|
@@ -30,7 +30,7 @@ const props = defineProps({
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
-watch(
|
|
|
|
|
|
+watch?.(
|
|
() => props.typeCode,
|
|
() => props.typeCode,
|
|
(newVal: string) => {
|
|
(newVal: string) => {
|
|
queryParams.dictCode = newVal;
|
|
queryParams.dictCode = newVal;
|
|
@@ -89,7 +89,6 @@ function handleQuery() {
|
|
* 重置查询
|
|
* 重置查询
|
|
*/
|
|
*/
|
|
function resetQuery() {
|
|
function resetQuery() {
|
|
- queryFormRef.value.resetFields();
|
|
|
|
queryParams.pageNo = 1;
|
|
queryParams.pageNo = 1;
|
|
handleQuery();
|
|
handleQuery();
|
|
}
|
|
}
|
|
@@ -115,6 +114,8 @@ function openDialog(form?: any) {
|
|
Object.assign(formData, form);
|
|
Object.assign(formData, form);
|
|
} else {
|
|
} else {
|
|
dialog.title = "新增字典";
|
|
dialog.title = "新增字典";
|
|
|
|
+ dataFormRef.label = ''
|
|
|
|
+ dataFormRef.value = ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -162,7 +163,7 @@ function resetForm() {
|
|
dataFormRef.value.clearValidate();
|
|
dataFormRef.value.clearValidate();
|
|
|
|
|
|
formData.id = undefined;
|
|
formData.id = undefined;
|
|
- formData.state = 1;
|
|
|
|
|
|
+ formData.state = 0;
|
|
formData.dictSort = 1;
|
|
formData.dictSort = 1;
|
|
formData.dictCode = props.typeCode;
|
|
formData.dictCode = props.typeCode;
|
|
}
|
|
}
|
|
@@ -191,15 +192,15 @@ function handleDelete(dictId?: string) {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
|
|
+onMounted?.(() => {
|
|
handleQuery();
|
|
handleQuery();
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
- <div class="search-container">
|
|
|
|
- <!-- 搜索表单 -->
|
|
|
|
|
|
+<!-- <div class="search-container">
|
|
|
|
+ <!– 搜索表单 –>
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
<el-form-item label="关键字" prop="name">
|
|
<el-form-item label="关键字" prop="name">
|
|
<el-input
|
|
<el-input
|
|
@@ -215,7 +216,7 @@ onMounted(() => {
|
|
<el-button @click="resetQuery"> <i-ep-refresh />重置</el-button>
|
|
<el-button @click="resetQuery"> <i-ep-refresh />重置</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- </div>
|
|
|
|
|
|
+ </div>-->
|
|
<el-card shadow="never">
|
|
<el-card shadow="never">
|
|
<template #header>
|
|
<template #header>
|
|
<el-button
|
|
<el-button
|
|
@@ -224,13 +225,13 @@ onMounted(() => {
|
|
@click="openDialog()"
|
|
@click="openDialog()"
|
|
><i-ep-plus />新增</el-button
|
|
><i-ep-plus />新增</el-button
|
|
>
|
|
>
|
|
- <el-button
|
|
|
|
|
|
+<!-- <el-button
|
|
v-hasPerm="[ButtonPermKeys.SYSTEM.BTNS.dict_del]"
|
|
v-hasPerm="[ButtonPermKeys.SYSTEM.BTNS.dict_del]"
|
|
type="danger"
|
|
type="danger"
|
|
:disabled="ids.length === 0"
|
|
:disabled="ids.length === 0"
|
|
@click="handleDelete()"
|
|
@click="handleDelete()"
|
|
><i-ep-delete />删除</el-button
|
|
><i-ep-delete />删除</el-button
|
|
- >
|
|
|
|
|
|
+ >-->
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<!-- 数据表格 -->
|
|
<!-- 数据表格 -->
|
|
@@ -259,13 +260,13 @@ onMounted(() => {
|
|
@click="openDialog(scope.row)"
|
|
@click="openDialog(scope.row)"
|
|
><i-ep-edit />编辑</el-button
|
|
><i-ep-edit />编辑</el-button
|
|
>
|
|
>
|
|
- <el-button
|
|
|
|
|
|
+<!-- <el-button
|
|
v-hasPerm="[ButtonPermKeys.SYSTEM.BTNS.dict_del]"
|
|
v-hasPerm="[ButtonPermKeys.SYSTEM.BTNS.dict_del]"
|
|
type="primary"
|
|
type="primary"
|
|
link
|
|
link
|
|
@click.stop="handleDelete(scope.row.id)"
|
|
@click.stop="handleDelete(scope.row.id)"
|
|
><i-ep-delete />删除</el-button
|
|
><i-ep-delete />删除</el-button
|
|
- >
|
|
|
|
|
|
+ >-->
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -296,7 +297,8 @@ onMounted(() => {
|
|
<el-input v-model="formData.dictLabel" placeholder="请输入字典名称" />
|
|
<el-input v-model="formData.dictLabel" placeholder="请输入字典名称" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="字典值" prop="dictValue">
|
|
<el-form-item label="字典值" prop="dictValue">
|
|
- <el-input v-model="formData.dictValue" placeholder="字典值" />
|
|
|
|
|
|
+ <el-input v-if="formData.id" disabled v-model="formData.dictValue" placeholder="字典值" />
|
|
|
|
+ <el-input v-if="!formData.id" v-model="formData.dictValue" placeholder="字典值" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="排序" prop="dictSort">
|
|
<el-form-item label="排序" prop="dictSort">
|