字典修复
This commit is contained in:
parent
df639d040a
commit
f34bff1406
|
|
@ -85,6 +85,19 @@ export const constantRoutes = [
|
||||||
meta: { title: '个人中心', icon: 'user' }
|
meta: { title: '个人中心', icon: 'user' }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/system/dict/data',
|
||||||
|
component: Layout,
|
||||||
|
hidden: true,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'index/:dictId?',
|
||||||
|
component: () => import('@/views/system/dict/data.vue'),
|
||||||
|
name: 'DictData',
|
||||||
|
meta: { title: '字典数据', activeMenu: '/system/dict' }
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
// 业务路由(订单管理、系统管理等)将从后端动态获取
|
// 业务路由(订单管理、系统管理等)将从后端动态获取
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -193,6 +193,7 @@ const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const title = ref("");
|
const title = ref("");
|
||||||
const defaultDictType = ref("");
|
const defaultDictType = ref("");
|
||||||
|
const currentDictId = ref("");
|
||||||
const typeOptions = ref([]);
|
const typeOptions = ref([]);
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
// 数据标签回显样式
|
// 数据标签回显样式
|
||||||
|
|
@ -225,6 +226,12 @@ const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
/** 查询字典类型详细 */
|
/** 查询字典类型详细 */
|
||||||
function getTypes(dictId) {
|
function getTypes(dictId) {
|
||||||
|
if (!dictId) {
|
||||||
|
queryParams.value.dictType = undefined;
|
||||||
|
defaultDictType.value = "";
|
||||||
|
getList();
|
||||||
|
return;
|
||||||
|
}
|
||||||
getType(dictId).then(response => {
|
getType(dictId).then(response => {
|
||||||
queryParams.value.dictType = response.data.dictType;
|
queryParams.value.dictType = response.data.dictType;
|
||||||
defaultDictType.value = response.data.dictType;
|
defaultDictType.value = response.data.dictType;
|
||||||
|
|
@ -357,6 +364,16 @@ function handleExport() {
|
||||||
}, `dict_data_${new Date().getTime()}.xlsx`);
|
}, `dict_data_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
|
|
||||||
getTypes(route.params && route.params.dictId);
|
watch(
|
||||||
|
() => [route.params?.dictId, route.query?.dictId],
|
||||||
|
([newParam, newQuery]) => {
|
||||||
|
const nextDictId = newParam ?? newQuery ?? "";
|
||||||
|
if (nextDictId === currentDictId.value) return;
|
||||||
|
currentDictId.value = nextDictId;
|
||||||
|
getTypes(nextDictId);
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
getTypeList();
|
getTypeList();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,10 @@
|
||||||
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true"/>
|
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
|
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
|
<router-link
|
||||||
|
:to="`/system/dict/data/index/${scope.row.dictId}`"
|
||||||
|
class="link-type"
|
||||||
|
>
|
||||||
<span>{{ scope.row.dictType }}</span>
|
<span>{{ scope.row.dictType }}</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue