From 42c1ea3c89c3bc335c19eb33f9a9b352e2807d15 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期二, 01 四月 2025 19:14:59 +0800 Subject: [PATCH] 添加新群号:287842588 --- src/views/system/dict/index.vue | 31 +++++++++++++++++-------------- 1 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 1e54c29..ead773b 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -123,20 +123,10 @@ <span>{{ parseTime(scope.row.createTime) }}</span> </template> </el-table-column> - <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <el-table-column label="鎿嶄綔" align="center" width="160" class-name="small-padding fixed-width"> <template #default="scope"> - <el-button - type="text" - icon="Edit" - @click="handleUpdate(scope.row)" - v-hasPermi="['system:dict:edit']" - >淇敼</el-button> - <el-button - type="text" - icon="Delete" - @click="handleDelete(scope.row)" - v-hasPermi="['system:dict:remove']" - >鍒犻櫎</el-button> + <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">淇敼</el-button> + <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">鍒犻櫎</el-button> </template> </el-table-column> </el-table> @@ -163,7 +153,7 @@ <el-radio v-for="dict in sys_normal_disable" :key="dict.value" - :label="dict.value" + :value="dict.value" >{{ dict.label }}</el-radio> </el-radio-group> </el-form-item> @@ -182,6 +172,7 @@ </template> <script setup name="Dict"> +import useDictStore from '@/store/modules/dict' import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type"; const { proxy } = getCurrentInstance(); @@ -224,11 +215,13 @@ loading.value = false; }); } + /** 鍙栨秷鎸夐挳 */ function cancel() { open.value = false; reset(); } + /** 琛ㄥ崟閲嶇疆 */ function reset() { form.value = { @@ -240,29 +233,34 @@ }; proxy.resetForm("dictRef"); } + /** 鎼滅储鎸夐挳鎿嶄綔 */ function handleQuery() { queryParams.value.pageNum = 1; getList(); } + /** 閲嶇疆鎸夐挳鎿嶄綔 */ function resetQuery() { dateRange.value = []; proxy.resetForm("queryRef"); handleQuery(); } + /** 鏂板鎸夐挳鎿嶄綔 */ function handleAdd() { reset(); open.value = true; title.value = "娣诲姞瀛楀吀绫诲瀷"; } + /** 澶氶�夋閫変腑鏁版嵁 */ function handleSelectionChange(selection) { ids.value = selection.map(item => item.dictId); single.value = selection.length != 1; multiple.value = !selection.length; } + /** 淇敼鎸夐挳鎿嶄綔 */ function handleUpdate(row) { reset(); @@ -273,6 +271,7 @@ title.value = "淇敼瀛楀吀绫诲瀷"; }); } + /** 鎻愪氦鎸夐挳 */ function submitForm() { proxy.$refs["dictRef"].validate(valid => { @@ -293,6 +292,7 @@ } }); } + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ function handleDelete(row) { const dictIds = row.dictId || ids.value; @@ -303,16 +303,19 @@ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }).catch(() => {}); } + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ function handleExport() { proxy.download("system/dict/type/export", { ...queryParams.value }, `dict_${new Date().getTime()}.xlsx`); } + /** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */ function handleRefreshCache() { refreshCache().then(() => { proxy.$modal.msgSuccess("鍒锋柊鎴愬姛"); + useDictStore().cleanDict(); }); } -- Gitblit v1.9.3