czh-20260501-增加密级相关功能
This commit is contained in:
@@ -7,35 +7,41 @@
|
||||
<script lang="ts" setup>
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { createListFormSchema } from '../TaskList.data';
|
||||
import { getCreateListFormSchema } from '../TaskList.data';
|
||||
import { addTaskList } from '../TaskList.api';
|
||||
import { getSecretText } from '../types';
|
||||
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
const [registerForm, { resetFields, validate }] = useForm({
|
||||
let pendingGroupId = '';
|
||||
let pendingUserSecurityLevel = 3;
|
||||
|
||||
const [registerForm, { resetFields, validate, updateSchema }] = useForm({
|
||||
labelWidth: 100,
|
||||
schemas: createListFormSchema,
|
||||
schemas: getCreateListFormSchema(3),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
let pendingGroupId = '';
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
pendingGroupId = data?.groupId || '';
|
||||
pendingUserSecurityLevel = data?.userSecurityLevel || 3;
|
||||
updateSchema(getCreateListFormSchema(pendingUserSecurityLevel));
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
setModalProps({ confirmLoading: true });
|
||||
const values = await validate();
|
||||
const listId = await addTaskList({
|
||||
tasklistName: values.tasklistName || values.name,
|
||||
const result = await addTaskList({
|
||||
tasklistName: values.tasklistName,
|
||||
pid: pendingGroupId || undefined,
|
||||
secretLevel: values.secretLevel,
|
||||
secretText: getSecretText(values.secretLevel),
|
||||
});
|
||||
closeModal();
|
||||
emit('success', listId);
|
||||
emit('success', result);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user