resolver-egretimp-plus 0.0.32 → 0.0.34
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/3/index.js +1 -0
- package/dist/661/index.js +2 -0
- package/dist/661/index.js.LICENSE.txt +6 -0
- package/dist/h5/index.js +1 -1
- package/dist/theme/element/index.css +1 -1
- package/dist/theme/element/src/components/tabs.scss +1 -1
- package/dist/web/index.js +1 -1
- package/package.json +1 -1
- package/src/components/childDialog/index.js +33 -0
- package/src/components/childDialog/src/index.vue +94 -0
- package/src/components/helper/button.js +63 -7
- package/src/components/packages-web/CustomComponentCollapse.vue +2 -2
- package/src/components/packages-web/CustomComponentTable.jsx +4 -0
- package/src/components/packages-web/ElButton.vue +27 -4
- package/src/hooks/mock.js +313 -2503
- package/src/hooks/pageConfig.js +2 -1
- package/src/index.jsx +7 -4
- package/src/resolver-common.vue +3 -0
- package/src/theme/element/components/tabs.scss +1 -1
- package/src/utils/render.jsx +5 -5
package/package.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import ChildDialog from './src/index.vue'
|
|
2
|
+
import { createVNode, render } from 'vue'
|
|
3
|
+
|
|
4
|
+
let instance = null
|
|
5
|
+
|
|
6
|
+
export function openChildDialog(options = {}, appContext) {
|
|
7
|
+
if (instance) {
|
|
8
|
+
Object.keys(options).forEach(key => {
|
|
9
|
+
instance.props[key] = options[key]
|
|
10
|
+
|
|
11
|
+
instance.vm.exposed.dialogVisible.value = true
|
|
12
|
+
})
|
|
13
|
+
return instance.close
|
|
14
|
+
}
|
|
15
|
+
const container = document.createElement('div')
|
|
16
|
+
const vnode = createVNode(ChildDialog, {
|
|
17
|
+
...options,
|
|
18
|
+
})
|
|
19
|
+
vnode.appContext = appContext
|
|
20
|
+
render(vnode, container)
|
|
21
|
+
document.body.appendChild(container.firstElementChild)
|
|
22
|
+
|
|
23
|
+
instance = {
|
|
24
|
+
vnode,
|
|
25
|
+
vm: vnode.component,
|
|
26
|
+
props: vnode.component?.props,
|
|
27
|
+
close: () => {
|
|
28
|
+
vnode.component.exposed.dialogVisible.value = false
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
vnode.component.exposed.dialogVisible.value = true
|
|
32
|
+
return instance.close
|
|
33
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, defineAsyncComponent, ref } from 'vue';
|
|
3
|
+
import { ElDialog } from 'element-plus';
|
|
4
|
+
const Resolver = defineAsyncComponent(() => import('../../../resolver-web.vue'))
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
busiIdentityId: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ''
|
|
10
|
+
},
|
|
11
|
+
// 请求方法的实列
|
|
12
|
+
axiosInstance: {
|
|
13
|
+
type: [Object, Function],
|
|
14
|
+
default: () => null
|
|
15
|
+
},
|
|
16
|
+
// config的额外属性配置
|
|
17
|
+
polyfillConfigs: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default: () => ({})
|
|
20
|
+
},
|
|
21
|
+
axiosConfig: {
|
|
22
|
+
type: Object,
|
|
23
|
+
default: null
|
|
24
|
+
},
|
|
25
|
+
lang: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'zh'
|
|
28
|
+
},
|
|
29
|
+
loadEvnetsReq: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: () => ({})
|
|
32
|
+
},
|
|
33
|
+
rootStoreChange: Function
|
|
34
|
+
})
|
|
35
|
+
const formData = ref({})
|
|
36
|
+
const dialogVisible = ref(true)
|
|
37
|
+
const rootOptionComp = ref({})
|
|
38
|
+
const dialogHeight = computed(() => {
|
|
39
|
+
return rootOptionComp.value?.widgetHeight
|
|
40
|
+
})
|
|
41
|
+
const dialogWidth = computed(() => {
|
|
42
|
+
return rootOptionComp.value?.widgetWidth
|
|
43
|
+
})
|
|
44
|
+
const dialogStyle = computed(() => {
|
|
45
|
+
return {color: 'red', 'height': dialogHeight}
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
function loadedConfigCompeted(pageConfig) {
|
|
49
|
+
rootOptionComp.value = pageConfig.rootOptionComp
|
|
50
|
+
}
|
|
51
|
+
function rootStoreChange(rootStore) {
|
|
52
|
+
props.rootStoreChange(rootStore)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
defineExpose({
|
|
57
|
+
dialogVisible
|
|
58
|
+
})
|
|
59
|
+
</script>
|
|
60
|
+
<template>
|
|
61
|
+
<ElDialog class="open-child-frame" v-model="dialogVisible"
|
|
62
|
+
:style="dialogStyle"
|
|
63
|
+
:close-on-click-modal="false" :width="dialogWidth"
|
|
64
|
+
>
|
|
65
|
+
<div>
|
|
66
|
+
</div>
|
|
67
|
+
<Resolver v-if="dialogVisible" ref="resolverRef"
|
|
68
|
+
@loadedConfigCompeted="loadedConfigCompeted"
|
|
69
|
+
@rootStoreChange="rootStoreChange"
|
|
70
|
+
v-model="formData"
|
|
71
|
+
:busiIdentityId="busiIdentityId"
|
|
72
|
+
:lang="props.lang"
|
|
73
|
+
:loadEvnetsReq="props.loadEvnetsReq"
|
|
74
|
+
:polyfillConfigs="props.polyfillConfigs"
|
|
75
|
+
:axiosInstance="props.axiosInstance"
|
|
76
|
+
:axiosConfig="props.axiosConfig"
|
|
77
|
+
></Resolver>
|
|
78
|
+
</ElDialog>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<style lang="scss">
|
|
82
|
+
.open-child-frame {
|
|
83
|
+
overflow-y: auto;
|
|
84
|
+
&.el-dialog {
|
|
85
|
+
margin-top: 30px !important;
|
|
86
|
+
margin-bottom: 30px;
|
|
87
|
+
iframe {
|
|
88
|
+
border: 1px solid #dee0e3;
|
|
89
|
+
height: 80vh;
|
|
90
|
+
width: 100%;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getRelateConfigKeys } from "../../rules/ruleUtils"
|
|
2
|
+
import { openChildDialog } from "../childDialog"
|
|
2
3
|
|
|
3
4
|
export async function dispatchClickEvents ({serviceList = [], axiosInstance, dynamicMapComp, rootValue, dynamicHireRelat, messageInstance}) {
|
|
4
5
|
const dynamicMapCompKeys = Object.keys(dynamicMapComp)
|
|
@@ -25,12 +26,12 @@ export async function dispatchClickEvent(service, { dynamicMapComp, rootValue, d
|
|
|
25
26
|
method: "post",
|
|
26
27
|
data: reqData
|
|
27
28
|
}))
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
ret.data = {result: {pageTotalCount: 100, result: [{},{},{},{},{}]}}
|
|
29
|
+
if (!ret?.data?.success) {
|
|
30
|
+
messageInstance?.value?.error(ret?.data?.resultMessage || '')
|
|
31
|
+
await Promise.reject()
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
// ret.data = {result: {pageTotalCount: 100, result: [{},{},{},{},{}]}}
|
|
34
35
|
initOutParamData(service.outParamMappingList, {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult: ret.data})
|
|
35
36
|
if (tableConfig?.vm) {
|
|
36
37
|
const total = parseInt(ret.data?.result?.[service.pageTotalCount || 'pageTotalCount'])
|
|
@@ -98,4 +99,59 @@ export function getTableConfig(outParamMappingList = [], { dynamicMapComp, dynam
|
|
|
98
99
|
return compConfig
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
|
-
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function openDailg({
|
|
105
|
+
pagePopupMap,
|
|
106
|
+
axiosInstance,
|
|
107
|
+
rootValue,
|
|
108
|
+
dynamicMapComp,
|
|
109
|
+
dynamicHireRelat,
|
|
110
|
+
messageInstance,
|
|
111
|
+
lang,
|
|
112
|
+
appContext,
|
|
113
|
+
}) {
|
|
114
|
+
const busiIdentityId = pagePopupMap.popupBusiIdentityId
|
|
115
|
+
const dynamicMapCompKeys = Object.keys(dynamicMapComp)
|
|
116
|
+
const reqData = getReqData(pagePopupMap.inParamMappingList || [], {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat})
|
|
117
|
+
|
|
118
|
+
const outParamMappingList = pagePopupMap?.outParamMappingList?.map(item => {
|
|
119
|
+
return {
|
|
120
|
+
...item,
|
|
121
|
+
orignParam: item.orignParam ? item.orignParam.split('->')[0] : ''
|
|
122
|
+
}
|
|
123
|
+
}) || []
|
|
124
|
+
|
|
125
|
+
let rootStore = {}
|
|
126
|
+
let dialogClose = null
|
|
127
|
+
const polyfillConfigs = {}
|
|
128
|
+
if (pagePopupMap.outDisplayTrigger) {
|
|
129
|
+
polyfillConfigs[pagePopupMap.outDisplayTrigger] = (config) => {
|
|
130
|
+
return {
|
|
131
|
+
onClick() {
|
|
132
|
+
initOutParamData(outParamMappingList, {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult: rootStore.tableSelectedInfo})
|
|
133
|
+
dialogClose?.()
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (pagePopupMap.closedTrigger) {
|
|
139
|
+
polyfillConfigs[pagePopupMap.closedTrigger] = (config) => {
|
|
140
|
+
return {
|
|
141
|
+
onClick() {
|
|
142
|
+
dialogClose?.()
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
dialogClose = openChildDialog({
|
|
148
|
+
busiIdentityId,
|
|
149
|
+
axiosInstance: axiosInstance?.value,
|
|
150
|
+
lang,
|
|
151
|
+
loadEvnetsReq: reqData,
|
|
152
|
+
polyfillConfigs,
|
|
153
|
+
rootStoreChange: (val) => {
|
|
154
|
+
rootStore = val
|
|
155
|
+
}
|
|
156
|
+
}, appContext)
|
|
157
|
+
}
|
|
@@ -76,10 +76,10 @@ const stopPropagation = (e) => {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
const component = computed(() => {
|
|
79
|
-
return props.config.needWrap ? ElCard : 'div'
|
|
79
|
+
return (props.config.needWrap === true || props.config.needWrap === '1') ? ElCard : 'div'
|
|
80
80
|
})
|
|
81
81
|
const componentProps = computed(() => {
|
|
82
|
-
return props.config.needWrap ? {
|
|
82
|
+
return (props.config.needWrap === true || props.config.needWrap === '1') ? {
|
|
83
83
|
shadow: 'never'
|
|
84
84
|
} : {}
|
|
85
85
|
})
|
|
@@ -6,6 +6,7 @@ import { commonPropsType, TABLE_COLUMN_NOT_RENDER_META_TYPE, DISPLAY_SHOW, compa
|
|
|
6
6
|
import '../styles/CustomComponenTable.scss'
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
|
+
inheritAttrs: false,
|
|
9
10
|
name: 'CustomComponentTable',
|
|
10
11
|
props: {
|
|
11
12
|
...commonPropsType,
|
|
@@ -50,6 +51,7 @@ export default {
|
|
|
50
51
|
return getCompEvents(ElPagination)
|
|
51
52
|
})
|
|
52
53
|
|
|
54
|
+
const rootStore = inject('_rootStore', {})
|
|
53
55
|
const lang = inject('lang')
|
|
54
56
|
const rootValue = inject('rootValue')
|
|
55
57
|
const selects = inject('selects')
|
|
@@ -240,10 +242,12 @@ export default {
|
|
|
240
242
|
const currentChange = (row) => {
|
|
241
243
|
selectedRow.value = row
|
|
242
244
|
tableEvents?.onCurrentChange?.(row)
|
|
245
|
+
rootStore.tableSelectedInfo = row
|
|
243
246
|
}
|
|
244
247
|
const multipleSelection = ref([])
|
|
245
248
|
const handleSelectionChange = (val) => {
|
|
246
249
|
multipleSelection.value = val
|
|
250
|
+
rootStore.tableSelectedInfo = val
|
|
247
251
|
}
|
|
248
252
|
|
|
249
253
|
// 是否配置分页功能 ====== start======
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ElButton @click="buttonAction" v-bind="{...
|
|
2
|
+
<ElButton @click.stop="buttonAction" v-bind="{...calcAttrs, ...calcPorps}">
|
|
3
3
|
{{label}}
|
|
4
4
|
</ElButton>
|
|
5
5
|
</template>
|
|
@@ -8,9 +8,12 @@ import { ElButton } from 'element-plus'
|
|
|
8
8
|
import { defineProps, inject, getCurrentInstance, computed, useAttrs } from 'vue'
|
|
9
9
|
import { commonPropsType } from '../../utils/index.js'
|
|
10
10
|
import { useRoute } from 'vue-router'
|
|
11
|
-
import { dispatchClickEvents } from '../helper/button.js';
|
|
11
|
+
import { dispatchClickEvents, openDailg } from '../helper/button.js';
|
|
12
12
|
import { getRelateConfigKeys } from '../../rules/ruleUtils.js';
|
|
13
13
|
|
|
14
|
+
defineOptions({
|
|
15
|
+
inheritAttrs: false
|
|
16
|
+
})
|
|
14
17
|
const appContext = getCurrentInstance()?.appContext
|
|
15
18
|
|
|
16
19
|
const props = defineProps({
|
|
@@ -32,7 +35,7 @@ const calcPorps = computed(() => {
|
|
|
32
35
|
} else {
|
|
33
36
|
ret.circle = false
|
|
34
37
|
}
|
|
35
|
-
if (props?.config?.rounds && props?.config?.rounds == '1') {
|
|
38
|
+
if (props?.config?.rounds === true && props?.config?.rounds == '1') {
|
|
36
39
|
ret.round = true
|
|
37
40
|
}
|
|
38
41
|
if (props?.config?.widgetSize) {
|
|
@@ -45,6 +48,13 @@ const calcPorps = computed(() => {
|
|
|
45
48
|
})
|
|
46
49
|
|
|
47
50
|
const attrs = useAttrs()
|
|
51
|
+
const calcAttrs = computed(() => {
|
|
52
|
+
const props = {
|
|
53
|
+
...attrs,
|
|
54
|
+
}
|
|
55
|
+
delete props.onClick
|
|
56
|
+
return props
|
|
57
|
+
})
|
|
48
58
|
|
|
49
59
|
const lang = inject('lang')
|
|
50
60
|
|
|
@@ -79,7 +89,6 @@ const buttonAction = (...arg) => {
|
|
|
79
89
|
rootForm,
|
|
80
90
|
routeQuery
|
|
81
91
|
}, appContext)
|
|
82
|
-
|
|
83
92
|
const PageServiceMapVOList = props.config.lcpPageServiceMapVOList
|
|
84
93
|
if (PageServiceMapVOList?.length) {
|
|
85
94
|
const dynamicHireRelat = props.config?.dynamicHireRelat
|
|
@@ -92,5 +101,19 @@ const buttonAction = (...arg) => {
|
|
|
92
101
|
messageInstance
|
|
93
102
|
})
|
|
94
103
|
}
|
|
104
|
+
const lcpPagePopupMapVO = props.config.lcpPagePopupMapVO
|
|
105
|
+
if (lcpPagePopupMapVO) {
|
|
106
|
+
const dynamicHireRelat = props.config?.dynamicHireRelat
|
|
107
|
+
openDailg({
|
|
108
|
+
pagePopupMap: lcpPagePopupMapVO,
|
|
109
|
+
axiosInstance: _axiosInstance,
|
|
110
|
+
rootValue: rootValue?.value,
|
|
111
|
+
dynamicMapComp,
|
|
112
|
+
dynamicHireRelat,
|
|
113
|
+
messageInstance,
|
|
114
|
+
appContext,
|
|
115
|
+
lang: lang?.value
|
|
116
|
+
})
|
|
117
|
+
}
|
|
95
118
|
}
|
|
96
119
|
</script>
|