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
@@ -230,7 +230,7 @@
230
230
  </div>
231
231
  </template>
232
232
  <script setup lang="ts">
233
- import { ref, nextTick, onActivated, onDeactivated } from 'vue'
233
+ import { ref, nextTick, onActivated, onDeactivated, onBeforeUnmount } from 'vue'
234
234
  import common from '../../../utils/common'
235
235
  import request from '../../../utils/request'
236
236
  import SearchStats from './SearchStats.vue';
@@ -345,7 +345,19 @@ const getRowsRouterRef = (el, index) => {
345
345
  }
346
346
  const refHeadTr = ref()
347
347
  const refTableHead = ref()
348
-
348
+ onBeforeUnmount(()=>{
349
+ if (model.value && typeof model.value.scripts !== 'undefined') {
350
+ model.value.scripts.formData.formTable = null;
351
+ model.value.scripts.formData = null;
352
+ }
353
+ window.removeEventListener("resize", setTableHeight)
354
+ if(refTableParent.value){
355
+ refTableParent.value.removeEventListener("scroll", getScrollAttr);
356
+ refTableParent.value=null
357
+ }
358
+ refSearchTable.value = null;
359
+ model.value = null;
360
+ })
349
361
  onActivated(() => {
350
362
  nextTick(() => {
351
363
  setTableHeight();
@@ -395,9 +407,7 @@ function load(data) {
395
407
  emit("loaded");
396
408
  setTableHeight()
397
409
  nextTick(() => {
398
- window.addEventListener("resize", (ev) => {
399
- setTableHeight();
400
- });
410
+ window.addEventListener("resize", setTableHeight);
401
411
  currentRow.value = null;
402
412
  rowColorChange(model.value.selectIndex, true)
403
413
  fiexdHead()
@@ -44,7 +44,7 @@ import searchTable from './SearchList/searchTable.vue';
44
44
  import SearchCategory from './SearchList/SearchCategory.vue';
45
45
  import SearchSideMenu from './SearchList/SearchSideMenu.vue';
46
46
  import SearchSideRight from './SearchList/SearchSideRight.vue';
47
- import { ref, nextTick, onMounted, watch, onActivated } from 'vue'
47
+ import { ref, nextTick, onMounted, watch, onActivated, onBeforeUnmount } from 'vue'
48
48
  const emit = defineEmits(['loaded', 'failLoad', 'tableLoaded', 'scrollHandle', 'rowClickHandle', 'refreshParent', 'submit', 'flagNotificationParentAfterContentChanged','drag'])
49
49
  const props = defineProps({
50
50
  vmodel: Object,
@@ -122,6 +122,9 @@ const RefSideRight = ref()
122
122
  const refSideMenu = ref()
123
123
  const flagShow = ref(true)
124
124
  const isLayout = ref(true)
125
+ onBeforeUnmount(()=>{
126
+ window.removeEventListener('resize',resizeSearchList)
127
+ })
125
128
  onMounted(() => {
126
129
  nextTick(() => {
127
130
  if (refMain.value) {
@@ -275,9 +278,7 @@ function tableLoaded() {
275
278
  sideMenuClickHandler(status);
276
279
  }
277
280
  }
278
- window.addEventListener("resize", (ev) => {
279
- resizeSearchList();
280
- });
281
+ window.addEventListener("resize", resizeSearchList);
281
282
  }
282
283
  else {
283
284
  flagSideBarOfData.value = false;
@@ -22,9 +22,9 @@
22
22
  @SaveSearchWhere="SaveSearchWhere" @SearchWhereManage="SearchWhereManage"
23
23
  @clickSearchWhere="clickSearchWhere"></component>
24
24
  <br v-else-if="col.controlType === Enum.ControlType.LineFeed" />
25
- <component v-else :from="from" class="list-field" v-bind="col.listBind"
26
- :is="col.is" :vmodel="col" :parameterAction="model.parameterAction"
27
- @search="searchHandler(col)" @change="changeHandler(col)">
25
+ <component v-else :from="from" class="list-field" v-bind="col.listBind" :is="col.is"
26
+ :vmodel="col" :parameterAction="model.parameterAction" @search="searchHandler(col)"
27
+ @change="changeHandler(col)">
28
28
  </component>
29
29
  </template>
30
30
  </template>
@@ -55,7 +55,6 @@
55
55
  <script setup lang="ts">
56
56
  import { ref, nextTick, onDeactivated } from 'vue'
57
57
  import SearchScreen from '../../loader/src/SearchScreen'
58
- import Form from '../../loader/src/Form'
59
58
  import Enum from '../../utils/Enum'
60
59
  import common from '../../utils/common';
61
60
  const emit = defineEmits(['loaded', 'failLoad', 'showTitle', 'search', 'resetSearch', 'saveShortcut'])
@@ -114,6 +113,19 @@ function searchComplate(flagLoad) {
114
113
  //加载数据
115
114
  function load(data) {
116
115
  model.value = data;
116
+ if (model.value.scripts) {
117
+ model.value.scripts.formData = model.value.formData;
118
+ model.value.scripts.formData.form = model.value;
119
+ model.value.scripts.formData.excuteData = model.value.screen;
120
+ model.value.scripts.formData.fieldsDic = model.value.screenDic;
121
+ model.value.scripts.formData.source = SearchScreen;
122
+ }
123
+ if (model.value.onload) {
124
+ let onloads = model.value.onload.split(';');
125
+ onloads.forEach((v) => {
126
+ common.excute.call(model.value.scripts, v);
127
+ });
128
+ }
117
129
  setScreenShow();
118
130
  loading.value = false;
119
131
  emit('loaded', model.value.flagSearch);
@@ -139,8 +151,7 @@ function setScreenShow() {
139
151
  }
140
152
  //组件值发生变化时操作
141
153
  function changeHandler(field) {
142
- SearchScreen.hiddenHandle(field, model.value);
143
- Form.clearRelatedHandle(field, model.value.screen)
154
+ SearchScreen.changeHandler(field, model.value);
144
155
  }
145
156
  //按钮执行
146
157
  function searchHandler(field) {
@@ -32,7 +32,7 @@
32
32
  </div>
33
33
  </template>
34
34
  <script setup lang="ts">
35
- import { ref, nextTick, ComponentPublicInstance } from 'vue'
35
+ import { ref, nextTick, ComponentPublicInstance, onBeforeUnmount } from 'vue'
36
36
  import common from '../../../utils/common'
37
37
  import { RouterClickHandler } from '../../../utils/mixins';
38
38
  import Enum from '../../../utils/Enum'
@@ -80,17 +80,24 @@ const handleSetInputMap = (el: refItem, item) => {
80
80
  }
81
81
  };
82
82
 
83
+ const qrtimer=ref(null)
84
+ onBeforeUnmount(()=>{
85
+ if (qrtimer.value) {
86
+ clearTimeout(qrtimer.value);
87
+ qrtimer.value = null;
88
+ }
89
+ })
90
+
83
91
  //搜索(查询条件调用)
84
92
  function search(m) {
85
- let timer;
86
93
  if (searchStatus.value.length == 0) {
87
- clearTimeout(timer);
94
+ if(qrtimer.value)clearTimeout(qrtimer.value);
88
95
  searchStatus.value.push('a');
89
96
  rootNode.value.childNodes = []
90
97
  loadNode(rootNode.value, rootResolve.value,m)
91
98
  }
92
99
  else {
93
- timer = setTimeout(() => {
100
+ qrtimer.value = setTimeout(() => {
94
101
  search(m);
95
102
  }, 200);
96
103
  }
@@ -11,7 +11,7 @@
11
11
  </div>
12
12
  </template>
13
13
  <script lang="ts" setup>
14
- import { ref, nextTick, watch, onMounted } from 'vue'
14
+ import { ref, nextTick, watch, onMounted, onBeforeUnmount } from 'vue'
15
15
  import Tree from './Tree/Tree.vue';
16
16
  const emit = defineEmits(['loaded'])
17
17
  const loadTree=ref(false)
@@ -33,10 +33,19 @@ const refscreenDiv = ref()
33
33
  const reftreescreen = ref()
34
34
  const reftree = ref()
35
35
  const treeHeight = ref(0)
36
+
37
+ const qrtimer=ref(null)
38
+ onBeforeUnmount(()=>{
39
+ if (qrtimer.value) {
40
+ clearTimeout(qrtimer.value);
41
+ qrtimer.value = null;
42
+ }
43
+ })
44
+
36
45
  function setTreeHeight() {
37
46
  nextTick(() => {
38
47
  if (refscreenDiv.value) {
39
- setTimeout(() => {
48
+ qrtimer.value = setTimeout(() => {
40
49
  let searchHeight = refscreenDiv.value.offsetHeight;
41
50
  treeHeight.value = props.searchtreeHeight - searchHeight;
42
51
  }, 200);
@@ -228,6 +228,7 @@ const displayAreaHeight = ref(0)
228
228
  const downloadUrl = ref("")
229
229
  const downloadLoading = ref(false)
230
230
  const mediaLabelShow=ref(false)
231
+ const qrtimer=ref(null)
231
232
 
232
233
  groupCountLen.value = 0;
233
234
  props.MediaAlbum.forEach((item, n) => {
@@ -294,7 +295,7 @@ function handDownloadUrl(url) {
294
295
  else {
295
296
  downloadUrl.value = getDownloadUrl(url) + "?download=1&" + Math.random();
296
297
  }
297
- setTimeout(function () {
298
+ qrtimer.value = setTimeout(function () {
298
299
  downloadLoading.value = false;
299
300
  }, 1000);
300
301
  }
@@ -421,7 +422,11 @@ function enterFullscreen(n) {
421
422
  refviewerP360.value.enterFullscreen(n);
422
423
  }
423
424
  onUnmounted(() => {
424
- window.onresize = null;
425
+ window.onresize = null;
426
+ if (qrtimer.value) {
427
+ clearTimeout(qrtimer.value);
428
+ qrtimer.value = null;
429
+ }
425
430
  })
426
431
  </script>
427
432
  <style scoped>
@@ -10,7 +10,7 @@
10
10
  </div>
11
11
  </template>
12
12
  <script setup>
13
- import { ref, nextTick, watch, onMounted } from 'vue'
13
+ import { ref, nextTick, watch, onMounted, onBeforeUnmount } from 'vue'
14
14
  import AppContainer from '../../loader/src/AppContainer';
15
15
  import appContainerLayout from './appContainer/appContainerLayout.vue'
16
16
 
@@ -29,6 +29,9 @@ const appContainerLeft = ref(0)
29
29
  const appContainerHeight = ref(0)
30
30
  const appContainerWidth = ref(0)
31
31
  const refappContainer = ref()
32
+ onBeforeUnmount(()=>{
33
+ window.removeEventListener('resize',setresize)
34
+ })
32
35
  function init() {
33
36
 
34
37
  //初始化
@@ -2,7 +2,7 @@
2
2
  <render />
3
3
  </template>
4
4
  <script setup>
5
- import { h, ref, onActivated, resolveComponent } from 'vue'
5
+ import { h, ref, onActivated, resolveComponent, onBeforeUnmount } from 'vue'
6
6
  const emit = defineEmits(['close'])
7
7
  const props = defineProps({
8
8
  vmodel: Object,
@@ -12,6 +12,9 @@ const contentTop = ref(0)
12
12
  const content = ref()
13
13
  const captionBarButtons = ref([])
14
14
  const modelSelf = ref(null)
15
+ onBeforeUnmount(()=>{
16
+ modelSelf.value=null
17
+ })
15
18
  onActivated(() => {
16
19
  if (contentTop.value && content) {
17
20
  content.value.scrollTop = contentTop.value;
@@ -29,7 +32,7 @@ function scrollHandle(ev) {
29
32
  ev.stopPropagation();
30
33
  }
31
34
 
32
- const render = () => {
35
+ const render = () => {
33
36
  return h('div', {}, [
34
37
  h('div', {
35
38
  style: {
@@ -57,7 +57,7 @@
57
57
  </div>
58
58
  </template>
59
59
  <script setup lang="ts">
60
- import { ref, nextTick } from 'vue'
60
+ import { ref, nextTick, onBeforeUnmount } from 'vue'
61
61
  import { ElMessage } from 'element-plus'
62
62
  import common from '../../../utils/common'
63
63
  import { RouterClickHandler } from '../../../utils/mixins';
@@ -86,6 +86,11 @@ const isBusy = ref(false)
86
86
  const elTableHeight = ref(0)
87
87
  const selectCount = ref(0)
88
88
  const multipleTable = ref()
89
+
90
+ onBeforeUnmount(()=>{
91
+ multipleTable.value.$el.querySelector('.el-scrollbar__wrap').removeEventListener('scroll', scrollHandle);
92
+ multipleTable.value=null;
93
+ })
89
94
  function load(data) {
90
95
  loadingOne.value = false;
91
96
  model.value = data;
@@ -146,6 +146,8 @@ const refupload = ref()
146
146
  const QRCodeRef = ref()
147
147
  const UploadhttpRequest = ref({})
148
148
  const model = ref(null)
149
+ const qrtimer1=ref(null)
150
+ const qrtimer2=ref(null)
149
151
 
150
152
  const headers = computed(() => {
151
153
  return common.getDataDrivenOpts().handler.getRequestHeaders();
@@ -222,7 +224,7 @@ function handleRemove(file) {
222
224
  }).then(() => {
223
225
  Photo.deleteFile(file, false, model.value);
224
226
  selfValidExcute("remove");
225
- setTimeout(() => {
227
+ qrtimer1.value = setTimeout(() => {
226
228
  QRCodeLocate();
227
229
  }, 1080);
228
230
 
@@ -274,7 +276,7 @@ function uploadProcess(event, file, fileList) {
274
276
  file.loadProgress = parseInt(event.percent); // 动态获取文件上传进度
275
277
  if (file.loadProgress >= 100) {
276
278
  file.loadProgress = 100;
277
- setTimeout(() => {
279
+ qrtimer2.value = setTimeout(() => {
278
280
  file.progressFlag = false;
279
281
  }, 1000); // 一秒后关闭进度条
280
282
  }
@@ -522,10 +524,21 @@ function ListenerPaste(event) {
522
524
  document.addEventListener('paste', ListenerPaste);
523
525
  onBeforeUnmount(() => {
524
526
  //销毁定时上传
525
- clearTimeout(model.value.qrtimer);
527
+ if (model.value.qrtimer) {
528
+ clearTimeout(model.value.qrtimer);
529
+ model.value.qrtimer = null;
530
+ }
526
531
  window.removeEventListener('scroll', model.value.QRCodeLocate, true)
527
532
  //销毁贴事件监听器
528
533
  document.removeEventListener('paste', ListenerPaste)
534
+ if (qrtimer1.value) {
535
+ clearTimeout(qrtimer1.value);
536
+ qrtimer1.value = null;
537
+ }
538
+ if (qrtimer2.value) {
539
+ clearTimeout(qrtimer2.value);
540
+ qrtimer2.value = null;
541
+ }
529
542
  })
530
543
  defineExpose({
531
544
  model
@@ -829,6 +829,11 @@ const Base = function (source, moreActionRouter) {
829
829
  }
830
830
  else {
831
831
  this.value = this.defaultCode1
832
+ if(this.searchName){
833
+ this.searchName=''
834
+ this.searchValue=''
835
+ this.searchValue1=''
836
+ }
832
837
  }
833
838
 
834
839
  }
@@ -1,7 +1,9 @@
1
+ import base from '../index';
1
2
  import LibFunction from './LibFunction';
2
3
  import Enum from '../../utils/Enum';
3
4
  import common from '../../utils/common';
4
5
  import request from '../../utils/request';
6
+ import formData from '../../utils/formData';
5
7
 
6
8
  function loadSearchScreenApi(action, callBack, screenPara, prevParam, failCallBack) {
7
9
  if (action) {
@@ -26,6 +28,7 @@ function loadSearchScreenApi(action, callBack, screenPara, prevParam, failCallBa
26
28
  }
27
29
  function loadSearchScreenModel(source, prevParam) {
28
30
  let rtn = {
31
+ formData:formData,
29
32
  get title() {
30
33
  return source.title;
31
34
  },
@@ -41,6 +44,22 @@ function loadSearchScreenModel(source, prevParam) {
41
44
  get parameterAction() {
42
45
  return source.parameterAction
43
46
  },
47
+ _scripts: null,
48
+ get scripts() {
49
+ if (rtn._scripts !== null) {
50
+ return rtn._scripts;
51
+ }
52
+ else {
53
+ if (source.scripts) {
54
+ rtn._scripts = base.common.eval(source.scripts);
55
+ return rtn._scripts;
56
+ }
57
+ else {
58
+ rtn._scripts = base.common.eval("");
59
+ return rtn._scripts;
60
+ }
61
+ }
62
+ },
44
63
  _screen: null,
45
64
  _btnScreen: null,
46
65
  _highScreen: null,
@@ -415,12 +434,52 @@ function getAction(api, callback) {
415
434
  }
416
435
  });
417
436
  }
437
+ function changeHandler(field, model){
438
+ hiddenHandle(field, model);
439
+ clearRelatedHandle(field, model.screen)
440
+ if (field.onChanged) {
441
+ if (model.scripts) {
442
+ model.scripts.formData.setExcuteListData(model.screen);
443
+ }
444
+ model.scripts.$fd = field.id;
445
+ common.excute.call(model.scripts, field.onChanged);
446
+ }
447
+ if (field.onAfterChanged && field.controlType !== Enum.ControlType.NumericTextBox) {
448
+ var router = model.actionRouters.find((v) => {
449
+ return v.key === field.onAfterChanged;
450
+ });
451
+ if (router) {
452
+ model.$vue.clickHandler(router);
453
+ }
454
+ else {
455
+ if (model.scripts) {
456
+ model.scripts.formData.setExcuteListData(model.fields);
457
+ }
458
+ model.scripts.$fd = field.id;
459
+ common.excute.call(model.scripts, field.onAfterChanged);
460
+ }
461
+ }
462
+ }
463
+ //清除关联当前组件的组件值
464
+ function clearRelatedHandle(field, fields) {
465
+ var f = fields.filter((v) => {
466
+ return v.parentField && field.fieldName1 && (',' + v.parentField + ',').indexOf(',' + field.fieldName1 + ',') > -1;
467
+ });
468
+ f.forEach((v) => {
469
+ if (v.reset) {
470
+ v.reset();
471
+ }
472
+ clearRelatedHandle(v, fields)
473
+ });
474
+ }
418
475
  const SearchScreen = {
419
476
  loadSearchScreenApi,
420
477
  loadSearchScreenModel,
421
478
  hiddenHandle,
422
479
  isHandle,
423
480
  getNewSearchValue,
424
- getAction
481
+ getAction,
482
+ changeHandler,
483
+ clearRelatedHandle
425
484
  };
426
485
  export default SearchScreen;
package/src/main.js CHANGED
@@ -30,10 +30,10 @@ app.use(centaline, {
30
30
  //baseUrl: "http://10.1.245.111:38028/",
31
31
 
32
32
  flagRouterSelf: true,
33
- flagApp: true,//是否app端
33
+ flagApp: false,//是否app端
34
34
  zindex: 999,
35
35
  showRequestSuccessMessage: true,
36
- showRequestErrorMessage: true,
36
+ showRequestErrorMessage: false,
37
37
  language: 'HK',
38
38
  handler: {
39
39
  // 打开tab页
@@ -68,7 +68,7 @@ app.use(centaline, {
68
68
  //authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
69
69
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
70
70
  //authObject: '{token:"1-bce18a8d-21f0-4022-a6ca-450de105cafc"}',
71
- authObject: '{EmpID:"Token_24ffcd48-4caa-4158-af20-b6dea70d869e",MachineCode:"7c4b2ffd-920a-462c-a586-37bbfb45c4fe",SSO_Token:"SSOToken_24ffcd48-4caa-4158-af20-b6dea70d869e",Platform:"IOS"}',
71
+ authObject: '{EmpID:"Token_0b4aa384-effe-43ec-9912-dddce2cd9709",MachineCode:"7c4b2ffd-920a-462c-a586-37bbfb45c4fe",SSO_Token:"SSOToken_0b4aa384-effe-43ec-9912-dddce2cd9709",Platform:"WEB"}',
72
72
  };
73
73
  },
74
74
  getToken() {
@@ -285,7 +285,10 @@ const common = {
285
285
  showDialog({ title: '提示', message: message, closeOnClickOverlay: true, confirmButtonText: this.LocalizedString('确定', '確認'), className: 'showDialogMessage' });
286
286
  }
287
287
  else {
288
- showToast(message);
288
+ showToast({
289
+ message: message,
290
+ duration: 3000,
291
+ });
289
292
  }
290
293
 
291
294
  }