resolver-egretimp-plus 0.1.4 → 0.1.5
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/const/index.js +1 -1
- package/dist/h5/index.js +2 -2
- package/dist/web/index.js +2 -2
- package/package.json +1 -1
- package/src/components/helper/calcTooltip.jsx +2 -1
- package/src/components/helper/eventOrchestration.js +9 -11
- package/src/components/packages-web/ElSelect.jsx +17 -15
- package/src/components/packages-web/ElText.jsx +2 -1
- package/src/utils/const.js +12 -0
- package/src/utils/defaultVal.js +20 -15
- package/src/utils/render.jsx +2 -3
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ export function useToolTip({
|
|
|
6
6
|
offset,
|
|
7
7
|
displayValue,
|
|
8
8
|
calcFn,
|
|
9
|
+
config
|
|
9
10
|
}) {
|
|
10
11
|
const isFocus = ref(false) // 是否是焦点状态
|
|
11
12
|
const isEnter = ref(false) // 鼠标是否在内部
|
|
@@ -102,7 +103,7 @@ export function useToolTip({
|
|
|
102
103
|
} = opt || {}
|
|
103
104
|
const nodeComp = defineComponent(node)
|
|
104
105
|
if (maintain && !showTooltip.value) {
|
|
105
|
-
<nodeComp></nodeComp>
|
|
106
|
+
return <nodeComp></nodeComp>
|
|
106
107
|
}
|
|
107
108
|
return (
|
|
108
109
|
<div class="resolver-calc-contrainer custom-error-tip-block">
|
|
@@ -195,19 +195,17 @@ function getReqData(inParamMappingList = [], {emptyUpdate, dynamicMapComp, dynam
|
|
|
195
195
|
console.error('search arg muti', params, configCodes)
|
|
196
196
|
}
|
|
197
197
|
const configCode = configCodes[0]
|
|
198
|
+
const val = dynamicMapComp?.[configCode]?.refValue
|
|
198
199
|
if (
|
|
199
|
-
configCode &&
|
|
200
200
|
(
|
|
201
201
|
(
|
|
202
|
-
(
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
(
|
|
208
|
-
|
|
209
|
-
!isNull(dynamicMapComp[configCode]?.refValue)
|
|
210
|
-
)
|
|
202
|
+
isUndefined(val) ||
|
|
203
|
+
isNull(val)
|
|
204
|
+
) && emptyUpdate
|
|
205
|
+
) ||
|
|
206
|
+
(
|
|
207
|
+
!isUndefined(val) &&
|
|
208
|
+
!isNull(val)
|
|
211
209
|
)
|
|
212
210
|
) {
|
|
213
211
|
let destParamArr
|
|
@@ -216,7 +214,7 @@ function getReqData(inParamMappingList = [], {emptyUpdate, dynamicMapComp, dynam
|
|
|
216
214
|
} else {
|
|
217
215
|
destParamArr = destParam?.split('.') || []
|
|
218
216
|
}
|
|
219
|
-
assignmentPathVal(ret, destParamArr,
|
|
217
|
+
assignmentPathVal(ret, destParamArr, (isUndefined(val) || isNull(val)) ? '' : val)
|
|
220
218
|
}
|
|
221
219
|
return ret
|
|
222
220
|
}, {})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElSelect, ElOption } from 'element-plus'
|
|
2
2
|
import { computed, inject, onMounted, watch} from 'vue'
|
|
3
|
-
import { commonPropsType, isString } from '../../utils/index.js'
|
|
3
|
+
import { commonPropsType, isArray, isNumber, isPlainObject, isString } from '../../utils/index.js'
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
inheritAttrs: false,
|
|
@@ -29,22 +29,24 @@ export default {
|
|
|
29
29
|
const modelValue = computed({
|
|
30
30
|
get() {
|
|
31
31
|
let val = props.modelValue
|
|
32
|
-
if (
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
if (!props.hidden) {
|
|
33
|
+
if (isStrVal.value) {
|
|
34
|
+
if (isPlainObject(val) || isArray(val)) {
|
|
35
|
+
try {
|
|
36
|
+
val = Object.values(val).join(props.separator)
|
|
37
|
+
emit('update:modelValue', val)
|
|
38
|
+
} catch (error) {
|
|
39
|
+
val = val
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
} else {
|
|
43
|
+
if (isString(val) || isNumber(val)) {
|
|
44
|
+
val = `${val}`?.split(props.separator)
|
|
45
|
+
if (isObject.value) {
|
|
46
|
+
val = val?.reduce((ret, item, idx) => {ret[idx] = item; return ret;}, {})
|
|
47
|
+
}
|
|
48
|
+
emit('update:modelValue', val)
|
|
46
49
|
}
|
|
47
|
-
emit('update:modelValue', val)
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
return val
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
// 是否在超出的时候展示tooltip
|
|
26
26
|
showTooltip: {
|
|
27
27
|
type: [String, Number],
|
|
28
|
-
default: '
|
|
28
|
+
default: '0'
|
|
29
29
|
},
|
|
30
30
|
truncated: {
|
|
31
31
|
type: [String, Number, Boolean],
|
|
@@ -98,6 +98,7 @@ export default {
|
|
|
98
98
|
return offset
|
|
99
99
|
}),
|
|
100
100
|
displayValue: labelDesc,
|
|
101
|
+
config: props.config,
|
|
101
102
|
calcFn(node) {
|
|
102
103
|
return node?.getBoundingClientRect?.()?.width
|
|
103
104
|
}
|
package/src/utils/const.js
CHANGED
|
@@ -104,6 +104,14 @@ export const commonPropsType = {
|
|
|
104
104
|
return config.requiredFlag == '1'
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
+
// 组件是否必填
|
|
108
|
+
hidden: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: false,
|
|
111
|
+
getValue(config, props, modelValue) {
|
|
112
|
+
return isHidden({config})
|
|
113
|
+
}
|
|
114
|
+
},
|
|
107
115
|
// 组件是否展示必填标识
|
|
108
116
|
onlyRequiredFlag: {
|
|
109
117
|
type: [Boolean, String, Number],
|
|
@@ -165,6 +173,10 @@ export const commonPropsType = {
|
|
|
165
173
|
},
|
|
166
174
|
}
|
|
167
175
|
|
|
176
|
+
export function isHidden({config}) {
|
|
177
|
+
return (typeof config.hidden === 'boolean' && config.hidden) || config.hidden == '1' || config.collapseHidden == '1'
|
|
178
|
+
}
|
|
179
|
+
|
|
168
180
|
export function calcDisable(config, mode) {
|
|
169
181
|
const specicesType = [
|
|
170
182
|
'CustomComponentTabs',
|
package/src/utils/defaultVal.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { toRaw } from 'vue'
|
|
1
2
|
import { formatDate } from './common'
|
|
2
3
|
import { ARG_FLAGS } from './const'
|
|
3
4
|
|
|
@@ -6,23 +7,27 @@ export default function defaultVal(config) {
|
|
|
6
7
|
const configDefaultVal = config.defaultVal || config.defaultValue
|
|
7
8
|
let defaultVal = null
|
|
8
9
|
try {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (configDefaultVal === ARG_FLAGS.CURRENT_DATE || configDefaultVal === 'currentDate') {
|
|
20
|
-
defaultVal = formatDate(new Date(), 'yyyy-MM-dd')
|
|
21
|
-
} else if (['true', 'false'].includes(configDefaultVal)) {
|
|
22
|
-
defaultVal = configDefaultVal == 'true' ? true : false
|
|
10
|
+
if (typeof configDefaultVal === 'string') {
|
|
11
|
+
let routeMatchs = null
|
|
12
|
+
if ( typeof configDefaultVal === 'string' && (routeMatchs = configDefaultVal.match(/^_route:(.*)$/))) {
|
|
13
|
+
const queryKey = routeMatchs[1]
|
|
14
|
+
const routeQuery = config?.route?.query
|
|
15
|
+
defaultVal = routeQuery?.[queryKey]
|
|
16
|
+
} else if ( typeof configDefaultVal === 'string' && (/^_lang$/.test(configDefaultVal))) {
|
|
17
|
+
defaultVal = config?._lang
|
|
18
|
+
} else if (/^{[\w\W]*}$/.test(configDefaultVal) || /^\[[\w\W]*\]$/.test(configDefaultVal)) {
|
|
19
|
+
defaultVal = JSON.parse(configDefaultVal)
|
|
23
20
|
} else {
|
|
24
|
-
|
|
21
|
+
if (configDefaultVal === ARG_FLAGS.CURRENT_DATE || configDefaultVal === 'currentDate') {
|
|
22
|
+
defaultVal = formatDate(new Date(), 'yyyy-MM-dd')
|
|
23
|
+
} else if (['true', 'false'].includes(configDefaultVal)) {
|
|
24
|
+
defaultVal = configDefaultVal == 'true' ? true : false
|
|
25
|
+
} else {
|
|
26
|
+
defaultVal = configDefaultVal
|
|
27
|
+
}
|
|
25
28
|
}
|
|
29
|
+
} else {
|
|
30
|
+
defaultVal = toRaw(configDefaultVal)
|
|
26
31
|
}
|
|
27
32
|
console.log(`${config.dynamicHireRelat},${config.hireRelat} to set defaultValue, ${defaultVal}`)
|
|
28
33
|
config.refValue = defaultVal
|
package/src/utils/render.jsx
CHANGED
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
PLAIN_TYPE_ALONG_COLUMNS,
|
|
24
24
|
TRANS_CELL_COMPONETS,
|
|
25
25
|
MODE,
|
|
26
|
+
|
|
27
|
+
isHidden
|
|
26
28
|
} from './const.js'
|
|
27
29
|
import { preserveCheck } from './preserveFunc.js'
|
|
28
30
|
import { isArray, isFunction, isString } from './is.js'
|
|
@@ -1016,9 +1018,6 @@ function isTransCellMobile(config, disabled) {
|
|
|
1016
1018
|
return config?.alwaysNative !== '1' && disabled && findComponent(TRANS_CELL_COMPONETS, config.renderby || config.metaType) !== -1
|
|
1017
1019
|
}
|
|
1018
1020
|
|
|
1019
|
-
function isHidden({config}) {
|
|
1020
|
-
return (typeof config.hidden === 'boolean' && config.hidden) || config.hidden == '1' || config.collapseHidden == '1'
|
|
1021
|
-
}
|
|
1022
1021
|
// 如果父级有一个是hidden了,那就表示hidden了
|
|
1023
1022
|
function isChainHidden({config}) {
|
|
1024
1023
|
if (isHidden({config})) {
|