doway-coms 2.11.71 → 2.11.72

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 (92) hide show
  1. package/.browserslistrc +2 -2
  2. package/README.md +28 -28
  3. package/package.json +62 -62
  4. package/packages/AuditsList/index.js +7 -7
  5. package/packages/AuditsList/src/index.vue +314 -314
  6. package/packages/BaseButton/index.js +7 -7
  7. package/packages/BaseButton/src/index.vue +242 -242
  8. package/packages/BaseCheckbox/index.js +7 -7
  9. package/packages/BaseCheckbox/src/index.vue +134 -134
  10. package/packages/BaseDate/index.js +7 -7
  11. package/packages/BaseDate/src/index.vue +233 -233
  12. package/packages/BaseDateWeek/index.js +7 -7
  13. package/packages/BaseDateWeek/src/index.vue +163 -163
  14. package/packages/BaseDatetime/index.js +7 -7
  15. package/packages/BaseDatetime/src/index.vue +196 -196
  16. package/packages/BaseFileGroup/index.js +7 -7
  17. package/packages/BaseFileGroup/src/index.vue +724 -724
  18. package/packages/BaseForm/index.js +7 -7
  19. package/packages/BaseForm/src/index.vue +901 -901
  20. package/packages/BaseGantt/index.js +9 -9
  21. package/packages/BaseGantt/src/index.vue +617 -617
  22. package/packages/BaseGrid/index.js +9 -9
  23. package/packages/BaseGrid/src/exportCmp.vue +105 -105
  24. package/packages/BaseGrid/src/gridApi.js +32 -32
  25. package/packages/BaseGrid/src/index.vue +4602 -4602
  26. package/packages/BaseGridAdjust/index.js +9 -9
  27. package/packages/BaseGridAdjust/src/index.vue +482 -482
  28. package/packages/BaseInput/index.js +7 -7
  29. package/packages/BaseInput/src/index.vue +207 -207
  30. package/packages/BaseIntervalInput/index.js +7 -7
  31. package/packages/BaseIntervalInput/src/index.vue +310 -310
  32. package/packages/BaseKanbanEmpty/index.js +7 -7
  33. package/packages/BaseKanbanEmpty/src/index.vue +176 -176
  34. package/packages/BaseNumberInput/index.js +7 -7
  35. package/packages/BaseNumberInput/src/index.vue +299 -299
  36. package/packages/BasePagination/index.js +7 -7
  37. package/packages/BasePagination/src/index.vue +90 -90
  38. package/packages/BasePictureCard/index.js +7 -7
  39. package/packages/BasePictureCard/src/index.vue +671 -671
  40. package/packages/BasePrintPreview/index.js +7 -7
  41. package/packages/BasePrintPreview/src/index.vue +150 -150
  42. package/packages/BasePulldown/index.js +7 -7
  43. package/packages/BasePulldown/src/index.vue +1400 -1400
  44. package/packages/BaseSearch/index.js +7 -7
  45. package/packages/BaseSearch/src/index.vue +935 -935
  46. package/packages/BaseSelect/index.js +7 -7
  47. package/packages/BaseSelect/src/index.vue +162 -162
  48. package/packages/BaseSelectMulti/index.js +7 -7
  49. package/packages/BaseSelectMulti/src/index.vue +148 -148
  50. package/packages/BaseTextArea/index.js +7 -7
  51. package/packages/BaseTextArea/src/index.vue +197 -197
  52. package/packages/BaseTime/index.js +7 -7
  53. package/packages/BaseTime/src/index.vue +166 -166
  54. package/packages/BaseTool/index.js +7 -7
  55. package/packages/BaseTool/src/index.vue +353 -353
  56. package/packages/BaseToolStatus/index.js +7 -7
  57. package/packages/BaseToolStatus/src/ApprovalPersonsGroup.vue +41 -41
  58. package/packages/BaseToolStatus/src/index.vue +439 -439
  59. package/packages/BaseTreeSelect/index.js +8 -8
  60. package/packages/BaseTreeSelect/src/index.vue +437 -437
  61. package/packages/HistoryModal/index.js +8 -8
  62. package/packages/HistoryModal/src/index.vue +161 -161
  63. package/packages/LeaveAMessage/index.js +7 -7
  64. package/packages/LeaveAMessage/src/index.vue +601 -601
  65. package/packages/directive/clickoutside.js +44 -44
  66. package/packages/index.js +197 -197
  67. package/packages/styles/default.css +78 -78
  68. package/packages/styles/default.less +91 -91
  69. package/packages/styles/hps/default.less +73 -73
  70. package/packages/utils/api.js +128 -128
  71. package/packages/utils/auth.js +38 -38
  72. package/packages/utils/common.js +728 -728
  73. package/packages/utils/dom.js +181 -181
  74. package/packages/utils/enum.js +86 -86
  75. package/packages/utils/filters.js +542 -542
  76. package/packages/utils/gridFormat.js +66 -66
  77. package/packages/utils/msg.js +104 -104
  78. package/packages/utils/patchFiles.js +44 -44
  79. package/packages/utils/request.js +181 -181
  80. package/packages/utils/store.js +378 -378
  81. package/packages/utils/tscPrinter.js +101 -101
  82. package/sync.bash +6 -6
  83. package/vue.config.js +59 -59
  84. package/dist/css/chunk-vendors.7f83d8f9.css +0 -8
  85. package/dist/css/index.7946d50b.css +0 -1
  86. package/dist/favicon.ico +0 -0
  87. package/dist/js/chunk-vendors.28fda91d.js +0 -340
  88. package/dist/js/index.49bc6add.js +0 -2
  89. package/lib/doway-coms.common.js +0 -120397
  90. package/lib/doway-coms.css +0 -1
  91. package/lib/doway-coms.umd.js +0 -120407
  92. package/lib/doway-coms.umd.min.js +0 -328
@@ -1,378 +1,378 @@
1
- import {loadViewInfo, loadLangInfo} from './api'
2
- import XEUtils from 'xe-utils'
3
- import Vue from 'vue'
4
- import Vuex from 'vuex'
5
- import {stringUrlQuery} from './common'
6
- import {controlType} from './enum'
7
-
8
- Vue.use(Vuex)
9
-
10
- export default new Vuex.Store({
11
- state: {
12
- moduleLangUrl: '',
13
- umsUrl: '',
14
- baseUrl: '',
15
- msgUrl: '',
16
- wmsUrl: '',
17
- hegitTab: 33,
18
- identityUrl: '',
19
- token: '',
20
- industryVersion: '',//行业版本
21
- custPriceNotTaxPrecision: 0,
22
- custPricePrecision: 0,
23
- supplyPriceNotTaxPrecision: 0,
24
- supplyPricePrecision: 0,
25
- isGenerateMatCode: 'false',//是否生成物料编码
26
- webAppCode: '',
27
- moduleViewInfo: {},
28
- moduleLangInfo: {},
29
- controlSize: 'small',
30
- newId: 0,//明细新增id
31
- userId: '',
32
- userName: '',
33
- staffId: '',
34
- company: {},
35
- pathTabs:[]
36
- },
37
- mutations: {
38
- SET_PATH_TABS: (state, pathTabs) => {
39
- state.pathTabs = pathTabs
40
- },
41
- SET_HEGIT_TAB: (state, hegitTab) => {
42
- state.hegitTab = hegitTab
43
- },
44
- SET_TOKEN: (state, token) => {
45
- state.token = token
46
- },
47
- SET_USERID: (state, userId) => {
48
- state.userId = userId
49
- },
50
- SET_USERNAME: (state, userName) => {
51
- state.userName = userName
52
- },
53
- SET_STAFFID: (state, staffId) => {
54
- state.staffId = staffId
55
- },
56
- SET_INDUSTRY_VERSION: (state, industryVersion) => {
57
- state.industryVersion = industryVersion
58
- },
59
- SET_IS_GENERATE_MAT_CODE: (state, isGenerateMatCode) => {
60
- state.isGenerateMatCode = isGenerateMatCode
61
- },
62
- SET_WEB_APP_CODE: (state, webAppCode) => {
63
- state.webAppCode = webAppCode
64
- },
65
- SET_MODULE_LANG_INFO: (state, data) => {
66
- state.moduleLangInfo[data.moduleCode] = data.info
67
- },
68
- SET_MODULE_VIEW_INFO: (state, data) => {
69
- let tempDataInfo = {}
70
- const tempPulldownFields = [];
71
- XEUtils.arrayEach(data.info.datas, loopData => {
72
- let tempFields = []
73
- let tempPagerButtons = []
74
- tempDataInfo[loopData.code] = {code: '', name: '', fields: []}
75
- tempDataInfo[loopData.code].code = loopData.code
76
- tempDataInfo[loopData.code].name = loopData.name
77
- tempDataInfo[loopData.code].extraInfo = loopData.extraInfo
78
- if (loopData.extraInfo && Object.keys(loopData.extraInfo).length) {
79
- tempDataInfo[loopData.code] = XEUtils.assign(
80
- loopData.extraInfo,
81
- tempDataInfo[loopData.code],
82
- );
83
- }
84
- let operationFields = []
85
- XEUtils.arrayEach(loopData.fields, loopField => {
86
- let tempField = {
87
- field:loopField.code, // loopField.boundField,
88
- title: loopField.name,
89
- width: loopField.width,
90
- visible: !loopField.hidden,
91
- filter: loopField.isFilter,
92
- sortable: loopField.isSortable,
93
- controlType: loopField.controlType,
94
- edit: loopField.edit,
95
- sysVisible: !loopField.sysHidden,
96
- toolTip:loopField.toolTip
97
- }
98
- if (tempField.sysVisible === false) {
99
- tempField.visible = false
100
- }
101
- //页面状态控制
102
- if (loopField.editStates) {
103
- tempField['editStates'] = loopField.editStates.split(',')
104
- tempField['visibleStates'] = loopField.editStates.split(',')
105
- }
106
- //单据状态控制
107
- if (loopField.editStatuss) {
108
- tempField['editStatuss'] = loopField.editStatuss.split(',')
109
- tempField['visibleStatuss'] = loopField.editStatuss.split(',')
110
- }
111
- let extraInfo = loopField.extraInfo
112
- ? JSON.parse(loopField.extraInfo)
113
- : {}
114
- let userExtraInfo = loopField.userExtraInfo
115
- ? JSON.parse(loopField.userExtraInfo)
116
- : {}
117
- extraInfo = {...extraInfo, ...userExtraInfo}
118
- //存在额外参数,就赋值
119
- if (Object.keys(extraInfo).length) {
120
- if (Object.hasOwn(extraInfo, 'api')) {
121
- extraInfo['api'] = state[extraInfo['url']] + extraInfo['api']
122
- }
123
- tempField = XEUtils.assign(extraInfo, tempField)
124
- }
125
- if (tempField.controlType === controlType.select) {
126
- tempField['dataSource'] = XEUtils.filter(
127
- data.info.dictItems,
128
- p => p.dictCode === extraInfo.dataSource
129
- )
130
- }
131
- if (tempField.controlType === controlType.pulldown && tempField.linkData
132
- ) {
133
- tempPulldownFields.push(tempField);
134
- }
135
-
136
- if (tempField.controlType === controlType.pager_button) {
137
- tempPagerButtons.push(tempField)
138
- } else if (tempField.controlType === controlType.operation) {
139
- //操作按钮列
140
- // 动态加载 visibleConditional 函数 来控制操作按钮是否显示
141
- if (tempField.visibleConditional) {
142
- tempField.visibleConditional = eval(`(${tempField.visibleConditional})`);
143
- }
144
- operationFields.push(tempField)
145
-
146
- } else {
147
- tempFields.push(tempField)
148
- }
149
- })
150
-
151
- tempDataInfo[loopData.code]['pagerButtons'] = tempPagerButtons
152
- if (operationFields.length > 0) {
153
- //添加右侧按钮操作列
154
- tempFields.push({
155
- field: controlType.operation,
156
- title: '操作',
157
- width: operationFields[0].width || 100,
158
- fixed: 'right',
159
- showOverflow: true,
160
- controlType: controlType.operation,
161
- params: {
162
- columns: operationFields
163
- }
164
- })
165
- }
166
- tempDataInfo[loopData.code]['fields'] = tempFields
167
-
168
- })
169
- //批量设置下拉属性
170
- XEUtils.arrayEach(tempPulldownFields, (loopField) => {
171
- if(!tempDataInfo[loopField.linkData]){
172
- return
173
- }
174
- loopField['columns'] = tempDataInfo[loopField.linkData].fields;
175
- loopField['pageSize'] = tempDataInfo[loopField.linkData].pageSize;
176
- loopField['pageSizeOptions'] = tempDataInfo[loopField.linkData].pageSizeOptions;
177
- let tempApi = null;
178
- switch(tempDataInfo[loopField.linkData].objectService){
179
- case 'base':
180
- tempApi = process.env.VUE_APP_BASE_SERVICE_URL
181
- break;
182
- case 'mes':
183
- tempApi = process.env.VUE_APP_MES_SERVICE_URL
184
- break;
185
- case 'wms':
186
- tempApi = process.env.VUE_APP_WMS_SERVICE_URL
187
- break;
188
- case 'erp':
189
- tempApi = process.env.VUE_APP_ERP_SERVICE_URL
190
- break;
191
- default:
192
- tempApi = process.env.VUE_APP_WMS_SERVICE_URL
193
- break;
194
- }
195
- loopField['api'] = tempApi+'/v1/commonOperation/searchData';
196
- loopField['currentModuleCode'] = data.moduleCode;
197
- });
198
- data.info['dataInfo'] = tempDataInfo
199
- state.moduleViewInfo[data.moduleCode] = data.info
200
- },
201
- SET_NEW_ID: (state, id) => {
202
- state.newId = id
203
- },
204
- SET_UMS_URL: (state, url) => {
205
- state.umsUrl = url
206
- },
207
- SET_MODULE_LANG_URL: (state, url) => {
208
- state.moduleLangUrl = url
209
- },
210
- SET_BASE_URL: (state, url) => {
211
- state.baseUrl = url
212
- },
213
- SET_WMS_URL: (state, url) => {
214
- state.wmsUrl = url
215
- },
216
- SET_CUST_PRICE_NOT_TAX_PRECISION: (state, custPriceNotTaxPrecision) => {
217
- state.custPriceNotTaxPrecision = custPriceNotTaxPrecision
218
- },
219
- SET_CUST_PRICE_PRECISION: (state, custPricePrecision) => {
220
- state.custPricePrecision = custPricePrecision
221
- },
222
- SET_SUPPLY_PRICE_NOT_TAX_PRECISION: (state, supplyPriceNotTaxPrecision) => {
223
- state.supplyPriceNotTaxPrecision = supplyPriceNotTaxPrecision
224
- },
225
- SET_SUPPLY_PRICE_PRECISION: (state, supplyPricePrecision) => {
226
- state.supplyPricePrecision = supplyPricePrecision
227
- },
228
- SET_MSG_URL: (state, url) => {
229
- state.msgUrl = url
230
- },
231
- SET_IDENTITY_URL: (state, url) => {
232
- state.identityUrl = url
233
- },
234
- SET_BASE_SETTING: (state, baseSetting) => {
235
- state.baseSetting = baseSetting
236
- },
237
- SET_DEFAULT_DEP: (state, defaultDep) => {
238
- state.defaultDep = defaultDep
239
- },
240
- SET_COMPANY: (state, company) => {
241
- state.company = company
242
- },
243
- },
244
- actions: {
245
- /**
246
- * 系统登出
247
- * @param {} param0
248
- */
249
- logOut({commit}) {
250
- // alert('会话过期3');
251
- if (window.$wujie) {
252
- // alert('会话过期4');
253
- //通知主应用会员过期重新登陆
254
- window.$wujie.bus.$emit(
255
- 'subAppLoginOut', window.$wujie.props.webAppCode
256
- )
257
- }
258
- },
259
- setTabTitle({commit}, tabInfo) {
260
- //通知父应用修改Tab标签文字描述
261
- if (window.$wujie) {
262
-
263
- if (tabInfo.replaceQuery) {
264
- let newRoutePath =
265
- tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
266
- history.replaceState(null, null, (window.$wujie.props.webAppActiveRule + newRoutePath))
267
- }
268
-
269
- window.$wujie.bus.$emit('subAppSetTabTitle', {
270
- title: tabInfo.title,
271
- name: tabInfo.name,
272
- query: tabInfo.query,
273
- replaceQuery: tabInfo.replaceQuery,
274
- path: tabInfo.path
275
- })
276
- }
277
- },
278
- closeTab({commit}, fullPath) {
279
- if (window.$wujie) {
280
- window.$wujie.bus.$emit(
281
- 'subAppCloseTab',
282
- window.$wujie.props.webAppActiveRule + fullPath
283
- )
284
- }
285
- },
286
- moduleLoadViewInfo({commit, state}, dataInfo) {
287
- let vm = this
288
- return new Promise((resolve, reject) => {
289
- loadViewInfo({
290
- moduleCode: dataInfo.moduleCode,
291
- companyId: dataInfo.companyId,
292
- })
293
- .then(reponseData => {
294
- commit('SET_MODULE_VIEW_INFO', {
295
- moduleCode: dataInfo.moduleCode,
296
- info: reponseData.content
297
- })
298
- loadLangInfo(dataInfo.moduleCode, reponseData.content.moduleLangCacheHash)
299
- .then(langData => {
300
- commit('SET_MODULE_LANG_INFO', {
301
- moduleCode: dataInfo.moduleCode,
302
- info: langData.data
303
- })
304
- resolve()
305
- }).catch(() => {
306
- resolve()
307
- })
308
- })
309
- .catch(error => {
310
- reject(error)
311
- })
312
- })
313
- },
314
- // moduleLoadLangInfo({ commit, state }, dataInfo) {
315
- // let vm = this
316
- // return new Promise((resolve, reject) => {
317
- // loadLangInfo(dataInfo.moduleCode)
318
- // .then(reponseData => {
319
- // commit('SET_MODULE_LANG_INFO', {
320
- // moduleCode: dataInfo.moduleCode,
321
- // info: reponseData.data
322
- // })
323
- // resolve()
324
- // })
325
- // .catch(error => {
326
- // console.debug(error)
327
- // resolve()
328
- // })
329
- // })
330
- // },
331
- // 固定返回工作台,并根据条件决定是否关闭其余标签
332
- goWorkbench({commit}, tabsAllClose) {
333
- if (window.$wujie) {
334
- window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose == false ? false : true)
335
- }
336
- },
337
- // 替换页面
338
- replaceTab({commit}, fullPath) {
339
- if (window.$wujie) {
340
- window.$wujie.bus.$emit(
341
- 'subAppReplaceTab',
342
- window.$wujie.props.webAppActiveRule + fullPath
343
- )
344
- }
345
- },
346
- },
347
- modules: {},
348
- getters: {
349
- custPriceNotTaxPrecision: state => state.custPriceNotTaxPrecision,
350
- custPricePrecision: state => state.custPricePrecision,
351
- supplyPriceNotTaxPrecision: state => state.supplyPriceNotTaxPrecision,
352
- supplyPricePrecision: state => state.supplyPricePrecision,
353
- industryVersion: state => state.industryVersion,
354
- isGenerateMatCode: state => state.isGenerateMatCode,
355
- umsUrl: state => state.umsUrl,
356
- moduleLangUrl: state => state.moduleLangUrl,
357
- baseUrl: state => state.baseUrl,
358
- msgUrl: state => state.msgUrl,
359
- identityUrl: state => state.identityUrl,
360
- token: state => state.token,
361
- webAppCode: state => state.webAppCode,
362
- moduleViewInfo: state => state.moduleViewInfo,
363
- moduleLangInfo: state => state.moduleLangInfo,
364
- controlSize: state => state.controlSize,
365
- hegitTab: state => state.hegitTab,
366
- newId: state => () => {
367
- state.newId = state.newId + 1
368
- return state.newId
369
- },
370
- userId: state => state.userId,
371
- userName: state => state.userName,
372
- staffId: state => state.staffId,
373
- baseSetting: state => state.baseSetting,
374
- defaultDep: state => state.defaultDep,
375
- company: state => state.company,
376
- pathTabs: state => state.pathTabs
377
- }
378
- })
1
+ import {loadViewInfo, loadLangInfo} from './api'
2
+ import XEUtils from 'xe-utils'
3
+ import Vue from 'vue'
4
+ import Vuex from 'vuex'
5
+ import {stringUrlQuery} from './common'
6
+ import {controlType} from './enum'
7
+
8
+ Vue.use(Vuex)
9
+
10
+ export default new Vuex.Store({
11
+ state: {
12
+ moduleLangUrl: '',
13
+ umsUrl: '',
14
+ baseUrl: '',
15
+ msgUrl: '',
16
+ wmsUrl: '',
17
+ hegitTab: 33,
18
+ identityUrl: '',
19
+ token: '',
20
+ industryVersion: '',//行业版本
21
+ custPriceNotTaxPrecision: 0,
22
+ custPricePrecision: 0,
23
+ supplyPriceNotTaxPrecision: 0,
24
+ supplyPricePrecision: 0,
25
+ isGenerateMatCode: 'false',//是否生成物料编码
26
+ webAppCode: '',
27
+ moduleViewInfo: {},
28
+ moduleLangInfo: {},
29
+ controlSize: 'small',
30
+ newId: 0,//明细新增id
31
+ userId: '',
32
+ userName: '',
33
+ staffId: '',
34
+ company: {},
35
+ pathTabs:[]
36
+ },
37
+ mutations: {
38
+ SET_PATH_TABS: (state, pathTabs) => {
39
+ state.pathTabs = pathTabs
40
+ },
41
+ SET_HEGIT_TAB: (state, hegitTab) => {
42
+ state.hegitTab = hegitTab
43
+ },
44
+ SET_TOKEN: (state, token) => {
45
+ state.token = token
46
+ },
47
+ SET_USERID: (state, userId) => {
48
+ state.userId = userId
49
+ },
50
+ SET_USERNAME: (state, userName) => {
51
+ state.userName = userName
52
+ },
53
+ SET_STAFFID: (state, staffId) => {
54
+ state.staffId = staffId
55
+ },
56
+ SET_INDUSTRY_VERSION: (state, industryVersion) => {
57
+ state.industryVersion = industryVersion
58
+ },
59
+ SET_IS_GENERATE_MAT_CODE: (state, isGenerateMatCode) => {
60
+ state.isGenerateMatCode = isGenerateMatCode
61
+ },
62
+ SET_WEB_APP_CODE: (state, webAppCode) => {
63
+ state.webAppCode = webAppCode
64
+ },
65
+ SET_MODULE_LANG_INFO: (state, data) => {
66
+ state.moduleLangInfo[data.moduleCode] = data.info
67
+ },
68
+ SET_MODULE_VIEW_INFO: (state, data) => {
69
+ let tempDataInfo = {}
70
+ const tempPulldownFields = [];
71
+ XEUtils.arrayEach(data.info.datas, loopData => {
72
+ let tempFields = []
73
+ let tempPagerButtons = []
74
+ tempDataInfo[loopData.code] = {code: '', name: '', fields: []}
75
+ tempDataInfo[loopData.code].code = loopData.code
76
+ tempDataInfo[loopData.code].name = loopData.name
77
+ tempDataInfo[loopData.code].extraInfo = loopData.extraInfo
78
+ if (loopData.extraInfo && Object.keys(loopData.extraInfo).length) {
79
+ tempDataInfo[loopData.code] = XEUtils.assign(
80
+ loopData.extraInfo,
81
+ tempDataInfo[loopData.code],
82
+ );
83
+ }
84
+ let operationFields = []
85
+ XEUtils.arrayEach(loopData.fields, loopField => {
86
+ let tempField = {
87
+ field:loopField.code, // loopField.boundField,
88
+ title: loopField.name,
89
+ width: loopField.width,
90
+ visible: !loopField.hidden,
91
+ filter: loopField.isFilter,
92
+ sortable: loopField.isSortable,
93
+ controlType: loopField.controlType,
94
+ edit: loopField.edit,
95
+ sysVisible: !loopField.sysHidden,
96
+ toolTip:loopField.toolTip
97
+ }
98
+ if (tempField.sysVisible === false) {
99
+ tempField.visible = false
100
+ }
101
+ //页面状态控制
102
+ if (loopField.editStates) {
103
+ tempField['editStates'] = loopField.editStates.split(',')
104
+ tempField['visibleStates'] = loopField.editStates.split(',')
105
+ }
106
+ //单据状态控制
107
+ if (loopField.editStatuss) {
108
+ tempField['editStatuss'] = loopField.editStatuss.split(',')
109
+ tempField['visibleStatuss'] = loopField.editStatuss.split(',')
110
+ }
111
+ let extraInfo = loopField.extraInfo
112
+ ? JSON.parse(loopField.extraInfo)
113
+ : {}
114
+ let userExtraInfo = loopField.userExtraInfo
115
+ ? JSON.parse(loopField.userExtraInfo)
116
+ : {}
117
+ extraInfo = {...extraInfo, ...userExtraInfo}
118
+ //存在额外参数,就赋值
119
+ if (Object.keys(extraInfo).length) {
120
+ if (Object.hasOwn(extraInfo, 'api')) {
121
+ extraInfo['api'] = state[extraInfo['url']] + extraInfo['api']
122
+ }
123
+ tempField = XEUtils.assign(extraInfo, tempField)
124
+ }
125
+ if (tempField.controlType === controlType.select) {
126
+ tempField['dataSource'] = XEUtils.filter(
127
+ data.info.dictItems,
128
+ p => p.dictCode === extraInfo.dataSource
129
+ )
130
+ }
131
+ if (tempField.controlType === controlType.pulldown && tempField.linkData
132
+ ) {
133
+ tempPulldownFields.push(tempField);
134
+ }
135
+
136
+ if (tempField.controlType === controlType.pager_button) {
137
+ tempPagerButtons.push(tempField)
138
+ } else if (tempField.controlType === controlType.operation) {
139
+ //操作按钮列
140
+ // 动态加载 visibleConditional 函数 来控制操作按钮是否显示
141
+ if (tempField.visibleConditional) {
142
+ tempField.visibleConditional = eval(`(${tempField.visibleConditional})`);
143
+ }
144
+ operationFields.push(tempField)
145
+
146
+ } else {
147
+ tempFields.push(tempField)
148
+ }
149
+ })
150
+
151
+ tempDataInfo[loopData.code]['pagerButtons'] = tempPagerButtons
152
+ if (operationFields.length > 0) {
153
+ //添加右侧按钮操作列
154
+ tempFields.push({
155
+ field: controlType.operation,
156
+ title: '操作',
157
+ width: operationFields[0].width || 100,
158
+ fixed: 'right',
159
+ showOverflow: true,
160
+ controlType: controlType.operation,
161
+ params: {
162
+ columns: operationFields
163
+ }
164
+ })
165
+ }
166
+ tempDataInfo[loopData.code]['fields'] = tempFields
167
+
168
+ })
169
+ //批量设置下拉属性
170
+ XEUtils.arrayEach(tempPulldownFields, (loopField) => {
171
+ if(!tempDataInfo[loopField.linkData]){
172
+ return
173
+ }
174
+ loopField['columns'] = tempDataInfo[loopField.linkData].fields;
175
+ loopField['pageSize'] = tempDataInfo[loopField.linkData].pageSize;
176
+ loopField['pageSizeOptions'] = tempDataInfo[loopField.linkData].pageSizeOptions;
177
+ let tempApi = null;
178
+ switch(tempDataInfo[loopField.linkData].objectService){
179
+ case 'base':
180
+ tempApi = process.env.VUE_APP_BASE_SERVICE_URL
181
+ break;
182
+ case 'mes':
183
+ tempApi = process.env.VUE_APP_MES_SERVICE_URL
184
+ break;
185
+ case 'wms':
186
+ tempApi = process.env.VUE_APP_WMS_SERVICE_URL
187
+ break;
188
+ case 'erp':
189
+ tempApi = process.env.VUE_APP_ERP_SERVICE_URL
190
+ break;
191
+ default:
192
+ tempApi = process.env.VUE_APP_WMS_SERVICE_URL
193
+ break;
194
+ }
195
+ loopField['api'] = tempApi+'/v1/commonOperation/searchData';
196
+ loopField['currentModuleCode'] = data.moduleCode;
197
+ });
198
+ data.info['dataInfo'] = tempDataInfo
199
+ state.moduleViewInfo[data.moduleCode] = data.info
200
+ },
201
+ SET_NEW_ID: (state, id) => {
202
+ state.newId = id
203
+ },
204
+ SET_UMS_URL: (state, url) => {
205
+ state.umsUrl = url
206
+ },
207
+ SET_MODULE_LANG_URL: (state, url) => {
208
+ state.moduleLangUrl = url
209
+ },
210
+ SET_BASE_URL: (state, url) => {
211
+ state.baseUrl = url
212
+ },
213
+ SET_WMS_URL: (state, url) => {
214
+ state.wmsUrl = url
215
+ },
216
+ SET_CUST_PRICE_NOT_TAX_PRECISION: (state, custPriceNotTaxPrecision) => {
217
+ state.custPriceNotTaxPrecision = custPriceNotTaxPrecision
218
+ },
219
+ SET_CUST_PRICE_PRECISION: (state, custPricePrecision) => {
220
+ state.custPricePrecision = custPricePrecision
221
+ },
222
+ SET_SUPPLY_PRICE_NOT_TAX_PRECISION: (state, supplyPriceNotTaxPrecision) => {
223
+ state.supplyPriceNotTaxPrecision = supplyPriceNotTaxPrecision
224
+ },
225
+ SET_SUPPLY_PRICE_PRECISION: (state, supplyPricePrecision) => {
226
+ state.supplyPricePrecision = supplyPricePrecision
227
+ },
228
+ SET_MSG_URL: (state, url) => {
229
+ state.msgUrl = url
230
+ },
231
+ SET_IDENTITY_URL: (state, url) => {
232
+ state.identityUrl = url
233
+ },
234
+ SET_BASE_SETTING: (state, baseSetting) => {
235
+ state.baseSetting = baseSetting
236
+ },
237
+ SET_DEFAULT_DEP: (state, defaultDep) => {
238
+ state.defaultDep = defaultDep
239
+ },
240
+ SET_COMPANY: (state, company) => {
241
+ state.company = company
242
+ },
243
+ },
244
+ actions: {
245
+ /**
246
+ * 系统登出
247
+ * @param {} param0
248
+ */
249
+ logOut({commit}) {
250
+ // alert('会话过期3');
251
+ if (window.$wujie) {
252
+ // alert('会话过期4');
253
+ //通知主应用会员过期重新登陆
254
+ window.$wujie.bus.$emit(
255
+ 'subAppLoginOut', window.$wujie.props.webAppCode
256
+ )
257
+ }
258
+ },
259
+ setTabTitle({commit}, tabInfo) {
260
+ //通知父应用修改Tab标签文字描述
261
+ if (window.$wujie) {
262
+
263
+ if (tabInfo.replaceQuery) {
264
+ let newRoutePath =
265
+ tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
266
+ history.replaceState(null, null, (window.$wujie.props.webAppActiveRule + newRoutePath))
267
+ }
268
+
269
+ window.$wujie.bus.$emit('subAppSetTabTitle', {
270
+ title: tabInfo.title,
271
+ name: tabInfo.name,
272
+ query: tabInfo.query,
273
+ replaceQuery: tabInfo.replaceQuery,
274
+ path: tabInfo.path
275
+ })
276
+ }
277
+ },
278
+ closeTab({commit}, fullPath) {
279
+ if (window.$wujie) {
280
+ window.$wujie.bus.$emit(
281
+ 'subAppCloseTab',
282
+ window.$wujie.props.webAppActiveRule + fullPath
283
+ )
284
+ }
285
+ },
286
+ moduleLoadViewInfo({commit, state}, dataInfo) {
287
+ let vm = this
288
+ return new Promise((resolve, reject) => {
289
+ loadViewInfo({
290
+ moduleCode: dataInfo.moduleCode,
291
+ companyId: dataInfo.companyId,
292
+ })
293
+ .then(reponseData => {
294
+ commit('SET_MODULE_VIEW_INFO', {
295
+ moduleCode: dataInfo.moduleCode,
296
+ info: reponseData.content
297
+ })
298
+ loadLangInfo(dataInfo.moduleCode, reponseData.content.moduleLangCacheHash)
299
+ .then(langData => {
300
+ commit('SET_MODULE_LANG_INFO', {
301
+ moduleCode: dataInfo.moduleCode,
302
+ info: langData.data
303
+ })
304
+ resolve()
305
+ }).catch(() => {
306
+ resolve()
307
+ })
308
+ })
309
+ .catch(error => {
310
+ reject(error)
311
+ })
312
+ })
313
+ },
314
+ // moduleLoadLangInfo({ commit, state }, dataInfo) {
315
+ // let vm = this
316
+ // return new Promise((resolve, reject) => {
317
+ // loadLangInfo(dataInfo.moduleCode)
318
+ // .then(reponseData => {
319
+ // commit('SET_MODULE_LANG_INFO', {
320
+ // moduleCode: dataInfo.moduleCode,
321
+ // info: reponseData.data
322
+ // })
323
+ // resolve()
324
+ // })
325
+ // .catch(error => {
326
+ // console.debug(error)
327
+ // resolve()
328
+ // })
329
+ // })
330
+ // },
331
+ // 固定返回工作台,并根据条件决定是否关闭其余标签
332
+ goWorkbench({commit}, tabsAllClose) {
333
+ if (window.$wujie) {
334
+ window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose == false ? false : true)
335
+ }
336
+ },
337
+ // 替换页面
338
+ replaceTab({commit}, fullPath) {
339
+ if (window.$wujie) {
340
+ window.$wujie.bus.$emit(
341
+ 'subAppReplaceTab',
342
+ window.$wujie.props.webAppActiveRule + fullPath
343
+ )
344
+ }
345
+ },
346
+ },
347
+ modules: {},
348
+ getters: {
349
+ custPriceNotTaxPrecision: state => state.custPriceNotTaxPrecision,
350
+ custPricePrecision: state => state.custPricePrecision,
351
+ supplyPriceNotTaxPrecision: state => state.supplyPriceNotTaxPrecision,
352
+ supplyPricePrecision: state => state.supplyPricePrecision,
353
+ industryVersion: state => state.industryVersion,
354
+ isGenerateMatCode: state => state.isGenerateMatCode,
355
+ umsUrl: state => state.umsUrl,
356
+ moduleLangUrl: state => state.moduleLangUrl,
357
+ baseUrl: state => state.baseUrl,
358
+ msgUrl: state => state.msgUrl,
359
+ identityUrl: state => state.identityUrl,
360
+ token: state => state.token,
361
+ webAppCode: state => state.webAppCode,
362
+ moduleViewInfo: state => state.moduleViewInfo,
363
+ moduleLangInfo: state => state.moduleLangInfo,
364
+ controlSize: state => state.controlSize,
365
+ hegitTab: state => state.hegitTab,
366
+ newId: state => () => {
367
+ state.newId = state.newId + 1
368
+ return state.newId
369
+ },
370
+ userId: state => state.userId,
371
+ userName: state => state.userName,
372
+ staffId: state => state.staffId,
373
+ baseSetting: state => state.baseSetting,
374
+ defaultDep: state => state.defaultDep,
375
+ company: state => state.company,
376
+ pathTabs: state => state.pathTabs
377
+ }
378
+ })