--添加测试模块

This commit is contained in:
2025-10-13 11:53:54 +08:00
parent c3c93fe308
commit e1326c7ce8
146 changed files with 11171 additions and 807 deletions

View File

@ -1,23 +1,25 @@
<template>
<div class="page-bg-wrap">
<div class="top-toolbar">
<a-space :size="10" wrap style="gap:0">
<a-button style="margin-right: 10px" @click="close">
<slot name="icon">
<close-outlined />
</slot>
关闭
</a-button>
<a-button v-if="mode != 'view'" type="primary" @click="handleSubmit">
<slot name="icon">
<check-circle-outlined />
</slot>
确认
</a-button>
</a-space>
<a-spin :spinning="spinning" tip="请稍后...">
<div class="page-bg-wrap">
<div class="top-toolbar" id="formViewPage">
<a-space :size="10" wrap style="gap:0">
<a-button style="margin-right: 10px" @click="close">
<slot name="icon">
<close-outlined />
</slot>
关闭
</a-button>
<a-button v-if="mode != 'view'" type="primary" @click="handleSubmit">
<slot name="icon">
<check-circle-outlined />
</slot>
确认
</a-button>
</a-space>
</div>
<component :is="dynamicComponent" ref="formRef" :fromPage="FromPageType.MENU" @form-mounted="onFormMounted" />
</div>
<component :is="dynamicComponent" ref="formRef" :fromPage="FromPageType.MENU" @form-mounted="onFormMounted" />
</div>
</a-spin>
</template>
<script setup>
@ -46,6 +48,8 @@ const tabStore = useMultipleTabStore();
const formProps = ref(null);
const formId = ref(currentRoute.value?.params?.id);
const spinning = ref(false)
const { notification } = useMessage();
const { t } = useI18n();
const hash = location.hash||location.pathname;
@ -84,6 +88,7 @@ function close() {
}
async function handleSubmit() {
spinning.value = true
try {
const saveSuccess = await saveModal();
if (saveSuccess) {
@ -98,6 +103,7 @@ async function handleSubmit() {
}, 1000);
}
} finally {
spinning.value = false
}
}
@ -105,7 +111,8 @@ async function saveModal() {
let saveSuccess = false;
const _mode = mode.value;
try {
const values = await formRef.value?.validate();
await formRef.value?.validate();
const values = (formRef.value?.getFormModal && formRef.value.getFormModal()) || await formRef.value?.validate();
//添加隐藏组件
if (formProps.hiddenComponent?.length) {
formProps.hiddenComponent.forEach((component) => {