resolver-egretimp-plus 0.1.126 → 0.1.127
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 +18 -18
- package/dist/web/index.js +19 -19
- package/package.json +1 -1
- package/src/analysisComponent.jsx +17 -5
- package/src/components/lazyLoadComponent/index.js +2 -0
- package/src/components/lazyLoadComponent/src/LazyLoadComponent.jsx +71 -29
- package/src/components/lazyLoadComponent/src/LazyLoadSkeleton.vue +112 -0
- package/src/components/packages-web/CustomComponentCycle.vue +4 -2
- package/src/components/packages-web/CustomComponentCycleTabPane.vue +1 -1
- package/src/components/packages-web/CustomComponentNativeTabPane.vue +1 -1
- package/src/components/packages-web/CustomComponentSelectEmployees.vue +2 -2
- package/src/components/packages-web/CustomComponentTable.jsx +3 -1
- package/src/components/packages-web/CustomComponentTabs.vue +2 -2
- package/src/hooks/index.js +5 -4
- package/src/hooks/pageConfig.js +2 -0
- package/src/index.jsx +11 -2
- package/src/renderer.jsx +2 -1
- package/src/rules/eventsSupplement.js +13 -15
- package/src/rules/ruleUtils.js +1 -1
- package/src/rules/rulesDriver.js +16 -3
- package/src/rulesOfDate/eventsSupplement.js +107 -31
- package/src/rulesOfDate/ruleUtils.js +1 -1
- package/src/rulesOfDate/rulesDriver.js +8 -4
- package/src/utils/render.jsx +60 -10
- package/src/utils/validateByData.js +4 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { computed, defineAsyncComponent, getCurrentInstance, inject, onBeforeMou
|
|
|
2
2
|
import { COFNGI_KEY_EVENT_FLAG, commonPropsType, definePrivatelyProp, EXECTE_CLICK_EVENT_COMPONENTS, findComponent, getComponentPropsKeys, getComponentSolt, hasOwn, isPlainObject } from './utils/index.js'
|
|
3
3
|
import { useVmodels } from './hooks/index.js'
|
|
4
4
|
import { getRenderComponentProps, generateFormItemPolyfill } from './utils/index.js'
|
|
5
|
-
import rulesDriver from './rules/rulesDriver'
|
|
5
|
+
import rulesDriver, { recoverCb } from './rules/rulesDriver'
|
|
6
6
|
import { penddingRules } from './rules/ruleUtils.js'
|
|
7
7
|
import { useRoute } from 'vue-router'
|
|
8
8
|
import { executeEventOrchestration } from './components/helper/eventOrchestration.js'
|
|
@@ -10,7 +10,6 @@ import { useRouter } from 'vue-router'
|
|
|
10
10
|
import { onErrorCaptured } from 'vue'
|
|
11
11
|
import LoadingComponent from './components/loadingComponent/LoadingComponent.vue'
|
|
12
12
|
import { useConfigLoad } from './hooks/configLoad.js'
|
|
13
|
-
import { OPEN_DATA_RULES } from './config.js'
|
|
14
13
|
|
|
15
14
|
export default {
|
|
16
15
|
name: 'AnalysisComponent',
|
|
@@ -76,6 +75,7 @@ export default {
|
|
|
76
75
|
const rootValue = inject('rootValue')
|
|
77
76
|
const validate = inject('_validate')
|
|
78
77
|
const lang = inject('lang')
|
|
78
|
+
const OPEN_DATA_RULES = inject('OPEN_DATA_RULES')
|
|
79
79
|
|
|
80
80
|
const selects = inject('selects')
|
|
81
81
|
const _parentRootValue = inject('_parentRootValue')
|
|
@@ -137,7 +137,7 @@ export default {
|
|
|
137
137
|
const rules = context.rules
|
|
138
138
|
delete context.rules
|
|
139
139
|
setTimeout(() => {
|
|
140
|
-
rulesDriver.call(context, rules)
|
|
140
|
+
rulesDriver.call(context, rules, false, OPEN_DATA_RULES)
|
|
141
141
|
}, 0)
|
|
142
142
|
})
|
|
143
143
|
penddingRules[hireRelat] = null
|
|
@@ -177,9 +177,19 @@ export default {
|
|
|
177
177
|
console.error('onVnodeUnmounted error,', error, props.config)
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
+
// 清除事件中不满足条件的触发逻辑
|
|
181
|
+
const dynamicHireRelat = props?.config?.dynamicHireRelat || ''
|
|
182
|
+
const delKeys = Object.keys(recoverCb).filter(key => {
|
|
183
|
+
return key.endsWith(dynamicHireRelat)
|
|
184
|
+
})
|
|
185
|
+
if (delKeys.length) {
|
|
186
|
+
delKeys.forEach(key => {
|
|
187
|
+
delete recoverCb[key]
|
|
188
|
+
})
|
|
189
|
+
}
|
|
180
190
|
}
|
|
181
191
|
|
|
182
|
-
const { vModelObjs, initVmodels, modelValue } = useVmodels(props, emit) // 过个v-model绑定对象,实现可以组件过赋值
|
|
192
|
+
const { vModelObjs, initVmodels, modelValue } = useVmodels(props, emit, OPEN_DATA_RULES) // 过个v-model绑定对象,实现可以组件过赋值
|
|
183
193
|
|
|
184
194
|
definePrivatelyProp(props.config, 'refValue', modelValue)
|
|
185
195
|
// onBeforeMount(() => {
|
|
@@ -321,10 +331,12 @@ export default {
|
|
|
321
331
|
rootValue,
|
|
322
332
|
dynamicMapComp,
|
|
323
333
|
props,
|
|
324
|
-
messageInstance: messageInstance?.value
|
|
334
|
+
messageInstance: messageInstance?.value,
|
|
335
|
+
OPEN_DATA_RULES,
|
|
325
336
|
}) // 生成formItem()的辅助函数
|
|
326
337
|
return formItemPolyfill(
|
|
327
338
|
<currentComponent.value
|
|
339
|
+
key={props.config.metaCode}
|
|
328
340
|
ref={refFn}
|
|
329
341
|
onVnodeMounted={onVnodeMounted}
|
|
330
342
|
onVnodeUnmounted={onVnodeUnmounted}
|
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import { onMounted,
|
|
1
|
+
import { onMounted, onBeforeUnmount, reactive, ref, TransitionGroup, withDirectives } from "vue"
|
|
2
2
|
import './LazyLoadComponent.scss'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
+
inheritAttrs: false,
|
|
5
6
|
name: 'LazyLoadComponent',
|
|
7
|
+
emits: [
|
|
8
|
+
'beforeInit',
|
|
9
|
+
'init',
|
|
10
|
+
'before-enter',
|
|
11
|
+
'before-leave',
|
|
12
|
+
'after-enter',
|
|
13
|
+
'after-leave',
|
|
14
|
+
],
|
|
6
15
|
props: {
|
|
16
|
+
config: Object,
|
|
7
17
|
timeout: {
|
|
8
18
|
type: Number
|
|
9
19
|
},
|
|
10
20
|
tagName: {
|
|
11
21
|
type: String,
|
|
12
|
-
default: '
|
|
22
|
+
default: ''
|
|
13
23
|
},
|
|
14
24
|
viewport: {
|
|
15
25
|
type: typeof window !== 'undefined' ? window.HTMLElement : Object,
|
|
@@ -28,7 +38,8 @@ export default {
|
|
|
28
38
|
default: 50
|
|
29
39
|
}
|
|
30
40
|
},
|
|
31
|
-
setup(props, { slots, emit }) {
|
|
41
|
+
setup(props, { slots, emit, attrs }) {
|
|
42
|
+
const randomKey = Math.random()
|
|
32
43
|
const el = ref(null)
|
|
33
44
|
let timer = null
|
|
34
45
|
let io = null
|
|
@@ -46,15 +57,17 @@ export default {
|
|
|
46
57
|
}
|
|
47
58
|
|
|
48
59
|
function intersectionHandler (entries) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
entries?.forEach(item => {
|
|
61
|
+
if (
|
|
62
|
+
// 正在交叉
|
|
63
|
+
item.isIntersecting ||
|
|
64
|
+
// 交叉率大于0
|
|
65
|
+
item.intersectionRatio
|
|
66
|
+
) {
|
|
67
|
+
toInit()
|
|
68
|
+
io?.unobserve(el.value)
|
|
69
|
+
}
|
|
70
|
+
})
|
|
58
71
|
}
|
|
59
72
|
|
|
60
73
|
function requestAnimationFrame (callback) {
|
|
@@ -70,7 +83,6 @@ export default {
|
|
|
70
83
|
}
|
|
71
84
|
// 处理组件和骨架组件的切换
|
|
72
85
|
function toInit () {
|
|
73
|
-
debugger
|
|
74
86
|
// 此时说明骨架组件即将被切换
|
|
75
87
|
emit('beforeInit')
|
|
76
88
|
|
|
@@ -85,7 +97,27 @@ export default {
|
|
|
85
97
|
})
|
|
86
98
|
}
|
|
87
99
|
|
|
88
|
-
|
|
100
|
+
function bindElement(e) {
|
|
101
|
+
if (e) {
|
|
102
|
+
io && el.value && io.unobserve(el.value)
|
|
103
|
+
// 这边是兼容元素已经在视图区域了,但是IntersectionObserver回调没有触发的情况(不知道为什么)======start======
|
|
104
|
+
// const rect = e?.getBoundingClientRect()
|
|
105
|
+
// if (rect.top || rect.bottom) {
|
|
106
|
+
// requestAnimationFrame(() => {
|
|
107
|
+
// data.isInit = true
|
|
108
|
+
// emit('init')
|
|
109
|
+
// })
|
|
110
|
+
// return
|
|
111
|
+
// }
|
|
112
|
+
// 这边是兼容元素已经在视图区域了,但是IntersectionObserver回调没有触发的情况(不知道为什么)======end======
|
|
113
|
+
el.value = e
|
|
114
|
+
if (!data.isInit) {
|
|
115
|
+
mountedHandler()
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function mountedHandler() {
|
|
89
121
|
if (!props.timeout) {
|
|
90
122
|
// 根据滚动方向来构造视口外边距,用于提前加载
|
|
91
123
|
let rootMargin
|
|
@@ -103,35 +135,45 @@ export default {
|
|
|
103
135
|
io = new window.IntersectionObserver(intersectionHandler, {
|
|
104
136
|
rootMargin,
|
|
105
137
|
root: props.viewport,
|
|
106
|
-
threshold: [0, Number.MIN_VALUE, 0.01]
|
|
138
|
+
threshold: [0, Number.MIN_VALUE, 0.01, 0.25, 0.5, 0.75, 1]
|
|
107
139
|
});
|
|
108
140
|
io.observe(el.value);
|
|
109
141
|
} catch (e) {
|
|
110
142
|
toInit()
|
|
111
143
|
}
|
|
112
144
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// onMounted(mountedHandler)
|
|
148
|
+
|
|
149
|
+
onBeforeUnmount(() => {
|
|
115
150
|
if (io) {
|
|
116
|
-
|
|
151
|
+
console.log('props.config=:', props.config)
|
|
152
|
+
io?.disconnect()
|
|
117
153
|
}
|
|
118
154
|
})
|
|
119
155
|
|
|
120
|
-
return () => (
|
|
121
|
-
<TransitionGroup
|
|
156
|
+
return () => (<>
|
|
157
|
+
{/* <TransitionGroup tag={props.tagName}
|
|
122
158
|
onBeforeEnter={(el) => emit('before-enter', el)}
|
|
123
|
-
|
|
159
|
+
onBeforeLeave={(el) => emit('before-leave', el)}
|
|
124
160
|
onAfterEnter={(el) => emit('after-enter', el)}
|
|
125
161
|
onAfterLeave={(el) => emit('after-leave', el)}
|
|
126
|
-
>
|
|
162
|
+
> */}
|
|
163
|
+
|
|
127
164
|
{
|
|
128
|
-
data.isInit ?
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
165
|
+
!data.isInit ?
|
|
166
|
+
(<div style="width: 100%" key={randomKey} ref={bindElement}>
|
|
167
|
+
{
|
|
168
|
+
slots?.skeleton ?
|
|
169
|
+
slots?.skeleton() :
|
|
170
|
+
null
|
|
171
|
+
}
|
|
172
|
+
</div>) :
|
|
173
|
+
slots?.default(data.loading)
|
|
174
|
+
|
|
133
175
|
}
|
|
134
|
-
</TransitionGroup>
|
|
135
|
-
)
|
|
176
|
+
{/* </TransitionGroup> */}
|
|
177
|
+
</>)
|
|
136
178
|
}
|
|
137
179
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="[
|
|
4
|
+
'skeleton-item',
|
|
5
|
+
`skeleton-${type}`,
|
|
6
|
+
animated && 'skeleton-animated'
|
|
7
|
+
]"
|
|
8
|
+
:style="computedStyle"
|
|
9
|
+
>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { computed } from 'vue';
|
|
16
|
+
|
|
17
|
+
defineOptions({
|
|
18
|
+
name: 'LazyLoadSkeleton'
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
type: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'text',
|
|
25
|
+
validator: (value) => ['text', 'avatar', 'image', 'button'].includes(value)
|
|
26
|
+
},
|
|
27
|
+
width: {
|
|
28
|
+
type: [String, Number],
|
|
29
|
+
default: '100%'
|
|
30
|
+
},
|
|
31
|
+
height: {
|
|
32
|
+
type: [String, Number],
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
animated: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true
|
|
38
|
+
},
|
|
39
|
+
round: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const computedStyle = computed(() => {
|
|
46
|
+
const style = {};
|
|
47
|
+
|
|
48
|
+
if (props.width) {
|
|
49
|
+
style.width = isNaN(props.width) ? props.width : `${props.width}px`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (props.height) {
|
|
53
|
+
style.height = isNaN(props.height) ? props.height : `${props.height}px`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (props.round) {
|
|
57
|
+
style.borderRadius = '50%';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return style;
|
|
61
|
+
});
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style scoped>
|
|
65
|
+
/* 基础样式和动画实现 */
|
|
66
|
+
.skeleton-item {
|
|
67
|
+
background: #f0f0f0;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
position: relative;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.skeleton-text {
|
|
73
|
+
height: 16px;
|
|
74
|
+
border-radius: 4px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.skeleton-avatar {
|
|
78
|
+
width: 40px;
|
|
79
|
+
height: 40px;
|
|
80
|
+
border-radius: 50%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.skeleton-button {
|
|
84
|
+
height: 36px;
|
|
85
|
+
border-radius: 4px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.skeleton-animated::after {
|
|
89
|
+
content: '';
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: 0;
|
|
92
|
+
left: 0;
|
|
93
|
+
right: 0;
|
|
94
|
+
bottom: 0;
|
|
95
|
+
background: linear-gradient(
|
|
96
|
+
90deg,
|
|
97
|
+
rgba(255, 255, 255, 0) 0%,
|
|
98
|
+
rgba(255, 255, 255, 0.6) 50%,
|
|
99
|
+
rgba(255, 255, 255, 0) 100%
|
|
100
|
+
);
|
|
101
|
+
animation: shimmer 1.5s infinite;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@keyframes shimmer {
|
|
105
|
+
0% {
|
|
106
|
+
transform: translateX(-100%);
|
|
107
|
+
}
|
|
108
|
+
100% {
|
|
109
|
+
transform: translateX(100%);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
</style>
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
</template>
|
|
13
13
|
<script setup>
|
|
14
|
-
import { computed, defineModel, watch, reactive } from 'vue'
|
|
14
|
+
import { computed, defineModel, watch, reactive, inject } from 'vue'
|
|
15
15
|
import { commonPropsType, cloneDeep, definePrivatelyProp } from '../../utils/index.js'
|
|
16
16
|
import { ElRow, ElCard } from 'element-plus'
|
|
17
17
|
import Renderer from '../../renderer.jsx'
|
|
18
|
-
import {
|
|
18
|
+
import { normalRecoverCb } from '../../rules/rulesDriver.js'
|
|
19
19
|
|
|
20
|
+
const OPEN_DATA_RULES = inject('OPEN_DATA_RULES')
|
|
20
21
|
// const lang = inject('lang')
|
|
21
22
|
const modelValue = defineModel()
|
|
22
23
|
// setTimeout(() => {
|
|
@@ -59,6 +60,7 @@ if (!OPEN_DATA_RULES) {
|
|
|
59
60
|
if (rowCgs) {
|
|
60
61
|
rowCgs.forEach(config => {
|
|
61
62
|
config.rowIndex = idx
|
|
63
|
+
normalRecoverCb(config, idx)
|
|
62
64
|
})
|
|
63
65
|
return rowCgs
|
|
64
66
|
} else {
|
|
@@ -40,11 +40,11 @@ import { commonPropsType, cloneDeep, definePrivatelyProp } from '../../utils/ind
|
|
|
40
40
|
import { TabPane } from '../tabs'
|
|
41
41
|
import { h } from 'vue'
|
|
42
42
|
import { useAttrs } from 'vue'
|
|
43
|
-
import { OPEN_DATA_RULES } from '../../config.js'
|
|
44
43
|
|
|
45
44
|
defineOptions({
|
|
46
45
|
inheritAttrs: false
|
|
47
46
|
})
|
|
47
|
+
const OPEN_DATA_RULES = inject('OPEN_DATA_RULES')
|
|
48
48
|
const attrs = useAttrs()
|
|
49
49
|
const props = defineProps({
|
|
50
50
|
...commonPropsType,
|
|
@@ -28,8 +28,8 @@ import { computed, inject, useAttrs, useSlots } from 'vue'
|
|
|
28
28
|
import { commonPropsType } from '../../utils/index.js'
|
|
29
29
|
import { TabPane } from '../tabs'
|
|
30
30
|
import { h } from 'vue'
|
|
31
|
-
import { OPEN_DATA_RULES } from '../../config.js'
|
|
32
31
|
|
|
32
|
+
const OPEN_DATA_RULES = inject('OPEN_DATA_RULES')
|
|
33
33
|
const slots = useSlots()
|
|
34
34
|
const props = defineProps({
|
|
35
35
|
...commonPropsType,
|
|
@@ -27,7 +27,7 @@ const props = defineProps({
|
|
|
27
27
|
},
|
|
28
28
|
// ====start==== 按部门查找人员,type为user时有效,结构为{deptIds:'xxx,yyy', cascade: true, excludeDeptIds:'xxx,yyy'}, deptIds为部门ID(如有多个用英文逗号分隔),cascade为是否包含下级部门人员, excludeDeptIds为除外部门ID(如有多个用英文逗号分隔)
|
|
29
29
|
cascade: {
|
|
30
|
-
type: Boolean,
|
|
30
|
+
type: [Boolean, String],
|
|
31
31
|
default: true
|
|
32
32
|
},
|
|
33
33
|
deptIds: {
|
|
@@ -107,7 +107,7 @@ const initSelEmployee = async () => {
|
|
|
107
107
|
if (props.deptIds || props.excludeDeptIds) {
|
|
108
108
|
deptForUser.deptIds = isString(props.deptIds) ? props.deptIds : ''
|
|
109
109
|
deptForUser.excludeDeptIds = isString(props.excludeDeptIds) ? props.excludeDeptIds : ''
|
|
110
|
-
deptForUser.cascade = isBoolean(props.cascade) ? props.cascade :
|
|
110
|
+
deptForUser.cascade = isBoolean(props.cascade) ? props.cascade : props.cascade == '1'
|
|
111
111
|
}
|
|
112
112
|
const initParams = {
|
|
113
113
|
el: `#${metaCode.value}`,
|
|
@@ -5,7 +5,7 @@ import Renderer from '../../renderer.jsx'
|
|
|
5
5
|
import { computed, inject, watch, h, ref, reactive, onMounted, unref } from 'vue'
|
|
6
6
|
import { commonPropsType, TABLE_COLUMN_NOT_RENDER_META_TYPE, DISPLAY_SHOW, compareComponet, isPlainObject, hasOwn, cloneDeep, isPromise, isPlainColumn, generateUniqueId, calcDisable, camelize, capitalize, DISPLAY_HIDDEN, definePrivatelyProp, isArray, eleIsOverflow } from '../../utils/index.js'
|
|
7
7
|
import { getCustomerTableProps, tableValidate } from '../helper/table'
|
|
8
|
-
import { OPEN_TABLE_DEFAULT_PAGINATION
|
|
8
|
+
import { OPEN_TABLE_DEFAULT_PAGINATION } from '../../config'
|
|
9
9
|
// import '../styles/CustomComponenTable.scss'
|
|
10
10
|
|
|
11
11
|
export default {
|
|
@@ -92,6 +92,8 @@ export default {
|
|
|
92
92
|
const selectable = computed(() => {
|
|
93
93
|
return props.config?.selectable == '1' || props.config?.canSelect
|
|
94
94
|
})
|
|
95
|
+
|
|
96
|
+
const OPEN_DATA_RULES = inject('OPEN_DATA_RULES')
|
|
95
97
|
const formContext = inject(formContextKey, undefined)
|
|
96
98
|
const messageInstance = inject('_messageInstance')
|
|
97
99
|
const indectModeRef = inject('indectModeRef', ref(''))
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
import { ElTabs } from 'element-plus'
|
|
11
11
|
import Tabs from '../tabs'
|
|
12
12
|
import Renderer from '../../renderer.jsx'
|
|
13
|
-
import { computed, useAttrs, useSlots } from 'vue'
|
|
13
|
+
import { computed, inject, useAttrs, useSlots } from 'vue'
|
|
14
14
|
import { assertMetaType, commonPropsType, hasOwn } from '../../utils/index.js'
|
|
15
15
|
import { watch } from 'vue'
|
|
16
|
-
import { OPEN_DATA_RULES } from '../../config.js'
|
|
17
16
|
// import * as lib from 'element-plus/es/utils/index.mjs'
|
|
18
17
|
|
|
18
|
+
const OPEN_DATA_RULES = inject('OPEN_DATA_RULES')
|
|
19
19
|
const slots = useSlots()
|
|
20
20
|
const props = defineProps({
|
|
21
21
|
...ElTabs.props,
|
package/src/hooks/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import defaultVal from '../utils/defaultVal.js'
|
|
|
4
4
|
import {definePrivatelyProp, isNonRefType, modelValueDeepMerge } from "../utils"
|
|
5
5
|
|
|
6
6
|
export function useVModel(config, props, emit, modelKey = 'update:modelValue') {
|
|
7
|
-
const { hireRelatMapRules, messageInstance, rootValue, ruleExecuter, dataLoad, dynamicMapComp, lang, _mapComp } = this
|
|
7
|
+
const { OPEN_DATA_RULES, hireRelatMapRules, messageInstance, rootValue, ruleExecuter, dataLoad, dynamicMapComp, lang, _mapComp } = this
|
|
8
8
|
const currentRules = hireRelatMapRules.value[config.hireRelat]
|
|
9
9
|
let metaCodeKey = config.metaCode
|
|
10
10
|
if (modelKey !== 'update:modelValue') {
|
|
@@ -50,7 +50,7 @@ export function useVModel(config, props, emit, modelKey = 'update:modelValue') {
|
|
|
50
50
|
lang,
|
|
51
51
|
_mapComp,
|
|
52
52
|
messageInstance
|
|
53
|
-
}, currentRules, true)
|
|
53
|
+
}, currentRules, true, OPEN_DATA_RULES)
|
|
54
54
|
definePrivatelyProp(config, 'eventInit', true)
|
|
55
55
|
}, 0)
|
|
56
56
|
}
|
|
@@ -126,7 +126,7 @@ export function useVModel(config, props, emit, modelKey = 'update:modelValue') {
|
|
|
126
126
|
lang,
|
|
127
127
|
_mapComp,
|
|
128
128
|
messageInstance
|
|
129
|
-
}, currentRules)
|
|
129
|
+
}, currentRules, false, OPEN_DATA_RULES)
|
|
130
130
|
}, 0)
|
|
131
131
|
}
|
|
132
132
|
}
|
|
@@ -134,7 +134,7 @@ export function useVModel(config, props, emit, modelKey = 'update:modelValue') {
|
|
|
134
134
|
return retModelVale
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
export function useVmodels(props, emit) {
|
|
137
|
+
export function useVmodels(props, emit, OPEN_DATA_RULES) {
|
|
138
138
|
const hireRelatMapRules = inject('hireRelatMapRules')
|
|
139
139
|
const dataLoad = inject('dataLoad')
|
|
140
140
|
const dynamicMapComp = inject('dynamicMapComp')
|
|
@@ -145,6 +145,7 @@ export function useVmodels(props, emit) {
|
|
|
145
145
|
const messageInstance = inject('_messageInstance')
|
|
146
146
|
|
|
147
147
|
const thisObj = {
|
|
148
|
+
OPEN_DATA_RULES,
|
|
148
149
|
hireRelatMapRules,
|
|
149
150
|
dataLoad,
|
|
150
151
|
dynamicMapComp,
|
package/src/hooks/pageConfig.js
CHANGED
|
@@ -11,6 +11,7 @@ export function usePageConfig() {
|
|
|
11
11
|
const hireRelatMapRulesRef = ref(null)
|
|
12
12
|
const mapCompRef = ref(null)
|
|
13
13
|
function initPageConfig({
|
|
14
|
+
OPEN_DATA_RULES,
|
|
14
15
|
components,
|
|
15
16
|
confirmInstance,
|
|
16
17
|
openChildDialogInstance,
|
|
@@ -35,6 +36,7 @@ export function usePageConfig() {
|
|
|
35
36
|
messageCb
|
|
36
37
|
}) {
|
|
37
38
|
const { pageConfig, mapComp, hireRelatMapRules } = parsePageConfig({
|
|
39
|
+
OPEN_DATA_RULES,
|
|
38
40
|
components,
|
|
39
41
|
confirmInstance,
|
|
40
42
|
openChildDialogInstance,
|
package/src/index.jsx
CHANGED
|
@@ -16,6 +16,11 @@ import { OPEN_DATA_RULES } from "./config.js"
|
|
|
16
16
|
export default {
|
|
17
17
|
name: 'Resolver',
|
|
18
18
|
props: {
|
|
19
|
+
// 是否开启根据数据加载组件逻辑
|
|
20
|
+
OPEN_DATA_RULES: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: OPEN_DATA_RULES
|
|
23
|
+
},
|
|
19
24
|
// 传入的自定义组件
|
|
20
25
|
components: {
|
|
21
26
|
type: Object,
|
|
@@ -280,6 +285,7 @@ export default {
|
|
|
280
285
|
resetConfigEventInit(dynamicMapComp)
|
|
281
286
|
const emptyObj = createEmptyCopy(val)
|
|
282
287
|
emit('update:modelValue', emptyObj)
|
|
288
|
+
|
|
283
289
|
setTimeout(() => {
|
|
284
290
|
nativeDataLoad.value = true
|
|
285
291
|
emit('update:modelValue', val)
|
|
@@ -300,6 +306,7 @@ export default {
|
|
|
300
306
|
)
|
|
301
307
|
}
|
|
302
308
|
initPageConfig({
|
|
309
|
+
OPEN_DATA_RULES: props.OPEN_DATA_RULES,
|
|
303
310
|
components: props.components,
|
|
304
311
|
confirmInstance: props.confirmInstance,
|
|
305
312
|
openChildDialogInstance: props.openChildDialogInstance,
|
|
@@ -327,6 +334,7 @@ export default {
|
|
|
327
334
|
|
|
328
335
|
watch(toRef(props, 'config'), () => {
|
|
329
336
|
initPageConfig({
|
|
337
|
+
OPEN_DATA_RULES: props.OPEN_DATA_RULES,
|
|
330
338
|
components: props.components,
|
|
331
339
|
confirmInstance: props.confirmInstance,
|
|
332
340
|
openChildDialogInstance: props.openChildDialogInstance,
|
|
@@ -395,12 +403,13 @@ export default {
|
|
|
395
403
|
provide('_polyfillConfigs', props.polyfillConfigs)
|
|
396
404
|
const requestTraceIdRef = toRef(props, 'requestTraceId')
|
|
397
405
|
provide('requestTraceId', requestTraceIdRef) // 所有渲染器调用的接口,都需要加次参数(生哥提)
|
|
406
|
+
provide('OPEN_DATA_RULES', props.OPEN_DATA_RULES) // 通过 provide 传递此配置给所有子组件
|
|
398
407
|
|
|
399
408
|
const rootForm = ref(null)
|
|
400
409
|
provide('rootForm', rootForm)
|
|
401
410
|
|
|
402
411
|
const validate = (cb) => {
|
|
403
|
-
if (OPEN_DATA_RULES) {
|
|
412
|
+
if (props.OPEN_DATA_RULES) {
|
|
404
413
|
validateByData({
|
|
405
414
|
rootConfig: props.config,
|
|
406
415
|
rootValue: props.modelValue,
|
|
@@ -438,7 +447,7 @@ export default {
|
|
|
438
447
|
emit('update:modelValue', val)
|
|
439
448
|
}
|
|
440
449
|
})
|
|
441
|
-
if (OPEN_DATA_RULES) {
|
|
450
|
+
if (props.OPEN_DATA_RULES) {
|
|
442
451
|
toWatchRules({
|
|
443
452
|
rules: hireRelatMapRulesRef.value,
|
|
444
453
|
rootValue: toRef(props, 'modelValue'),
|
package/src/renderer.jsx
CHANGED
|
@@ -45,6 +45,7 @@ export default {
|
|
|
45
45
|
const loadModuleCache = inject('_loadModuleCache')
|
|
46
46
|
const _isH5 = inject('_isH5')
|
|
47
47
|
const injectMode = inject('injectMode', '')
|
|
48
|
+
const OPEN_DATA_RULES = inject('OPEN_DATA_RULES')
|
|
48
49
|
const mode = props.mode || injectMode
|
|
49
50
|
provide('injectMode', mode)
|
|
50
51
|
|
|
@@ -63,7 +64,7 @@ export default {
|
|
|
63
64
|
if (config?.displayType == DISPLAY_HIDDEN) {
|
|
64
65
|
return null
|
|
65
66
|
}
|
|
66
|
-
if (canHiddenConfig(config)) {
|
|
67
|
+
if (canHiddenConfig(config, OPEN_DATA_RULES)) {
|
|
67
68
|
return null
|
|
68
69
|
}
|
|
69
70
|
const disabled = calcDisable(config, modelRef.value)
|
|
@@ -236,18 +236,16 @@ const allInitEvents = {
|
|
|
236
236
|
const targetObj = `${tabpanelCode ? tabpanelCode + '->' : ''}${target}`
|
|
237
237
|
const configs = getCurrentComp.call(this, targetObj, 'setHidden')
|
|
238
238
|
// const oldDisplayTypes = []
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
})
|
|
250
|
-
}, 0)
|
|
239
|
+
|
|
240
|
+
configs.forEach(labelInfo => {
|
|
241
|
+
// const oldDisplayType = labzelInfo && labelInfo.displayType
|
|
242
|
+
// oldDisplayTypes.push(oldDisplayType)
|
|
243
|
+
// 兼容开始使用displayType用于显示隐藏的配置
|
|
244
|
+
labelInfo && /^\d+$/.test(labelInfo.displayType) && (labelInfo.displayType = '0')
|
|
245
|
+
labelInfo && (labelInfo.hidden = '1')
|
|
246
|
+
labelInfo && labelInfo.refConfig && /^\d+$/.test(labelInfo.refConfig.displayType) && (labelInfo.refConfig.displayType = '0')
|
|
247
|
+
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.hidden = '1')
|
|
248
|
+
})
|
|
251
249
|
|
|
252
250
|
// 有的事件在不满足条件的情况下,需要进行恢复
|
|
253
251
|
return () => {
|
|
@@ -255,7 +253,7 @@ const allInitEvents = {
|
|
|
255
253
|
// const oldDisplayType = oldDisplayTypes[idx]
|
|
256
254
|
labelInfo && /^\d+$/.test(labelInfo.displayType) && (labelInfo.displayType = '1')
|
|
257
255
|
labelInfo && (labelInfo.hidden = '0')
|
|
258
|
-
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.displayType = '1')
|
|
256
|
+
labelInfo && labelInfo.refConfig && /^\d+$/.test(labelInfo.refConfig.displayType) && (labelInfo.refConfig.displayType = '1')
|
|
259
257
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.hidden = '0')
|
|
260
258
|
})
|
|
261
259
|
}
|
|
@@ -271,7 +269,7 @@ const allInitEvents = {
|
|
|
271
269
|
// oldDisplayTypes.push(oldDisplayType)
|
|
272
270
|
labelInfo && /^\d+$/.test(labelInfo.displayType) && (labelInfo.displayType = '1')
|
|
273
271
|
labelInfo && (labelInfo.hidden = '0')
|
|
274
|
-
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.displayType = '1')
|
|
272
|
+
labelInfo && labelInfo.refConfig && /^\d+$/.test(labelInfo.refConfig.displayType) && (labelInfo.refConfig.displayType = '1')
|
|
275
273
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.hidden = '0')
|
|
276
274
|
})
|
|
277
275
|
// 有的事件在不满足条件的情况下,需要进行恢复
|
|
@@ -282,7 +280,7 @@ const allInitEvents = {
|
|
|
282
280
|
// const oldDisplayType = oldDisplayTypes[idx]
|
|
283
281
|
labelInfo && /^\d+$/.test(labelInfo.displayType) && (labelInfo.displayType = '0')
|
|
284
282
|
labelInfo && (labelInfo.hidden = '1')
|
|
285
|
-
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.displayType = '0')
|
|
283
|
+
labelInfo && labelInfo.refConfig && /^\d+$/.test(labelInfo.refConfig.displayType) && (labelInfo.refConfig.displayType = '0')
|
|
286
284
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.hidden = '1')
|
|
287
285
|
})
|
|
288
286
|
}, 0)
|
package/src/rules/ruleUtils.js
CHANGED
|
@@ -159,7 +159,7 @@ function getRelateConfigs(codesStr, config, type) {
|
|
|
159
159
|
})
|
|
160
160
|
retConfigs = list
|
|
161
161
|
}
|
|
162
|
-
if (_mapComp?.value?.[codesStr] && !retConfigs.length) {
|
|
162
|
+
if (_mapComp?.value?.[codesStr] && !(retConfigs.filter(item => item.vmIsBind)).length) {
|
|
163
163
|
if (!penddingRules[codesStr]) {
|
|
164
164
|
penddingRules[codesStr] = []
|
|
165
165
|
}
|