From c482628d3daf21dafba7e2b9eaba6e46ffda0fdb Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期四, 27 二月 2025 20:11:14 +0800 Subject: [PATCH] 首页跳转bug --- src/views/system/dept/index.vue | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index e502b4e..e9a2cdb 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -56,7 +56,7 @@ :default-expand-all="isExpandAll" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" > - <el-table-column prop="deptName" label="閮ㄩ棬鍚嶇О" width="260"></el-table-column> + <el-table-column prop="deptName" label="閮ㄩ棬鍚嶇О" width="500"></el-table-column> <el-table-column prop="orderNum" label="鎺掑簭" width="200"></el-table-column> <el-table-column prop="status" label="鐘舵��" width="100"> <template slot-scope="scope"> @@ -100,7 +100,7 @@ <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-row> - <el-col :span="24" v-if="form.parentId !== 0"> + <el-col :span="24"> <el-form-item label="涓婄骇閮ㄩ棬" prop="parentId"> <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="閫夋嫨涓婄骇閮ㄩ棬" /> </el-form-item> @@ -193,9 +193,9 @@ form: {}, // 琛ㄥ崟鏍¢獙 rules: { - parentId: [ - { required: true, message: "涓婄骇閮ㄩ棬涓嶈兘涓虹┖", trigger: "blur" } - ], + // parentId: [ + // { required: true, message: "涓婄骇閮ㄩ棬涓嶈兘涓虹┖", trigger: "blur" } + // ], deptName: [ { required: true, message: "閮ㄩ棬鍚嶇О涓嶈兘涓虹┖", trigger: "blur" } ], @@ -226,10 +226,12 @@ /** 鏌ヨ閮ㄩ棬鍒楄〃 */ getList() { this.loading = true; + console.log(this.queryParams, "dddddd") listDept(this.queryParams).then(response => { this.deptList = this.handleTree(response.data, "deptId"); this.loading = false; }); + }, /** 杞崲閮ㄩ棬鏁版嵁缁撴瀯 */ normalizer(node) { @@ -303,6 +305,13 @@ const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] }; this.deptOptions.push(noResultsOptions); } + if (row.parentId === 0) { + this.deptOptions.push({ + deptId: 0, + deptName: '鏃�', + children: [] + }); + } }); }); }, -- Gitblit v1.8.0