resolver-egretimp-plus 0.0.44 → 0.0.45
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/web/index.js +1 -1
- package/package.json +1 -1
- package/src/analysisComponent.jsx +2 -1
- package/src/components/cmiFormItem/index.js +1 -0
- package/src/components/cmiFormItem/src/index.vue +106 -0
- package/src/components/packages-H5/CmiCheckbox.vue +2 -12
- package/src/components/packages-H5/CmiInput.vue +1 -1
- package/src/components/packages-H5/CmiSelect.vue +1 -1
- package/src/components/packages-H5/CustomComponentCardH5.vue +2 -2
- package/src/components/packages-H5/CustomComponentTableH5.vue +1 -1
- package/src/components/packages-web/ElInput.vue +3 -0
- package/src/utils/render.jsx +18 -10
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as default} from './src/index.vue'
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, useAttrs } from 'vue';
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
messageInstance: {
|
|
6
|
+
type: [Object, Function],
|
|
7
|
+
default: () => null
|
|
8
|
+
},
|
|
9
|
+
config: [Object, Array],
|
|
10
|
+
lang: String,
|
|
11
|
+
labelWidth: [String, Number]
|
|
12
|
+
})
|
|
13
|
+
const attrs = useAttrs()
|
|
14
|
+
const label = computed(() => {
|
|
15
|
+
if (props.config.labelHidden == '1' || props.config.labelWidth === 0 || props.config.labelWidth === '0') {
|
|
16
|
+
return ''
|
|
17
|
+
}
|
|
18
|
+
return (props.lang.indexOf('zh') > -1 ? props.config.metaNameZh : props.config.metaNameEn) || ''
|
|
19
|
+
})
|
|
20
|
+
const labelWidth = computed(() => {
|
|
21
|
+
if (!!props.config.labelPosition) {
|
|
22
|
+
return props.config.labelPosition
|
|
23
|
+
}
|
|
24
|
+
return 'left'
|
|
25
|
+
})
|
|
26
|
+
function handleClickTip() {
|
|
27
|
+
messageInstance?.text(props.lang.indexOf('zh') > -1 ? props.config.hintContentZh : props.config.hintContentEn)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
</script>
|
|
31
|
+
<template>
|
|
32
|
+
<cmi-form-item v-bind="attrs" class="custom-form-item-h5"
|
|
33
|
+
:class="[{'--required': props.config.requiredFlag == '1', '--label-hide': !labelWidth,
|
|
34
|
+
'--label-text-left': labelPosition === 'left', '--label-text-right': labelPosition === 'right'
|
|
35
|
+
}, customClass]"
|
|
36
|
+
:labelWidth="props.labelWidth"
|
|
37
|
+
>
|
|
38
|
+
<div slot="label" class="custom-label--formItem">
|
|
39
|
+
<div class="custom-label-content">
|
|
40
|
+
<span class="label-required" v-if="props.config.requiredFlag == '1'">*</span>
|
|
41
|
+
<span class="label-text">{{ label }}</span>
|
|
42
|
+
<span class="label-tip" v-if="props.config.hintFlag == '1'" @click="handleClickTip"><cmi-icon-question-circle size="14"/></span>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<slot></slot>
|
|
46
|
+
</cmi-form-item>
|
|
47
|
+
</template>
|
|
48
|
+
<style lang="scss" scoped>
|
|
49
|
+
cmi-form-item {
|
|
50
|
+
position: relative;
|
|
51
|
+
|
|
52
|
+
.custom-label--formItem {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
width: 100%;
|
|
56
|
+
// height: 16px;
|
|
57
|
+
|
|
58
|
+
.custom-label-content {
|
|
59
|
+
width: 100%;
|
|
60
|
+
display: -webkit-box;
|
|
61
|
+
line-height: 16px;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
text-overflow: ellipsis;
|
|
64
|
+
-webkit-line-clamp: 2;
|
|
65
|
+
-webkit-box-orient: vertical;
|
|
66
|
+
text-align: left;
|
|
67
|
+
.label-required {
|
|
68
|
+
color: #f5222d;
|
|
69
|
+
position: relative;
|
|
70
|
+
right: 3px;
|
|
71
|
+
top: 3px;
|
|
72
|
+
}
|
|
73
|
+
.label-text {
|
|
74
|
+
padding-right: 3px;
|
|
75
|
+
}
|
|
76
|
+
.label-tip {
|
|
77
|
+
position: absolute;
|
|
78
|
+
right: 16px;
|
|
79
|
+
top: 2px;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.--label-text-left {
|
|
85
|
+
.custom-label--formItem {
|
|
86
|
+
.custom-label-content {
|
|
87
|
+
text-align: left;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.--label-text-right {
|
|
93
|
+
.custom-label--formItem {
|
|
94
|
+
.custom-label-content {
|
|
95
|
+
text-align: right;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.--required {
|
|
101
|
+
.custom-label-content {
|
|
102
|
+
padding-left: 3px;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
@@ -30,16 +30,6 @@ const checkboxProps = computed(() => {
|
|
|
30
30
|
const attrs = useAttrs()
|
|
31
31
|
const modeValue = defineModel()
|
|
32
32
|
|
|
33
|
-
const aa = [
|
|
34
|
-
{
|
|
35
|
-
columnValue: 'aaa',
|
|
36
|
-
columnDesc_zh: 'aaa',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
columnValue: 'bbb',
|
|
40
|
-
columnDesc_zh: 'bbb',
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
33
|
const onChange = ({ detail }) => {
|
|
44
34
|
modeValue.value = detail.value
|
|
45
35
|
}
|
|
@@ -49,11 +39,11 @@ const onSigleChange = ({ detail }) => {
|
|
|
49
39
|
</script>
|
|
50
40
|
|
|
51
41
|
<template>
|
|
52
|
-
<cmi-checkbox-group :value="modeValue" @change="onChange" v-if="props.options && props.options.length" v-bind="{...
|
|
42
|
+
<cmi-checkbox-group :value="modeValue" @change="onChange" v-if="props.options && props.options.length" v-bind="{...attrs, ...checkboxGroupProps}">
|
|
53
43
|
<cmi-checkbox
|
|
54
44
|
class="mr-20"
|
|
55
45
|
v-for="option in props.options" :key="option.columnValue"
|
|
56
|
-
:disabled="option.columnStatus == '0' || option.columnStatus == '2'"
|
|
46
|
+
:disabled="props.disabled || option.columnStatus == '0' || option.columnStatus == '2'"
|
|
57
47
|
:name="option.columnValue" :label="lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc"
|
|
58
48
|
>
|
|
59
49
|
{{lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc}}
|
|
@@ -9,7 +9,7 @@ const props = defineProps({
|
|
|
9
9
|
const inputProps = computed(() => {
|
|
10
10
|
return {
|
|
11
11
|
label: props.config?.label,
|
|
12
|
-
type: props.config?.
|
|
12
|
+
type: props.config?.displayType,
|
|
13
13
|
name: props.config?.name,
|
|
14
14
|
placeholder: lang?.value?.indexOf('zh') > -1 ? props.config?.defPlacehold : props.config?.defPlaceholdEn,
|
|
15
15
|
min: props.config?.min,
|
|
@@ -54,7 +54,7 @@ const selectProps = computed(() => {
|
|
|
54
54
|
multiple: isMutiple.value,
|
|
55
55
|
placeholder: lang?.value?.indexOf('zh') > -1 ? props.config?.defPlacehold : props.config?.defPlaceholdEn,
|
|
56
56
|
'max-options-visible': props.config?.['max-options-visible'] || props.config?.maxOptionsVisible,
|
|
57
|
-
required: props.required,
|
|
57
|
+
// required: props.required,
|
|
58
58
|
}
|
|
59
59
|
})
|
|
60
60
|
const clear = () => {
|
|
@@ -16,8 +16,8 @@ const attrs = useAttrs()
|
|
|
16
16
|
const lang = inject('lang')
|
|
17
17
|
const cmiProps = computed(() => {
|
|
18
18
|
return {
|
|
19
|
-
title: lang?.value?.indexOf('zh') ? props.config?.metaNameZh : props.config?.metaNameEn,
|
|
20
|
-
subtitle: lang?.value?.indexOf('zh') ? props.config.subtitleZh : props.config.subtitleEn,
|
|
19
|
+
title: lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
|
|
20
|
+
subtitle: lang?.value?.indexOf('zh') > -1 ? props.config.subtitleZh : props.config.subtitleEn,
|
|
21
21
|
content: props.content,
|
|
22
22
|
noborder: props.noborder == '1' ? true : false,
|
|
23
23
|
cardbgcolor: props.cardbgcolor || '#FAFAFA',
|
|
@@ -16,7 +16,7 @@ const tableProps = computed(() => {
|
|
|
16
16
|
card: props.config?.displayType === 'card',
|
|
17
17
|
display: props.config?.display,
|
|
18
18
|
open: props.config?.open === '1',
|
|
19
|
-
showlandscape: props.config?.
|
|
19
|
+
showlandscape: props.config?.showLandscape === '1',
|
|
20
20
|
}
|
|
21
21
|
})
|
|
22
22
|
|
package/src/utils/render.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCodeMapRules } from '../rules/rulesDriver.js'
|
|
2
2
|
import { resolveAssetComponents, findComponent, compareComponet, normalPixel, isPlainObject, hasOwn, isFnStr, normalCapitalizeComponent, capitalize, camelize, formatDate} from './common.js'
|
|
3
|
-
import { resolveComponent, inject } from 'vue'
|
|
3
|
+
import { resolveComponent, inject, defineAsyncComponent } from 'vue'
|
|
4
4
|
import CustomComponentColH5 from '../components/packages-H5/CustomComponentColH5.vue'
|
|
5
5
|
import {
|
|
6
6
|
commonPropsType,
|
|
@@ -26,6 +26,7 @@ import { isArray, isFunction, isString } from './is.js'
|
|
|
26
26
|
import CustomComponentPlain from '../components/packages-web/CustomComponentPlain.vue'
|
|
27
27
|
import QuestionFilled from '../components/icons/question-filled.vue'
|
|
28
28
|
import { dispatchClickEvent, dispatchClickEvents, getTableConfig } from '../components/helper/eventOrchestration.js'
|
|
29
|
+
import CmiFormItem from '../components/cmiFormItem'
|
|
29
30
|
|
|
30
31
|
// 解析配置中的defStyle属性
|
|
31
32
|
export function parseDefStyle(defStyle) {
|
|
@@ -582,20 +583,27 @@ function generateFormItemPc (config, lang, compProps, params,) {
|
|
|
582
583
|
}
|
|
583
584
|
}
|
|
584
585
|
|
|
585
|
-
function generateFormItemH5(config, lang, compProps, params) {
|
|
586
|
+
function generateFormItemH5(config, lang, compProps, params = {}) {
|
|
587
|
+
const { messageInstance } = params
|
|
588
|
+
const props = {
|
|
589
|
+
config,
|
|
590
|
+
lang,
|
|
591
|
+
messageInstance,
|
|
592
|
+
hidemessage: config?.hidemessage == '1' ? true : false,
|
|
593
|
+
hideasterisk: config?.hideasterisk == '1' ? true : false,
|
|
594
|
+
...getFormItemExtendProps(config, lang, params),
|
|
595
|
+
}
|
|
596
|
+
// labelWidth 需要特殊处理
|
|
597
|
+
if (hasOwn(config, 'labelWidth')) {
|
|
598
|
+
props.labelWidth = props.labelWidth && `${props.labelWidth}` !== '-1' ? props.labelWidth : undefined
|
|
599
|
+
}
|
|
600
|
+
|
|
586
601
|
return node => {
|
|
587
602
|
if (!config.needformItem && !config.showFormItem) {
|
|
588
603
|
return node
|
|
589
604
|
}
|
|
590
|
-
const props = {
|
|
591
|
-
label: lang.indexOf('zh') > -1 ? config.metaNameZh : config.metaNameEn,
|
|
592
|
-
hidemessage: config?.hidemessage == '1' ? true : false,
|
|
593
|
-
hideasterisk: config?.hideasterisk == '1' ? true : false,
|
|
594
|
-
...getFormItemExtendProps(config, lang, params),
|
|
595
|
-
}
|
|
596
|
-
|
|
597
605
|
return (
|
|
598
|
-
<
|
|
606
|
+
<CmiFormItem {...props}>{node}</CmiFormItem>
|
|
599
607
|
)
|
|
600
608
|
}
|
|
601
609
|
}
|