feat: 字典配置前端代码.

This commit is contained in:
lijiahang
2023-10-26 19:25:08 +08:00
parent 29e3bde5b6
commit 5d43a9ce88
11 changed files with 36 additions and 88 deletions

View File

@@ -55,9 +55,8 @@
:bordered="false">
<!-- 配置项 -->
<template #keyName="{ record }">
<span class="pointer" @click="copy(record.keyName)">
<icon-copy /> {{ record.keyName }}
</span>
<icon-copy class="copy-left" title="复制" @click="copy(record.keyName)" />
<span>{{ record.keyName }}</span>
</template>
<!-- 配置值类型 -->
<template #valueType="{ record }">

View File

@@ -27,7 +27,7 @@
import { ref } from 'vue';
import useLoading from '@/hooks/loading';
import useVisible from '@/hooks/visible';
import { getDictValueEnum } from '@/api/system/dict-value';
import { getDictValueList } from '@/api/system/dict-value';
const { visible, setVisible } = useVisible();
const { loading, setLoading } = useLoading();
@@ -48,8 +48,8 @@
try {
setLoading(true);
// 查看
const { data } = await getDictValueEnum(keyName);
value.value = JSON.stringify(data, undefined, 4);
const { data } = await getDictValueList([keyName]);
value.value = JSON.stringify(data[keyName], undefined, 4);
} finally {
setLoading(false);
}

View File

@@ -17,7 +17,7 @@ export const definedExtraKeys = [{
/**
* 内置字段
*/
export const innerKeys = ['name', 'value', 'label'];
export const innerKeys = ['value', 'label'];
/**
* 额外参数类型

View File

@@ -15,12 +15,6 @@ const columns = [
align: 'left',
ellipsis: true,
tooltip: true,
}, {
title: '类型',
dataIndex: 'valueType',
slotName: 'valueType',
align: 'left',
width: 150
}, {
title: '配置描述',
dataIndex: 'description',
@@ -28,6 +22,12 @@ const columns = [
align: 'left',
ellipsis: true,
tooltip: true,
}, {
title: '类型',
dataIndex: 'valueType',
slotName: 'valueType',
align: 'left',
width: 150
}, {
title: '额外配置',
dataIndex: 'extraSchema',