doway-coms 2.10.76 → 2.10.78

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