Commit 36081662 by yancanhua

fix: 页面优化

1 parent a075417c
Pipeline #105 for 36081662 failed in 0 seconds
...@@ -30,6 +30,7 @@ declare module 'vue' { ...@@ -30,6 +30,7 @@ declare module 'vue' {
VanImage: typeof import('vant/es')['Image'] VanImage: typeof import('vant/es')['Image']
VanList: typeof import('vant/es')['List'] VanList: typeof import('vant/es')['List']
VanLoading: typeof import('vant/es')['Loading'] VanLoading: typeof import('vant/es')['Loading']
VanOverlay: typeof import('vant/es')['Overlay']
VanPicker: typeof import('vant/es')['Picker'] VanPicker: typeof import('vant/es')['Picker']
VanPopup: typeof import('vant/es')['Popup'] VanPopup: typeof import('vant/es')['Popup']
VanProgress: typeof import('vant/es')['Progress'] VanProgress: typeof import('vant/es')['Progress']
......
...@@ -26,9 +26,17 @@ const resultStatus = ref(false); ...@@ -26,9 +26,17 @@ const resultStatus = ref(false);
const form = ref({}); const form = ref({});
const rules = ref({}); const rules = ref({});
//加载中
const pageLoading = ref(false);
watch(() => props.leafNodes, (nodes) => { watch(() => props.leafNodes, (nodes) => {
pageLoading.value = true;
columnsList.value = (nodes || []).map((item: any) => ({ ...item, value: getValueText(item), })); columnsList.value = (nodes || []).map((item: any) => ({ ...item, value: getValueText(item), }));
console.log('watchLeafNodes', columnsList.value); console.log('watchLeafNodes', columnsList.value);
setTimeout(() => {
pageLoading.value = false;
}, 1000);
}, { immediate: true, deep: true }); }, { immediate: true, deep: true });
...@@ -162,6 +170,12 @@ defineExpose({ ...@@ -162,6 +170,12 @@ defineExpose({
<template> <template>
<div> <div>
<van-overlay :show="pageLoading">
<div class="loadingBox">
<van-loading size="24px" color="#1989fa" vertical>加载中...</van-loading>
</div>
</van-overlay>
<div v-if="!pageLoading">
<van-form ref="customizeFormRef" :model="form" :rules="rules"> <van-form ref="customizeFormRef" :model="form" :rules="rules">
<div v-if="allowNoStructure" class="formTitle"> <div v-if="allowNoStructure" class="formTitle">
<div @click="resultStatus = !resultStatus"> <div @click="resultStatus = !resultStatus">
...@@ -186,8 +200,9 @@ defineExpose({ ...@@ -186,8 +200,9 @@ defineExpose({
<!-- 长文本输入框 --> <!-- 长文本输入框 -->
<div v-if="item.interactionType == 'textarea_input'"> <div v-if="item.interactionType == 'textarea_input'">
<van-field v-model="item.value" autosize :label="item.nodeName" <van-field v-model="item.value" autosize :label="item.nodeName"
:maxlength="getValidationRules(item).maxLength || 120" clearable :placeholder="item.placeholder" :maxlength="getValidationRules(item).maxLength || 120" clearable
:required="item.required === 1" rows="2" show-word-limit type="textarea" /> :placeholder="item.placeholder" :required="item.required === 1" rows="2" show-word-limit
type="textarea" />
</div> </div>
<!-- 数字输入框 --> <!-- 数字输入框 -->
...@@ -225,6 +240,7 @@ defineExpose({ ...@@ -225,6 +240,7 @@ defineExpose({
</div> </div>
</van-form> </van-form>
</div> </div>
</div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -255,4 +271,13 @@ defineExpose({ ...@@ -255,4 +271,13 @@ defineExpose({
.border-bottom { .border-bottom {
border-bottom: 1px solid #e6ebf5; border-bottom: 1px solid #e6ebf5;
} }
.loadingBox {
width: 80px;
height: 80px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!