resolver-egretimp-plus 0.0.21 → 0.0.28
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/dist/h5/index.js +1 -1
- package/dist/theme/element/index.css +1 -1
- package/dist/theme/element/src/components/form.scss +4 -0
- package/dist/web/index.js +1 -1
- package/package.json +3 -1
- package/scripts/webpack.config.js +3 -1
- package/src/api/builtIn.js +3 -1
- package/src/components/icons/question-filled.vue +3 -2
- package/src/components/loading/loading.vue +3 -5
- package/src/components/packages-H5/CmiCell.vue +4 -3
- package/src/enums/index.js +10 -3
- package/src/hooks/pageConfig.js +49 -71
- package/src/index.jsx +2 -2
- package/src/resolver-H5.vue +18 -2
- package/src/resolver-common.vue +45 -0
- package/src/resolver-web.vue +17 -2
- package/src/theme/element/components/form.scss +4 -0
- package/src/utils/cipher.js +141 -0
- package/src/utils/render.jsx +6 -11
- package/src/utils/request.js +98 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resolver-egretimp-plus",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "交付体验渲染",
|
|
5
5
|
"main": "./dist/web/index.js",
|
|
6
6
|
"module": "./dist/web/index.js",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"babel-loader": "^9.1.3",
|
|
29
29
|
"consola": "^3.2.3",
|
|
30
30
|
"core-js-pure": "^3.38.1",
|
|
31
|
+
"crypto-js": "^4.2.0",
|
|
31
32
|
"css-loader": "^7.1.2",
|
|
32
33
|
"dayjs": "^1.11.13",
|
|
33
34
|
"element-plus": "^2.7.6",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"lodash-es": "^4.17.21",
|
|
41
42
|
"mini-css-extract-plugin": "^2.9.0",
|
|
42
43
|
"node-sass": "^9.0.0",
|
|
44
|
+
"qs": "^6.13.0",
|
|
43
45
|
"sass": "1.77.6",
|
|
44
46
|
"sass-loader": "^14.2.1",
|
|
45
47
|
"vue-loader": "^17.4.2",
|
|
@@ -71,7 +71,9 @@ module.exports = {
|
|
|
71
71
|
},
|
|
72
72
|
externals: {
|
|
73
73
|
vue: 'vue',
|
|
74
|
-
'cmid
|
|
74
|
+
'cmid': 'cmid',
|
|
75
|
+
'cmid/lib/toast': 'cmid/lib/toast',
|
|
76
|
+
'cmid/lib/fullloading': 'cmid/lib/fullloading',
|
|
75
77
|
'element-plus': 'element-plus',
|
|
76
78
|
'vue-router': 'vue-router',
|
|
77
79
|
'element-plus/es/hooks/index.mjs': 'element-plus/es/hooks/index.mjs',
|
package/src/api/builtIn.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export const QUERY_PAGE_CONFIG_DATA = '/sa-lcp/api/v1/pageConfig/queryPageConfigData'
|
|
2
|
-
export const LCP_LOGIN = '/sa-lcp/login'
|
|
2
|
+
export const LCP_LOGIN = '/sa-lcp/login'
|
|
3
|
+
export const GET_SYS_PARAM_CACHE = '/sa-lcp/api/v1/sysparam/getSysParamCache'
|
|
4
|
+
export const REFRESH_TOKEN = '/sa-lcp/changePwd/refreshToken'
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"/></svg>
|
|
3
|
+
<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
3
4
|
<path
|
|
4
5
|
fill="currentColor"
|
|
5
6
|
d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"
|
|
6
7
|
/>
|
|
7
|
-
</svg>
|
|
8
|
+
</svg> -->
|
|
8
9
|
</template>
|
|
9
10
|
<script setup>
|
|
10
11
|
defineOptions({
|
|
@@ -5,21 +5,19 @@
|
|
|
5
5
|
<span></span>
|
|
6
6
|
<span></span>
|
|
7
7
|
<span></span>
|
|
8
|
-
<div class="word" style="display: block">{{ worldTip }}</div>
|
|
8
|
+
<!-- <div class="word" style="display: block">{{ worldTip }}</div> -->
|
|
9
9
|
</div>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
12
|
</template>
|
|
13
13
|
<script>
|
|
14
14
|
/* eslint-disable */
|
|
15
|
-
import { useLocaleStoreWithOut } from '@/stores/modules/locale'
|
|
16
15
|
import { computed } from 'vue'
|
|
17
16
|
export default {
|
|
18
17
|
name: 'CmiLoading',
|
|
19
|
-
setup() {
|
|
20
|
-
const localeStore = useLocaleStoreWithOut()
|
|
18
|
+
setup(props) {
|
|
21
19
|
const lang = computed(() => {
|
|
22
|
-
return
|
|
20
|
+
return props.lang
|
|
23
21
|
})
|
|
24
22
|
return {
|
|
25
23
|
lang
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, defineProps, inject, useAttrs } from 'vue'
|
|
3
|
-
import { commonPropsType } from '../../utils/index.js'
|
|
3
|
+
import { commonPropsType, hasOwn } from '../../utils/index.js'
|
|
4
4
|
|
|
5
5
|
const lang = inject('lang')
|
|
6
6
|
const modelValue = defineModel()
|
|
7
7
|
const props = defineProps({
|
|
8
8
|
...commonPropsType,
|
|
9
9
|
})
|
|
10
|
+
|
|
10
11
|
const calcProps = computed(() => {
|
|
11
12
|
return {
|
|
12
13
|
title: lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
|
|
13
14
|
desc: modelValue.value || props.config?.desc,
|
|
14
15
|
content: props.config?.content,
|
|
15
|
-
to: props.config?.
|
|
16
|
+
to: props.config?.toHref,
|
|
16
17
|
islink: props.config?.islink === '1',
|
|
17
18
|
icon: props.config?.icon,
|
|
18
|
-
selfadaption: props.config
|
|
19
|
+
selfadaption: hasOwn(props.config, 'selfadaption') ? props.config.selfadaption === '1' : true,
|
|
19
20
|
noborder: props.noborder === '1',
|
|
20
21
|
}
|
|
21
22
|
})
|
package/src/enums/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const
|
|
1
|
+
import { LCP_LOGIN } from "../api/builtIn"
|
|
2
|
+
|
|
3
|
+
export const USER_NAME = 'lcpsupport'
|
|
4
|
+
export const PASSWORD = '8ik,*IK<'
|
|
5
|
+
export const USER_TYPE = '1'
|
|
6
|
+
export const AUTH_CODE = '9887'
|
|
7
|
+
|
|
8
|
+
export const NOT_AUTH_APIS = [
|
|
9
|
+
LCP_LOGIN
|
|
10
|
+
]
|
package/src/hooks/pageConfig.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { parsePageConfig } from "../utils"
|
|
2
2
|
import { ref } from 'vue'
|
|
3
|
+
import { buildInRequest } from "../utils/request"
|
|
4
|
+
import { GET_SYS_PARAM_CACHE, QUERY_PAGE_CONFIG_DATA } from "../api/builtIn"
|
|
3
5
|
|
|
4
6
|
export function usePageConfig() {
|
|
5
7
|
const pageConfigRef = ref(null)
|
|
@@ -19,74 +21,50 @@ export function usePageConfig() {
|
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// },
|
|
70
|
-
// {
|
|
71
|
-
// id: 3,
|
|
72
|
-
// label: 'Level one 3',
|
|
73
|
-
// children: [
|
|
74
|
-
// {
|
|
75
|
-
// id: 7,
|
|
76
|
-
// label: 'Level two 3-1',
|
|
77
|
-
// },
|
|
78
|
-
// {
|
|
79
|
-
// id: 8,
|
|
80
|
-
// label: 'Level two 3-2',
|
|
81
|
-
// },
|
|
82
|
-
// ],
|
|
83
|
-
// },
|
|
84
|
-
// ]
|
|
85
|
-
// })
|
|
86
|
-
// return {
|
|
87
|
-
// pageConfig,
|
|
88
|
-
// getPageConfig,
|
|
89
|
-
// getSelects,
|
|
90
|
-
// selects
|
|
91
|
-
// }
|
|
92
|
-
// }
|
|
24
|
+
export function useBuildInData(messageTipInstance, loadingInstance) {
|
|
25
|
+
const pageConfig = ref(null)
|
|
26
|
+
function getPageConfig(reqData) {
|
|
27
|
+
if (loadingInstance.start && typeof loadingInstance.start === 'function') {
|
|
28
|
+
loadingInstance.start()
|
|
29
|
+
} else if (loadingInstance.show && typeof loadingInstance.show === 'function') {
|
|
30
|
+
loadingInstance.show()
|
|
31
|
+
}
|
|
32
|
+
buildInRequest(QUERY_PAGE_CONFIG_DATA, reqData).then(ret => {
|
|
33
|
+
if (ret.data.success) {
|
|
34
|
+
pageConfig.value = ret.data.result
|
|
35
|
+
getSelects(ret.data.result?.pmBusinessIdentityVO?.tenantId)
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
messageTipInstance?.error(ret.data.resultMessage)
|
|
39
|
+
}).catch(() => {
|
|
40
|
+
if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
|
|
41
|
+
loadingInstance.finish()
|
|
42
|
+
} else if (loadingInstance.hide && typeof loadingInstance.hide === 'function') {
|
|
43
|
+
loadingInstance.hide()
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
const selects = ref([])
|
|
48
|
+
function getSelects(tenantId) {
|
|
49
|
+
buildInRequest(GET_SYS_PARAM_CACHE, {
|
|
50
|
+
tenantId
|
|
51
|
+
}).then(ret => {
|
|
52
|
+
if (ret.data.success) {
|
|
53
|
+
selects.value = JSON.parse(ret.data.result || '{}')
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
messageTipInstance?.error(ret.data.resultMessage)
|
|
57
|
+
}).finally(() => {
|
|
58
|
+
if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
|
|
59
|
+
loadingInstance.finish()
|
|
60
|
+
} else if (loadingInstance.hide && typeof loadingInstance.hide === 'function') {
|
|
61
|
+
loadingInstance.hide()
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
pageConfig,
|
|
67
|
+
getPageConfig,
|
|
68
|
+
selects
|
|
69
|
+
}
|
|
70
|
+
}
|
package/src/index.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { provide, toRef, watch, computed, ref, defineExpose, reactive, getCurrentInstance } from "vue"
|
|
2
2
|
import Renderer from './renderer.jsx'
|
|
3
3
|
// import './style/index.scss'
|
|
4
|
-
import { usePageConfig } from './hooks/pageConfig'
|
|
4
|
+
import { useBuildInData, usePageConfig } from './hooks/pageConfig'
|
|
5
5
|
import { toValidate } from './utils/valid.js'
|
|
6
6
|
import { MODE } from "./utils/const.js"
|
|
7
7
|
import { generateRequester } from "./utils/request.js"
|
|
@@ -72,7 +72,7 @@ export default {
|
|
|
72
72
|
getNativeComps: {
|
|
73
73
|
type: Function,
|
|
74
74
|
default: () => ({composeComponents: {}})
|
|
75
|
-
}
|
|
75
|
+
},
|
|
76
76
|
},
|
|
77
77
|
setup(props, { emit, attrs, expose }) {
|
|
78
78
|
let axiosInstance = ref(props.axiosInstance)
|
package/src/resolver-H5.vue
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import getNativeComps from './components/patchComponents-H5.js'
|
|
3
3
|
import { useAttrs } from 'vue';
|
|
4
|
-
import Resolver from './
|
|
4
|
+
import Resolver from './resolver-common.vue'
|
|
5
|
+
import CmiToast from "cmid/lib/toast"
|
|
6
|
+
import CmiFullLoading from "cmid/lib/fullloading"
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
loadingInstance: {
|
|
10
|
+
type: [Object, Function],
|
|
11
|
+
default: () => CmiFullLoading
|
|
12
|
+
// default: () => null
|
|
13
|
+
},
|
|
14
|
+
messageInstance: {
|
|
15
|
+
type: [Object, Function],
|
|
16
|
+
default: () => CmiToast
|
|
17
|
+
// default: () => null
|
|
18
|
+
},
|
|
19
|
+
})
|
|
5
20
|
|
|
6
21
|
defineOptions({
|
|
7
22
|
inheritAttrs: false
|
|
8
23
|
})
|
|
9
24
|
const attrs = useAttrs()
|
|
25
|
+
|
|
10
26
|
</script>
|
|
11
27
|
<template>
|
|
12
|
-
<Resolver v-bind="attrs" :getNativeComps="getNativeComps"></Resolver>
|
|
28
|
+
<Resolver v-bind="attrs" :isH5="true" :getNativeComps="getNativeComps" :messageInstance="props.messageInstance" :loadingInstance="props.loadingInstance"></Resolver>
|
|
13
29
|
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, useAttrs } from 'vue';
|
|
3
|
+
import Resolver from './index.jsx'
|
|
4
|
+
import { useBuildInData } from './hooks/pageConfig';
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
busiIdentityId: String,
|
|
8
|
+
selects: {
|
|
9
|
+
type: Object,
|
|
10
|
+
default: () => ({})
|
|
11
|
+
},
|
|
12
|
+
getNativeComps: {
|
|
13
|
+
type: Function,
|
|
14
|
+
default: () => ({composeComponents: {}})
|
|
15
|
+
},
|
|
16
|
+
loadingInstance: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default: () => null
|
|
19
|
+
},
|
|
20
|
+
messageInstance: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: () => null
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
defineOptions({
|
|
26
|
+
inheritAttrs: false
|
|
27
|
+
})
|
|
28
|
+
const attrs = useAttrs()
|
|
29
|
+
|
|
30
|
+
const { getPageConfig, pageConfig, selects } = useBuildInData(props.messageInstance, props.loadingInstance)
|
|
31
|
+
getPageConfig({
|
|
32
|
+
busiIdentityId: props.busiIdentityId,
|
|
33
|
+
queryPageMeta: '1',
|
|
34
|
+
queryPageService: '1',
|
|
35
|
+
})
|
|
36
|
+
const allSelects = computed(() => {
|
|
37
|
+
return {
|
|
38
|
+
...props.selects,
|
|
39
|
+
...selects
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
</script>
|
|
43
|
+
<template>
|
|
44
|
+
<Resolver v-bind="attrs" :getNativeComps="props.getNativeComps" :config="pageConfig || null" :selects="allSelects"></Resolver>
|
|
45
|
+
</template>
|
package/src/resolver-web.vue
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import getNativeComps from './components/patchComponents-web'
|
|
3
|
+
import { ElMessage } from "element-plus"
|
|
4
|
+
import { loadingInstance } from './components/loading'
|
|
3
5
|
import { useAttrs } from 'vue';
|
|
4
|
-
import Resolver from './
|
|
6
|
+
import Resolver from './resolver-common.vue'
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
loadingInstance: {
|
|
10
|
+
type: [Object, Function],
|
|
11
|
+
default: () => loadingInstance
|
|
12
|
+
// default: () => null
|
|
13
|
+
},
|
|
14
|
+
messageInstance: {
|
|
15
|
+
type: [Object, Function],
|
|
16
|
+
default: () => ElMessage
|
|
17
|
+
},
|
|
18
|
+
})
|
|
5
19
|
|
|
6
20
|
defineOptions({
|
|
7
21
|
inheritAttrs: false
|
|
8
22
|
})
|
|
9
23
|
const attrs = useAttrs()
|
|
24
|
+
|
|
10
25
|
</script>
|
|
11
26
|
<template>
|
|
12
|
-
<Resolver v-bind="attrs" :getNativeComps="getNativeComps"></Resolver>
|
|
27
|
+
<Resolver v-bind="attrs" :getNativeComps="getNativeComps" :messageInstance="props.messageInstance" :loadingInstance="props.loadingInstance"></Resolver>
|
|
13
28
|
</template>
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { decrypt as aesDecrypt, encrypt as aesEncrypt } from 'crypto-js/aes';
|
|
2
|
+
import UTF8 from 'crypto-js/enc-utf8';
|
|
3
|
+
import pkcs7 from 'crypto-js/pad-pkcs7';
|
|
4
|
+
import CTR from 'crypto-js/mode-ctr';
|
|
5
|
+
import Base64 from 'crypto-js/enc-base64';
|
|
6
|
+
import MD5 from 'crypto-js/md5';
|
|
7
|
+
import SHA256 from 'crypto-js/sha256';
|
|
8
|
+
import SHA512 from 'crypto-js/sha512';
|
|
9
|
+
|
|
10
|
+
class AesEncryption {
|
|
11
|
+
key;
|
|
12
|
+
iv;
|
|
13
|
+
constructor({ key, iv }) {
|
|
14
|
+
this.key = UTF8.parse(key);
|
|
15
|
+
this.iv = UTF8.parse(iv);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get getOptions() {
|
|
19
|
+
return {
|
|
20
|
+
mode: CTR,
|
|
21
|
+
padding: pkcs7,
|
|
22
|
+
iv: this.iv,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
encrypt(plainText) {
|
|
27
|
+
return aesEncrypt(plainText, this.key, this.getOptions).toString();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
decrypt(cipherText) {
|
|
31
|
+
return aesDecrypt(cipherText, this.key, this.getOptions).toString(UTF8);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Define a singleton class for Base64 encryption
|
|
36
|
+
class Base64Encryption{
|
|
37
|
+
instance;
|
|
38
|
+
|
|
39
|
+
constructor() {}
|
|
40
|
+
|
|
41
|
+
// Get the singleton instance
|
|
42
|
+
// 获取单例实例
|
|
43
|
+
getInstance() {
|
|
44
|
+
if (!Base64Encryption.instance) {
|
|
45
|
+
Base64Encryption.instance = new Base64Encryption();
|
|
46
|
+
}
|
|
47
|
+
return Base64Encryption.instance;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
encrypt(plainText) {
|
|
51
|
+
return UTF8.parse(plainText).toString(Base64);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
decrypt(cipherText) {
|
|
55
|
+
return Base64.parse(cipherText).toString(UTF8);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Define a singleton class for MD5 Hashing
|
|
60
|
+
class MD5Hashing {
|
|
61
|
+
instance;
|
|
62
|
+
|
|
63
|
+
constructor() {}
|
|
64
|
+
|
|
65
|
+
// Get the singleton instance
|
|
66
|
+
// 获取单例实例
|
|
67
|
+
static getInstance() {
|
|
68
|
+
if (!MD5Hashing.instance) {
|
|
69
|
+
MD5Hashing.instance = new MD5Hashing();
|
|
70
|
+
}
|
|
71
|
+
return MD5Hashing.instance;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
hash(plainText) {
|
|
75
|
+
return MD5(plainText).toString();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Define a singleton class for SHA256 Hashing
|
|
80
|
+
class SHA256Hashing {
|
|
81
|
+
static instance;
|
|
82
|
+
|
|
83
|
+
constructor() {}
|
|
84
|
+
|
|
85
|
+
// Get the singleton instance
|
|
86
|
+
// 获取单例实例
|
|
87
|
+
static getInstance() {
|
|
88
|
+
if (!SHA256Hashing.instance) {
|
|
89
|
+
SHA256Hashing.instance = new SHA256Hashing();
|
|
90
|
+
}
|
|
91
|
+
return SHA256Hashing.instance;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
hash(plainText) {
|
|
95
|
+
return SHA256(plainText).toString();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Define a singleton class for SHA512 Hashing
|
|
100
|
+
class SHA512Hashing {
|
|
101
|
+
static instance;
|
|
102
|
+
|
|
103
|
+
constructor() {}
|
|
104
|
+
|
|
105
|
+
// Get the singleton instance
|
|
106
|
+
// 获取单例实例
|
|
107
|
+
static getInstance() {
|
|
108
|
+
if (!SHA512Hashing.instance) {
|
|
109
|
+
SHA512Hashing.instance = new SHA512Hashing();
|
|
110
|
+
}
|
|
111
|
+
return SHA512Hashing.instance;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
hash(plainText) {
|
|
115
|
+
return SHA512(plainText).toString();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export class EncryptionFactory {
|
|
120
|
+
static createAesEncryption(params) {
|
|
121
|
+
return new AesEncryption(params);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static createBase64Encryption() {
|
|
125
|
+
return Base64Encryption.getInstance();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export class HashingFactory {
|
|
130
|
+
static createMD5Hashing() {
|
|
131
|
+
return MD5Hashing.getInstance();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
static createSHA256Hashing() {
|
|
135
|
+
return SHA256Hashing.getInstance();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
static createSHA512Hashing() {
|
|
139
|
+
return SHA512Hashing.getInstance();
|
|
140
|
+
}
|
|
141
|
+
}
|
package/src/utils/render.jsx
CHANGED
|
@@ -660,7 +660,7 @@ function getFormItemMargins(config) {
|
|
|
660
660
|
}
|
|
661
661
|
|
|
662
662
|
function createFormLable(config, lang = 'zh') {
|
|
663
|
-
const
|
|
663
|
+
const ElTooltip = resolveComponent('el-tooltip')
|
|
664
664
|
const elIcon = resolveComponent('el-icon')
|
|
665
665
|
const required = config.requiredFlag === '1'
|
|
666
666
|
return (
|
|
@@ -669,20 +669,15 @@ function createFormLable(config, lang = 'zh') {
|
|
|
669
669
|
{required ? <span style="color: #f5222d; margin-right: 3px">*</span> : null}
|
|
670
670
|
<span>{lang.indexOf('zh') > -1 ? config.metaNameZh : config.metaNameEn}</span>
|
|
671
671
|
</span>
|
|
672
|
-
<
|
|
673
|
-
|
|
674
|
-
width="300"
|
|
675
|
-
trigger="hover"
|
|
672
|
+
<ElTooltip
|
|
673
|
+
effect="dark"
|
|
676
674
|
content={lang.indexOf('zh') > -1 ? config.hintContentZh : config.hintContentEn}
|
|
675
|
+
placement="top"
|
|
677
676
|
>
|
|
678
677
|
{
|
|
679
|
-
|
|
680
|
-
reference: () => {
|
|
681
|
-
return config.hintFlag == '1' ? <span class="label-tip"><elIcon><QuestionFilled /></elIcon></span> : null
|
|
682
|
-
}
|
|
683
|
-
}
|
|
678
|
+
config.hintFlag == '1' ? <span class="label-tip"><elIcon><QuestionFilled /></elIcon></span> : null
|
|
684
679
|
}
|
|
685
|
-
</
|
|
680
|
+
</ElTooltip>
|
|
686
681
|
</div>
|
|
687
682
|
)
|
|
688
683
|
}
|