centaline-data-driven-v3 0.1.47 → 0.1.49

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 (37) hide show
  1. package/dist/centaline-data-driven-v3.umd.js +84 -84
  2. package/package.json +1 -1
  3. package/src/assets/commonWeb.css +13 -0
  4. package/src/components/web/CheckBox.vue +1 -0
  5. package/src/components/web/CheckBoxList.vue +6 -3
  6. package/src/components/web/ComboBox.vue +1 -1
  7. package/src/components/web/ContainerControl.vue +1 -0
  8. package/src/components/web/Cron.vue +1 -0
  9. package/src/components/web/DatePicker.vue +1 -0
  10. package/src/components/web/File.vue +1 -0
  11. package/src/components/web/Form.vue +13 -10
  12. package/src/components/web/GroupList.vue +1 -0
  13. package/src/components/web/GroupSplitLine.vue +1 -0
  14. package/src/components/web/HyperLink.vue +1 -0
  15. package/src/components/web/HyperLinkList.vue +1 -0
  16. package/src/components/web/Image.vue +1 -0
  17. package/src/components/web/JsonViewer.vue +1 -0
  18. package/src/components/web/Label.vue +1 -0
  19. package/src/components/web/MultiComboBoxWithTextBox.vue +1 -0
  20. package/src/components/web/NumberWithPlusAndMinus.vue +1 -0
  21. package/src/components/web/NumericRange.vue +1 -0
  22. package/src/components/web/RadioButton.vue +1 -0
  23. package/src/components/web/SearchList/SearchTable.vue +8 -2
  24. package/src/components/web/SearchList.vue +3 -0
  25. package/src/components/web/Tags.vue +1 -0
  26. package/src/components/web/TextBox.vue +1 -0
  27. package/src/components/web/Tree/Tree.vue +172 -88
  28. package/src/loader/src/CheckBoxList.js +113 -0
  29. package/src/loader/src/DatePicker.js +9 -8
  30. package/src/loader/src/Field.js +17 -5
  31. package/src/loader/src/Form.js +11 -3
  32. package/src/loader/src/SearchTable.js +11 -1
  33. package/src/main.js +2 -2
  34. package/src/utils/mixins.js +13 -0
  35. package/src/utils/request.js +2 -5
  36. package/src/views/Form.vue +4 -3
  37. package/src/views/SearchList.vue +5 -7
@@ -1,12 +1,13 @@
1
1
  <template>
2
2
  <div id="ct-tree" class="ct-tree" oncontextmenu="event.preventDefault()" style="overflow:auto;" v-loading="loading"
3
3
  :style="{ height: props.treeHeight - 10 + 'px' }">
4
- <el-tree class="tree-line" :props="defaultProps" :expand-on-click-node="false"
5
- @node-click="handleNodeClick"
4
+ <el-tree class="tree-line" :props="defaultProps" :expand-on-click-node="false" @node-click="handleNodeClick"
6
5
  :filter-node-method="filterNode" lazy :load="loadNode" ref="refTree" @node-contextmenu="handleContextMenu"
7
6
  node-key="code" current-node-key="currentNodeKey" :default-expanded-keys="defaultExpandedKeys">
8
7
  <template #default="{ node, data }">
9
- <span class="node_content" @mouseenter="handleMouseEnter(data, node)" @mousemove="handleMouseMove">
8
+ <!-- 添加鼠标离开事件监听 -->
9
+ <span class="node_content" @mouseenter="handleMouseEnter(data, node)" @mouseleave="handleMouseLeave(data)"
10
+ @mousemove="handleMouseMove">
10
11
  <el-icon class="node-icon" :class="{ 'is-leaf': node.isLeaf }">
11
12
  <Document v-if="node.isLeaf" :size="14" />
12
13
  <Folder v-else-if="!node.expanded" :size="14" />
@@ -16,10 +17,12 @@
16
17
  {{ data.name }}
17
18
  </span>
18
19
  <span @click.stop>
19
- <el-popover placement="right" :show-arrow="false" :virtual-ref="nodeRef" virtual-triggering :visible="showPopover(data)" v-if="showPopover(data)" :show-after="0"
20
- :hide-after="0" :popper-class="allIconsMode ? 'popper-transparent' : 'popper-menu'"
21
- :popper-style="popoverStyle">
22
- <div class="box-menu" :class="{ 'box-menu-icons': allIconsMode }">
20
+ <el-popover placement="right" :show-arrow="false" :virtual-ref="nodeRef" virtual-triggering
21
+ :visible="showPopover(data)" v-if="showPopover(data)" :show-after="0" :hide-after="0"
22
+ :popper-class="allIconsMode ? 'popper-transparent' : 'popper-menu'" :popper-style="popoverStyle">
23
+ <!-- 添加菜单区域的鼠标事件,防止移入菜单时触发离开 -->
24
+ <div class="box-menu" :class="{ 'box-menu-icons': allIconsMode }" @mouseenter="handleMenuEnter"
25
+ @mouseleave="handleMenuLeave">
23
26
  <template v-for="(item, index) in allowedRoutes">
24
27
  <template v-if="allIconsMode">
25
28
  <img class="opertion" v-if="item.imgUrl" :src="item.imgUrl" :alt="item.controlLabel || ''"
@@ -103,6 +106,9 @@ const hoverNodeCode = ref('')
103
106
  const isHoverMode = ref(false) // 是否是悬停模式
104
107
  const isManualClose = ref(false) // 是否是手动关闭
105
108
  const allIconsMode = ref(false) // 是否全是图标模式
109
+ // 新增:菜单相关状态
110
+ const isMouseInMenu = ref(false) // 鼠标是否在菜单内
111
+ const isMouseInNode = ref(false) // 鼠标是否在节点内
106
112
  // 新增:弹出框位置控制
107
113
  const popoverStyle = ref({})
108
114
  const currentMousePosition = ref({ x: 0, y: 0 }) // 当前鼠标位置
@@ -128,6 +134,9 @@ const isLazyInitialized = ref(false) // 标记是否已经初始化过lazy值
128
134
  // 新增:记录节点加载状态的Map
129
135
  const nodeLoadedStatus = ref(new Map())
130
136
 
137
+ // 新增:关闭菜单的定时器
138
+ const closeTimer = ref(null)
139
+
131
140
  /** 动态设置Input Ref */
132
141
  const handleSetInputMap = (el: refItem, item) => {
133
142
  if (el) {
@@ -145,6 +154,10 @@ onBeforeUnmount(() => {
145
154
  clearTimeout(hoverTimer.value);
146
155
  hoverTimer.value = null;
147
156
  }
157
+ if (closeTimer.value) {
158
+ clearTimeout(closeTimer.value);
159
+ closeTimer.value = null;
160
+ }
148
161
  })
149
162
 
150
163
  // 检查allowedRoutes是否全是图标
@@ -161,6 +174,7 @@ function showPopover(data) {
161
174
 
162
175
  const isCurrentNode = data.code === currentData.value.code;
163
176
  const hasRoutes = allowedRoutes.value.length > 0;
177
+
164
178
  if (isHoverMode.value) {
165
179
  // 悬停模式:当前节点且有路由就显示
166
180
  return isCurrentNode && hasRoutes && menuVisible.value;
@@ -172,14 +186,19 @@ function showPopover(data) {
172
186
 
173
187
  // 鼠标进入节点
174
188
  function handleMouseEnter(data, node) {
175
- // if (isManualClose.value) {
176
- // isManualClose.value = false;
177
- // return;
178
- // }
189
+ // 清除可能存在的关闭定时器
190
+ if (closeTimer.value) {
191
+ clearTimeout(closeTimer.value);
192
+ closeTimer.value = null;
193
+ }
194
+
195
+ isMouseInNode.value = true;
196
+
179
197
  // 检查当前节点的allowedRoutes是否全是图标
180
198
  const routes = getAllowedRoutesForNode(data);
181
199
  const allIcons = checkIfAllIcons(routes);
182
200
  allIconsMode.value = allIcons;
201
+
183
202
  if (allIcons) {
184
203
  isHoverMode.value = true;
185
204
  hoverNodeCode.value = data.code;
@@ -191,6 +210,53 @@ function handleMouseEnter(data, node) {
191
210
  }
192
211
  }
193
212
 
213
+ // 鼠标离开节点
214
+ function handleMouseLeave(data) {
215
+ isMouseInNode.value = false;
216
+
217
+ // 如果是悬停模式且全是图标模式,开始关闭计时
218
+ if (isHoverMode.value && allIconsMode.value && !isMouseInMenu.value) {
219
+ startCloseTimer();
220
+ }
221
+ }
222
+
223
+ // 鼠标进入菜单
224
+ function handleMenuEnter() {
225
+ isMouseInMenu.value = true;
226
+
227
+ // 清除关闭定时器
228
+ if (closeTimer.value) {
229
+ clearTimeout(closeTimer.value);
230
+ closeTimer.value = null;
231
+ }
232
+ }
233
+
234
+ // 鼠标离开菜单
235
+ function handleMenuLeave() {
236
+ isMouseInMenu.value = false;
237
+
238
+ // 如果鼠标也不在节点内,开始关闭计时
239
+ if (isHoverMode.value && allIconsMode.value && !isMouseInNode.value) {
240
+ startCloseTimer();
241
+ }
242
+ }
243
+
244
+ // 开始关闭计时器
245
+ function startCloseTimer() {
246
+ // 清除已有的计时器
247
+ if (closeTimer.value) {
248
+ clearTimeout(closeTimer.value);
249
+ closeTimer.value = null;
250
+ }
251
+
252
+ // 设置关闭计时器(延迟300ms关闭,避免误触)
253
+ closeTimer.value = setTimeout(() => {
254
+ if (!isMouseInNode.value && !isMouseInMenu.value) {
255
+ closeMenu();
256
+ }
257
+ }, 300);
258
+ }
259
+
194
260
  // 鼠标移动事件
195
261
  function handleMouseMove(event) {
196
262
  // 更新鼠标位置
@@ -238,11 +304,18 @@ function updatePopoverPosition() {
238
304
  function handleContextMenu(event, object, node) {
239
305
  event.preventDefault();
240
306
 
307
+ // 清除可能的关闭计时器
308
+ if (closeTimer.value) {
309
+ clearTimeout(closeTimer.value);
310
+ closeTimer.value = null;
311
+ }
312
+
241
313
  // 记录鼠标位置
242
314
  currentMousePosition.value = {
243
315
  x: event.clientX,
244
316
  y: event.clientY
245
317
  };
318
+
246
319
  // 检查当前节点的allowedRoutes是否全是图标
247
320
  const routes = getAllowedRoutesForNode(object);
248
321
  const allIcons = checkIfAllIcons(routes);
@@ -251,7 +324,9 @@ function handleContextMenu(event, object, node) {
251
324
  if (allIcons) {
252
325
  return;
253
326
  }
327
+
254
328
  isManualClose.value = false;
329
+ isMouseInNode.value = true;
255
330
  showNodeMenu(object, node, false);
256
331
  }
257
332
 
@@ -308,6 +383,8 @@ function closeMenu() {
308
383
  isManualClose.value = true;
309
384
  menuVisible.value = false;
310
385
  isHoverMode.value = false;
386
+ isMouseInMenu.value = false;
387
+ isMouseInNode.value = false;
311
388
  lastNodeCode.value = '';
312
389
  isPositionLockedForCurrentNode.value = false;
313
390
 
@@ -316,6 +393,12 @@ function closeMenu() {
316
393
  // 重置弹出框样式
317
394
  popoverStyle.value = {};
318
395
 
396
+ // 清除关闭计时器
397
+ if (closeTimer.value) {
398
+ clearTimeout(closeTimer.value);
399
+ closeTimer.value = null;
400
+ }
401
+
319
402
  // 移除事件监听
320
403
  document.removeEventListener('click', closeMenuOnClick);
321
404
 
@@ -717,7 +800,7 @@ function getAllowedRoutesForNode(data) {
717
800
  }
718
801
 
719
802
  // 修改:加载节点,保存节点Map
720
- function loadNode(node, resolve) {
803
+ function loadNode(node, resolve) {
721
804
  // 如果是根节点(level === 0),清空节点加载状态
722
805
  if (node.level === 0) {
723
806
  nodeLoadedStatus.value.clear();
@@ -731,7 +814,7 @@ function loadNode(node, resolve) {
731
814
  }
732
815
  return;
733
816
  }
734
-
817
+
735
818
  // 如果节点已经有数据且不是懒加载模式,直接返回子节点
736
819
  if (node.data && node.data.children && node.data.children.length > 0 && !lazy.value) {
737
820
  resolve(node.data.children);
@@ -743,7 +826,7 @@ function loadNode(node, resolve) {
743
826
  loading.value = true;
744
827
  rootNode.value = node;
745
828
  rootResolve.value = resolve;
746
-
829
+
747
830
  return SearchTree(screenPara.value || undefined).then(data => {
748
831
  loading.value = false;
749
832
  // 重置前折叠所有节点
@@ -774,8 +857,8 @@ function loadNode(node, resolve) {
774
857
  // 无论是否第一次加载,都解析树数据
775
858
  const resultData = hasAnyLeaf ? tree : data.rows;
776
859
  resolve(resultData);
777
-
778
-
860
+
861
+
779
862
 
780
863
  if (props.expandTwoLevels && hasAnyLeaf) {
781
864
  fullTreeData.value = tree;
@@ -799,74 +882,73 @@ function loadNode(node, resolve) {
799
882
  }
800
883
 
801
884
  // 懒加载模式加载子节点
802
- // 懒加载模式加载子节点
803
885
  if (node.level >= 1 && lazy.value) {
804
-
805
- // 设置节点为加载中状态
806
- if (node && node.key) {
807
- nodeLoadedStatus.value.set(node.key, 'loading');
808
- }
809
-
810
- // 检查是否已经有子节点数据
811
- if (node.data.children && node.data.children.length > 0) {
886
+
887
+ // 设置节点为加载中状态
812
888
  if (node && node.key) {
813
- nodeLoadedStatus.value.set(node.key, 'loaded');
889
+ nodeLoadedStatus.value.set(node.key, 'loading');
814
890
  }
815
- resolve(node.data.children);
816
- return;
817
- }
818
891
 
819
- let fields = model.value.searchData("code", node.data.code, 9, 3);
820
- let filter = {
821
- "searchData": {
822
- ...(screenPara.value?.searchData || {}),
823
- fields: [
824
- ...fields.fields,
825
- ...(screenPara.value?.searchData?.fields || [])
826
- ]
892
+ // 检查是否已经有子节点数据
893
+ if (node.data.children && node.data.children.length > 0) {
894
+ if (node && node.key) {
895
+ nodeLoadedStatus.value.set(node.key, 'loaded');
896
+ }
897
+ resolve(node.data.children);
898
+ return;
827
899
  }
828
- };
829
900
 
830
- return SearchTree(filter).then(data => {
831
- // 标记节点为已加载
832
- if (node && node.key) {
833
- nodeLoadedStatus.value.set(node.key, 'loaded');
834
- }
835
-
836
- // 关键:更新节点的数据,添加children属性
837
- if (node.data) {
838
- node.data.children = data.rows;
839
-
840
- // 判断是否没有子节点
841
- if (!data.rows || data.rows.length === 0) {
842
- // 没有子节点,设置节点为叶子节点
901
+ let fields = model.value.searchData("code", node.data.code, 9, 3);
902
+ let filter = {
903
+ "searchData": {
904
+ ...(screenPara.value?.searchData || {}),
905
+ fields: [
906
+ ...fields.fields,
907
+ ...(screenPara.value?.searchData?.fields || [])
908
+ ]
909
+ }
910
+ };
911
+
912
+ return SearchTree(filter).then(data => {
913
+ // 标记节点为已加载
914
+ if (node && node.key) {
915
+ nodeLoadedStatus.value.set(node.key, 'loaded');
916
+ }
917
+
918
+ // 关键:更新节点的数据,添加children属性
919
+ if (node.data) {
920
+ node.data.children = data.rows;
921
+
922
+ // 判断是否没有子节点
923
+ if (!data.rows || data.rows.length === 0) {
924
+ // 没有子节点,设置节点为叶子节点
925
+ node.data.isLeaf = true;
926
+ node.isLeaf = true;
927
+ } else {
928
+ // 有子节点,设置节点为非叶子节点
929
+ node.data.isLeaf = false;
930
+ node.isLeaf = false;
931
+ }
932
+ }
933
+
934
+ resolve(data.rows || []);
935
+ load(data, false);
936
+ }).catch(error => {
937
+ loading.value = false;
938
+ if (node && node.key) {
939
+ nodeLoadedStatus.value.delete(node.key);
940
+ }
941
+ console.error('加载子节点失败:', error);
942
+
943
+ // 加载失败时,如果没有子节点数据,也标记为叶子节点
944
+ if (node && node.data) {
843
945
  node.data.isLeaf = true;
844
946
  node.isLeaf = true;
845
- } else {
846
- // 有子节点,设置节点为非叶子节点
847
- node.data.isLeaf = false;
848
- node.isLeaf = false;
849
947
  }
850
- }
851
-
852
- resolve(data.rows || []);
853
- load(data, false);
854
- }).catch(error => {
855
- loading.value = false;
856
- if (node && node.key) {
857
- nodeLoadedStatus.value.delete(node.key);
858
- }
859
- console.error('加载子节点失败:', error);
860
-
861
- // 加载失败时,如果没有子节点数据,也标记为叶子节点
862
- if (node && node.data) {
863
- node.data.isLeaf = true;
864
- node.isLeaf = true;
865
- }
866
-
867
- resolve([]);
868
- });
869
- }
948
+
949
+ resolve([]);
950
+ });
951
+ }
870
952
  }
871
953
 
872
954
  // 加载数据
@@ -962,14 +1044,14 @@ function clearSearch() {
962
1044
  }
963
1045
 
964
1046
  // 修改:节点点击事件,支持自动展开和懒加载
965
- function handleNodeClick(data) {
966
-
1047
+ function handleNodeClick(data) {
1048
+
967
1049
  closeMenu();
968
-
1050
+
969
1051
  // 设置当前选中节点
970
1052
  if (data && data.code) {
971
1053
  refTree.value?.setCurrentKey(data.code);
972
-
1054
+
973
1055
  // 如果是懒加载模式,检查节点是否需要加载子节点
974
1056
  if (lazy.value) {
975
1057
  const treeNode = refTree.value.getNode(data.code);
@@ -986,12 +1068,12 @@ function handleNodeClick(data) {
986
1068
  // 没有子节点,标记为叶子节点
987
1069
  treeNode.isLeaf = true;
988
1070
  treeNode.loaded = true;
989
-
1071
+
990
1072
  // 更新原始数据中的 isLeaf 属性
991
1073
  if (treeNode.data) {
992
1074
  treeNode.data.isLeaf = true;
993
1075
  }
994
-
1076
+
995
1077
  // 如果有父节点,更新父节点的children数组
996
1078
  if (treeNode.parent && treeNode.parent.data) {
997
1079
  const parentData = treeNode.parent.data;
@@ -1015,7 +1097,7 @@ function handleNodeClick(data) {
1015
1097
  }
1016
1098
  }
1017
1099
  }
1018
-
1100
+
1019
1101
  if (LastClickNode.value != data) {
1020
1102
  LastClickNode.value = data;
1021
1103
  let rowRouter = model.value.rowSelectRouter;
@@ -1050,7 +1132,14 @@ function routerClickHandler(field) {
1050
1132
  submitData.actionType = field.actionType;
1051
1133
 
1052
1134
  RouterClickHandler(field, submitData, null, model.value, 'tree', function (newData) {
1135
+ if (newData?.responseData?.notification == Enum.ActionType.Refersh || field.actionType == Enum.ActionType.Refersh) {
1136
+ isLazyInitialized.value = false;
1137
+ lazy.value = true;
1138
+ search(screenPara.value);
1139
+ return false;
1140
+ }
1053
1141
  switch (field.actionType) {
1142
+
1054
1143
  case Enum.ActionType.Delete:
1055
1144
  case Enum.ActionType.CloseTabThenDelete:
1056
1145
  removeNode(newData);
@@ -1063,6 +1152,7 @@ function routerClickHandler(field) {
1063
1152
  case Enum.ActionType.CloseTabThenUpdate:
1064
1153
  updateNode(newData)
1065
1154
  break;
1155
+
1066
1156
  default:
1067
1157
  break;
1068
1158
  }
@@ -1411,7 +1501,6 @@ defineExpose({
1411
1501
  .box-menu {
1412
1502
  z-index: 1000;
1413
1503
  background-color: #fff;
1414
- // box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
1415
1504
  border-radius: 4px;
1416
1505
  padding: 4px 0;
1417
1506
 
@@ -1539,11 +1628,6 @@ defineExpose({
1539
1628
 
1540
1629
  }
1541
1630
 
1542
- // .popper-transparent .el-popper__arrow::before,
1543
- // .popper-menu .el-popper__arrow::before {
1544
- // background: transparent !important;
1545
- // }
1546
-
1547
1631
  .popper-menu {
1548
1632
  padding: 0 !important;
1549
1633
  }
@@ -2,6 +2,37 @@ import base from '../../loader/index';
2
2
  import valid from '../../utils//validate';
3
3
  const CheckBoxList = function (source) {
4
4
  let rtn = {
5
+ checkedAllCode: '-99999',
6
+ _flagCheckedAll: null,
7
+ get options() {
8
+ return source.selectItems1;
9
+ },
10
+ get normalItemValues() {
11
+ this._value = [];
12
+ this.options.forEach((v) => {
13
+ if (v['code']) {
14
+ if (!v['flagDeleted']) {
15
+ this._value.push(v.code);
16
+ }
17
+ }
18
+ });
19
+ return this._value;
20
+ },
21
+ get flagCheckedAll() {
22
+ if (this._flagCheckedAll !== null) {
23
+ return this._flagCheckedAll;
24
+ }
25
+ else {
26
+ this._checkedItemArr = false;
27
+ source.selectItems1.forEach((v) => {
28
+ if (v['code'] === this.checkedAllCode) {
29
+ this._checkedItemArr = true;
30
+ return;
31
+ }
32
+ });
33
+ return this._checkedItemArr;
34
+ }
35
+ },
5
36
  _value: null,
6
37
  get value() {
7
38
 
@@ -18,16 +49,81 @@ const CheckBoxList = function (source) {
18
49
  }
19
50
  }
20
51
  });
52
+ if (this.flagCheckedAll) {
53
+ let ic = this._value.findIndex((op) => { return op === this.checkedAllCode });
54
+ let opl = ic > -1 ? this.options.length : this.options.length - 1;
55
+ if (ic > -1 || this._value.length === opl) {
56
+ this._value.splice(0, this._value.length);
57
+ source.code1 = JSON.stringify(this.options);
58
+ this.options.forEach((v) => {
59
+ if (v['code']) {
60
+ this._value.push(v['code']);
61
+ }
62
+ });
63
+ }
64
+ else if (this._value.length < opl) {
65
+ if (ic > -1) this._value.splice(ic, 1);
66
+ }
67
+ }
21
68
  }
22
69
 
70
+
23
71
  return this._value
24
72
 
25
73
  },
26
74
  set value(v) {
27
75
  this._value = v
28
76
  },
77
+ checkAll() {
78
+ let checked = source.code1
79
+ if (typeof source.code1 === 'string') {
80
+ checked = JSON.parse(source.code1)
81
+ }
82
+ // 保存旧的选中值用于比较
83
+ const oldValue = [];
84
+ checked.forEach((v) => {
85
+ if (v['flagDeleted'] != true) {
86
+ oldValue.push(v['code'])
87
+ }
88
+ });
89
+
90
+ // 找出新增和移除的项
91
+ const added = this.value.filter(item => !oldValue.includes(item))
92
+ const removed = oldValue.filter(item => !this.value.includes(item))
93
+
94
+ const hasAll = this.value.includes(this.checkedAllCode)
95
+ const selectedNormals = this.value.filter(item => item !== this.checkedAllCode)
96
+
97
+ // 处理各种情况
98
+ if (added.includes(this.checkedAllCode)) {
99
+ // 情况1: 点击了全选 -> 全选所有
100
+ this.value = this.normalItemValues
101
+ }
102
+ else if (removed.includes(this.checkedAllCode)) {
103
+ // 情况2: 取消了全选 -> 全部取消
104
+ this.value = []
105
+ }
106
+ else {
107
+ // 情况3: 操作了普通选项
108
+ if (selectedNormals.length === this.normalItemValues.length - 1) {
109
+ // 如果所有普通项都选中了,加上全选
110
+ this.value = this.normalItemValues
111
+ }
112
+ else if (hasAll && selectedNormals.length < this.normalItemValues.length) {
113
+ // 如果当前有全选但普通项没全选,移除全选
114
+ this.value = [...selectedNormals]
115
+ }
116
+ else {
117
+ // 普通情况:只有普通项
118
+ this.value = [...selectedNormals]
119
+ }
120
+ }
121
+ },
29
122
  //修改code1值
30
123
  setcode() {
124
+ if (this.flagCheckedAll) {
125
+ this.checkAll();
126
+ }
31
127
  let currentOptions = this.selectItems1.filter((v) => {
32
128
  return this.value.indexOf(v['code']) >= 0;
33
129
  });
@@ -90,6 +186,23 @@ const CheckBoxList = function (source) {
90
186
  });
91
187
  return nameArr;
92
188
  },
189
+ getFormObj() {
190
+ var rtnFormObj = {};
191
+ Object.defineProperty(rtnFormObj, source.fieldName1, {
192
+ get: function () {
193
+ if (rtn.flagCheckedAll && source.code1) {
194
+ let v = JSON.parse(source.code1);
195
+ let ic = v.findIndex((op) => { return op['code'] === rtn.checkedAllCode });
196
+ if (ic > -1) v.splice(ic, 1);
197
+ return JSON.stringify(v);
198
+ }
199
+ return source.code1;
200
+ },
201
+ enumerable: true,
202
+ configurable: true
203
+ });
204
+ return rtnFormObj;
205
+ },
93
206
 
94
207
  };
95
208
  rtn = base.copy(source, rtn);
@@ -6,14 +6,15 @@ const DatePicker = function (source) {
6
6
  let rtn = {
7
7
  //格式
8
8
  get valueFormat() {
9
- if (source.controlType == Enum.ControlType.DateTime || source.controlType == Enum.ControlType.DateTimeRange || this.flagtime) {
10
- return 'yyyy-MM-dd HH:mm:ss'
11
- }
12
- else if (source.controlType == Enum.ControlType.DateYearMonth
13
- || source.controlType == Enum.ControlType.MonthRange) {
14
- return 'yyyy-MM'
15
- }
16
- return 'yyyy-MM-dd'
9
+ // if (source.controlType == Enum.ControlType.DateTime || source.controlType == Enum.ControlType.DateTimeRange || this.flagtime) {
10
+ // return 'yyyy-MM-dd HH:mm:ss'
11
+ // }
12
+ // else if (source.controlType == Enum.ControlType.DateYearMonth
13
+ // || source.controlType == Enum.ControlType.MonthRange) {
14
+ // return 'yyyy-MM'
15
+ // }
16
+ // return 'yyyy-MM-dd'
17
+ return this.format;
17
18
  },
18
19
  //APP格式
19
20
  get valueFormatAPP() {
@@ -798,7 +798,7 @@ const Base = function (source, moreActionRouter, formLabelPlacement) {
798
798
  if (source.code2) {
799
799
  return source.code2 * 1024 * 1024;
800
800
  }
801
- return null;
801
+ return undefined;
802
802
  },
803
803
  set class(v) {
804
804
  source.className = v
@@ -924,12 +924,24 @@ const Base = function (source, moreActionRouter, formLabelPlacement) {
924
924
  //搜索组件宽度
925
925
  get listBind() {
926
926
  let bind = {};
927
- bind = {
928
- style: {
929
- 'width': source.width + 'px',
930
- display: 'inline-table'
927
+ if (this.controlType === Enum.ControlType.MultiSelectNoSearch
928
+ || this.controlType === Enum.ControlType.MultiSelectWithSearch) {
929
+ bind = {
930
+ style: {
931
+ 'min-width': source.width + 'px',
932
+ display: 'inline-table'
933
+ }
934
+ }
935
+ }
936
+ else {
937
+ bind = {
938
+ style: {
939
+ 'width': source.width + 'px',
940
+ display: 'inline-table'
941
+ }
931
942
  }
932
943
  }
944
+
933
945
  return bind;
934
946
  },
935
947
  //获取控件fieldName1对应的code1
@@ -654,6 +654,13 @@ function loadFromModel(source, isFormList) {
654
654
  set col(v) {
655
655
  source.colSpan = v;
656
656
  },
657
+ _pageDisabled: false,
658
+ get pageDisabled() {
659
+ return this._pageDisabled;
660
+ },
661
+ set pageDisabled(v) {
662
+ this._pageDisabled = v;
663
+ },
657
664
  //操作按钮列表
658
665
  _buttons: null,
659
666
  get buttons() {
@@ -835,10 +842,11 @@ function loadFromModel(source, isFormList) {
835
842
  if (f.table) {
836
843
  let rtnFormArr = [];
837
844
  var tempListData = f.table.model.getSelectRowData({ isMulti: f.table.model.isMulti });
838
- for (let i = 0; i < tempListData.length; i++) {
839
- rtnFormArr.push(tempListData[i]);
845
+ if (tempListData) {
846
+ for (let i = 0; i < tempListData.length; i++) {
847
+ rtnFormArr.push(tempListData[i]);
848
+ }
840
849
  }
841
-
842
850
  let rtnObj = {};
843
851
  Object.defineProperty(rtnObj, f.fieldName1, {
844
852
  get: function () {