Explorar o código

修改显示问题

lex-xin %!s(int64=5) %!d(string=hai) anos
pai
achega
026d1f543c

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/index.html


+ 1 - 1
dist/static/css/chunk-2e165b2d.ea5d3645.css → dist/static/css/chunk-5f40cf2e.24f80988.css

@@ -1 +1 @@
-.pagination-container[data-v-31cb099a]{background:#fff;padding:32px 16px;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.pagination-container.hidden[data-v-31cb099a]{display:none}.el-button--primary[data-v-3d9b6769],.el-button--primary[data-v-3d9b6769]:active,.el-button--primary[data-v-3d9b6769]:focus,.el-button--primary[data-v-3d9b6769]:hover{background:#14928a;border-color:#14928a;color:#fff}[data-v-3d9b6769] .el-date-editor.el-input,[data-v-3d9b6769] .el-select{width:100%!important}[data-v-3d9b6769] .el-table .cell{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:3;-webkit-box-orient:vertical}[data-v-3d9b6769] .el-dialog__body{padding:10px 20px}
+.pagination-container[data-v-31cb099a]{background:#fff;padding:32px 16px;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.pagination-container.hidden[data-v-31cb099a]{display:none}.el-button--primary[data-v-0a7f6c42],.el-button--primary[data-v-0a7f6c42]:active,.el-button--primary[data-v-0a7f6c42]:focus,.el-button--primary[data-v-0a7f6c42]:hover{background:#14928a;border-color:#14928a;color:#fff}[data-v-0a7f6c42] .el-date-editor.el-input,[data-v-0a7f6c42] .el-select{width:100%!important}[data-v-0a7f6c42] .el-table .cell{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:3;-webkit-box-orient:vertical}[data-v-0a7f6c42] .el-dialog__body{padding:10px 20px}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/app.4df4b380.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/chunk-2e165b2d.23456ad2.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/chunk-5f40cf2e.beb95049.js


+ 44 - 11
src/views/helpCenter/helpContent.vue

@@ -9,7 +9,7 @@
       <!-- 搜索标题 -->
       <el-form :inline="true" class="searchForm" v-model.trim="searchForm">
         <el-form-item prop="hasPracticeCourse">
-          <el-cascader
+          <el-cascader ref="cascader"
             :show-all-levels="false"
             :options="treeList"
             v-model="searchForm.catalogId"
@@ -57,6 +57,7 @@
         <el-form-item label="分类" prop="catalogId" :label-width="formLabelWidth">
           <el-cascader style="width: 100%;"
             :show-all-levels="false"
+            ref="formCascader"
             :options="treeList"
             v-model="form.catalogId"
             :props="{ checkStrictly: true }"
@@ -121,7 +122,8 @@ export default {
         page: 1, // 当前页
         total: 0, // 总条数
         page_size: [10, 20, 40, 50] // 选择限制显示条数
-      }
+      },
+      tempTreeList: []
     };
   },
   activated() {
@@ -154,7 +156,7 @@ export default {
             let params = {
               title: this.form.title, // 标题
               content: this.form.content, // 内容
-              catalogId: this.form.catalogId[0], // 分类编号
+              catalogId: this.form.catalogId[this.form.catalogId.length - 1], // 分类编号
             }
             helpCenterContentModify(params).then(res => {
               this.messageTips("添加", res);
@@ -175,7 +177,6 @@ export default {
         }
       });
     },
-
     messageTips(title, res) {
       if (res.code == 200) {
         this.$message.success(title + "成功");
@@ -220,6 +221,7 @@ export default {
         tempList = {
           value: res.id,
           label: res.text,
+          parentId: res.parentId
         }
         if (res.children && res.children.length > 0) {
           tempList.children = this.setTableData(res.children)
@@ -229,25 +231,56 @@ export default {
       return list
     },
     openTypes(type, row) {
-      this.typeStatus = true;
-      this.formActionTitle = type;
+      this.typeStatus = true
+      this.formActionTitle = type
       if (type == "update") {
         // 修改的时候赋值
-        console.log(row)
         this.form = {
           id: row.id,
           title: row.title, // 标题
           content: row.content, // 内容
-          catalogId: [row.catalogId], // 分类编号
+          catalogId: this.getAllIds(row), // 分类编号
         };
       }
     },
+    getAllIds(row) {
+      let idAndParent=[];// idAndParent保存 Tree所有节点的id和parentId
+      this.getIdAndParent(this.treeList,idAndParent);	
+      let parentIds = []; // 用于保存选中节点的父节点及父节点的父节点
+      this.getId(row.catalogId, parentIds, idAndParent);
+      return parentIds.reverse(); //反转数组
+    },
+    getIdAndParent(tree, idAndParentIds) {// idAndParentIds用来保存所有节点的id,parentId
+			// 对原有的数据结构进行遍历,拿出所有节点的id,parentId到一个一维数组中。
+			tree.forEach(item => {
+				let mid = {
+					id: item.value,
+					parentId: item.parentId,
+				};
+				idAndParentIds.push(mid);
+				if (item.children) {
+					this.getIdAndParent(item.children, idAndParentIds);
+				}
+			});
+		},
+    getId(id, parentIds, idAndParent) {
+			idAndParent.forEach(item => {
+				if (item.id == id) {
+					parentIds.push(id);
+					if (item.parentId != -1) {
+						this.getId(item.parentId, parentIds, idAndParent);
+					}
+				}
+			});
+    },
     onFormClose(formName) {
       // 关闭弹窗重置验证
       this.form = {
-        name: null, // 作业模块名称
-        subjectIds: []
-      };
+        title: null, // 标题
+        content: null, // 内容
+        catalogId: [], // 分类编号
+      }
+      this.$refs.cascader.handleClear()
       this.$refs[formName].resetFields();
     }
   }

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio