doway-coms 2.11.25 → 2.11.27

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