zengyicheng 3 years ago
parent
commit
2db2e28233
4 changed files with 79 additions and 13 deletions
  1. 7 1
      src/App.vue
  2. 52 0
      src/components/pages/course.vue
  3. 11 12
      src/components/pages/data.vue
  4. 9 0
      src/components/pages/library.vue

+ 7 - 1
src/App.vue

@@ -1,5 +1,5 @@
 <template>
-	<div id="app">
+	<div id="app" :class="{appNoWidth:$route.path == '/data'}">
 		<!-- <div class="app_head" :class="{stuWidth:$route.path == '/student'}"> -->
 		<!-- <div class="logo" @click="goTo('/course')"></div>
       <span style="margin-left: 10px; color: #fff; font-weight: 600" @click="goTo('/course')"
@@ -200,6 +200,12 @@
 		/* min-width: 1380px; */
 		min-width: 1250px;
 	}
+	
+	.appNoWidth{
+		min-width: unset !important;
+		display: inline-block !important;
+	}
+
 	.app_head {
 		height: 67.5px;
 		width: 100%;

+ 52 - 0
src/components/pages/course.vue

@@ -20,6 +20,16 @@
             <el-option value="1" label="他人课程"></el-option>
           </el-select>
         </div>
+        <div class="head_left">
+          <el-input
+            v-model="courseName"
+            class="student_input"
+            placeholder="请输入课程名称"
+          ></el-input>
+          <el-button class="course_button" @click="searchCourse"
+            >查询</el-button
+          >
+        </div>
       </div>
       <div class="student_table">
         <div class="course_box">
@@ -132,6 +142,7 @@ export default {
       groupA: "0",
       classX: "",
       course: [],
+      courseName:"",
       mr: require("../../assets/icon/kc1.png"),
     };
   },
@@ -230,6 +241,10 @@ export default {
         }
       }
     },
+    searchCourse(){
+      this.page = 1;
+      this.searchCourse();
+    },
     getCourse() {
       const loading = this.openLoading(
         document.querySelector(".student_table")
@@ -254,6 +269,25 @@ export default {
           console.error(err);
         });
     },
+    searchCourse(){
+      this.isLoading = true;
+      let params = {
+        cu: "",
+        cn: this.courseName,
+        page: this.page,
+      };
+      this.ajax
+        .get(this.$store.state.api + "searchCourse", params)
+        .then((res) => {
+          this.isLoading = false;
+          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+          this.course = res.data[0];
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
     deleteCourse(cid) {
       const loading = this.openLoading(
         document.querySelector(".student_table")
@@ -539,4 +573,22 @@ export default {
 .three_bottom > div:hover {
   color: #79a2ff;
 }
+.head_left {
+  display: flex;
+}
+.student_input >>> .el-input__inner {
+  height: 40px;
+  width: 190px;
+  font-size: 13px;
+  padding: 0 10px;
+}
+.course_button {
+  color: #fff;
+  background: #2268bc;
+  width: 75px;
+  height: 40px;
+  padding: 0 !important;
+  font-size: 12px;
+  line-height: 40px;
+}
 </style>

+ 11 - 12
src/components/pages/data.vue

@@ -1,15 +1,10 @@
 <template>
-  <div class="pb_content">
-    <div class="pb_content_body" style="position: relative; width: 95%">
-      <div
-        style="
-          width: 25%;
-          position: absolute;
-          left: 50%;
-          top: 0;
-          transform: translate(-50%, 30%);
-        "
-      >
+  <div
+    class="pb_content"
+    style="width: 100%; max-width: 745px; height: 100%;"
+  >
+    <div class="pb_content_body" style="position: relative; width: 100%">
+      <div style="width: 55%; margin: 0 auto">
         <div class="formTop">
           <div class="tx">
             <img
@@ -232,7 +227,11 @@ export default {
   display: flex;
   align-items: center;
   justify-content: center;
-  margin-bottom: 20px;
+  margin: 20px 0;
+  padding-top: 35px;
+}
+.formTop >>> .el-form {
+  margin: 0 auto;
 }
 .tx {
   width: 100px;

+ 9 - 0
src/components/pages/library.vue

@@ -440,6 +440,10 @@ export default {
   position: relative;
 }
 
+.tup:hover .deleteWord{
+  display: block;
+}
+
 .deleteWord {
   width: 25px;
   height: 25px;
@@ -447,8 +451,10 @@ export default {
   right: -25px;
   top: -10px;
   cursor: pointer;
+  display: none;
 }
 
+
 .tup > img,
 .deleteWord > img {
   width: 100%;
@@ -494,4 +500,7 @@ export default {
   display: flex;
   justify-content: space-between;
 }
+.student_page {
+  margin-top: 30px;
+}
 </style>