resolver-egretimp-plus 0.1.119 → 0.1.121

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 (225) hide show
  1. package/dist/h5/index.js +18 -18
  2. package/dist/web/index.js +11 -11
  3. package/package.json +1 -1
  4. package/src/components/options/OptionsDefault.vue +0 -1
  5. package/src/components/packages-web/CustomComponentCycle.vue +38 -33
  6. package/src/components/packages-web/CustomComponentCycleTabPane.vue +40 -33
  7. package/src/components/packages-web/CustomComponentPlain.vue +6 -5
  8. package/src/components/packages-web/CustomComponentTable.jsx +48 -40
  9. package/src/components/packages-web/ElInput copy.jsx +0 -1
  10. package/src/components/packages-web/ElInput.jsx +0 -1
  11. package/src/config.js +2 -0
  12. package/src/hooks/pageConfig.js +10 -4
  13. package/src/index.jsx +15 -10
  14. package/src/renderer.jsx +4 -1
  15. package/src/resolver-common.vue +22 -2
  16. package/src/rules/rulesDriver.js +4 -0
  17. package/src/utils/common.js +13 -0
  18. package/src/utils/render.jsx +196 -96
  19. package/src-bak/analysisComponent.jsx +0 -343
  20. package/src-bak/api/builtIn.js +0 -10
  21. package/src-bak/bpm/bpmInstance.js +0 -388
  22. package/src-bak/bpm/udc-sdk-esm/cjs/impl/application.js +0 -8
  23. package/src-bak/bpm/udc-sdk-esm/cjs/impl/component.js +0 -97
  24. package/src-bak/bpm/udc-sdk-esm/cjs/impl/datasource.js +0 -88
  25. package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/index.js +0 -3
  26. package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/UdcComponent.js +0 -76
  27. package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/index.js +0 -201
  28. package/src-bak/bpm/udc-sdk-esm/cjs/impl/index.js +0 -69
  29. package/src-bak/bpm/udc-sdk-esm/cjs/impl/page.js +0 -56
  30. package/src-bak/bpm/udc-sdk-esm/cjs/impl/utils.js +0 -76
  31. package/src-bak/bpm/udc-sdk-esm/cjs/index.js +0 -46
  32. package/src-bak/bpm/udc-sdk-esm/cjs/utils.js +0 -21
  33. package/src-bak/components/childDialog/index.js +0 -39
  34. package/src-bak/components/childDialog/src/index.vue +0 -185
  35. package/src-bak/components/cmiFormItem/index.js +0 -1
  36. package/src-bak/components/cmiFormItem/src/index.vue +0 -112
  37. package/src-bak/components/confirmInstance-H5/index.js +0 -53
  38. package/src-bak/components/confirmInstance-H5/src/index.vue +0 -54
  39. package/src-bak/components/helper/FormPolyfill.jsx +0 -25
  40. package/src-bak/components/helper/calcTooltip.jsx +0 -134
  41. package/src-bak/components/helper/dock.js +0 -141
  42. package/src-bak/components/helper/eventOrchestration.js +0 -763
  43. package/src-bak/components/helper/resolver.js +0 -163
  44. package/src-bak/components/helper/table.jsx +0 -103
  45. package/src-bak/components/icons/date.vue +0 -33
  46. package/src-bak/components/icons/info.vue +0 -62
  47. package/src-bak/components/icons/loading.vue +0 -19
  48. package/src-bak/components/icons/question-filled.vue +0 -8
  49. package/src-bak/components/loading/index.js +0 -6
  50. package/src-bak/components/loading/loading.js +0 -98
  51. package/src-bak/components/loading/loading.scss +0 -74
  52. package/src-bak/components/loading/loading.vue +0 -89
  53. package/src-bak/components/loadingComponent/LoadingComponent.vue +0 -33
  54. package/src-bak/components/modal/index.js +0 -9
  55. package/src-bak/components/modal/modal.scss +0 -195
  56. package/src-bak/components/modal/modal.vue +0 -201
  57. package/src-bak/components/options/OptionsDefault.vue +0 -47
  58. package/src-bak/components/packages-H5/CmiButton.vue +0 -120
  59. package/src-bak/components/packages-H5/CmiCalendar.vue +0 -152
  60. package/src-bak/components/packages-H5/CmiCell.vue +0 -87
  61. package/src-bak/components/packages-H5/CmiCheckbox.vue +0 -82
  62. package/src-bak/components/packages-H5/CmiDatetimePicker.vue +0 -98
  63. package/src-bak/components/packages-H5/CmiDivider.vue +0 -30
  64. package/src-bak/components/packages-H5/CmiDropdownMenu.vue +0 -58
  65. package/src-bak/components/packages-H5/CmiInput.vue +0 -69
  66. package/src-bak/components/packages-H5/CmiLink.vue +0 -28
  67. package/src-bak/components/packages-H5/CmiPicker.vue +0 -229
  68. package/src-bak/components/packages-H5/CmiRadio.vue +0 -29
  69. package/src-bak/components/packages-H5/CmiSearch.vue +0 -39
  70. package/src-bak/components/packages-H5/CmiSelect.vue +0 -84
  71. package/src-bak/components/packages-H5/CustomComponentCardH5.vue +0 -129
  72. package/src-bak/components/packages-H5/CustomComponentColH5.vue +0 -8
  73. package/src-bak/components/packages-H5/CustomComponentCollapseH5.vue +0 -141
  74. package/src-bak/components/packages-H5/CustomComponentFormLayoutH5.vue +0 -54
  75. package/src-bak/components/packages-H5/CustomComponentTabPaneH5.vue +0 -38
  76. package/src-bak/components/packages-H5/CustomComponentTableH5.vue +0 -352
  77. package/src-bak/components/packages-H5/CustomComponentTabsH5.vue +0 -170
  78. package/src-bak/components/packages-web/CustomComponentCard.vue +0 -40
  79. package/src-bak/components/packages-web/CustomComponentCol.vue +0 -66
  80. package/src-bak/components/packages-web/CustomComponentCollapse.vue +0 -164
  81. package/src-bak/components/packages-web/CustomComponentCycle.vue +0 -95
  82. package/src-bak/components/packages-web/CustomComponentCycleTabPane.vue +0 -155
  83. package/src-bak/components/packages-web/CustomComponentDialog.vue +0 -192
  84. package/src-bak/components/packages-web/CustomComponentEditor.vue +0 -50
  85. package/src-bak/components/packages-web/CustomComponentFileExport.vue +0 -60
  86. package/src-bak/components/packages-web/CustomComponentFileImport.vue +0 -60
  87. package/src-bak/components/packages-web/CustomComponentFormLayout.vue +0 -65
  88. package/src-bak/components/packages-web/CustomComponentGrid.vue +0 -29
  89. package/src-bak/components/packages-web/CustomComponentGridCol.vue +0 -29
  90. package/src-bak/components/packages-web/CustomComponentInputDialog.vue +0 -144
  91. package/src-bak/components/packages-web/CustomComponentNativeTabPane.vue +0 -84
  92. package/src-bak/components/packages-web/CustomComponentPlain.vue +0 -247
  93. package/src-bak/components/packages-web/CustomComponentRow.vue +0 -83
  94. package/src-bak/components/packages-web/CustomComponentSelectEmployees.vue +0 -203
  95. package/src-bak/components/packages-web/CustomComponentSendMail.vue +0 -62
  96. package/src-bak/components/packages-web/CustomComponentSteps.vue +0 -41
  97. package/src-bak/components/packages-web/CustomComponentTabPane.vue +0 -20
  98. package/src-bak/components/packages-web/CustomComponentTable.jsx +0 -814
  99. package/src-bak/components/packages-web/CustomComponentTabs.vue +0 -126
  100. package/src-bak/components/packages-web/CustomComponentTree.vue +0 -28
  101. package/src-bak/components/packages-web/ElButton.vue +0 -146
  102. package/src-bak/components/packages-web/ElCheckbox.vue +0 -97
  103. package/src-bak/components/packages-web/ElDatePicker.vue +0 -93
  104. package/src-bak/components/packages-web/ElInput copy.jsx +0 -393
  105. package/src-bak/components/packages-web/ElInput.jsx +0 -312
  106. package/src-bak/components/packages-web/ElInputNumber.vue +0 -81
  107. package/src-bak/components/packages-web/ElPagination.vue +0 -61
  108. package/src-bak/components/packages-web/ElRadio.vue +0 -47
  109. package/src-bak/components/packages-web/ElSelect.jsx +0 -249
  110. package/src-bak/components/packages-web/ElSelect_bak.vue +0 -155
  111. package/src-bak/components/packages-web/ElText.jsx +0 -187
  112. package/src-bak/components/packages-web/ElTextaa.vue +0 -169
  113. package/src-bak/components/packages-web/ElTimePicker.vue +0 -39
  114. package/src-bak/components/patchComponents-H5.js +0 -46
  115. package/src-bak/components/patchComponents-web.js +0 -46
  116. package/src-bak/components/simpleFormItemPc/index.js +0 -1
  117. package/src-bak/components/simpleFormItemPc/src/index.vue +0 -94
  118. package/src-bak/components/table/index.ts +0 -29
  119. package/src-bak/components/table/src/composables/use-scrollbar.ts +0 -30
  120. package/src-bak/components/table/src/config.ts +0 -256
  121. package/src-bak/components/table/src/filter-panel.vue +0 -260
  122. package/src-bak/components/table/src/h-helper.ts +0 -34
  123. package/src-bak/components/table/src/layout-observer.ts +0 -78
  124. package/src-bak/components/table/src/store/current.ts +0 -85
  125. package/src-bak/components/table/src/store/expand.ts +0 -76
  126. package/src-bak/components/table/src/store/helper.ts +0 -74
  127. package/src-bak/components/table/src/store/index.ts +0 -246
  128. package/src-bak/components/table/src/store/tree.ts +0 -230
  129. package/src-bak/components/table/src/store/watcher.ts +0 -543
  130. package/src-bak/components/table/src/table/defaults.ts +0 -402
  131. package/src-bak/components/table/src/table/key-render-helper.ts +0 -27
  132. package/src-bak/components/table/src/table/style-helper.ts +0 -378
  133. package/src-bak/components/table/src/table/utils-helper.ts +0 -47
  134. package/src-bak/components/table/src/table-body/defaults.ts +0 -52
  135. package/src-bak/components/table/src/table-body/events-helper.ts +0 -203
  136. package/src-bak/components/table/src/table-body/index.ts +0 -119
  137. package/src-bak/components/table/src/table-body/render-helper.ts +0 -283
  138. package/src-bak/components/table/src/table-body/styles-helper.ts +0 -164
  139. package/src-bak/components/table/src/table-column/defaults.ts +0 -237
  140. package/src-bak/components/table/src/table-column/index.ts +0 -202
  141. package/src-bak/components/table/src/table-column/render-helper.ts +0 -214
  142. package/src-bak/components/table/src/table-column/watcher-helper.ts +0 -88
  143. package/src-bak/components/table/src/table-footer/index.ts +0 -128
  144. package/src-bak/components/table/src/table-footer/mapState-helper.ts +0 -33
  145. package/src-bak/components/table/src/table-footer/style-helper.ts +0 -51
  146. package/src-bak/components/table/src/table-header/event-helper.ts +0 -213
  147. package/src-bak/components/table/src/table-header/index.ts +0 -244
  148. package/src-bak/components/table/src/table-header/style.helper.ts +0 -119
  149. package/src-bak/components/table/src/table-header/utils-helper.ts +0 -94
  150. package/src-bak/components/table/src/table-layout.ts +0 -259
  151. package/src-bak/components/table/src/table.vue +0 -389
  152. package/src-bak/components/table/src/tableColumn.ts +0 -3
  153. package/src-bak/components/table/src/tokens.ts +0 -5
  154. package/src-bak/components/table/src/util.ts +0 -521
  155. package/src-bak/components/table/style/css.ts +0 -5
  156. package/src-bak/components/table/style/index.ts +0 -5
  157. package/src-bak/components/tabs/index.js +0 -8
  158. package/src-bak/components/tabs/src/constants.js +0 -23
  159. package/src-bak/components/tabs/src/tab-bar.js +0 -8
  160. package/src-bak/components/tabs/src/tab-bar.vue +0 -92
  161. package/src-bak/components/tabs/src/tab-nav.jsx +0 -424
  162. package/src-bak/components/tabs/src/tab-pane.js +0 -16
  163. package/src-bak/components/tabs/src/tab-pane.vue +0 -80
  164. package/src-bak/components/tabs/src/tabs.jsx +0 -223
  165. package/src-bak/components/tabs/style/css.js +0 -2
  166. package/src-bak/components/tabs/style/index.js +0 -2
  167. package/src-bak/components/thirdPartyFrame/index.js +0 -32
  168. package/src-bak/components/thirdPartyFrame/src/ThirdPartyFrame.vue +0 -125
  169. package/src-bak/enums/index.js +0 -16
  170. package/src-bak/hooks/configLoad.js +0 -45
  171. package/src-bak/hooks/index.js +0 -189
  172. package/src-bak/hooks/mock.js +0 -6960
  173. package/src-bak/hooks/pageConfig.js +0 -127
  174. package/src-bak/index.jsx +0 -443
  175. package/src-bak/renderer.jsx +0 -77
  176. package/src-bak/resolver-H5.vue +0 -88
  177. package/src-bak/resolver-common.vue +0 -129
  178. package/src-bak/resolver-web.vue +0 -91
  179. package/src-bak/rules/eventsSupplement.js +0 -573
  180. package/src-bak/rules/parseCondition.js +0 -378
  181. package/src-bak/rules/ruleUtils.js +0 -273
  182. package/src-bak/rules/rulesDriver.js +0 -139
  183. package/src-bak/rulesImp/events.js +0 -588
  184. package/src-bak/rulesImp/index.js +0 -33
  185. package/src-bak/rulesImp/ruleInstance.js +0 -231
  186. package/src-bak/rulesImp/ruleUtils.js +0 -124
  187. package/src-bak/theme/element/components/button.scss +0 -122
  188. package/src-bak/theme/element/components/card.scss +0 -8
  189. package/src-bak/theme/element/components/checkbox.scss +0 -19
  190. package/src-bak/theme/element/components/collapse.scss +0 -174
  191. package/src-bak/theme/element/components/common.scss +0 -30
  192. package/src-bak/theme/element/components/cycle.scss +0 -0
  193. package/src-bak/theme/element/components/date.scss +0 -13
  194. package/src-bak/theme/element/components/dialog.scss +0 -44
  195. package/src-bak/theme/element/components/form.scss +0 -104
  196. package/src-bak/theme/element/components/index.scss +0 -55
  197. package/src-bak/theme/element/components/input.scss +0 -36
  198. package/src-bak/theme/element/components/message.scss +0 -48
  199. package/src-bak/theme/element/components/pagination.scss +0 -47
  200. package/src-bak/theme/element/components/popper.scss +0 -3
  201. package/src-bak/theme/element/components/radio.scss +0 -40
  202. package/src-bak/theme/element/components/scrollbar.scss +0 -14
  203. package/src-bak/theme/element/components/select.scss +0 -82
  204. package/src-bak/theme/element/components/steps.scss +0 -6
  205. package/src-bak/theme/element/components/table.scss +0 -218
  206. package/src-bak/theme/element/components/tabs.scss +0 -128
  207. package/src-bak/theme/element/components/tag.scss +0 -6
  208. package/src-bak/theme/element/components/text.scss +0 -20
  209. package/src-bak/theme/element/components/textarea.scss +0 -3
  210. package/src-bak/theme/element/components/tree.scss +0 -0
  211. package/src-bak/theme/element/index.scss +0 -55
  212. package/src-bak/utils/cipher.js +0 -141
  213. package/src-bak/utils/common.js +0 -664
  214. package/src-bak/utils/const.js +0 -259
  215. package/src-bak/utils/defaultVal.js +0 -92
  216. package/src-bak/utils/dom.js +0 -36
  217. package/src-bak/utils/format.js +0 -19
  218. package/src-bak/utils/index.js +0 -4
  219. package/src-bak/utils/is.js +0 -74
  220. package/src-bak/utils/loadModule.js +0 -75
  221. package/src-bak/utils/preserveFunc.js +0 -33
  222. package/src-bak/utils/render.jsx +0 -1138
  223. package/src-bak/utils/request.js +0 -136
  224. package/src-bak/utils/respone.js +0 -70
  225. package/src-bak/utils/valid.js +0 -89
@@ -1,152 +0,0 @@
1
- <script setup>
2
- import { computed, defineProps, watch, inject, ref, useAttrs } from 'vue'
3
- import { commonPropsType } from '../../utils/index.js'
4
- import dayjs from "dayjs"
5
-
6
- const calendarRef = ref(null)
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
- const format = computed(() => {
28
- return props?.config?.format || "YYYY-MM-DD"
29
- })
30
-
31
- const formatValue = computed({
32
- get() {
33
- return modelValue.value
34
- },
35
- set(val) {
36
- let valueArr = Array.isArray(val) ? val : [val]
37
- let formatVal = valueArr.reduce((pre, cur, i) => {
38
- pre = pre + dayjs(cur).format(format.value) + (i === valueArr.length - 1 ? "" : ",")
39
- return pre
40
- }, "")
41
- modelValue.value = formatVal
42
- }
43
- })
44
-
45
- const separator = computed(() => {
46
- if (props?.config?.displayType === "multiple") {
47
- return "; "
48
- } else if (props?.config?.displayType === "range") {
49
- return " ~ "
50
- }
51
- return ""
52
- })
53
-
54
- const valueDesc = computed(() => {
55
- let desc = ""
56
- if (formatValue.value) {
57
- let valueArr = formatValue.value.split(",")
58
- desc = valueArr.reduce((pre, cur, i) => {
59
- pre = pre + dayjs(cur).format(format.value) + (i === valueArr.length - 1 ? "" : separator.value)
60
- return pre
61
- }, "")
62
- }
63
- return desc
64
- })
65
-
66
- const calcProps = computed(() => {
67
- const ret = {
68
- type: props?.config?.displayType,
69
- title: lang.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
70
- readonly: props?.config?.readonly == '1',
71
- tiled: props?.config?.tiled == '1',
72
- mindate: props?.config?.mindate,
73
- maxdate: props?.config?.maxdate,
74
- hidemark: props?.config?.hidemark == '1',
75
- hidetitle: props?.config?.hidetitle == '1',
76
- hidesubtitle: props?.config?.hidesubtitle == '1',
77
- hideconfirm: props?.config?.hideconfirm == '1',
78
- eagerrender: props?.config?.eagerrender == '1',
79
- confirmtext: props?.config?.confirmtext,
80
- confirmdisabledtext: props?.config?.confirmdisabledtext,
81
- weekfirstday: props?.config?.weekfirstday,
82
- forbidmaskclick: props?.config?.forbidmaskclick == '1',
83
-
84
- maxrange: props?.config?.maxrange,
85
- rangeprompt: props?.config?.rangeprompt,
86
- hiderangeprompt: props?.config?.hiderangeprompt == '1',
87
- allowsameday: props?.config?.allowsameday == '1',
88
- }
89
- return ret
90
- })
91
- const onClose = () => {
92
- props.config?.onClose?.()
93
- open.value = false
94
- }
95
- const onConfirm = (e) => {
96
- formatValue.value = e.detail.value
97
- props.config?.onConfirm?.(formatValue.value)
98
- open.value = false
99
- }
100
-
101
- let setValueUnWatch = null
102
- watch(() => {
103
- return calcProps.tiled
104
- }, (val) => {
105
- setValueUnWatch && setValueUnWatch()
106
- if (val) {
107
- setValueUnWatch = watch(formatValue, (val) => {
108
- let valueArr = val.split(",")
109
- if (calcProps.type == single) {
110
- calendarRef.value?.setValue?.(dayjs(valueArr[0])?.toDate())
111
- } else {
112
- calendarRef.value?.setValue?.(valueArr?.map(curVal => dayjs(curVal)?.toDate()) || [])
113
- }
114
- })
115
- }
116
- }, {
117
- immediate: true
118
- })
119
-
120
- const inputProps = computed(() => {
121
- return {
122
- placeholder: lang?.value?.indexOf('zh') > -1 ? props.config?.defPlacehold : props.config?.defPlaceholdEn,
123
- disabled: props.disabled
124
- }
125
- })
126
-
127
- const onFocus = (e) => {
128
- open.value = true
129
- e.preventDefault()
130
- e.stopPropagation()
131
- e.target.blur()
132
- }
133
-
134
- </script>
135
-
136
- <template>
137
- <cmi-input v-if="!calcProps.tiled" :value="valueDesc" suffixIcon @focus="onFocus" v-bind="{...attrs, ...inputProps}">
138
- <div slot="suffix" v-if="suffixIcon">
139
- <component :is="`cmi-icon-${suffixIcon}`" color="#4E5969"></component>
140
- </div>
141
- <span slot="prefix" v-if="prefixIcon">
142
- <component :is="`cmi-icon-${prefixIcon}`" color="#4E5969"></component>
143
- </span>
144
- </cmi-input>
145
- <cmi-calendar
146
- ref="calendarRef"
147
- v-bind="{...attrs, ...calcProps}"
148
- :open="open"
149
- @close="onClose"
150
- @confirm="onConfirm"
151
- />
152
- </template>
@@ -1,87 +0,0 @@
1
- <script setup>
2
- import { computed, defineProps, inject, useAttrs } from 'vue'
3
- import { commonPropsType, formatDate, formatAmount, hasOwn } from '../../utils/index.js'
4
-
5
- const lang = inject('lang')
6
- const modelValue = defineModel()
7
- const props = defineProps({
8
- ...commonPropsType,
9
- formatter: {
10
- type: Function,
11
- default: null
12
- },
13
- titleFormatter: {
14
- type: Function,
15
- default: null
16
- }
17
- })
18
-
19
- const emptyValDisplay = props.config?.emptyValDisplay ?? "--"
20
-
21
- const normalVal = computed(() => {
22
- const findItem = props?.options?.find(item => item.columnValue == modelValue.value)
23
- if (findItem) {
24
- return lang?.value?.indexOf('zh') > -1 ? findItem.columnDesc_zh : findItem.columnDesc
25
- }
26
- return modelValue.value
27
- })
28
-
29
- const dateFormat = computed(() => {
30
- return props.config?.dateFormat
31
- })
32
-
33
- const amountFormat = computed(() => {
34
- return props.config?.amountFormat
35
- })
36
-
37
- const calcProps = computed(() => {
38
- let desc = normalVal.value ?? props.config?.desc
39
- let title = lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn
40
- try {
41
- if (desc?.toString) {
42
- desc = desc.toString()
43
- }
44
- if (dateFormat.value) {
45
- desc = formatDate(desc, dateFormat.value)
46
- }
47
- if (amountFormat.value) {
48
- desc = formatAmount(desc, amountFormat.value)
49
- }
50
- if (props.formatter && typeof props.formatter === "function") {
51
- desc = props.formatter(desc, props.config, props)
52
- }
53
- if (desc === "" || desc === undefined || desc === null) {
54
- desc = emptyValDisplay
55
- }
56
- if (props.titleFormatter && typeof props.titleFormatter === "function") {
57
- title = props.titleFormatter(title, props.config, props)
58
- }
59
- } catch (error) {
60
- console.log('CmiCell, error==:', error)
61
- }
62
- return {
63
- title,
64
- desc,
65
- content: props.config?.content,
66
- to: props.config?.toHref,
67
- islink: props.config?.islink == '1',
68
- icon: props.config?.icon,
69
- selfadaption: hasOwn(props.config, 'selfadaption') ? props.config.selfadaption == '1' : true,
70
- noborder: props.config?.noborder == '1' || props.config?.borderHidden == '1',
71
- }
72
- })
73
- const attrs = useAttrs()
74
- const onChange = (e) => {
75
- modelValue.value = e.detail.value
76
- }
77
-
78
- </script>
79
-
80
- <template>
81
- <cmi-cell-group>
82
- <cmi-cell
83
- v-bind="{ ...attrs, ...calcProps}"
84
- @change="onChange"
85
- ></cmi-cell>
86
- </cmi-cell-group>
87
- </template>
@@ -1,82 +0,0 @@
1
- <script setup>
2
- import { useAttrs, computed, inject } from 'vue'
3
- import { commonPropsType, hasOwn } from '../../utils/index.js'
4
-
5
- const props = defineProps({
6
- ...commonPropsType,
7
- })
8
-
9
- const lang = inject('lang')
10
-
11
- const label = computed(() => {
12
- return lang.value.indexOf('zh') > -1 ? (props.config?.labelZh || props.config?.metaNameZh) : (props.config?.labelEn || props.config?.metaNameEn)
13
- })
14
- // 是否为多选
15
- const isMutiple = computed(() => {
16
- return props.options && props.options.length
17
- })
18
-
19
- const checkboxGroupProps = computed(() => {
20
- return {
21
- direction: props.config?.direction,
22
- }
23
- })
24
-
25
- const checkboxProps = computed(() => {
26
- return {
27
- label: lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
28
- size: props?.config?.size,
29
- disabled: props.disabled,
30
- block: props?.config?.block == '1',
31
- indeterminate: props?.config?.indeterminate == '1',
32
- }
33
- })
34
- const attrs = useAttrs()
35
- const modelValue = defineModel()
36
-
37
- const proxyValue = computed({
38
- get() {
39
- if (isMutiple.value) {
40
- const val = modelValue.value || ''
41
- return val ? val.split(',') : []
42
- } else {
43
- return modelValue.value
44
- }
45
- },
46
- set(val) {
47
- if (isMutiple.value) {
48
- modelValue.value = val.join(',')
49
- } else {
50
- modelValue.value = val
51
- }
52
- }
53
- })
54
-
55
- const onChange = ({ detail }) => {
56
- proxyValue.value = detail.value
57
- }
58
- const onSigleChange = ({ detail }) => {
59
- proxyValue.value = detail.value ? '1' : '0'
60
- }
61
- </script>
62
-
63
- <template>
64
- <cmi-checkbox-group :value="proxyValue" @change="onChange" v-if="isMutiple" v-bind="{...attrs, ...checkboxGroupProps}">
65
- <cmi-checkbox
66
- class="mr-20"
67
- v-for="option in props.options" :key="option.columnValue"
68
- :disabled="props.disabled || option.columnStatus == '0' || option.columnStatus == '2'"
69
- :name="option.columnValue" :label="lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc"
70
- >
71
- {{lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc}}
72
- </cmi-checkbox>
73
- </cmi-checkbox-group>
74
- <cmi-checkbox v-else v-bind="{...attrs, ...checkboxProps}" :checked="proxyValue == '1'" :value="proxyValue" @change="onSigleChange">
75
- {{ label }}
76
- </cmi-checkbox>
77
- </template>
78
- <style lang="scss" scoped>
79
- .mr-20 {
80
- margin-right: 20px;
81
- }
82
- </style>
@@ -1,98 +0,0 @@
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
- const inputProps = computed(() => {
68
- return {
69
- placeholder: lang?.value?.indexOf('zh') > -1 ? props.config?.defPlacehold : props.config?.defPlaceholdEn,
70
- disabled: props.disabled
71
- }
72
- })
73
-
74
- const onFocus = (e) => {
75
- open.value = true
76
- e.preventDefault()
77
- e.stopPropagation()
78
- e.target.blur()
79
- }
80
-
81
- </script>
82
-
83
- <template>
84
- <cmi-input :value="formatValue" suffixIcon @focus="onFocus" v-bind="{...attrs, ...inputProps}">
85
- <div slot="suffix" v-if="suffixIcon">
86
- <component :is="`cmi-icon-${suffixIcon}`" color="#4E5969"></component>
87
- </div>
88
- <span slot="prefix" v-if="prefixIcon">
89
- <component :is="`cmi-icon-${prefixIcon}`" color="#4E5969"></component>
90
- </span>
91
- </cmi-input>
92
- <cmi-datetime-picker
93
- v-bind="{...attrs, ...calcProps}"
94
- :open="open"
95
- @close="onClose"
96
- @confirm="onConfirm"
97
- />
98
- </template>
@@ -1,30 +0,0 @@
1
- <script setup>
2
- import { computed, defineProps, inject } from 'vue'
3
- import { commonPropsType } from '../../utils/index.js'
4
-
5
- const lang = inject('lang')
6
- const props = defineProps({
7
- ...commonPropsType,
8
- })
9
- const dividerProps = computed(() => {
10
- return {
11
- direction: props.config?.direction,
12
- borderStyle: props.config?.borderStyle,
13
- borderwidth: props.config?.borderwidth,
14
- position: props.config?.position,
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-divider
26
- v-bind="{...dividerProps}"
27
- >
28
- {{ label }}
29
- </cmi-divider>
30
- </template>
@@ -1,58 +0,0 @@
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
- disabled: props.disabled,
36
- title: config?.label,
37
- activetype: props.config?.activetype,
38
- options: ((selects?.value && selects?.value?.[config?.selectKey]) || []).map(option => {
39
- return {
40
- label: lang?.value?.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc,
41
- value: option.columnValue
42
- }
43
- }),
44
- onChange(e) {
45
- const val = modelValue.value || ''
46
- const valArr = val.split(',')
47
- valArr[idx] = e.detail.value
48
- modelValue.value = valArr?.join(',')
49
- }
50
- }
51
- }
52
- </script>
53
-
54
- <template>
55
- <cmi-dropdown-menu v-bind="{...dropdownMenuProps}">
56
- <cmi-dropdown-item v-for="(config, idx) in optionItems" :key="JSON.stringify(config)" v-bind="{...getDropdownItemProps(config, idx)}"></cmi-dropdown-item>
57
- </cmi-dropdown-menu>
58
- </template>
@@ -1,69 +0,0 @@
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
- formatter: {
9
- type: Function,
10
- default: null
11
- },
12
- parser: {
13
- type: Function,
14
- default: null
15
- }
16
- })
17
- const inputProps = computed(() => {
18
- return {
19
- label: props.config?.label,
20
- type: props.config?.displayType,
21
- name: props.config?.name,
22
- placeholder: lang?.value?.indexOf('zh') > -1 ? props.config?.defPlacehold : props.config?.defPlaceholdEn,
23
- min: props.config?.min,
24
- minlength: props.config?.minlength,
25
- max: props.config?.max,
26
- maxlength: props.config?.maxLength,
27
- disabled: props.disabled,
28
- readonly: props.config?.readonly =='1',
29
- required: props.required,
30
- errormsg: props.config?.errormsg,
31
- clearable: props.clearable && !props.disabled,
32
- showWordLimit: props.config?.showWordLimit == '1' && props.config?.maxLength,
33
- showPassword: props.config?.showPassword == '1',
34
- prefixIcon: props.config?.prefixIcon,
35
- suffixIcon: props.config?.suffixIcon,
36
- minRows: props.config?.minRows,
37
- maxRows: props.config?.maxRows,
38
- }
39
- })
40
- const attrs = useAttrs()
41
- const modelValue = defineModel()
42
- const onChange = (e) => {
43
- valueProxy.value = e.detail.value
44
- }
45
- const valueProxy = computed({
46
- get() {
47
- return typeof props.formatter === "function" ? props.formatter(modelValue.value) : modelValue.value
48
- },
49
- set(val) {
50
- let value = typeof props.parser === "function" ? props.parser(val) : val
51
- if (modelValue.value === value && typeof props.formatter === "function") {
52
- modelValue.value += ' '
53
- setTimeout(() => { // 如果值相等,会导致没有再次进入get取值
54
- modelValue.value = value
55
- }, 0)
56
- } else {
57
- modelValue.value = value
58
- }
59
- }
60
- })
61
-
62
- </script>
63
-
64
- <template>
65
- <cmi-input
66
- :value="valueProxy" v-bind="{ ...attrs, ...inputProps,}"
67
- @change="onChange"
68
- ></cmi-input>
69
- </template>
@@ -1,28 +0,0 @@
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>