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,90 @@
1
+ <template>
2
+ <ElButton @click="buttonAction" v-bind="{...attrs, ...calcPorps}">
3
+ {{label}}
4
+ </ElButton>
5
+ </template>
6
+ <script setup>
7
+ import { ElButton } from 'element-plus'
8
+ import { defineProps, inject, getCurrentInstance, computed, useAttrs } from 'vue'
9
+ import { commonPropsType } from '../../utils/index.js'
10
+ import { useRoute } from 'vue-router'
11
+ import { dispatchClickEvents } from '../helper/button.js';
12
+
13
+ const appContext = getCurrentInstance()?.appContext
14
+
15
+ const props = defineProps({
16
+ ...commonPropsType,
17
+ ...ElButton.props
18
+ })
19
+ const calcPorps = computed(() => {
20
+ const ret = {
21
+ ...props
22
+ }
23
+ if (ret.plain == '1') {
24
+ ret.plain = true
25
+ } else {
26
+ ret.plain = false
27
+ }
28
+
29
+ if (ret.circle == '1') {
30
+ ret.circle = true
31
+ } else {
32
+ ret.circle = false
33
+ }
34
+ if (props?.config?.rounds && props?.config?.rounds == '1') {
35
+ ret.round = true
36
+ }
37
+ if (props?.config?.widgetSize) {
38
+ ret.size = props?.config?.widgetSize
39
+ }
40
+ if (props?.config?.displayType) {
41
+ ret.type = props?.config?.displayType
42
+ }
43
+ return ret
44
+ })
45
+
46
+ const attrs = useAttrs()
47
+
48
+ const lang = inject('lang')
49
+
50
+ const label = computed(() => {
51
+ return lang.value.indexOf('zh') > -1 ? (props.config?.labelZh || props.config?.metaNameZh) : (props.config?.labelEn || props.config?.metaNameEn)
52
+ })
53
+ const route = useRoute()
54
+ const buttonActions = inject('buttonActions', {})
55
+
56
+ const dynamicMapComp = inject('dynamicMapComp')
57
+ const hireRelatMapRules = inject('hireRelatMapRules')
58
+ const components = inject('components')
59
+ const selects = inject('selects')
60
+ const rootValue = inject('rootValue')
61
+ const dataLoad = inject('dataLoad')
62
+ const rootForm = inject('rootForm')
63
+ const _axiosInstance = inject('_axiosInstance')
64
+ const routeQuery= route?.query
65
+
66
+ const buttonAction = () => {
67
+ attrs?.onClick?.(e) // 如果配置中有点击事件
68
+ const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
69
+ const actionFn = buttonActions[actionKey]
70
+ actionFn && actionFn(props, {
71
+ dynamicMapComp,
72
+ hireRelatMapRules,
73
+ components,
74
+ selects,
75
+ rootValue,
76
+ dataLoad,
77
+ rootForm,
78
+ routeQuery
79
+ }, appContext)
80
+
81
+ const PageServiceMapVOList = props.config.lcpPageServiceMapVOList
82
+ if (PageServiceMapVOList?.length) {
83
+ dispatchClickEvents({
84
+ serviceList: PageServiceMapVOList,
85
+ axiosInstance: _axiosInstance,
86
+ reqData: rootValue?.value
87
+ })
88
+ }
89
+ }
90
+ </script>
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <ElCheckboxGroup v-model="modeValue" v-if="props.options && props.options.length" v-bind="{...checkboxGroupProps, ...attrs}">
3
+ <ElCheckbox
4
+ v-bind="{...checkboxProps }"
5
+ v-for="option in props.options"
6
+ :key="option.columnValue"
7
+ :value="option.columnValue"
8
+ >
9
+ {{lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc}}
10
+ </ElCheckbox>
11
+ </ElCheckboxGroup>
12
+ <ElCheckbox v-else v-bind="{...checkboxProps, ...attrs}" v-model="modeValue">
13
+ {{ label }}
14
+ </ElCheckbox>
15
+ </template>
16
+ <script setup>
17
+ import { ElCheckbox, ElCheckboxGroup } from 'element-plus'
18
+ import { useAttrs, computed, inject } from 'vue'
19
+ import { commonPropsType, hasOwn } from '../../utils/index.js'
20
+
21
+ const props = defineProps({
22
+ ...ElCheckbox.props,
23
+ ...commonPropsType,
24
+ })
25
+
26
+ const lang = inject('lang')
27
+
28
+ const label = computed(() => {
29
+ return lang.value.indexOf('zh') > -1 ? (props.config?.labelZh || props.config?.metaNameZh) : (props.config?.labelEn || props.config?.metaNameEn)
30
+ })
31
+
32
+ const checkboxGroupProps = computed(() => {
33
+ const ret = Object.keys(ElCheckboxGroup.props).reduce((ret, key) => {
34
+ ret[key] = props[key]
35
+ return ret
36
+ }, {})
37
+ return ret
38
+ })
39
+
40
+ const checkboxProps = computed(() => {
41
+ const ret = Object.keys(ElCheckbox.props).reduce((ret, key) => {
42
+ ret[key] = props[key]
43
+ return ret
44
+ }, {})
45
+ if (!hasOwn(props.config, 'true-value') && !hasOwn(props.config, 'trueValue')) {
46
+ ret['true-value'] = '1'
47
+ }
48
+ if (!hasOwn(props.config, 'false-value') && !hasOwn(props.config, 'falseValue')) {
49
+ ret['false-value'] = '0'
50
+ }
51
+ return ret
52
+ })
53
+ const attrs = useAttrs()
54
+ const modeValue = defineModel()
55
+ </script>
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <ElDatePicker v-bind="{ ...attrs, ...datePickerProps}" :disabledDate="disabledDate" v-model="modeValue"></ElDatePicker>
3
+ </template>
4
+ <script setup>
5
+ import { ElDatePicker } from 'element-plus'
6
+ import { useAttrs, computed } from 'vue'
7
+ import { commonPropsType, formatDate, isDate } from '../../utils/index.js'
8
+
9
+ const props = defineProps({
10
+ min: {
11
+ type: [Date, String],
12
+ default: null
13
+ },
14
+ max: {
15
+ type: [Date, String],
16
+ default: null
17
+ },
18
+ ...ElDatePicker.props,
19
+ ...commonPropsType,
20
+ })
21
+
22
+ const datePickerProps = computed(() => {
23
+ const ret = Object.keys(ElDatePicker.props).reduce((ret, key) => {
24
+ ret[key] = props[key]
25
+ return ret
26
+ }, {})
27
+ if (!ret['value-format'] && !ret.valueFormat) {
28
+ ret.valueFormat = 'YYYY-MM-DD'
29
+ }
30
+
31
+ return ret
32
+ })
33
+ const attrs = useAttrs()
34
+ const modeValue = defineModel()
35
+
36
+
37
+ const disabledDate = (date) => {
38
+ let dateTime = formatDate(date, 'yyyy-MM-dd')
39
+ const newDate = new Date(dateTime)
40
+ if (props.min) {
41
+ if (isDate(props.min)) {
42
+ return props.min.getTime() > newDate.getTime()
43
+ }
44
+ if (typeof props.min === 'string') {
45
+ return new Date(props.min).getTime() > newDate.getTime()
46
+ }
47
+ }
48
+ if (props.max) {
49
+ if (isDate(props.max)) {
50
+ return props.max.getTime() < newDate.getTime()
51
+ }
52
+ if (typeof props.max === 'string') {
53
+ return new Date(props.max).getTime() < newDate.getTime()
54
+ }
55
+ }
56
+ return false
57
+ }
58
+ </script>
@@ -0,0 +1,23 @@
1
+ <script setup>
2
+ import { ElInput } from 'element-plus'
3
+ import { computed, defineProps, useAttrs } from 'vue'
4
+ import { commonPropsType } from '../../utils/index.js'
5
+
6
+ const props = defineProps({
7
+ ...commonPropsType,
8
+ ...ElInput.props
9
+ })
10
+ const inputProps = computed(() => {
11
+ const ret = Object.keys(ElInput.props).reduce((total, key) => {
12
+ total[key] = props[key]
13
+ return total
14
+ }, {})
15
+ return ret
16
+ })
17
+ const attrs = useAttrs()
18
+ const modelValue = defineModel()
19
+
20
+ </script>
21
+ <template>
22
+ <ElInput v-model="modelValue" v-bind="{...attrs, ...inputProps}"></ElInput>
23
+ </template>
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <ElInputNumber v-bind="{...inputNumberProps, ...attrs}" @blur="normalValue" :class="[textAlignClass]" :key="updateKey" v-model="modeValue"></ElInputNumber>
3
+ </template>
4
+ <script setup>
5
+ import { ElInputNumber } from 'element-plus'
6
+ import { useAttrs, computed, ref } from 'vue'
7
+ import { commonPropsType, isDate } from '../../utils/index.js'
8
+
9
+ const props = defineProps({
10
+ textAlign: {
11
+ type: String, // left、right
12
+ default: ''
13
+ },
14
+ ...ElInputNumber.props,
15
+ ...commonPropsType,
16
+ })
17
+ const textAlignClass = computed(() => {
18
+ return props.textAlign === 'right' ? 'text-right' :
19
+ props.textAlign === 'left' ? 'text-left' : ''
20
+ })
21
+ const inputNumberProps = computed(() => {
22
+ const ret = Object.keys(ElInputNumber.props).reduce((ret, key) => {
23
+ ret[key] = props[key]
24
+ return ret
25
+ }, {})
26
+
27
+ return ret
28
+ })
29
+ const attrs = useAttrs()
30
+ const modeValue = defineModel()
31
+ // 目前有问题,可以输入--跟e字符串
32
+ const updateKey = ref(false)
33
+ const normalValue = () => {
34
+ if (modeValue.value === null) {
35
+ updateKey.value = !updateKey.value
36
+ }
37
+ }
38
+ </script>
39
+ <style lang="scss">
40
+ .text-right {
41
+ .el-input__wrapper {
42
+ input {
43
+ text-align: right;
44
+ }
45
+ }
46
+ }
47
+ .text-left {
48
+ .el-input__wrapper {
49
+ input {
50
+ text-align: left;
51
+ }
52
+ }
53
+ }
54
+ </style>
@@ -0,0 +1,56 @@
1
+ <script setup>
2
+ import { ElPagination } from 'element-plus'
3
+ import { computed, defineProps, useAttrs } from 'vue'
4
+ import { commonPropsType, hasOwn } from '../../utils/index.js'
5
+
6
+ const props = defineProps({
7
+ ...commonPropsType,
8
+ ...ElPagination.props,
9
+ })
10
+ const calcProps = computed(() => {
11
+ const ret = Object.keys(ElPagination.props).reduce((total, key) => {
12
+ total[key] = props[key]
13
+ return total
14
+ }, {})
15
+ if (!props.config['page-sizes'] && !props.config['pageSizes']) {
16
+ ret['pageSizes'] = [5, 10, 20, 30]
17
+ }
18
+ if (!ret.layout || typeof ret.layout !== 'string') {
19
+ ret.layout = 'total'
20
+ }
21
+ if (props.config?.showSizer === '1' || props.config?.showJumper === '1') {
22
+ const layoutArr = ret.layout ? ret.layout.split(',') : []
23
+ if (props.config?.showSizer === '1') {
24
+ if (!layoutArr.some(item => item.trim() === 'sizes')) {
25
+ layoutArr.splice(1, 0, 'sizes')
26
+ }
27
+ }
28
+ if (!layoutArr.some(item => item.trim() === 'prev')) {
29
+ layoutArr.splice(2, 0, 'prev')
30
+ }
31
+ if (!layoutArr.some(item => item.trim() === 'pager')) {
32
+ layoutArr.splice(3, 0, 'pager')
33
+ }
34
+ if (!layoutArr.some(item => item.trim() === 'next')) {
35
+ layoutArr.splice(4, 0, 'next')
36
+ }
37
+ if (props.config?.showJumper === '1') {
38
+ if (!layoutArr.some(item => item.trim() === 'jumper')) {
39
+ layoutArr.push('jumper')
40
+ }
41
+ }
42
+ ret.layout = layoutArr.join(',')
43
+ }
44
+
45
+ if (!hasOwn(props.config, 'background')) {
46
+ ret.background = true
47
+ }
48
+ return ret
49
+ })
50
+ const attrs = useAttrs()
51
+ const modelValue = defineModel()
52
+
53
+ </script>
54
+ <template>
55
+ <ElPagination v-bind="{...attrs, ...calcProps}"></ElPagination>
56
+ </template>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <el-radio-group v-bind="{...radioGroupProps, ...attrs}" v-model="modeValue">
3
+ <CurrentRadio v-for="option in props.options"
4
+ :key="option.columnValue"
5
+ :value="option.columnValue"
6
+ >
7
+ {{lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc}}
8
+ </CurrentRadio>
9
+ </el-radio-group>
10
+ </template>
11
+ <script setup>
12
+ import { ElRadioGroup, ElRadio, ElRadioButton } from 'element-plus'
13
+ import { useAttrs, computed, inject, ref } from 'vue'
14
+ import { commonPropsType, hasOwn } from '../../utils/index.js'
15
+
16
+ const props = defineProps({
17
+ ...ElRadioGroup.props,
18
+ ...commonPropsType,
19
+ })
20
+
21
+ // 两种样式,一种是button,一种是default,默认为default
22
+ const type = computed(() => {
23
+ return props.config.type || 'default'
24
+ })
25
+
26
+ const CurrentRadio = computed(() => {
27
+ return type.value === 'button' ? ElRadioButton : ElRadio
28
+ })
29
+
30
+ const lang = inject('lang')
31
+
32
+ const radioGroupProps = computed(() => {
33
+ const ret = Object.keys(ElRadioGroup.props).reduce((ret, key) => {
34
+ ret[key] = props[key]
35
+ return ret
36
+ }, {})
37
+ if (!hasOwn(ret, 'value')) {
38
+ ret.value = '1'
39
+ }
40
+ return ret
41
+ })
42
+ const attrs = useAttrs()
43
+ const modeValue = defineModel()
44
+ </script>
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <ElSelect class="custom-self-select" v-bind="{...selectProps, ...attrs }" v-model="value" @clear="clear">
3
+ <ElOption v-for="option in props.options"
4
+ :key="option.columnValue"
5
+ :label="lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc"
6
+ :value="option.columnValue"
7
+ :disabled="option.columnStatus == '0' || option.columnStatus == '2'"
8
+ />
9
+ </ElSelect>
10
+ </template>
11
+ <script setup>
12
+ import { ElSelect, ElOption } from 'element-plus'
13
+ import { computed, defineProps, inject, useAttrs } from 'vue'
14
+ import { commonPropsType } from '../../utils/index.js'
15
+
16
+ const modelValue = defineModel()
17
+ const props = defineProps({
18
+ ...ElSelect.props,
19
+ ...commonPropsType
20
+ })
21
+ const attrs = useAttrs()
22
+
23
+ const value = computed({
24
+ get() {
25
+ if (isMutiple.value) {
26
+ const val = modelValue.value || ''
27
+ return val ? val.split(',') : []
28
+ } else {
29
+ if (modelValue.value !== null && modelValue.value !== undefined) {
30
+ if (props.options?.some(item => item.columnValue == modelValue.value)) {
31
+ props.config.isMatch = true
32
+ return `${modelValue.value}`
33
+ } else {
34
+ props.config.isMatch = false
35
+ return ''
36
+ }
37
+ } else {
38
+ return ''
39
+ }
40
+ }
41
+ },
42
+ set(val) {
43
+ if (isMutiple.value) {
44
+ modelValue.value = val.join(',')
45
+ } else {
46
+ modelValue.value = val
47
+ }
48
+ }
49
+ })
50
+ // 是否为多选
51
+ const isMutiple = computed(() => {
52
+ return props.multiple
53
+ })
54
+
55
+ const selectProps = computed(() => {
56
+ const attrs = Object.keys(ElSelect.props).reduce((ret, key) => {
57
+ ret[key] = props[key]
58
+ return ret
59
+ }, {})
60
+ if (attrs.placeholder === null || attrs.placeholder === undefined) {
61
+ attrs.placeholder = ''
62
+ }
63
+ return attrs
64
+ })
65
+ const lang = inject('lang')
66
+ const clear = () => {
67
+ modelValue.value = ''
68
+ }
69
+ </script>
70
+ <style lang="scss">
71
+ .custom-self-select {
72
+ }
73
+ </style>
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <ElText v-bind="{...elRowProps, ...attrs}" @click="clickAction" >
3
+ {{props.refValue.value}}
4
+ </ElText>
5
+ </template>
6
+ <script setup>
7
+ import { ElText } from 'element-plus'
8
+ import { computed, defineProps, inject, getCurrentInstance, useAttrs } from 'vue'
9
+ import { commonPropsType } from '../../utils/index.js'
10
+ const appContext = getCurrentInstance()?.appContext
11
+
12
+ const props = defineProps({
13
+ ...commonPropsType,
14
+ ...ElText.props
15
+ })
16
+ const attrs = useAttrs()
17
+
18
+ const elRowProps = computed(() => {
19
+ return Object.keys(ElText.props).reduce((ret, key) => {
20
+ ret[key] = props[key]
21
+ return ret
22
+ }, {})
23
+ })
24
+ const buttonActions = inject('buttonActions', {})
25
+
26
+ const dynamicMapComp = inject('dynamicMapComp')
27
+ const hireRelatMapRules = inject('hireRelatMapRules')
28
+ const components = inject('components')
29
+ const selects = inject('selects')
30
+ const rootValue = inject('rootValue')
31
+ const dataLoad = inject('dataLoad')
32
+ const rootForm = inject('rootForm')
33
+
34
+ const clickAction = (e) => {
35
+ attrs?.onClick?.(e) // 如果配置中有点击事件
36
+ const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
37
+ const actionFn = buttonActions[actionKey]
38
+ actionFn && actionFn(props, {
39
+ dynamicMapComp,
40
+ hireRelatMapRules,
41
+ components,
42
+ selects,
43
+ rootValue,
44
+ dataLoad,
45
+ rootForm
46
+ }, appContext)
47
+ }
48
+ </script>
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <ElTimePicker v-bind="calcProps" v-model="modeValue"></ElTimePicker>
3
+ </template>
4
+ <script setup>
5
+ import { ElTimePicker } from "element-plus"
6
+ import { useAttrs, computed, ref, watch } from "vue"
7
+ import { commonPropsType, isDate } from "../../utils/index.js"
8
+
9
+ const attrs = useAttrs()
10
+ const props = defineProps({
11
+ min: {
12
+ type: [Date, String],
13
+ default: null
14
+ },
15
+ max: {
16
+ type: [Date, String],
17
+ default: null
18
+ },
19
+ ...ElTimePicker.props,
20
+ ...commonPropsType
21
+ })
22
+ const calcProps = computed(() => {
23
+ const ret = Object.keys(ElTimePicker.props).reduce((ret, key) => {
24
+ ret[key] = props[key]
25
+ return ret
26
+ }, {...attrs})
27
+
28
+ delete ret.modelValue
29
+ delete ret.defaultValue
30
+ return ret
31
+ })
32
+
33
+ const modeValue = defineModel()
34
+ </script>
@@ -0,0 +1,46 @@
1
+ let composeKeys = null
2
+ let composeComponents = null
3
+
4
+ export default function () {
5
+ if (!composeComponents || !composeKeys) {
6
+ let modulesFiles = {}
7
+ let modulesFilesKeys = []
8
+ let resolveModule = null
9
+ try {
10
+ if (require) {
11
+ modulesFiles = require.context('./packages', false, /\.(vue|jsx|js)$/)
12
+ modulesFilesKeys = modulesFiles.keys() || []
13
+ resolveModule = (modulePath) => {
14
+ return modulesFiles(modulePath)
15
+ }
16
+ }
17
+ } catch (error) {
18
+ modulesFiles = import.meta.glob('./packages/*.{vue,jsx,js}')
19
+ modulesFilesKeys = Object.keys(modulesFiles)
20
+ resolveModule = (modulePath) => {
21
+ return modulesFiles[modulePath]
22
+ }
23
+ }
24
+
25
+ const keys = modulesFilesKeys.map(modulePath => modulePath.replace(/(.*\/)*([^.]+).*/ig,"$2"))
26
+ const components = modulesFilesKeys.reduce((retObj, modulePath) => {
27
+ const moduleName = modulePath.replace(/(.*\/)*([^.]+).*/ig,"$2")
28
+ const value = resolveModule(modulePath)
29
+ retObj[moduleName] = value.default || value
30
+ return retObj
31
+ }, {})
32
+
33
+ composeKeys = [
34
+ // ...dynamicKeys,
35
+ ...keys
36
+ ]
37
+ composeComponents = {
38
+ // ...dynamicComponents,
39
+ ...components
40
+ }
41
+ }
42
+ return {
43
+ composeKeys,
44
+ composeComponents
45
+ }
46
+ }