feat: 保存字典值.

This commit is contained in:
lijiahangmax
2023-10-21 02:26:36 +08:00
parent bd02ce1dd0
commit eb2c8eb719
13 changed files with 168 additions and 41 deletions

View File

@@ -101,7 +101,6 @@
import { definedExtraKeys, innerKeys, ExtraParamType } from '../types/const';
import { ValueTypeEnum } from '../types/enum.types';
import { toOptions } from '@/utils/enum';
import { FieldData } from '@arco-design/web-vue/es/form/interface';
const { visible, setVisible } = useVisible();
const { loading, setLoading } = useLoading();
@@ -113,7 +112,7 @@
return {
id: undefined,
keyName: undefined,
valueType: undefined,
valueType: ValueTypeEnum.STRING.value,
extraSchema: undefined,
description: undefined,
};

View File

@@ -77,6 +77,12 @@
<!-- 操作 -->
<template #handle="{ record }">
<div class="table-handle-wrapper">
<!-- 查看 -->
<a-button type="text"
size="mini"
@click="viewDictKey(record.keyName)">
查看
</a-button>
<!-- 修改 -->
<a-button type="text"
size="mini"
@@ -117,13 +123,15 @@
import { usePagination } from '@/types/table';
import {} from '../types/const';
import { ValueTypeEnum } from '../types/enum.types';
import { toOptions, getEnumValue } from '@/utils/enum';
import { MenuStatusEnum } from '@/views/system/menu/types/enum.types';
import { getEnumValue } from '@/utils/enum';
import { getDictValueEnum } from '@/api/system/dict-value';
import useCopy from '@/hooks/copy';
const tableRenderData = ref<DictKeyQueryResponse[]>([]);
const { loading, setLoading } = useLoading();
const emits = defineEmits(['openAdd', 'openUpdate']);
const { copy } = useCopy();
const pagination = usePagination();
const formModel = reactive<DictKeyQueryRequest>({
@@ -163,6 +171,13 @@
addedCallback, updatedCallback
});
// 查看
const viewDictKey = async (keyName: string) => {
const { data } = await getDictValueEnum(keyName);
// fixme 后续改为 jsonView
await copy(JSON.stringify(data), '复制成功');
};
// 加载数据
const doFetchTableData = async (request: DictKeyQueryRequest) => {
try {

View File

@@ -36,7 +36,7 @@ const columns = [
}, {
title: '操作',
slotName: 'handle',
width: 130,
width: 170,
align: 'center',
fixed: 'right',
},