doway-coms 1.6.10 → 1.6.11

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 (65) hide show
  1. package/.browserslistrc +2 -2
  2. package/README.md +28 -28
  3. package/package.json +52 -52
  4. package/packages/BaseButton/index.js +7 -7
  5. package/packages/BaseButton/src/index.vue +241 -241
  6. package/packages/BaseCheckbox/index.js +7 -7
  7. package/packages/BaseCheckbox/src/index.vue +134 -134
  8. package/packages/BaseDate/index.js +7 -7
  9. package/packages/BaseDate/src/index.vue +197 -197
  10. package/packages/BaseDateWeek/index.js +7 -7
  11. package/packages/BaseDateWeek/src/index.vue +163 -163
  12. package/packages/BaseDatetime/index.js +7 -7
  13. package/packages/BaseDatetime/src/index.vue +196 -196
  14. package/packages/BaseForm/index.js +7 -7
  15. package/packages/BaseForm/src/index.vue +666 -666
  16. package/packages/BaseGantt/index.js +9 -9
  17. package/packages/BaseGantt/src/index.vue +608 -608
  18. package/packages/BaseGrid/index.js +9 -9
  19. package/packages/BaseGrid/src/index.vue +2725 -2725
  20. package/packages/BaseGridAdjust/index.js +9 -9
  21. package/packages/BaseGridAdjust/src/index.vue +455 -455
  22. package/packages/BaseInput/index.js +7 -7
  23. package/packages/BaseInput/src/index.vue +164 -164
  24. package/packages/BaseIntervalInput/index.js +7 -7
  25. package/packages/BaseIntervalInput/src/index.vue +310 -310
  26. package/packages/BaseKanbanEmpty/index.js +7 -7
  27. package/packages/BaseKanbanEmpty/src/index.vue +176 -176
  28. package/packages/BaseNumberInput/index.js +7 -7
  29. package/packages/BaseNumberInput/src/index.vue +229 -229
  30. package/packages/BasePagination/index.js +7 -7
  31. package/packages/BasePagination/src/index.vue +91 -91
  32. package/packages/BasePictureCard/index.js +7 -7
  33. package/packages/BasePictureCard/src/index.vue +561 -561
  34. package/packages/BasePrintPreview/index.js +7 -7
  35. package/packages/BasePrintPreview/src/index.vue +117 -117
  36. package/packages/BasePulldown/index.js +7 -7
  37. package/packages/BasePulldown/src/index.vue +1090 -1090
  38. package/packages/BaseSearch/index.js +7 -7
  39. package/packages/BaseSearch/src/index.vue +935 -935
  40. package/packages/BaseSelect/index.js +7 -7
  41. package/packages/BaseSelect/src/index.vue +155 -153
  42. package/packages/BaseSelectMulti/index.js +7 -7
  43. package/packages/BaseSelectMulti/src/index.vue +148 -148
  44. package/packages/BaseTextArea/index.js +7 -7
  45. package/packages/BaseTextArea/src/index.vue +178 -178
  46. package/packages/BaseTime/index.js +7 -7
  47. package/packages/BaseTime/src/index.vue +166 -166
  48. package/packages/BaseTool/index.js +7 -7
  49. package/packages/BaseTool/src/index.vue +349 -349
  50. package/packages/BaseToolStatus/index.js +7 -7
  51. package/packages/BaseToolStatus/src/index.vue +383 -383
  52. package/packages/index.js +165 -165
  53. package/packages/styles/default.less +80 -80
  54. package/packages/utils/api.js +45 -45
  55. package/packages/utils/auth.js +38 -38
  56. package/packages/utils/common.js +583 -583
  57. package/packages/utils/dom.js +181 -181
  58. package/packages/utils/enum.js +83 -83
  59. package/packages/utils/filters.js +458 -458
  60. package/packages/utils/gridFormat.js +52 -52
  61. package/packages/utils/msg.js +16 -16
  62. package/packages/utils/patchFiles.js +44 -44
  63. package/packages/utils/request.js +169 -169
  64. package/packages/utils/store.js +261 -261
  65. package/vue.config.js +59 -59
@@ -1,584 +1,584 @@
1
- import {notification } from 'ant-design-vue'
2
- import store from './store'
3
- import XEUtils from 'xe-utils'
4
- /**
5
- * 替换掩码参数字符串
6
- * @param {参数字符串} paramString
7
- * @param {当前页面数据集} formData
8
- */
9
- export function replaceParamString(
10
- paramString,
11
- formData,
12
- currentModuleSelectInfo
13
- ) {
14
- // hh添加
15
- let tempStr = paramString
16
- while (true) {
17
- if (tempStr.indexOf('@Fn(') < 0) {
18
- break
19
- }
20
- let tempReplaceParam = tempStr.substr(tempStr.indexOf('@Fn('))
21
- tempReplaceParam = tempReplaceParam.substr(
22
- 0,
23
- tempReplaceParam.indexOf(')') + 1
24
- ) // 查找掩码参数
25
- let tempDataFields = tempReplaceParam
26
- .substr(0, tempReplaceParam.length - 1)
27
- .substr(4)
28
- .split('.')
29
- let tempReplaceValue = null
30
- if (tempDataFields[0] === '') {
31
- // 取主表数据
32
- tempReplaceValue = formData[tempDataFields[1]]
33
- } else {
34
- if (formData[tempDataFields[0]] instanceof Array) {
35
- let tempSelectItemInfo = currentModuleSelectInfo.filter(filterItem => {
36
- return filterItem.attrDataName === tempDataFields[0]
37
- })
38
- if (tempSelectItemInfo.length > 0) {
39
- let tempKeyFieldValue =
40
- tempSelectItemInfo[0].selectItem[tempSelectItemInfo[0].keyField]
41
- let tempActualRow = formData[tempDataFields[0]].filter(filterItem => {
42
- return (
43
- filterItem[tempSelectItemInfo[0].keyField] === tempKeyFieldValue
44
- )
45
- })
46
- if (tempActualRow.length > 0) {
47
- tempReplaceValue = tempActualRow[0][tempDataFields[1]]
48
- }
49
- }
50
- } else {
51
- tempReplaceValue = formData[tempDataFields[0]][tempDataFields[1]]
52
- }
53
- }
54
- //刘松嗣临时处理
55
- if (tempReplaceValue == undefined) {
56
- tempReplaceValue = '0'
57
- }
58
- tempStr = tempStr.substr(
59
- tempStr.indexOf(tempReplaceParam) + tempReplaceParam.length
60
- )
61
-
62
- if (typeof tempReplaceValue === 'string') {
63
- paramString = paramString.replace(
64
- tempReplaceParam,
65
- '"' + tempReplaceValue + '"'
66
- )
67
- tempStr = tempStr.replace(tempReplaceParam, '"' + tempReplaceValue + '"')
68
- } else {
69
- paramString = paramString.replace(tempReplaceParam, tempReplaceValue)
70
- tempStr = tempStr.replace(tempReplaceParam, tempReplaceValue)
71
- }
72
- }
73
- return paramString
74
- }
75
-
76
- /**
77
- * 替换掩码参数字符串
78
- * @param {参数字符串} paramString
79
- * @param {当前页面数据集} formData
80
- */
81
- export function replaceParam(paramString, formData) {
82
- let tempStr = paramString
83
- while (true) {
84
- if (tempStr.indexOf('@Fn(') < 0) {
85
- break
86
- }
87
- let tempReplaceParam = tempStr.substr(tempStr.indexOf('@Fn('))
88
- tempReplaceParam = tempReplaceParam.substr(
89
- 0,
90
- tempReplaceParam.indexOf(')') + 1
91
- ) // 查找掩码参数
92
- let tempDataFields = tempReplaceParam
93
- .substr(0, tempReplaceParam.length - 1)
94
- .substr(4)
95
- .split('.')
96
- let tempReplaceValue = null
97
- if (tempDataFields[0] === '') {
98
- // 取主表数据
99
- tempReplaceValue = formData[tempDataFields[1]]
100
- } else {
101
- tempReplaceValue = formData[tempDataFields[0]][tempDataFields[1]]
102
- }
103
- tempStr = tempStr.substr(
104
- tempStr.indexOf(tempReplaceParam) + tempReplaceParam.length
105
- )
106
-
107
- // if (typeof tempReplaceValue === 'string') {
108
- // paramString = paramString.replace(
109
- // tempReplaceParam,
110
- // '"' + tempReplaceValue + '"'
111
- // )
112
- // tempStr = tempStr.replace(tempReplaceParam, '"' + tempReplaceValue + '"')
113
- // } else {
114
- paramString = paramString.replace(tempReplaceParam, tempReplaceValue)
115
- tempStr = tempStr.replace(tempReplaceParam, tempReplaceValue)
116
- // }
117
- }
118
- return paramString
119
- }
120
-
121
- export function setFrameColState(formCols, formState, formStatus) {
122
- for (let prop in formCols) {
123
- if (formCols[prop].editStates instanceof Array) {
124
- let exists = formCols[prop].editStates.filter(item => {
125
- //editState:['add','edit']
126
- return item === formState // view === add|edit formState :view|add|edit
127
- }) //[]
128
- if (exists.length > 0) {
129
- formCols[prop].edit = true
130
- } else {
131
- formCols[prop].edit = false
132
- }
133
- }
134
- // 单据状态控制
135
- if (
136
- formStatus &&
137
- formCols[prop].editStatuss instanceof Array &&
138
- formCols[prop].editStatuss.length > 0 &&
139
- formCols[prop].edit === true
140
- ) {
141
- let formStatusExists = formCols[prop].editStatuss.filter(item => {
142
- //editStatuss:[,'publish',]
143
- return item === formStatus // formStatus:'draft'
144
- })
145
- if (formStatusExists.length > 0) {
146
- formCols[prop].edit = true
147
- } else {
148
- formCols[prop].edit = false
149
- }
150
- }
151
- // Vue.set(formCols, i, formCols[i])
152
- }
153
- }
154
- export function setFrameToolBtnState(toolBars, formState, formStatus) {
155
- for (let i = 0; i < toolBars.length; i++) {
156
- toolBars[i].visible = false
157
- toolBars[i].isPrimary = false
158
- if (
159
- toolBars[i].visibleStates &&
160
- toolBars[i].visibleStates.indexOf(formState) >= 0
161
- ) {
162
- toolBars[i].visible = true
163
- }
164
- if (formStatus && toolBars[i].visibleStatuss && toolBars[i].visible) {
165
- toolBars[i].visible = toolBars[i].visibleStatuss.indexOf(formStatus) >= 0
166
- }
167
- }
168
- // 查找优先级最大的并且显示的设置按钮强调色
169
- let visibleBtns = toolBars.filter(filterItem => {
170
- return filterItem.visible === true
171
- })
172
- //循环数组查找出小于自身的priority优先级 优先级高设置按钮强调色
173
- for (let i = 0; i < visibleBtns.length; i++) {
174
- let tempPriority = visibleBtns[i].priority
175
- let tempBtns = visibleBtns.filter(filterItem => {
176
- return filterItem.priority < tempPriority
177
- })
178
- //如果找到小于自身优先级的数量>0就说明还有更小的跳出本次不设置true继续查找
179
- if (tempBtns.length > 0) {
180
- continue
181
- }
182
- visibleBtns[i].isPrimary = true
183
- }
184
- }
185
- export function showErrors(errs) {
186
- let errors = ''
187
- for (let i = 0; i < errs.length; i++) {
188
- errors = errors + errs[i] + '\n'
189
- }
190
- notification.error({
191
- style: {
192
- whiteSpace: 'pre-wrap'
193
- },
194
- message: '错误',
195
- description: errors,
196
- placement: 'topRight',
197
- top: '100px'
198
- })
199
- }
200
- export function getUuid() {
201
- let d = new Date().getTime()
202
- let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(
203
- c
204
- ) {
205
- let r = (d + Math.random() * 16) % 16 | 0
206
- d = Math.floor(d / 16)
207
- return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16)
208
- })
209
- return uuid
210
- }
211
- export async function getFormValidErrors(formView) {
212
- let formErrors = []
213
- const validFormError = await formView.validate().catch(errMap => errMap)
214
- if (validFormError === false) {
215
- for (let errorProp in formView.errors) {
216
- for (let x = 0; x < formView.errors[errorProp].length; x++) {
217
- formErrors.push(errorProp + ':' + formView.errors[errorProp][x])
218
- }
219
- }
220
- }
221
- return formErrors
222
- }
223
- export function stringUrlQuery(obj) {
224
- let strUrlQuery = ''
225
- for (let prop in obj) {
226
- strUrlQuery = strUrlQuery + prop + '=' + obj[prop] + '&'
227
- }
228
- if (strUrlQuery.length > 0) {
229
- strUrlQuery = strUrlQuery.substring(0, strUrlQuery.length - 1)
230
- }
231
- return strUrlQuery
232
- }
233
- export function getRouteFullPath(route) {
234
- let fullPath = route.path + '?' + stringUrlQuery(route.query)
235
- return fullPath
236
- }
237
- export async function getGridValidErrors(gridView) {
238
- const gridErrors = await gridView.fullValidate()
239
- return gridErrors
240
- }
241
-
242
- export function routeBeforeEach(to, from, next){
243
- if(to.params.aliveCacheKey){
244
- to.meta['aliveCacheKey'] = to.params.aliveCacheKey
245
- }
246
- if(!to.meta.aliveCacheKey){
247
- alert('防呆,子应用没有路由缓存键:'+JSON.stringify(to))
248
- }
249
- if (to.meta.moduleCode && !store.getters.moduleViewInfo[to.meta.moduleCode]) {
250
- store
251
- .dispatch('moduleLoadViewInfo', { moduleCode: to.meta.moduleCode })
252
- .then(() => {
253
- next()
254
- })
255
- .catch((err) => {
256
- console.debug(err)
257
- })
258
- } else {
259
- next()
260
- }
261
- }
262
-
263
- /**
264
- * 供应商未税单价计算金额
265
- * @param {行数据信息} rowInfo
266
- * @param {税率} taxRate
267
- * @param {数量字段} qtyField
268
- * @param {未税单价字段} unitPriceNotTaxField
269
- * @param {含税单价字段} unitPriceField
270
- * @param {未税金额字段} amountNotTaxField
271
- * @param {含税金额字段} amountField
272
- * @param {税额字段} taxField
273
- */
274
- export function supplyUnitPriceNotTaxAmount(rowInfo, taxRate, colInfo) {
275
- //未税计算方式
276
- //未税金额
277
- rowInfo[colInfo.amountNotTaxField] = XEUtils.round(
278
- XEUtils.multiply(
279
- rowInfo[colInfo.qtyField],
280
- rowInfo[colInfo.unitPriceNotTaxField]
281
- ),
282
- 2
283
- )
284
- //税额
285
- rowInfo[colInfo.taxField] = XEUtils.round(
286
- XEUtils.multiply(rowInfo[colInfo.amountNotTaxField], taxRate),
287
- 2
288
- )
289
- //含税金额 = 未税金额+税额
290
- rowInfo[colInfo.amountField] = XEUtils.add(
291
- rowInfo[colInfo.amountNotTaxField],
292
- rowInfo[colInfo.taxField]
293
- )
294
- //返回来计算含税单价
295
-
296
- rowInfo[colInfo.unitPriceField] = XEUtils.round(
297
- XEUtils.divide(rowInfo[colInfo.amountField], rowInfo[colInfo.qtyField]),
298
- store.getters.supplyPricePrecision,
299
- )
300
-
301
- if (colInfo.direction) {
302
- rowInfo[colInfo.taxField] = XEUtils.multiply(
303
- rowInfo[colInfo.taxField],
304
- colInfo.direction
305
- )
306
- rowInfo[colInfo.amountNotTaxField] = XEUtils.multiply(
307
- rowInfo[colInfo.amountNotTaxField],
308
- colInfo.direction
309
- )
310
- rowInfo[colInfo.amountField] = XEUtils.multiply(
311
- rowInfo[colInfo.amountField],
312
- colInfo.direction
313
- )
314
- }
315
- }
316
-
317
- /**
318
- * 供应商含税单价计算金额
319
- * @param {行数据信息} rowInfo
320
- * @param {税率} taxRate
321
- * @param {数量字段} qtyField
322
- * @param {未税单价字段} unitPriceNotTaxField
323
- * @param {含税单价字段} unitPriceField
324
- * @param {未税金额字段} amountNotTaxField
325
- * @param {含税金额字段} amountField
326
- * @param {税额字段} taxField
327
- */
328
- export function supplyUnitPriceAmount(rowInfo, taxRate, colInfo) {
329
- //含税计算方式
330
- rowInfo[colInfo.amountField] = XEUtils.round(
331
- XEUtils.multiply(
332
- rowInfo[colInfo.qtyField],
333
- rowInfo[colInfo.unitPriceField]
334
- ),
335
- 2
336
- )
337
- //未税金额 = 含税金额除以1.13
338
- let tempValue = XEUtils.add(1, taxRate)
339
- rowInfo[colInfo.amountNotTaxField] = XEUtils.round(
340
- XEUtils.divide(rowInfo[colInfo.amountField], tempValue),
341
- 2
342
- )
343
- //税额 = 含税金额-未税金额
344
- rowInfo[colInfo.taxField] = XEUtils.subtract(
345
- rowInfo[colInfo.amountField],
346
- rowInfo[colInfo.amountNotTaxField]
347
- )
348
- //未税单价
349
- rowInfo[colInfo.unitPriceNotTaxField] = XEUtils.round(
350
- XEUtils.divide(
351
- rowInfo[colInfo.amountNotTaxField],
352
- rowInfo[colInfo.qtyField]
353
- ),
354
- store.getters.supplyPriceNotTaxPrecision,
355
- )
356
-
357
- if (colInfo.direction) {
358
- rowInfo[colInfo.taxField] = XEUtils.multiply(
359
- rowInfo[colInfo.taxField],
360
- colInfo.direction
361
- )
362
- rowInfo[colInfo.amountNotTaxField] = XEUtils.multiply(
363
- rowInfo[colInfo.amountNotTaxField],
364
- colInfo.direction
365
- )
366
- rowInfo[colInfo.amountField] = XEUtils.multiply(
367
- rowInfo[colInfo.amountField],
368
- colInfo.direction
369
- )
370
- }
371
- }
372
-
373
- /**
374
- * 客户含税单价计算金额
375
- * @param {行数据信息} rowInfo
376
- * @param {税率} taxRate
377
- * @param {数量字段} qtyField
378
- * @param {未税单价字段} unitPriceNotTaxField
379
- * @param {含税单价字段} unitPriceField
380
- * @param {未税金额字段} amountNotTaxField
381
- * @param {含税金额字段} amountField
382
- * @param {税额字段} taxField
383
- */
384
- export function custUnitPriceAmount(rowInfo, taxRate, colInfo) {
385
- //含税计算方式
386
- rowInfo[colInfo.amountField] = XEUtils.round(
387
- XEUtils.multiply(
388
- rowInfo[colInfo.qtyField],
389
- rowInfo[colInfo.unitPriceField]
390
- ),
391
- 2
392
- )
393
- //未税金额 = 含税金额除以1.13
394
- let tempValue = XEUtils.add(1, taxRate)
395
- rowInfo[colInfo.amountNotTaxField] = XEUtils.round(
396
- XEUtils.divide(rowInfo[colInfo.amountField], tempValue),
397
- 2
398
- )
399
- //税额 = 含税金额-未税金额
400
- rowInfo[colInfo.taxField] = XEUtils.subtract(
401
- rowInfo[colInfo.amountField],
402
- rowInfo[colInfo.amountNotTaxField]
403
- )
404
- //未税单价
405
- rowInfo[colInfo.unitPriceNotTaxField] = XEUtils.round(
406
- XEUtils.divide(
407
- rowInfo[colInfo.amountNotTaxField],
408
- rowInfo[colInfo.qtyField]
409
- ),
410
- store.getters.custPriceNotTaxPrecision,
411
- )
412
- if (colInfo.direction) {
413
- rowInfo[colInfo.taxField] = XEUtils.multiply(
414
- rowInfo[colInfo.taxField],
415
- colInfo.direction
416
- )
417
- rowInfo[colInfo.amountNotTaxField] = XEUtils.multiply(
418
- rowInfo[colInfo.amountNotTaxField],
419
- colInfo.direction
420
- )
421
- rowInfo[colInfo.amountField] = XEUtils.multiply(
422
- rowInfo[colInfo.amountField],
423
- colInfo.direction
424
- )
425
- }
426
- }
427
- /**
428
- * 客户未税单价计算金额
429
- * @param {行数据信息} rowInfo
430
- * @param {税率} taxRate
431
- * @param {数量字段} qtyField
432
- * @param {未税单价字段} unitPriceNotTaxField
433
- * @param {含税单价字段} unitPriceField
434
- * @param {未税金额字段} amountNotTaxField
435
- * @param {含税金额字段} amountField
436
- * @param {税额字段} taxField
437
- */
438
- export function custUnitPriceNotTaxAmount(rowInfo, taxRate, colInfo) {
439
- //未税计算方式
440
- //未税金额
441
- rowInfo[colInfo.amountNotTaxField] = XEUtils.round(
442
- XEUtils.multiply(
443
- rowInfo[colInfo.qtyField],
444
- rowInfo[colInfo.unitPriceNotTaxField]
445
- ),
446
- 2
447
- )
448
- //税额
449
- rowInfo[colInfo.taxField] = XEUtils.round(
450
- XEUtils.multiply(rowInfo[colInfo.amountNotTaxField], taxRate),
451
- 2
452
- )
453
- //含税金额 = 未税金额+税额
454
- rowInfo[colInfo.amountField] = XEUtils.add(
455
- rowInfo[colInfo.amountNotTaxField],
456
- rowInfo[colInfo.taxField]
457
- )
458
- //返回来计算含税单价
459
- rowInfo[colInfo.unitPriceField] = XEUtils.round(
460
- XEUtils.divide(rowInfo[colInfo.amountField], rowInfo[colInfo.qtyField]),
461
- store.getters.custPricePrecision,
462
- )
463
-
464
- if (colInfo.direction) {
465
- rowInfo[colInfo.taxField] = XEUtils.multiply(
466
- rowInfo[colInfo.taxField],
467
- colInfo.direction
468
- )
469
- rowInfo[colInfo.amountNotTaxField] = XEUtils.multiply(
470
- rowInfo[colInfo.amountNotTaxField],
471
- colInfo.direction
472
- )
473
- rowInfo[colInfo.amountField] = XEUtils.multiply(
474
- rowInfo[colInfo.amountField],
475
- colInfo.direction
476
- )
477
- }
478
- }
479
- /**
480
- * 设置行业属性字段信息
481
- * @param {字段} fields
482
- */
483
- export function setIndustryVersionFields(fields){
484
- let length = fields.length
485
- for(let i=length-1;i>=0;i--){
486
- if(XEUtils.isArray(fields[i].versions)){
487
- let tempValue = XEUtils.find(fields[i].versions,p=>store.getters.industryVersion.includes(p))
488
- if(tempValue){
489
- continue
490
- }
491
- XEUtils.remove(fields,i)
492
- }
493
- }
494
- }
495
-
496
- /**
497
- * 计算数量保留位数及判断取整方向
498
- * @param {行数据信息} rowInfo
499
- * @param {数值} number
500
- * @param {位数} digits
501
- * @param {取整方向} round
502
- */
503
- export function numberDigitsRound(rowInfo, colInfo) {
504
- // 向上、向下、四舍五入
505
- switch (rowInfo[colInfo.round]) {
506
- case 'ceiling':
507
- rowInfo[colInfo.number] = XEUtils.ceil(rowInfo[colInfo.number], rowInfo[colInfo.digits])
508
- break;
509
- case 'floor':
510
- rowInfo[colInfo.number] = XEUtils.floor(rowInfo[colInfo.number], rowInfo[colInfo.digits])
511
- break;
512
- case 'round':
513
- rowInfo[colInfo.number] = rowInfo[colInfo.number].toFixed(rowInfo[colInfo.digits])
514
- break;
515
- }
516
- }
517
- // 导出用
518
- export function getExportParams(columns) {
519
- let tempParams = {
520
- fields: [],
521
- dicts: {}
522
- }
523
- for (let i = 0; i < columns.length; i++) {
524
- if (columns[i].visible === false) {
525
- continue
526
- }
527
- let tempFieldInfo = {
528
- field: columns[i].field,
529
- title: columns[i].title
530
- }
531
- tempParams.fields.push(tempFieldInfo)
532
- if (columns[i].dataSource && columns[i].dataSource.length > 0) {
533
- if (!tempParams.dicts[columns[i].field]) {
534
- tempParams.dicts[columns[i].field] = {}
535
- for (let j = 0; j < columns[i].dataSource.length; j++) {
536
- tempParams.dicts[columns[i].field][columns[i].dataSource[j].value] =
537
- columns[i].dataSource[j].caption
538
- }
539
- }
540
- }
541
- }
542
- return tempParams
543
- }
544
- export function setFormButtons(toolBtns,statusBtns,permissionBtns){
545
- XEUtils.arrayEach(permissionBtns,loopBtn=>{
546
- let pushBtn = {
547
- code: loopBtn.code,
548
- caption: loopBtn.name,
549
- visible: true
550
- }
551
- if(loopBtn.visibleState){
552
- pushBtn['visibleStates'] = loopBtn.visibleState.split(',')
553
- }
554
- if(loopBtn.visibleStatus){
555
- pushBtn['visibleStatuss'] = loopBtn.visibleStatus.split(',')
556
- }
557
- switch(loopBtn.buttonType){
558
- case 'tool':
559
- toolBtns.push(pushBtn)
560
- break
561
- case 'status':
562
- statusBtns.push(pushBtn)
563
- break
564
- }
565
- })
566
- }
567
- export function getGridPagerButton(datas,dataCode){
568
- let returnButtons = []
569
- let tempData = XEUtils.find(datas,p=>p.code===dataCode)
570
- if(!tempData){
571
- return returnButtons
572
- }
573
-
574
- XEUtils.arrayEach(tempData.fields,loopField=>{
575
- if(loopField.controlType==='pager_button'){
576
- returnButtons.push({
577
- field:loopField.boundField,
578
- title:loopField.name,
579
- visible:true
580
- })
581
- }
582
- })
583
- return returnButtons
1
+ import {notification } from 'ant-design-vue'
2
+ import store from './store'
3
+ import XEUtils from 'xe-utils'
4
+ /**
5
+ * 替换掩码参数字符串
6
+ * @param {参数字符串} paramString
7
+ * @param {当前页面数据集} formData
8
+ */
9
+ export function replaceParamString(
10
+ paramString,
11
+ formData,
12
+ currentModuleSelectInfo
13
+ ) {
14
+ // hh添加
15
+ let tempStr = paramString
16
+ while (true) {
17
+ if (tempStr.indexOf('@Fn(') < 0) {
18
+ break
19
+ }
20
+ let tempReplaceParam = tempStr.substr(tempStr.indexOf('@Fn('))
21
+ tempReplaceParam = tempReplaceParam.substr(
22
+ 0,
23
+ tempReplaceParam.indexOf(')') + 1
24
+ ) // 查找掩码参数
25
+ let tempDataFields = tempReplaceParam
26
+ .substr(0, tempReplaceParam.length - 1)
27
+ .substr(4)
28
+ .split('.')
29
+ let tempReplaceValue = null
30
+ if (tempDataFields[0] === '') {
31
+ // 取主表数据
32
+ tempReplaceValue = formData[tempDataFields[1]]
33
+ } else {
34
+ if (formData[tempDataFields[0]] instanceof Array) {
35
+ let tempSelectItemInfo = currentModuleSelectInfo.filter(filterItem => {
36
+ return filterItem.attrDataName === tempDataFields[0]
37
+ })
38
+ if (tempSelectItemInfo.length > 0) {
39
+ let tempKeyFieldValue =
40
+ tempSelectItemInfo[0].selectItem[tempSelectItemInfo[0].keyField]
41
+ let tempActualRow = formData[tempDataFields[0]].filter(filterItem => {
42
+ return (
43
+ filterItem[tempSelectItemInfo[0].keyField] === tempKeyFieldValue
44
+ )
45
+ })
46
+ if (tempActualRow.length > 0) {
47
+ tempReplaceValue = tempActualRow[0][tempDataFields[1]]
48
+ }
49
+ }
50
+ } else {
51
+ tempReplaceValue = formData[tempDataFields[0]][tempDataFields[1]]
52
+ }
53
+ }
54
+ //刘松嗣临时处理
55
+ if (tempReplaceValue == undefined) {
56
+ tempReplaceValue = '0'
57
+ }
58
+ tempStr = tempStr.substr(
59
+ tempStr.indexOf(tempReplaceParam) + tempReplaceParam.length
60
+ )
61
+
62
+ if (typeof tempReplaceValue === 'string') {
63
+ paramString = paramString.replace(
64
+ tempReplaceParam,
65
+ '"' + tempReplaceValue + '"'
66
+ )
67
+ tempStr = tempStr.replace(tempReplaceParam, '"' + tempReplaceValue + '"')
68
+ } else {
69
+ paramString = paramString.replace(tempReplaceParam, tempReplaceValue)
70
+ tempStr = tempStr.replace(tempReplaceParam, tempReplaceValue)
71
+ }
72
+ }
73
+ return paramString
74
+ }
75
+
76
+ /**
77
+ * 替换掩码参数字符串
78
+ * @param {参数字符串} paramString
79
+ * @param {当前页面数据集} formData
80
+ */
81
+ export function replaceParam(paramString, formData) {
82
+ let tempStr = paramString
83
+ while (true) {
84
+ if (tempStr.indexOf('@Fn(') < 0) {
85
+ break
86
+ }
87
+ let tempReplaceParam = tempStr.substr(tempStr.indexOf('@Fn('))
88
+ tempReplaceParam = tempReplaceParam.substr(
89
+ 0,
90
+ tempReplaceParam.indexOf(')') + 1
91
+ ) // 查找掩码参数
92
+ let tempDataFields = tempReplaceParam
93
+ .substr(0, tempReplaceParam.length - 1)
94
+ .substr(4)
95
+ .split('.')
96
+ let tempReplaceValue = null
97
+ if (tempDataFields[0] === '') {
98
+ // 取主表数据
99
+ tempReplaceValue = formData[tempDataFields[1]]
100
+ } else {
101
+ tempReplaceValue = formData[tempDataFields[0]][tempDataFields[1]]
102
+ }
103
+ tempStr = tempStr.substr(
104
+ tempStr.indexOf(tempReplaceParam) + tempReplaceParam.length
105
+ )
106
+
107
+ // if (typeof tempReplaceValue === 'string') {
108
+ // paramString = paramString.replace(
109
+ // tempReplaceParam,
110
+ // '"' + tempReplaceValue + '"'
111
+ // )
112
+ // tempStr = tempStr.replace(tempReplaceParam, '"' + tempReplaceValue + '"')
113
+ // } else {
114
+ paramString = paramString.replace(tempReplaceParam, tempReplaceValue)
115
+ tempStr = tempStr.replace(tempReplaceParam, tempReplaceValue)
116
+ // }
117
+ }
118
+ return paramString
119
+ }
120
+
121
+ export function setFrameColState(formCols, formState, formStatus) {
122
+ for (let prop in formCols) {
123
+ if (formCols[prop].editStates instanceof Array) {
124
+ let exists = formCols[prop].editStates.filter(item => {
125
+ //editState:['add','edit']
126
+ return item === formState // view === add|edit formState :view|add|edit
127
+ }) //[]
128
+ if (exists.length > 0) {
129
+ formCols[prop].edit = true
130
+ } else {
131
+ formCols[prop].edit = false
132
+ }
133
+ }
134
+ // 单据状态控制
135
+ if (
136
+ formStatus &&
137
+ formCols[prop].editStatuss instanceof Array &&
138
+ formCols[prop].editStatuss.length > 0 &&
139
+ formCols[prop].edit === true
140
+ ) {
141
+ let formStatusExists = formCols[prop].editStatuss.filter(item => {
142
+ //editStatuss:[,'publish',]
143
+ return item === formStatus // formStatus:'draft'
144
+ })
145
+ if (formStatusExists.length > 0) {
146
+ formCols[prop].edit = true
147
+ } else {
148
+ formCols[prop].edit = false
149
+ }
150
+ }
151
+ // Vue.set(formCols, i, formCols[i])
152
+ }
153
+ }
154
+ export function setFrameToolBtnState(toolBars, formState, formStatus) {
155
+ for (let i = 0; i < toolBars.length; i++) {
156
+ toolBars[i].visible = false
157
+ toolBars[i].isPrimary = false
158
+ if (
159
+ toolBars[i].visibleStates &&
160
+ toolBars[i].visibleStates.indexOf(formState) >= 0
161
+ ) {
162
+ toolBars[i].visible = true
163
+ }
164
+ if (formStatus && toolBars[i].visibleStatuss && toolBars[i].visible) {
165
+ toolBars[i].visible = toolBars[i].visibleStatuss.indexOf(formStatus) >= 0
166
+ }
167
+ }
168
+ // 查找优先级最大的并且显示的设置按钮强调色
169
+ let visibleBtns = toolBars.filter(filterItem => {
170
+ return filterItem.visible === true
171
+ })
172
+ //循环数组查找出小于自身的priority优先级 优先级高设置按钮强调色
173
+ for (let i = 0; i < visibleBtns.length; i++) {
174
+ let tempPriority = visibleBtns[i].priority
175
+ let tempBtns = visibleBtns.filter(filterItem => {
176
+ return filterItem.priority < tempPriority
177
+ })
178
+ //如果找到小于自身优先级的数量>0就说明还有更小的跳出本次不设置true继续查找
179
+ if (tempBtns.length > 0) {
180
+ continue
181
+ }
182
+ visibleBtns[i].isPrimary = true
183
+ }
184
+ }
185
+ export function showErrors(errs) {
186
+ let errors = ''
187
+ for (let i = 0; i < errs.length; i++) {
188
+ errors = errors + errs[i] + '\n'
189
+ }
190
+ notification.error({
191
+ style: {
192
+ whiteSpace: 'pre-wrap'
193
+ },
194
+ message: '错误',
195
+ description: errors,
196
+ placement: 'topRight',
197
+ top: '100px'
198
+ })
199
+ }
200
+ export function getUuid() {
201
+ let d = new Date().getTime()
202
+ let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(
203
+ c
204
+ ) {
205
+ let r = (d + Math.random() * 16) % 16 | 0
206
+ d = Math.floor(d / 16)
207
+ return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16)
208
+ })
209
+ return uuid
210
+ }
211
+ export async function getFormValidErrors(formView) {
212
+ let formErrors = []
213
+ const validFormError = await formView.validate().catch(errMap => errMap)
214
+ if (validFormError === false) {
215
+ for (let errorProp in formView.errors) {
216
+ for (let x = 0; x < formView.errors[errorProp].length; x++) {
217
+ formErrors.push(errorProp + ':' + formView.errors[errorProp][x])
218
+ }
219
+ }
220
+ }
221
+ return formErrors
222
+ }
223
+ export function stringUrlQuery(obj) {
224
+ let strUrlQuery = ''
225
+ for (let prop in obj) {
226
+ strUrlQuery = strUrlQuery + prop + '=' + obj[prop] + '&'
227
+ }
228
+ if (strUrlQuery.length > 0) {
229
+ strUrlQuery = strUrlQuery.substring(0, strUrlQuery.length - 1)
230
+ }
231
+ return strUrlQuery
232
+ }
233
+ export function getRouteFullPath(route) {
234
+ let fullPath = route.path + '?' + stringUrlQuery(route.query)
235
+ return fullPath
236
+ }
237
+ export async function getGridValidErrors(gridView) {
238
+ const gridErrors = await gridView.fullValidate()
239
+ return gridErrors
240
+ }
241
+
242
+ export function routeBeforeEach(to, from, next){
243
+ if(to.params.aliveCacheKey){
244
+ to.meta['aliveCacheKey'] = to.params.aliveCacheKey
245
+ }
246
+ if(!to.meta.aliveCacheKey){
247
+ alert('防呆,子应用没有路由缓存键:'+JSON.stringify(to))
248
+ }
249
+ if (to.meta.moduleCode && !store.getters.moduleViewInfo[to.meta.moduleCode]) {
250
+ store
251
+ .dispatch('moduleLoadViewInfo', { moduleCode: to.meta.moduleCode })
252
+ .then(() => {
253
+ next()
254
+ })
255
+ .catch((err) => {
256
+ console.debug(err)
257
+ })
258
+ } else {
259
+ next()
260
+ }
261
+ }
262
+
263
+ /**
264
+ * 供应商未税单价计算金额
265
+ * @param {行数据信息} rowInfo
266
+ * @param {税率} taxRate
267
+ * @param {数量字段} qtyField
268
+ * @param {未税单价字段} unitPriceNotTaxField
269
+ * @param {含税单价字段} unitPriceField
270
+ * @param {未税金额字段} amountNotTaxField
271
+ * @param {含税金额字段} amountField
272
+ * @param {税额字段} taxField
273
+ */
274
+ export function supplyUnitPriceNotTaxAmount(rowInfo, taxRate, colInfo) {
275
+ //未税计算方式
276
+ //未税金额
277
+ rowInfo[colInfo.amountNotTaxField] = XEUtils.round(
278
+ XEUtils.multiply(
279
+ rowInfo[colInfo.qtyField],
280
+ rowInfo[colInfo.unitPriceNotTaxField]
281
+ ),
282
+ 2
283
+ )
284
+ //税额
285
+ rowInfo[colInfo.taxField] = XEUtils.round(
286
+ XEUtils.multiply(rowInfo[colInfo.amountNotTaxField], taxRate),
287
+ 2
288
+ )
289
+ //含税金额 = 未税金额+税额
290
+ rowInfo[colInfo.amountField] = XEUtils.add(
291
+ rowInfo[colInfo.amountNotTaxField],
292
+ rowInfo[colInfo.taxField]
293
+ )
294
+ //返回来计算含税单价
295
+
296
+ rowInfo[colInfo.unitPriceField] = XEUtils.round(
297
+ XEUtils.divide(rowInfo[colInfo.amountField], rowInfo[colInfo.qtyField]),
298
+ store.getters.supplyPricePrecision,
299
+ )
300
+
301
+ if (colInfo.direction) {
302
+ rowInfo[colInfo.taxField] = XEUtils.multiply(
303
+ rowInfo[colInfo.taxField],
304
+ colInfo.direction
305
+ )
306
+ rowInfo[colInfo.amountNotTaxField] = XEUtils.multiply(
307
+ rowInfo[colInfo.amountNotTaxField],
308
+ colInfo.direction
309
+ )
310
+ rowInfo[colInfo.amountField] = XEUtils.multiply(
311
+ rowInfo[colInfo.amountField],
312
+ colInfo.direction
313
+ )
314
+ }
315
+ }
316
+
317
+ /**
318
+ * 供应商含税单价计算金额
319
+ * @param {行数据信息} rowInfo
320
+ * @param {税率} taxRate
321
+ * @param {数量字段} qtyField
322
+ * @param {未税单价字段} unitPriceNotTaxField
323
+ * @param {含税单价字段} unitPriceField
324
+ * @param {未税金额字段} amountNotTaxField
325
+ * @param {含税金额字段} amountField
326
+ * @param {税额字段} taxField
327
+ */
328
+ export function supplyUnitPriceAmount(rowInfo, taxRate, colInfo) {
329
+ //含税计算方式
330
+ rowInfo[colInfo.amountField] = XEUtils.round(
331
+ XEUtils.multiply(
332
+ rowInfo[colInfo.qtyField],
333
+ rowInfo[colInfo.unitPriceField]
334
+ ),
335
+ 2
336
+ )
337
+ //未税金额 = 含税金额除以1.13
338
+ let tempValue = XEUtils.add(1, taxRate)
339
+ rowInfo[colInfo.amountNotTaxField] = XEUtils.round(
340
+ XEUtils.divide(rowInfo[colInfo.amountField], tempValue),
341
+ 2
342
+ )
343
+ //税额 = 含税金额-未税金额
344
+ rowInfo[colInfo.taxField] = XEUtils.subtract(
345
+ rowInfo[colInfo.amountField],
346
+ rowInfo[colInfo.amountNotTaxField]
347
+ )
348
+ //未税单价
349
+ rowInfo[colInfo.unitPriceNotTaxField] = XEUtils.round(
350
+ XEUtils.divide(
351
+ rowInfo[colInfo.amountNotTaxField],
352
+ rowInfo[colInfo.qtyField]
353
+ ),
354
+ store.getters.supplyPriceNotTaxPrecision,
355
+ )
356
+
357
+ if (colInfo.direction) {
358
+ rowInfo[colInfo.taxField] = XEUtils.multiply(
359
+ rowInfo[colInfo.taxField],
360
+ colInfo.direction
361
+ )
362
+ rowInfo[colInfo.amountNotTaxField] = XEUtils.multiply(
363
+ rowInfo[colInfo.amountNotTaxField],
364
+ colInfo.direction
365
+ )
366
+ rowInfo[colInfo.amountField] = XEUtils.multiply(
367
+ rowInfo[colInfo.amountField],
368
+ colInfo.direction
369
+ )
370
+ }
371
+ }
372
+
373
+ /**
374
+ * 客户含税单价计算金额
375
+ * @param {行数据信息} rowInfo
376
+ * @param {税率} taxRate
377
+ * @param {数量字段} qtyField
378
+ * @param {未税单价字段} unitPriceNotTaxField
379
+ * @param {含税单价字段} unitPriceField
380
+ * @param {未税金额字段} amountNotTaxField
381
+ * @param {含税金额字段} amountField
382
+ * @param {税额字段} taxField
383
+ */
384
+ export function custUnitPriceAmount(rowInfo, taxRate, colInfo) {
385
+ //含税计算方式
386
+ rowInfo[colInfo.amountField] = XEUtils.round(
387
+ XEUtils.multiply(
388
+ rowInfo[colInfo.qtyField],
389
+ rowInfo[colInfo.unitPriceField]
390
+ ),
391
+ 2
392
+ )
393
+ //未税金额 = 含税金额除以1.13
394
+ let tempValue = XEUtils.add(1, taxRate)
395
+ rowInfo[colInfo.amountNotTaxField] = XEUtils.round(
396
+ XEUtils.divide(rowInfo[colInfo.amountField], tempValue),
397
+ 2
398
+ )
399
+ //税额 = 含税金额-未税金额
400
+ rowInfo[colInfo.taxField] = XEUtils.subtract(
401
+ rowInfo[colInfo.amountField],
402
+ rowInfo[colInfo.amountNotTaxField]
403
+ )
404
+ //未税单价
405
+ rowInfo[colInfo.unitPriceNotTaxField] = XEUtils.round(
406
+ XEUtils.divide(
407
+ rowInfo[colInfo.amountNotTaxField],
408
+ rowInfo[colInfo.qtyField]
409
+ ),
410
+ store.getters.custPriceNotTaxPrecision,
411
+ )
412
+ if (colInfo.direction) {
413
+ rowInfo[colInfo.taxField] = XEUtils.multiply(
414
+ rowInfo[colInfo.taxField],
415
+ colInfo.direction
416
+ )
417
+ rowInfo[colInfo.amountNotTaxField] = XEUtils.multiply(
418
+ rowInfo[colInfo.amountNotTaxField],
419
+ colInfo.direction
420
+ )
421
+ rowInfo[colInfo.amountField] = XEUtils.multiply(
422
+ rowInfo[colInfo.amountField],
423
+ colInfo.direction
424
+ )
425
+ }
426
+ }
427
+ /**
428
+ * 客户未税单价计算金额
429
+ * @param {行数据信息} rowInfo
430
+ * @param {税率} taxRate
431
+ * @param {数量字段} qtyField
432
+ * @param {未税单价字段} unitPriceNotTaxField
433
+ * @param {含税单价字段} unitPriceField
434
+ * @param {未税金额字段} amountNotTaxField
435
+ * @param {含税金额字段} amountField
436
+ * @param {税额字段} taxField
437
+ */
438
+ export function custUnitPriceNotTaxAmount(rowInfo, taxRate, colInfo) {
439
+ //未税计算方式
440
+ //未税金额
441
+ rowInfo[colInfo.amountNotTaxField] = XEUtils.round(
442
+ XEUtils.multiply(
443
+ rowInfo[colInfo.qtyField],
444
+ rowInfo[colInfo.unitPriceNotTaxField]
445
+ ),
446
+ 2
447
+ )
448
+ //税额
449
+ rowInfo[colInfo.taxField] = XEUtils.round(
450
+ XEUtils.multiply(rowInfo[colInfo.amountNotTaxField], taxRate),
451
+ 2
452
+ )
453
+ //含税金额 = 未税金额+税额
454
+ rowInfo[colInfo.amountField] = XEUtils.add(
455
+ rowInfo[colInfo.amountNotTaxField],
456
+ rowInfo[colInfo.taxField]
457
+ )
458
+ //返回来计算含税单价
459
+ rowInfo[colInfo.unitPriceField] = XEUtils.round(
460
+ XEUtils.divide(rowInfo[colInfo.amountField], rowInfo[colInfo.qtyField]),
461
+ store.getters.custPricePrecision,
462
+ )
463
+
464
+ if (colInfo.direction) {
465
+ rowInfo[colInfo.taxField] = XEUtils.multiply(
466
+ rowInfo[colInfo.taxField],
467
+ colInfo.direction
468
+ )
469
+ rowInfo[colInfo.amountNotTaxField] = XEUtils.multiply(
470
+ rowInfo[colInfo.amountNotTaxField],
471
+ colInfo.direction
472
+ )
473
+ rowInfo[colInfo.amountField] = XEUtils.multiply(
474
+ rowInfo[colInfo.amountField],
475
+ colInfo.direction
476
+ )
477
+ }
478
+ }
479
+ /**
480
+ * 设置行业属性字段信息
481
+ * @param {字段} fields
482
+ */
483
+ export function setIndustryVersionFields(fields){
484
+ let length = fields.length
485
+ for(let i=length-1;i>=0;i--){
486
+ if(XEUtils.isArray(fields[i].versions)){
487
+ let tempValue = XEUtils.find(fields[i].versions,p=>store.getters.industryVersion.includes(p))
488
+ if(tempValue){
489
+ continue
490
+ }
491
+ XEUtils.remove(fields,i)
492
+ }
493
+ }
494
+ }
495
+
496
+ /**
497
+ * 计算数量保留位数及判断取整方向
498
+ * @param {行数据信息} rowInfo
499
+ * @param {数值} number
500
+ * @param {位数} digits
501
+ * @param {取整方向} round
502
+ */
503
+ export function numberDigitsRound(rowInfo, colInfo) {
504
+ // 向上、向下、四舍五入
505
+ switch (rowInfo[colInfo.round]) {
506
+ case 'ceiling':
507
+ rowInfo[colInfo.number] = XEUtils.ceil(rowInfo[colInfo.number], rowInfo[colInfo.digits])
508
+ break;
509
+ case 'floor':
510
+ rowInfo[colInfo.number] = XEUtils.floor(rowInfo[colInfo.number], rowInfo[colInfo.digits])
511
+ break;
512
+ case 'round':
513
+ rowInfo[colInfo.number] = rowInfo[colInfo.number].toFixed(rowInfo[colInfo.digits])
514
+ break;
515
+ }
516
+ }
517
+ // 导出用
518
+ export function getExportParams(columns) {
519
+ let tempParams = {
520
+ fields: [],
521
+ dicts: {}
522
+ }
523
+ for (let i = 0; i < columns.length; i++) {
524
+ if (columns[i].visible === false) {
525
+ continue
526
+ }
527
+ let tempFieldInfo = {
528
+ field: columns[i].field,
529
+ title: columns[i].title
530
+ }
531
+ tempParams.fields.push(tempFieldInfo)
532
+ if (columns[i].dataSource && columns[i].dataSource.length > 0) {
533
+ if (!tempParams.dicts[columns[i].field]) {
534
+ tempParams.dicts[columns[i].field] = {}
535
+ for (let j = 0; j < columns[i].dataSource.length; j++) {
536
+ tempParams.dicts[columns[i].field][columns[i].dataSource[j].value] =
537
+ columns[i].dataSource[j].caption
538
+ }
539
+ }
540
+ }
541
+ }
542
+ return tempParams
543
+ }
544
+ export function setFormButtons(toolBtns,statusBtns,permissionBtns){
545
+ XEUtils.arrayEach(permissionBtns,loopBtn=>{
546
+ let pushBtn = {
547
+ code: loopBtn.code,
548
+ caption: loopBtn.name,
549
+ visible: true
550
+ }
551
+ if(loopBtn.visibleState){
552
+ pushBtn['visibleStates'] = loopBtn.visibleState.split(',')
553
+ }
554
+ if(loopBtn.visibleStatus){
555
+ pushBtn['visibleStatuss'] = loopBtn.visibleStatus.split(',')
556
+ }
557
+ switch(loopBtn.buttonType){
558
+ case 'tool':
559
+ toolBtns.push(pushBtn)
560
+ break
561
+ case 'status':
562
+ statusBtns.push(pushBtn)
563
+ break
564
+ }
565
+ })
566
+ }
567
+ export function getGridPagerButton(datas,dataCode){
568
+ let returnButtons = []
569
+ let tempData = XEUtils.find(datas,p=>p.code===dataCode)
570
+ if(!tempData){
571
+ return returnButtons
572
+ }
573
+
574
+ XEUtils.arrayEach(tempData.fields,loopField=>{
575
+ if(loopField.controlType==='pager_button'){
576
+ returnButtons.push({
577
+ field:loopField.boundField,
578
+ title:loopField.name,
579
+ visible:true
580
+ })
581
+ }
582
+ })
583
+ return returnButtons
584
584
  }