2023-10-20 17:07:53 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="layout-container">
|
|
|
|
|
<!-- 列表-表格 -->
|
|
|
|
|
<dict-key-table ref="table"
|
2023-10-26 14:10:48 +08:00
|
|
|
@openAdd="() => modal.openAdd()"
|
2023-10-26 14:57:09 +08:00
|
|
|
@openUpdate="(e) => modal.openUpdate(e)"
|
|
|
|
|
@openView="(e) => view.open(e)" />
|
2023-10-20 17:07:53 +08:00
|
|
|
<!-- 添加修改模态框 -->
|
|
|
|
|
<dict-key-form-modal ref="modal"
|
2023-10-26 14:10:48 +08:00
|
|
|
@added="modalAddCallback"
|
|
|
|
|
@updated="modalUpdateCallback" />
|
2023-10-26 14:57:09 +08:00
|
|
|
<!-- json 查看器模态框 -->
|
|
|
|
|
<dict-key-view-modal ref="view" />
|
2023-10-20 17:07:53 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
export default {
|
|
|
|
|
name: 'systemDictKey'
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-10-26 14:10:48 +08:00
|
|
|
import { ref } from 'vue';
|
2023-10-20 17:07:53 +08:00
|
|
|
import DictKeyTable from './components/dict-key-table.vue';
|
|
|
|
|
import DictKeyFormModal from './components/dict-key-form-modal.vue';
|
2023-10-26 14:57:09 +08:00
|
|
|
import DictKeyViewModal from './components/dict-key-view-modal.vue';
|
2023-10-27 02:27:18 +08:00
|
|
|
import { useDictStore } from '@/store';
|
|
|
|
|
import { dictKeys } from './types/const';
|
2023-10-20 17:07:53 +08:00
|
|
|
|
|
|
|
|
const table = ref();
|
|
|
|
|
const modal = ref();
|
2023-10-26 14:57:09 +08:00
|
|
|
const view = ref();
|
2023-10-20 17:07:53 +08:00
|
|
|
|
2023-10-27 02:27:18 +08:00
|
|
|
useDictStore().loadKeys(dictKeys);
|
|
|
|
|
|
2023-10-20 17:07:53 +08:00
|
|
|
// 添加回调
|
|
|
|
|
const modalAddCallback = () => {
|
|
|
|
|
table.value.addedCallback();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 修改回调
|
|
|
|
|
const modalUpdateCallback = () => {
|
|
|
|
|
table.value.updatedCallback();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
|
|
|
|
</style>
|