doway-coms 2.10.19 → 2.10.21

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