@bytenew/bn-bus-ui 1.1.463 → 1.1.464

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/dist/assocTableSearch-Bfe96864.js +349 -0
  2. package/dist/assocTableSearch.css +1 -0
  3. package/dist/bn-bus-ui.es.js +65 -0
  4. package/dist/bn-bus-ui.umd.js +49 -0
  5. package/dist/chooseIPaasData-COrrvQKZ.js +391 -0
  6. package/dist/chooseIPaasData.css +1 -0
  7. package/dist/defaultSet-CzN1ec_d.js +297 -0
  8. package/dist/defaultSet.css +1 -0
  9. package/dist/fileFormData-D_Q1vylE.js +53 -0
  10. package/dist/formItemFooter-BvptZj_u.js +108 -0
  11. package/dist/formItemFooter.css +1 -0
  12. package/dist/funcExprDialog-BguNs9fl.js +139 -0
  13. package/dist/funcExprDialog.css +1 -0
  14. package/dist/index-0oB7QocU.js +44 -0
  15. package/dist/index-69fRP0M8.js +89 -0
  16. package/dist/index-BdklTJtF.js +66 -0
  17. package/dist/index-Bu3jHlby.js +45 -0
  18. package/dist/index-BxWx5kpG.js +89 -0
  19. package/dist/index-C5LQ0OSs.js +183 -0
  20. package/dist/index-C8YhrrUN.js +51 -0
  21. package/dist/index-COuPCIzB.js +45 -0
  22. package/dist/index-CSvVyjxx.js +178 -0
  23. package/dist/index-DCv51EXX.js +109 -0
  24. package/dist/index-DUSI6MuC.js +135 -0
  25. package/dist/index-DVzxs2vR.js +58 -0
  26. package/dist/index-Dd4b8zNb.js +746 -0
  27. package/dist/index-Md-ZlkCW.js +66 -0
  28. package/dist/index-hsSIY2FP.js +221 -0
  29. package/dist/index-n13-H3_Y.js +118 -0
  30. package/dist/index-wUl5aPUD.js +64 -0
  31. package/dist/index.css +1 -0
  32. package/dist/index2.css +1 -0
  33. package/dist/index3.css +1 -0
  34. package/dist/index4.css +1 -0
  35. package/dist/index5.css +1 -0
  36. package/dist/index6.css +1 -0
  37. package/dist/index7.css +1 -0
  38. package/dist/install-CNjs0u5x.js +23299 -0
  39. package/dist/install.css +1 -0
  40. package/dist/setOption-CXOifQcx.js +329 -0
  41. package/dist/setOption.css +1 -0
  42. package/dist/setRelationOption-C7VDhej7.js +5217 -0
  43. package/dist/setRelationOption.css +1 -0
  44. package/package.json +4 -20
  45. package/install.js +0 -134
  46. package/packages/BnAddress/index.vue +0 -141
  47. package/packages/BnAddressParse/index.vue +0 -75
  48. package/packages/BnAdvancedFilter/BnFilterView.vue +0 -145
  49. package/packages/BnAdvancedFilter/index.vue +0 -345
  50. package/packages/BnAdvancedFilter/util.js +0 -171
  51. package/packages/BnCascader/BnCascader.vue +0 -543
  52. package/packages/BnCascader/BnCascaderPanel.vue +0 -1331
  53. package/packages/BnCascader/cascaderDisplay.js +0 -102
  54. package/packages/BnCheck/BnCheck.vue +0 -253
  55. package/packages/BnColumnConfig/columnConfigDialog.vue +0 -134
  56. package/packages/BnColumnConfig/component/childrenFormSetting/assocTable.vue +0 -143
  57. package/packages/BnColumnConfig/component/childrenFormSetting/assocTableSearch.vue +0 -314
  58. package/packages/BnColumnConfig/component/childrenFormSetting/index.vue +0 -243
  59. package/packages/BnColumnConfig/component/defaultSet/defaultSet.vue +0 -114
  60. package/packages/BnColumnConfig/component/defaultSet/stringDefault.vue +0 -210
  61. package/packages/BnColumnConfig/component/funcExprDialog/funcExprDialog.vue +0 -126
  62. package/packages/BnColumnConfig/component/packageFilter/index.vue +0 -141
  63. package/packages/BnColumnConfig/component/paraExplainSet/index.vue +0 -156
  64. package/packages/BnColumnConfig/component/setOption/setOption.vue +0 -321
  65. package/packages/BnColumnConfig/component/setRelationOption/ConditionList.vue +0 -277
  66. package/packages/BnColumnConfig/component/setRelationOption/LevelHeader.vue +0 -144
  67. package/packages/BnColumnConfig/component/setRelationOption/setRelationOption.vue +0 -642
  68. package/packages/BnColumnConfig/data.js +0 -129
  69. package/packages/BnColumnConfig/index.scss +0 -23
  70. package/packages/BnColumnConfig/index.vue +0 -309
  71. package/packages/BnCondVal/BnCondVal.vue +0 -112
  72. package/packages/BnCondVal/itemVal/dateRegVal.vue +0 -39
  73. package/packages/BnCondVal/itemVal/dateVal.vue +0 -39
  74. package/packages/BnCondVal/itemVal/numRegVal.vue +0 -67
  75. package/packages/BnCondVal/itemVal/numVal.vue +0 -44
  76. package/packages/BnCondVal/itemVal/relationVal.vue +0 -73
  77. package/packages/BnCondVal/itemVal/selectColumnVal.vue +0 -58
  78. package/packages/BnCondVal/itemVal/selectVal.vue +0 -59
  79. package/packages/BnCondVal/itemVal/stringVal.vue +0 -156
  80. package/packages/BnCondition/index.vue +0 -551
  81. package/packages/BnCondition/util.js +0 -232
  82. package/packages/BnDatePicker/BnDatePicker.vue +0 -194
  83. package/packages/BnDrop/BnDrop.vue +0 -917
  84. package/packages/BnEmptyTip/BnEmptyTip.vue +0 -107
  85. package/packages/BnExportOrder/BnExportOrder.vue +0 -241
  86. package/packages/BnExportOrder/validatorCode.vue +0 -94
  87. package/packages/BnFileView/BnFileView.vue +0 -271
  88. package/packages/BnFileView/FileDetail.vue +0 -125
  89. package/packages/BnFileView/videoPreview.vue +0 -70
  90. package/packages/BnFilterOption/BnFilterOption.vue +0 -160
  91. package/packages/BnFunExpr/BnFunExpr.vue +0 -608
  92. package/packages/BnImportOrder/BnImportOrder.vue +0 -323
  93. package/packages/BnImportTemplate/BnImportTemplate.vue +0 -866
  94. package/packages/BnImportTemplate/assets/merge_tip_img.png +0 -0
  95. package/packages/BnImportTemplate/assets/sheet_tip.png +0 -0
  96. package/packages/BnImportTemplate/assets/xls.png +0 -0
  97. package/packages/BnImportTemplate/components/ImportTemplateTrigger.vue +0 -198
  98. package/packages/BnImportTemplate/components/TemplateEditDialog.vue +0 -340
  99. package/packages/BnImportTemplate/components/TemplateFieldsConfig.vue +0 -401
  100. package/packages/BnImportTemplate/components/TemplateListDialog.vue +0 -297
  101. package/packages/BnInpNum/BnInpNum.vue +0 -165
  102. package/packages/BnMenus/BnMenus.vue +0 -502
  103. package/packages/BnMenus/MenuItem.vue +0 -321
  104. package/packages/BnOrderCard/BnOrderCard.vue +0 -389
  105. package/packages/BnOrderCard/orderRemark.vue +0 -178
  106. package/packages/BnOrderCard/util.js +0 -94
  107. package/packages/BnOrderDetail/BnOrderDetail.vue +0 -338
  108. package/packages/BnOrderDetail/filterLogByUser.vue +0 -108
  109. package/packages/BnOrderDetail/orderLogs.vue +0 -53
  110. package/packages/BnOrderDetail/showSubForm/index.vue +0 -41
  111. package/packages/BnOrderDetail/showSubForm/showChildTable.vue +0 -61
  112. package/packages/BnOrderDetail/showSubForm/showTimeLine.vue +0 -131
  113. package/packages/BnOrderDetail/showSubForm/tableCellCopy.vue +0 -84
  114. package/packages/BnOrderShare/index.vue +0 -378
  115. package/packages/BnOrderShare/shareUrlInp.vue +0 -54
  116. package/packages/BnRadio/BnRadio.vue +0 -181
  117. package/packages/BnRelation/BnRelation.vue +0 -120
  118. package/packages/BnSelect/BnSelect.vue +0 -485
  119. package/packages/BnSmartForm/BnBatchForm.vue +0 -334
  120. package/packages/BnSmartForm/BnBatchFormDialog.vue +0 -423
  121. package/packages/BnSmartForm/BnSmartElf/elfLog/index.vue +0 -57
  122. package/packages/BnSmartForm/BnSmartElf/index.vue +0 -95
  123. package/packages/BnSmartForm/BnSmartFormPsychic.js +0 -629
  124. package/packages/BnSmartForm/BnSmartFormUtil.js +0 -524
  125. package/packages/BnSmartForm/addressForm/index.vue +0 -73
  126. package/packages/BnSmartForm/checkboxForm/index.vue +0 -99
  127. package/packages/BnSmartForm/childrenForm/childFormFile.vue +0 -237
  128. package/packages/BnSmartForm/childrenForm/childrenFormBody.vue +0 -260
  129. package/packages/BnSmartForm/childrenForm/index.vue +0 -110
  130. package/packages/BnSmartForm/childrenForm/searchInventory.vue +0 -115
  131. package/packages/BnSmartForm/chooseAssocTable/chooseAssocTable.vue +0 -451
  132. package/packages/BnSmartForm/chooseAssocTable/chooseChildGood.vue +0 -229
  133. package/packages/BnSmartForm/chooseAssocTable/tableCellCopy.vue +0 -84
  134. package/packages/BnSmartForm/chooseChildOrder/chooseChildOrder.vue +0 -158
  135. package/packages/BnSmartForm/chooseIPaasData/chooseIPaasData.vue +0 -307
  136. package/packages/BnSmartForm/chooseIPaasData/tableCellCopy.vue +0 -84
  137. package/packages/BnSmartForm/choosePackage/choosePackage.vue +0 -361
  138. package/packages/BnSmartForm/dateDualForm/index.vue +0 -37
  139. package/packages/BnSmartForm/dateForm/index.vue +0 -38
  140. package/packages/BnSmartForm/fileForm/fileFormData.js +0 -50
  141. package/packages/BnSmartForm/fileForm/index.vue +0 -240
  142. package/packages/BnSmartForm/formItemFooter/formItemFooter.vue +0 -38
  143. package/packages/BnSmartForm/formItemTop/formItemTop.vue +0 -42
  144. package/packages/BnSmartForm/index.vue +0 -1201
  145. package/packages/BnSmartForm/numberForm/index.vue +0 -63
  146. package/packages/BnSmartForm/radioForm/index.vue +0 -72
  147. package/packages/BnSmartForm/receiveForm/index.vue +0 -112
  148. package/packages/BnSmartForm/relationForm/index.vue +0 -82
  149. package/packages/BnSmartForm/scoreForm/index.vue +0 -39
  150. package/packages/BnSmartForm/selectForm/index.vue +0 -55
  151. package/packages/BnSmartForm/showValForm/index.vue +0 -42
  152. package/packages/BnSmartForm/showValForm/showValFormTable.vue +0 -104
  153. package/packages/BnSmartForm/smartFormsCommon.scss +0 -43
  154. package/packages/BnSmartForm/stringForm/index.vue +0 -170
  155. package/packages/BnVirtPopover/index.vue +0 -319
  156. package/packages/BnWebLog/BnWebLog.vue +0 -140
  157. package/packages/BnWorkSettingDrop/advancedOptions.js +0 -112
  158. package/packages/BnWorkSettingDrop/benBenAIUtil.js +0 -89
  159. package/packages/BnWorkSettingDrop/index.vue +0 -292
  160. package/packages/font/iconfont.css +0 -243
  161. package/packages/font/iconfont.ttf +0 -0
  162. package/packages/font/iconfont.woff +0 -0
  163. package/packages/font/iconfont.woff2 +0 -0
  164. package/utils/addressParse-old.js +0 -645
  165. package/utils/addressParse.js +0 -735
  166. package/utils/config.js +0 -68
  167. package/utils/index.js +0 -1171
@@ -1,629 +0,0 @@
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
-