feat. 终端主题设置.

This commit is contained in:
lijiahang
2023-12-08 16:40:14 +08:00
parent f68745b80d
commit 73dd7cd3d5
24 changed files with 128 additions and 94 deletions

View File

@@ -245,7 +245,6 @@
// 清空
const handlerClear = () => {
setLoading(false);
setVisible(false);
};
</script>

View File

@@ -144,7 +144,7 @@
import { usePagination } from '@/types/table';
import { dictValueTypeKey } from '../types/const';
import useCopy from '@/hooks/copy';
import { useDictStore } from '@/store';
import { useCacheStore, useDictStore } from '@/store';
import { getDictValueList } from '@/api/system/dict-value';
const tableRenderData = ref<DictKeyQueryResponse[]>([]);
@@ -154,6 +154,7 @@
const { copy } = useCopy();
const { loading, setLoading } = useLoading();
const { toOptions, getDictValue } = useDictStore();
const cacheStore = useCacheStore();
const formModel = reactive<DictKeyQueryRequest>({
id: undefined,
@@ -170,6 +171,7 @@
// 调用删除接口
await deleteDictKey(id);
Message.success('删除成功');
cacheStore.reset('dictKeys');
// 重新加载数据
fetchTableData();
} catch (e) {
@@ -181,11 +183,13 @@
// 添加后回调
const addedCallback = () => {
fetchTableData();
cacheStore.reset('dictKeys');
};
// 更新后回调
const updatedCallback = () => {
fetchTableData();
cacheStore.reset('dictKeys');
};
defineExpose({

View File

@@ -21,7 +21,9 @@
:wrapper-col-props="{ span: 18 }"
:rules="formRules">
<!-- 配置项 -->
<a-form-item field="keyId" label="配置项">
<a-form-item v-if="visible"
field="keyId"
label="配置项">
<dict-key-selector v-model="formModel.keyId" @change="changeKey" />
</a-form-item>
<!-- 配置值 -->
@@ -123,18 +125,18 @@
const emits = defineEmits(['added', 'updated']);
// 打开新增
const openAdd = () => {
const openAdd = async () => {
title.value = '添加字典配置值';
isAddHandle.value = true;
renderForm({ ...defaultForm(), keyId: formModel.value.keyId, sort: (formModel.value.sort || 0) + sortStep });
await renderForm({ ...defaultForm(), keyId: formModel.value.keyId, sort: (formModel.value.sort || 0) + sortStep });
setVisible(true);
};
// 打开修改
const openUpdate = (record: any) => {
const openUpdate = async (record: any) => {
title.value = '修改字典配置值';
isAddHandle.value = false;
renderForm({ ...defaultForm(), ...record });
await renderForm({ ...defaultForm(), ...record });
setVisible(true);
};
@@ -217,7 +219,6 @@
// 清空
const handlerClear = () => {
setLoading(false);
setVisible(false);
};
</script>

View File

@@ -255,7 +255,6 @@
// 清空
const handlerClear = () => {
setLoading(false);
setVisible(false);
// 触发 watch 防止第二次加载变成根目录
renderForm(defaultForm());
};