|
|
@@ -1,18 +1,20 @@
|
|
|
<template>
|
|
|
- <CommonRoot>
|
|
|
- <LoadingPage v-if="loading" />
|
|
|
- <FlexCol :padding="30">
|
|
|
- <DynamicForm
|
|
|
- ref="formRef"
|
|
|
- :options="formDefine"
|
|
|
- :model="formModel"formModel
|
|
|
- :globalParams="querys"
|
|
|
- />
|
|
|
- <Height :height="20" />
|
|
|
- <Button type="primary" @click="submit">提交</Button>
|
|
|
- </FlexCol>
|
|
|
- <XBarSpace />
|
|
|
- </CommonRoot>
|
|
|
+ <view>
|
|
|
+ <CommonRoot>
|
|
|
+ <LoadingPage v-if="loading" />
|
|
|
+ <FlexCol :padding="30">
|
|
|
+ <DynamicForm
|
|
|
+ ref="formRef"
|
|
|
+ :options="formDefine"
|
|
|
+ :model="formModel"formModel
|
|
|
+ :globalParams="querys"
|
|
|
+ />
|
|
|
+ <Height :height="20" />
|
|
|
+ <Button type="primary" @click="submit">提交</Button>
|
|
|
+ </FlexCol>
|
|
|
+ <XBarSpace />
|
|
|
+ </CommonRoot>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
@@ -20,7 +22,7 @@ import { nextTick, ref, type Ref } from 'vue';
|
|
|
import { showError } from '@/common/composeabe/ErrorDisplay';
|
|
|
import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
|
|
|
import { getVillageInfoForm } from './forms';
|
|
|
-import { RequestApiError } from '@imengyu/imengyu-utils';
|
|
|
+import { RequestApiError, waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
import VillageInfoApi, { CommonInfoModel } from '@/api/inhert/VillageInfoApi';
|
|
|
import DynamicForm from '@/components/dynamic/DynamicForm.vue';
|
|
|
import LoadingPage from '@/components/display/loading/LoadingPage.vue';
|
|
|
@@ -32,6 +34,7 @@ import Height from '@/components/layout/space/Height.vue';
|
|
|
import { backAndCallOnPageBack } from '@/components/utils/PageAction';
|
|
|
import XBarSpace from '@/components/layout/space/XBarSpace.vue';
|
|
|
import { toast } from '@/components/utils/DialogAction';
|
|
|
+import { confirm } from '@/components/dialog/CommonRoot';
|
|
|
|
|
|
const loading = ref(false);
|
|
|
const subTitle = ref('');
|
|
|
@@ -62,12 +65,20 @@ async function submit() {
|
|
|
try {
|
|
|
loading.value = true;
|
|
|
formModel.value.type = querys.value.subId;
|
|
|
+ await waitTimeOut(800);
|
|
|
await VillageInfoApi.updateInfo(
|
|
|
querys.value.subType,
|
|
|
querys.value.villageId,
|
|
|
querys.value.villageVolunteerId,
|
|
|
formModel.value as CommonInfoModel,
|
|
|
);
|
|
|
+ confirm({
|
|
|
+ content: '您的提交已成功,感谢您的参与!',
|
|
|
+ cancelText: '继续编辑',
|
|
|
+ confirmText: '返回列表',
|
|
|
+ icon: 'success',
|
|
|
+ onConfirm: () => backPrev(true),
|
|
|
+ })
|
|
|
} catch (e) {
|
|
|
showError(e);
|
|
|
} finally {
|
|
|
@@ -98,6 +109,8 @@ const { querys } = useLoadQuerys({
|
|
|
|
|
|
let formData = undefined;
|
|
|
|
|
|
+ await waitTimeOut(200);
|
|
|
+
|
|
|
try {
|
|
|
const [model, forms] = getVillageInfoForm(querys.subType, querys.subId);
|
|
|
formModel.value = new model() as any;
|