浏览代码

优化:点击分类管理名称自动跳转搜索文件管理分类名称

zhangfu 3 年之前
父节点
当前提交
fa7579515b
共有 4 个文件被更改,包括 45 次插入21 次删除
  1. 8 1
      src/assets/styles/element.less
  2. 22 13
      src/pages/classification/index.vue
  3. 10 6
      src/pages/fileManagement/index.vue
  4. 5 1
      src/store/index.js

+ 8 - 1
src/assets/styles/element.less

@@ -393,7 +393,14 @@ input[maxlength='32']:not([disabled]) {
 .el-pagination.is-background .el-pager li:not(.active):hover {
   color: #F4453E;
 }
-
+.a_link{
+  &:hover{
+    color: #F4453E;
+    border-bottom:1px solid #F4453E;
+  }
+  cursor:pointer
+  
+}
 // maxlength 
 .maxlength-input {
   .el-input__inner {

+ 22 - 13
src/pages/classification/index.vue

@@ -67,27 +67,29 @@
           prop="name"
           align="center"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            <a class="a_link" @click="classificaName(scope.row)" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
+              {{ scope.row.name }}
+            </a>
+          </template>
+        </el-table-column>
         <el-table-column
           label="链接地址"
           prop="linkUrl"
           align="center"
           min-width="180"
         ></el-table-column>
-        <el-table-column
-          label="禁用/启用"
-          prop="status"
-          align="center"
-        >
+        <el-table-column label="禁用/启用" prop="status" align="center">
           <template slot-scope="scope">
             <div>
-                <el-switch
-                  v-model="scope.row.status"
-                  active-color="#17A8FF"
-                  inactive-color="#AFAFAF"
-                  @change="switchChange($event, scope.row)"
-                >
-                </el-switch>
+              <el-switch
+                v-model="scope.row.status"
+                active-color="#17A8FF"
+                inactive-color="#AFAFAF"
+                @change="switchChange($event, scope.row)"
+              >
+              </el-switch>
             </div> </template
         ></el-table-column>
         <el-table-column
@@ -164,6 +166,13 @@ export default {
   },
   methods: {
     /**
+     * @method 点击名称跳转文件管理
+     **/
+    classificaName(val) {
+      this.$store.commit('getClassificName', val)
+      this.$router.push('/fileManagement')
+    },
+    /**
      * @method 重置
      * **/
     resetForm(formName) {

+ 10 - 6
src/pages/fileManagement/index.vue

@@ -103,11 +103,7 @@
           align="center"
           min-width="180"
         ></el-table-column>
-        <el-table-column
-          label="禁用/启用"
-          prop="status"
-          align="center"
-        >
+        <el-table-column label="禁用/启用" prop="status" align="center">
           <template slot-scope="scope">
             <div>
               <div>
@@ -189,7 +185,8 @@ export default {
       },
       classifyList: [],
       screenHeight: document.body.clientHeight - 320,
-      tableDataheight: 0
+      tableDataheight: 0,
+      getClassificName: this.$store.state.classificName
     }
   },
   mounted() {
@@ -199,6 +196,13 @@ export default {
         this.screenHeight = document.body.clientHeight - 320
       })()
     }
+    if (this.getClassificName) {
+      this.visbleChange(true)
+      this.form.typeId = this.getClassificName.typeId
+      this.$store.commit('getClassificName', '')
+    } else {
+      this.form.typeId = ''
+    }
     this.listDataInit()
   },
   methods: {

+ 5 - 1
src/store/index.js

@@ -12,7 +12,8 @@ const store = new Vuex.Store({
         authRoutes: [],
         isCollapse: '',
         stepsActiveListData: [],
-        stepsActiveListDataBarcode: []
+        stepsActiveListDataBarcode: [],
+        classificName:''
       },
   mutations: {
     getRoutesPermission(state, val) {
@@ -35,6 +36,9 @@ const store = new Vuex.Store({
     },
     getStepsActiveListDataBarcode(state, val) {
       state.stepsActiveListDataBarcode = val
+    },
+    getClassificName(state,val){
+      state.classificName = val
     }
   },
   actions: {},