|
|
@@ -23,6 +23,7 @@
|
|
|
:options="formDefine"
|
|
|
:model="formModel"
|
|
|
:globalParams="querys"
|
|
|
+ @storageOverflow="handleStorageOverflow"
|
|
|
/>
|
|
|
</ProvideVar>
|
|
|
</BackgroundBox>
|
|
|
@@ -48,7 +49,7 @@ import { nextTick, ref, watch, type Ref } from 'vue';
|
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
|
import { CollectableModulesIdMap, getVillageInfoForm, getVillageInfoFormIds, type SingleForm } from './forms';
|
|
|
import { showError } from '@/common/composeabe/ErrorDisplay';
|
|
|
-import { backAndCallOnPageBack } from '@/components/utils/PageAction';
|
|
|
+import { backAndCallOnPageBack, navTo } from '@/components/utils/PageAction';
|
|
|
import { toast } from '@/components/utils/DialogAction';
|
|
|
import { alert, confirm } from '@/components/dialog/CommonRoot';
|
|
|
import { Debounce, RequestApiError, waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
@@ -56,7 +57,6 @@ import VillageInfoApi, { CommonInfoModel } from '@/api/inhert/VillageInfoApi';
|
|
|
import DynamicForm from '@/components/dynamic/DynamicForm.vue';
|
|
|
import LoadingPage from '@/components/display/loading/LoadingPage.vue';
|
|
|
import Button from '@/components/basic/Button.vue';
|
|
|
-import CommonRoot from '@/components/dialog/CommonRoot.vue';
|
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
import Height from '@/components/layout/space/Height.vue';
|
|
|
import XBarSpace from '@/components/layout/space/XBarSpace.vue';
|
|
|
@@ -66,7 +66,6 @@ import type { UploaderFieldInstance } from '@/components/form/UploaderField.vue'
|
|
|
import CommonTopBanner from '@/common/components/CommonTopBanner.vue';
|
|
|
import ProvideVar from '@/components/theme/ProvideVar.vue';
|
|
|
import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
|
|
|
-import BackgroundImageButton from '@/components/basic/BackgroundImageButton.vue';
|
|
|
import PrimaryButton from '@/common/components/PrimaryButton.vue';
|
|
|
|
|
|
const loading = ref(false);
|
|
|
@@ -138,6 +137,7 @@ const { querys } = useLoadQuerys({
|
|
|
findId,
|
|
|
model,
|
|
|
);
|
|
|
+ console.log('加载数据', formData);
|
|
|
}
|
|
|
} catch (e) {
|
|
|
if (!(e instanceof RequestApiError && e.errorMessage.startsWith('请完成')))
|
|
|
@@ -259,10 +259,10 @@ function getSaveName() {
|
|
|
async function loadLocalSave(formData: CommonInfoModel|undefined) {
|
|
|
if (!currentFormInfo)
|
|
|
return formData;
|
|
|
- console.log('加载暂存数据');
|
|
|
const saveName = getSaveName();
|
|
|
const saveData = uni.getStorageSync(saveName);
|
|
|
if (saveData) {
|
|
|
+ console.log('加载暂存数据');
|
|
|
const res = await confirm({
|
|
|
content: '您有上次编辑未完成的内容,是否要从上次的编辑数据继续?',
|
|
|
cancelText: '取消',
|
|
|
@@ -273,7 +273,7 @@ async function loadLocalSave(formData: CommonInfoModel|undefined) {
|
|
|
const d = JSON.parse(saveData);
|
|
|
d.id = 0;
|
|
|
formData = new currentFormInfo[0]().fromServerSide(d) as CommonInfoModel;
|
|
|
- console.log('有暂存数据', formData);
|
|
|
+ console.log('读取暂存数据', formData);
|
|
|
} else
|
|
|
deleteLocalSave();
|
|
|
}
|
|
|
@@ -291,6 +291,20 @@ function saveLocalSave() {
|
|
|
console.log('保存暂存数据');
|
|
|
}
|
|
|
|
|
|
+async function handleStorageOverflow() {
|
|
|
+ const res = await confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '当前村社采编数据库已超过存储限制啦,无法再上传资源,您可以选择升级村社获得更多存储空间。',
|
|
|
+ confirmText: '去升级',
|
|
|
+ cancelText: '取消',
|
|
|
+ });
|
|
|
+ if (res) {
|
|
|
+ navTo('/pages/home/village/upgrade/upgrade-village', {
|
|
|
+ villageId: querys.value.villageId,
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
watch(formModel, () => {
|
|
|
if (!canSaveNow)
|
|
|
return;
|