agilebuilder-ui 1.0.69 → 1.0.71-temp8
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.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +44667 -42821
- package/lib/super-ui.umd.cjs +94 -86
- package/package.json +4 -2
- package/packages/department-tree/src/department-tree.vue +28 -10
- package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
- package/packages/department-user-tree/src/department-user-tree.vue +16 -2
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +410 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +484 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +140 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +220 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +249 -0
- package/packages/fs-upload-new/src/fs-button-upload.vue +9 -13
- package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
- package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
- package/packages/fs-upload-new/src/fs-upload-new.vue +88 -8
- package/packages/super-grid/src/apis.js +6 -6
- package/packages/super-grid/src/custom-formatter.js +2 -1
- package/packages/super-grid/src/search-button.vue +18 -14
- package/packages/super-grid/src/search-form-mobile.vue +250 -0
- package/packages/super-grid/src/search-form.vue +159 -82
- package/packages/super-grid/src/super-grid.vue +21 -5
- package/src/api/sso-service.js +25 -14
- package/src/i18n/langs/cn.js +4 -1
- package/src/i18n/langs/en.js +4 -1
- package/src/permission.js +108 -122
- package/src/styles/theme/green/sidebar.scss +11 -0
- package/src/utils/common-util.js +217 -124
- package/src/utils/i18n-util.js +127 -0
- package/src/utils/jump-page-utils.js +34 -13
- package/src/utils/permissionAuth.js +47 -8
- package/src/utils/util.js +1 -1
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getEntityFieldValue,
|
|
6
6
|
setEntityFieldValue,
|
|
7
7
|
} from './util'
|
|
8
|
-
import { getSystemFrontendUrl, getUuidv4 } from './common-util'
|
|
8
|
+
import { getSystemFrontendUrl, getUuidv4, isMobileBrowser } from './common-util'
|
|
9
9
|
// 解析初始化条件,api方法;additionalParamMap是上个页面传过来的附加参数集合
|
|
10
10
|
export function initialization(
|
|
11
11
|
jumpPage,
|
|
@@ -365,6 +365,7 @@ function jumpToPageTwo(
|
|
|
365
365
|
if (!jumpPageUrl) {
|
|
366
366
|
return
|
|
367
367
|
}
|
|
368
|
+
const isMobile = isMobileBrowser()
|
|
368
369
|
if (jumpPageUrl.indexOf('page:') === 0) {
|
|
369
370
|
// 表示是自定义系统跳转页面编码
|
|
370
371
|
jumpWithSuperPage(
|
|
@@ -374,7 +375,8 @@ function jumpToPageTwo(
|
|
|
374
375
|
jumpPageSetting,
|
|
375
376
|
ids,
|
|
376
377
|
buttonCode,
|
|
377
|
-
isHasIdParam
|
|
378
|
+
isHasIdParam,
|
|
379
|
+
isMobile
|
|
378
380
|
).then((openPageParams) => {
|
|
379
381
|
resolve(openPageParams)
|
|
380
382
|
})
|
|
@@ -398,7 +400,8 @@ function jumpToPageTwo(
|
|
|
398
400
|
path = frontendUrl + '/#' + path
|
|
399
401
|
}
|
|
400
402
|
const systemName = getSystemNameWithLanguage(system)
|
|
401
|
-
|
|
403
|
+
// 移动端时会有返回值
|
|
404
|
+
const fullPath = jumpToPageWithFullPath(
|
|
402
405
|
dataId,
|
|
403
406
|
path,
|
|
404
407
|
additionalParameterStr,
|
|
@@ -406,9 +409,14 @@ function jumpToPageTwo(
|
|
|
406
409
|
ids,
|
|
407
410
|
buttonCode,
|
|
408
411
|
isHasIdParam,
|
|
409
|
-
systemName
|
|
412
|
+
systemName,
|
|
413
|
+
isMobile
|
|
410
414
|
)
|
|
411
|
-
|
|
415
|
+
if(fullPath){
|
|
416
|
+
// 移动端时返回的全路径
|
|
417
|
+
jumpPageSetting._path = fullPath
|
|
418
|
+
}
|
|
419
|
+
resolve(jumpPageSetting)
|
|
412
420
|
}
|
|
413
421
|
})
|
|
414
422
|
}
|
|
@@ -427,7 +435,8 @@ function jumpToPageWithFullPath(
|
|
|
427
435
|
ids,
|
|
428
436
|
buttonCode,
|
|
429
437
|
isHasIdParam,
|
|
430
|
-
systemName
|
|
438
|
+
systemName,
|
|
439
|
+
isMobile
|
|
431
440
|
) {
|
|
432
441
|
path = packagePathParams(
|
|
433
442
|
dataId,
|
|
@@ -451,6 +460,10 @@ function jumpToPageWithFullPath(
|
|
|
451
460
|
path += additionalParameterStr + systemNameParam
|
|
452
461
|
}
|
|
453
462
|
}
|
|
463
|
+
if(isMobile){
|
|
464
|
+
// 如果是移动端返回全路径即可
|
|
465
|
+
return path
|
|
466
|
+
}
|
|
454
467
|
let jumpMode = 'refresh'
|
|
455
468
|
if (jumpPage) {
|
|
456
469
|
if (jumpPage.jumpPageOpenMode) {
|
|
@@ -574,7 +587,8 @@ function jumpWithSuperPage(
|
|
|
574
587
|
jumpPageSetting,
|
|
575
588
|
ids,
|
|
576
589
|
buttonCode,
|
|
577
|
-
isHasIdParam
|
|
590
|
+
isHasIdParam,
|
|
591
|
+
isMobile
|
|
578
592
|
) {
|
|
579
593
|
return new Promise((resolve, reject) => {
|
|
580
594
|
// 表示是自定义系统跳转页面编码
|
|
@@ -587,10 +601,8 @@ function jumpWithSuperPage(
|
|
|
587
601
|
)
|
|
588
602
|
const pageCode = getPageCode(jumpPageUrl)
|
|
589
603
|
let jumpMode = 'refresh'
|
|
590
|
-
if (jumpPageSetting) {
|
|
591
|
-
if (jumpPageSetting.jumpPageOpenMode) {
|
|
604
|
+
if (jumpPageSetting && jumpPageSetting.jumpPageOpenMode) {
|
|
592
605
|
jumpMode = jumpPageSetting.jumpPageOpenMode
|
|
593
|
-
}
|
|
594
606
|
}
|
|
595
607
|
const jumpJsonData = {
|
|
596
608
|
jumpMode: jumpMode,
|
|
@@ -626,6 +638,7 @@ function jumpWithSuperPage(
|
|
|
626
638
|
popPageSetting.isRefreshWhenClosePopup = jumpPageSetting.isRefreshWhenClosePopup
|
|
627
639
|
}
|
|
628
640
|
popPageSetting._path = path
|
|
641
|
+
popPageSetting.customSystem = system.code
|
|
629
642
|
resolve(popPageSetting)
|
|
630
643
|
} else if (jumpMode === 'newTab') {
|
|
631
644
|
// 新页签打开
|
|
@@ -642,8 +655,16 @@ function jumpWithSuperPage(
|
|
|
642
655
|
) +
|
|
643
656
|
'&_t_=' +
|
|
644
657
|
new Date().getTime()
|
|
645
|
-
|
|
646
|
-
|
|
658
|
+
const popPageSetting = {
|
|
659
|
+
_path: path,
|
|
660
|
+
pageCode: pageCode,
|
|
661
|
+
customSystem: system.code
|
|
662
|
+
}
|
|
663
|
+
if(!isMobile){
|
|
664
|
+
// 不是移动端时直接open打开pc新页签
|
|
665
|
+
window.open(path)
|
|
666
|
+
}
|
|
667
|
+
resolve(popPageSetting)
|
|
647
668
|
} else {
|
|
648
669
|
// 刷新页面
|
|
649
670
|
const queryParam = {
|
|
@@ -651,7 +672,7 @@ function jumpWithSuperPage(
|
|
|
651
672
|
customSystem: system.code,
|
|
652
673
|
jumpMode: jumpMode,
|
|
653
674
|
buttonCode: buttonCode,
|
|
654
|
-
ids: ids ? ids.join(',') : ''
|
|
675
|
+
ids: ids ? ids.join(',') : ''
|
|
655
676
|
}
|
|
656
677
|
if (
|
|
657
678
|
jumpPageSetting.isNeedId === undefined ||
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as Vue from 'vue'
|
|
2
2
|
import {getSessionCache, getRunInfoKey} from './auth'
|
|
3
|
+
import { isMobileBrowser } from './common-util'
|
|
3
4
|
|
|
4
5
|
const permissionKey = 'PERMISSION-'
|
|
5
6
|
const permissionMenuKey = 'PERMISSION_MENU-'
|
|
6
7
|
const _RUN_PERMISSION = '_RUN_PERMISSION'
|
|
7
8
|
|
|
8
9
|
const permissionAllSystemKey = 'PERMISSION_All_SYSTSEM_KEY'
|
|
10
|
+
const mobilePermissionKey = 'PERMISSION-MOBILE-WEB'
|
|
9
11
|
export function getSystemCode() {
|
|
10
12
|
let systemCode
|
|
11
13
|
if (window.$vueApp.config.globalProperties.customSystem) {
|
|
@@ -23,13 +25,27 @@ export function getSystemCode() {
|
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export function getPermissions() {
|
|
28
|
+
let totalPermissions = null
|
|
26
29
|
const systemCode = getSystemCode()
|
|
27
30
|
let permissions = localStorage.getItem(permissionKey + systemCode)
|
|
28
31
|
if (permissions) {
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
if(!totalPermissions){
|
|
33
|
+
totalPermissions = {}
|
|
34
|
+
}
|
|
35
|
+
Object.assign(totalPermissions,JSON.parse(permissions))
|
|
31
36
|
}
|
|
32
|
-
|
|
37
|
+
|
|
38
|
+
const isMobile = isMobileBrowser()
|
|
39
|
+
if(isMobile){
|
|
40
|
+
const permissions = localStorage.getItem(mobilePermissionKey)
|
|
41
|
+
if (permissions) {
|
|
42
|
+
if(!totalPermissions){
|
|
43
|
+
totalPermissions = {}
|
|
44
|
+
}
|
|
45
|
+
Object.assign(totalPermissions,JSON.parse(permissions))
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return totalPermissions
|
|
33
49
|
}
|
|
34
50
|
|
|
35
51
|
export function getTotalPermissions() {
|
|
@@ -45,6 +61,15 @@ export function getTotalPermissions() {
|
|
|
45
61
|
if (sysetemPermissions) {
|
|
46
62
|
sysetemPermissionsObj = JSON.parse(sysetemPermissions)
|
|
47
63
|
}
|
|
64
|
+
|
|
65
|
+
let mobilePermissionsObj
|
|
66
|
+
const isMobile = isMobileBrowser()
|
|
67
|
+
if(isMobile){
|
|
68
|
+
const mobilePermissions = localStorage.getItem(mobilePermissionKey)
|
|
69
|
+
if (mobilePermissions) {
|
|
70
|
+
mobilePermissionsObj = JSON.parse(mobilePermissions)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
48
73
|
const b = new Date().getTime()
|
|
49
74
|
if(runPermissionsObj || sysetemPermissionsObj) {
|
|
50
75
|
let permissions = {}
|
|
@@ -54,6 +79,9 @@ export function getTotalPermissions() {
|
|
|
54
79
|
if(sysetemPermissionsObj){
|
|
55
80
|
Object.assign(permissions, sysetemPermissionsObj)
|
|
56
81
|
}
|
|
82
|
+
if(mobilePermissionsObj){
|
|
83
|
+
Object.assign(permissions, mobilePermissionsObj)
|
|
84
|
+
}
|
|
57
85
|
// console.log('getTotalPermissions----permissions=', permissions )
|
|
58
86
|
return permissions
|
|
59
87
|
}
|
|
@@ -61,8 +89,21 @@ export function getTotalPermissions() {
|
|
|
61
89
|
}
|
|
62
90
|
|
|
63
91
|
export function setPermissions(permissions) {
|
|
64
|
-
const
|
|
65
|
-
|
|
92
|
+
const isMobile = isMobileBrowser()
|
|
93
|
+
let key
|
|
94
|
+
const permissionObjs = getPermissionObjs(permissions)
|
|
95
|
+
if(isMobile){
|
|
96
|
+
key = mobilePermissionKey
|
|
97
|
+
} else {
|
|
98
|
+
const systemCode = getSystemCode()
|
|
99
|
+
key = permissionKey + systemCode
|
|
100
|
+
}
|
|
101
|
+
localStorage.setItem(key, JSON.stringify(permissionObjs))
|
|
102
|
+
setPermissionAllSystemKey(key)
|
|
103
|
+
return permissionObjs
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function getPermissionObjs(permissions){
|
|
66
107
|
const permissionObjs = {}
|
|
67
108
|
for (let i = 0; i < permissions.length; i++) {
|
|
68
109
|
const functionCode = permissions[i]
|
|
@@ -71,9 +112,6 @@ export function setPermissions(permissions) {
|
|
|
71
112
|
permissionObjs[permission] = true
|
|
72
113
|
}
|
|
73
114
|
}
|
|
74
|
-
const key = permissionKey + systemCode
|
|
75
|
-
localStorage.setItem(key, JSON.stringify(permissionObjs))
|
|
76
|
-
setPermissionAllSystemKey(key)
|
|
77
115
|
return permissionObjs
|
|
78
116
|
}
|
|
79
117
|
|
|
@@ -147,6 +185,7 @@ function rtrim(str) { // 删除右边的空格
|
|
|
147
185
|
|
|
148
186
|
// 删除缓存的资源和菜单
|
|
149
187
|
export function removeAllSystemPermissions() {
|
|
188
|
+
localStorage.removeItem(mobilePermissionKey)
|
|
150
189
|
const systemCode = getSystemCode()
|
|
151
190
|
localStorage.removeItem(permissionKey + systemCode)
|
|
152
191
|
const myPermissionMenuKey = getRunInfoKey(permissionMenuKey)
|
package/src/utils/util.js
CHANGED
|
@@ -965,7 +965,7 @@ export function isImage(fileName) {
|
|
|
965
965
|
// const fileType = fileName.substring(fileName.lastIndexOf('.'), fileName.length).toLowerCase()
|
|
966
966
|
// const imageTypes = ['.jpg', '.JPG', '.png', '.bmp', '.BMP', '.jpeg', '.gif', '.psd', '.tif', '.tga', '.svg', '.eps']
|
|
967
967
|
// const index = imageTypes.indexOf(fileType)
|
|
968
|
-
if (
|
|
968
|
+
if (fileName &&
|
|
969
969
|
/\.(jpg|JPG|jpeg|JPEG|png|PNG|gif|GIF|bmp|BMP|psd|PSD|tif|TIF)$/.test(
|
|
970
970
|
fileName
|
|
971
971
|
)
|