imatrix-ui 2.9.99 → 7.7.20-p2

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 (35) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +13 -6
  3. package/package.json +3 -2
  4. package/src/api/sso-service.js +12 -1
  5. package/src/directives/permission/permission.js +1 -1
  6. package/src/i18n/langs/cn.js +64 -3
  7. package/src/i18n/langs/en.js +65 -4
  8. package/src/permission.js +16 -22
  9. package/src/router/index.js +18 -1
  10. package/src/store/getters.js +2 -1
  11. package/src/store/modules/user.js +16 -1
  12. package/src/styles/index.scss +11 -2
  13. package/src/utils/calculator/calculator-factory.js +125 -0
  14. package/src/utils/calculator/calculator-util.js +6 -0
  15. package/src/utils/common-util.js +21 -1
  16. package/src/utils/eventBus.js +2 -0
  17. package/src/utils/iconUtils.js +23 -0
  18. package/src/utils/jump-page-utils.js +467 -0
  19. package/src/utils/permission.js +1 -1
  20. package/src/utils/permissionAuth.js +1 -1
  21. package/src/utils/request.js +4 -2
  22. package/src/utils/restful-interface-utils.js +47 -0
  23. package/src/utils/util.js +451 -0
  24. package/src/utils/watermark.js +95 -0
  25. package/src/views/layout/NewLayout.vue +77 -0
  26. package/src/views/layout/components/AppMain.vue +9 -0
  27. package/src/views/layout/components/Breadcrumb/index.vue +33 -1
  28. package/src/views/layout/components/Menubar/Item.vue +46 -0
  29. package/src/views/layout/components/Menubar/Link.vue +31 -0
  30. package/src/views/layout/components/Menubar/SidebarItem.vue +101 -0
  31. package/src/views/layout/components/Menubar/index.vue +143 -0
  32. package/src/views/layout/components/iframe-page.vue +31 -0
  33. package/src/views/layout/components/index.js +1 -0
  34. package/src/views/redirect/index.vue +3 -3
  35. package/src/views/wf-history/tache-subprocess-history.vue +45 -0
@@ -0,0 +1,467 @@
1
+ import sessionStorage from 'sessionstorage'
2
+ import Vue from 'vue'
3
+ import { analysisCondition, analysisValue, getEntityFieldValue, setEntityFieldValue } from './util'
4
+ import { getSystemFrontendUrl } from './common-util'
5
+ // 解析初始化条件,api方法;additionalParamMap是上个页面传过来的附加参数集合
6
+ export function initialization(jumpPage, entity, isSql, additionalParamerter, contextParameter, tableName, parentFormData) {
7
+ const result = {}
8
+ if (jumpPage) {
9
+ // 页面附加参数
10
+ result.visible = true
11
+ let additionalParameterMap = {}
12
+ if (additionalParamerter && typeof (additionalParamerter) === 'string' && additionalParamerter !== '') {
13
+ additionalParameterMap = JSON.parse(additionalParamerter)
14
+ } else if (additionalParamerter && typeof (additionalParamerter) === 'object') {
15
+ additionalParameterMap = additionalParamerter
16
+ }
17
+ // 环境变量,例如:当前用户id、当前用户登录名等
18
+ let contextParameterMap = {}
19
+ if (contextParameter && typeof (contextParameter) === 'string' && contextParameter !== '') {
20
+ contextParameterMap = JSON.parse(contextParameter)
21
+ } else if (contextParameter && typeof (contextParameter) === 'object') {
22
+ contextParameterMap = contextParameter
23
+ }
24
+ if (jumpPage.displayTextJudge) {
25
+ // 例如:${obj.menu_code}-#-#${input.---}-#-#${context.currentTransactor}
26
+ const label = analysisValue(jumpPage.displayText, entity, additionalParameterMap, contextParameterMap)
27
+ result.label = label
28
+ }
29
+ if (jumpPage.icon) {
30
+ result.icon = jumpPage.icon
31
+ }
32
+ if (jumpPage.linkTips) {
33
+ result.title = jumpPage.linkTips
34
+ }
35
+ if (jumpPage.buttonDisplayConditionsList) {
36
+ let displayJudgment = ''
37
+ if (jumpPage.buttonDisplayConditionsList) {
38
+ displayJudgment = JSON.stringify(jumpPage.buttonDisplayConditionsList)
39
+ }
40
+ if (displayJudgment && displayJudgment !== '') {
41
+ const visible = analysisCondition(displayJudgment, entity, additionalParameterMap, contextParameterMap, isSql, tableName, parentFormData)
42
+ result.visible = visible
43
+ }
44
+ }
45
+ }
46
+ return result
47
+ }
48
+
49
+ /**
50
+ * 弹框方法
51
+ * @param {*} pageSetting 格式为:
52
+ * {
53
+ * jumpPageSetting:{
54
+ * jumpPageUrl:'弹出的页面编码或路径',
55
+ * jumpPageAdditional:{附加参数},
56
+ * isNeedId:true/false 是否拼接id参数默认是true,
57
+ * jumpPageOpenMode:'popup/newTab/refresh 页面显示方式'
58
+ * jumpPageWidth: '500弹框宽度',
59
+ * jumpPageHeight: '600弹框高度'
60
+ * },
61
+ * system:{frontendUrl:'http://localhost:8080/dsc',code:xxx},
62
+ * dataId: 1,
63
+ * entity:{业务实体信息},
64
+ * additionalParamMap:{上个页面传过来的附加参数},
65
+ * ids:[1,2],
66
+ * parentFormData: {父表单实体,用于解析${parent.xxx}参数}
67
+ * }
68
+ */
69
+ export function openPage(pageSetting) {
70
+ if (pageSetting) {
71
+ const jumpPageSetting = pageSetting.jumpPageSetting
72
+ const system = pageSetting.system
73
+ const dataId = pageSetting.dataId
74
+ const ids = pageSetting.ids
75
+ const buttonCode = pageSetting.buttonCode
76
+ // 上个页面传过来的附加参数
77
+ const additionalParamMap = pageSetting.additionalParamMap
78
+ const entity = pageSetting.entity
79
+ const parentFormData = pageSetting.parentFormData
80
+ jumpToPage(jumpPageSetting, system, dataId, entity, additionalParamMap, ids, buttonCode, parentFormData).then(openPageParams => {
81
+ let jumpMode
82
+ if (openPageParams) {
83
+ jumpMode = openPageParams.jumpMode
84
+ }
85
+ if (openPageParams) {
86
+ const popPageSetting = openPageParams
87
+ const path = popPageSetting._path
88
+ if (jumpMode === 'popup') {
89
+ let jumpPageWidth = 400
90
+ let jumpPageHeight = 400
91
+ if (openPageParams.jumpPageWidth) {
92
+ jumpPageWidth = openPageParams.jumpPageWidth
93
+ }
94
+ if (openPageParams.jumpPageHeight) {
95
+ jumpPageHeight = openPageParams.jumpPageHeight
96
+ }
97
+ // 弹出页面
98
+ window.open(path, '', `height=` + jumpPageHeight + `,width=` + jumpPageWidth + `,top=100,left=100,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no`)
99
+ } else if (jumpMode === 'refresh') {
100
+ window.location.href = path
101
+ }
102
+ }
103
+ })
104
+ }
105
+ }
106
+
107
+ // 页面跳转处理,api方法;additionalParamMap是上个页面传过来的附加参数集合;
108
+ // isFromChart 是否是从chart方面来,如果是,则弹窗和刷新页面都用winows方式打开
109
+ export function jumpToPage(jumpPageSetting, system, dataId, entity, additionalParamMap, ids, buttonCode, parentFormData) {
110
+ return new Promise((resolve, reject) => {
111
+ if (jumpPageSetting && typeof (jumpPageSetting) === 'string' && jumpPageSetting !== '') {
112
+ jumpPageSetting = JSON.parse(jumpPageSetting)
113
+ }
114
+ if (!jumpPageSetting.jumpPageUrl) {
115
+ resolve()
116
+ }
117
+ getSystem(system, jumpPageSetting.jumpPageUrl).then(system => {
118
+ if (jumpPageSetting.jumpPageAdditional && jumpPageSetting.jumpPageAdditional.length > 0) {
119
+ // 发送请求,获取附加参数,并存入缓存
120
+ const paramPath = Vue.prototype.baseAPI + '/component/super-pages/parsing-additional-parameters'
121
+ const paramMap = {}
122
+ paramMap.jumpPageAdditional = JSON.stringify(jumpPageSetting.jumpPageAdditional)
123
+ // 表单页面
124
+ paramMap.entity = entity
125
+ paramMap.additionalParamMap = additionalParamMap
126
+ console.log('paramMap.parentFormData', parentFormData)
127
+ paramMap.parentFormData = parentFormData
128
+
129
+ Vue.prototype.$http.post(paramPath, paramMap).then((result) => {
130
+ let paramStoreId = ''
131
+ if (result && result.uuid) {
132
+ paramStoreId = result.uuid + '_additionalParamMap'
133
+ sessionStorage.setItem(paramStoreId, JSON.stringify(result.paramMap))
134
+ }
135
+ jumpPageSetting.paramStoreId = paramStoreId
136
+ // 存入缓存
137
+ jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode).then(openPageParams => {
138
+ // openPageParams:xxx弹框打开页面时需要的参数 或 刷新页面时路由查询参数
139
+ resolve(openPageParams)
140
+ })
141
+ })
142
+ } else {
143
+ jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode).then(openPageParams => {
144
+ // openPageParams:xxx弹框打开页面时需要的参数 或 刷新页面时路由查询参数
145
+ resolve(openPageParams)
146
+ })
147
+ }
148
+ }).catch(error => {
149
+ console.log(error)
150
+ reject(error)
151
+ })
152
+ })
153
+ }
154
+ function getSystem(system, jumpPageUrl) {
155
+ return new Promise((resolve, reject) => {
156
+ if (isFullPath(jumpPageUrl)) {
157
+ resolve(null)
158
+ } else {
159
+ if (!system || system === null) {
160
+ if (jumpPageUrl.indexOf('page:') === 0) {
161
+ const pageCode = jumpPageUrl.substring(jumpPageUrl.indexOf('page:') + 'page:'.length)
162
+ const path = Vue.prototype.baseAPI + '/component/business-systems/with-page-codes/' + pageCode
163
+ Vue.prototype.$http.get(path).then(data => {
164
+ resolve(data)
165
+ }).catch(error => {
166
+ reject(error)
167
+ })
168
+ } else {
169
+ // 则根据当前系统编码获得系统
170
+ let systemCode = Vue.prototype.customSystem
171
+ if (!systemCode) {
172
+ systemCode = Vue.prototype.systemCode
173
+ }
174
+ const path = Vue.prototype.baseAPI + '/component/business-systems/' + systemCode
175
+ Vue.prototype.$http.get(path).then(data => {
176
+ resolve(data)
177
+ }).catch(error => {
178
+ reject(error)
179
+ })
180
+ }
181
+ } else {
182
+ resolve(system)
183
+ }
184
+ }
185
+ })
186
+ }
187
+
188
+ // 表示是全路径
189
+ function isFullPath(path) {
190
+ return path.indexOf('http:') === 0 || path.indexOf('https:') === 0
191
+ }
192
+ // 正式跳转
193
+ function jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode) {
194
+ return new Promise((resolve, reject) => {
195
+ const jumpPageUrl = jumpPageSetting.jumpPageUrl
196
+ if (!jumpPageUrl) {
197
+ return
198
+ }
199
+ if (jumpPageUrl.indexOf('page:') === 0) {
200
+ // 表示是自定义系统跳转页面编码
201
+ jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, buttonCode).then((openPageParams) => {
202
+ resolve(openPageParams)
203
+ })
204
+ } else {
205
+ const additionalParameterStr = analysisAdditionalParameter(jumpPageSetting.paramStoreId)
206
+ // 表示是路径,格式如:http://www.baidu.com 或 http://localhost:9600/demo/#/demo/plan/list 或 /demo/plan/list
207
+ let path = jumpPageUrl
208
+ if (jumpPageUrl.indexOf('path:') >= 0) {
209
+ // 兼容历史数据
210
+ path = jumpPageUrl.substring(jumpPageUrl.indexOf('path:') + 'path:'.length)
211
+ }
212
+ if (isFullPath(path)) {
213
+ // 表示是全路径,例如:http://www.baidu.com 或 http://localhost:9600/demo/#/demo/plan/list
214
+ jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPageSetting, ids, buttonCode)
215
+ } else if (system) {
216
+ // 表示是路由路径,例如:/demo/plan/list
217
+ // TODO 配置系统暂时不支持该配置,只能选页面或全路径
218
+ // jumpToPageWithPath(dataId, path, additionalParameterStr, system, jumpPage)
219
+ }
220
+ resolve()
221
+ }
222
+ })
223
+ }
224
+ /**
225
+ * 全路径时跳转页面处理
226
+ * @param {*} dataId
227
+ * @param {*} path
228
+ * @param {*} additionalParameterStr
229
+ * @param {*} jumpPage
230
+ */
231
+ function jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPage, ids, buttonCode) {
232
+ path = packagePathParams(dataId, path, jumpPage, ids, buttonCode)
233
+ // 保持这种情况参数传递,是为了解决不同域时获得不到sessionStorage中存的附加参数问题
234
+ if (additionalParameterStr && additionalParameterStr !== '') {
235
+ if (path.indexOf('?') !== -1) {
236
+ path += '&'
237
+ path += additionalParameterStr
238
+ } else {
239
+ path += '?'
240
+ path += additionalParameterStr
241
+ }
242
+ }
243
+ let jumpMode = 'refresh'
244
+ if (jumpPage) {
245
+ if (jumpPage.jumpPageOpenMode) {
246
+ jumpMode = jumpPage.jumpPageOpenMode
247
+ }
248
+ }
249
+ if (jumpMode === 'popup') {
250
+ // 弹框
251
+ const jumpPageWidth = jumpPage.jumpPageWidth
252
+ const jumpPageHeight = jumpPage.jumpPageHeight
253
+ const features = 'height=' + jumpPageHeight + ', width=' + jumpPageWidth + ', top=0, left=0, toolbar=no, menubar=no,' +
254
+ 'scrollbars=no,resizable=no, location=no, status=no' // 设置新窗口的特性
255
+ window.open(path, 'newW', features) // 打开新窗口
256
+ } else if (jumpMode === 'newTab') {
257
+ // 新页签
258
+ window.open(path)
259
+ } else {
260
+ // 刷新页面
261
+ location.href = path
262
+ }
263
+ }
264
+
265
+ // path封装参数
266
+ function packagePathParams(dataId, path, jumpPage, ids, buttonCode) {
267
+ if (jumpPage.isNeedId === undefined || jumpPage.isNeedId === null || jumpPage.isNeedId === true) {
268
+ if (dataId) {
269
+ // 表示是修改或查看页面,封装id参数
270
+ let paramSeparator = '?'
271
+ if (path.indexOf('?') > 0) {
272
+ paramSeparator = '&'
273
+ }
274
+ path = path + paramSeparator + 'id=' + dataId
275
+ }
276
+ }
277
+ // sessionStorage中存储附加参数的key
278
+ const paramStoreId = jumpPage.paramStoreId
279
+ if (paramStoreId && paramStoreId !== '') {
280
+ const paramStoreIdParam = 'paramStoreId=' + paramStoreId
281
+ if (path.indexOf('?') !== -1) {
282
+ path += '&'
283
+ path += paramStoreIdParam
284
+ } else {
285
+ path += '?'
286
+ path += paramStoreIdParam
287
+ }
288
+ }
289
+ if (ids && ids.length > 0) {
290
+ if (path.indexOf('?') !== -1) {
291
+ path += '&'
292
+ path += 'ids=' + ids.join(',')
293
+ } else {
294
+ path += '?'
295
+ path += 'ids=' + ids.join(',')
296
+ }
297
+ }
298
+ if (buttonCode) {
299
+ if (path.indexOf('?') !== -1) {
300
+ path += '&buttonCode=' + buttonCode
301
+ } else {
302
+ path += '?buttonCode=' + buttonCode
303
+ }
304
+ }
305
+ return path
306
+ }
307
+
308
+ function getPageCode(jumpPageUrl) {
309
+ let pageCode
310
+ if (jumpPageUrl && jumpPageUrl.indexOf('page:') !== -1) {
311
+ pageCode = jumpPageUrl.substring(jumpPageUrl.indexOf('page:') + 'page:'.length)
312
+ }
313
+ return pageCode
314
+ }
315
+ // 使用页面组件内部调整
316
+ function jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, buttonCode) {
317
+ return new Promise((resolve, reject) => {
318
+ // 表示是自定义系统跳转页面编码
319
+ console.log('----jumpWithSuperPage---', jumpPageUrl, system, dataId, jumpPageSetting)
320
+ const pageCode = getPageCode(jumpPageUrl)
321
+ let jumpMode = 'refresh'
322
+ if (jumpPageSetting) {
323
+ if (jumpPageSetting.jumpPageOpenMode) {
324
+ jumpMode = jumpPageSetting.jumpPageOpenMode
325
+ }
326
+ }
327
+ const jumpJsonData = {
328
+ jumpMode: jumpMode
329
+ }
330
+ sessionStorage.setItem(pageCode + '-jumpMode', JSON.stringify(jumpJsonData))
331
+ if (jumpMode === 'popup') {
332
+ const path = packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode)
333
+ // 页面布局中的按钮打开
334
+ const popPageSetting = openDialogWhenPopup(jumpPageSetting, system, pageCode, dataId, jumpMode, ids, buttonCode)
335
+ popPageSetting._path = path
336
+ resolve(popPageSetting)
337
+ } else if (jumpMode === 'newTab') {
338
+ // 新页签打开
339
+ const path = packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode)
340
+ window.open(path)
341
+ resolve()
342
+ } else {
343
+ // 刷新页面
344
+ const queryParam = { pageCode: pageCode, customSystem: system.code, jumpMode: jumpMode, buttonCode: buttonCode, ids: ids ? ids.join(',') : '' }
345
+ if (jumpPageSetting.isNeedId === undefined || jumpPageSetting.isNeedId === null || jumpPageSetting.isNeedId === true) {
346
+ if (dataId) {
347
+ // 表示是修改或查看页面,封装id参数
348
+ queryParam.id = dataId
349
+ }
350
+ }
351
+ const paramStoreId = jumpPageSetting.paramStoreId
352
+ if (paramStoreId && paramStoreId !== '') {
353
+ queryParam['paramStoreId'] = paramStoreId
354
+ }
355
+ const path = packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode)
356
+ queryParam._path = path
357
+ resolve(queryParam)
358
+ }
359
+ })
360
+ }
361
+ /**
362
+ * 使用dialog打开弹框,页面布局中的按钮、自定义按钮等使用该方法
363
+ * @param {*} jumpPageSetting
364
+ * @param {*} system
365
+ * @param {*} pageCode
366
+ * @param {*} dataId
367
+ * @param {*} jumpMode
368
+ * @param {*} ids
369
+ * @param {*} buttonCode
370
+ */
371
+ function openDialogWhenPopup(jumpPageSetting, system, pageCode, dataId, jumpMode, ids, buttonCode) {
372
+ const popPageSetting = {
373
+ }
374
+ if (jumpPageSetting) {
375
+ popPageSetting.jumpPageTitle = jumpPageSetting.jumpPageTitle
376
+ popPageSetting.jumpPageWidth = jumpPageSetting.jumpPageWidth
377
+ popPageSetting.jumpPageHeight = jumpPageSetting.jumpPageHeight
378
+ popPageSetting.valueMappings = jumpPageSetting.valueMappings
379
+ popPageSetting.updateValueEvent = jumpPageSetting.updateValueEvent
380
+ }
381
+ // 是否是自定义系统
382
+ let isDsc = false
383
+ if (typeof (system.standard) !== 'undefined') {
384
+ isDsc = !system.standard
385
+ }
386
+ popPageSetting.pageCode = pageCode
387
+ if (jumpPageSetting.isNeedId === undefined || jumpPageSetting.isNeedId === null || jumpPageSetting.isNeedId === true) {
388
+ if (dataId) {
389
+ // 表示是修改或查看页面,封装id参数
390
+ popPageSetting.dataId = dataId
391
+ }
392
+ }
393
+ popPageSetting.isDsc = isDsc
394
+ // 用于获取sessionStorage中缓存的附加参数的key值
395
+ popPageSetting.paramStoreId = jumpPageSetting.paramStoreId
396
+ // 打开方式
397
+ popPageSetting.jumpMode = jumpMode
398
+ popPageSetting.ids = ids
399
+ popPageSetting.buttonCode = buttonCode
400
+ // eventBus.$emit('showDialogPage', buttonSetting)
401
+ return popPageSetting
402
+ }
403
+
404
+ function packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode) {
405
+ const frontendUrl = getSystemFrontendUrl(system.frontendUrl)
406
+ const path = frontendUrl + '/#/dsc-full-screen/page?customSystem=' + system.code + '&pageCode=' + pageCode + '&jumpMode=' + jumpMode
407
+ return packagePathParams(dataId, path, jumpPageSetting, ids, buttonCode)
408
+ }
409
+
410
+ // 解析跳转页面附带参数
411
+ function analysisAdditionalParameter(paramStoreId) {
412
+ const additionalParamMap = sessionStorage.getItem(paramStoreId)
413
+ return analysisAdditionalParameterWithMap(additionalParamMap)
414
+ }
415
+
416
+ // 解析跳转页面附带参数
417
+ function analysisAdditionalParameterWithMap(additionalParamMap) {
418
+ let additionalParameterStr = ''
419
+ if (additionalParamMap) {
420
+ const additionalParameterMap = JSON.parse(additionalParamMap)
421
+ const keys = Object.getOwnPropertyNames(JSON.parse(additionalParamMap))
422
+ console.log(keys)
423
+ for (var i = 0; i < keys.length; i++) {
424
+ if (additionalParameterStr !== '') {
425
+ additionalParameterStr += '&'
426
+ }
427
+ additionalParameterStr += keys[i]
428
+ additionalParameterStr += '='
429
+ additionalParameterStr += additionalParameterMap[keys[i]]
430
+ }
431
+ }
432
+ return additionalParameterStr
433
+ }
434
+
435
+ export function updateWithPageValue(sourceModel, sourceTableName, jumpPageSetting, entity, targetTableName, isNeedReplaceFieldName) {
436
+ if (sourceModel && sourceModel !== null && entity && entity !== null && jumpPageSetting && jumpPageSetting !== null && jumpPageSetting.valueMappings) {
437
+ let sourceEntity = sourceModel
438
+ if (Array.isArray(sourceModel) && sourceModel.length > 0) {
439
+ // 弹出框中列表选择了多行时,默认只赋值第一行记录
440
+ sourceEntity = sourceModel[0]
441
+ }
442
+ const valueMappings = jumpPageSetting.valueMappings
443
+ valueMappings.forEach((valueMapping) => {
444
+ let sourceField = valueMapping.source
445
+ let targetValue = getEntityFieldValue(sourceEntity, sourceField)
446
+ // sql查询时,会把点“.”改为两个下划线"__"
447
+ const replaceDot = '__'
448
+ if (targetValue === undefined || targetValue === null) {
449
+ // 如果通过字段没有获得字段,则再拼接表名作为字段,重新获得字段值
450
+ if (sourceField && sourceTableName && sourceField.indexOf('.') > 0) {
451
+ // 表示包括点“.”,需要把两个下划线"__"重新改为点“.”,否则会导致查询报500错误
452
+ sourceField = sourceTableName + replaceDot + sourceField
453
+ }
454
+ // 重新获得字段值
455
+ targetValue = getEntityFieldValue(sourceEntity, sourceField)
456
+ }
457
+
458
+ let targetField = valueMapping.target
459
+ if (isNeedReplaceFieldName !== undefined && isNeedReplaceFieldName === true && targetField && targetTableName && targetField.indexOf('.') > 0) {
460
+ // 表示包括点“.”,需要把两个下划线"__"重新改为点“.”,否则会导致查询报500错误
461
+ targetField = targetTableName + replaceDot + targetField
462
+ }
463
+ setEntityFieldValue(entity, targetField, targetValue)
464
+ })
465
+ }
466
+ }
467
+
@@ -20,7 +20,7 @@ export default function checkPermission(permission) {
20
20
 
21
21
  return hasPermission
22
22
  } else {
23
- console.error(`need permission! Like v-permission="acs.department.save"`)
23
+ console.error(`need permission2! Like v-permission="acs.department.save"`)
24
24
  return false
25
25
  }
26
26
  }
@@ -2,7 +2,7 @@ import sessionStorage from 'sessionstorage'
2
2
  import Vue from 'vue'
3
3
 
4
4
  const permissionKey = 'PERMISSION-'
5
- function getSystemCode() {
5
+ export function getSystemCode() {
6
6
  let systemCode = Vue.prototype.systemCode
7
7
  if (Vue.prototype.customSystem) {
8
8
  systemCode = Vue.prototype.customSystem
@@ -27,7 +27,9 @@ service.interceptors.request.use(
27
27
  if (customSystem) {
28
28
  config.headers['customSystem'] = customSystem
29
29
  }
30
- config.baseURL = getRelativeBaseUrl(Vue.prototype.baseURL)
30
+ if (Vue.prototype.baseURL) {
31
+ config.baseURL = getRelativeBaseUrl(Vue.prototype.baseURL)
32
+ }
31
33
  return config
32
34
  },
33
35
  error => {
@@ -107,7 +109,7 @@ service.interceptors.response.use(
107
109
  }
108
110
  )
109
111
 
110
- export const apiUrlMappings = []
112
+ export const apiUrlMappings = {}
111
113
  /**
112
114
  *
113
115
  * @param {*} code 资源权限的编码
@@ -0,0 +1,47 @@
1
+ import Vue from 'vue'
2
+ /**
3
+ * rest接口调用处理
4
+ * @param {*} restfulInterface 接口配置json信息
5
+ * @param {*} backendUrl 后台url路径
6
+ * @param {*} entity 表单数据
7
+ * @returns request Promise函数
8
+ */
9
+ export function restfulInterfaceTo(restfulInterface, entity, additionalParamMap) {
10
+ return new Promise((resolve, reject) => {
11
+ let systemCode = Vue.prototype.customSystem
12
+ if (!systemCode) {
13
+ systemCode = Vue.prototype.systemCode
14
+ }
15
+ let restConfigMap = restfulInterface
16
+
17
+ if (restfulInterface && typeof (restfulInterface) === 'string') {
18
+ restConfigMap = JSON.parse(restfulInterface)
19
+ } else if (restfulInterface && typeof (restfulInterface) === 'object') {
20
+ restConfigMap = restfulInterface
21
+ }
22
+ const paramMap = {
23
+ }
24
+ if (systemCode) {
25
+ paramMap.systemCode = systemCode
26
+ }
27
+ if (additionalParamMap) {
28
+ paramMap.additionalParamMap = additionalParamMap
29
+ }
30
+ if (restConfigMap) {
31
+ paramMap.restConfig = restConfigMap
32
+ }
33
+ if (entity) {
34
+ paramMap.entity = entity
35
+ }
36
+ Vue.prototype.$http.post(Vue.prototype.baseAPI + '/component/super-pages/rest-data', paramMap).then((dataJson) => {
37
+ if (dataJson) {
38
+ // json字符串
39
+ resolve(JSON.parse(dataJson))
40
+ } else {
41
+ resolve()
42
+ }
43
+ }).catch((error) => {
44
+ reject(error)
45
+ })
46
+ })
47
+ }