resolver-egretimp-plus 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.config.js +14 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +8 -0
- package/dist/theme/element/index.css +1 -0
- package/dist/theme/element/src/components/card.scss +4 -0
- package/dist/theme/element/src/components/collapse.scss +16 -0
- package/dist/theme/element/src/components/date.scss +13 -0
- package/dist/theme/element/src/components/form.scss +54 -0
- package/dist/theme/element/src/components/index.scss +42 -0
- package/dist/theme/element/src/components/input.scss +15 -0
- package/dist/theme/element/src/components/message.scss +31 -0
- package/dist/theme/element/src/components/scrollbar.scss +14 -0
- package/dist/theme/element/src/components/select.scss +17 -0
- package/dist/theme/element/src/components/steps.scss +6 -0
- package/dist/theme/element/src/components/table.scss +8 -0
- package/dist/theme/element/src/components/tabs.scss +68 -0
- package/dist/theme/element/src/components/tree.scss +0 -0
- package/dist/theme/element/src/index.scss +79 -0
- package/index.js +17 -0
- package/package.json +45 -0
- package/scripts/gulpfile.mjs +73 -0
- package/scripts/webpack.config.js +81 -0
- package/src/analysisComponent.jsx +166 -0
- package/src/components/helper/button.js +17 -0
- package/src/components/helper/dock.js +120 -0
- package/src/components/icons/question-filled.vue +13 -0
- package/src/components/packages/CmiButton.vue +84 -0
- package/src/components/packages/CmiCalendar.vue +138 -0
- package/src/components/packages/CmiCell.vue +34 -0
- package/src/components/packages/CmiCheckbox.vue +63 -0
- package/src/components/packages/CmiDatetimePicker.vue +84 -0
- package/src/components/packages/CmiDropdownMenu.vue +57 -0
- package/src/components/packages/CmiInput.vue +45 -0
- package/src/components/packages/CmiLink.vue +28 -0
- package/src/components/packages/CmiPicker.vue +120 -0
- package/src/components/packages/CmiRadio.vue +29 -0
- package/src/components/packages/CmiSearch.vue +39 -0
- package/src/components/packages/CmiSelect.vue +84 -0
- package/src/components/packages/CustomComponentCard.vue +40 -0
- package/src/components/packages/CustomComponentCardH5.vue +40 -0
- package/src/components/packages/CustomComponentCol.vue +69 -0
- package/src/components/packages/CustomComponentColH5.vue +8 -0
- package/src/components/packages/CustomComponentCollapse.vue +183 -0
- package/src/components/packages/CustomComponentCollapseH5.vue +37 -0
- package/src/components/packages/CustomComponentCycle.vue +95 -0
- package/src/components/packages/CustomComponentCycleTabPane.vue +92 -0
- package/src/components/packages/CustomComponentDialog.vue +162 -0
- package/src/components/packages/CustomComponentEditor.vue +43 -0
- package/src/components/packages/CustomComponentFormLayout.vue +63 -0
- package/src/components/packages/CustomComponentFormLayoutH5.vue +55 -0
- package/src/components/packages/CustomComponentGrid.vue +29 -0
- package/src/components/packages/CustomComponentGridCol.vue +29 -0
- package/src/components/packages/CustomComponentInputDialog.vue +144 -0
- package/src/components/packages/CustomComponentPlain.vue +80 -0
- package/src/components/packages/CustomComponentRow.vue +67 -0
- package/src/components/packages/CustomComponentSelectEmployees.vue +133 -0
- package/src/components/packages/CustomComponentSendMail.vue +72 -0
- package/src/components/packages/CustomComponentSteps.vue +41 -0
- package/src/components/packages/CustomComponentTabPane.vue +41 -0
- package/src/components/packages/CustomComponentTabPaneH5.vue +30 -0
- package/src/components/packages/CustomComponentTable.jsx +406 -0
- package/src/components/packages/CustomComponentTableH5.vue +58 -0
- package/src/components/packages/CustomComponentTabs.vue +75 -0
- package/src/components/packages/CustomComponentTabsH5.vue +86 -0
- package/src/components/packages/CustomComponentTree.vue +28 -0
- package/src/components/packages/ElButton.vue +90 -0
- package/src/components/packages/ElCheckbox.vue +55 -0
- package/src/components/packages/ElDatePicker.vue +58 -0
- package/src/components/packages/ElInput.vue +23 -0
- package/src/components/packages/ElInputNumber.vue +54 -0
- package/src/components/packages/ElPagination.vue +56 -0
- package/src/components/packages/ElRadio.vue +44 -0
- package/src/components/packages/ElSelect.vue +73 -0
- package/src/components/packages/ElText.vue +48 -0
- package/src/components/packages/ElTimePicker.vue +34 -0
- package/src/components/patchComponents.js +46 -0
- package/src/components/styles/CustomComponenTable.scss +125 -0
- package/src/components/tabs/index.js +8 -0
- package/src/components/tabs/src/constants.js +23 -0
- package/src/components/tabs/src/tab-bar.js +8 -0
- package/src/components/tabs/src/tab-bar.vue +92 -0
- package/src/components/tabs/src/tab-nav.jsx +413 -0
- package/src/components/tabs/src/tab-pane.js +15 -0
- package/src/components/tabs/src/tab-pane.vue +80 -0
- package/src/components/tabs/src/tabs.jsx +217 -0
- package/src/components/tabs/style/css.js +2 -0
- package/src/components/tabs/style/index.js +2 -0
- package/src/components/thirdPartyFrame/index.js +32 -0
- package/src/components/thirdPartyFrame/src/ThirdPartyFrame.vue +123 -0
- package/src/hooks/index.js +129 -0
- package/src/hooks/pageConfig.js +20 -0
- package/src/index.jsx +140 -0
- package/src/renderer.jsx +68 -0
- package/src/rules/eventsSupplement.js +439 -0
- package/src/rules/parseCondition.js +359 -0
- package/src/rules/ruleUtils.js +208 -0
- package/src/rules/rulesDriver.js +118 -0
- package/src/theme/element/components/card.scss +4 -0
- package/src/theme/element/components/collapse.scss +16 -0
- package/src/theme/element/components/date.scss +13 -0
- package/src/theme/element/components/form.scss +54 -0
- package/src/theme/element/components/index.scss +42 -0
- package/src/theme/element/components/input.scss +15 -0
- package/src/theme/element/components/message.scss +31 -0
- package/src/theme/element/components/scrollbar.scss +14 -0
- package/src/theme/element/components/select.scss +17 -0
- package/src/theme/element/components/steps.scss +6 -0
- package/src/theme/element/components/table.scss +8 -0
- package/src/theme/element/components/tabs.scss +68 -0
- package/src/theme/element/components/tree.scss +0 -0
- package/src/theme/element/index.scss +79 -0
- package/src/utils/common.js +230 -0
- package/src/utils/const.js +198 -0
- package/src/utils/defaultVal.js +23 -0
- package/src/utils/format.js +19 -0
- package/src/utils/index.js +4 -0
- package/src/utils/is.js +69 -0
- package/src/utils/preserveFunc.js +33 -0
- package/src/utils/render.jsx +714 -0
- package/src/utils/request.js +10 -0
- package/src/utils/valid.js +71 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<cmi-form v-bind="formProps" :ref="refFn">
|
|
3
|
+
<Renderer :config="pmPageMetaList" v-model="val"></Renderer>
|
|
4
|
+
</cmi-form>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup>
|
|
7
|
+
import Renderer from '../../renderer.jsx'
|
|
8
|
+
import { computed, inject } from "vue"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const emits = defineEmits(['update:modelValue'])
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
config: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: () => null
|
|
16
|
+
},
|
|
17
|
+
// 这个组件通过v-model进行数据的绑定
|
|
18
|
+
modelValue: {
|
|
19
|
+
// type: [String, Number, Object],
|
|
20
|
+
default: null
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const rootForm = inject('rootForm')
|
|
25
|
+
const refFn = e => {
|
|
26
|
+
if (props.config?.rootForm) {
|
|
27
|
+
rootForm.value = e
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const formProps = computed(() => {
|
|
32
|
+
return {
|
|
33
|
+
validatefirst: props.config?.validatefirst == '1' ? true : false,
|
|
34
|
+
hidemessage: props.config?.hidemessage == '1' ? true : false,
|
|
35
|
+
hideasterisk: props.config?.hideasterisk == '1' ? true : false,
|
|
36
|
+
labelwidth: props.config?.labelwidth,
|
|
37
|
+
labelsuffix: props.config?.labelsuffix,
|
|
38
|
+
labelposition: props.config?.labelposition,
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const pmPageMetaList = computed(() => props.config.pmPageMetaList)
|
|
43
|
+
|
|
44
|
+
const val = computed({
|
|
45
|
+
get() {
|
|
46
|
+
return props.modelValue
|
|
47
|
+
},
|
|
48
|
+
set(val) {
|
|
49
|
+
emits('update:modelValue', val)
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
defineExpose({
|
|
53
|
+
val
|
|
54
|
+
})
|
|
55
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElRow class="custom-component-grid" v-bind="elRowProps">
|
|
3
|
+
<Renderer :config="pmPageMetaList" v-model="modelValue"></Renderer>
|
|
4
|
+
</ElRow>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup>
|
|
7
|
+
import Renderer from '../../renderer.jsx'
|
|
8
|
+
import { ElRow } from 'element-plus'
|
|
9
|
+
import { computed, defineProps } from 'vue'
|
|
10
|
+
import { commonPropsType } from '../../utils/index.js'
|
|
11
|
+
|
|
12
|
+
const modelValue = defineModel()
|
|
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 pmPageMetaList = computed(() => {
|
|
25
|
+
return props.config?.pmPageMetaList || []
|
|
26
|
+
})
|
|
27
|
+
</script>
|
|
28
|
+
<style lang="scss">
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElCol class="custom-component-grid" v-bind="elColProps">
|
|
3
|
+
<Renderer :config="pmPageMetaList" v-model="modelValue"></Renderer>
|
|
4
|
+
</ElCol>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup>
|
|
7
|
+
import Renderer from '../../renderer.jsx'
|
|
8
|
+
import { ElCol } from 'element-plus'
|
|
9
|
+
import { computed, defineProps } from 'vue'
|
|
10
|
+
import { commonPropsType } from '../../utils/index.js'
|
|
11
|
+
|
|
12
|
+
const modelValue = defineModel()
|
|
13
|
+
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
...commonPropsType,
|
|
16
|
+
...ElCol.props
|
|
17
|
+
})
|
|
18
|
+
const elColProps = computed(() => {
|
|
19
|
+
return Object.keys(ElCol.props).reduce((ret, key) => {
|
|
20
|
+
ret[key] = props[key]
|
|
21
|
+
return ret
|
|
22
|
+
}, {})
|
|
23
|
+
})
|
|
24
|
+
const pmPageMetaList = computed(() => {
|
|
25
|
+
return props.config?.pmPageMetaList || []
|
|
26
|
+
})
|
|
27
|
+
</script>
|
|
28
|
+
<style lang="scss">
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="input-dialog">
|
|
3
|
+
<ElInput :disabled="props.disabled" v-bind="{...inputProps, inputEvents}" :modelValue="label" @clear="modelValue = ''" @click="handleShowDialog">
|
|
4
|
+
<template #suffix v-if="!props.disabled">
|
|
5
|
+
<ElIcon style="cursor: pointer;" @click="handleShowDialog">
|
|
6
|
+
<Search />
|
|
7
|
+
</ElIcon>
|
|
8
|
+
</template>
|
|
9
|
+
</ElInput>
|
|
10
|
+
<ElDialog v-model="dialogVisible" append-to-body width="1000" :title="props.dialogTitle" v-bind="dialogEvents">
|
|
11
|
+
<component :is="component" :valueKey="valueKey" :value="modelValue" @change="currentChange"></component>
|
|
12
|
+
<template #footer>
|
|
13
|
+
<div class="dialog-footer">
|
|
14
|
+
<el-button @click="toClose">
|
|
15
|
+
{{ lang.indexOf('zh') > -1 ? '取消' : 'Cancel' }}
|
|
16
|
+
</el-button>
|
|
17
|
+
<el-button type="primary" @click="toConfirm">
|
|
18
|
+
{{ lang.indexOf('zh') > -1 ? '确定' : 'Confirm' }}
|
|
19
|
+
</el-button>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
</ElDialog>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
<script setup>
|
|
26
|
+
import { ElInput, ElIcon, ElDialog } from 'element-plus'
|
|
27
|
+
import { defineProps, defineOptions, defineModel, ref, watch, computed, inject, useAttrs } from 'vue'
|
|
28
|
+
import { Search, Close } from '@element-plus/icons-vue'
|
|
29
|
+
import { commonPropsType } from '../../utils/index.js'
|
|
30
|
+
|
|
31
|
+
import { hasOwn } from '../../utils';
|
|
32
|
+
|
|
33
|
+
defineOptions({
|
|
34
|
+
inheritAttrs: false
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const currentRow = ref(null)
|
|
38
|
+
const props = defineProps({
|
|
39
|
+
...commonPropsType,
|
|
40
|
+
...ElInput.props,
|
|
41
|
+
valueKey: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: '',
|
|
44
|
+
},
|
|
45
|
+
bindKeys: {
|
|
46
|
+
type: [Array, Object],
|
|
47
|
+
default: () => []
|
|
48
|
+
},
|
|
49
|
+
isRefOptions: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
},
|
|
53
|
+
dialogTitle: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: '',
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
const attrs = useAttrs()
|
|
59
|
+
|
|
60
|
+
const getCompEvents = (comp) => {
|
|
61
|
+
let emitKeys = comp.emits
|
|
62
|
+
if(!Array.isArray(emitKeys)) {
|
|
63
|
+
emitKeys = Object.keys(emitKeys)
|
|
64
|
+
}
|
|
65
|
+
return emitKeys.reduce((ret, key) => {
|
|
66
|
+
const eventKey = capitalize(camelize(eventKey))
|
|
67
|
+
if (hasOwn(attrs, eventKey)) {
|
|
68
|
+
ret[eventKey] = attrs[eventKey]
|
|
69
|
+
}
|
|
70
|
+
return ret
|
|
71
|
+
}, {})
|
|
72
|
+
}
|
|
73
|
+
const inputEvents = computed(() => {
|
|
74
|
+
return getCompEvents(ElInput)
|
|
75
|
+
})
|
|
76
|
+
const dialogEvents = computed(() => {
|
|
77
|
+
return getCompEvents(ElDialog)
|
|
78
|
+
})
|
|
79
|
+
const inputProps = computed(() => {
|
|
80
|
+
const propsObj = Object.keys(ElInput.props).reduce((ret, key) => {
|
|
81
|
+
if (props[key]) {
|
|
82
|
+
ret[key] = props[key]
|
|
83
|
+
}
|
|
84
|
+
return ret
|
|
85
|
+
}, {})
|
|
86
|
+
if (!hasOwn(propsObj, 'clearable')) {
|
|
87
|
+
propsObj.clearable = true
|
|
88
|
+
}
|
|
89
|
+
return propsObj
|
|
90
|
+
})
|
|
91
|
+
const lang = inject('lang')
|
|
92
|
+
const dialogComponents = inject('dialogComponents')
|
|
93
|
+
const component = computed(() => {
|
|
94
|
+
return dialogComponents?.[props?.config?.component]
|
|
95
|
+
})
|
|
96
|
+
const valueKey = computed(() => {
|
|
97
|
+
return props.valueKey || props?.config?.metaCode
|
|
98
|
+
})
|
|
99
|
+
const modelValue = defineModel()
|
|
100
|
+
const label = computed(() => {
|
|
101
|
+
if (props.isRefOptions) {
|
|
102
|
+
return (props.options || []).find(item => item.columnValue === modelValue.value)?.[lang?.value?.indexOf('zh') > -1 ? 'columnDesc_zh' : 'columnDesc']
|
|
103
|
+
}
|
|
104
|
+
return modelValue.value
|
|
105
|
+
})
|
|
106
|
+
let models = {}
|
|
107
|
+
const bindkeysType = Object.prototype.toString.call(props.bindKeys)
|
|
108
|
+
if (bindkeysType === '[object Object]') {
|
|
109
|
+
models = Object.keys(props.bindKeys).reduce((ret, key) => {
|
|
110
|
+
ret[props.bindKeys[key]] = defineModel(key)
|
|
111
|
+
return ret
|
|
112
|
+
}, {})
|
|
113
|
+
} else if (bindkeysType === '[object Array]') {
|
|
114
|
+
models = props.bindKeys.reduce((ret, key) => {
|
|
115
|
+
ret[key] = defineModel(key)
|
|
116
|
+
return ret
|
|
117
|
+
}, {})
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const dialogVisible = ref(false)
|
|
121
|
+
|
|
122
|
+
const currentChange = (val) => {
|
|
123
|
+
currentRow.value = val
|
|
124
|
+
}
|
|
125
|
+
const handleShowDialog = () => {
|
|
126
|
+
dialogVisible.value = true
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const toClose = () => {
|
|
130
|
+
dialogVisible.value = false
|
|
131
|
+
}
|
|
132
|
+
const toConfirm = () => {
|
|
133
|
+
modelValue.value = currentRow.value && currentRow.value[valueKey.value]
|
|
134
|
+
Object.keys(models).forEach(key => {
|
|
135
|
+
models[key].value = currentRow.value && currentRow.value[key]
|
|
136
|
+
})
|
|
137
|
+
dialogVisible.value = false
|
|
138
|
+
}
|
|
139
|
+
</script>
|
|
140
|
+
<style scoped>
|
|
141
|
+
.input-dialog {
|
|
142
|
+
width: 100%;
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
@@ -0,0 +1,80 @@
|
|
|
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 } from 'vue'
|
|
8
|
+
import dayjs from 'dayjs'
|
|
9
|
+
|
|
10
|
+
const modelValue = defineModel()
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
...commonPropsType,
|
|
13
|
+
type: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ''
|
|
16
|
+
},
|
|
17
|
+
formatter: {
|
|
18
|
+
type: Function,
|
|
19
|
+
default: null
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
const lang = inject('lang')
|
|
23
|
+
function isPatchComponent(components, props) {
|
|
24
|
+
return (findComponent(components, props?.config?.renderby) !== -1 || findComponent(components, props?.config?.metaType) !== -1)
|
|
25
|
+
}
|
|
26
|
+
const value = computed(() => {
|
|
27
|
+
if (
|
|
28
|
+
isPatchComponent(PLAIN_TYPE_OPTIONS_COLUMNS, props)
|
|
29
|
+
) {
|
|
30
|
+
return props?.options?.find(item => item.columnValue == modelValue.value)?.[lang?.value?.indexOf('zh') > -1 ? 'columnDesc_zh' : 'columnDesc']
|
|
31
|
+
} else {
|
|
32
|
+
if (isPatchComponent(['ElDatePicker'], props)) {
|
|
33
|
+
if (!modelValue.value) {
|
|
34
|
+
return ''
|
|
35
|
+
}
|
|
36
|
+
return dayjs(modelValue.value, props?.config?.format || 'YYYY-MM-DD').format(props?.config?.format || 'YYYY-MM-DD')
|
|
37
|
+
}
|
|
38
|
+
return modelValue.value
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const classObj = computed(() => ({
|
|
43
|
+
[`custom-component-plain--${props.type}`]: true
|
|
44
|
+
}))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
const appContext = getCurrentInstance()?.appContext
|
|
48
|
+
const buttonActions = inject('buttonActions', {})
|
|
49
|
+
|
|
50
|
+
const dynamicMapComp = inject('dynamicMapComp')
|
|
51
|
+
const hireRelatMapRules = inject('hireRelatMapRules')
|
|
52
|
+
const components = inject('components')
|
|
53
|
+
const selects = inject('selects')
|
|
54
|
+
const rootValue = inject('rootValue')
|
|
55
|
+
const dataLoad = inject('dataLoad')
|
|
56
|
+
const rootForm = inject('rootForm')
|
|
57
|
+
const clickAction = () => {
|
|
58
|
+
const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
|
|
59
|
+
const actionFn = buttonActions[actionKey]
|
|
60
|
+
actionFn && actionFn(props, {
|
|
61
|
+
dynamicMapComp,
|
|
62
|
+
hireRelatMapRules,
|
|
63
|
+
components,
|
|
64
|
+
selects,
|
|
65
|
+
rootValue,
|
|
66
|
+
dataLoad,
|
|
67
|
+
rootForm
|
|
68
|
+
}, appContext)
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
<style lang="scss" scoped>
|
|
72
|
+
.custom-component-plain {
|
|
73
|
+
}
|
|
74
|
+
.custom-component-plain--primary {
|
|
75
|
+
color: var(--el-color-primary);
|
|
76
|
+
}
|
|
77
|
+
.custom-component-plain--error {
|
|
78
|
+
color: #F54A45;
|
|
79
|
+
}
|
|
80
|
+
</style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElRow class="custom-component-row" :class="classRef" v-bind="{...elRowProps, ...attrs}">
|
|
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
|
+
|
|
26
|
+
const classRef = computed(() => {
|
|
27
|
+
return {
|
|
28
|
+
'clear-right-margin': !reserveRightMargin.value,
|
|
29
|
+
'clear-bottom-margin': !reserveBottomMargin.value,
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const pmPageMetaList = computed(() => {
|
|
34
|
+
return props.config?.pmPageMetaList || []
|
|
35
|
+
})
|
|
36
|
+
// 保留内部formItem的margin-right
|
|
37
|
+
const reserveRightMargin = computed(() => {
|
|
38
|
+
return props.config?.reserveRightMargin
|
|
39
|
+
})
|
|
40
|
+
// 保留内部formItem的margin-bottom
|
|
41
|
+
const reserveBottomMargin = computed(() => {
|
|
42
|
+
return props.config?.reserveBottomMargin
|
|
43
|
+
})
|
|
44
|
+
</script>
|
|
45
|
+
<style lang="scss">
|
|
46
|
+
.custom-component-row {
|
|
47
|
+
width: 100%;
|
|
48
|
+
.el-col {
|
|
49
|
+
& > .el-form-item {
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
.clear-right-margin {
|
|
54
|
+
.el-col {
|
|
55
|
+
& > .el-form-item {
|
|
56
|
+
margin-right: 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
.clear-bottom-margin {
|
|
61
|
+
.el-col {
|
|
62
|
+
& > .el-form-item {
|
|
63
|
+
margin-bottom: 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-employees">
|
|
3
|
+
<div :id="metaCode" :style="styleObj" class="xm-select-user" :class="[props.disabled ? 'is-disabled' : '']"></div>
|
|
4
|
+
<div v-if="props.disabled" class="disable-employees"></div>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
<script setup>
|
|
8
|
+
import { onMounted, inject, watch, defineProps, computed, defineEmits, nextTick } from 'vue';
|
|
9
|
+
import { useSelEmployeeJs } from '../helper/dock.js'
|
|
10
|
+
import { commonPropsType } from '../../utils/index.js'
|
|
11
|
+
import { useFormItem } from 'element-plus'
|
|
12
|
+
|
|
13
|
+
const { formItem: elFormItem } = useFormItem()
|
|
14
|
+
const emit = defineEmits(['change'])
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
...commonPropsType,
|
|
17
|
+
multiple: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
type: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: 'user'
|
|
24
|
+
},
|
|
25
|
+
placeholder: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ''
|
|
28
|
+
},
|
|
29
|
+
placeholderEn: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
const dataLoad = inject('dataLoad')
|
|
35
|
+
const metaCode = computed(() => {
|
|
36
|
+
return props.config?.metaCode
|
|
37
|
+
})
|
|
38
|
+
const styleObj = computed(() => {
|
|
39
|
+
const obj = {}
|
|
40
|
+
if (props.width) {
|
|
41
|
+
obj.width = props.width
|
|
42
|
+
}
|
|
43
|
+
return obj
|
|
44
|
+
})
|
|
45
|
+
const lang = inject('lang')
|
|
46
|
+
const modelValue = defineModel()
|
|
47
|
+
watch(modelValue, () => {
|
|
48
|
+
nextTick(() => {
|
|
49
|
+
elFormItem?.validate?.('blur').catch()
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
const initSelEmployee = async () => {
|
|
53
|
+
let feiShuTokens = ''
|
|
54
|
+
const { getToken, loadStyle, loadScript, initSelUser } = useSelEmployeeJs()
|
|
55
|
+
let ret = await Promise.all([getToken(), loadStyle(), loadScript()])
|
|
56
|
+
if (ret && ret.length) {
|
|
57
|
+
feiShuTokens = ret[0]
|
|
58
|
+
if (!feiShuTokens) return
|
|
59
|
+
}
|
|
60
|
+
const unWatch = watch(() => {
|
|
61
|
+
return dataLoad.value
|
|
62
|
+
}, async (val) => {
|
|
63
|
+
if (!val) return
|
|
64
|
+
await nextTick()
|
|
65
|
+
const data = modelValue.value ? modelValue.value.split(',') : []
|
|
66
|
+
const initParams = {
|
|
67
|
+
el: `#${metaCode.value}`,
|
|
68
|
+
data,
|
|
69
|
+
token: feiShuTokens,
|
|
70
|
+
type: props.type,
|
|
71
|
+
deptForUser: {
|
|
72
|
+
// deptIds: '100178100000000001X8',
|
|
73
|
+
// cascade: true
|
|
74
|
+
},
|
|
75
|
+
lang: lang.value,
|
|
76
|
+
multiple: props.multiple,
|
|
77
|
+
placeholder: lang?.value?.indexOf('zh') > -1 ? props.placeholder : props.placeholderEn,
|
|
78
|
+
// disabled: props.disabled,
|
|
79
|
+
onSelectedChange: (data, arr) => {
|
|
80
|
+
if (data && data.length > 0) {
|
|
81
|
+
emit('change', data, arr, props)
|
|
82
|
+
modelValue.value = data && data.join(',')
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (props.disabled) {
|
|
87
|
+
initParams.userIds = data
|
|
88
|
+
}
|
|
89
|
+
console.log('initParams', initParams)
|
|
90
|
+
initSelUser(initParams)
|
|
91
|
+
unWatch && unWatch()
|
|
92
|
+
}, {
|
|
93
|
+
immediate: true
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
onMounted(() => {
|
|
98
|
+
initSelEmployee()
|
|
99
|
+
})
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<style lang="scss">
|
|
103
|
+
.select-employees {
|
|
104
|
+
position: relative;
|
|
105
|
+
width: 100%;
|
|
106
|
+
.disable-employees {
|
|
107
|
+
position: absolute;
|
|
108
|
+
top: 0;
|
|
109
|
+
bottom: 0;
|
|
110
|
+
left: 0;
|
|
111
|
+
right: 0;
|
|
112
|
+
cursor: not-allowed;
|
|
113
|
+
background: transparent;
|
|
114
|
+
// cursor: no-drop;
|
|
115
|
+
// background: #EFF0F1;
|
|
116
|
+
// border: 1px solid #D0D3D6;
|
|
117
|
+
// padding: 0 12px;
|
|
118
|
+
// border-radius: 4px;
|
|
119
|
+
// height: 32px;
|
|
120
|
+
}
|
|
121
|
+
xm-select > .xm-label .scroll .label-content {
|
|
122
|
+
line-height: 24px;
|
|
123
|
+
padding-left: 10px !important;
|
|
124
|
+
padding-top: 3px !important;
|
|
125
|
+
padding-bottom: 3px !important;
|
|
126
|
+
}
|
|
127
|
+
.is-disabled {
|
|
128
|
+
xm-select {
|
|
129
|
+
background: var(--el-disabled-bg-color);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElButton @click="buttonAction" v-bind="{...attrs, ...calcPorps}">
|
|
3
|
+
{{label}}
|
|
4
|
+
</ElButton>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup>
|
|
7
|
+
import { ElButton } from 'element-plus'
|
|
8
|
+
import { defineProps, inject, getCurrentInstance, computed, useAttrs } from 'vue'
|
|
9
|
+
import { commonPropsType, MAIL_SEND_URL } from '../../utils/index.js'
|
|
10
|
+
import { useRoute } from 'vue-router'
|
|
11
|
+
import thirdPartyFrame from '../thirdPartyFrame'
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
...commonPropsType,
|
|
15
|
+
...ElButton.props,
|
|
16
|
+
toHref: String
|
|
17
|
+
})
|
|
18
|
+
const calcPorps = computed(() => {
|
|
19
|
+
const ret = {
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
if (ret.plain == '1') {
|
|
23
|
+
ret.plain = true
|
|
24
|
+
} else {
|
|
25
|
+
ret.plain = false
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (ret.circle == '1') {
|
|
29
|
+
ret.circle = true
|
|
30
|
+
} else {
|
|
31
|
+
ret.circle = false
|
|
32
|
+
}
|
|
33
|
+
if (props?.config?.rounds && props?.config?.rounds == '1') {
|
|
34
|
+
ret.round = true
|
|
35
|
+
}
|
|
36
|
+
if (props?.config?.widgetSize) {
|
|
37
|
+
ret.size = props?.config?.widgetSize
|
|
38
|
+
}
|
|
39
|
+
if (props?.config?.displayType) {
|
|
40
|
+
ret.type = props?.config?.displayType
|
|
41
|
+
}
|
|
42
|
+
return ret
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const attrs = useAttrs()
|
|
46
|
+
|
|
47
|
+
const lang = inject('lang')
|
|
48
|
+
|
|
49
|
+
const label = computed(() => {
|
|
50
|
+
return lang.value.indexOf('zh') > -1 ? (props.config?.labelZh || props.config?.metaNameZh) : (props.config?.labelEn || props.config?.metaNameEn)
|
|
51
|
+
})
|
|
52
|
+
// const route = useRoute()
|
|
53
|
+
// const buttonActions = inject('buttonActions', {})
|
|
54
|
+
|
|
55
|
+
// const dynamicMapComp = inject('dynamicMapComp')
|
|
56
|
+
// const hireRelatMapRules = inject('hireRelatMapRules')
|
|
57
|
+
// const components = inject('components')
|
|
58
|
+
// const selects = inject('selects')
|
|
59
|
+
// const rootValue = inject('rootValue')
|
|
60
|
+
// const dataLoad = inject('dataLoad')
|
|
61
|
+
// const rootForm = inject('rootForm')
|
|
62
|
+
// const _axiosInstance = inject('_axiosInstance')
|
|
63
|
+
// const routeQuery= route?.query
|
|
64
|
+
|
|
65
|
+
const buttonAction = () => {
|
|
66
|
+
thirdPartyFrame({
|
|
67
|
+
lang: lang?.value,
|
|
68
|
+
showClose: true,
|
|
69
|
+
src: `${MAIL_SEND_URL}?showMenuHead=5&fullScreen=true&apToken=${props.toHref}`
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
</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,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<TabPane v-bind="{...tabPaneProps, ...polyProps, ...attrs}">
|
|
3
|
+
<template #label v-if="slotsPageMetalist.length">
|
|
4
|
+
<Renderer :config="slotsPageMetalist" v-model="props.refValue.value"></Renderer>
|
|
5
|
+
</template>
|
|
6
|
+
<ElRow>
|
|
7
|
+
<Renderer :config="(props.config.pmPageMetaList || []).filter(config => !config.collapseSlot)" v-model="props.refValue.value"></Renderer>
|
|
8
|
+
</ElRow>
|
|
9
|
+
</TabPane>
|
|
10
|
+
</template>
|
|
11
|
+
<script setup>
|
|
12
|
+
import { ElTabPane, ElRow } from 'element-plus'
|
|
13
|
+
import Renderer from '../../renderer.jsx'
|
|
14
|
+
import { computed, inject, useAttrs } from 'vue'
|
|
15
|
+
import { commonPropsType } from '../../utils/index.js'
|
|
16
|
+
import { TabPane } from '../tabs'
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
...commonPropsType,
|
|
20
|
+
...ElTabPane.props,
|
|
21
|
+
})
|
|
22
|
+
const attrs = useAttrs()
|
|
23
|
+
|
|
24
|
+
const slotsPageMetalist = computed(() => {
|
|
25
|
+
return (props.config.pmPageMetaList || []).filter(config => config.collapseSlot)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const lang = inject('lang')
|
|
29
|
+
const polyProps = computed(() => {
|
|
30
|
+
return {
|
|
31
|
+
label: lang.value.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
|
|
32
|
+
name: props.config?.metaCode
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
const tabPaneProps = computed(() => {
|
|
36
|
+
return Object.keys(ElTabPane.props).reduce((ret, key) => {
|
|
37
|
+
ret[key] = props[key]
|
|
38
|
+
return ret
|
|
39
|
+
}, {})
|
|
40
|
+
})
|
|
41
|
+
</script>
|