resolver-egretimp-plus 0.0.4

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.
Files changed (121) hide show
  1. package/babel.config.js +14 -0
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.LICENSE.txt +8 -0
  4. package/dist/theme/element/index.css +1 -0
  5. package/dist/theme/element/src/components/card.scss +4 -0
  6. package/dist/theme/element/src/components/collapse.scss +16 -0
  7. package/dist/theme/element/src/components/date.scss +13 -0
  8. package/dist/theme/element/src/components/form.scss +54 -0
  9. package/dist/theme/element/src/components/index.scss +42 -0
  10. package/dist/theme/element/src/components/input.scss +15 -0
  11. package/dist/theme/element/src/components/message.scss +31 -0
  12. package/dist/theme/element/src/components/scrollbar.scss +14 -0
  13. package/dist/theme/element/src/components/select.scss +17 -0
  14. package/dist/theme/element/src/components/steps.scss +6 -0
  15. package/dist/theme/element/src/components/table.scss +8 -0
  16. package/dist/theme/element/src/components/tabs.scss +68 -0
  17. package/dist/theme/element/src/components/tree.scss +0 -0
  18. package/dist/theme/element/src/index.scss +79 -0
  19. package/index.js +17 -0
  20. package/package.json +45 -0
  21. package/scripts/gulpfile.mjs +73 -0
  22. package/scripts/webpack.config.js +81 -0
  23. package/src/analysisComponent.jsx +166 -0
  24. package/src/components/helper/button.js +17 -0
  25. package/src/components/helper/dock.js +120 -0
  26. package/src/components/icons/question-filled.vue +13 -0
  27. package/src/components/packages/CmiButton.vue +84 -0
  28. package/src/components/packages/CmiCalendar.vue +138 -0
  29. package/src/components/packages/CmiCell.vue +34 -0
  30. package/src/components/packages/CmiCheckbox.vue +63 -0
  31. package/src/components/packages/CmiDatetimePicker.vue +84 -0
  32. package/src/components/packages/CmiDropdownMenu.vue +57 -0
  33. package/src/components/packages/CmiInput.vue +45 -0
  34. package/src/components/packages/CmiLink.vue +28 -0
  35. package/src/components/packages/CmiPicker.vue +120 -0
  36. package/src/components/packages/CmiRadio.vue +29 -0
  37. package/src/components/packages/CmiSearch.vue +39 -0
  38. package/src/components/packages/CmiSelect.vue +84 -0
  39. package/src/components/packages/CustomComponentCard.vue +40 -0
  40. package/src/components/packages/CustomComponentCardH5.vue +40 -0
  41. package/src/components/packages/CustomComponentCol.vue +69 -0
  42. package/src/components/packages/CustomComponentColH5.vue +8 -0
  43. package/src/components/packages/CustomComponentCollapse.vue +183 -0
  44. package/src/components/packages/CustomComponentCollapseH5.vue +37 -0
  45. package/src/components/packages/CustomComponentCycle.vue +95 -0
  46. package/src/components/packages/CustomComponentCycleTabPane.vue +92 -0
  47. package/src/components/packages/CustomComponentDialog.vue +162 -0
  48. package/src/components/packages/CustomComponentEditor.vue +43 -0
  49. package/src/components/packages/CustomComponentFormLayout.vue +63 -0
  50. package/src/components/packages/CustomComponentFormLayoutH5.vue +55 -0
  51. package/src/components/packages/CustomComponentGrid.vue +29 -0
  52. package/src/components/packages/CustomComponentGridCol.vue +29 -0
  53. package/src/components/packages/CustomComponentInputDialog.vue +144 -0
  54. package/src/components/packages/CustomComponentPlain.vue +80 -0
  55. package/src/components/packages/CustomComponentRow.vue +67 -0
  56. package/src/components/packages/CustomComponentSelectEmployees.vue +133 -0
  57. package/src/components/packages/CustomComponentSendMail.vue +72 -0
  58. package/src/components/packages/CustomComponentSteps.vue +41 -0
  59. package/src/components/packages/CustomComponentTabPane.vue +41 -0
  60. package/src/components/packages/CustomComponentTabPaneH5.vue +30 -0
  61. package/src/components/packages/CustomComponentTable.jsx +406 -0
  62. package/src/components/packages/CustomComponentTableH5.vue +58 -0
  63. package/src/components/packages/CustomComponentTabs.vue +75 -0
  64. package/src/components/packages/CustomComponentTabsH5.vue +86 -0
  65. package/src/components/packages/CustomComponentTree.vue +28 -0
  66. package/src/components/packages/ElButton.vue +90 -0
  67. package/src/components/packages/ElCheckbox.vue +55 -0
  68. package/src/components/packages/ElDatePicker.vue +58 -0
  69. package/src/components/packages/ElInput.vue +23 -0
  70. package/src/components/packages/ElInputNumber.vue +54 -0
  71. package/src/components/packages/ElPagination.vue +56 -0
  72. package/src/components/packages/ElRadio.vue +44 -0
  73. package/src/components/packages/ElSelect.vue +73 -0
  74. package/src/components/packages/ElText.vue +48 -0
  75. package/src/components/packages/ElTimePicker.vue +34 -0
  76. package/src/components/patchComponents.js +46 -0
  77. package/src/components/styles/CustomComponenTable.scss +125 -0
  78. package/src/components/tabs/index.js +8 -0
  79. package/src/components/tabs/src/constants.js +23 -0
  80. package/src/components/tabs/src/tab-bar.js +8 -0
  81. package/src/components/tabs/src/tab-bar.vue +92 -0
  82. package/src/components/tabs/src/tab-nav.jsx +413 -0
  83. package/src/components/tabs/src/tab-pane.js +15 -0
  84. package/src/components/tabs/src/tab-pane.vue +80 -0
  85. package/src/components/tabs/src/tabs.jsx +217 -0
  86. package/src/components/tabs/style/css.js +2 -0
  87. package/src/components/tabs/style/index.js +2 -0
  88. package/src/components/thirdPartyFrame/index.js +32 -0
  89. package/src/components/thirdPartyFrame/src/ThirdPartyFrame.vue +123 -0
  90. package/src/hooks/index.js +129 -0
  91. package/src/hooks/pageConfig.js +20 -0
  92. package/src/index.jsx +140 -0
  93. package/src/renderer.jsx +68 -0
  94. package/src/rules/eventsSupplement.js +439 -0
  95. package/src/rules/parseCondition.js +359 -0
  96. package/src/rules/ruleUtils.js +208 -0
  97. package/src/rules/rulesDriver.js +118 -0
  98. package/src/theme/element/components/card.scss +4 -0
  99. package/src/theme/element/components/collapse.scss +16 -0
  100. package/src/theme/element/components/date.scss +13 -0
  101. package/src/theme/element/components/form.scss +54 -0
  102. package/src/theme/element/components/index.scss +42 -0
  103. package/src/theme/element/components/input.scss +15 -0
  104. package/src/theme/element/components/message.scss +31 -0
  105. package/src/theme/element/components/scrollbar.scss +14 -0
  106. package/src/theme/element/components/select.scss +17 -0
  107. package/src/theme/element/components/steps.scss +6 -0
  108. package/src/theme/element/components/table.scss +8 -0
  109. package/src/theme/element/components/tabs.scss +68 -0
  110. package/src/theme/element/components/tree.scss +0 -0
  111. package/src/theme/element/index.scss +79 -0
  112. package/src/utils/common.js +230 -0
  113. package/src/utils/const.js +198 -0
  114. package/src/utils/defaultVal.js +23 -0
  115. package/src/utils/format.js +19 -0
  116. package/src/utils/index.js +4 -0
  117. package/src/utils/is.js +69 -0
  118. package/src/utils/preserveFunc.js +33 -0
  119. package/src/utils/render.jsx +714 -0
  120. package/src/utils/request.js +10 -0
  121. package/src/utils/valid.js +71 -0
@@ -0,0 +1,84 @@
1
+ <script setup>
2
+ import { computed, defineProps, inject, ref, useAttrs } from 'vue'
3
+ import { commonPropsType } from '../../utils/index.js'
4
+
5
+ const attrs = useAttrs()
6
+ const lang = inject('lang')
7
+ const modelValue = defineModel()
8
+ const props = defineProps({
9
+ ...commonPropsType,
10
+ })
11
+ const open = computed({
12
+ get() {
13
+ return props?.config?.open === '1'
14
+ },
15
+ set(val) {
16
+ props.config.open = val ? '1' : '0'
17
+ }
18
+ })
19
+ const prefixIcon = computed(() => {
20
+ return props?.config?.prefixIcon
21
+ })
22
+ const suffixIcon = computed(() => {
23
+ return props?.config?.suffixIcon
24
+ })
25
+ const formatArr = computed(() => {
26
+ return props?.config?.format?.match(/\W/g) || []
27
+ })
28
+
29
+ const formatValue = computed({
30
+ get() {
31
+ return modelValue.value
32
+ },
33
+ set(val) {
34
+ let valueArr = Array.isArray(val) ? val : val.split(/\W/).map((value) => ({ value }))
35
+ let formatVal = valueArr.reduce((pre, cur, i) => {
36
+ pre = pre + cur.value + (i === valueArr.length - 1 ? "" : formatArr.value[i])
37
+ return pre
38
+ }, "")
39
+ modelValue.value = formatVal
40
+ }
41
+ })
42
+
43
+ const calcProps = computed(() => {
44
+ const ret = {
45
+ type: props?.config?.displayType,
46
+ title: lang.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
47
+ forbidmaskclick: props?.config?.forbidmaskclick === '1',
48
+ mindate: props?.config?.mindate,
49
+ maxdate: props?.config?.maxdate,
50
+ minhour: props?.config?.minhour,
51
+ maxhour: props?.config?.minhour,
52
+ minminute: props?.config?.minminute,
53
+ maxminute: props?.config?.maxminute,
54
+ }
55
+ return ret
56
+ })
57
+ const onClose = () => {
58
+ props.config?.onClose?.()
59
+ open.value = false
60
+ }
61
+ const onConfirm = (e) => {
62
+ formatValue.value = e.detail.value
63
+ props.config?.onConfirm?.(formatValue.value)
64
+ open.value = false
65
+ }
66
+
67
+ </script>
68
+
69
+ <template>
70
+ <cmi-input :value="formatValue" suffixIcon @focus="open = true">
71
+ <div slot="suffix-icon" v-if="suffixIcon">
72
+ <component :is="`cmi-icon-${suffixIcon}`" color="#4E5969"></component>
73
+ </div>
74
+ <span slot="prefix" v-if="prefixIcon">
75
+ <component :is="`cmi-icon-${prefixIcon}`" color="#4E5969"></component>
76
+ </span>
77
+ </cmi-input>
78
+ <cmi-datetime-picker
79
+ v-bind="{...attrs, ...calcProps}"
80
+ :open="open"
81
+ @close="onClose"
82
+ @confirm="onConfirm"
83
+ />
84
+ </template>
@@ -0,0 +1,57 @@
1
+ <script setup>
2
+ import { computed, defineProps, inject, useAttrs } from 'vue'
3
+ import { commonPropsType } from '../../utils/index.js'
4
+
5
+ const selects = inject('selects')
6
+ const lang = inject('lang')
7
+ const modelValue = defineModel()
8
+ const props = defineProps({
9
+ ...commonPropsType,
10
+ })
11
+
12
+ const dropdownMenuProps = computed(() => {
13
+ return {
14
+ title: lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
15
+ "active-color": props.config?.['active-color'] || props.config?.activeColor,
16
+ direction: props.config?.direction,
17
+ "z-index": props.config?.['z-index'] || props.config?.zIndex,
18
+ "active-color": props.config?.['hide-overlay'] || props.config?.hideOverlay,
19
+ "swipe-threshold": props.config?.['swipe-threshold'] || props.config?.swipeThreshold,
20
+ }
21
+ })
22
+
23
+ const optionItems = computed(() => {
24
+ return JSON.parse(props.config?.optionItems || '[]')
25
+ })
26
+
27
+ const getItemValue = (idx) => {
28
+ const val = modelValue.value || ''
29
+ const valArr = val.split(',')
30
+ return valArr[idx]
31
+ }
32
+ const getDropdownItemProps = (config, idx) => {
33
+ return {
34
+ value: getItemValue(idx),
35
+ title: config?.label,
36
+ activetype: props.config?.activetype,
37
+ options: ((selects?.value && selects?.value?.[config?.selectKey]) || []).map(option => {
38
+ return {
39
+ label: lang?.value?.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc,
40
+ value: option.columnValue
41
+ }
42
+ }),
43
+ onChange(e) {
44
+ const val = modelValue.value || ''
45
+ const valArr = val.split(',')
46
+ valArr[idx] = e.detail.value
47
+ modelValue.value = valArr?.join(',')
48
+ }
49
+ }
50
+ }
51
+ </script>
52
+
53
+ <template>
54
+ <cmi-dropdown-menu v-bind="{...dropdownMenuProps}">
55
+ <cmi-dropdown-item v-for="(config, idx) in optionItems" :key="JSON.stringify(config)" v-bind="{...getDropdownItemProps(config, idx)}"></cmi-dropdown-item>
56
+ </cmi-dropdown-menu>
57
+ </template>
@@ -0,0 +1,45 @@
1
+ <script setup>
2
+ import { computed, defineProps, inject, useAttrs } from 'vue'
3
+ import { commonPropsType } from '../../utils/index.js'
4
+
5
+ const lang = inject('lang')
6
+ const props = defineProps({
7
+ ...commonPropsType,
8
+ })
9
+ const inputProps = computed(() => {
10
+ return {
11
+ label: props.config?.label,
12
+ type: props.config?.type,
13
+ name: props.config?.name,
14
+ placeholder: lang?.value?.indexOf('zh') > -1 ? props.config?.defPlacehold : props.config?.defPlaceholdEn,
15
+ min: props.config?.min,
16
+ minlength: props.config?.minlength,
17
+ max: props.config?.max,
18
+ maxlength: props.config?.maxlength,
19
+ disabled: props.disabled,
20
+ readonly: props.config?.readonly ==='1',
21
+ required: props.required,
22
+ errormsg: props.config?.errormsg,
23
+ clearable: props.clearable,
24
+ showWordLimit: props.config?.showWordLimit === '1',
25
+ showPassword: props.config?.showPassword === '1',
26
+ prefixIcon: props.config?.prefixIcon,
27
+ suffixIcon: props.config?.suffixIcon,
28
+ minRows: props.config?.minRows,
29
+ maxRows: props.config?.maxRows,
30
+ }
31
+ })
32
+ const attrs = useAttrs()
33
+ const modelValue = defineModel()
34
+ const onChange = (e) => {
35
+ modelValue.value = e.detail.value
36
+ }
37
+
38
+ </script>
39
+
40
+ <template>
41
+ <cmi-input
42
+ :value="modelValue" v-bind="{ ...attrs, ...inputProps,}"
43
+ @change="onChange"
44
+ ></cmi-input>
45
+ </template>
@@ -0,0 +1,28 @@
1
+ <script setup>
2
+ import { computed, defineProps, inject, useAttrs } from 'vue'
3
+ import { commonPropsType } from '../../utils/index.js'
4
+
5
+ const lang = inject('lang')
6
+ const props = defineProps({
7
+ ...commonPropsType,
8
+ })
9
+ const linkProps = computed(() => {
10
+ return {
11
+ type: props.config?.type,
12
+ disabled: props.disabled,
13
+ href: props.config?.href,
14
+ target: props.config?.target
15
+ }
16
+ })
17
+ const modelValue = defineModel()
18
+
19
+ const label = computed(() => {
20
+ return modelValue.value || (lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn)
21
+ })
22
+ </script>
23
+
24
+ <template>
25
+ <cmi-link v-bind="{...linkProps}">
26
+ {{ label }}
27
+ </cmi-link>
28
+ </template>
@@ -0,0 +1,120 @@
1
+ <script setup>
2
+ import { computed, defineProps, inject, ref, useAttrs, watch } from 'vue'
3
+ import { commonPropsType } from '../../utils/index.js'
4
+
5
+ const pickerRef = ref(null)
6
+ const selects = inject('selects')
7
+ const attrs = useAttrs()
8
+ const lang = inject('lang')
9
+ const modelValue = defineModel()
10
+ const props = defineProps({
11
+ ...commonPropsType,
12
+ })
13
+ const open = computed({
14
+ get() {
15
+ return props?.config?.open === '1'
16
+ },
17
+ set(val) {
18
+ props.config.open = val ? '1' : '0'
19
+ }
20
+ })
21
+ const prefixIcon = computed(() => {
22
+ return props?.config?.prefixIcon
23
+ })
24
+ const suffixIcon = computed(() => {
25
+ return props?.config?.suffixIcon
26
+ })
27
+
28
+ const formatValue = computed({
29
+ get() {
30
+ return modelValue.value ? modelValue.value.split(',') : []
31
+ },
32
+ set(val) {
33
+ const formatVal = Array.isArray(val) ? val.join(',') : val
34
+ modelValue.value = formatVal
35
+ }
36
+ })
37
+
38
+ const calcProps = computed(() => {
39
+ const ret = {
40
+ type: props?.config?.displayType,
41
+ title: lang.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
42
+ canceltext: props?.config?.canceltext,
43
+ confirmtext: props?.config?.confirmtext,
44
+ bottomhidden: props?.config?.bottomhidden === '1',
45
+ forbidmaskclick: props?.config?.forbidmaskclick === '1',
46
+ fastpick: props?.config?.fastpick === '1',
47
+ }
48
+ return ret
49
+ })
50
+ const getColumns = () => {
51
+ const selectKeyArr = props.config?.selectKey?.split?.(',') || []
52
+ return selectKeyArr.map((key, idx) => {
53
+ return {
54
+ defaultIndex: selects?.value?.[key]?.find(option => option?.columnValue === formatValue.value[idx]) || 0,
55
+ values: selects?.value?.[key]?.map(option => ({
56
+ label: lang?.value?.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc,
57
+ value: option.columnValue
58
+ }))
59
+ }
60
+ })
61
+ }
62
+
63
+ const onFocus = () => {
64
+ open.value = true
65
+ pickerRef.value?.setColumns?.(getColumns())
66
+ }
67
+
68
+ const onClose = () => {
69
+ props.config?.onClose?.()
70
+ open.value = false
71
+ }
72
+ const onConfirm = (e) => {
73
+ const val = (e.detail.value || []).map(item => {
74
+ if (typeof item.value === 'object') {
75
+ return item.value?.value
76
+ } else {
77
+ return item.value
78
+ }
79
+ })
80
+ formatValue.value = val
81
+
82
+ props.config?.onConfirm?.(formatValue.value)
83
+ open.value = false
84
+ }
85
+
86
+ const modelvalDesc = computed(() => {
87
+ const columns = getColumns()
88
+ return formatValue.value?.reduce?.((ret, cur, idx) => {
89
+ const col = columns[idx]
90
+ const curItem = (col?.values || []).find(item => {
91
+ if (typeof item === 'object') {
92
+ return item.value === cur
93
+ } else {
94
+ return item == cur
95
+ }
96
+ })
97
+ const label = (typeof curItem === 'object' ? curItem.label : curItem) || ''
98
+ return ret ? `${ret},${label}` : `${label}`
99
+ }, '')
100
+ })
101
+
102
+ </script>
103
+
104
+ <template>
105
+ <cmi-input :value="modelvalDesc" suffixIcon @focus="onFocus">
106
+ <div slot="suffix-icon" v-if="suffixIcon">
107
+ <component :is="`cmi-icon-${suffixIcon}`" color="#4E5969"></component>
108
+ </div>
109
+ <span slot="prefix" v-if="prefixIcon">
110
+ <component :is="`cmi-icon-${prefixIcon}`" color="#4E5969"></component>
111
+ </span>
112
+ </cmi-input>
113
+ <cmi-picker
114
+ ref="pickerRef"
115
+ v-bind="{...attrs, ...calcProps}"
116
+ :open="open"
117
+ @close="onClose"
118
+ @confirm="onConfirm"
119
+ />
120
+ </template>
@@ -0,0 +1,29 @@
1
+ <script setup>
2
+ import { computed, defineProps, inject, ref, useAttrs } from 'vue'
3
+ import { commonPropsType } from '../../utils/index.js'
4
+
5
+ const lang = inject('lang')
6
+ const modelValue = defineModel()
7
+ const props = defineProps({
8
+ ...commonPropsType,
9
+ })
10
+ const calcProps = computed(() => {
11
+ return {
12
+ direction: props.config?.direction,
13
+ }
14
+ })
15
+ const attrs = useAttrs()
16
+ const onChange = (e) => {
17
+ modelValue.value = e.detail.value
18
+ }
19
+ </script>
20
+
21
+ <template>
22
+ <cmi-radio-group :value="modelValue" v-bind="{ ...attrs, ...calcProps}" @change="onChange">
23
+ <cmi-radio
24
+ v-for="option in props.options" :key="option.columnValue"
25
+ :disabled="option.columnStatus == '0' || option.columnStatus == '2'"
26
+ :name="option.columnValue" :label="lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc"
27
+ />
28
+ </cmi-radio-group>
29
+ </template>
@@ -0,0 +1,39 @@
1
+ <script setup>
2
+ import { computed, defineProps, inject, useAttrs } from 'vue'
3
+ import { commonPropsType } from '../../utils/index.js'
4
+
5
+ const lang = inject('lang')
6
+ const modelValue = defineModel()
7
+ const props = defineProps({
8
+ ...commonPropsType,
9
+ })
10
+ const calcProps = computed(() => {
11
+ return {
12
+ shape: props.config?.shape,
13
+ dark: props.config?.dark,
14
+ showback: props.config?.showback === '1',
15
+ showaction: props.config?.showaction === '1',
16
+ actiontext: props.config?.actiontext,
17
+ iconcolor: props.config?.iconcolor,
18
+ placeholder: lang?.value?.indexOf('zh') > -1 ? props.config?.defPlacehold : props.config?.defPlaceholdEn,
19
+ maxlength: props.config?.maxlength,
20
+ autofocus: props.config?.autofocus,
21
+ clearable: props.config?.clearable === '1',
22
+ disabled: props.disabled,
23
+ readonly: props.readonly,
24
+ noborder: props.config?.noborder,
25
+ }
26
+ })
27
+ const attrs = useAttrs()
28
+ const onChange = (e) => {
29
+ modelValue.value = e.detail.value
30
+ }
31
+
32
+ </script>
33
+
34
+ <template>
35
+ <cmi-search
36
+ :value="modelValue" v-bind="{ ...attrs, ...calcProps}"
37
+ @change="onChange"
38
+ ></cmi-search>
39
+ </template>
@@ -0,0 +1,84 @@
1
+ <script setup>
2
+ import { computed, defineProps, inject, useAttrs } from 'vue'
3
+ import { commonPropsType } from '../../utils/index.js'
4
+
5
+ const modelValue = defineModel()
6
+ const props = defineProps({
7
+ ...commonPropsType,
8
+ isMutiple: [String, Boolean]
9
+ })
10
+ const attrs = useAttrs()
11
+ const lang = inject('lang')
12
+
13
+ // 是否为多选
14
+ const isMutiple = computed(() => {
15
+ return props.multiple === '1' || (typeof props.multiple === 'boolean' && props.multiple)
16
+ })
17
+ const showAll = computed(() => {
18
+ return props.showAll === '1'
19
+ })
20
+ const value = computed({
21
+ get() {
22
+ if (isMutiple.value) {
23
+ const val = modelValue.value || ''
24
+ return val ? val.split(',') : []
25
+ } else {
26
+ if (modelValue.value !== null && modelValue.value !== undefined) {
27
+ if (props.options?.some(item => item.columnValue == modelValue.value)) {
28
+ props.config.isMatch = true
29
+ return `${modelValue.value}`
30
+ } else {
31
+ props.config.isMatch = false
32
+ return ''
33
+ }
34
+ } else {
35
+ return ''
36
+ }
37
+ }
38
+ },
39
+ set(val) {
40
+ if (isMutiple.value) {
41
+ modelValue.value = val.join(',')
42
+ } else {
43
+ modelValue.value = val
44
+ }
45
+ }
46
+ })
47
+
48
+ const selectProps = computed(() => {
49
+ return {
50
+ label: lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
51
+ value: value.value,
52
+ disabled: props.disabled,
53
+ clearable: props.clearable,
54
+ multiple: isMutiple.value,
55
+ placeholder: lang?.value?.indexOf('zh') > -1 ? props.config?.defPlacehold : props.config?.defPlaceholdEn,
56
+ 'max-options-visible': props.config?.['max-options-visible'] || props.config?.maxOptionsVisible,
57
+ required: props.required,
58
+ }
59
+ })
60
+ const clear = () => {
61
+ value.value = ''
62
+ }
63
+ const onChange = ({detail}) => {
64
+ value.value = detail.value || []
65
+ props.config?.onChange(modelValue.value)
66
+ }
67
+ </script>
68
+
69
+ <template>
70
+ <cmi-select class="custom-self-select" v-bind="{...attrs, ...selectProps}" @change="onChange" @clear="clear">
71
+ <cmi-option v-if="showAll" value="all" multiple>{{ lang.indexOf('zh') > -1 ? '全选' : 'All' }}</cmi-option>
72
+ <cmi-option v-for="option in (props.options || [])" :key="option.columnValue"
73
+ :label="lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc"
74
+ :value="option.columnValue"
75
+ :multiple="isMutiple"
76
+ :disabled="option.columnStatus == '0' || option.columnStatus == '2'"
77
+ />
78
+ </cmi-select>
79
+ </template>
80
+
81
+ <style lang="scss">
82
+ .custom-self-select {
83
+ }
84
+ </style>
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <ElCard class="custom-component-card" v-bind="cardProps">
3
+ <ElRow>
4
+ <Renderer :config="pmPageMetaList" v-model="modelValue"></Renderer>
5
+ </ElRow>
6
+ </ElCard>
7
+ </template>
8
+ <script setup>
9
+ import { ElCard, ElRow } from 'element-plus'
10
+ import { commonPropsType, hasOwn } from '../../utils/index.js'
11
+ import Renderer from '../../renderer.jsx'
12
+ import { computed } from 'vue'
13
+
14
+ const modelValue = defineModel()
15
+ const props = defineProps({
16
+ ...ElCard.props,
17
+ ...commonPropsType,
18
+ })
19
+
20
+ const cardProps = computed(() => {
21
+ const ret = Object.keys(ElCard.props).reduce((ret, key) => {
22
+ ret[key] = props[key]
23
+ return ret
24
+ }, {})
25
+ if (!hasOwn(ret, 'shadow')) {
26
+ ret.shadow = 'never'
27
+ }
28
+ return ret
29
+ })
30
+
31
+ const pmPageMetaList = computed(() => {
32
+ return props.config?.pmPageMetaList?.filter(item => !item.collapseSlot) || []
33
+ })
34
+ </script>
35
+ <style lang="scss">
36
+ .custom-component-card {
37
+ width: 100%;
38
+ box-sizing: border-box
39
+ }
40
+ </style>
@@ -0,0 +1,40 @@
1
+ <script setup>
2
+ import { computed, inject, resolveComponent, useAttrs } from "vue";
3
+ import Renderer from '../../renderer.jsx'
4
+ import { commonPropsType, hasOwn } from '../../utils/index.js'
5
+
6
+ const modelValue = defineModel()
7
+ const props = defineProps({
8
+ ...commonPropsType,
9
+ subtitleZh: String,
10
+ subtitleEn: String,
11
+ content: String,
12
+ noborder: [Boolean, String],
13
+ cardbgcolor: String,
14
+ })
15
+ const attrs = useAttrs()
16
+ const lang = inject('lang')
17
+ const cmiProps = computed(() => {
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,
21
+ content: props.content,
22
+ noborder: props.noborder == '1' ? true : false,
23
+ cardbgcolor: props.cardbgcolor,
24
+ }
25
+ })
26
+
27
+ const pmPageMetaList = computed(() => {
28
+ return props.config?.pmPageMetaList?.filter(item => !item.collapseSlot) || []
29
+ })
30
+
31
+ </script>
32
+ <template>
33
+ <cmi-card v-bind="{...cmiProps, ...attrs}">
34
+ <div slot="content">
35
+ <Renderer :config="pmPageMetaList" v-model="modelValue"></Renderer>
36
+ </div>
37
+ </cmi-card>
38
+ </template>
39
+ <style lang="scss">
40
+ </style>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <ElCol class="custom-component-row" :class="classRef" v-bind="{...elRowProps, ...attrs}">
3
+ <ElRow>
4
+ <Renderer :config="pmPageMetaList" v-model="props.refValue.value"></Renderer>
5
+ </ElRow>
6
+ </ElCol>
7
+ </template>
8
+ <script setup>
9
+ import Renderer from '../../renderer.jsx'
10
+ import { ElCol, ElRow } from 'element-plus'
11
+ import { computed, defineProps, useAttrs } from 'vue'
12
+ import { commonPropsType } from '../../utils/index.js'
13
+
14
+ defineEmits(['update:modelValue'])
15
+
16
+ const props = defineProps({
17
+ ...commonPropsType,
18
+ ...ElCol.props
19
+ })
20
+ const elRowProps = computed(() => {
21
+ return Object.keys(ElCol.props).reduce((ret, key) => {
22
+ ret[key] = props[key]
23
+ return ret
24
+ }, {})
25
+ })
26
+ const attrs = useAttrs()
27
+
28
+ const classRef = computed(() => {
29
+ return {
30
+ 'clear-right-margin': !reserveRightMargin.value,
31
+ 'clear-bottom-margin': !reserveBottomMargin.value,
32
+ }
33
+ })
34
+
35
+ const pmPageMetaList = computed(() => {
36
+ return props.config?.pmPageMetaList || []
37
+ })
38
+ // 保留内部formItem的margin-right
39
+ const reserveRightMargin = computed(() => {
40
+ return props.config?.reserveRightMargin
41
+ })
42
+ // 保留内部formItem的margin-bottom
43
+ const reserveBottomMargin = computed(() => {
44
+ return props.config?.reserveBottomMargin
45
+ })
46
+ </script>
47
+ <style lang="scss">
48
+ .custom-component-row {
49
+ width: 100%;
50
+ .el-col {
51
+ & > .el-form-item {
52
+ }
53
+ }
54
+ }
55
+ .clear-right-margin {
56
+ .el-col {
57
+ & > .el-form-item {
58
+ margin-right: 0;
59
+ }
60
+ }
61
+ }
62
+ .clear-bottom-margin {
63
+ .el-col {
64
+ & > .el-form-item {
65
+ margin-bottom: 0;
66
+ }
67
+ }
68
+ }
69
+ </style>
@@ -0,0 +1,8 @@
1
+ <script setup>
2
+ </script>
3
+ <template>
4
+ <div>
5
+ <slot></slot>
6
+ </div>
7
+ </template>
8
+ <style lang="scss"></style>