使用字典值替换所有枚举对象.

This commit is contained in:
lijiahang
2023-10-27 14:48:50 +08:00
parent d32f21dc91
commit 706492f54a
48 changed files with 395 additions and 360 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="layout-container">
<div class="layout-container" v-if="render">
<!-- 列表-表格 -->
<dict-key-table ref="table"
@openAdd="() => modal.openAdd()"
@@ -21,19 +21,18 @@
</script>
<script lang="ts" setup>
import { ref } from 'vue';
import { ref, onBeforeMount } from 'vue';
import DictKeyTable from './components/dict-key-table.vue';
import DictKeyFormModal from './components/dict-key-form-modal.vue';
import DictKeyViewModal from './components/dict-key-view-modal.vue';
import { useDictStore } from '@/store';
import { dictKeys } from './types/const';
const render = ref(false);
const table = ref();
const modal = ref();
const view = ref();
useDictStore().loadKeys(dictKeys);
// 添加回调
const modalAddCallback = () => {
table.value.addedCallback();
@@ -44,6 +43,12 @@
table.value.updatedCallback();
};
onBeforeMount(async () => {
const dictStore = useDictStore();
await dictStore.loadKeys(dictKeys);
render.value = true;
});
</script>
<style lang="less" scoped>