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,187 @@
|
|
|
1
|
+
import { ElText, ElIcon } from 'element-plus'
|
|
2
|
+
import { computed, defineProps, inject, getCurrentInstance, useAttrs, useSlots } from 'vue'
|
|
3
|
+
import { commonPropsType } from '../../utils/index.js'
|
|
4
|
+
import { h, resolveComponent, withModifiers } from 'vue'
|
|
5
|
+
import { useToolTip } from '../helper/calcTooltip.jsx'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
props: {
|
|
10
|
+
...commonPropsType,
|
|
11
|
+
...ElText.props,
|
|
12
|
+
fontSize: [String, Number],
|
|
13
|
+
needWrap: {
|
|
14
|
+
type: [String, Number],
|
|
15
|
+
default: '0'
|
|
16
|
+
},
|
|
17
|
+
suffixIcon: {
|
|
18
|
+
type: [String, Object],
|
|
19
|
+
default: ''
|
|
20
|
+
},
|
|
21
|
+
isPointer: {
|
|
22
|
+
type: [String, Number]
|
|
23
|
+
},
|
|
24
|
+
// 是否在超出的时候展示tooltip
|
|
25
|
+
showTooltip: {
|
|
26
|
+
type: [String, Number],
|
|
27
|
+
default: '0'
|
|
28
|
+
},
|
|
29
|
+
truncated: {
|
|
30
|
+
type: [String, Number, Boolean],
|
|
31
|
+
default: '0'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
emits: ['update:modelValue'],
|
|
35
|
+
setup(props, { emit, attrs, expose, slots }) {
|
|
36
|
+
// 这个是真实的值
|
|
37
|
+
const modelValue = computed({
|
|
38
|
+
get() {
|
|
39
|
+
return props.modelValue
|
|
40
|
+
},
|
|
41
|
+
set(val) {
|
|
42
|
+
emit('update:modelValue', val)
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
const lang = inject('lang')
|
|
46
|
+
const appContext = getCurrentInstance()?.appContext
|
|
47
|
+
const isPagePopup = computed(() => {
|
|
48
|
+
return props.config?.lcpPagePopupMapVO
|
|
49
|
+
})
|
|
50
|
+
const normalVal = computed(() => {
|
|
51
|
+
let val = (modelValue.value !== null && modelValue.value !== undefined) ? modelValue.value : ''
|
|
52
|
+
if (typeof val === 'object') {
|
|
53
|
+
try {
|
|
54
|
+
val = JSON.stringify(val)
|
|
55
|
+
} catch (error) {
|
|
56
|
+
val = ''
|
|
57
|
+
}
|
|
58
|
+
} else if (typeof val === 'function') {
|
|
59
|
+
val = ''
|
|
60
|
+
}
|
|
61
|
+
const findItem = props?.options?.find(item => item.columnValue == val)
|
|
62
|
+
if (findItem) {
|
|
63
|
+
return lang?.value?.indexOf('zh') > -1 ? findItem.columnDesc_zh : findItem.columnDesc
|
|
64
|
+
}
|
|
65
|
+
return val
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const elTextProps = computed(() => {
|
|
69
|
+
const result = Object.keys(ElText.props).reduce((ret, key) => {
|
|
70
|
+
ret[key] = props[key]
|
|
71
|
+
return ret
|
|
72
|
+
}, {})
|
|
73
|
+
if (typeof result.truncated !== 'boolean') {
|
|
74
|
+
result.truncated = result.truncated == '1'
|
|
75
|
+
}
|
|
76
|
+
return result
|
|
77
|
+
})
|
|
78
|
+
const buttonActions = inject('buttonActions', {})
|
|
79
|
+
|
|
80
|
+
const labelDesc = computed(() => {
|
|
81
|
+
return normalVal.value
|
|
82
|
+
})
|
|
83
|
+
const showTooltip = computed(() => {
|
|
84
|
+
return props?.showTooltip == '1'
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const { generateTooltipWrap } = useToolTip({
|
|
88
|
+
showTooltip,
|
|
89
|
+
offset: computed(() => {
|
|
90
|
+
let offset = 0
|
|
91
|
+
if (props.needWrap == '1') {
|
|
92
|
+
offset = 22
|
|
93
|
+
if (props.suffixIcon) {
|
|
94
|
+
offset = 36
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return offset
|
|
98
|
+
}),
|
|
99
|
+
displayValue: labelDesc,
|
|
100
|
+
config: props.config,
|
|
101
|
+
calcFn(node) {
|
|
102
|
+
return node?.getBoundingClientRect?.()?.width
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
const dynamicMapComp = inject('dynamicMapComp')
|
|
107
|
+
const hireRelatMapRules = inject('hireRelatMapRules')
|
|
108
|
+
const components = inject('components')
|
|
109
|
+
const selects = inject('selects')
|
|
110
|
+
const rootValue = inject('rootValue')
|
|
111
|
+
const dataLoad = inject('dataLoad')
|
|
112
|
+
const rootForm = inject('rootForm')
|
|
113
|
+
|
|
114
|
+
const clickAction = (e) => {
|
|
115
|
+
// attrs?.onClick?.(e) // 如果配置中有点击事件
|
|
116
|
+
const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
|
|
117
|
+
const actionFn = buttonActions[actionKey]
|
|
118
|
+
actionFn && actionFn(props, {
|
|
119
|
+
dynamicMapComp,
|
|
120
|
+
hireRelatMapRules,
|
|
121
|
+
components,
|
|
122
|
+
selects,
|
|
123
|
+
rootValue,
|
|
124
|
+
dataLoad,
|
|
125
|
+
rootForm
|
|
126
|
+
}, appContext)
|
|
127
|
+
}
|
|
128
|
+
function getSuffixIcon() {
|
|
129
|
+
if (props.suffixIcon && !props.disabled) {
|
|
130
|
+
const iconProps = {
|
|
131
|
+
color: '#a8abb2',
|
|
132
|
+
size: 14
|
|
133
|
+
}
|
|
134
|
+
let suffixIcon = props.suffixIcon
|
|
135
|
+
if (typeof suffixIcon === 'string') {
|
|
136
|
+
if (isPagePopup.value && suffixIcon == 'Search') {
|
|
137
|
+
iconProps.onClick = withModifiers(attrs.onClick, [
|
|
138
|
+
'stop'
|
|
139
|
+
]),
|
|
140
|
+
iconProps.style = {
|
|
141
|
+
cursor: 'pointer',
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
suffixIcon = resolveComponent(suffixIcon)
|
|
145
|
+
}
|
|
146
|
+
return (
|
|
147
|
+
<ElIcon {...iconProps}>
|
|
148
|
+
<suffixIcon></suffixIcon>
|
|
149
|
+
</ElIcon>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
return null
|
|
153
|
+
}
|
|
154
|
+
function getWrap(node) {
|
|
155
|
+
if (props.needWrap == '1') {
|
|
156
|
+
return (
|
|
157
|
+
<div class={{
|
|
158
|
+
'resolver-custom-cust-input-wrap': true,
|
|
159
|
+
'resolver-custom-is-disabled': props.disabled
|
|
160
|
+
}}>
|
|
161
|
+
{ node }
|
|
162
|
+
{ getSuffixIcon() }
|
|
163
|
+
</div>
|
|
164
|
+
)
|
|
165
|
+
} else {
|
|
166
|
+
return node
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function getSlots() {
|
|
170
|
+
return {
|
|
171
|
+
default: () => labelDesc.value,
|
|
172
|
+
...slots,
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return () => {
|
|
176
|
+
return generateTooltipWrap(getWrap(
|
|
177
|
+
<ElText {...{...attrs, ...elTextProps.value}} onClickCapture={withModifiers((e) => {clickAction(e)}, [ 'stop', 'self' ])} class={{cursor: props.isPointer == '1'}}>
|
|
178
|
+
{
|
|
179
|
+
getSlots()
|
|
180
|
+
}
|
|
181
|
+
</ElText>
|
|
182
|
+
), {
|
|
183
|
+
maintain: true,
|
|
184
|
+
})
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- <ElText v-bind="{...attrs, ...elTextProps}">{{ labelDesc }}</ElText> -->
|
|
3
|
+
<renderNode></renderNode>
|
|
4
|
+
</template>
|
|
5
|
+
<script setup>
|
|
6
|
+
import { ElText, ElIcon } from 'element-plus'
|
|
7
|
+
import { computed, defineProps, inject, getCurrentInstance, useAttrs, useSlots } from 'vue'
|
|
8
|
+
import { commonPropsType } from '../../utils/index.js'
|
|
9
|
+
import { h, resolveComponent, withModifiers } from 'vue'
|
|
10
|
+
|
|
11
|
+
defineOptions({
|
|
12
|
+
inheritAttrs: false
|
|
13
|
+
})
|
|
14
|
+
const slots = useSlots()
|
|
15
|
+
const lang = inject('lang')
|
|
16
|
+
const modelValue = defineModel()
|
|
17
|
+
const appContext = getCurrentInstance()?.appContext
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
...commonPropsType,
|
|
20
|
+
...ElText.props,
|
|
21
|
+
fontSize: [String, Number],
|
|
22
|
+
needWrap: {
|
|
23
|
+
type: [String, Number],
|
|
24
|
+
default: '0'
|
|
25
|
+
},
|
|
26
|
+
suffixIcon: {
|
|
27
|
+
type: [String, Object],
|
|
28
|
+
default: ''
|
|
29
|
+
},
|
|
30
|
+
isPointer: {
|
|
31
|
+
type: [String, Number]
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
const isPagePopup = computed(() => {
|
|
35
|
+
return props.config?.lcpPagePopupMapVO
|
|
36
|
+
})
|
|
37
|
+
const attrs = useAttrs()
|
|
38
|
+
|
|
39
|
+
const normalVal = computed(() => {
|
|
40
|
+
let val = (modelValue.value !== null && modelValue.value !== undefined) ? modelValue.value : ''
|
|
41
|
+
if (typeof val === 'object') {
|
|
42
|
+
try {
|
|
43
|
+
val = JSON.stringify(val)
|
|
44
|
+
} catch (error) {
|
|
45
|
+
val = ''
|
|
46
|
+
}
|
|
47
|
+
} else if (typeof val === 'function') {
|
|
48
|
+
val = ''
|
|
49
|
+
}
|
|
50
|
+
const findItem = props?.options?.find(item => item.columnValue == val)
|
|
51
|
+
if (findItem) {
|
|
52
|
+
return lang?.value?.indexOf('zh') > -1 ? findItem.columnDesc_zh : findItem.columnDesc
|
|
53
|
+
}
|
|
54
|
+
return val
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const elTextProps = computed(() => {
|
|
58
|
+
const result = Object.keys(ElText.props).reduce((ret, key) => {
|
|
59
|
+
ret[key] = props[key]
|
|
60
|
+
return ret
|
|
61
|
+
}, {})
|
|
62
|
+
return result
|
|
63
|
+
})
|
|
64
|
+
const buttonActions = inject('buttonActions', {})
|
|
65
|
+
|
|
66
|
+
const labelDesc = computed(() => {
|
|
67
|
+
return normalVal.value
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const renderNode = computed(() => {
|
|
71
|
+
const textNode = h(ElText, {
|
|
72
|
+
...attrs,
|
|
73
|
+
...elTextProps.value,
|
|
74
|
+
onClick: withModifiers(() => {
|
|
75
|
+
clickAction()
|
|
76
|
+
}, [
|
|
77
|
+
'stop'
|
|
78
|
+
]),
|
|
79
|
+
class:{
|
|
80
|
+
cursor: props.isPointer == '1'
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
default: () => labelDesc.value,
|
|
84
|
+
...slots,
|
|
85
|
+
})
|
|
86
|
+
if (props.needWrap == '1') {
|
|
87
|
+
return h('div', {
|
|
88
|
+
class: {
|
|
89
|
+
'cust-input-wrap': true,
|
|
90
|
+
'is-disabled': props.disabled
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
}, [
|
|
94
|
+
textNode,
|
|
95
|
+
getSuffixIcon()
|
|
96
|
+
])
|
|
97
|
+
} else {
|
|
98
|
+
return textNode
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
const dynamicMapComp = inject('dynamicMapComp')
|
|
103
|
+
const hireRelatMapRules = inject('hireRelatMapRules')
|
|
104
|
+
const components = inject('components')
|
|
105
|
+
const selects = inject('selects')
|
|
106
|
+
const rootValue = inject('rootValue')
|
|
107
|
+
const dataLoad = inject('dataLoad')
|
|
108
|
+
const rootForm = inject('rootForm')
|
|
109
|
+
|
|
110
|
+
const clickAction = (e) => {
|
|
111
|
+
// attrs?.onClick?.(e) // 如果配置中有点击事件
|
|
112
|
+
const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
|
|
113
|
+
const actionFn = buttonActions[actionKey]
|
|
114
|
+
actionFn && actionFn(props, {
|
|
115
|
+
dynamicMapComp,
|
|
116
|
+
hireRelatMapRules,
|
|
117
|
+
components,
|
|
118
|
+
selects,
|
|
119
|
+
rootValue,
|
|
120
|
+
dataLoad,
|
|
121
|
+
rootForm
|
|
122
|
+
}, appContext)
|
|
123
|
+
}
|
|
124
|
+
function getSuffixIcon() {
|
|
125
|
+
if (props.suffixIcon && !props.disabled) {
|
|
126
|
+
const iconProps = {
|
|
127
|
+
color: '#a8abb2',
|
|
128
|
+
size: 14
|
|
129
|
+
}
|
|
130
|
+
let suffixIcon = props.suffixIcon
|
|
131
|
+
if (typeof suffixIcon === 'string') {
|
|
132
|
+
if (isPagePopup.value && suffixIcon == 'Search') {
|
|
133
|
+
iconProps.onClick = withModifiers(attrs.onClick, [
|
|
134
|
+
'stop'
|
|
135
|
+
]),
|
|
136
|
+
iconProps.style = {
|
|
137
|
+
cursor: 'pointer',
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
suffixIcon = resolveComponent(suffixIcon)
|
|
141
|
+
}
|
|
142
|
+
return h(ElIcon, {
|
|
143
|
+
...iconProps
|
|
144
|
+
}, [h(suffixIcon)])
|
|
145
|
+
}
|
|
146
|
+
return null
|
|
147
|
+
}
|
|
148
|
+
</script>
|
|
149
|
+
<style lang="scss" scoped>
|
|
150
|
+
.cust-input-wrap {
|
|
151
|
+
display: flex;
|
|
152
|
+
width: 100%;
|
|
153
|
+
align-items: center;
|
|
154
|
+
min-height: 32px;
|
|
155
|
+
line-height: 24px;
|
|
156
|
+
padding: 1px 11px;
|
|
157
|
+
box-sizing: border-box;
|
|
158
|
+
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
159
|
+
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
|
160
|
+
background: var(--el-input-bg-color, var(--el-fill-color-blank));
|
|
161
|
+
cursor: 'not-allowed';
|
|
162
|
+
}
|
|
163
|
+
.is-disabled {
|
|
164
|
+
background: var(--el-disabled-bg-color);
|
|
165
|
+
}
|
|
166
|
+
.cursor {
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
}
|
|
169
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElTimePicker v-bind="calcProps" v-model="modeValue">
|
|
3
|
+
<template v-for="(_, key) in slots" :key="key" v-slot:[key]="scope">
|
|
4
|
+
<slot :name="key" v-bind="scope"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
</ElTimePicker>
|
|
7
|
+
</template>
|
|
8
|
+
<script setup>
|
|
9
|
+
import { ElTimePicker } from "element-plus"
|
|
10
|
+
import { useAttrs, computed, useSlots } from "vue"
|
|
11
|
+
import { commonPropsType } from "../../utils/index.js"
|
|
12
|
+
|
|
13
|
+
const slots = useSlots()
|
|
14
|
+
const attrs = useAttrs()
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
min: {
|
|
17
|
+
type: [Date, String],
|
|
18
|
+
default: null
|
|
19
|
+
},
|
|
20
|
+
max: {
|
|
21
|
+
type: [Date, String],
|
|
22
|
+
default: null
|
|
23
|
+
},
|
|
24
|
+
...ElTimePicker.props,
|
|
25
|
+
...commonPropsType
|
|
26
|
+
})
|
|
27
|
+
const calcProps = computed(() => {
|
|
28
|
+
const ret = Object.keys(ElTimePicker.props).reduce((ret, key) => {
|
|
29
|
+
ret[key] = props[key]
|
|
30
|
+
return ret
|
|
31
|
+
}, {...attrs})
|
|
32
|
+
|
|
33
|
+
delete ret.modelValue
|
|
34
|
+
delete ret.defaultValue
|
|
35
|
+
return ret
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const modeValue = defineModel()
|
|
39
|
+
</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-H5', 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-H5/*.{vue,jsx,js}', { import: 'default', eager: true })
|
|
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
|
+
}
|
|
@@ -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-web', 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-web/*.{vue,jsx,js}', { eager: true })
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as default} from './src/index.vue'
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, inject, useAttrs } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
name: 'SimpleFormItemPc'
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const attrs = useAttrs()
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
label: String,
|
|
13
|
+
labelWidth: [String, Number],
|
|
14
|
+
labelPosition: String,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const formContextKey = inject('_formContextKey')
|
|
18
|
+
const formContext = inject(formContextKey, undefined)
|
|
19
|
+
|
|
20
|
+
const labelStyle = computed(() => {
|
|
21
|
+
if (formContext?.labelPosition === 'top' || props?.labelPosition === 'top') {
|
|
22
|
+
return {}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const labelWidth = props.labelWidth || formContext?.labelWidth || ''
|
|
26
|
+
if (labelWidth) return { width: `${parseInt(labelWidth)}px` }
|
|
27
|
+
return {}
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const formItemClass = computed(() => {
|
|
31
|
+
const clas = attrs.class
|
|
32
|
+
return [
|
|
33
|
+
clas || '',
|
|
34
|
+
{
|
|
35
|
+
[`label-position__${props.labelPosition || 'right'}`]: true
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
</script>
|
|
41
|
+
<template>
|
|
42
|
+
<div class="simple-form-item el-form-item" :class="formItemClass" :style="attrs.style">
|
|
43
|
+
<label class="simple-form-item-label el-form-item__label" :style="labelStyle">
|
|
44
|
+
<slot name="label"></slot>
|
|
45
|
+
</label>
|
|
46
|
+
<div class="simple-form-item-content el-form-item__content">
|
|
47
|
+
<slot></slot>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<style lang="scss">
|
|
53
|
+
.simple-form-item {
|
|
54
|
+
display: flex;
|
|
55
|
+
margin-bottom: var(--prmary-marign);
|
|
56
|
+
margin-right: var(--prmary-marign);
|
|
57
|
+
.simple-form-item-label {
|
|
58
|
+
flex: 0 0 auto;
|
|
59
|
+
display: flex;
|
|
60
|
+
font-size: var(--el-form-label-font-size);
|
|
61
|
+
color: var(--el-text-color-regular);
|
|
62
|
+
height: 32px;
|
|
63
|
+
line-height: 32px;
|
|
64
|
+
padding: 0 12px 0 0;
|
|
65
|
+
align-items: center;
|
|
66
|
+
box-sizing: content-box;
|
|
67
|
+
max-width: 100%;
|
|
68
|
+
}
|
|
69
|
+
.simple-form-item-content {
|
|
70
|
+
align-items: center;
|
|
71
|
+
display: flex;
|
|
72
|
+
flex: 1;
|
|
73
|
+
flex-wrap: wrap;
|
|
74
|
+
line-height: 32px;
|
|
75
|
+
min-width: 0;
|
|
76
|
+
position: relative;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.label-position__left {
|
|
80
|
+
.simple-form-item-label {
|
|
81
|
+
justify-content: flex-start;
|
|
82
|
+
text-align: left;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
.label-position__right {
|
|
86
|
+
.simple-form-item-label {
|
|
87
|
+
justify-content: flex-end;
|
|
88
|
+
text-align: right;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
.label-position__top {
|
|
92
|
+
display: block;
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { withInstall, withNoopInstall } from 'element-plus/es/utils/index.mjs'
|
|
2
|
+
import Table from './src/table.vue'
|
|
3
|
+
import TableColumn from './src/tableColumn'
|
|
4
|
+
|
|
5
|
+
export const ElTable = withInstall(Table, {
|
|
6
|
+
TableColumn,
|
|
7
|
+
})
|
|
8
|
+
export default ElTable
|
|
9
|
+
export const ElTableColumn = withNoopInstall(TableColumn)
|
|
10
|
+
|
|
11
|
+
export type TableInstance = InstanceType<typeof Table>
|
|
12
|
+
|
|
13
|
+
export type TableColumnInstance = InstanceType<typeof TableColumn>
|
|
14
|
+
|
|
15
|
+
export type {
|
|
16
|
+
SummaryMethod,
|
|
17
|
+
Table,
|
|
18
|
+
TableProps,
|
|
19
|
+
TableRefs,
|
|
20
|
+
ColumnCls,
|
|
21
|
+
ColumnStyle,
|
|
22
|
+
CellCls,
|
|
23
|
+
CellStyle,
|
|
24
|
+
TreeNode,
|
|
25
|
+
RenderRowData,
|
|
26
|
+
Sort,
|
|
27
|
+
Filter,
|
|
28
|
+
TableColumnCtx,
|
|
29
|
+
} from './src/table/defaults'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import { isNumber } from 'element-plus/es/utils/index.mjs'
|
|
3
|
+
|
|
4
|
+
export const useScrollbar = () => {
|
|
5
|
+
const scrollBarRef = ref()
|
|
6
|
+
|
|
7
|
+
const scrollTo = (options: ScrollToOptions | number, yCoord?: number) => {
|
|
8
|
+
const scrollbar = scrollBarRef.value
|
|
9
|
+
if (scrollbar) {
|
|
10
|
+
scrollbar.scrollTo(options, yCoord)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const setScrollPosition = (position: 'Top' | 'Left', offset?: number) => {
|
|
15
|
+
const scrollbar = scrollBarRef.value
|
|
16
|
+
if (scrollbar && isNumber(offset) && ['Top', 'Left'].includes(position)) {
|
|
17
|
+
scrollbar[`setScroll${position}`](offset)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const setScrollTop = (top?: number) => setScrollPosition('Top', top)
|
|
22
|
+
const setScrollLeft = (left?: number) => setScrollPosition('Left', left)
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
scrollBarRef,
|
|
26
|
+
scrollTo,
|
|
27
|
+
setScrollTop,
|
|
28
|
+
setScrollLeft,
|
|
29
|
+
}
|
|
30
|
+
}
|