resolver-egretimp-plus 0.1.113 → 0.1.115
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/theme/element/index.css +1 -1
- package/dist/theme/element/src/components/common.scss +4 -0
- package/dist/theme/element/src/components/text.scss +17 -0
- package/dist/web/index.js +2 -2
- package/package.json +1 -1
- package/src/analysisComponent.jsx +2 -1
- package/src/components/helper/table.jsx +26 -23
- package/src/components/packages-H5/CustomComponentCollapseH5.vue +6 -2
- package/src/components/packages-web/ElText.jsx +0 -1
- package/src/theme/element/components/common.scss +4 -0
- package/src/theme/element/components/text.scss +17 -0
- package/src-bak/analysisComponent.jsx +343 -0
- package/src-bak/api/builtIn.js +10 -0
- package/src-bak/bpm/bpmInstance.js +388 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/application.js +8 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/component.js +97 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/datasource.js +88 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/index.js +3 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/UdcComponent.js +76 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/index.js +201 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/index.js +69 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/page.js +56 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/utils.js +76 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/index.js +46 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/utils.js +21 -0
- package/src-bak/components/childDialog/index.js +39 -0
- package/src-bak/components/childDialog/src/index.vue +185 -0
- package/src-bak/components/cmiFormItem/index.js +1 -0
- package/src-bak/components/cmiFormItem/src/index.vue +112 -0
- package/src-bak/components/confirmInstance-H5/index.js +53 -0
- package/src-bak/components/confirmInstance-H5/src/index.vue +54 -0
- package/src-bak/components/helper/FormPolyfill.jsx +25 -0
- package/src-bak/components/helper/calcTooltip.jsx +134 -0
- package/src-bak/components/helper/dock.js +141 -0
- package/src-bak/components/helper/eventOrchestration.js +763 -0
- package/src-bak/components/helper/resolver.js +163 -0
- package/src-bak/components/helper/table.jsx +103 -0
- package/src-bak/components/icons/date.vue +33 -0
- package/src-bak/components/icons/info.vue +62 -0
- package/src-bak/components/icons/loading.vue +19 -0
- package/src-bak/components/icons/question-filled.vue +8 -0
- package/src-bak/components/loading/index.js +6 -0
- package/src-bak/components/loading/loading.js +98 -0
- package/src-bak/components/loading/loading.scss +74 -0
- package/src-bak/components/loading/loading.vue +89 -0
- package/src-bak/components/loadingComponent/LoadingComponent.vue +33 -0
- package/src-bak/components/modal/index.js +9 -0
- package/src-bak/components/modal/modal.scss +195 -0
- package/src-bak/components/modal/modal.vue +201 -0
- package/src-bak/components/options/OptionsDefault.vue +47 -0
- package/src-bak/components/packages-H5/CmiButton.vue +120 -0
- package/src-bak/components/packages-H5/CmiCalendar.vue +152 -0
- package/src-bak/components/packages-H5/CmiCell.vue +87 -0
- package/src-bak/components/packages-H5/CmiCheckbox.vue +82 -0
- package/src-bak/components/packages-H5/CmiDatetimePicker.vue +98 -0
- package/src-bak/components/packages-H5/CmiDivider.vue +30 -0
- package/src-bak/components/packages-H5/CmiDropdownMenu.vue +58 -0
- package/src-bak/components/packages-H5/CmiInput.vue +69 -0
- package/src-bak/components/packages-H5/CmiLink.vue +28 -0
- package/src-bak/components/packages-H5/CmiPicker.vue +229 -0
- package/src-bak/components/packages-H5/CmiRadio.vue +29 -0
- package/src-bak/components/packages-H5/CmiSearch.vue +39 -0
- package/src-bak/components/packages-H5/CmiSelect.vue +84 -0
- package/src-bak/components/packages-H5/CustomComponentCardH5.vue +129 -0
- package/src-bak/components/packages-H5/CustomComponentColH5.vue +8 -0
- package/src-bak/components/packages-H5/CustomComponentCollapseH5.vue +137 -0
- package/src-bak/components/packages-H5/CustomComponentFormLayoutH5.vue +54 -0
- package/src-bak/components/packages-H5/CustomComponentTabPaneH5.vue +38 -0
- package/src-bak/components/packages-H5/CustomComponentTableH5.vue +352 -0
- package/src-bak/components/packages-H5/CustomComponentTabsH5.vue +170 -0
- package/src-bak/components/packages-web/CustomComponentCard.vue +40 -0
- package/src-bak/components/packages-web/CustomComponentCol.vue +66 -0
- package/src-bak/components/packages-web/CustomComponentCollapse.vue +164 -0
- package/src-bak/components/packages-web/CustomComponentCycle.vue +95 -0
- package/src-bak/components/packages-web/CustomComponentCycleTabPane.vue +155 -0
- package/src-bak/components/packages-web/CustomComponentDialog.vue +192 -0
- package/src-bak/components/packages-web/CustomComponentEditor.vue +50 -0
- package/src-bak/components/packages-web/CustomComponentFileExport.vue +60 -0
- package/src-bak/components/packages-web/CustomComponentFileImport.vue +60 -0
- package/src-bak/components/packages-web/CustomComponentFormLayout.vue +65 -0
- package/src-bak/components/packages-web/CustomComponentGrid.vue +29 -0
- package/src-bak/components/packages-web/CustomComponentGridCol.vue +29 -0
- package/src-bak/components/packages-web/CustomComponentInputDialog.vue +144 -0
- package/src-bak/components/packages-web/CustomComponentNativeTabPane.vue +84 -0
- package/src-bak/components/packages-web/CustomComponentPlain.vue +243 -0
- package/src-bak/components/packages-web/CustomComponentRow.vue +83 -0
- package/src-bak/components/packages-web/CustomComponentSelectEmployees.vue +203 -0
- package/src-bak/components/packages-web/CustomComponentSendMail.vue +62 -0
- package/src-bak/components/packages-web/CustomComponentSteps.vue +41 -0
- package/src-bak/components/packages-web/CustomComponentTabPane.vue +20 -0
- package/src-bak/components/packages-web/CustomComponentTable.jsx +813 -0
- package/src-bak/components/packages-web/CustomComponentTabs.vue +126 -0
- package/src-bak/components/packages-web/CustomComponentTree.vue +28 -0
- package/src-bak/components/packages-web/ElButton.vue +146 -0
- package/src-bak/components/packages-web/ElCheckbox.vue +97 -0
- package/src-bak/components/packages-web/ElDatePicker.vue +93 -0
- package/src-bak/components/packages-web/ElInput copy.jsx +393 -0
- package/src-bak/components/packages-web/ElInput.jsx +312 -0
- package/src-bak/components/packages-web/ElInputNumber.vue +81 -0
- package/src-bak/components/packages-web/ElPagination.vue +61 -0
- package/src-bak/components/packages-web/ElRadio.vue +47 -0
- package/src-bak/components/packages-web/ElSelect.jsx +249 -0
- package/src-bak/components/packages-web/ElSelect_bak.vue +155 -0
- package/src-bak/components/packages-web/ElText.jsx +187 -0
- package/src-bak/components/packages-web/ElTextaa.vue +169 -0
- package/src-bak/components/packages-web/ElTimePicker.vue +39 -0
- package/src-bak/components/patchComponents-H5.js +46 -0
- package/src-bak/components/patchComponents-web.js +46 -0
- package/src-bak/components/simpleFormItemPc/index.js +1 -0
- package/src-bak/components/simpleFormItemPc/src/index.vue +94 -0
- package/src-bak/components/table/index.ts +29 -0
- package/src-bak/components/table/src/composables/use-scrollbar.ts +30 -0
- package/src-bak/components/table/src/config.ts +256 -0
- package/src-bak/components/table/src/filter-panel.vue +260 -0
- package/src-bak/components/table/src/h-helper.ts +34 -0
- package/src-bak/components/table/src/layout-observer.ts +78 -0
- package/src-bak/components/table/src/store/current.ts +85 -0
- package/src-bak/components/table/src/store/expand.ts +76 -0
- package/src-bak/components/table/src/store/helper.ts +74 -0
- package/src-bak/components/table/src/store/index.ts +246 -0
- package/src-bak/components/table/src/store/tree.ts +230 -0
- package/src-bak/components/table/src/store/watcher.ts +543 -0
- package/src-bak/components/table/src/table/defaults.ts +402 -0
- package/src-bak/components/table/src/table/key-render-helper.ts +27 -0
- package/src-bak/components/table/src/table/style-helper.ts +378 -0
- package/src-bak/components/table/src/table/utils-helper.ts +47 -0
- package/src-bak/components/table/src/table-body/defaults.ts +52 -0
- package/src-bak/components/table/src/table-body/events-helper.ts +203 -0
- package/src-bak/components/table/src/table-body/index.ts +119 -0
- package/src-bak/components/table/src/table-body/render-helper.ts +283 -0
- package/src-bak/components/table/src/table-body/styles-helper.ts +164 -0
- package/src-bak/components/table/src/table-column/defaults.ts +237 -0
- package/src-bak/components/table/src/table-column/index.ts +202 -0
- package/src-bak/components/table/src/table-column/render-helper.ts +214 -0
- package/src-bak/components/table/src/table-column/watcher-helper.ts +88 -0
- package/src-bak/components/table/src/table-footer/index.ts +128 -0
- package/src-bak/components/table/src/table-footer/mapState-helper.ts +33 -0
- package/src-bak/components/table/src/table-footer/style-helper.ts +51 -0
- package/src-bak/components/table/src/table-header/event-helper.ts +213 -0
- package/src-bak/components/table/src/table-header/index.ts +244 -0
- package/src-bak/components/table/src/table-header/style.helper.ts +119 -0
- package/src-bak/components/table/src/table-header/utils-helper.ts +94 -0
- package/src-bak/components/table/src/table-layout.ts +259 -0
- package/src-bak/components/table/src/table.vue +389 -0
- package/src-bak/components/table/src/tableColumn.ts +3 -0
- package/src-bak/components/table/src/tokens.ts +5 -0
- package/src-bak/components/table/src/util.ts +521 -0
- package/src-bak/components/table/style/css.ts +5 -0
- package/src-bak/components/table/style/index.ts +5 -0
- package/src-bak/components/tabs/index.js +8 -0
- package/src-bak/components/tabs/src/constants.js +23 -0
- package/src-bak/components/tabs/src/tab-bar.js +8 -0
- package/src-bak/components/tabs/src/tab-bar.vue +92 -0
- package/src-bak/components/tabs/src/tab-nav.jsx +424 -0
- package/src-bak/components/tabs/src/tab-pane.js +16 -0
- package/src-bak/components/tabs/src/tab-pane.vue +80 -0
- package/src-bak/components/tabs/src/tabs.jsx +223 -0
- package/src-bak/components/tabs/style/css.js +2 -0
- package/src-bak/components/tabs/style/index.js +2 -0
- package/src-bak/components/thirdPartyFrame/index.js +32 -0
- package/src-bak/components/thirdPartyFrame/src/ThirdPartyFrame.vue +125 -0
- package/src-bak/enums/index.js +16 -0
- package/src-bak/hooks/configLoad.js +45 -0
- package/src-bak/hooks/index.js +189 -0
- package/src-bak/hooks/mock.js +6960 -0
- package/src-bak/hooks/pageConfig.js +127 -0
- package/src-bak/index.jsx +440 -0
- package/src-bak/renderer.jsx +77 -0
- package/src-bak/resolver-H5.vue +88 -0
- package/src-bak/resolver-common.vue +129 -0
- package/src-bak/resolver-web.vue +91 -0
- package/src-bak/rules/eventsSupplement.js +573 -0
- package/src-bak/rules/parseCondition.js +378 -0
- package/src-bak/rules/ruleUtils.js +273 -0
- package/src-bak/rules/rulesDriver.js +118 -0
- package/src-bak/rulesImp/events.js +588 -0
- package/src-bak/rulesImp/index.js +33 -0
- package/src-bak/rulesImp/ruleInstance.js +231 -0
- package/src-bak/rulesImp/ruleUtils.js +124 -0
- package/src-bak/theme/element/components/button.scss +122 -0
- package/src-bak/theme/element/components/card.scss +8 -0
- package/src-bak/theme/element/components/checkbox.scss +19 -0
- package/src-bak/theme/element/components/collapse.scss +174 -0
- package/src-bak/theme/element/components/common.scss +30 -0
- package/src-bak/theme/element/components/cycle.scss +0 -0
- package/src-bak/theme/element/components/date.scss +13 -0
- package/src-bak/theme/element/components/dialog.scss +44 -0
- package/src-bak/theme/element/components/form.scss +104 -0
- package/src-bak/theme/element/components/index.scss +55 -0
- package/src-bak/theme/element/components/input.scss +36 -0
- package/src-bak/theme/element/components/message.scss +48 -0
- package/src-bak/theme/element/components/pagination.scss +47 -0
- package/src-bak/theme/element/components/popper.scss +3 -0
- package/src-bak/theme/element/components/radio.scss +40 -0
- package/src-bak/theme/element/components/scrollbar.scss +14 -0
- package/src-bak/theme/element/components/select.scss +82 -0
- package/src-bak/theme/element/components/steps.scss +6 -0
- package/{src/components/styles/CustomComponenTable.scss → src-bak/theme/element/components/table.scss} +90 -13
- package/src-bak/theme/element/components/tabs.scss +128 -0
- package/src-bak/theme/element/components/tag.scss +6 -0
- package/{src/components/styles → src-bak/theme/element/components}/text.scss +3 -3
- package/src-bak/theme/element/components/textarea.scss +3 -0
- package/src-bak/theme/element/components/tree.scss +0 -0
- package/src-bak/theme/element/index.scss +55 -0
- package/src-bak/utils/cipher.js +141 -0
- package/src-bak/utils/common.js +664 -0
- package/src-bak/utils/const.js +259 -0
- package/src-bak/utils/defaultVal.js +92 -0
- package/src-bak/utils/dom.js +36 -0
- package/src-bak/utils/format.js +19 -0
- package/src-bak/utils/index.js +4 -0
- package/src-bak/utils/is.js +74 -0
- package/src-bak/utils/loadModule.js +75 -0
- package/src-bak/utils/preserveFunc.js +33 -0
- package/src-bak/utils/render.jsx +1138 -0
- package/src-bak/utils/request.js +136 -0
- package/src-bak/utils/respone.js +70 -0
- package/src-bak/utils/valid.js +89 -0
|
@@ -0,0 +1,152 @@
|
|
|
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>
|
|
@@ -0,0 +1,87 @@
|
|
|
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>
|
|
@@ -0,0 +1,82 @@
|
|
|
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>
|
|
@@ -0,0 +1,98 @@
|
|
|
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>
|
|
@@ -0,0 +1,30 @@
|
|
|
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>
|
|
@@ -0,0 +1,58 @@
|
|
|
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>
|
|
@@ -0,0 +1,69 @@
|
|
|
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>
|
|
@@ -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>
|