doway-coms 2.8.3 → 2.8.5

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 (85) 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 +266 -266
  15. package/packages/BaseButton/index.js +7 -7
  16. package/packages/BaseButton/src/index.vue +241 -241
  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 +752 -752
  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/SeqSetting.vue +278 -278
  33. package/packages/BaseGrid/src/index.vue +3796 -3796
  34. package/packages/BaseGridAdjust/index.js +9 -9
  35. package/packages/BaseGridAdjust/src/index.vue +482 -482
  36. package/packages/BaseInput/index.js +7 -7
  37. package/packages/BaseInput/src/index.vue +164 -164
  38. package/packages/BaseIntervalInput/index.js +7 -7
  39. package/packages/BaseIntervalInput/src/index.vue +310 -310
  40. package/packages/BaseKanbanEmpty/index.js +7 -7
  41. package/packages/BaseKanbanEmpty/src/index.vue +176 -176
  42. package/packages/BaseNumberInput/index.js +7 -7
  43. package/packages/BaseNumberInput/src/index.vue +290 -290
  44. package/packages/BasePagination/index.js +7 -7
  45. package/packages/BasePagination/src/index.vue +91 -91
  46. package/packages/BasePictureCard/index.js +7 -7
  47. package/packages/BasePictureCard/src/index.vue +580 -580
  48. package/packages/BasePrintPreview/index.js +7 -7
  49. package/packages/BasePrintPreview/src/index.vue +150 -129
  50. package/packages/BasePulldown/index.js +7 -7
  51. package/packages/BasePulldown/src/index.vue +1346 -1346
  52. package/packages/BaseSearch/index.js +7 -7
  53. package/packages/BaseSearch/src/index.vue +935 -935
  54. package/packages/BaseSelect/index.js +7 -7
  55. package/packages/BaseSelect/src/index.vue +155 -155
  56. package/packages/BaseSelectMulti/index.js +7 -7
  57. package/packages/BaseSelectMulti/src/index.vue +148 -148
  58. package/packages/BaseTextArea/index.js +7 -7
  59. package/packages/BaseTextArea/src/index.vue +178 -178
  60. package/packages/BaseTime/index.js +7 -7
  61. package/packages/BaseTime/src/index.vue +166 -166
  62. package/packages/BaseTool/index.js +7 -7
  63. package/packages/BaseTool/src/index.vue +353 -349
  64. package/packages/BaseToolStatus/index.js +7 -7
  65. package/packages/BaseToolStatus/src/ApprovalPersonsGroup.vue +41 -41
  66. package/packages/BaseToolStatus/src/index.vue +439 -439
  67. package/packages/BaseTreeSelect/index.js +8 -8
  68. package/packages/BaseTreeSelect/src/index.vue +437 -437
  69. package/packages/LeaveAMessage/index.js +7 -7
  70. package/packages/LeaveAMessage/src/index.vue +601 -601
  71. package/packages/index.js +194 -194
  72. package/packages/styles/default.css +78 -78
  73. package/packages/styles/default.less +91 -91
  74. package/packages/utils/api.js +107 -107
  75. package/packages/utils/auth.js +38 -38
  76. package/packages/utils/common.js +635 -635
  77. package/packages/utils/dom.js +181 -181
  78. package/packages/utils/enum.js +86 -86
  79. package/packages/utils/filters.js +485 -485
  80. package/packages/utils/gridFormat.js +66 -66
  81. package/packages/utils/msg.js +84 -84
  82. package/packages/utils/patchFiles.js +44 -44
  83. package/packages/utils/request.js +178 -178
  84. package/packages/utils/store.js +314 -314
  85. package/vue.config.js +59 -59
@@ -1,314 +1,314 @@
1
-
2
- import {loadViewInfo,loadLangInfo} from './api'
3
- import XEUtils from 'xe-utils'
4
- import Vue from 'vue'
5
- import Vuex from 'vuex'
6
- import {stringUrlQuery} from './common'
7
- import { controlType } from './enum'
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
- },
34
- mutations: {
35
- SET_TOKEN: (state, token) => {
36
- state.token = token
37
- },
38
- SET_USERID: (state, userId) => {
39
- state.userId = userId
40
- },
41
- SET_USERNAME: (state, userName) => {
42
- state.userName = userName
43
- },
44
- SET_STAFFID: (state, staffId) => {
45
- state.staffId = staffId
46
- },
47
- SET_INDUSTRY_VERSION:(state,industryVersion)=>{
48
- state.industryVersion = industryVersion
49
- },
50
- SET_IS_GENERATE_MAT_CODE:(state,isGenerateMatCode)=>{
51
- state.isGenerateMatCode = isGenerateMatCode
52
- },
53
- SET_WEB_APP_CODE: (state, webAppCode) => {
54
- state.webAppCode = webAppCode
55
- },
56
- SET_MODULE_LANG_INFO:(state,data)=>{
57
- state.moduleLangInfo[data.moduleCode] = data.info
58
- },
59
- SET_MODULE_VIEW_INFO: (state, data) => {
60
- let tempDataInfo = {}
61
- XEUtils.arrayEach(data.info.datas,loopData=>{
62
- let tempFields = []
63
- let tempPagerButtons = []
64
- tempDataInfo[loopData.code] = {code:'',name:'',fields:[]}
65
- tempDataInfo[loopData.code].code = loopData.code
66
- tempDataInfo[loopData.code].name = loopData.name
67
- tempDataInfo[loopData.code].extraInfo = loopData.extraInfo
68
- let operationFields = []
69
- XEUtils.arrayEach(loopData.fields,loopField=>{
70
- let tempField = {
71
- field: loopField.boundField,
72
- title: loopField.name,
73
- width: loopField.width,
74
- visible: !loopField.hidden,
75
- filters: loopField.isFilter,
76
- sortable: loopField.isSortable,
77
- controlType: loopField.controlType,
78
- edit:loopField.edit,
79
- sysVisible:!loopField.sysHidden
80
- }
81
- if(tempField.sysVisible===false){
82
- tempField.visible = false
83
- }
84
- //页面状态控制
85
- if(loopField.editStates){
86
- tempField['editStates'] = loopField.editStates.split(',')
87
- tempField['visibleStates'] = loopField.editStates.split(',')
88
- }
89
- //单据状态控制
90
- if(loopField.editStatuss){
91
- tempField['editStatuss'] = loopField.editStatuss.split(',')
92
- tempField['visibleStatuss'] = loopField.editStatuss.split(',')
93
- }
94
- let extraInfo = loopField.extraInfo
95
- ? JSON.parse(loopField.extraInfo)
96
- : {}
97
- let userExtraInfo = loopField.userExtraInfo
98
- ? JSON.parse(loopField.userExtraInfo)
99
- : {}
100
- extraInfo = {...extraInfo, ...userExtraInfo}
101
- //存在额外参数,就赋值
102
- if (Object.keys(extraInfo).length) {
103
- if (Object.hasOwn(extraInfo,'api')){
104
- extraInfo['api'] = state[extraInfo['url']] + extraInfo['api']
105
- }
106
- tempField = XEUtils.assign(extraInfo, tempField)
107
- }
108
- if (tempField.controlType === controlType.select) {
109
- tempField['dataSource'] = XEUtils.filter(
110
- data.info.dictItems,
111
- p => p.dictCode === extraInfo.dataSource
112
- )
113
- }
114
-
115
- if(tempField.controlType === controlType.pager_button){
116
- tempPagerButtons.push(tempField)
117
- }else if(tempField.controlType===controlType.operation){
118
- //操作按钮列
119
- // 动态加载 visibleConditional 函数 来控制操作按钮是否显示
120
- if (tempField.visibleConditional){
121
- tempField.visibleConditional = eval(`(${tempField.visibleConditional})`);
122
- }
123
- operationFields.push(tempField)
124
-
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
- },
189
- actions: {
190
- /**
191
- * 系统登出
192
- * @param {} param0
193
- */
194
- logOut({commit}){
195
- // alert('会话过期3');
196
- if(window.$wujie){
197
- // alert('会话过期4');
198
- //通知主应用会员过期重新登陆
199
- window.$wujie.bus.$emit(
200
- 'subAppLoginOut',window.$wujie.props.webAppCode
201
- )
202
- }
203
- },
204
- setTabTitle({ commit }, tabInfo) {
205
- if (tabInfo.replaceQuery) {
206
- let newRoutePath =
207
- tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
208
- history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
209
- }
210
- //通知父应用修改Tab标签文字描述
211
- if(window.$wujie){
212
- window.$wujie.bus.$emit('subAppSetTabTitle', {
213
- title: tabInfo.title,
214
- name: tabInfo.name,
215
- query: tabInfo.query,
216
- replaceQuery: tabInfo.replaceQuery,
217
- path: tabInfo.path
218
- })
219
- }
220
- },
221
- closeTab({ commit }, fullPath) {
222
- if(window.$wujie){
223
- window.$wujie.bus.$emit(
224
- 'subAppCloseTab',
225
- window.$wujie.props.webAppActiveRule + fullPath
226
- )
227
- }
228
- },
229
- moduleLoadViewInfo({ commit, state }, dataInfo) {
230
- let vm = this
231
- return new Promise((resolve, reject) => {
232
- loadViewInfo(dataInfo.moduleCode)
233
- .then(reponseData => {
234
- commit('SET_MODULE_VIEW_INFO', {
235
- moduleCode: dataInfo.moduleCode,
236
- info: reponseData.content
237
- })
238
- loadLangInfo(dataInfo.moduleCode,reponseData.content.moduleLangCacheHash)
239
- .then(langData=>{
240
- commit('SET_MODULE_LANG_INFO', {
241
- moduleCode: dataInfo.moduleCode,
242
- info: langData.data
243
- })
244
- resolve()
245
- }).catch(()=>{
246
- resolve()
247
- })
248
- })
249
- .catch(error => {
250
- reject(error)
251
- })
252
- })
253
- },
254
- // moduleLoadLangInfo({ commit, state }, dataInfo) {
255
- // let vm = this
256
- // return new Promise((resolve, reject) => {
257
- // loadLangInfo(dataInfo.moduleCode)
258
- // .then(reponseData => {
259
- // commit('SET_MODULE_LANG_INFO', {
260
- // moduleCode: dataInfo.moduleCode,
261
- // info: reponseData.data
262
- // })
263
- // resolve()
264
- // })
265
- // .catch(error => {
266
- // console.debug(error)
267
- // resolve()
268
- // })
269
- // })
270
- // },
271
- // 固定返回工作台,并根据条件决定是否关闭其余标签
272
- goWorkbench({ commit }, tabsAllClose) {
273
- if(window.$wujie){
274
- window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose==false?false:true)
275
- }
276
- },
277
- // 替换页面
278
- replaceTab({ commit }, fullPath) {
279
- if(window.$wujie){
280
- window.$wujie.bus.$emit(
281
- 'subAppReplaceTab',
282
- window.$wujie.props.webAppActiveRule + fullPath
283
- )
284
- }
285
- },
286
- },
287
- modules:{},
288
- getters: {
289
- custPriceNotTaxPrecision:state=>state.custPriceNotTaxPrecision,
290
- custPricePrecision:state=>state.custPricePrecision,
291
- supplyPriceNotTaxPrecision:state=>state.supplyPriceNotTaxPrecision,
292
- supplyPricePrecision:state=>state.supplyPricePrecision,
293
- industryVersion:state=>state.industryVersion,
294
- isGenerateMatCode:state=>state.isGenerateMatCode,
295
- umsUrl:state=>state.umsUrl,
296
- moduleLangUrl:state=>state.moduleLangUrl,
297
- baseUrl:state=>state.baseUrl,
298
- msgUrl:state=>state.msgUrl,
299
- identityUrl:state=>state.identityUrl,
300
- token: state => state.token,
301
- webAppCode: state => state.webAppCode,
302
- moduleViewInfo: state => state.moduleViewInfo,
303
- moduleLangInfo: state => state.moduleLangInfo,
304
- controlSize: state => state.controlSize,
305
- newId: state => () => {
306
- state.newId = state.newId + 1
307
- return state.newId
308
- },
309
- userId: state => state.userId,
310
- userName: state => state.userName,
311
- staffId: state => state.staffId,
312
- baseSetting: state => state.baseSetting,
313
- }
314
- })
1
+
2
+ import {loadViewInfo,loadLangInfo} from './api'
3
+ import XEUtils from 'xe-utils'
4
+ import Vue from 'vue'
5
+ import Vuex from 'vuex'
6
+ import {stringUrlQuery} from './common'
7
+ import { controlType } from './enum'
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
+ },
34
+ mutations: {
35
+ SET_TOKEN: (state, token) => {
36
+ state.token = token
37
+ },
38
+ SET_USERID: (state, userId) => {
39
+ state.userId = userId
40
+ },
41
+ SET_USERNAME: (state, userName) => {
42
+ state.userName = userName
43
+ },
44
+ SET_STAFFID: (state, staffId) => {
45
+ state.staffId = staffId
46
+ },
47
+ SET_INDUSTRY_VERSION:(state,industryVersion)=>{
48
+ state.industryVersion = industryVersion
49
+ },
50
+ SET_IS_GENERATE_MAT_CODE:(state,isGenerateMatCode)=>{
51
+ state.isGenerateMatCode = isGenerateMatCode
52
+ },
53
+ SET_WEB_APP_CODE: (state, webAppCode) => {
54
+ state.webAppCode = webAppCode
55
+ },
56
+ SET_MODULE_LANG_INFO:(state,data)=>{
57
+ state.moduleLangInfo[data.moduleCode] = data.info
58
+ },
59
+ SET_MODULE_VIEW_INFO: (state, data) => {
60
+ let tempDataInfo = {}
61
+ XEUtils.arrayEach(data.info.datas,loopData=>{
62
+ let tempFields = []
63
+ let tempPagerButtons = []
64
+ tempDataInfo[loopData.code] = {code:'',name:'',fields:[]}
65
+ tempDataInfo[loopData.code].code = loopData.code
66
+ tempDataInfo[loopData.code].name = loopData.name
67
+ tempDataInfo[loopData.code].extraInfo = loopData.extraInfo
68
+ let operationFields = []
69
+ XEUtils.arrayEach(loopData.fields,loopField=>{
70
+ let tempField = {
71
+ field: loopField.boundField,
72
+ title: loopField.name,
73
+ width: loopField.width,
74
+ visible: !loopField.hidden,
75
+ filters: loopField.isFilter,
76
+ sortable: loopField.isSortable,
77
+ controlType: loopField.controlType,
78
+ edit:loopField.edit,
79
+ sysVisible:!loopField.sysHidden
80
+ }
81
+ if(tempField.sysVisible===false){
82
+ tempField.visible = false
83
+ }
84
+ //页面状态控制
85
+ if(loopField.editStates){
86
+ tempField['editStates'] = loopField.editStates.split(',')
87
+ tempField['visibleStates'] = loopField.editStates.split(',')
88
+ }
89
+ //单据状态控制
90
+ if(loopField.editStatuss){
91
+ tempField['editStatuss'] = loopField.editStatuss.split(',')
92
+ tempField['visibleStatuss'] = loopField.editStatuss.split(',')
93
+ }
94
+ let extraInfo = loopField.extraInfo
95
+ ? JSON.parse(loopField.extraInfo)
96
+ : {}
97
+ let userExtraInfo = loopField.userExtraInfo
98
+ ? JSON.parse(loopField.userExtraInfo)
99
+ : {}
100
+ extraInfo = {...extraInfo, ...userExtraInfo}
101
+ //存在额外参数,就赋值
102
+ if (Object.keys(extraInfo).length) {
103
+ if (Object.hasOwn(extraInfo,'api')){
104
+ extraInfo['api'] = state[extraInfo['url']] + extraInfo['api']
105
+ }
106
+ tempField = XEUtils.assign(extraInfo, tempField)
107
+ }
108
+ if (tempField.controlType === controlType.select) {
109
+ tempField['dataSource'] = XEUtils.filter(
110
+ data.info.dictItems,
111
+ p => p.dictCode === extraInfo.dataSource
112
+ )
113
+ }
114
+
115
+ if(tempField.controlType === controlType.pager_button){
116
+ tempPagerButtons.push(tempField)
117
+ }else if(tempField.controlType===controlType.operation){
118
+ //操作按钮列
119
+ // 动态加载 visibleConditional 函数 来控制操作按钮是否显示
120
+ if (tempField.visibleConditional){
121
+ tempField.visibleConditional = eval(`(${tempField.visibleConditional})`);
122
+ }
123
+ operationFields.push(tempField)
124
+
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
+ },
189
+ actions: {
190
+ /**
191
+ * 系统登出
192
+ * @param {} param0
193
+ */
194
+ logOut({commit}){
195
+ // alert('会话过期3');
196
+ if(window.$wujie){
197
+ // alert('会话过期4');
198
+ //通知主应用会员过期重新登陆
199
+ window.$wujie.bus.$emit(
200
+ 'subAppLoginOut',window.$wujie.props.webAppCode
201
+ )
202
+ }
203
+ },
204
+ setTabTitle({ commit }, tabInfo) {
205
+ if (tabInfo.replaceQuery) {
206
+ let newRoutePath =
207
+ tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
208
+ history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
209
+ }
210
+ //通知父应用修改Tab标签文字描述
211
+ if(window.$wujie){
212
+ window.$wujie.bus.$emit('subAppSetTabTitle', {
213
+ title: tabInfo.title,
214
+ name: tabInfo.name,
215
+ query: tabInfo.query,
216
+ replaceQuery: tabInfo.replaceQuery,
217
+ path: tabInfo.path
218
+ })
219
+ }
220
+ },
221
+ closeTab({ commit }, fullPath) {
222
+ if(window.$wujie){
223
+ window.$wujie.bus.$emit(
224
+ 'subAppCloseTab',
225
+ window.$wujie.props.webAppActiveRule + fullPath
226
+ )
227
+ }
228
+ },
229
+ moduleLoadViewInfo({ commit, state }, dataInfo) {
230
+ let vm = this
231
+ return new Promise((resolve, reject) => {
232
+ loadViewInfo(dataInfo.moduleCode)
233
+ .then(reponseData => {
234
+ commit('SET_MODULE_VIEW_INFO', {
235
+ moduleCode: dataInfo.moduleCode,
236
+ info: reponseData.content
237
+ })
238
+ loadLangInfo(dataInfo.moduleCode,reponseData.content.moduleLangCacheHash)
239
+ .then(langData=>{
240
+ commit('SET_MODULE_LANG_INFO', {
241
+ moduleCode: dataInfo.moduleCode,
242
+ info: langData.data
243
+ })
244
+ resolve()
245
+ }).catch(()=>{
246
+ resolve()
247
+ })
248
+ })
249
+ .catch(error => {
250
+ reject(error)
251
+ })
252
+ })
253
+ },
254
+ // moduleLoadLangInfo({ commit, state }, dataInfo) {
255
+ // let vm = this
256
+ // return new Promise((resolve, reject) => {
257
+ // loadLangInfo(dataInfo.moduleCode)
258
+ // .then(reponseData => {
259
+ // commit('SET_MODULE_LANG_INFO', {
260
+ // moduleCode: dataInfo.moduleCode,
261
+ // info: reponseData.data
262
+ // })
263
+ // resolve()
264
+ // })
265
+ // .catch(error => {
266
+ // console.debug(error)
267
+ // resolve()
268
+ // })
269
+ // })
270
+ // },
271
+ // 固定返回工作台,并根据条件决定是否关闭其余标签
272
+ goWorkbench({ commit }, tabsAllClose) {
273
+ if(window.$wujie){
274
+ window.$wujie.bus.$emit('subAppGoWorkbench', tabsAllClose==false?false:true)
275
+ }
276
+ },
277
+ // 替换页面
278
+ replaceTab({ commit }, fullPath) {
279
+ if(window.$wujie){
280
+ window.$wujie.bus.$emit(
281
+ 'subAppReplaceTab',
282
+ window.$wujie.props.webAppActiveRule + fullPath
283
+ )
284
+ }
285
+ },
286
+ },
287
+ modules:{},
288
+ getters: {
289
+ custPriceNotTaxPrecision:state=>state.custPriceNotTaxPrecision,
290
+ custPricePrecision:state=>state.custPricePrecision,
291
+ supplyPriceNotTaxPrecision:state=>state.supplyPriceNotTaxPrecision,
292
+ supplyPricePrecision:state=>state.supplyPricePrecision,
293
+ industryVersion:state=>state.industryVersion,
294
+ isGenerateMatCode:state=>state.isGenerateMatCode,
295
+ umsUrl:state=>state.umsUrl,
296
+ moduleLangUrl:state=>state.moduleLangUrl,
297
+ baseUrl:state=>state.baseUrl,
298
+ msgUrl:state=>state.msgUrl,
299
+ identityUrl:state=>state.identityUrl,
300
+ token: state => state.token,
301
+ webAppCode: state => state.webAppCode,
302
+ moduleViewInfo: state => state.moduleViewInfo,
303
+ moduleLangInfo: state => state.moduleLangInfo,
304
+ controlSize: state => state.controlSize,
305
+ newId: state => () => {
306
+ state.newId = state.newId + 1
307
+ return state.newId
308
+ },
309
+ userId: state => state.userId,
310
+ userName: state => state.userName,
311
+ staffId: state => state.staffId,
312
+ baseSetting: state => state.baseSetting,
313
+ }
314
+ })