瀏覽代碼

优化copy组件

1
mo 3 年之前
父節點
當前提交
eb00d86bba

+ 5 - 3
src/components/copy-text/index.vue

@@ -1,8 +1,10 @@
 <template>
   <span class="copyWrap">
-    <span class="copy" v-if="content" :style="{ width: width }">
-      <slot />
-    </span>
+    <el-tooltip effect="dark" placement="top" :content="content"  v-if="content">
+      <span class="copy" :style="{ width: width }">
+        <slot />
+      </span>
+    </el-tooltip>
     <i
       v-if="!!content"
       @click.stop="copyText"

+ 23 - 3
src/views/accompaniment/index.vue

@@ -25,6 +25,24 @@
             placeholder="伴奏编号/伴奏名称"
           />
         </el-form-item>
+        <el-form-item prop="organId">
+          <el-select
+            class="multiple"
+            v-model.trim="searchForm.organId"
+            filterable
+            multiple
+            collapse-tags
+            clearable
+            placeholder="请选择分部"
+          >
+            <el-option
+              v-for="(item, index) in selects.branchs"
+              :key="index"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item prop="type">
           <el-select
             v-model="searchForm.type"
@@ -64,7 +82,7 @@
             @change="changeCategor"
           ></el-cascader>
         </el-form-item>
-        <!-- <el-form-item
+        <el-form-item
           prop="subjectId"
         >
           <el-select v-model="searchForm.subjectId" clearable placeholder="请选择声部">
@@ -75,7 +93,7 @@
               :key="item.id"
             ></el-option>
           </el-select>
-        </el-form-item> -->
+        </el-form-item>
         <el-form-item prop="rankType">
           <el-select
             v-model="searchForm.rankType"
@@ -353,6 +371,7 @@ export default {
       this.searchForm.categoriesId = [params.categoriesId];
     }
     this.$store.dispatch("setSubjects");
+       this.$store.dispatch("setBranchs");
     await this.FetchTree();
     await this.FetchList();
 
@@ -367,9 +386,10 @@ export default {
     },
     async FetchList() {
       try {
-        let { categoriesId, ...search } = deepClone(this.searchForm);
+        let { categoriesId,organId, ...search } = deepClone(this.searchForm);
         const res = await QueryPage({
           ...search,
+          organId:organId.join(','),
           categoriesId:
             categoriesId && categoriesId.length > 0 ? categoriesId.pop() : null,
           page: this.rules.page,

+ 0 - 1
src/views/luckyDraw/trophyCreate.vue

@@ -219,7 +219,6 @@ export default {
           id: item.id,
         };
       });
-      console.log(arr);
       this.$set(this.form, "rewordList", arr);
       this.$forceUpdate();
     }

+ 36 - 19
src/views/teachManager/index.vue

@@ -11,6 +11,7 @@
         :model="searchForm"
         @submit="search"
         @reset="onReSet"
+        ref="searchForm"
       >
         <el-form-item prop="search">
           <el-input
@@ -20,6 +21,24 @@
             placeholder="教材编号、名称"
           ></el-input>
         </el-form-item>
+        <el-form-item prop="organId">
+          <el-select
+            class="multiple"
+            v-model.trim="searchForm.organId"
+            filterable
+            multiple
+            collapse-tags
+            clearable
+            placeholder="请选择分部"
+          >
+            <el-option
+              v-for="(item, index) in selects.branchs"
+              :key="index"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item prop="enable">
           <el-select
             v-model.trim="searchForm.enable"
@@ -56,16 +75,12 @@
             prop="name"
             label="教材名称"
           ></el-table-column>
-          <el-table-column
-            align="center"
-            prop="organNames"
-            label="可见分部"
-          >
-          <template slot-scope="scope">
-            <div>
-                 <overflow-text :text="scope.row.organNames"></overflow-text>
-            </div>
-          </template>
+          <el-table-column align="center" prop="organNames" label="可见分部">
+            <template slot-scope="scope">
+              <div>
+                <overflow-text :text="scope.row.organNames"></overflow-text>
+              </div>
+            </template>
           </el-table-column>
           <el-table-column
             align="center"
@@ -87,10 +102,10 @@
           <el-table-column align="center" prop="studentId" label="操作">
             <template slot-scope="scope">
               <div>
-                <auth
-                  auths="/accompaniment"
-                >
-                  <el-button type="text" @click="lookMusic(scope.row)">查看</el-button>
+                <auth auths="/accompaniment">
+                  <el-button type="text" @click="lookMusic(scope.row)"
+                    >查看</el-button
+                  >
                 </auth>
 
                 <auth auths="sysMusicScoreCategories/update">
@@ -196,7 +211,7 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     // 获取分部
-
+     this.$store.dispatch("setBranchs");
     this.init();
   },
   methods: {
@@ -204,9 +219,11 @@ export default {
       this.getList();
     },
     async getList() {
+      let {organId ,...rest} =  this.searchForm
       try {
         const res = await getSysMusicScoreList({
-          ...this.searchForm,
+          organId:organId.join(','),
+         ...rest,
           page: this.rules.page,
           rows: this.rules.limit,
         });
@@ -282,12 +299,12 @@ export default {
           console.log(e);
         });
     },
-    lookMusic(row){
-          this.$router.push({
+    lookMusic(row) {
+      this.$router.push({
         name: "accompaniment",
         params: { categoriesId: row.id },
       });
-    }
+    },
   },
 };
 </script>

+ 19 - 13
src/views/teamDetail/teamList.vue

@@ -57,7 +57,7 @@
         <el-form-item prop="cooperationOrganId">
           <el-select
             class="multiple"
-            :disabled="!topForm.orgin.length>0"
+            :disabled="!topForm.orgin.length > 0"
             v-model.trim="topForm.cooperationOrganId"
             filterable
             clearable
@@ -184,7 +184,9 @@
             label="乐团编号"
           >
             <template slot-scope="scope">
-              <copy-text>{{ scope.row.id }}</copy-text>
+              <copy-text>
+                {{ scope.row.id }}
+              </copy-text>
             </template>
           </el-table-column>
           <el-table-column
@@ -194,7 +196,9 @@
             label="乐团名称"
           >
             <template slot-scope="scope">
-              <copy-text>{{ scope.row.name }}</copy-text>
+              <p>
+                {{ scope.row.name }}
+              </p>
             </template>
           </el-table-column>
           <el-table-column
@@ -467,6 +471,7 @@ import closeStudens from "../teamBuild/modals/close-studens";
 import { getTimes } from "@/utils";
 import { Export } from "@/utils/downLoadFile";
 import { queryByOrganId } from "@/api/systemManage";
+import Tooltip from "@/components/Tooltip/index";
 export default {
   name: "teamList",
   data() {
@@ -483,7 +488,7 @@ export default {
         courseViewType: "",
         billTimer: [],
         createTimer: [],
-        cooperationOrganId:null
+        cooperationOrganId: null,
       },
       organList: [],
       typeList: [], // 收费类型
@@ -500,26 +505,27 @@ export default {
       passed: [], // 传递的参数
       showSteam: false,
       activeId: null,
-      cooperationList:[]
+      cooperationList: [],
     };
   },
   components: {
     pagination,
     teamSteam,
     closeStudens,
+    Tooltip,
   },
   mounted() {
     const { query } = this.$route;
     if (query.organId) {
-      this.topForm.orgin = []
-       this.topForm.orgin.push(query.organId)
+      this.topForm.orgin = [];
+      this.topForm.orgin.push(query.organId);
       // this.topForm.orgin = query.organId;
     }
     if (query.search) {
       this.topForm.search = query.search;
     }
-    if(this.topForm.orgin.length >0){
-      this.onBranchChange(this.topForm.orgin)
+    if (this.topForm.orgin.length > 0) {
+      this.onBranchChange(this.topForm.orgin);
     }
 
     this.init();
@@ -568,12 +574,12 @@ export default {
       getTeamList({
         rows: this.rules.limit,
         page: this.rules.page,
-        organId: this.topForm.orgin.join(','),
+        organId: this.topForm.orgin.join(","),
         chargeTypeId: this.topForm.payType || null,
         search: this.topForm.search || null,
         musicGroupStatus: this.topForm.status || null,
         courseViewType: this.topForm.courseViewType || null,
-        cooperationOrganId:this.topForm.cooperationOrganId || null,
+        cooperationOrganId: this.topForm.cooperationOrganId || null,
         searchType: this.$route.query.searchType,
         ...getTimes(
           createTimer,
@@ -1118,7 +1124,7 @@ export default {
       let { createTimer, billTimer, ...reset } = this.topForm;
       let obj = {
         ...reset,
-        organId: this.topForm.orgin.join(',') || null,
+        organId: this.topForm.orgin.join(",") || null,
         ...getTimes(
           createTimer,
           ["createStartDate", "createEndDate"],
@@ -1144,7 +1150,7 @@ export default {
         return;
       }
       // 合作单位
-      await queryByOrganId({ organId: value.join(',') }).then((res) => {
+      await queryByOrganId({ organId: value.join(",") }).then((res) => {
         if (res.code == 200) {
           this.cooperationList = res.data;
           this.topForm.cooperationOrganId = null;