From cb80de3742d66cfee20bc3136c735e5ca5a7d45c Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期三, 29 十一月 2023 12:44:42 +0800 Subject: [PATCH] 优化字典标签支持自定义分隔符 --- src/views/system/dept/index.vue | 43 +++++++++++++++---------------------------- 1 files changed, 15 insertions(+), 28 deletions(-) diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 090384e..889867d 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -6,11 +6,12 @@ v-model="queryParams.deptName" placeholder="璇疯緭鍏ラ儴闂ㄥ悕绉�" clearable + style="width: 200px" @keyup.enter="handleQuery" /> </el-form-item> <el-form-item label="鐘舵��" prop="status"> - <el-select v-model="queryParams.status" placeholder="閮ㄩ棬鐘舵��" clearable> + <el-select v-model="queryParams.status" placeholder="閮ㄩ棬鐘舵��" clearable style="width: 200px"> <el-option v-for="dict in sys_normal_disable" :key="dict.value" @@ -68,25 +69,9 @@ </el-table-column> <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> <template #default="scope"> - <el-button - type="text" - icon="Edit" - @click="handleUpdate(scope.row)" - v-hasPermi="['system:dept:edit']" - >淇敼</el-button> - <el-button - type="text" - icon="Plus" - @click="handleAdd(scope.row)" - v-hasPermi="['system:dept:add']" - >鏂板</el-button> - <el-button - v-if="scope.row.parentId != 0" - type="text" - icon="Delete" - @click="handleDelete(scope.row)" - v-hasPermi="['system:dept:remove']" - >鍒犻櫎</el-button> + <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dept:edit']">淇敼</el-button> + <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:dept:add']">鏂板</el-button> + <el-button v-if="scope.row.parentId != 0" link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dept:remove']">鍒犻櫎</el-button> </template> </el-table-column> </el-table> @@ -97,11 +82,13 @@ <el-row> <el-col :span="24" v-if="form.parentId !== 0"> <el-form-item label="涓婄骇閮ㄩ棬" prop="parentId"> - <tree-select - v-model:value="form.parentId" - :options="deptOptions" - :objMap="{ value: 'deptId', label: 'deptName', children: 'children' }" + <el-tree-select + v-model="form.parentId" + :data="deptOptions" + :props="{ value: 'deptId', label: 'deptName', children: 'children' }" + value-key="deptId" placeholder="閫夋嫨涓婄骇閮ㄩ棬" + check-strictly /> </el-form-item> </el-col> @@ -222,9 +209,9 @@ handleQuery(); } /** 鏂板鎸夐挳鎿嶄綔 */ -async function handleAdd(row) { +function handleAdd(row) { reset(); - await listDept().then(response => { + listDept().then(response => { deptOptions.value = proxy.handleTree(response.data, "deptId"); }); if (row != undefined) { @@ -242,9 +229,9 @@ }); } /** 淇敼鎸夐挳鎿嶄綔 */ -async function handleUpdate(row) { +function handleUpdate(row) { reset(); - await listDeptExcludeChild(row.deptId).then(response => { + listDeptExcludeChild(row.deptId).then(response => { deptOptions.value = proxy.handleTree(response.data, "deptId"); }); getDept(row.deptId).then(response => { -- Gitblit v1.9.3