From 6666ce5526b1ed17f5c3906c94620cad586745a5 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期五, 28 六月 2024 17:01:39 +0800 Subject: [PATCH] 优化代码 --- src/views/system/dept/index.vue | 31 ++++++++++++------------------- 1 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 1b2dc44..b483acd 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -69,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> @@ -196,11 +180,13 @@ loading.value = false; }); } + /** 鍙栨秷鎸夐挳 */ function cancel() { open.value = false; reset(); } + /** 琛ㄥ崟閲嶇疆 */ function reset() { form.value = { @@ -215,15 +201,18 @@ }; proxy.resetForm("deptRef"); } + /** 鎼滅储鎸夐挳鎿嶄綔 */ function handleQuery() { getList(); } + /** 閲嶇疆鎸夐挳鎿嶄綔 */ function resetQuery() { proxy.resetForm("queryRef"); handleQuery(); } + /** 鏂板鎸夐挳鎿嶄綔 */ function handleAdd(row) { reset(); @@ -236,6 +225,7 @@ open.value = true; title.value = "娣诲姞閮ㄩ棬"; } + /** 灞曞紑/鎶樺彔鎿嶄綔 */ function toggleExpandAll() { refreshTable.value = false; @@ -244,6 +234,7 @@ refreshTable.value = true; }); } + /** 淇敼鎸夐挳鎿嶄綔 */ function handleUpdate(row) { reset(); @@ -256,6 +247,7 @@ title.value = "淇敼閮ㄩ棬"; }); } + /** 鎻愪氦鎸夐挳 */ function submitForm() { proxy.$refs["deptRef"].validate(valid => { @@ -276,6 +268,7 @@ } }); } + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ function handleDelete(row) { proxy.$modal.confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.deptName + '"鐨勬暟鎹」?').then(function() { -- Gitblit v1.9.3