centaline-data-driven-v3 0.0.90 → 0.0.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/centaline-data-driven-v3.umd.js +141 -141
  2. package/package.json +1 -1
  3. package/src/assets/commonApp.css +1 -0
  4. package/src/components/app/ComboBox.vue +3 -3
  5. package/src/components/app/Form.vue +2 -2
  6. package/src/components/app/FormList.vue +20 -0
  7. package/src/components/app/SearchList/SearchTable.vue +3 -1
  8. package/src/components/app/TextBox.vue +1 -1
  9. package/src/components/app/searchScreen.vue +53 -34
  10. package/src/components/common/iframe.vue +4 -1
  11. package/src/components/web/ComboBox.vue +14 -5
  12. package/src/components/web/ContainerControl.vue +1 -1
  13. package/src/components/web/File.vue +16 -4
  14. package/src/components/web/Form.vue +29 -7
  15. package/src/components/web/MapBaidu.vue +10 -2
  16. package/src/components/web/PhotoSelect.vue +10 -2
  17. package/src/components/web/Progress.vue +17 -3
  18. package/src/components/web/SearchList/SearchTable.vue +15 -5
  19. package/src/components/web/SearchList.vue +5 -4
  20. package/src/components/web/SearchScreen.vue +17 -6
  21. package/src/components/web/Tree/Tree.vue +11 -4
  22. package/src/components/web/Tree.vue +11 -2
  23. package/src/components/web/ViewerFile.vue +7 -2
  24. package/src/components/web/appContainer.vue +4 -1
  25. package/src/components/web/dialog.vue +5 -2
  26. package/src/components/web/other/PopupSearchListTable.vue +6 -1
  27. package/src/components/web/photo.vue +16 -3
  28. package/src/loader/src/Field.js +5 -0
  29. package/src/loader/src/SearchScreen.js +60 -1
  30. package/src/main.js +3 -3
  31. package/src/utils/common.js +4 -1
  32. package/src/utils/formData.js +285 -180
  33. package/src/utils/mixins.js +0 -18
  34. package/src/utils/request.js +10 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven-v3",
3
- "version": "0.0.90",
3
+ "version": "0.0.92",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -90,6 +90,7 @@
90
90
 
91
91
  .ct-serach-screen .screen-serach .title {
92
92
  font-size: 14px;
93
+ max-width: 90%;
93
94
  }
94
95
 
95
96
  .ct-serach-screen .screen-serach .color-EE6B6B {
@@ -30,7 +30,7 @@
30
30
  </div>
31
31
 
32
32
  <van-search v-if="model.filterable" placeholder="请输入搜索内容" v-model="searchText"
33
- @update:model-value="searchInputHandle" />
33
+ @update:model-value="searchInputHandle" autocomplete="off" />
34
34
  <div style="height: 350px;overflow: scroll;">
35
35
  <van-checkbox-group>
36
36
  <template v-if="model.options.length > 0 && model.options[0].options">
@@ -61,7 +61,7 @@
61
61
  </div>
62
62
 
63
63
  <van-search v-if="model.filterable" placeholder="请输入搜索内容" v-model="searchText"
64
- @update:model-value="searchInputHandle" />
64
+ @update:model-value="searchInputHandle" autocomplete="off" />
65
65
  <div style="height: 400px;overflow: scroll;">
66
66
  <van-checkbox-group shape="square" v-model="model.value">
67
67
  <van-cell-group>
@@ -79,7 +79,7 @@
79
79
  </template>
80
80
  <template v-else>
81
81
  <van-search v-if="model.filterable" placeholder="请输入搜索内容" v-model="searchText"
82
- @update:model-value="searchInputHandle" />
82
+ @update:model-value="searchInputHandle" autocomplete="off" />
83
83
  <div style="height: 350px;overflow: scroll;">
84
84
  <van-checkbox-group>
85
85
  <van-cell-group>
@@ -56,7 +56,7 @@
56
56
  </template>
57
57
  <template #title v-if="item.show !== false">
58
58
  <div :class="[item.required ? 'requiredLabel' : '']">{{ item.controlLabel }}</div>
59
- <div v-html="item.sufLabel1"></div>
59
+ <div v-if="item.sufLabel1" style="margin-top: 5px;" v-html="item.sufLabel1"></div>
60
60
  </template>
61
61
  </van-cell-group>
62
62
  </template>
@@ -248,7 +248,7 @@ function setFormHeight() {
248
248
  h2 = refForm.value.offsetTop
249
249
  }
250
250
  let formHeight = h1 - h2
251
- if (common.flagMicroMessenger()||common.flagHK()) {
251
+ if ((common.flagMicroMessenger()||common.flagHK())&&model.value.buttons.findIndex((v) => { return v.show }) > -1) {
252
252
  formHeight = formHeight - 64
253
253
  }
254
254
  model.value.formHeight = formHeight
@@ -131,6 +131,7 @@
131
131
  import { ref } from 'vue'
132
132
  import FormList from '../../loader/src/FormList'
133
133
  import { initData } from '../../utils/mixins';
134
+ import Enum from '../../utils/Enum'
134
135
  import common from '../../utils/common'
135
136
  import util from '../../utils/pub-use'
136
137
  import draggable from "vuedraggable";
@@ -222,8 +223,27 @@ function deleteRow(index, sourceIndex) {
222
223
  //验证
223
224
  function fieldsValidExcute() {
224
225
  var rtnBool = true;
226
+ var i = 0;
227
+ var controlLabel = model.value.controlLabel;
228
+ //如果当前组件的controlLabel为空 取上一个分组组的controlLabel
229
+ if (!model.value.controlLabel) {
230
+ if (model.value.form && model.value.form.fields) {
231
+ const currentIndex = model.value.form.fields.findIndex(v => v.fieldName1 === model.value.fieldName1);
232
+ if (currentIndex - 1 >= 0) {
233
+ if (model.value.form.fields[currentIndex - 1].controlType == Enum.ControlType.Group){
234
+ controlLabel = model.value.form.fields[currentIndex - 1].controlLabel;
235
+ }
236
+ }
237
+ }
238
+ }
225
239
  if (model.value.required) {
226
240
  if (model.value.tableData.length == 0) {
241
+ if (controlLabel) {
242
+ model.value.displayValidMessage = common.LocalizedString('请填写', '請填寫') + '[' + controlLabel + ']'
243
+ }
244
+ else {
245
+ model.value.displayValidMessage = '表格不能为空'
246
+ }
227
247
  return false;
228
248
  }
229
249
  }
@@ -9,9 +9,11 @@
9
9
  </div>
10
10
  <div ref="refTableParent" class="ct-tableParentAPP" :style="'height:' + model.tableHeight + 'px'"
11
11
  @scroll="scrollHandle($event)">
12
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
12
+ <van-pull-refresh v-model="refreshing" @refresh="onRefresh"
13
+ :loosing-text="common.LocalizedString('释放即可刷新...', '釋放即可刷新...')">
13
14
  <van-list v-if="!tableError" v-model:loading="tableLoading"
14
15
  :error-text="common.LocalizedString('没有查到数据,点我刷新', '沒有查到數據,點我刷新')" :finished="finished"
16
+ :loading-text="common.LocalizedString('加载中...', '加載中...')"
15
17
  @load="onLoad" :immediate-check="false" :style="'min-height:' + model.tableHeight + 'px'">
16
18
  <template v-if="flagPopupSearchlist && singleSelectio">
17
19
  <van-radio-group v-model="checkeds" ref="refCheckboxGroup">
@@ -11,7 +11,7 @@
11
11
  <van-field clearable :type="model.inputType" :rows="model.rows" v-bind="model.attrs" v-model="model.code1"
12
12
  :readonly="model.readonly" :disabled="model.locked" :maxlength="model.maxValue1"
13
13
  :show-word-limit="model.showWordLimit" :label-align="model.inputType == 'textarea' ? 'top' : 'left'"
14
- @input="changeHandler(model, emit)" class="ct-text">
14
+ @input="changeHandler(model, emit)" class="ct-text" autocomplete="off">
15
15
  <template #label v-if="model.showLabel && model.controlLabel">
16
16
  <div :class="[model.required ? 'requiredLabel' : '']"
17
17
  :style="model.isList ? 'white-space: nowrap' : ''">
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="ct-serach-screen" v-if="model">
3
3
  <div class="screen-serach" style="display: flex;flex-direction: row;">
4
- <div style="display: flex; flex: 1;">
4
+ <div style="display: flex; flex: 1;overflow-x: auto;">
5
5
  <van-dropdown-menu v-if="showScreen && screendata.length > 0" active-color="#EE6B6B"
6
6
  style=" width: 100%;">
7
7
  <van-dropdown-item v-for="(field, index) in screendata" :key="index" ref="Refitem"
@@ -25,25 +25,31 @@
25
25
  </van-dropdown-item>
26
26
  <van-dropdown-item v-if="ismore" key="4" title="更多" ref="RefitemMore" title-class="title"
27
27
  class="screen-more" @open="openMore" @close="closeMore">
28
- <template v-for="(field, index) in model.screen" :key="index">
29
- <component v-if="field.show !== false" :is="field.is" :vmodel="field" ref="Fields"
30
- :parameterAction="model.parameterAction" />
31
- </template>
32
- <template v-for="(field, index) in model.highScreen" :key="index">
33
- <component v-if="field.show !== false" :is="field.is" :vmodel="field" ref="Fields"
34
- :parameterAction="model.parameterAction" />
35
- </template>
36
- <van-sticky position="bottom">
37
- <div style="padding: 5px 16px; display: flex;background-color: #ffffff;">
38
- <van-button color="#ECECEC" block @click="reset"
39
- style="color:333333;margin-right: 10px;">
40
- {{ getBtnLabel(Enum.ControlType.ButtonReset, '重置') }}
41
- </van-button>
42
- <van-button color="#FF5252" block @click="clickHandlerMore()">
43
- {{ getBtnLabel(Enum.ControlType.ButtonSearch, '确定') }}
44
- </van-button>
28
+ <div style="position: relative; height: 100%;">
29
+ <template v-for="(field, index) in model.screen" :key="field.keyScreen">
30
+ <template v-if="field.show !== false">
31
+ <component :is="field.is" :vmodel="field" ref="Fields"
32
+ :parameterAction="model.parameterAction" @change="changeHandler(field)" />
33
+ </template>
34
+ </template>
35
+ <template v-for="(field, index) in model.highScreen" :key="field.keyScreen">
36
+ <template v-if="field.show !== false" :key="field.keyScreen">
37
+ <component :is="field.is" :vmodel="field" ref="Fields"
38
+ :parameterAction="model.parameterAction" @change="changeHandler(field)" />
39
+ </template>
40
+ </template>
41
+ <div style="position: sticky;bottom: 0;">
42
+ <div style="padding: 5px 16px; display: flex;background-color: #ffffff;">
43
+ <van-button color="#ECECEC" block @click="reset"
44
+ style="color:333333;margin-right: 10px;">
45
+ {{ getBtnLabel(Enum.ControlType.ButtonReset, '重置') }}
46
+ </van-button>
47
+ <van-button color="#FF5252" block @click="clickHandlerMore()">
48
+ {{ getBtnLabel(Enum.ControlType.ButtonSearch, '确定') }}
49
+ </van-button>
50
+ </div>
45
51
  </div>
46
- </van-sticky>
52
+ </div>
47
53
  </van-dropdown-item>
48
54
  </van-dropdown-menu>
49
55
  </div>
@@ -57,7 +63,8 @@
57
63
  </div>
58
64
  <div class="screen-condition" v-if="searchdata.length > 0">
59
65
  <van-dropdown-menu active-color="#323233">
60
- <van-dropdown-item :title="common.LocalizedString('当前搜索条件:已选中' + searchdata.length + '个条件', '當前搜尋條件:已選中' + searchdata.length + '個條件')">
66
+ <van-dropdown-item
67
+ :title="common.LocalizedString('当前搜索条件:已选中' + searchdata.length + '个条件', '當前搜尋條件:已選中' + searchdata.length + '個條件')">
61
68
  <van-row gutter="20" v-for="(field, index) in searchdata" :key="index">
62
69
  <van-col span="6" style="text-align: right;">{{ field.controlLabel }}</van-col>
63
70
  <van-col span="18">
@@ -81,21 +88,19 @@
81
88
  </van-dropdown-item>
82
89
  </van-dropdown-menu>
83
90
  </div>
84
- <van-action-sheet v-model:show="issort" cancel-text="取消"
85
- :round="false">
86
- <template #default>
87
- <button type="button" class="van-action-sheet__item" v-for="(v, i) in actions" :key="i"
88
- :style="{ 'background': v.name==sortname ? '#f2f3f5' : ''}">
89
- <span class="van-action-sheet__name" @click="selectsort(v)">{{ v.name}}</span>
90
- </button>
91
- </template>
91
+ <van-action-sheet v-model:show="issort" cancel-text="取消" :round="false">
92
+ <template #default>
93
+ <button type="button" class="van-action-sheet__item" v-for="(v, i) in actions" :key="i"
94
+ :style="{ 'background': v.code == sortCode ? '#f2f3f5' : '' }">
95
+ <span class="van-action-sheet__name" @click="selectsort(v)">{{ v.name }}</span>
96
+ </button>
97
+ </template>
92
98
  </van-action-sheet>
93
99
  </div>
94
100
  </template>
95
101
  <script setup lang="ts">
96
102
  import { ref, nextTick } from 'vue'
97
103
  import SearchScreen from '../../loader/src/SearchScreen'
98
- import Form from '../../loader/src/Form'
99
104
  import Enum from '../../utils/Enum'
100
105
  import common from '../../utils/common'
101
106
  const emit = defineEmits(['loaded', 'failLoad', 'showTitle', 'search', 'resetSearch', 'saveShortcut', 'sort'])
@@ -122,6 +127,7 @@ const screendata = ref([])
122
127
  const ismore = ref(false)
123
128
  const flagsort = ref(false)
124
129
  const sortname = ref('')
130
+ const sortCode = ref('')
125
131
  const searchdata = ref([])
126
132
  const issort = ref(false)
127
133
  const actions = ref([])
@@ -152,6 +158,19 @@ function searchComplate(flagLoad) {
152
158
  //加载数据
153
159
  function load(data) {
154
160
  model.value = data;
161
+ if (model.value.scripts) {
162
+ model.value.scripts.formData = model.value.formData;
163
+ model.value.scripts.formData.form = model.value;
164
+ model.value.scripts.formData.excuteData = model.value.screen;
165
+ model.value.scripts.formData.fieldsDic = model.value.screenDic;
166
+ model.value.scripts.formData.source = SearchScreen;
167
+ }
168
+ if (model.value.onload) {
169
+ let onloads = model.value.onload.split(';');
170
+ onloads.forEach((v) => {
171
+ common.excute.call(model.value.scripts, v);
172
+ });
173
+ }
155
174
  setScreenShow();
156
175
  setscreendata();
157
176
  emit('loaded', model.value.flagSearch);
@@ -186,7 +205,7 @@ function setscreendata() {
186
205
  v.controlType !== Enum.ControlType.LineFeed
187
206
  );
188
207
  });
189
- if (screens.length > 4) {
208
+ if (screens.length > 3) {
190
209
  ismore.value = true;
191
210
  screens = screens.splice(0, 3);
192
211
  }
@@ -215,19 +234,18 @@ function search() {
215
234
  }
216
235
  //组件值发生变化时操作
217
236
  function changeHandler(field) {
218
- if (field.is == 'ct-combobox') {
237
+ if (field.is == 'ct-combobox' && field.isList) {
219
238
  setsearchdata()
220
239
  search()
221
240
  }
222
- SearchScreen.hiddenHandle(field, model.value);
223
- Form.clearRelatedHandle(field, model.value.screen)
241
+ SearchScreen.changeHandler(field, model.value);
224
242
  }
225
243
 
226
244
  function open(field) {
227
245
  field.showLabel = false;
228
246
  field.isList = true;
229
247
  if (field.is == 'ct-combobox') {
230
- field.getOptions(model.value.parameterAction, '',null, function (data) {
248
+ field.getOptions(model.value.parameterAction, '', null, function (data) {
231
249
  field.options = data
232
250
  })
233
251
  }
@@ -346,6 +364,7 @@ function getsortfield(field) {
346
364
  function selectsort(ev) {
347
365
  issort.value = false;
348
366
  sortname.value = "";
367
+ sortCode.value = ev.code
349
368
  if (ev.code) {
350
369
  sortname.value = ev.name;
351
370
  }
@@ -5,7 +5,7 @@
5
5
  </div>
6
6
  </template>
7
7
  <script setup lang="ts">
8
- import { ref, onMounted } from 'vue'
8
+ import { ref, onMounted, onBeforeUnmount } from 'vue'
9
9
  import common from '../../utils/common'
10
10
  const emit = defineEmits(['new', 'update', 'delete', 'refreshParent', 'closeDialog'])
11
11
  const props = defineProps({
@@ -13,6 +13,9 @@ const props = defineProps({
13
13
  })
14
14
  const refIframe = ref()
15
15
  const pageStyle=ref('')
16
+ onBeforeUnmount(()=>{
17
+ window.removeEventListener('message', handleMessage);
18
+ })
16
19
  Init()
17
20
  function Init(){
18
21
  if(common.flagApp()){
@@ -27,7 +27,7 @@
27
27
  </el-select-v2>
28
28
  <template v-if="model.flagaFterText">
29
29
  <el-input type="text" v-model="model.code2" v-bind="model.attrs" @change="changeHandler(model, emit)"
30
- :disabled="model.locked" :rows="model.rows" :readonly="model.readonly" autocomplete="on"
30
+ :disabled="model.locked" :rows="model.rows" :readonly="model.readonly"
31
31
  :maxlength="model.maxValue1" :show-word-limit="model.showWordLimit" clearable
32
32
  class="fieldControl ml10">
33
33
  </el-input>
@@ -45,7 +45,7 @@
45
45
  </template>
46
46
  <script lang="ts" setup>
47
47
  import Axios from 'axios';
48
- import { ref, nextTick } from 'vue'
48
+ import { ref, nextTick, onBeforeUnmount } from 'vue'
49
49
  import { Search } from '@element-plus/icons-vue'
50
50
  import { initData, changeHandler } from '../../utils/mixins';
51
51
  import common from '../../utils/common'
@@ -64,6 +64,16 @@ const nodatatext = ref(' ')
64
64
  model.value.itemKey=Math.random();
65
65
  let cancelTokenSource = null; // 用于存储取消令牌
66
66
 
67
+ const qrtimer=ref(null)
68
+ onBeforeUnmount(()=>{
69
+ model.value=null
70
+ refselect.value=null
71
+ if (qrtimer.value) {
72
+ clearTimeout(qrtimer.value);
73
+ qrtimer.value = null;
74
+ }
75
+ })
76
+
67
77
  //下拉框出现/隐藏时触发
68
78
  function visibleChange(visible) {
69
79
  //是否有更多选择路由
@@ -142,12 +152,11 @@ function getOptions(key) {
142
152
  }
143
153
  // 防抖函数
144
154
  function debounce(func, delay) {
145
- let timer = null;
146
155
  return function () {
147
156
  const context = this;
148
157
  const args = arguments;
149
- clearTimeout(timer);
150
- timer = setTimeout(() => {
158
+ if(qrtimer.value)clearTimeout(qrtimer.value);
159
+ qrtimer.value = setTimeout(() => {
151
160
  func.apply(context, args);
152
161
  }, delay);
153
162
  };
@@ -12,7 +12,7 @@
12
12
  <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
13
13
  <div v-if="col.show !== false"
14
14
  :class="index > 0 && (col.controlLabel == '' || col.is == 'ct-button') ? 'complex-left-10' : ''"
15
- :style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : '100%'), 'flex': (col.width && col.width>0? '0 0 ' + col.width + 'px' : '100%') }">
15
+ :style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : ''), 'flex': (col.width && col.width>0? '0 0 ' + col.width + 'px' : '') }">
16
16
  <component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
17
17
  v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)" @change="change(col)"
18
18
  @popupSearchList="popupSearchListHandler"></component>
@@ -188,7 +188,8 @@ const UploadhttpRequest = ref({})
188
188
  const startfile = ref();
189
189
  const endfile = ref();
190
190
  const model = ref(null);
191
-
191
+ const qrtimer1=ref(null)
192
+ const qrtimer2=ref(null)
192
193
 
193
194
  const headers = computed(() => {
194
195
  return common.getDataDrivenOpts().handler.getRequestHeaders();
@@ -268,7 +269,7 @@ function handleRemove(file) {
268
269
  }).then(() => {
269
270
  File.deleteFile(file, false, model.value);
270
271
  selfValidExcute("remove");
271
- setTimeout(() => {
272
+ qrtimer1.value = setTimeout(() => {
272
273
  QRCodeLocate();
273
274
  }, 1080);
274
275
 
@@ -329,7 +330,7 @@ function uploadProcess(event, file, fileList) {
329
330
  file.loadProgress = parseInt(event.percent); // 动态获取文件上传进度
330
331
  if (file.loadProgress >= 100) {
331
332
  file.loadProgress = 100;
332
- setTimeout(() => {
333
+ qrtimer2.value = setTimeout(() => {
333
334
  file.progressFlag = false;
334
335
  }, 1000); // 一秒后关闭进度条
335
336
  }
@@ -667,10 +668,21 @@ function ListenerPaste(event) {
667
668
  document.addEventListener('paste', ListenerPaste);
668
669
  onBeforeUnmount(() => {
669
670
  //销毁定时上传
670
- clearTimeout(model.value.qrtimer);
671
+ if (model.value.qrtimer) {
672
+ clearTimeout(model.value.qrtimer);
673
+ model.value.qrtimer = null;
674
+ }
671
675
  window.removeEventListener('scroll', model.value.QRCodeLocate, true)
672
676
  //销毁贴事件监听器
673
677
  document.removeEventListener('paste', ListenerPaste)
678
+ if (qrtimer1.value) {
679
+ clearTimeout(qrtimer1.value);
680
+ qrtimer1.value = null;
681
+ }
682
+ if (qrtimer2.value) {
683
+ clearTimeout(qrtimer2.value);
684
+ qrtimer2.value = null;
685
+ }
674
686
  })
675
687
 
676
688
  defineExpose({
@@ -173,8 +173,8 @@
173
173
 
174
174
  </div>
175
175
  <template v-if="model?.aiAttr?.showAI && !showAI">
176
- <div class="btn-avatar" @click="AIToggle">
177
- <img class="avatar-img" :src="util.getAssetsImage('AIChat.png')" :alt="model?.aiRouter.controlLabel"
176
+ <div class="btn-avatar" @click.stop="AIToggle">
177
+ <img class="avatar-img" @click.stop="AIToggle" :src="util.getAssetsImage('AIChat.png')" :alt="model?.aiRouter.controlLabel"
178
178
  :title="model?.aiRouter.controlLabel">
179
179
  </div>
180
180
  </template>
@@ -184,7 +184,7 @@
184
184
  </div>
185
185
  </template>
186
186
  <script lang="ts" setup>
187
- import { ref, nextTick, onUpdated, onDeactivated, onMounted } from 'vue'
187
+ import { ref, nextTick, onUpdated, onDeactivated, onMounted, onBeforeUnmount } from 'vue'
188
188
  import { RouterClickHandler } from '../../utils/mixins';
189
189
  import common from '../../utils/common'
190
190
  import Form from '../../loader/src/Form'
@@ -253,15 +253,36 @@ const isScroll = ref(false)
253
253
  const isWebScroll = ref(false)
254
254
  const Fields = ref()
255
255
  const refForm = ref()
256
- const qrtimer = ref(null)
257
256
  const downloadUrl = ref('')
258
257
  const minHeight = ref('auto')
259
258
  const showAI = ref(false);
260
259
  const dialogHeight = ref(props.dialogHeight || (window.innerHeight - 60));
261
260
 
261
+ const qrtimer1 = ref(null)
262
+ const qrtimer2=ref(null)
263
+ onBeforeUnmount(()=>{
264
+ if (model.value && typeof model.value.scripts !== 'undefined') {
265
+ model.value.scripts.formData.form = null;
266
+ model.value.scripts.formData.excuteData = null;
267
+ model.value.scripts.formData.fieldsDic = null;
268
+ model.value.scripts.formData = null;
269
+ }
270
+ Fields.value = null;
271
+ refForm.value = null;
272
+ model.value = null;
273
+ if (qrtimer1.value) {
274
+ clearTimeout(qrtimer1.value);
275
+ qrtimer1.value = null;
276
+ }
277
+ if (qrtimer2.value) {
278
+ clearTimeout(qrtimer2.value);
279
+ qrtimer2.value = null;
280
+ }
281
+ })
282
+
262
283
  onUpdated(() => {
263
284
  nextTick(() => {
264
- qrtimer.value = setTimeout(getisScroll, 100);
285
+ qrtimer1.value = setTimeout(getisScroll, 100);
265
286
  });
266
287
  })
267
288
  onDeactivated(() => {
@@ -330,7 +351,7 @@ function doAction(data) {
330
351
  //判断是否有滚动条
331
352
  function getisScroll() {
332
353
  if (Fields.value) {
333
- clearInterval(qrtimer.value);
354
+ if(qrtimer1.value)clearTimeout(qrtimer1.value);
334
355
  if (refForm.value) {
335
356
  let parentDom = refForm.value.parentElement;
336
357
  if (parentDom.id == "app-form" && parentDom.scrollHeight > window.innerHeight) {
@@ -385,7 +406,7 @@ function validExcute() {
385
406
  model.value.collapseActiveNames.push(f.model.collapseName);
386
407
  timeOut = 300;//展开折叠有个时间并影响滚动条位置,故需要延迟
387
408
  }
388
- setTimeout(function () {
409
+ qrtimer2.value = setTimeout(function () {
389
410
  if (f.model.controlType == Enum.ControlType.List) {
390
411
  if (f.$el.offsetParent) {
391
412
  let total = f.$el.offsetParent.offsetTop;
@@ -666,6 +687,7 @@ function buttonsWidth() {
666
687
  .avatar-img {
667
688
  height: 50px;
668
689
  animation: bounce 0.5s infinite ease-in-out;
690
+ cursor: pointer;
669
691
  /* 使用ease-in-out让动画更平滑 */
670
692
  }
671
693
 
@@ -21,7 +21,7 @@
21
21
  </template>
22
22
  <script lang="ts" setup>
23
23
  import {BaiduMap,BmMarker,BmLabel,BmNavigation} from 'vue-baidu-map-3x'
24
- import { ref, nextTick, onUpdated,onDeactivated , onMounted } from 'vue'
24
+ import { ref, nextTick, onUpdated,onDeactivated , onMounted, onBeforeUnmount } from 'vue'
25
25
  import { initData, changeHandler } from '../../utils/mixins';
26
26
 
27
27
  const emit = defineEmits(['popupLocation'])
@@ -62,6 +62,14 @@ const data = ref({
62
62
  rtnPoint:null,
63
63
  })
64
64
 
65
+ const qrtimer=ref(null)
66
+ onBeforeUnmount(()=>{
67
+ if (qrtimer.value) {
68
+ clearTimeout(qrtimer.value);
69
+ qrtimer.value = null;
70
+ }
71
+ })
72
+
65
73
  function handler({BMap, map}) {
66
74
  // 经度
67
75
  data.value.center.lng = 116.404
@@ -96,7 +104,7 @@ function handler({BMap, map}) {
96
104
  }
97
105
 
98
106
  if(props.apiParam.lng && props.apiParam.lat){
99
- setTimeout(() => {
107
+ qrtimer.value = setTimeout(() => {
100
108
  //偏移处理
101
109
  data.value.center.lng = props.apiParam.lng;
102
110
  data.value.center.lat = props.apiParam.lat;
@@ -62,7 +62,7 @@
62
62
 
63
63
 
64
64
  <script setup lang="ts">
65
- import { ref, nextTick, watch } from 'vue'
65
+ import { ref, nextTick, watch, onBeforeUnmount } from 'vue'
66
66
  import { ElMessage } from 'element-plus'
67
67
  import common from '../../utils/common'
68
68
  import PhotoSelect from '../../loader/src/PhotoSelect';
@@ -85,6 +85,14 @@ const dragOptions = {
85
85
  forceFallback: true,
86
86
  }
87
87
 
88
+ const qrtimer=ref(null)
89
+ onBeforeUnmount(()=>{
90
+ if (qrtimer.value) {
91
+ clearTimeout(qrtimer.value);
92
+ qrtimer.value = null;
93
+ }
94
+ })
95
+
88
96
  const model = ref()
89
97
  init();
90
98
  function init() {
@@ -157,7 +165,7 @@ function handleOpen() {
157
165
  showClose: true,
158
166
  });
159
167
  model.value.valid = false;
160
- setTimeout(() => {
168
+ qrtimer.value = setTimeout(() => {
161
169
  model.value.valid = true;
162
170
  }, 3000);
163
171
  List = List.slice(0, model.value.maxValue1);
@@ -17,7 +17,7 @@
17
17
  </div>
18
18
  </template>
19
19
  <script setup lang="ts">
20
- import { ref, onDeactivated, onMounted } from 'vue'
20
+ import { ref, onDeactivated, onMounted, onBeforeUnmount } from 'vue'
21
21
  import request from '../../utils/request'
22
22
  import common from '../../utils/common'
23
23
  const emit = defineEmits(['finished', 'error'])
@@ -38,6 +38,20 @@ const progressFlag = ref(false)
38
38
  const percentage = ref(0)
39
39
  const message = ref('')
40
40
  const downloadUrl = ref('')
41
+
42
+ const qrtimer1=ref(null)
43
+ const qrtimer2=ref(null)
44
+ onBeforeUnmount(()=>{
45
+ if (qrtimer1.value) {
46
+ clearTimeout(qrtimer1.value);
47
+ qrtimer1.value = null;
48
+ }
49
+ if (qrtimer2.value) {
50
+ clearTimeout(qrtimer2.value);
51
+ qrtimer2.value = null;
52
+ }
53
+ })
54
+
41
55
  function getApiData() {
42
56
  let params = {
43
57
  action: props.progressAction,
@@ -80,7 +94,7 @@ function getApiData() {
80
94
  downloadUrl.value = data.content + "?" + Math.random();
81
95
  }
82
96
  }
83
- setTimeout(() => {
97
+ qrtimer1.value = setTimeout(() => {
84
98
  emit('finished', data);
85
99
  }, 800);
86
100
  }
@@ -89,7 +103,7 @@ function getApiData() {
89
103
  }
90
104
  }
91
105
  else {
92
- setTimeout(() => {
106
+ qrtimer2.value = setTimeout(() => {
93
107
  getApiData();
94
108
  }, 1000);
95
109
  }