@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
package/utils/index.js DELETED
@@ -1,1171 +0,0 @@
1
- import {cloneDeep} from "lodash";
2
- import {getApiBaseUrl} from "./config.js";
3
- /**
4
- * 规则配置默认支持的条件
5
- * */
6
- export const ruleTypeMap = {
7
- 1: [
8
- {title: '等于', id: '1'},
9
- {title: '不等于', id: '2'},
10
- {title: '包含', id: '3'},
11
- {title: '不包含', id: '4'},
12
- // {title: '包含任一项', id: '5'},
13
- // {title: '不包含任一项', id: '6'},
14
- {title: '为空', id: '9'},
15
- {title: '不为空', id: '10'},
16
- // {title: '不重复', id: '14'},
17
- // {title: '重复', id: '15'}
18
- ],
19
- 2: [
20
- {title: '等于', id: '1'},
21
- {title: '不等于', id: '2'},
22
- {title: '大于', id: '16'},
23
- {title: '小于', id: '17'},
24
- {title: '大于等于', id: '18'},
25
- {title: '小于等于', id: '19'},
26
- // {title: '范围', id: '8'},
27
- {title: '为空', id: '9'},
28
- {title: '不为空', id: '10'},
29
- ],
30
- 3: [
31
- {title: '等于', id: '1'},
32
- {title: '不等于', id: '2'},
33
- {title: '包含任一项', id: '5'},
34
- {title: '不包含任一项', id: '6'},
35
- {title: '为空', id: '9'},
36
- {title: '不为空', id: '10'}
37
- ],
38
- 4: [
39
- {title: '等于', id: '1'},
40
- {title: '不等于', id: '2'},
41
- {title: '包含任一项', id: '5'},
42
- {title: '不包含任一项', id: '6'},
43
- {title: '为空', id: '9'},
44
- {title: '不为空', id: '10'}
45
- ],
46
- 5: [
47
- {title: '等于', id: '1'},
48
- {title: '不等于', id: '2'},
49
- {title: '包含任一项', id: '5'},
50
- {title: '不包含任一项', id: '6'},
51
- {title: '包含所有项', id: '7'},
52
- {title: '为空', id: '9'},
53
- {title: '不为空', id: '10'},
54
- ],
55
- 6: [
56
- {title: '等于', id: '1'},
57
- {title: '不等于', id: '2'},
58
- {title: '包含任一项', id: '5'},
59
- {title: '不包含任一项', id: '6'},
60
- // {title: '包含所有项', id: '7'},
61
- {title: '包含', id: '3'},
62
- {title: '不包含', id: '4'},
63
- {title: '为空', id: '9'},
64
- {title: '不为空', id: '10'},
65
- // {title: '重复', id: '15'}
66
- ],
67
- 20: [
68
- {title: '等于', id: '1'},
69
- {title: '不等于', id: '2'},
70
- {title: '包含', id: '3'},
71
- {title: '不包含', id: '4'},
72
- {title: '包含任一项', id: '5'},
73
- {title: '不包含任一项', id: '6'},
74
- // {title: '包含所有项', id: '7'},
75
- {title: '为空', id: '9'},
76
- {title: '不为空', id: '10'},
77
- // {title: '重复', id: '15'}
78
- ],
79
- 7: [
80
- // {title: '范围', id: '8'},
81
- {title: '等于', id: '1'},
82
- {title: '不等于', id: '2'},
83
- {title: '大于', id: '16'},
84
- {title: '小于', id: '17'},
85
- {title: '大于等于', id: '18'},
86
- {title: '小于等于', id: '19'},
87
- {title: '为空', id: '9'},
88
- {title: '不为空', id: '10'},
89
- ],
90
- 8: [
91
- {title: '范围', id: '8'},
92
- {title: '包含', id: '3'},
93
- {title: '不包含', id: '4'},
94
- {title: '为空', id: '9'},
95
- {title: '不为空', id: '10'},
96
- {title: '属于', id: '11'},
97
- {title: '有交集', id: '12'},
98
- {title: '无交集', id: '13'},
99
- ],
100
- 9: [
101
- {title: '范围', id: '8'},
102
- {title: '为空', id: '9'},
103
- {title: '不为空', id: '10'},
104
- ],
105
- 10: [
106
- {title: '为空', id: '9'},
107
- {title: '不为空', id: '10'},
108
- ],
109
- 11: [
110
- {title: '等于', id: '1'},
111
- {title: '不等于', id: '2'},
112
- {title: '包含', id: '3'},
113
- {title: '不包含', id: '4'},
114
- {title: '包含任一项', id: '5'},
115
- {title: '不包含任一项', id: '6'},
116
- {title: '包含所有项', id: '7'},
117
- {title: '范围', id: '8'},
118
- {title: '为空', id: '9'},
119
- {title: '不为空', id: '10'},
120
- {title: '属于', id: '11'},
121
- {title: '有交集', id: '12'},
122
- {title: '无交集', id: '13'},],
123
- 12: [
124
- {title: '等于', id: '1'},
125
- {title: '不等于', id: '2'},
126
- {title: '包含', id: '3'},
127
- {title: '不包含', id: '4'},
128
- {title: '包含任一项', id: '5'},
129
- {title: '不包含任一项', id: '6'},
130
- {title: '包含所有项', id: '7'},
131
- {title: '范围', id: '8'},
132
- {title: '为空', id: '9'},
133
- {title: '不为空', id: '10'},
134
- {title: '属于', id: '11'},
135
- {title: '有交集', id: '12'},
136
- {title: '无交集', id: '13'},],
137
- 13: [
138
- {title: '等于', id: '1'},
139
- {title: '不等于', id: '2'},
140
- {title: '包含', id: '3'},
141
- {title: '不包含', id: '4'},
142
- {title: '包含任一项', id: '5'},
143
- {title: '不包含任一项', id: '6'},
144
- {title: '包含所有项', id: '7'},
145
- {title: '范围', id: '8'},
146
- {title: '为空', id: '9'},
147
- {title: '不为空', id: '10'},
148
- {title: '属于', id: '11'},
149
- {title: '有交集', id: '12'},
150
- {title: '无交集', id: '13'},],
151
- 14: [
152
- {title: '等于', id: '1'},
153
- {title: '不等于', id: '2'},
154
- {title: '包含', id: '3'},
155
- {title: '包含任一项', id: '5'},
156
- {title: '不包含任一项', id: '6'},
157
- // {title: '包含所有项', id: '7'},
158
- {title: '为空', id: '9'},
159
- {title: '不为空', id: '10'},
160
- ],
161
- 15: [
162
- // {title: '等于', id: '1'},
163
- // {title: '不等于', id: '2'},
164
- // {title: '包含', id: '3'},
165
- // {title: '包含任一项', id: '5'},
166
- // {title: '不包含任一项', id: '6'},
167
- // {title: '包含所有项', id: '7'},
168
- {title: '为空', id: '9'},
169
- {title: '不为空', id: '10'},
170
- ],
171
- /*8: [
172
- {title: '范围', id: '8'},
173
- {title: '为空', id: '9'},
174
- {title: '不为空', id: '10'},
175
- // {title: '属于', id: '11'},
176
- // {title: '有交集', id: '12'},
177
- // {title: '无交集', id: '13'},
178
- ],
179
- 9: [
180
- {title: '范围', id: '8'},
181
- {title: '为空', id: '9'},
182
- {title: '不为空', id: '10'},
183
- ],
184
- 11: [
185
- {title: '等于', id: '1'},
186
- {title: '不等于', id: '2'},
187
- {title: '包含', id: '3'},
188
- {title: '不包含', id: '4'},
189
- {title: '包含任一项', id: '5'},
190
- {title: '不包含任一项', id: '6'},
191
- {title: '包含所有项', id: '7'},
192
- {title: '范围', id: '8'},
193
- {title: '为空', id: '9'},
194
- {title: '不为空', id: '10'},
195
- {title: '属于', id: '11'},
196
- {title: '有交集', id: '12'},
197
- {title: '无交集', id: '13'},],
198
- 12: [
199
- {title: '等于', id: '1'},
200
- {title: '不等于', id: '2'},
201
- {title: '包含', id: '3'},
202
- {title: '不包含', id: '4'},
203
- {title: '包含任一项', id: '5'},
204
- {title: '不包含任一项', id: '6'},
205
- {title: '包含所有项', id: '7'},
206
- {title: '范围', id: '8'},
207
- {title: '为空', id: '9'},
208
- {title: '不为空', id: '10'},
209
- {title: '属于', id: '11'},
210
- {title: '有交集', id: '12'},
211
- {title: '无交集', id: '13'},],
212
- 13: [
213
- {title: '等于', id: '1'},
214
- {title: '不等于', id: '2'},
215
- {title: '包含', id: '3'},
216
- {title: '不包含', id: '4'},
217
- {title: '包含任一项', id: '5'},
218
- {title: '不包含任一项', id: '6'},
219
- {title: '包含所有项', id: '7'},
220
- {title: '范围', id: '8'},
221
- {title: '为空', id: '9'},
222
- {title: '不为空', id: '10'},
223
- {title: '属于', id: '11'},
224
- {title: '有交集', id: '12'},
225
- {title: '无交集', id: '13'},],
226
- 15: [
227
- {title: '等于', id: '1'},
228
- {title: '为空', id: '9'},
229
- {title: '不为空', id: '10'}
230
- ],*/
231
- };
232
- /**
233
- * 规则配置各组件默认支持的数值条件 当前值、选择其他组件 这种
234
- * */
235
- export const valueTypeMap = {
236
- 1: '0',
237
- 2: '0',
238
- 3: '2',
239
- 4: '2',
240
- 5: '2',
241
- 6: '2',
242
- 7: '0',
243
- 8: '0',
244
- 9: '0',
245
- 10: '2',
246
- 11: '2',
247
- 12: '2',
248
- 13: '2',
249
- 14: '2',
250
- 15: '2',
251
- }
252
- /**
253
- * 字段,组件数据格式化
254
- * */
255
- export const searchTypeMap = {
256
- 1: [
257
- {title: '等于', id: '1'},
258
- {title: '不等于', id: '2'},
259
- {title: '包含', id: '3'},
260
- {title: '不包含', id: '4'},
261
- {title: '包含任一项', id: '5'},
262
- {title: '为空', id: '9'},
263
- {title: '不为空', id: '10'},
264
- {title: '重复', id: '15'},
265
- {title: '不重复', id: '14'},
266
- ],
267
- 2: [
268
- {title: '范围', id: '8'},
269
- {title: '等于', id: '1'},
270
- {title: '不等于', id: '2'},
271
- {title: '包含任一项', id: '5'},
272
- {title: '为空', id: '9'},
273
- {title: '不为空', id: '10'},
274
- ],
275
- 3: [
276
- {title: '包含任一项', id: '5'},
277
- {title: '不包含任一项', id: '6'},
278
- {title: '为空', id: '9'},
279
- {title: '不为空', id: '10'}
280
- ],
281
- 4: [
282
- {title: '包含任一项', id: '5'},
283
- // {title: '不包含任一项', id: '6'},
284
- {title: '为空', id: '9'},
285
- {title: '不为空', id: '10'}
286
- ],
287
- 5: [
288
- {title: '等于', id: '1'},
289
- {title: '不等于', id: '2'},
290
- {title: '包含任一项', id: '5'},
291
- {title: '不包含任一项', id: '6'},
292
- {title: '包含所有项', id: '7'},
293
- {title: '为空', id: '9'},
294
- {title: '不为空', id: '10'},
295
- ],
296
- 6: [
297
- // {title: '等于', id: '1'},
298
- // {title: '不等于', id: '2'},
299
- {title: '包含', id: '3'},
300
- {title: '不包含', id: '4'},
301
- {title: '包含任一项', id: '5'},
302
- {title: '不包含任一项', id: '6'},
303
- {title: '包含所有项', id: '7'},
304
- {title: '为空', id: '9'},
305
- {title: '不为空', id: '10'},
306
- // {title: '重复', id: '15'}
307
- ],
308
- 20: [
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
- // {title: '重复', id: '15'}
319
- ],
320
- 7: [
321
- {title: '范围', id: '8'},
322
- {title: '为空', id: '9'},
323
- {title: '不为空', id: '10'},
324
- ],
325
- 8: [
326
- {title: '范围', id: '8'},
327
- {title: '包含', id: '3'},
328
- {title: '不包含', id: '4'},
329
- {title: '为空', id: '9'},
330
- {title: '不为空', id: '10'},
331
- {title: '属于', id: '11'},
332
- {title: '有交集', id: '12'},
333
- {title: '无交集', id: '13'},
334
- ],
335
- 9: [
336
- {title: '范围', id: '8'},
337
- {title: '为空', id: '9'},
338
- {title: '不为空', id: '10'},
339
- ],
340
- 10: [
341
- {title: '为空', id: '9'},
342
- {title: '不为空', id: '10'},
343
- ],
344
- 11: [
345
- {title: '等于', id: '1'},
346
- {title: '不等于', id: '2'},
347
- {title: '包含', id: '3'},
348
- {title: '不包含', id: '4'},
349
- {title: '包含任一项', id: '5'},
350
- {title: '不包含任一项', id: '6'},
351
- {title: '包含所有项', id: '7'},
352
- {title: '范围', id: '8'},
353
- {title: '为空', id: '9'},
354
- {title: '不为空', id: '10'},
355
- {title: '属于', id: '11'},
356
- {title: '有交集', id: '12'},
357
- {title: '无交集', id: '13'},],
358
- 12: [
359
- {title: '等于', id: '1'},
360
- {title: '不等于', id: '2'},
361
- {title: '包含', id: '3'},
362
- {title: '不包含', id: '4'},
363
- {title: '包含任一项', id: '5'},
364
- {title: '不包含任一项', id: '6'},
365
- {title: '包含所有项', id: '7'},
366
- {title: '范围', id: '8'},
367
- {title: '为空', id: '9'},
368
- {title: '不为空', id: '10'},
369
- {title: '属于', id: '11'},
370
- {title: '有交集', id: '12'},
371
- {title: '无交集', id: '13'},],
372
- 13: [
373
- {title: '等于', id: '1'},
374
- {title: '不等于', id: '2'},
375
- {title: '包含', id: '3'},
376
- {title: '不包含', id: '4'},
377
- {title: '包含任一项', id: '5'},
378
- {title: '不包含任一项', id: '6'},
379
- {title: '包含所有项', id: '7'},
380
- {title: '范围', id: '8'},
381
- {title: '为空', id: '9'},
382
- {title: '不为空', id: '10'},
383
- {title: '属于', id: '11'},
384
- {title: '有交集', id: '12'},
385
- {title: '无交集', id: '13'},],
386
- 14: [
387
- {title: '等于', id: '1'},
388
- {title: '不等于', id: '2'},
389
- {title: '包含', id: '3'},
390
- {title: '不包含', id: '4'},
391
- {title: '为空', id: '9'},
392
- {title: '不为空', id: '10'}
393
- ],
394
- 15: [
395
- {title: '等于', id: '1'},
396
- {title: '包含', id: '3'},
397
- {title: '不包含', id: '4'},
398
- {title: '为空', id: '9'},
399
- {title: '不为空', id: '10'}
400
- ],
401
- };
402
- /**
403
- * 全局默认成员列表
404
- * */
405
- export const userConst = [
406
- {title: "班牛助手(工单)", code: "10001487", id: "10001487"},
407
- {title: "班牛助手(服务大厅)", code: "857", id: "857"},
408
- {title: "班牛助手(API)", code: "110430206", id: "110430206"}
409
- ]
410
-
411
- /**
412
- * 通过id列表,和options将title拼接出来 ,id的key名和 title的key名可以传过来,默认是id和title
413
- * id:[1,2] options:[{id:1,title:'name'},{id:2,title:'name2'}] 或 {1:'name',2:'name2'}
414
- * 结果返回 'name,name2'
415
- * @param {Array} ids ID列表
416
- * @param {Array|Object} options 选项数组或对象映射
417
- * @param {String} idKey ID的键名,默认为'id',仅当options为数组时使用
418
- * @param {String} nameKey 名称的键名,默认为'title',仅当options为数组时使用
419
- * @param {String} separator 自定义分隔符,默认为中文逗号','
420
- * @return {String} 拼接后的字符串
421
- * */
422
- export function idsToTexts(ids, options, idKey = 'id', nameKey = 'title', separator = ',') {
423
- // 快速路径:空值检查
424
- if (!ids?.length) return '';
425
- if (!options) return ids.join(separator);
426
-
427
- // 使用Map代替普通对象,在大量数据时性能更好
428
- const map = new Map();
429
-
430
- // 判断options类型并进行相应处理
431
- if (Array.isArray(options)) {
432
- // 数组类型的options: [{id:1,title:'name'},{id:2,title:'name2'}]
433
- for (let i = 0, len = options.length; i < len; i++) {
434
- const item = options[i];
435
- if (item) map.set(item[idKey], item[nameKey]);
436
- }
437
- } else if (typeof options === 'object') {
438
- // 对象映射类型的options: {1:'name',2:'name2'}
439
- const keys = Object.keys(options);
440
- for (let i = 0, len = keys.length; i < len; i++) {
441
- const key = keys[i];
442
- map.set(key, options[key]);
443
- }
444
- }
445
-
446
- // 使用join的第二种模式,减少中间数组创建
447
- let result = '';
448
- for (let i = 0, len = ids.length; i < len; i++) {
449
- const id = ids[i];
450
- result += (i > 0 ? separator : '') + (map.has(String(id)) ? map.get(String(id)) :
451
- (map.has(id) ? map.get(id) : id));
452
- }
453
-
454
- return result;
455
- }
456
-
457
- /**
458
- * 向输入框的光标位置插入字符
459
- * */
460
- export function insertText(dom, value) {
461
- let selectRange;
462
- if (document.selection) {
463
- // IE Support
464
- dom.focus();
465
- selectRange = document.selection.createRange();
466
- selectRange.text = value;
467
- dom.focus();
468
- } else if (dom.selectionStart || dom.selectionStart == '0') {
469
- // Firefox support
470
- let startPos = dom.selectionStart;
471
- let endPos = dom.selectionEnd;
472
- let scrollTop = dom.scrollTop;
473
- dom.value = dom.value.substring(0, startPos) + value + dom.value.substring(endPos, dom.value.length);
474
- dom.focus();
475
- dom.selectionStart = startPos + value.length;
476
- dom.selectionEnd = startPos + value.length;
477
- dom.scrollTop = scrollTop;
478
- } else {
479
- dom.value += value;
480
- dom.focus();
481
- }
482
- return dom.value
483
- }
484
-
485
- /**
486
- * 格式化规则设置中单个组件信息
487
- * @param Object component 组件信息
488
- * */
489
- function tidyRuleComponent(component) {
490
- // 组件必须可见
491
- if (component.extraInfo.listShow != 1) {
492
- return null;
493
- }
494
- let data = {
495
- id: component.id,
496
- behaviorType: component.behaviorType,
497
- columnCode: component.columnCode,
498
- name: component.name,
499
- valueType: valueTypeMap[component.behaviorType],
500
- extraInfo: component.extraInfo || {},
501
- moduleDefinition: component.moduleDefinition || [],
502
- insideDataSourceInfo: component.insideDataSourceInfo,
503
- outDataSourceInfo: component.outDataSourceInfo || [],
504
- matchType: ruleTypeMap[component.behaviorType][0]?.id,
505
- searchType: ruleTypeMap[component.behaviorType][0]?.id,
506
- parentCode: component.parent ? component.parent.columnCode : '',
507
- parentId: component.parent ? component.parent.id : '',
508
- parentBehaviorType: component.parent ? component.parent.behaviorType : ''
509
- };
510
- switch (data.behaviorType) {
511
- case 1://文本
512
- case 9://评分
513
- case 11://富文本
514
- {
515
- data.value = '';
516
- break;
517
- }
518
- case 3://单选
519
- case 4://下拉
520
- {
521
- if (component.insideDataSourceInfo && component.insideDataSourceInfo.type) {
522
- data.postData = {
523
- appId: component.appId,
524
- projectId: component.tableId,
525
- ...component.insideDataSourceInfo
526
- }
527
- data.pathUrl = '/v2/project/column/select'
528
- }
529
- data.value = {};
530
- //筛选时,当计算条件是等于、不等于、为空、不为空时,值是空对象,其他条件都是数组
531
- if (data.matchType && !['1', '2', '9', '10'].includes(data.matchType)) {
532
- data.value = []
533
- }
534
- break;
535
- }
536
- case 5://多选
537
- case 6://联动组件
538
- case 20://多选联动组件
539
- case 12://标签
540
- {
541
- if (component.parent && [14, 15].includes(component.parent.behaviorType)) {
542
- data.pathUrl = '/address/getAreaDataList'
543
- }
544
- data.value = [];
545
- break;
546
- }
547
- case 10://附件
548
- {
549
- data.pathUrl = getApiBaseUrl() + "/v2/attachment/upload/task"
550
- data.value = []
551
- break;
552
- }
553
- case 2://数值
554
- case 7://日期
555
- {
556
- data.value = '';
557
- //筛选时,值是空对象
558
- if (data.matchType == '8') {
559
- data.value = {start: '', end: ''}
560
- }
561
- break;
562
- }
563
- case 8://日期区间
564
- {
565
- data.value = []
566
- //筛选时,值是空对象
567
- if (data.matchType) {
568
- data.value = {start: '', end: ''}
569
- }
570
- break;
571
- }
572
- case 13://子表单
573
- {
574
- data.value = []
575
- data.moduleDefinition = data.moduleDefinition ? data.moduleDefinition : [];
576
- let moduleDefinition = [];
577
- for (let i in data.moduleDefinition) {
578
- let childColumn = tidyRuleComponent(data.moduleDefinition[i]);
579
- if (childColumn) {
580
- moduleDefinition.push(childColumn);
581
- }
582
- }
583
- data.moduleDefinition = moduleDefinition;
584
- break;
585
- }
586
- }
587
- return data;
588
- }
589
-
590
- /**
591
- * 格式化规则配置组件列表
592
- * */
593
- export function tidyRuleComponents(components, appId, tableId) {
594
- let componentList = [];
595
- components.forEach(item => {
596
- if ([13, 14, 15].includes(item.behaviorType)) {
597
- item.moduleDefinition.forEach(ite => {
598
- let component = tidyRuleComponent({
599
- ...ite,
600
- name: `${item.name}-${ite.name}`,
601
- parent: item,
602
- appId,
603
- tableId
604
- })
605
- if (component) {
606
- componentList.push(component)
607
- }
608
- })
609
- } else {
610
- let component = tidyRuleComponent({...item, appId, tableId})
611
- if (component) {
612
- componentList.push(component)
613
- }
614
- }
615
- })
616
- return componentList;
617
- }
618
-
619
- /**
620
- * 将高级筛选的value格式化成json
621
- * */
622
- export function searchValueToJson(components) {
623
- let list = cloneDeep(components);
624
- list.forEach(item => {
625
- if (item.value != null) { // 排除 null 和 undefined
626
- const valueType = typeof item.value;
627
- // 保留 string、number 和 boolean 原始值,其他都转换为 JSON
628
- if (valueType !== 'string' && valueType !== 'number' && valueType !== 'boolean') {
629
- try {
630
- item.value = JSON.stringify(item.value);
631
- } catch (e) {
632
- console.warn('JSON stringify failed for value:', item.value);
633
- item.value = String(item.value); // 降级处理
634
- }
635
- }
636
- }
637
- });
638
- return list;
639
- }
640
-
641
- /**
642
- * 格式化查看、高级筛选的组件信息
643
- * @param Object component 组件信息
644
- * @param String power 权限字段,跟简易工单admin配置对应,不穿则不校验权限
645
- * */
646
- function formatComponent(component, power) {
647
- // 先校验权限 展示的地方特殊判断下id
648
- if (power && component.extraInfo[power] != 1) {
649
- return null;
650
- }
651
- let data = {
652
- id: component.id,
653
- type: component.type,
654
- behaviorType: component.behaviorType,
655
- defaultInfo: component.defaultInfo,
656
- columnCode: component.columnCode,
657
- name: component.name,
658
- extraInfo: component.extraInfo || {},
659
- style: component.style || {},
660
- moduleDefinition: component.moduleDefinition || [],
661
- insideDataSourceInfo: component.insideDataSourceInfo,
662
- outDataSourceInfo: component.outDataSourceInfo || [],
663
- };
664
- // 高级筛选条件
665
- if (power == 'queryShow') {
666
- data.searchType = searchTypeMap[component.behaviorType][0]?.id;
667
- data.parentCode = component.parent ? component.parent.columnCode : null
668
- // 过滤公共筛选条件
669
- if (['alarm_status', 'sync_status'].includes(component.columnCode)) {
670
- return null;
671
- }
672
- }
673
- switch (data.behaviorType) {
674
- case 1://文本
675
- case 9://评分
676
- case 11://富文本
677
- {
678
- data.value = '';
679
- break;
680
- }
681
- case 3://单选
682
- case 4://下拉
683
- {
684
- if (component.insideDataSourceInfo && component.insideDataSourceInfo.type) {
685
- data.postData = {
686
- appId: component.appId,
687
- projectId: component.tableId,
688
- ids: JSON.stringify(component.insideDataSourceInfo),
689
- ...component.insideDataSourceInfo
690
- }
691
- if (component.insideDataSourceInfo.type == 'user') {
692
- data.postData.selectParams = "{\"userColId\":\"-1\"}"
693
- data.moduleDefinition = cloneDeep(userConst)
694
- }
695
- data.pathUrl = '/v2/project/column/select'
696
- }
697
- data.value = {};
698
- //筛选时,当计算条件是等于、不等于、为空、不为空时,值是空对象,其他条件都是数组
699
- if (data.searchType && !['1', '2', '9', '10'].includes(data.searchType)) {
700
- data.value = []
701
- }
702
- break;
703
- }
704
- case 5://多选
705
- case 6://联动组件
706
- case 20://多选联动组件
707
- case 12://标签
708
- {
709
- if (component.parent && [14, 15].includes(component.parent.behaviorType)) {
710
- data.pathUrl = '/address/getAreaDataList'
711
- }
712
- data.value = [];
713
- break;
714
- }
715
- case 10://附件
716
- {
717
- data.pathUrl = getApiBaseUrl() + "/v2/attachment/upload/task"
718
- data.value = []
719
- break;
720
- }
721
- case 2://数值
722
- case 7://日期
723
- {
724
- data.value = '';
725
- //筛选时,值是空对象
726
- if (data.searchType) {
727
- data.value = {start: '', end: ''}
728
- }
729
- break;
730
- }
731
- case 8://日期区间
732
- {
733
- data.value = []
734
- //筛选时,值是空对象
735
- if (data.searchType) {
736
- data.value = {start: '', end: ''}
737
- }
738
- break;
739
- }
740
- case 13://子表单
741
- {
742
- data.value = []
743
- data.moduleDefinition = data.moduleDefinition ? data.moduleDefinition : [];
744
- let moduleDefinition = [];
745
- for (let i in data.moduleDefinition) {
746
- let childColumn = formatComponent(data.moduleDefinition[i], power);
747
- if (childColumn) {
748
- moduleDefinition.push(childColumn);
749
- }
750
- }
751
- data.moduleDefinition = moduleDefinition;
752
- break;
753
- }
754
- case 14://地址组件
755
- case 15://收寄信息组件
756
- {
757
- let val = {};
758
- data.moduleDefinition.forEach(item => {
759
- val[item.columnCode] = item.behaviorType == 6 ? [] : ''
760
- })
761
- data.value = val
762
- }
763
- }
764
- return data;
765
- }
766
-
767
- /**
768
- * 格式化高级筛选组件列表
769
- * */
770
- export function getSearchComponents(components, appId, tableId) {
771
- let componentList = [];
772
- components.forEach(item => {
773
- if ([13, 14, 15].includes(item.behaviorType) && item.extraInfo.queryShow == 1 && item.moduleDefinition.length > 0) {
774
- item.moduleDefinition.forEach(ite => {
775
- let component = formatComponent({
776
- ...ite,
777
- name: `${item.name}-${ite.name}`,
778
- parent: item,
779
- appId,
780
- tableId
781
- }, 'queryShow')
782
- if (component) {
783
- componentList.push(component)
784
- }
785
- })
786
- } else {
787
- let component = formatComponent({...item, appId, tableId}, 'queryShow')
788
- if (component) {
789
- componentList.push(component)
790
- }
791
- }
792
- })
793
- return componentList;
794
- }
795
-
796
- /**
797
- * 格式化查看、详情组件列表
798
- * */
799
- export function getWatchComponents(components, appId, tableId, power = 'listShow') {
800
- let componentList = [];
801
- components.forEach(item => {
802
- let component = formatComponent({...item, appId, tableId}, power)
803
- if (component) {
804
- componentList.push(component)
805
- }
806
- })
807
- return componentList;
808
- }
809
-
810
- /**
811
- * 格式化新建、编辑 组件的value
812
- * @param Object component 组件信息
813
- * @param Object values 编辑表单时,传入的工单数据
814
- * @param String power 权限,当不是编辑的时候,将只给有新建权限的组件进行赋值 component.extraInfo[power]
815
- * */
816
- function formatColumnVal(component, values, power) {
817
- let data = {
818
- id: component.id,
819
- type: component.type,
820
- behaviorType: component.behaviorType,
821
- columnCode: component.columnCode,
822
- defaultInfo: component.defaultInfo,
823
- name: component.name,
824
- extraInfo: component.extraInfo || {},
825
- style: component.style || {},
826
- moduleDefinition: component.moduleDefinition || [],
827
- insideDataSourceInfo: component.insideDataSourceInfo,
828
- outDataSourceInfo: component.outDataSourceInfo || [],
829
- };
830
- let isSetValue = false;
831
- try {
832
- isSetValue = values && data.extraInfo[power];
833
- } catch (e) {
834
- // 缺少判断,isSetValue保持false
835
- }
836
- switch (data.behaviorType) {
837
- case 1://文本
838
- case 2://数值
839
- case 7://日期
840
- case 9://评分
841
- case 11://富文本
842
- {
843
- if (isSetValue) {
844
- data.value = values[data.columnCode] || '';
845
- } else {
846
- data.value = data.defaultInfo || '';
847
- }
848
- break;
849
- }
850
- case 3://单选
851
- case 4://下拉
852
- case 6://单选联动组件
853
- case 20://多选联动组件
854
- {
855
- if (component.insideDataSourceInfo && component.insideDataSourceInfo.type) {
856
- data.postData = {
857
- appId: component.appId,
858
- projectId: component.tableId,
859
- ids: JSON.stringify(component.insideDataSourceInfo),
860
- ...component.insideDataSourceInfo
861
- }
862
- if (component.insideDataSourceInfo.type == 'user') {
863
- data.postData.selectParams = "{\"userColId\":\"-1\"}"
864
- }
865
- // 级联组件关联其他组件查询选项
866
- if(data.extraInfo.relationColumns && values){
867
- let extCondition = {};
868
- data.extraInfo.relationColumns.forEach(i=>{
869
- if(values[i]){
870
- extCondition[i] = values[i].code;
871
- }
872
- })
873
- data.postData.extCondition = JSON.stringify(extCondition)
874
- }
875
- data.pathUrl = '/v2/project/column/select'
876
- }
877
- if (isSetValue) {
878
- if(data.behaviorType == 6 && values[data.columnCode]){
879
- data.value = values[data.columnCode].map(i => i.code)
880
- }else{
881
- data.value = values[data.columnCode] || ([6,20].includes(data.behaviorType)?[]:{});
882
- }
883
- } else {
884
- try {
885
- if (data.behaviorType == 6 && component.defaultInfo) {
886
- data.value = component.defaultInfo.map(i => i.code)
887
- }else{
888
- data.value = component.defaultInfo || ([6,20].includes(data.behaviorType)?[]:{});
889
- }
890
- } catch (e) {
891
- data.value = {}
892
- }
893
- }
894
- break;
895
- }
896
- case 5://多选
897
- case 8://日期区间
898
- case 12://标签
899
- {
900
- if (isSetValue) {
901
- data.value = values[data.columnCode] || [];
902
- } else {
903
- try {
904
- data.value = component.defaultInfo || [];
905
- } catch (e) {
906
- data.value = []
907
- }
908
- }
909
- break;
910
- }
911
- case 10://附件
912
- {
913
- data.pathUrl = getApiBaseUrl() + "/v2/attachment/upload/task"
914
- if (isSetValue) {
915
- data.value = values[data.columnCode] || [];
916
- } else {
917
- try {
918
- data.value = component.defaultInfo || [];
919
- } catch (e) {
920
- data.value = []
921
- }
922
- }
923
- break;
924
- }
925
- case 13://子表单
926
- {
927
- data.value = values ? values[data.columnCode] || [] : []
928
- data.moduleDefinition = data.moduleDefinition ? data.moduleDefinition : [];
929
- let moduleDefinition = [];
930
- for (let i in data.moduleDefinition) {
931
- let childColumn = formatColumnVal(data.moduleDefinition[i]);
932
- if (childColumn) {
933
- moduleDefinition.push(childColumn);
934
- }
935
- }
936
- data.moduleDefinition = moduleDefinition;
937
-
938
- // 性能优化:预先构建默认值映射,减少重复计算
939
- if (data.value.length > 0 && data.moduleDefinition.length > 0) {
940
- const defaultValueMap = {};
941
- data.moduleDefinition.forEach(definition => {
942
- defaultValueMap[definition.columnCode] = definition.value;
943
- });
944
-
945
- // 修正data.value中的数据,确保每个对象都包含moduleDefinition中所有字段
946
- data.value.forEach(item => {
947
- // 直接在原对象上补充缺失字段,避免创建新对象
948
- for (const columnCode in defaultValueMap) {
949
- if (!(columnCode in item)) {
950
- item[columnCode] = defaultValueMap[columnCode];
951
- }
952
- }
953
- });
954
- }
955
-
956
- break;
957
- }
958
- case 14://地址组件
959
- case 15://收寄信息组件
960
- {
961
- let val = {};
962
- let editValue = values ? values[data.columnCode] : null;
963
- data.moduleDefinition.forEach(item => {
964
- if (editValue) {
965
- val[item.columnCode] = editValue[item.columnCode] || (item.behaviorType == 6 ? [] : '')
966
- } else {
967
- val[item.columnCode] = item.behaviorType == 6 ? [] : ''
968
- }
969
- })
970
- data.value = val
971
- break;
972
- }
973
- }
974
- return data;
975
- }
976
-
977
- /**
978
- * 格式化查看、编辑、组件列表
979
- * */
980
- export function tidyComponents(components, appId, tableId, values) {
981
- let componentList = [];
982
- let power = values && values.id ? 'isEditable' : 'isAddable';
983
- components.forEach(item => {
984
- let component = formatColumnVal({...item, appId, tableId}, values, power)
985
- if (component) {
986
- componentList.push(component)
987
- }
988
- })
989
- return componentList;
990
- }
991
-
992
- /**
993
- * 展示子表单详情,将附件的完整value进行组装,只能在展示的时候用哦,编辑可别用
994
- * component 子表单
995
- * data 整条工单数据包含子表单包含inside
996
- * */
997
- export function tidyShowSubDataFile(component, data) {
998
- let fullSubData = cloneDeep(data.inside[component.columnCode]);
999
- let subData = cloneDeep(data[component.columnCode])
1000
- let files = component.moduleDefinition.filter(c => c.behaviorType == 10);
1001
- if (files.length > 0) {
1002
- subData.forEach((item, index) => {
1003
- item.inside = {};
1004
- files.forEach(i => {
1005
- if (item[i.columnCode]) {
1006
- item.inside[i.columnCode] = fullSubData[index][i.columnCode]
1007
- }
1008
- })
1009
- })
1010
- }
1011
- return subData;
1012
- }
1013
-
1014
- /**
1015
- * 整理跳转工作表的筛选条件
1016
- * */
1017
- export function tidyJumpSearchData(searchData, components) {
1018
- let searchList = [];
1019
- try {
1020
- searchData.forEach(item => {
1021
- let component = components.find(i => i.columnCode == item.id);
1022
- if (component) {
1023
- searchList.push({
1024
- behaviorType: component.behaviorType,
1025
- columnCode: component.columnCode,
1026
- name: component.name,
1027
- searchType: item.searchType,
1028
- value: item.value
1029
- })
1030
- }
1031
- })
1032
- } catch (e) {
1033
- console.log('tidyJumpSearchDataErr:' + e)
1034
- }
1035
- return searchList;
1036
- }
1037
-
1038
-
1039
- /**
1040
- * 接口日志记录器,将系统最近100条接口请求记录到localStrage缓存中去
1041
- * @param {Object} res 接口返回体
1042
- */
1043
- function formatLogDate(date = new Date()) {
1044
- const d = new Date(date)
1045
- const pad = n => String(n).padStart(2, '0')
1046
- const year = d.getFullYear()
1047
- const month = pad(d.getMonth() + 1)
1048
- const day = pad(d.getDate())
1049
- const hour = pad(d.getHours())
1050
- const minute = pad(d.getMinutes())
1051
- const second = pad(d.getSeconds())
1052
-
1053
- return `${year}-${month}-${day} ${hour}:${minute}:${second}`
1054
- }
1055
- /**
1056
- * 接口日志记录器,将系统最近100条接口请求记录到localStrage缓存中去
1057
- * @param {Object} res 接口返回体
1058
- */
1059
- export const recordApiLog = (res) => {
1060
- try {
1061
- let logs = JSON.parse(localStorage.getItem('webLog') || 'false') || [];
1062
- let sessionInfo = JSON.parse(localStorage.getItem('sessionInfo') || 'false') || {};
1063
- // 获取用户信息
1064
- try {
1065
- let params = res.config.data?JSON.parse(res.config.data):{};
1066
- let data = res.data.data;
1067
- if (res.config.url.indexOf('/v2/logins/checkSession') >= 0) {
1068
- sessionInfo.userName = data.userInfo?.workNick;
1069
- sessionInfo.userId = data.userInfo?.id;
1070
- sessionInfo.companyName = data.company?.companyName;
1071
- sessionInfo.companyId = data.company?.id;
1072
- localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo))
1073
- }
1074
- else if (res.config.url.indexOf('/biztable/definition/table?tableCode') >= 0) {
1075
- sessionInfo.appId = data.appId;
1076
- sessionInfo.tableId = data.tableId;
1077
- sessionInfo.tableCode = data.tableCode;
1078
- sessionInfo.taskId = '';
1079
- sessionInfo.url = window.location.href
1080
- localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo))
1081
- }
1082
- else if (res.config.url.indexOf('/biztable/content/get') >= 0) {
1083
- sessionInfo.taskId = data.view.id;
1084
- localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo))
1085
- }
1086
- else if (res.config.url.indexOf('/v2/project/task/queryV3/') >= 0) {
1087
- sessionInfo.appId = params.appId;
1088
- sessionInfo.tableId = params.id;
1089
- sessionInfo.taskId = '';
1090
- sessionInfo.tableCode = '';
1091
- sessionInfo.workflowId='';
1092
- sessionInfo.workFlowNodeId='';
1093
- sessionInfo.instanceId='';
1094
- sessionInfo.processCode='';
1095
- sessionInfo.url = window.location.href
1096
- localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo))
1097
- }else if (res.config.url.indexOf('/v2/project/task/queryByTaskId') >= 0) {
1098
- sessionInfo.taskId = data.id;
1099
- localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo))
1100
- }
1101
- // 流程代办取小程序id,工作表id
1102
- else if (res.config.url.indexOf('/v2/unitman/list/todo/pendingTaskList') >= 0) {
1103
- sessionInfo.appId = params.appId;
1104
- sessionInfo.tableId = params.tableId;
1105
- sessionInfo.taskId = '';
1106
- sessionInfo.tableCode = '';
1107
- sessionInfo.workflowId='';
1108
- sessionInfo.workFlowNodeId='';
1109
- sessionInfo.instanceId='';
1110
- sessionInfo.processCode='';
1111
- sessionInfo.url = window.location.href
1112
- localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo))
1113
- }
1114
- // 流程代办取流程详细信息
1115
- else if (res.config.url.indexOf('v2/unitman/list/taskDetail') >= 0) {
1116
- sessionInfo.taskId = params.tableTaskId;
1117
- sessionInfo.workflowId = params.workflowId;
1118
- sessionInfo.workFlowNodeId = params.workflowNodeId;
1119
- sessionInfo.instanceId = data.workflowInstanceId;
1120
- sessionInfo.processCode = data.processCode;
1121
- localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo))
1122
- }
1123
- // 流程工单获取流程id
1124
- else if (res.config.url.indexOf('/wf/config/findWfTmpVersionByInstanceId') >= 0) {
1125
- sessionInfo.workflowId = data.id;
1126
- localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo))
1127
- }// 流程工单获取流程编号
1128
- else if (res.config.url.indexOf('/wf/config/findWfTmpVersionByInstanceId') >= 0) {
1129
- sessionInfo.taskId = data.id;
1130
- localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo))
1131
- } //获取流程其他信息
1132
- else if (res.config.url.indexOf('/v2/scheduleCenter/query/queryNodeList') >= 0) {
1133
- let node = data.content?data.content[0]:{}
1134
- sessionInfo.workFlowNodeId = node.templateNodeId;
1135
- sessionInfo.instanceId = node.instanceId;
1136
- sessionInfo.processCode = node.processCode;
1137
- localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo))
1138
- }
1139
- } catch (e) {
1140
- console.log('apiLog:'+e)
1141
- }
1142
- let log = {
1143
- url: res.config.url,
1144
- code: res.data ? res.data.code : null,
1145
- time: formatLogDate(res.headers.date),
1146
- traceId: res.headers['trace-id'] || '未返回'
1147
- }
1148
- logs = [log, ...logs].slice(0, 50)
1149
- localStorage.setItem('webLog', JSON.stringify(logs))
1150
- } catch (err) {
1151
- console.log(`一条日志未能成功捕捉:${JSON.stringify(res)}`)
1152
- }
1153
- };
1154
- /**
1155
- * 跳转主应用路由
1156
- * 无界子应用内通过 bus 通知主应用改地址栏;独立运行时跳转到主应用入口
1157
- * @param {string|{ name?: string, path?: string, params?: object, query?: object }} route
1158
- */
1159
-
1160
- export function mainAppRouterPush(route) {
1161
- if (window.__POWERED_BY_WUJIE__) {
1162
- window.$wujie?.bus.$emit('router-jump', route);
1163
- }else{
1164
-
1165
- }
1166
-
1167
- }
1168
- /**
1169
- * 地址自动识别
1170
- * */
1171
- export { addressParse } from './addressParse.js';