Browse Source

👣 编写基础模块字典

master
wangxiang 3 years ago
parent
commit
e4507cef64
  1. 12
      kicc-ui/src/views/system/dict/DictModal.vue
  2. 1
      kicc-ui/src/views/system/dict/index.vue

12
kicc-ui/src/views/system/dict/DictModal.vue

@ -14,7 +14,7 @@
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. * Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-王翔 * author entfrm开发团队-王翔
*/ */
import { ref, unref } from 'vue'; import {ref, toRaw, unref} from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index'; import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './dict.data'; import { formSchema } from './dict.data';
import { addDict, editDict, getDict } from '/@/api/platform/system/controller/dict'; import { addDict, editDict, getDict } from '/@/api/platform/system/controller/dict';
@ -24,7 +24,7 @@
const tag = ref<Nullable<string>>(''); const tag = ref<Nullable<string>>('');
/** https://v3.cn.vuejs.org/api/options-data.html#emits */ /** https://v3.cn.vuejs.org/api/options-data.html#emits */
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
const [registerForm, { resetFields, setFieldsValue, validate, clearValidate }] = useForm({ const [registerForm, { resetFields, setFieldsValue, validate, clearValidate, updateSchema }] = useForm({
labelWidth: 100, labelWidth: 100,
schemas: formSchema, schemas: formSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
@ -38,6 +38,14 @@
tag.value = data._tag; tag.value = data._tag;
const dictId = data.record?.id; const dictId = data.record?.id;
const props: Partial<ModalProps> = { confirmLoading: false }; const props: Partial<ModalProps> = { confirmLoading: false };
await updateSchema([
{
field: 'type',
componentProps: {
disabled: unref(tag) != 'add'
}
}
]);
// tag // tag
switch (unref(tag)) { switch (unref(tag)) {
case 'add': case 'add':

1
kicc-ui/src/views/system/dict/index.vue

@ -153,6 +153,7 @@
/** 处理表格刷新 */ /** 处理表格刷新 */
function handleRefreshTable() { function handleRefreshTable() {
clearSelectedRowKeys(); clearSelectedRowKeys();
dictSubRef.value.handleRefreshTable();
reload(); reload();
} }

Loading…
Cancel
Save