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,243 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="custom-component-plain" :class="classObj" @click="clickAction">{{ props.formatter?.(value) ?? value }}</span>
|
|
3
|
+
</template>
|
|
4
|
+
<script setup>
|
|
5
|
+
import { findComponent } from '../../utils/common';
|
|
6
|
+
import { commonPropsType, PLAIN_TYPE_OPTIONS_COLUMNS } from '../../utils/const' // 这边不能用utils/index去引用,因为这个组件在utils/render.js中被引入了,会造成循环引用
|
|
7
|
+
import { computed, defineModel, defineProps, inject, getCurrentInstance, watch, nextTick } from 'vue'
|
|
8
|
+
import dayjs from 'dayjs'
|
|
9
|
+
import { isNaN } from '../../utils/is';
|
|
10
|
+
import { useFormItem } from 'element-plus'
|
|
11
|
+
|
|
12
|
+
const { formItem: elFormItem } = useFormItem()
|
|
13
|
+
const modelValue = defineModel()
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
...commonPropsType,
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
20
|
+
formatter: {
|
|
21
|
+
type: Function,
|
|
22
|
+
default: null
|
|
23
|
+
},
|
|
24
|
+
isPointer: {
|
|
25
|
+
type: [String, Number]
|
|
26
|
+
},
|
|
27
|
+
// 多选的分割符号
|
|
28
|
+
separator: {
|
|
29
|
+
type: [String],
|
|
30
|
+
default: ','
|
|
31
|
+
},
|
|
32
|
+
// 多选显示时候 分隔的符号
|
|
33
|
+
separatorDesc: {
|
|
34
|
+
type: [String],
|
|
35
|
+
default: null
|
|
36
|
+
},
|
|
37
|
+
showMoney: {
|
|
38
|
+
type: [String, Number],
|
|
39
|
+
default: ''
|
|
40
|
+
},
|
|
41
|
+
// 金额显示的分割,默认‘,’
|
|
42
|
+
moneySeg: {
|
|
43
|
+
type: [String],
|
|
44
|
+
default: ','
|
|
45
|
+
},
|
|
46
|
+
min: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: -Infinity
|
|
49
|
+
},
|
|
50
|
+
max: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: Infinity
|
|
53
|
+
},
|
|
54
|
+
// 小数位数
|
|
55
|
+
decimal: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: 2
|
|
58
|
+
},
|
|
59
|
+
// 保留小数点0后缀
|
|
60
|
+
decimalSuffix: {
|
|
61
|
+
type: [Number, String],
|
|
62
|
+
default: '0'
|
|
63
|
+
},
|
|
64
|
+
// 金额显示时保留小数点0后缀
|
|
65
|
+
keepLastZero: {
|
|
66
|
+
type: [Number, String],
|
|
67
|
+
default: '0'
|
|
68
|
+
},
|
|
69
|
+
// 在显示金额的时候,可以显示的符号
|
|
70
|
+
canShowFlag: {
|
|
71
|
+
type: Array,
|
|
72
|
+
default: ['na', '-']
|
|
73
|
+
},
|
|
74
|
+
// 是否显示货币符号
|
|
75
|
+
showSymbol: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: ''
|
|
78
|
+
},
|
|
79
|
+
// 货币符号
|
|
80
|
+
symbol: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: '¥'
|
|
83
|
+
},
|
|
84
|
+
// 符号位置:before/after
|
|
85
|
+
symbolPosition: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: 'before',
|
|
88
|
+
validator: value => ['before', 'after'].includes(value)
|
|
89
|
+
},
|
|
90
|
+
})
|
|
91
|
+
const lang = inject('lang')
|
|
92
|
+
function isPatchComponent(components, props) {
|
|
93
|
+
return (findComponent(components, props?.config?.renderby) !== -1 || findComponent(components, props?.config?.metaType) !== -1)
|
|
94
|
+
}
|
|
95
|
+
const value = computed(() => {
|
|
96
|
+
if (
|
|
97
|
+
isPatchComponent(PLAIN_TYPE_OPTIONS_COLUMNS, props)
|
|
98
|
+
) {
|
|
99
|
+
return selectFormat(modelValue.value)
|
|
100
|
+
} else if (isPatchComponent(['ElInputNumber'], props)) {
|
|
101
|
+
return inputNumebrFormat(modelValue.value, props)
|
|
102
|
+
} else {
|
|
103
|
+
if (isPatchComponent(['ElDatePicker'], props)) {
|
|
104
|
+
if (!modelValue.value) {
|
|
105
|
+
return ''
|
|
106
|
+
}
|
|
107
|
+
let val = ''
|
|
108
|
+
if (isNaN(Number(modelValue.value))) {
|
|
109
|
+
val = modelValue.value
|
|
110
|
+
} else {
|
|
111
|
+
if (props.config?.valueFormat === 'timestamp' || `${modelValue.value}`.length >= 13) {
|
|
112
|
+
val = Number(modelValue.value)
|
|
113
|
+
} else {
|
|
114
|
+
val = modelValue.value
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return dayjs(val).format(props?.config?.format || 'YYYY-MM-DD')
|
|
118
|
+
}
|
|
119
|
+
if (props.showMoney == '1') {
|
|
120
|
+
return formatValue(modelValue.value)
|
|
121
|
+
}
|
|
122
|
+
return modelValue.value
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
// 转换inputNumber类型的值
|
|
127
|
+
function inputNumebrFormat(val, props) {
|
|
128
|
+
if (val === undefined || val === null) return ''
|
|
129
|
+
const precise = parseInt(props.config.precise)
|
|
130
|
+
if (isNaN(precise)) {
|
|
131
|
+
return parseFloat(val)
|
|
132
|
+
} else {
|
|
133
|
+
return parseFloat(val)?.toFixed?.(precise)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const classObj = computed(() => ({
|
|
138
|
+
[`custom-component-plain--${props.type}`]: true,
|
|
139
|
+
cursor: props.isPointer == '1'
|
|
140
|
+
}))
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
const appContext = getCurrentInstance()?.appContext
|
|
144
|
+
const buttonActions = inject('buttonActions', {})
|
|
145
|
+
|
|
146
|
+
const dynamicMapComp = inject('dynamicMapComp')
|
|
147
|
+
const hireRelatMapRules = inject('hireRelatMapRules')
|
|
148
|
+
const components = inject('components')
|
|
149
|
+
const selects = inject('selects')
|
|
150
|
+
const rootValue = inject('rootValue')
|
|
151
|
+
const dataLoad = inject('dataLoad')
|
|
152
|
+
const rootForm = inject('rootForm')
|
|
153
|
+
const clickAction = () => {
|
|
154
|
+
const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
|
|
155
|
+
const actionFn = buttonActions[actionKey]
|
|
156
|
+
actionFn && actionFn(props, {
|
|
157
|
+
dynamicMapComp,
|
|
158
|
+
hireRelatMapRules,
|
|
159
|
+
components,
|
|
160
|
+
selects,
|
|
161
|
+
rootValue,
|
|
162
|
+
dataLoad,
|
|
163
|
+
rootForm
|
|
164
|
+
}, appContext)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function selectFormat(value) {
|
|
168
|
+
let valList = `${value}`
|
|
169
|
+
const multiple = props?.config?.multiple == '1'
|
|
170
|
+
const isStrVal = props.config?.valueType !== 'list'
|
|
171
|
+
// 在满足多选,并且不是str格式的时候,就表示value为数组类型,取反就表示不满足的时候,需要转换成数组格式进行计算
|
|
172
|
+
if (!(multiple && !isStrVal)) {
|
|
173
|
+
try {
|
|
174
|
+
valList = valList ? (valList?.split(props.separator) || []) : []
|
|
175
|
+
} catch (error) {
|
|
176
|
+
debugger
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return valList?.reduce((ret, val) => {
|
|
180
|
+
const str = props?.options?.find(item => item.columnValue == val)?.[lang?.value?.indexOf('zh') > -1 ? 'columnDesc_zh' : 'columnDesc'] || ''
|
|
181
|
+
return `${ret}${ret ? (props.separatorDesc || props.separator) : ''}${str}`
|
|
182
|
+
}, '')
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// 格式化显示
|
|
186
|
+
function formatValue(value) {
|
|
187
|
+
if (props.canShowFlag?.includes(String(value).toLowerCase())) {
|
|
188
|
+
return value
|
|
189
|
+
}
|
|
190
|
+
if (value === null || isNaN(value)) return ''
|
|
191
|
+
let val = `${value}`.replace(props.moneySeg, '')
|
|
192
|
+
val = parseFloat(val)
|
|
193
|
+
if (isNaN(val)) {
|
|
194
|
+
return ''
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// 转换数字并限制范围
|
|
198
|
+
val = Math.max(props.min, Math.min(props.max, val))
|
|
199
|
+
|
|
200
|
+
// 处理千分位
|
|
201
|
+
if (props.decimal != '-1') {
|
|
202
|
+
val = val.toFixed(props.decimal)
|
|
203
|
+
}
|
|
204
|
+
if (props.decimalSuffix != '1') {
|
|
205
|
+
val = parseFloat(val)
|
|
206
|
+
}
|
|
207
|
+
const parts = `${val}`.split('.')
|
|
208
|
+
|
|
209
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, props.moneySeg)
|
|
210
|
+
|
|
211
|
+
// 添加货币符号
|
|
212
|
+
const formatted = parts.join('.')
|
|
213
|
+
return props.showSymbol == '1'
|
|
214
|
+
? props.symbolPosition === 'before'
|
|
215
|
+
? `${props.symbol} ${formatted}`
|
|
216
|
+
: `${formatted} ${props.symbol}`
|
|
217
|
+
: formatted
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
watch(modelValue, () => {
|
|
221
|
+
nextTick(() => {
|
|
222
|
+
elFormItem?.validate?.('blur').catch()
|
|
223
|
+
})
|
|
224
|
+
}, {
|
|
225
|
+
immediate: true
|
|
226
|
+
})
|
|
227
|
+
</script>
|
|
228
|
+
<style lang="scss" scoped>
|
|
229
|
+
.custom-component-plain {
|
|
230
|
+
white-space: nowrap;
|
|
231
|
+
text-overflow: ellipsis;
|
|
232
|
+
overflow: hidden;
|
|
233
|
+
}
|
|
234
|
+
.custom-component-plain--primary {
|
|
235
|
+
color: var(--el-color-primary);
|
|
236
|
+
}
|
|
237
|
+
.custom-component-plain--error {
|
|
238
|
+
color: #F54A45;
|
|
239
|
+
}
|
|
240
|
+
.cursor {
|
|
241
|
+
cursor: pointer;
|
|
242
|
+
}
|
|
243
|
+
</style>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElRow class="custom-component-row" :class="classRef" v-bind="{...attrs, ...elRowProps}">
|
|
3
|
+
<Renderer :config="pmPageMetaList" v-model="props.refValue.value"></Renderer>
|
|
4
|
+
</ElRow>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup>
|
|
7
|
+
import Renderer from '../../renderer.jsx'
|
|
8
|
+
import { ElRow } from 'element-plus'
|
|
9
|
+
import { computed, defineProps, useAttrs } from 'vue'
|
|
10
|
+
import { commonPropsType } from '../../utils/index.js'
|
|
11
|
+
|
|
12
|
+
defineEmits(['update:modelValue'])
|
|
13
|
+
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
...commonPropsType,
|
|
16
|
+
...ElRow.props
|
|
17
|
+
})
|
|
18
|
+
const elRowProps = computed(() => {
|
|
19
|
+
return Object.keys(ElRow.props).reduce((ret, key) => {
|
|
20
|
+
ret[key] = props[key]
|
|
21
|
+
return ret
|
|
22
|
+
}, {})
|
|
23
|
+
})
|
|
24
|
+
const attrs = useAttrs()
|
|
25
|
+
const classRef = computed(() => {
|
|
26
|
+
return {
|
|
27
|
+
'clear-right-margin': !reserveRightMargin.value,
|
|
28
|
+
'clear-bottom-margin': !reserveBottomMargin.value,
|
|
29
|
+
'not-context': allHidden.value
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const pmPageMetaList = computed(() => {
|
|
34
|
+
return props.config?.pmPageMetaList || []
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const allHidden = computed(() => {
|
|
38
|
+
return !pmPageMetaList.value?.find(config => !((typeof config.hidden === 'boolean' && config.hidden) || config.hidden == '1'))
|
|
39
|
+
})
|
|
40
|
+
// 保留内部formItem的margin-right
|
|
41
|
+
const reserveRightMargin = computed(() => {
|
|
42
|
+
return props.config?.reserveRightMargin
|
|
43
|
+
})
|
|
44
|
+
// 保留内部formItem的margin-bottom
|
|
45
|
+
const reserveBottomMargin = computed(() => {
|
|
46
|
+
return props.config?.reserveBottomMargin
|
|
47
|
+
})
|
|
48
|
+
</script>
|
|
49
|
+
<style lang="scss">
|
|
50
|
+
.el-form-item__content, simple-form-item-content {
|
|
51
|
+
& > .custom-component-row {
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.custom-component-row {
|
|
56
|
+
max-width: 100%;
|
|
57
|
+
.el-col {
|
|
58
|
+
& > .el-form-item {
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
.clear-right-margin {
|
|
63
|
+
.el-col {
|
|
64
|
+
& > {
|
|
65
|
+
.el-form-item, .simple-form-item {
|
|
66
|
+
margin-right: 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
.not-context.not-context.not-context.not-context {
|
|
72
|
+
margin-bottom: 0;
|
|
73
|
+
}
|
|
74
|
+
.clear-bottom-margin {
|
|
75
|
+
.el-col {
|
|
76
|
+
& > {
|
|
77
|
+
.el-form-item, .simple-form-item {
|
|
78
|
+
margin-bottom: 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-employees">
|
|
3
|
+
<!-- <el-input @focus="showSelUserDialog">
|
|
4
|
+
<template #suffix>
|
|
5
|
+
<el-icon style="cursor: pointer;" @click="showSelUserDialog"><SearchIcon /></el-icon>
|
|
6
|
+
</template>
|
|
7
|
+
</el-input> -->
|
|
8
|
+
<div :id="metaCode" :style="styleObj" class="xm-select-user" :class="[props.disabled ? 'is-disabled' : '']"></div>
|
|
9
|
+
<div v-if="props.disabled" class="disable-employees"></div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
<script setup>
|
|
13
|
+
import { onMounted, inject, watch, defineProps, computed, defineEmits, nextTick, resolveComponent } from 'vue';
|
|
14
|
+
import { useSelEmployeeJs } from '../helper/dock.js'
|
|
15
|
+
import { commonPropsType, debounce, isBoolean, isString } from '../../utils/index.js'
|
|
16
|
+
import { useFormItem } from 'element-plus'
|
|
17
|
+
|
|
18
|
+
// const SearchIcon = resolveComponent('Search')
|
|
19
|
+
// console.log('SearchIcon==:', SearchIcon)
|
|
20
|
+
const { formItem: elFormItem } = useFormItem()
|
|
21
|
+
const emit = defineEmits(['change'])
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
...commonPropsType,
|
|
24
|
+
multiple: {
|
|
25
|
+
type: [String, Boolean],
|
|
26
|
+
default: false
|
|
27
|
+
},
|
|
28
|
+
// ====start==== 按部门查找人员,type为user时有效,结构为{deptIds:'xxx,yyy', cascade: true, excludeDeptIds:'xxx,yyy'}, deptIds为部门ID(如有多个用英文逗号分隔),cascade为是否包含下级部门人员, excludeDeptIds为除外部门ID(如有多个用英文逗号分隔)
|
|
29
|
+
cascade: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: true
|
|
32
|
+
},
|
|
33
|
+
deptIds: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ''
|
|
36
|
+
},
|
|
37
|
+
excludeDeptIds: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: ''
|
|
40
|
+
},
|
|
41
|
+
// ====end==== 按部门查找人员,type为user时有效,结构为{deptIds:'xxx,yyy', cascade: true, excludeDeptIds:'xxx,yyy'}, deptIds为部门ID(如有多个用英文逗号分隔),cascade为是否包含下级部门人员, excludeDeptIds为除外部门ID(如有多个用英文逗号分隔)
|
|
42
|
+
type: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: 'user'
|
|
45
|
+
},
|
|
46
|
+
isFrame: {
|
|
47
|
+
type: [String, Number],
|
|
48
|
+
default: '0'
|
|
49
|
+
},
|
|
50
|
+
placeholder: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: ''
|
|
53
|
+
},
|
|
54
|
+
placeholderEn: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ''
|
|
57
|
+
},
|
|
58
|
+
// 多选的分割符号
|
|
59
|
+
separator: {
|
|
60
|
+
type: [String],
|
|
61
|
+
default: ','
|
|
62
|
+
},
|
|
63
|
+
positionType: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: 'fixed'
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
const dataLoad = inject('dataLoad')
|
|
69
|
+
const separator = computed(() => {
|
|
70
|
+
return props.separator
|
|
71
|
+
})
|
|
72
|
+
const metaCode = computed(() => {
|
|
73
|
+
return props.config.dynamicHireRelat?.replace(/(\]|\[|(->))/g, '')?.replace(' ', '').replace(/[!@#$%^&*]/g, '')
|
|
74
|
+
// return `${props.config?.metaCode}-${props?.rowScope?.$index || ''}`
|
|
75
|
+
})
|
|
76
|
+
const styleObj = computed(() => {
|
|
77
|
+
const obj = {}
|
|
78
|
+
if (props.width) {
|
|
79
|
+
obj.width = props.width
|
|
80
|
+
}
|
|
81
|
+
return obj
|
|
82
|
+
})
|
|
83
|
+
const lang = inject('lang')
|
|
84
|
+
const modelValue = defineModel()
|
|
85
|
+
watch(modelValue, () => {
|
|
86
|
+
nextTick(() => {
|
|
87
|
+
elFormItem?.validate?.('blur').catch()
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
const initSelEmployee = async () => {
|
|
91
|
+
let feiShuTokens = ''
|
|
92
|
+
const { getToken, loadStyle, loadScript, initSelUser } = useSelEmployeeJs()
|
|
93
|
+
let ret = await Promise.all([getToken(), loadStyle(), loadScript()])
|
|
94
|
+
if (ret && ret.length) {
|
|
95
|
+
feiShuTokens = ret[0]
|
|
96
|
+
if (!feiShuTokens) return
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const unWatch = watch(() => {
|
|
100
|
+
return dataLoad.value
|
|
101
|
+
}, async (val) => {
|
|
102
|
+
if (!val) return
|
|
103
|
+
await seelp(200)
|
|
104
|
+
console.log('select-employees modelValue:', modelValue.value)
|
|
105
|
+
const data = modelValue.value ? modelValue.value.split(separator.value) : []
|
|
106
|
+
let deptForUser = {}
|
|
107
|
+
if (props.deptIds || props.excludeDeptIds) {
|
|
108
|
+
deptForUser.deptIds = isString(props.deptIds) ? props.deptIds : ''
|
|
109
|
+
deptForUser.excludeDeptIds = isString(props.excludeDeptIds) ? props.excludeDeptIds : ''
|
|
110
|
+
deptForUser.cascade = isBoolean(props.cascade) ? props.cascade : !!(props.cascade)
|
|
111
|
+
}
|
|
112
|
+
const initParams = {
|
|
113
|
+
el: `#${metaCode.value}`,
|
|
114
|
+
data,
|
|
115
|
+
token: feiShuTokens,
|
|
116
|
+
type: props.type,
|
|
117
|
+
deptForUser,
|
|
118
|
+
lang: lang.value,
|
|
119
|
+
multiple: typeof props.multiple === 'boolean' ? props.multiple : props.multiple == '1',
|
|
120
|
+
placeholder: lang?.value?.indexOf('zh') > -1 ? props.placeholder : props.placeholderEn,
|
|
121
|
+
// disabled: props.disabled,
|
|
122
|
+
onSelectedChange: (data, arr) => {
|
|
123
|
+
console.log('onSelectedChange===:', data, arr)
|
|
124
|
+
emit('change', data, arr, props)
|
|
125
|
+
modelValue.value = data?.join(separator.value) || ''
|
|
126
|
+
},
|
|
127
|
+
}
|
|
128
|
+
if (props.positionType) {
|
|
129
|
+
initParams.positionType = props.positionType
|
|
130
|
+
}
|
|
131
|
+
if (props.disabled) {
|
|
132
|
+
initParams.userIds = data
|
|
133
|
+
}
|
|
134
|
+
console.log(`metaCode:${props?.config?.metaCode},initParams:`, initParams)
|
|
135
|
+
initSelUser(initParams)
|
|
136
|
+
unWatch && unWatch()
|
|
137
|
+
}, {
|
|
138
|
+
immediate: true
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const showSelUserDialog = debounce(async function () {
|
|
143
|
+
let feiShuTokens = ''
|
|
144
|
+
const { getToken, loadScriptDepartment } = useSelEmployeeJs()
|
|
145
|
+
let ret = await Promise.all([getToken(), loadScriptDepartment()])
|
|
146
|
+
if (ret && ret.length) {
|
|
147
|
+
feiShuTokens = ret[0]
|
|
148
|
+
if (!feiShuTokens) return
|
|
149
|
+
}
|
|
150
|
+
_DIC_COMMON_JS_.showSelUserDialog({
|
|
151
|
+
token: feiShuTokens,
|
|
152
|
+
}, {
|
|
153
|
+
needCompleteData: false,
|
|
154
|
+
chooseType: 'all'
|
|
155
|
+
})?.then((res) => {
|
|
156
|
+
debugger
|
|
157
|
+
})
|
|
158
|
+
}, 200)
|
|
159
|
+
|
|
160
|
+
function seelp(time) {
|
|
161
|
+
return new Promise((resolve) => {
|
|
162
|
+
setTimeout(() => {
|
|
163
|
+
resolve(true)
|
|
164
|
+
}, time);
|
|
165
|
+
})
|
|
166
|
+
}
|
|
167
|
+
onMounted(() => {
|
|
168
|
+
initSelEmployee()
|
|
169
|
+
})
|
|
170
|
+
</script>
|
|
171
|
+
|
|
172
|
+
<style lang="scss">
|
|
173
|
+
.select-employees {
|
|
174
|
+
position: relative;
|
|
175
|
+
width: 100%;
|
|
176
|
+
.disable-employees {
|
|
177
|
+
position: absolute;
|
|
178
|
+
top: 0;
|
|
179
|
+
bottom: 0;
|
|
180
|
+
left: 0;
|
|
181
|
+
right: 0;
|
|
182
|
+
cursor: not-allowed;
|
|
183
|
+
background: transparent;
|
|
184
|
+
// cursor: no-drop;
|
|
185
|
+
// background: #EFF0F1;
|
|
186
|
+
// border: 1px solid #D0D3D6;
|
|
187
|
+
// padding: 0 12px;
|
|
188
|
+
// border-radius: 4px;
|
|
189
|
+
// height: 32px;
|
|
190
|
+
}
|
|
191
|
+
xm-select > .xm-label .scroll .label-content {
|
|
192
|
+
line-height: 24px;
|
|
193
|
+
padding-left: 10px !important;
|
|
194
|
+
padding-top: 3px !important;
|
|
195
|
+
padding-bottom: 3px !important;
|
|
196
|
+
}
|
|
197
|
+
.is-disabled {
|
|
198
|
+
xm-select {
|
|
199
|
+
background: var(--el-disabled-bg-color);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
</style>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElButton @click="buttonAction" v-bind="{...attrs, ...calcPorps}">
|
|
3
|
+
{{label}}
|
|
4
|
+
</ElButton>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup>
|
|
7
|
+
import { ElButton } from 'element-plus'
|
|
8
|
+
import { defineProps, inject, computed, useAttrs } from 'vue'
|
|
9
|
+
import { commonPropsType } from '../../utils/index.js'
|
|
10
|
+
import thirdPartyFrame from '../thirdPartyFrame'
|
|
11
|
+
import { MAIL_SEND_URL } from '../../api/builtIn.js'
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
...commonPropsType,
|
|
15
|
+
...ElButton.props,
|
|
16
|
+
toHref: String,
|
|
17
|
+
plain: [String, Number, Boolean],
|
|
18
|
+
circle: [String, Number, Boolean]
|
|
19
|
+
})
|
|
20
|
+
const calcPorps = computed(() => {
|
|
21
|
+
const ret = {
|
|
22
|
+
...props
|
|
23
|
+
}
|
|
24
|
+
if (ret.plain == '1') {
|
|
25
|
+
ret.plain = true
|
|
26
|
+
} else {
|
|
27
|
+
ret.plain = false
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (ret.circle == '1') {
|
|
31
|
+
ret.circle = true
|
|
32
|
+
} else {
|
|
33
|
+
ret.circle = false
|
|
34
|
+
}
|
|
35
|
+
if (props?.config?.rounds && props?.config?.rounds == '1') {
|
|
36
|
+
ret.round = true
|
|
37
|
+
}
|
|
38
|
+
if (props?.config?.widgetSize) {
|
|
39
|
+
ret.size = props?.config?.widgetSize
|
|
40
|
+
}
|
|
41
|
+
if (props?.config?.displayType) {
|
|
42
|
+
ret.type = props?.config?.displayType
|
|
43
|
+
}
|
|
44
|
+
return ret
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const attrs = useAttrs()
|
|
48
|
+
|
|
49
|
+
const lang = inject('lang')
|
|
50
|
+
|
|
51
|
+
const label = computed(() => {
|
|
52
|
+
return lang.value.indexOf('zh') > -1 ? (props.config?.labelZh || props.config?.metaNameZh) : (props.config?.labelEn || props.config?.metaNameEn)
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const buttonAction = () => {
|
|
56
|
+
thirdPartyFrame({
|
|
57
|
+
lang: lang?.value,
|
|
58
|
+
showClose: true,
|
|
59
|
+
src: `${MAIL_SEND_URL}?showMenuHead=5&fullScreen=true&apToken=${props.toHref}`
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ElSteps } from 'element-plus'
|
|
3
|
+
import { computed, defineProps, inject, useAttrs } from 'vue'
|
|
4
|
+
import { commonPropsType, hasOwn } from '../../utils/index.js'
|
|
5
|
+
|
|
6
|
+
const modelValue = defineModel()
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
...commonPropsType,
|
|
9
|
+
...ElSteps.props,
|
|
10
|
+
})
|
|
11
|
+
const calcProps = computed(() => {
|
|
12
|
+
const ret = Object.keys(ElSteps.props).reduce((total, key) => {
|
|
13
|
+
total[key] = props[key]
|
|
14
|
+
return total
|
|
15
|
+
}, {})
|
|
16
|
+
ret.simple = props.config?.displayType === 'simple'
|
|
17
|
+
if (!hasOwn(props.config, 'finish-status') && !hasOwn(props.config, 'finishStatus')) {
|
|
18
|
+
ret.finishStatus = 'finish'
|
|
19
|
+
}
|
|
20
|
+
if (!ret.direction) {
|
|
21
|
+
ret.direction = 'horizontal'
|
|
22
|
+
}
|
|
23
|
+
return ret
|
|
24
|
+
})
|
|
25
|
+
const lang = inject('lang')
|
|
26
|
+
const attrs = useAttrs()
|
|
27
|
+
|
|
28
|
+
const optionItems = computed(() => {
|
|
29
|
+
return JSON.parse(props.config?.optionItems || '[]')
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
</script>
|
|
33
|
+
<template>
|
|
34
|
+
<ElSteps v-bind="{...attrs, ...calcProps}" :active="modelValue || 0">
|
|
35
|
+
<el-step v-for="(item, index) in optionItems" :key="index"
|
|
36
|
+
:title="lang.indexOf('zh') > -1 ? item.title_zh : item.title_en"
|
|
37
|
+
:description="lang.indexOf('zh') > -1 ? item.description_zh : item.description_en"
|
|
38
|
+
:icon="!!item.icon ? item.icon : ''"
|
|
39
|
+
/>
|
|
40
|
+
</ElSteps>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="comp" v-bind="attrs"></component>
|
|
3
|
+
</template>
|
|
4
|
+
<script setup>
|
|
5
|
+
import { useAttrs } from 'vue'
|
|
6
|
+
import CustomComponentCycleTabPane from './CustomComponentCycleTabPane.vue'
|
|
7
|
+
import CustomComponentNativeTabPane from './CustomComponentNativeTabPane.vue'
|
|
8
|
+
import { computed } from 'vue'
|
|
9
|
+
|
|
10
|
+
const attrs = useAttrs()
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
isCycle: {
|
|
13
|
+
type: [String, Number],
|
|
14
|
+
default: '0'
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
const comp = computed(() => {
|
|
18
|
+
return props.isCycle == '1' ? CustomComponentCycleTabPane : CustomComponentNativeTabPane
|
|
19
|
+
})
|
|
20
|
+
</script>
|