|
@@ -7,7 +7,8 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="字典标签:" prop="dictLabel">
|
|
|
- <el-input v-model="queryParams.dictLabel" placeholder="请输入字典标签" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
|
|
+ <el-input v-model="queryParams.dictLabel" 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 style="width: 200px">
|
|
@@ -21,7 +22,8 @@
|
|
|
</el-form>
|
|
|
<div class="list-btns-container">
|
|
|
<el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['system:dict:add']">新增</el-button>
|
|
|
- <el-button type="danger" icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:dict:remove']">删除</el-button>
|
|
|
+ <el-button type="danger" icon="Delete" :disabled="multiple" @click="handleDelete"
|
|
|
+ v-hasPermi="['system:dict:remove']">删除</el-button>
|
|
|
<el-button type="warning" icon="Download" @click="handleExport" v-hasPermi="['system:dict:export']">导出</el-button>
|
|
|
<el-button type="danger" icon="Close" @click="handleClose">关闭</el-button>
|
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
@@ -33,8 +35,10 @@
|
|
|
<el-table-column label="字典编码" width="100" align="center" prop="dictCode" />
|
|
|
<el-table-column label="字典标签" width="100" align="center" prop="dictLabel">
|
|
|
<template #default="scope">
|
|
|
- <span v-if="scope.row.listClass == '' || scope.row.listClass == 'default'">{{ scope.row.dictLabel }}</span>
|
|
|
- <el-tag v-else :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass">{{ scope.row.dictLabel }}</el-tag>
|
|
|
+ <span v-if="scope.row.listClass == '' || scope.row.listClass == 'default'">{{ scope.row.dictLabel
|
|
|
+ }}</span>
|
|
|
+ <el-tag v-else :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass">{{ scope.row.dictLabel
|
|
|
+ }}</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="字典键值" width="200" align="center" prop="dictValue" />
|
|
@@ -52,14 +56,17 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" width="150">
|
|
|
<template #default="scope">
|
|
|
- <el-button link type="warning" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">编辑</el-button>
|
|
|
- <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button>
|
|
|
+ <el-button link type="warning" icon="Edit" @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['system:dict:edit']">编辑</el-button>
|
|
|
+ <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['system:dict:remove']">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
+ <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
|
<!-- 添加或修改参数配置对话框 -->
|
|
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body draggable>
|
|
@@ -82,17 +89,14 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="回显样式" prop="listClass">
|
|
|
<el-select v-model="form.listClass">
|
|
|
- <el-option
|
|
|
- v-for="item in listClassOptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label + '(' + item.value + ')'"
|
|
|
- :value="item.value"
|
|
|
- ></el-option>
|
|
|
+ <el-option v-for="item in listClassOptions" :key="item.value" :label="item.label + '(' + item.value + ')'"
|
|
|
+ :value="item.value"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
<el-radio-group v-model="form.status">
|
|
|
- <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
|
|
|
+ <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label
|
|
|
+ }}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注" prop="remark">
|
|
@@ -113,6 +117,7 @@
|
|
|
<script setup name="Data">
|
|
|
import useDictStore from '@/store/modules/dict'
|
|
|
import { optionselect as getDictOptionselect, getType } from '@/api/system/dict/type'
|
|
|
+import { refreshCache } from '@/api/system/dict/type'
|
|
|
import { listData, getData, delData, addData, updateData } from '@/api/system/dict/data'
|
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
@@ -252,6 +257,7 @@ function submitForm() {
|
|
|
proxy.$modal.msgSuccess('修改成功')
|
|
|
open.value = false
|
|
|
getList()
|
|
|
+ handleRefreshCache()
|
|
|
})
|
|
|
} else {
|
|
|
addData(form.value).then((response) => {
|
|
@@ -259,6 +265,7 @@ function submitForm() {
|
|
|
proxy.$modal.msgSuccess('新增成功')
|
|
|
open.value = false
|
|
|
getList()
|
|
|
+ handleRefreshCache()
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -276,8 +283,9 @@ function handleDelete(row) {
|
|
|
getList()
|
|
|
proxy.$modal.msgSuccess('删除成功')
|
|
|
useDictStore().removeDict(queryParams.value.dictType)
|
|
|
+ handleRefreshCache()
|
|
|
})
|
|
|
- .catch(() => {})
|
|
|
+ .catch(() => { })
|
|
|
}
|
|
|
/** 导出按钮操作 */
|
|
|
function handleExport() {
|
|
@@ -290,6 +298,13 @@ function handleExport() {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
+function handleRefreshCache() {
|
|
|
+ refreshCache().then(() => {
|
|
|
+ proxy.$modal.msgSuccess('刷新成功')
|
|
|
+ useDictStore().cleanDict()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
getTypes(route.params && route.params.dictId)
|
|
|
getTypeList()
|
|
|
</script>
|