@bytenew/bn-bus-ui 1.1.461 → 1.1.463

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 (167) hide show
  1. package/install.js +134 -0
  2. package/package.json +20 -4
  3. package/packages/BnAddress/index.vue +141 -0
  4. package/packages/BnAddressParse/index.vue +75 -0
  5. package/packages/BnAdvancedFilter/BnFilterView.vue +145 -0
  6. package/packages/BnAdvancedFilter/index.vue +345 -0
  7. package/packages/BnAdvancedFilter/util.js +171 -0
  8. package/packages/BnCascader/BnCascader.vue +543 -0
  9. package/packages/BnCascader/BnCascaderPanel.vue +1331 -0
  10. package/packages/BnCascader/cascaderDisplay.js +102 -0
  11. package/packages/BnCheck/BnCheck.vue +253 -0
  12. package/packages/BnColumnConfig/columnConfigDialog.vue +134 -0
  13. package/packages/BnColumnConfig/component/childrenFormSetting/assocTable.vue +143 -0
  14. package/packages/BnColumnConfig/component/childrenFormSetting/assocTableSearch.vue +314 -0
  15. package/packages/BnColumnConfig/component/childrenFormSetting/index.vue +243 -0
  16. package/packages/BnColumnConfig/component/defaultSet/defaultSet.vue +114 -0
  17. package/packages/BnColumnConfig/component/defaultSet/stringDefault.vue +210 -0
  18. package/packages/BnColumnConfig/component/funcExprDialog/funcExprDialog.vue +126 -0
  19. package/packages/BnColumnConfig/component/packageFilter/index.vue +141 -0
  20. package/packages/BnColumnConfig/component/paraExplainSet/index.vue +156 -0
  21. package/packages/BnColumnConfig/component/setOption/setOption.vue +321 -0
  22. package/packages/BnColumnConfig/component/setRelationOption/ConditionList.vue +277 -0
  23. package/packages/BnColumnConfig/component/setRelationOption/LevelHeader.vue +144 -0
  24. package/packages/BnColumnConfig/component/setRelationOption/setRelationOption.vue +642 -0
  25. package/packages/BnColumnConfig/data.js +129 -0
  26. package/packages/BnColumnConfig/index.scss +23 -0
  27. package/packages/BnColumnConfig/index.vue +309 -0
  28. package/packages/BnCondVal/BnCondVal.vue +112 -0
  29. package/packages/BnCondVal/itemVal/dateRegVal.vue +39 -0
  30. package/packages/BnCondVal/itemVal/dateVal.vue +39 -0
  31. package/packages/BnCondVal/itemVal/numRegVal.vue +67 -0
  32. package/packages/BnCondVal/itemVal/numVal.vue +44 -0
  33. package/packages/BnCondVal/itemVal/relationVal.vue +73 -0
  34. package/packages/BnCondVal/itemVal/selectColumnVal.vue +58 -0
  35. package/packages/BnCondVal/itemVal/selectVal.vue +59 -0
  36. package/packages/BnCondVal/itemVal/stringVal.vue +156 -0
  37. package/packages/BnCondition/index.vue +551 -0
  38. package/packages/BnCondition/util.js +232 -0
  39. package/packages/BnDatePicker/BnDatePicker.vue +194 -0
  40. package/packages/BnDrop/BnDrop.vue +917 -0
  41. package/packages/BnEmptyTip/BnEmptyTip.vue +107 -0
  42. package/packages/BnExportOrder/BnExportOrder.vue +241 -0
  43. package/packages/BnExportOrder/validatorCode.vue +94 -0
  44. package/packages/BnFileView/BnFileView.vue +271 -0
  45. package/packages/BnFileView/FileDetail.vue +125 -0
  46. package/packages/BnFileView/videoPreview.vue +70 -0
  47. package/packages/BnFilterOption/BnFilterOption.vue +160 -0
  48. package/packages/BnFunExpr/BnFunExpr.vue +608 -0
  49. package/packages/BnImportOrder/BnImportOrder.vue +323 -0
  50. package/packages/BnImportTemplate/BnImportTemplate.vue +866 -0
  51. package/packages/BnImportTemplate/assets/merge_tip_img.png +0 -0
  52. package/packages/BnImportTemplate/assets/sheet_tip.png +0 -0
  53. package/packages/BnImportTemplate/assets/xls.png +0 -0
  54. package/packages/BnImportTemplate/components/ImportTemplateTrigger.vue +198 -0
  55. package/packages/BnImportTemplate/components/TemplateEditDialog.vue +340 -0
  56. package/packages/BnImportTemplate/components/TemplateFieldsConfig.vue +401 -0
  57. package/packages/BnImportTemplate/components/TemplateListDialog.vue +297 -0
  58. package/packages/BnInpNum/BnInpNum.vue +165 -0
  59. package/packages/BnMenus/BnMenus.vue +502 -0
  60. package/packages/BnMenus/MenuItem.vue +321 -0
  61. package/packages/BnOrderCard/BnOrderCard.vue +389 -0
  62. package/packages/BnOrderCard/orderRemark.vue +178 -0
  63. package/packages/BnOrderCard/util.js +94 -0
  64. package/packages/BnOrderDetail/BnOrderDetail.vue +338 -0
  65. package/packages/BnOrderDetail/filterLogByUser.vue +108 -0
  66. package/packages/BnOrderDetail/orderLogs.vue +53 -0
  67. package/packages/BnOrderDetail/showSubForm/index.vue +41 -0
  68. package/packages/BnOrderDetail/showSubForm/showChildTable.vue +61 -0
  69. package/packages/BnOrderDetail/showSubForm/showTimeLine.vue +131 -0
  70. package/packages/BnOrderDetail/showSubForm/tableCellCopy.vue +84 -0
  71. package/packages/BnOrderShare/index.vue +378 -0
  72. package/packages/BnOrderShare/shareUrlInp.vue +54 -0
  73. package/packages/BnRadio/BnRadio.vue +181 -0
  74. package/packages/BnRelation/BnRelation.vue +120 -0
  75. package/packages/BnSelect/BnSelect.vue +485 -0
  76. package/packages/BnSmartForm/BnBatchForm.vue +334 -0
  77. package/packages/BnSmartForm/BnBatchFormDialog.vue +423 -0
  78. package/packages/BnSmartForm/BnSmartElf/elfLog/index.vue +57 -0
  79. package/packages/BnSmartForm/BnSmartElf/index.vue +95 -0
  80. package/packages/BnSmartForm/BnSmartFormPsychic.js +629 -0
  81. package/packages/BnSmartForm/BnSmartFormUtil.js +524 -0
  82. package/packages/BnSmartForm/addressForm/index.vue +73 -0
  83. package/packages/BnSmartForm/checkboxForm/index.vue +99 -0
  84. package/packages/BnSmartForm/childrenForm/childFormFile.vue +237 -0
  85. package/packages/BnSmartForm/childrenForm/childrenFormBody.vue +260 -0
  86. package/packages/BnSmartForm/childrenForm/index.vue +110 -0
  87. package/packages/BnSmartForm/childrenForm/searchInventory.vue +115 -0
  88. package/packages/BnSmartForm/chooseAssocTable/chooseAssocTable.vue +451 -0
  89. package/packages/BnSmartForm/chooseAssocTable/chooseChildGood.vue +229 -0
  90. package/packages/BnSmartForm/chooseAssocTable/tableCellCopy.vue +84 -0
  91. package/packages/BnSmartForm/chooseChildOrder/chooseChildOrder.vue +158 -0
  92. package/packages/BnSmartForm/chooseIPaasData/chooseIPaasData.vue +307 -0
  93. package/packages/BnSmartForm/chooseIPaasData/tableCellCopy.vue +84 -0
  94. package/packages/BnSmartForm/choosePackage/choosePackage.vue +361 -0
  95. package/packages/BnSmartForm/dateDualForm/index.vue +37 -0
  96. package/packages/BnSmartForm/dateForm/index.vue +38 -0
  97. package/packages/BnSmartForm/fileForm/fileFormData.js +50 -0
  98. package/packages/BnSmartForm/fileForm/index.vue +240 -0
  99. package/packages/BnSmartForm/formItemFooter/formItemFooter.vue +38 -0
  100. package/packages/BnSmartForm/formItemTop/formItemTop.vue +42 -0
  101. package/packages/BnSmartForm/index.vue +1201 -0
  102. package/packages/BnSmartForm/numberForm/index.vue +63 -0
  103. package/packages/BnSmartForm/radioForm/index.vue +72 -0
  104. package/packages/BnSmartForm/receiveForm/index.vue +112 -0
  105. package/packages/BnSmartForm/relationForm/index.vue +82 -0
  106. package/packages/BnSmartForm/scoreForm/index.vue +39 -0
  107. package/packages/BnSmartForm/selectForm/index.vue +55 -0
  108. package/packages/BnSmartForm/showValForm/index.vue +42 -0
  109. package/packages/BnSmartForm/showValForm/showValFormTable.vue +104 -0
  110. package/packages/BnSmartForm/smartFormsCommon.scss +43 -0
  111. package/packages/BnSmartForm/stringForm/index.vue +170 -0
  112. package/packages/BnVirtPopover/index.vue +319 -0
  113. package/packages/BnWebLog/BnWebLog.vue +140 -0
  114. package/packages/BnWorkSettingDrop/advancedOptions.js +112 -0
  115. package/packages/BnWorkSettingDrop/benBenAIUtil.js +89 -0
  116. package/packages/BnWorkSettingDrop/index.vue +292 -0
  117. package/packages/font/iconfont.css +243 -0
  118. package/packages/font/iconfont.ttf +0 -0
  119. package/packages/font/iconfont.woff +0 -0
  120. package/packages/font/iconfont.woff2 +0 -0
  121. package/utils/addressParse-old.js +645 -0
  122. package/utils/addressParse.js +735 -0
  123. package/utils/config.js +68 -0
  124. package/utils/index.js +1171 -0
  125. package/dist/assocTableSearch-C14i_zJO.js +0 -349
  126. package/dist/assocTableSearch.css +0 -1
  127. package/dist/bn-bus-ui.es.js +0 -65
  128. package/dist/bn-bus-ui.umd.js +0 -49
  129. package/dist/chooseIPaasData-Cl_5qkFA.js +0 -391
  130. package/dist/chooseIPaasData.css +0 -1
  131. package/dist/defaultSet-I4xpf8a4.js +0 -297
  132. package/dist/defaultSet.css +0 -1
  133. package/dist/fileFormData-D_Q1vylE.js +0 -53
  134. package/dist/formItemFooter-CTA7rDtV.js +0 -108
  135. package/dist/formItemFooter.css +0 -1
  136. package/dist/funcExprDialog-Cm5BiRM3.js +0 -139
  137. package/dist/funcExprDialog.css +0 -1
  138. package/dist/index-B6b4uj8v.js +0 -51
  139. package/dist/index-BWdkDTbz.js +0 -109
  140. package/dist/index-BdZ1zOap.js +0 -89
  141. package/dist/index-BdzNjjMC.js +0 -64
  142. package/dist/index-BfpZqab2.js +0 -66
  143. package/dist/index-BmkiB4hr.js +0 -66
  144. package/dist/index-Br1sqCoo.js +0 -58
  145. package/dist/index-C9qrl-yc.js +0 -183
  146. package/dist/index-CXFJXCn5.js +0 -746
  147. package/dist/index-DF114jZq.js +0 -135
  148. package/dist/index-DFPfZ_Il.js +0 -178
  149. package/dist/index-DSEtu7TN.js +0 -44
  150. package/dist/index-Did0UUWV.js +0 -221
  151. package/dist/index-DrPj-tmI.js +0 -45
  152. package/dist/index-DzDf9s2W.js +0 -89
  153. package/dist/index-LnjudNEI.js +0 -118
  154. package/dist/index-ObCfCmDT.js +0 -45
  155. package/dist/index.css +0 -1
  156. package/dist/index2.css +0 -1
  157. package/dist/index3.css +0 -1
  158. package/dist/index4.css +0 -1
  159. package/dist/index5.css +0 -1
  160. package/dist/index6.css +0 -1
  161. package/dist/index7.css +0 -1
  162. package/dist/install-C-scqkds.js +0 -23103
  163. package/dist/install.css +0 -1
  164. package/dist/setOption-CSnWzOny.js +0 -329
  165. package/dist/setOption.css +0 -1
  166. package/dist/setRelationOption-CJcHdfaa.js +0 -5217
  167. package/dist/setRelationOption.css +0 -1
@@ -0,0 +1,629 @@
1
+ // 类型无关的 includes 方法,用于比较可能是字符串或数值的 id
2
+ function Includes(array, value) {
3
+ return array.some(item => item == value); // 使用 == 进行类型转换比较
4
+ }
5
+
6
+ /*传入原始组件列表,组件显隐规则列表,返回可以显示的组件列表的code数组[1,2,3,4]*/
7
+ export function psychicComponentGetIds(components, rules,taskId) {
8
+ //1.获取组件列表中所有组件的id数组,和所有组件的数据map对象
9
+ let componentMap = JSON.parse(JSON.stringify(loadComponentIds(components).componentMap));
10
+ //2. 定义一个需要隐藏起来的组件id列表
11
+ let hiddenIds = [];
12
+ //3.定义一个需要显示的组件的id列表
13
+ let showIds = [];
14
+ //4获取规则内,所有涉及触发条件的组件的id数组
15
+ let conditionIds = [];
16
+ //5.遍历组件显隐规则
17
+ rules.map(rule => {
18
+ //6判断规则是否开启
19
+ if (rule.status == 1 && ((taskId && rule.columnRules.showScene.includes(2)) || (!taskId && rule.columnRules.showScene.includes(1)))) {
20
+ //7.获取该规则内,所有需要控制显示隐藏的组件id数组
21
+ let showComponentIds = loadComponentIds(rule.columnRules.showColumns).ids;
22
+ //8.获取规则内,所有涉及触发条件的组件的id数组
23
+ let conditionComponentIds = loadComponentIds(rule.columnRules.conditions).ids;
24
+ //9.判断规则是否符合
25
+ let flag = checkRuleCondition(rule.columnRules.calculation, rule.columnRules.conditions, componentMap);
26
+ conditionIds = mergeArray(conditionIds, conditionComponentIds)
27
+ //10.根据判断来确定该规则下能展示和需要隐藏的数组
28
+ if (flag) {
29
+ showIds = mergeArray(showIds, showComponentIds)
30
+ } else {
31
+ hiddenIds = mergeArray(hiddenIds, showComponentIds)
32
+ }
33
+ }
34
+ });
35
+ //11.需要隐藏的组件列表和需要显示的组件列表取差集。
36
+ let hidden = [];
37
+ for (let i in hiddenIds) {
38
+ if (!showIds.includes(hiddenIds[i])) {
39
+ hidden.push(hiddenIds[i])
40
+ }
41
+ }
42
+ return {
43
+ showIds: showIds,
44
+ hiddenIds: hidden,
45
+ conditionIds: conditionIds
46
+ };
47
+ }
48
+
49
+ //获取一个组件列表的所有id,返回它们的id的数组列表
50
+ function loadComponentIds(components) {
51
+ let response = {
52
+ ids: [],
53
+ componentMap: {}
54
+ };
55
+ components.map(item => {
56
+ response.ids.push(item.columnCode);
57
+ response.componentMap[item.columnCode] = item;
58
+ });
59
+ return response;
60
+ }
61
+
62
+ //校验组件显隐规则是否符合,符合返回true,不符合返回false。type:匹配方式 and 全部匹配,or 只要有一个匹配。conditions:触发条件列表。componentMap:组件map对象
63
+ function checkRuleCondition(type, conditions, componentMap) {
64
+ let flag = -1;
65
+ for (let i in conditions) {
66
+ let condition = conditions[i];
67
+ let component = componentMap[condition.columnCode];
68
+ flag = i
69
+ if (component) {
70
+ switch (component.behaviorType) {
71
+ //单行文本 附件
72
+ case 1:
73
+ case 10: {
74
+ flag = checkString(component, condition, i);
75
+ break;
76
+ }
77
+ //数值
78
+ case 2:
79
+ case 9: {
80
+ flag = checkNumber(component, condition, i);
81
+ break;
82
+ }
83
+ //单选、下拉
84
+ case 3:
85
+ case 4: {
86
+ flag = checkSelect(component, condition, i);
87
+ break;
88
+ }
89
+ //多选
90
+ case 5: {
91
+ flag = checkCheckBox(component, condition, i);
92
+ break;
93
+ }
94
+ //联动组件
95
+ case 6:
96
+ {
97
+ flag = checkRelation(component, condition, i);
98
+ break;
99
+ }
100
+ //日期组件
101
+ case 7: {
102
+ flag = checkDate(component, condition, i);
103
+ break;
104
+ }
105
+ //日期区间组件
106
+ case 8: {
107
+ flag = checkDateReg(component, condition, i);
108
+ break;
109
+ }
110
+ }
111
+ if (type === 'and') {
112
+ if (flag == -1) {
113
+ break;
114
+ }
115
+ } else {
116
+ if (flag != -1) {
117
+ break;
118
+ }
119
+ }
120
+ } else {
121
+ // 没有找到组件,直接跳出
122
+ flag = -1;
123
+ if(type == 'and'){
124
+ break;
125
+ }else{
126
+ continue;
127
+ }
128
+ }
129
+ }
130
+ return flag > -1;
131
+ }
132
+
133
+ //1。单行文本、10.附件校验
134
+ function checkString(component, condition, index) {
135
+ let flag = index;
136
+ /*
137
+ {title: '等于', id: '1'},
138
+ {title: '不等于', id: '2'},
139
+ {title: '包含', id: '3'},
140
+ {title: '不包含', id: '4'},
141
+ {title: '包含任一项', id: '5'},
142
+ {title: '为空', id: '9'},
143
+ {title: '不为空', id: '10'}
144
+ */
145
+ switch (condition.matchType) {
146
+ case "1"://等于
147
+ {
148
+ flag = condition.value == component.value ? index : -1;
149
+ break;
150
+ }
151
+ case "2"://不等于
152
+ {
153
+ flag = condition.value != component.value ? index : -1;
154
+ break;
155
+ }
156
+ case "3"://包含
157
+ {
158
+ flag = component.value.indexOf(condition.value) > -1 ? index : -1;
159
+ break;
160
+ }
161
+ case "4"://不包含
162
+ {
163
+ flag = component.value.indexOf(condition.value) < 0 ? index : -1;
164
+ break;
165
+ }
166
+ case "5"://包含任一项
167
+ {
168
+ flag = component.value && condition.value.includes(component.value) ? index : -1;
169
+ break;
170
+ }
171
+ case "9"://为空
172
+ {
173
+ flag = !component.value ? index : -1;
174
+ break;
175
+ }
176
+ case "10"://不为空
177
+ {
178
+ flag = component.value ? index : -1;
179
+ break;
180
+ }
181
+ }
182
+ return flag;
183
+ }
184
+
185
+ // case 2://数值
186
+ // case 9://评分
187
+ function checkNumber(component, condition, index) {
188
+ let flag = index;
189
+ let val = component.value!=''?parseFloat(component.value):''
190
+ let conVal = condition.matchType != '8' && condition.value!=''?parseFloat(condition.value):''
191
+ /*
192
+ {title: '等于', id: '1'},
193
+ {title: '不等于', id: '2'},
194
+ {title: '大于', id: '16'},
195
+ {title: '小于', id: '17'},
196
+ {title: '大于等于', id: '18'},
197
+ {title: '小于等于', id: '19'},
198
+ {title: '范围', id: '8'},
199
+ {title: '为空', id: '9'},
200
+ {title: '不为空', id: '10'},
201
+ */
202
+ switch (condition.matchType) {
203
+ case "1"://等于
204
+ {
205
+ flag = val == conVal ? index : -1;
206
+ break;
207
+ }
208
+ case "2"://不等于
209
+ {
210
+ flag = val != conVal ? index : -1;
211
+ break;
212
+ }
213
+ case "8"://范围
214
+ {
215
+ let conVal = {
216
+ start:condition.value.start!=''?parseFloat(condition.value.start):'',
217
+ end:condition.value.end!=''?parseFloat(condition.value.end):''
218
+ }
219
+ flag = val && val >= conVal.start && val <= conVal.end ? index : -1;
220
+ break;
221
+ }
222
+ case "9"://为空
223
+ {
224
+ flag = component.value === '' ? index : -1;
225
+ break;
226
+ }
227
+ case "10"://不为空
228
+ {
229
+ flag = component.value !== '' ? index : -1;
230
+ break;
231
+ }
232
+ case "16"://大于
233
+ {
234
+ flag = val >conVal ? index : -1;
235
+ break;
236
+ }
237
+ case "17"://小于
238
+ {
239
+ flag = val &&val < conVal ? index : -1;
240
+ break;
241
+ }
242
+ case "18"://大于等于
243
+ {
244
+ flag = val >= conVal ? index : -1;
245
+ break;
246
+ }
247
+ case "19"://小于等于
248
+ {
249
+ flag = val && val <= conVal ? index : -1;
250
+ break;
251
+ }
252
+ }
253
+ return flag;
254
+ }
255
+
256
+ // case 3://单选
257
+ // case 4://下拉
258
+ function checkSelect(component, condition, index) {
259
+ let flag = index;
260
+ /*
261
+ {title: '等于', id: '1'},
262
+ {title: '不等于', id: '2'},
263
+ {title: '包含任一项', id: '5'},
264
+ {title: '不包含任一项', id: '6'},
265
+ {title: '为空', id: '9'},
266
+ {title: '不为空', id: '10'}
267
+ */
268
+ switch (condition.matchType) {
269
+ case "1"://等于
270
+ {
271
+ flag = condition.value.id == component.value.id ? index : -1
272
+ break;
273
+ }
274
+ case "2"://不等于
275
+ {
276
+ flag = condition.value.id != component.value.id ? index : -1
277
+ break;
278
+ }
279
+ case "5"://包含任一项
280
+ {
281
+ let values = condition.value.map(val =>val.id)
282
+ flag = Includes(values, component.value.id) ? index : -1
283
+ break;
284
+ }
285
+ case "6"://不包含任一项
286
+ {
287
+ let values = condition.value.map(val =>val.id)
288
+ flag = !Includes(values, component.value.id) ? index : -1
289
+ break;
290
+ }
291
+ case "9"://为空
292
+ {
293
+ flag = !component.value.id ? index : -1
294
+ break;
295
+ }
296
+ case "10"://不为空
297
+ {
298
+ flag = component.value.id ? index : -1
299
+ break;
300
+ }
301
+ }
302
+ return flag;
303
+ }
304
+ // case 5://多选
305
+ function checkCheckBox(component, condition, index) {
306
+ let flag = index;
307
+ let val = component.value.map(item=>item.id);
308
+ /*
309
+ {title: '等于', id: '1'},
310
+ {title: '不等于', id: '2'},
311
+ {title: '包含', id: '3'},
312
+ {title: '不包含', id: '4'},
313
+ {title: '包含任一项', id: '5'},
314
+ {title: '不包含任一项', id: '6'},
315
+ {title: '包含所有项', id: '7'},
316
+ {title: '为空', id: '9'},
317
+ {title: '不为空', id: '10'},
318
+ */
319
+ switch (condition.matchType) {
320
+ case "1"://等于
321
+ {
322
+ if(component.value.length != condition.value.length){
323
+ flag = -1;
324
+ }else{
325
+ for(let i in condition.value){
326
+ flag = Includes(val, condition.value[i].id)?index:-1;
327
+ if(flag == -1){
328
+ break;
329
+ }
330
+ }
331
+ }
332
+ break;
333
+ }
334
+ case "2"://不等于
335
+ {
336
+ if(component.value.length == condition.value.length){
337
+ flag = condition.value.filter(item=>!Includes(val, item.id)).length > 0?index:-1
338
+ }
339
+ break;
340
+ }
341
+ case "3"://包含
342
+ {
343
+ let checkAll = condition.value.every(item=>{
344
+ return Includes(val, item.id)
345
+ });
346
+ flag = checkAll ? index : -1;
347
+ break;
348
+ }
349
+ case "4"://不包含
350
+ {
351
+ let checkAll = condition.value.every(item=>{
352
+ return !Includes(val, item.id)
353
+ });
354
+ flag = checkAll ? index : -1;
355
+ break;
356
+ }
357
+ case "5"://包含任一项
358
+ {
359
+ flag = -1;
360
+ for(let i in condition.value){
361
+ flag = Includes(val, condition.value[i].id)?index:-1;
362
+ if(flag != -1){
363
+ break;
364
+ }
365
+ }
366
+ break;
367
+ }
368
+ case "6"://不包含任一项
369
+ {
370
+ for(let i in condition.value){
371
+ flag = !Includes(val, condition.value[i].id)?index:-1;
372
+ if(flag == -1){
373
+ break;
374
+ }
375
+ }
376
+ break;
377
+ }
378
+ case "7"://包含所有项
379
+ {
380
+ let checkAll = condition.value.every(item=>{
381
+ return Includes(val, item.id)
382
+ });
383
+ flag = checkAll ? index : -1;
384
+ break;
385
+ }
386
+ case "9"://为空
387
+ {
388
+ flag = val.length == 0 ? index : -1
389
+ break;
390
+ }
391
+ case "10"://不为空
392
+ {
393
+ flag = val.length != 0 ? index : -1
394
+ break;
395
+ }
396
+ }
397
+ return flag;
398
+ }
399
+
400
+ // case 6://联动组件
401
+ function checkRelation(component, condition, index) {
402
+ let flag = index;
403
+ let val = component.value.join(',');
404
+ /*
405
+ {title: '等于', id: '1'},
406
+ {title: '不等于', id: '2'},
407
+ {title: '包含', id: '3'},
408
+ {title: '不包含', id: '4'},
409
+ {title: '包含任一项', id: '5'},
410
+ {title: '不包含任一项', id: '6'},
411
+ {title: '为空', id: '9'},
412
+ {title: '不为空', id: '10'},
413
+ */
414
+ switch (condition.matchType) {
415
+ case "1"://等于
416
+ {
417
+ if(val == '' || condition.value.length==0){
418
+ flag = -1;
419
+ }else{
420
+ flag = val == condition.value[0].join(',') ? index :-1;
421
+ }
422
+ break;
423
+ }
424
+ case "2"://不等于
425
+ {
426
+ if(val && condition.value.length>0){
427
+ flag = val != condition.value[0].join(',') ? index :-1;
428
+ }
429
+ break;
430
+ }
431
+ case "3"://包含
432
+ {
433
+ flag = -1;
434
+ for(let i in condition.value){
435
+ let ids = condition.value[i].join(',');
436
+ flag = val.indexOf(ids)>-1?index:-1;
437
+ if(flag != -1){
438
+ break;
439
+ }
440
+ }
441
+ break;
442
+ }
443
+ case "4"://不包含
444
+ {
445
+ let checkAll = condition.value.every(item=>{
446
+ return val.indexOf(item.join(',')) == -1
447
+ });
448
+ flag = checkAll ? index : -1;
449
+ break;
450
+ }
451
+ case "5"://包含任一项
452
+ {
453
+ flag = -1;
454
+ for(let i in condition.value){
455
+ let ids = condition.value[i].join(',');
456
+ flag = val == ids ? index:-1;
457
+ if(flag != -1){
458
+ break;
459
+ }
460
+ }
461
+ break;
462
+ }
463
+ case "6"://不包含任一项
464
+ {
465
+ for(let i in condition.value){
466
+ let ids = condition.value[i].join(',');
467
+ flag = val != ids ? index:-1;
468
+ if(flag == -1){
469
+ break;
470
+ }
471
+ }
472
+ break;
473
+ }
474
+ case "9"://为空
475
+ {
476
+ flag = val == '' ? index : -1
477
+ break;
478
+ }
479
+ case "10"://不为空
480
+ {
481
+ flag = val != '' ? index : -1
482
+ break;
483
+ }
484
+ }
485
+ return flag;
486
+ }
487
+ // case 7://日期
488
+ // 格式化日期
489
+ function getDate (val){
490
+ let time = val
491
+ if(val.length >0 && val.length == 10){
492
+ time +='00:00:00'
493
+ }
494
+ return time?new Date(time):'';
495
+ }
496
+ function checkDate(component, condition, index) {
497
+ let flag = index;
498
+ let val = getDate(component.value);
499
+ let conVal = typeof condition.value !='object'?getDate(condition.value):""
500
+ /*
501
+ {title: '等于', id: '1'},
502
+ {title: '不等于', id: '2'},
503
+ {title: '大于', id: '16'},
504
+ {title: '小于', id: '17'},
505
+ {title: '大于等于', id: '18'},
506
+ {title: '小于等于', id: '19'},
507
+ {title: '范围', id: '8'},
508
+ {title: '为空', id: '9'},
509
+ {title: '不为空', id: '10'},
510
+ */
511
+ switch (condition.matchType) {
512
+ case "1"://等于
513
+ {
514
+ flag = val == conVal ? index : -1;
515
+ break;
516
+ }
517
+ case "2"://不等于
518
+ {
519
+ flag = val != conVal ? index : -1;
520
+ break;
521
+ }
522
+ case "8"://范围
523
+ {
524
+ let start = getDate(condition.value.start)
525
+ let end = getDate(condition.value.end)
526
+ flag = val && val >= start && val <= end ? index : -1;
527
+ break;
528
+ }
529
+ case "9"://为空
530
+ {
531
+ flag = val === '' ? index : -1;
532
+ break;
533
+ }
534
+ case "10"://不为空
535
+ {
536
+ flag = val !== '' ? index : -1;
537
+ break;
538
+ }
539
+ case "16"://大于
540
+ {
541
+ flag = val > conVal ? index : -1;
542
+ break;
543
+ }
544
+ case "17"://小于
545
+ {
546
+ flag = val < conVal ? index : -1;
547
+ break;
548
+ }
549
+ case "18"://大于等于
550
+ {
551
+ flag = val >= conVal ? index : -1;
552
+ break;
553
+ }
554
+ case "19"://小于等于
555
+ {
556
+ flag = val <= conVal ? index : -1;
557
+ break;
558
+ }
559
+ }
560
+ return flag;
561
+ }
562
+ // case 8://日期区间
563
+ function checkDateReg(component, condition, index) {
564
+ let flag = index;
565
+ /*
566
+ {title: '等于', id: '1'},
567
+ {title: '不等于', id: '2'},
568
+ {title: '大于', id: '16'},
569
+ {title: '小于', id: '17'},
570
+ {title: '大于等于', id: '18'},
571
+ {title: '小于等于', id: '19'},
572
+ {title: '范围', id: '8'},
573
+ {title: '为空', id: '9'},
574
+ {title: '不为空', id: '10'},
575
+ */
576
+ switch (condition.matchType) {
577
+ case "8"://范围
578
+ {
579
+ let val={
580
+ start:getDate(component.value.start),
581
+ end:getDate(component.value.end)
582
+ }
583
+ let start = getDate(condition.value.start)
584
+ let end = getDate(condition.value.end)
585
+ flag = val.start && val.start >= start && val.end && val.end <= end ? index : -1;
586
+ break;
587
+ }
588
+ case "9"://为空
589
+ {
590
+ flag = component.value.start == '' && component.value.end == '' ? index : -1;
591
+ break;
592
+ }
593
+ case "10"://不为空
594
+ {
595
+ flag = component.value.start != '' && component.value.end != '' ? index : -1;
596
+ break;
597
+ }
598
+ }
599
+ return flag;
600
+ }
601
+ // case 11://富文本 不支持
602
+ // case 12://标签 不支持
603
+ // case 13://子表单 不支持
604
+ // case 15://组合组件 收寄信息
605
+
606
+ //合并两个纯数值的数组,type:取交集true还是取并集false(默认)
607
+ function mergeArray(array1, array2, type) {
608
+ let array = []
609
+ if (type) {
610
+ if (array1.length > array2.length) {
611
+ array1.map(i => {
612
+ if (array2.includes(i)) {
613
+ array.push(i)
614
+ }
615
+ })
616
+ } else {
617
+ array2.map(i => {
618
+ if (array1.includes(i)) {
619
+ array.push(i)
620
+ }
621
+ })
622
+ }
623
+ } else {
624
+ array = Array.from(new Set([...array1, ...array2]))
625
+ }
626
+ return array;
627
+ }
628
+
629
+