doway-coms 2.11.62 → 2.11.66

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 +233 -233
  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 +901 -901
  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 +4591 -4591
  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 -207
  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 +90 -90
  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 +1400 -1396
  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 +162 -162
  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 +161 -161
  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 +73 -73
  79. package/packages/utils/api.js +128 -128
  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 +378 -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,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
- 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
+ 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
+ })