resolver-egretimp-plus 0.1.119 → 0.1.120
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 +18 -18
- package/dist/web/index.js +9 -9
- package/package.json +1 -1
- package/src/components/packages-web/CustomComponentTable.jsx +7 -1
- package/src/config.js +2 -0
- package/src/hooks/pageConfig.js +8 -4
- package/src/index.jsx +13 -10
- package/src/resolver-common.vue +22 -2
- package/src/rules/rulesDriver.js +4 -0
- package/src/utils/common.js +13 -0
- package/src/utils/render.jsx +143 -96
- package/src-bak/analysisComponent.jsx +0 -343
- package/src-bak/api/builtIn.js +0 -10
- package/src-bak/bpm/bpmInstance.js +0 -388
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/application.js +0 -8
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/component.js +0 -97
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/datasource.js +0 -88
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/index.js +0 -3
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/UdcComponent.js +0 -76
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/index.js +0 -201
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/index.js +0 -69
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/page.js +0 -56
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/utils.js +0 -76
- package/src-bak/bpm/udc-sdk-esm/cjs/index.js +0 -46
- package/src-bak/bpm/udc-sdk-esm/cjs/utils.js +0 -21
- package/src-bak/components/childDialog/index.js +0 -39
- package/src-bak/components/childDialog/src/index.vue +0 -185
- package/src-bak/components/cmiFormItem/index.js +0 -1
- package/src-bak/components/cmiFormItem/src/index.vue +0 -112
- package/src-bak/components/confirmInstance-H5/index.js +0 -53
- package/src-bak/components/confirmInstance-H5/src/index.vue +0 -54
- package/src-bak/components/helper/FormPolyfill.jsx +0 -25
- package/src-bak/components/helper/calcTooltip.jsx +0 -134
- package/src-bak/components/helper/dock.js +0 -141
- package/src-bak/components/helper/eventOrchestration.js +0 -763
- package/src-bak/components/helper/resolver.js +0 -163
- package/src-bak/components/helper/table.jsx +0 -103
- package/src-bak/components/icons/date.vue +0 -33
- package/src-bak/components/icons/info.vue +0 -62
- package/src-bak/components/icons/loading.vue +0 -19
- package/src-bak/components/icons/question-filled.vue +0 -8
- package/src-bak/components/loading/index.js +0 -6
- package/src-bak/components/loading/loading.js +0 -98
- package/src-bak/components/loading/loading.scss +0 -74
- package/src-bak/components/loading/loading.vue +0 -89
- package/src-bak/components/loadingComponent/LoadingComponent.vue +0 -33
- package/src-bak/components/modal/index.js +0 -9
- package/src-bak/components/modal/modal.scss +0 -195
- package/src-bak/components/modal/modal.vue +0 -201
- package/src-bak/components/options/OptionsDefault.vue +0 -47
- package/src-bak/components/packages-H5/CmiButton.vue +0 -120
- package/src-bak/components/packages-H5/CmiCalendar.vue +0 -152
- package/src-bak/components/packages-H5/CmiCell.vue +0 -87
- package/src-bak/components/packages-H5/CmiCheckbox.vue +0 -82
- package/src-bak/components/packages-H5/CmiDatetimePicker.vue +0 -98
- package/src-bak/components/packages-H5/CmiDivider.vue +0 -30
- package/src-bak/components/packages-H5/CmiDropdownMenu.vue +0 -58
- package/src-bak/components/packages-H5/CmiInput.vue +0 -69
- package/src-bak/components/packages-H5/CmiLink.vue +0 -28
- package/src-bak/components/packages-H5/CmiPicker.vue +0 -229
- package/src-bak/components/packages-H5/CmiRadio.vue +0 -29
- package/src-bak/components/packages-H5/CmiSearch.vue +0 -39
- package/src-bak/components/packages-H5/CmiSelect.vue +0 -84
- package/src-bak/components/packages-H5/CustomComponentCardH5.vue +0 -129
- package/src-bak/components/packages-H5/CustomComponentColH5.vue +0 -8
- package/src-bak/components/packages-H5/CustomComponentCollapseH5.vue +0 -141
- package/src-bak/components/packages-H5/CustomComponentFormLayoutH5.vue +0 -54
- package/src-bak/components/packages-H5/CustomComponentTabPaneH5.vue +0 -38
- package/src-bak/components/packages-H5/CustomComponentTableH5.vue +0 -352
- package/src-bak/components/packages-H5/CustomComponentTabsH5.vue +0 -170
- package/src-bak/components/packages-web/CustomComponentCard.vue +0 -40
- package/src-bak/components/packages-web/CustomComponentCol.vue +0 -66
- package/src-bak/components/packages-web/CustomComponentCollapse.vue +0 -164
- package/src-bak/components/packages-web/CustomComponentCycle.vue +0 -95
- package/src-bak/components/packages-web/CustomComponentCycleTabPane.vue +0 -155
- package/src-bak/components/packages-web/CustomComponentDialog.vue +0 -192
- package/src-bak/components/packages-web/CustomComponentEditor.vue +0 -50
- package/src-bak/components/packages-web/CustomComponentFileExport.vue +0 -60
- package/src-bak/components/packages-web/CustomComponentFileImport.vue +0 -60
- package/src-bak/components/packages-web/CustomComponentFormLayout.vue +0 -65
- package/src-bak/components/packages-web/CustomComponentGrid.vue +0 -29
- package/src-bak/components/packages-web/CustomComponentGridCol.vue +0 -29
- package/src-bak/components/packages-web/CustomComponentInputDialog.vue +0 -144
- package/src-bak/components/packages-web/CustomComponentNativeTabPane.vue +0 -84
- package/src-bak/components/packages-web/CustomComponentPlain.vue +0 -247
- package/src-bak/components/packages-web/CustomComponentRow.vue +0 -83
- package/src-bak/components/packages-web/CustomComponentSelectEmployees.vue +0 -203
- package/src-bak/components/packages-web/CustomComponentSendMail.vue +0 -62
- package/src-bak/components/packages-web/CustomComponentSteps.vue +0 -41
- package/src-bak/components/packages-web/CustomComponentTabPane.vue +0 -20
- package/src-bak/components/packages-web/CustomComponentTable.jsx +0 -814
- package/src-bak/components/packages-web/CustomComponentTabs.vue +0 -126
- package/src-bak/components/packages-web/CustomComponentTree.vue +0 -28
- package/src-bak/components/packages-web/ElButton.vue +0 -146
- package/src-bak/components/packages-web/ElCheckbox.vue +0 -97
- package/src-bak/components/packages-web/ElDatePicker.vue +0 -93
- package/src-bak/components/packages-web/ElInput copy.jsx +0 -393
- package/src-bak/components/packages-web/ElInput.jsx +0 -312
- package/src-bak/components/packages-web/ElInputNumber.vue +0 -81
- package/src-bak/components/packages-web/ElPagination.vue +0 -61
- package/src-bak/components/packages-web/ElRadio.vue +0 -47
- package/src-bak/components/packages-web/ElSelect.jsx +0 -249
- package/src-bak/components/packages-web/ElSelect_bak.vue +0 -155
- package/src-bak/components/packages-web/ElText.jsx +0 -187
- package/src-bak/components/packages-web/ElTextaa.vue +0 -169
- package/src-bak/components/packages-web/ElTimePicker.vue +0 -39
- package/src-bak/components/patchComponents-H5.js +0 -46
- package/src-bak/components/patchComponents-web.js +0 -46
- package/src-bak/components/simpleFormItemPc/index.js +0 -1
- package/src-bak/components/simpleFormItemPc/src/index.vue +0 -94
- package/src-bak/components/table/index.ts +0 -29
- package/src-bak/components/table/src/composables/use-scrollbar.ts +0 -30
- package/src-bak/components/table/src/config.ts +0 -256
- package/src-bak/components/table/src/filter-panel.vue +0 -260
- package/src-bak/components/table/src/h-helper.ts +0 -34
- package/src-bak/components/table/src/layout-observer.ts +0 -78
- package/src-bak/components/table/src/store/current.ts +0 -85
- package/src-bak/components/table/src/store/expand.ts +0 -76
- package/src-bak/components/table/src/store/helper.ts +0 -74
- package/src-bak/components/table/src/store/index.ts +0 -246
- package/src-bak/components/table/src/store/tree.ts +0 -230
- package/src-bak/components/table/src/store/watcher.ts +0 -543
- package/src-bak/components/table/src/table/defaults.ts +0 -402
- package/src-bak/components/table/src/table/key-render-helper.ts +0 -27
- package/src-bak/components/table/src/table/style-helper.ts +0 -378
- package/src-bak/components/table/src/table/utils-helper.ts +0 -47
- package/src-bak/components/table/src/table-body/defaults.ts +0 -52
- package/src-bak/components/table/src/table-body/events-helper.ts +0 -203
- package/src-bak/components/table/src/table-body/index.ts +0 -119
- package/src-bak/components/table/src/table-body/render-helper.ts +0 -283
- package/src-bak/components/table/src/table-body/styles-helper.ts +0 -164
- package/src-bak/components/table/src/table-column/defaults.ts +0 -237
- package/src-bak/components/table/src/table-column/index.ts +0 -202
- package/src-bak/components/table/src/table-column/render-helper.ts +0 -214
- package/src-bak/components/table/src/table-column/watcher-helper.ts +0 -88
- package/src-bak/components/table/src/table-footer/index.ts +0 -128
- package/src-bak/components/table/src/table-footer/mapState-helper.ts +0 -33
- package/src-bak/components/table/src/table-footer/style-helper.ts +0 -51
- package/src-bak/components/table/src/table-header/event-helper.ts +0 -213
- package/src-bak/components/table/src/table-header/index.ts +0 -244
- package/src-bak/components/table/src/table-header/style.helper.ts +0 -119
- package/src-bak/components/table/src/table-header/utils-helper.ts +0 -94
- package/src-bak/components/table/src/table-layout.ts +0 -259
- package/src-bak/components/table/src/table.vue +0 -389
- package/src-bak/components/table/src/tableColumn.ts +0 -3
- package/src-bak/components/table/src/tokens.ts +0 -5
- package/src-bak/components/table/src/util.ts +0 -521
- package/src-bak/components/table/style/css.ts +0 -5
- package/src-bak/components/table/style/index.ts +0 -5
- package/src-bak/components/tabs/index.js +0 -8
- package/src-bak/components/tabs/src/constants.js +0 -23
- package/src-bak/components/tabs/src/tab-bar.js +0 -8
- package/src-bak/components/tabs/src/tab-bar.vue +0 -92
- package/src-bak/components/tabs/src/tab-nav.jsx +0 -424
- package/src-bak/components/tabs/src/tab-pane.js +0 -16
- package/src-bak/components/tabs/src/tab-pane.vue +0 -80
- package/src-bak/components/tabs/src/tabs.jsx +0 -223
- package/src-bak/components/tabs/style/css.js +0 -2
- package/src-bak/components/tabs/style/index.js +0 -2
- package/src-bak/components/thirdPartyFrame/index.js +0 -32
- package/src-bak/components/thirdPartyFrame/src/ThirdPartyFrame.vue +0 -125
- package/src-bak/enums/index.js +0 -16
- package/src-bak/hooks/configLoad.js +0 -45
- package/src-bak/hooks/index.js +0 -189
- package/src-bak/hooks/mock.js +0 -6960
- package/src-bak/hooks/pageConfig.js +0 -127
- package/src-bak/index.jsx +0 -443
- package/src-bak/renderer.jsx +0 -77
- package/src-bak/resolver-H5.vue +0 -88
- package/src-bak/resolver-common.vue +0 -129
- package/src-bak/resolver-web.vue +0 -91
- package/src-bak/rules/eventsSupplement.js +0 -573
- package/src-bak/rules/parseCondition.js +0 -378
- package/src-bak/rules/ruleUtils.js +0 -273
- package/src-bak/rules/rulesDriver.js +0 -139
- package/src-bak/rulesImp/events.js +0 -588
- package/src-bak/rulesImp/index.js +0 -33
- package/src-bak/rulesImp/ruleInstance.js +0 -231
- package/src-bak/rulesImp/ruleUtils.js +0 -124
- package/src-bak/theme/element/components/button.scss +0 -122
- package/src-bak/theme/element/components/card.scss +0 -8
- package/src-bak/theme/element/components/checkbox.scss +0 -19
- package/src-bak/theme/element/components/collapse.scss +0 -174
- package/src-bak/theme/element/components/common.scss +0 -30
- package/src-bak/theme/element/components/cycle.scss +0 -0
- package/src-bak/theme/element/components/date.scss +0 -13
- package/src-bak/theme/element/components/dialog.scss +0 -44
- package/src-bak/theme/element/components/form.scss +0 -104
- package/src-bak/theme/element/components/index.scss +0 -55
- package/src-bak/theme/element/components/input.scss +0 -36
- package/src-bak/theme/element/components/message.scss +0 -48
- package/src-bak/theme/element/components/pagination.scss +0 -47
- package/src-bak/theme/element/components/popper.scss +0 -3
- package/src-bak/theme/element/components/radio.scss +0 -40
- package/src-bak/theme/element/components/scrollbar.scss +0 -14
- package/src-bak/theme/element/components/select.scss +0 -82
- package/src-bak/theme/element/components/steps.scss +0 -6
- package/src-bak/theme/element/components/table.scss +0 -218
- package/src-bak/theme/element/components/tabs.scss +0 -128
- package/src-bak/theme/element/components/tag.scss +0 -6
- package/src-bak/theme/element/components/text.scss +0 -20
- package/src-bak/theme/element/components/textarea.scss +0 -3
- package/src-bak/theme/element/components/tree.scss +0 -0
- package/src-bak/theme/element/index.scss +0 -55
- package/src-bak/utils/cipher.js +0 -141
- package/src-bak/utils/common.js +0 -664
- package/src-bak/utils/const.js +0 -259
- package/src-bak/utils/defaultVal.js +0 -92
- package/src-bak/utils/dom.js +0 -36
- package/src-bak/utils/format.js +0 -19
- package/src-bak/utils/index.js +0 -4
- package/src-bak/utils/is.js +0 -74
- package/src-bak/utils/loadModule.js +0 -75
- package/src-bak/utils/preserveFunc.js +0 -33
- package/src-bak/utils/render.jsx +0 -1138
- package/src-bak/utils/request.js +0 -136
- package/src-bak/utils/respone.js +0 -70
- package/src-bak/utils/valid.js +0 -89
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed, useAttrs } from 'vue';
|
|
3
|
-
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
messageInstance: {
|
|
6
|
-
type: [Object, Function],
|
|
7
|
-
default: () => null
|
|
8
|
-
},
|
|
9
|
-
config: {
|
|
10
|
-
type: Object,
|
|
11
|
-
default: () => ({})
|
|
12
|
-
},
|
|
13
|
-
lang: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: 'zh'
|
|
16
|
-
},
|
|
17
|
-
labelWidth: [String, Number]
|
|
18
|
-
})
|
|
19
|
-
const attrs = useAttrs()
|
|
20
|
-
const label = computed(() => {
|
|
21
|
-
if (props.config.labelHidden == '1' || props.config.labelWidth == 0 || props.config.labelWidth == '0') {
|
|
22
|
-
return ''
|
|
23
|
-
}
|
|
24
|
-
return (props.lang.indexOf('zh') > -1 ? props.config.metaNameZh : props.config.metaNameEn) || ''
|
|
25
|
-
})
|
|
26
|
-
const labelWidth = computed(() => {
|
|
27
|
-
if (!!props.config.labelPosition) {
|
|
28
|
-
return props.config.labelPosition
|
|
29
|
-
}
|
|
30
|
-
return 'left'
|
|
31
|
-
})
|
|
32
|
-
function handleClickTip() {
|
|
33
|
-
messageInstance?.text(props.lang.indexOf('zh') > -1 ? props.config.hintContentZh : props.config.hintContentEn)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
</script>
|
|
37
|
-
<template>
|
|
38
|
-
<cmi-form-item v-bind="attrs" class="custom-form-item-h5"
|
|
39
|
-
:class="[{'--required': props.config.requiredFlag == '1', '--label-hide': !labelWidth,
|
|
40
|
-
'--label-text-left': labelPosition === 'left', '--label-text-right': labelPosition === 'right'
|
|
41
|
-
}, customClass]"
|
|
42
|
-
:labelWidth="props.labelWidth"
|
|
43
|
-
>
|
|
44
|
-
<div slot="label" class="custom-label--formItem">
|
|
45
|
-
<div class="custom-label-content">
|
|
46
|
-
<span class="label-required" v-if="props.config.requiredFlag == '1'">*</span>
|
|
47
|
-
<span class="label-text">{{ label }}</span>
|
|
48
|
-
<span class="label-tip" v-if="props.config.hintFlag == '1'" @click="handleClickTip"><cmi-icon-question-circle size="14"/></span>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
<slot></slot>
|
|
52
|
-
</cmi-form-item>
|
|
53
|
-
</template>
|
|
54
|
-
<style lang="scss" scoped>
|
|
55
|
-
cmi-form-item {
|
|
56
|
-
position: relative;
|
|
57
|
-
|
|
58
|
-
.custom-label--formItem {
|
|
59
|
-
display: inline-flex;
|
|
60
|
-
align-items: center;
|
|
61
|
-
width: 100%;
|
|
62
|
-
// height: 16px;
|
|
63
|
-
|
|
64
|
-
.custom-label-content {
|
|
65
|
-
width: 100%;
|
|
66
|
-
display: -webkit-box;
|
|
67
|
-
line-height: 16px;
|
|
68
|
-
overflow: hidden;
|
|
69
|
-
text-overflow: ellipsis;
|
|
70
|
-
-webkit-line-clamp: 2;
|
|
71
|
-
-webkit-box-orient: vertical;
|
|
72
|
-
text-align: left;
|
|
73
|
-
.label-required {
|
|
74
|
-
color: #f5222d;
|
|
75
|
-
position: relative;
|
|
76
|
-
right: 3px;
|
|
77
|
-
top: 3px;
|
|
78
|
-
}
|
|
79
|
-
.label-text {
|
|
80
|
-
padding-right: 3px;
|
|
81
|
-
}
|
|
82
|
-
.label-tip {
|
|
83
|
-
position: absolute;
|
|
84
|
-
right: 16px;
|
|
85
|
-
top: 2px;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
&.--label-text-left {
|
|
91
|
-
.custom-label--formItem {
|
|
92
|
-
.custom-label-content {
|
|
93
|
-
text-align: left;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&.--label-text-right {
|
|
99
|
-
.custom-label--formItem {
|
|
100
|
-
.custom-label-content {
|
|
101
|
-
text-align: right;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
&.--required {
|
|
107
|
-
.custom-label-content {
|
|
108
|
-
padding-left: 3px;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
</style>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import confirmInstance from './src/index.vue'
|
|
2
|
-
import { createVNode, render } from 'vue'
|
|
3
|
-
|
|
4
|
-
let instance = null
|
|
5
|
-
|
|
6
|
-
export function confirmDialog(content, title, opts = {}, appContext) {
|
|
7
|
-
const options = {
|
|
8
|
-
...opts,
|
|
9
|
-
content,
|
|
10
|
-
title
|
|
11
|
-
}
|
|
12
|
-
let resolver = null
|
|
13
|
-
let inject = null
|
|
14
|
-
const cancelFn = () => {
|
|
15
|
-
inject && inject()
|
|
16
|
-
}
|
|
17
|
-
const confirmFn = () => {
|
|
18
|
-
resolver && resolver()
|
|
19
|
-
}
|
|
20
|
-
const retPromise = new Promise((reso, inj) => {
|
|
21
|
-
resolver = reso
|
|
22
|
-
inject = inj
|
|
23
|
-
})
|
|
24
|
-
if (instance) {
|
|
25
|
-
Object.keys(options).forEach(key => {
|
|
26
|
-
instance.props[key] = options[key]
|
|
27
|
-
})
|
|
28
|
-
instance.props.cancel = cancelFn
|
|
29
|
-
instance.props.confirm = confirmFn
|
|
30
|
-
instance.vm.exposed.dialogVisible.value = true
|
|
31
|
-
return retPromise
|
|
32
|
-
}
|
|
33
|
-
const container = document.createElement('div')
|
|
34
|
-
const vnode = createVNode(confirmInstance, {
|
|
35
|
-
...options,
|
|
36
|
-
cancel: cancelFn,
|
|
37
|
-
confirm: confirmFn
|
|
38
|
-
})
|
|
39
|
-
appContext && (vnode.appContext = appContext)
|
|
40
|
-
render(vnode, container)
|
|
41
|
-
document.body.appendChild(container.firstElementChild)
|
|
42
|
-
|
|
43
|
-
instance = {
|
|
44
|
-
vnode,
|
|
45
|
-
vm: vnode.component,
|
|
46
|
-
props: vnode.component?.props,
|
|
47
|
-
close: () => {
|
|
48
|
-
vnode.component.exposed.dialogVisible.value = false
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
vnode.component.exposed.dialogVisible.value = true
|
|
52
|
-
return retPromise
|
|
53
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed, ref } from 'vue';
|
|
3
|
-
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
title: String,
|
|
6
|
-
content: String,
|
|
7
|
-
confirm: {
|
|
8
|
-
type: Function,
|
|
9
|
-
default: () => {}
|
|
10
|
-
},
|
|
11
|
-
cancel: {
|
|
12
|
-
type: Function,
|
|
13
|
-
default: () => {}
|
|
14
|
-
},
|
|
15
|
-
showCancelButton: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default: true
|
|
18
|
-
},
|
|
19
|
-
type: String
|
|
20
|
-
})
|
|
21
|
-
const dialogType = computed(() => {
|
|
22
|
-
return props.showCancelButton === false ? 'confirm' : 'modal'
|
|
23
|
-
})
|
|
24
|
-
const dialogVisible = ref(true)
|
|
25
|
-
|
|
26
|
-
const confirm = () => {
|
|
27
|
-
props.confirm()
|
|
28
|
-
dialogVisible.value = false
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const cancel = () => {
|
|
32
|
-
props.cancel()
|
|
33
|
-
dialogVisible.value = false
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
defineExpose({
|
|
38
|
-
dialogVisible
|
|
39
|
-
})
|
|
40
|
-
</script>
|
|
41
|
-
<template>
|
|
42
|
-
<cmi-dialog
|
|
43
|
-
:type="dialogType"
|
|
44
|
-
:zIndex="10000"
|
|
45
|
-
:open="dialogVisible"
|
|
46
|
-
:title="props.title"
|
|
47
|
-
:content="props.content"
|
|
48
|
-
@confirm="confirm"
|
|
49
|
-
@cancel="cancel"
|
|
50
|
-
/>
|
|
51
|
-
</template>
|
|
52
|
-
|
|
53
|
-
<style lang="scss">
|
|
54
|
-
</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { formContextKey } from "element-plus"
|
|
2
|
-
import { inject } from "vue"
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
name: 'FormPolyfill',
|
|
6
|
-
props: {
|
|
7
|
-
form: Object
|
|
8
|
-
},
|
|
9
|
-
setup(props, { slots }) {
|
|
10
|
-
const formContext = inject(formContextKey, undefined)
|
|
11
|
-
formContext.removeField = (field) => {
|
|
12
|
-
const fields = props.form?.fields
|
|
13
|
-
if (field.prop && fields) {
|
|
14
|
-
const idx = fields.indexOf(field)
|
|
15
|
-
if (idx !== -1) {
|
|
16
|
-
fields.splice(idx, 1)
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return () => {
|
|
22
|
-
return slots?.default?.() || null
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, nextTick, onMounted, onUnmounted, computed } from 'vue';
|
|
2
|
-
import { getDomWidth } from '../../utils/dom';
|
|
3
|
-
|
|
4
|
-
export function useToolTip({
|
|
5
|
-
showTooltip,
|
|
6
|
-
offset,
|
|
7
|
-
displayValue,
|
|
8
|
-
calcFn,
|
|
9
|
-
config
|
|
10
|
-
}) {
|
|
11
|
-
const isFocus = ref(false) // 是否是焦点状态
|
|
12
|
-
const isEnter = ref(false) // 鼠标是否在内部
|
|
13
|
-
const triggerRef = ref(null)
|
|
14
|
-
const isOverflow = ref(false)
|
|
15
|
-
const inputWrapRef = ref(null)
|
|
16
|
-
const calcSpanRef = ref(null)
|
|
17
|
-
|
|
18
|
-
function calcDomWidth(node) {
|
|
19
|
-
if (calcFn) {
|
|
20
|
-
return calcFn(node)
|
|
21
|
-
}
|
|
22
|
-
return getDomWidth(node, 0)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const tooltipCalc = (() => {
|
|
26
|
-
let unWatch = null
|
|
27
|
-
let onResize = null
|
|
28
|
-
return {
|
|
29
|
-
clear: () => {
|
|
30
|
-
unWatch && unWatch()
|
|
31
|
-
onResize && window.removeEventListener('resize', onResize)
|
|
32
|
-
},
|
|
33
|
-
calc() {
|
|
34
|
-
this.clear()
|
|
35
|
-
let inputWrapWidth = calcDomWidth(inputWrapRef.value, 0)
|
|
36
|
-
let textLengthWidth = getDomWidth(calcSpanRef.value, 0 - offset.value)
|
|
37
|
-
isOverflow.value = inputWrapWidth < textLengthWidth
|
|
38
|
-
|
|
39
|
-
unWatch = watch(() => displayValue.value, (val) => {
|
|
40
|
-
nextTick(() => {
|
|
41
|
-
textLengthWidth = getDomWidth(calcSpanRef.value, 0 - offset.value)
|
|
42
|
-
isOverflow.value = inputWrapWidth < textLengthWidth
|
|
43
|
-
})
|
|
44
|
-
})
|
|
45
|
-
onResize = () => {
|
|
46
|
-
inputWrapWidth = calcDomWidth(inputWrapRef.value, 0)
|
|
47
|
-
isOverflow.value = inputWrapWidth < textLengthWidth
|
|
48
|
-
// console.log('===:', inputWrapWidth, textLengthWidth)
|
|
49
|
-
}
|
|
50
|
-
window.addEventListener('resize', onResize)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
})()
|
|
54
|
-
const inputWrapMouseEvents = computed(() => {
|
|
55
|
-
const ret = {}
|
|
56
|
-
if (showTooltip.value) {
|
|
57
|
-
ret.onMouseenter = (e) => {
|
|
58
|
-
isEnter.value = true
|
|
59
|
-
triggerRef.value = e?.target
|
|
60
|
-
}
|
|
61
|
-
ret.onMouseleave = () => {
|
|
62
|
-
isEnter.value = false
|
|
63
|
-
if (!isFocus.value) {
|
|
64
|
-
triggerRef.value = null
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return ret
|
|
69
|
-
})
|
|
70
|
-
const calcComEvents = computed(() => {
|
|
71
|
-
const ret = {}
|
|
72
|
-
ret['onFocus'] = (...arg) => {
|
|
73
|
-
isFocus.value = true
|
|
74
|
-
if (showTooltip.value) {
|
|
75
|
-
triggerRef.value = arg?.[0]?.target
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
ret['onBlur'] = (...arg) => {
|
|
79
|
-
isFocus.value = false
|
|
80
|
-
if (showTooltip.value) {
|
|
81
|
-
if (!isEnter.value) {
|
|
82
|
-
triggerRef.value = null
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return ret
|
|
87
|
-
})
|
|
88
|
-
onMounted(() => {
|
|
89
|
-
watch(showTooltip, (val) => {
|
|
90
|
-
if (val) {
|
|
91
|
-
tooltipCalc?.calc()
|
|
92
|
-
}
|
|
93
|
-
}, {
|
|
94
|
-
immediate: true
|
|
95
|
-
})
|
|
96
|
-
})
|
|
97
|
-
onUnmounted(() => {
|
|
98
|
-
tooltipCalc?.clear()
|
|
99
|
-
})
|
|
100
|
-
function generateTooltipWrap(node, opt) {
|
|
101
|
-
const {
|
|
102
|
-
wrapAttrs = {},
|
|
103
|
-
maintain = false,
|
|
104
|
-
} = opt || {}
|
|
105
|
-
const nodeComp = defineComponent(node)
|
|
106
|
-
if (maintain && !showTooltip.value) {
|
|
107
|
-
return <nodeComp></nodeComp>
|
|
108
|
-
}
|
|
109
|
-
return (
|
|
110
|
-
<div class="resolver-calc-contrainer" {...wrapAttrs}>
|
|
111
|
-
<span ref={(e) => calcSpanRef.value = e} class="resolver-calc-span">{ displayValue.value }</span>
|
|
112
|
-
{
|
|
113
|
-
isOverflow.value ?
|
|
114
|
-
<el-tooltip
|
|
115
|
-
placement="top"
|
|
116
|
-
visible={isOverflow.value && !!triggerRef.value}
|
|
117
|
-
content={displayValue.value}
|
|
118
|
-
virtualTriggering
|
|
119
|
-
virtualRef={triggerRef.value}
|
|
120
|
-
></el-tooltip>
|
|
121
|
-
: null
|
|
122
|
-
}
|
|
123
|
-
<div class="resolver-calc-wrap" {...inputWrapMouseEvents.value} ref={(e) => inputWrapRef.value = e}>
|
|
124
|
-
<nodeComp {...calcComEvents.value}></nodeComp>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
isFocus,
|
|
131
|
-
isEnter,
|
|
132
|
-
generateTooltipWrap
|
|
133
|
-
}
|
|
134
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
// import { http } from '../../../http'
|
|
2
|
-
|
|
3
|
-
// 获取当前日期String
|
|
4
|
-
const getDateTime = () => {
|
|
5
|
-
let now = new Date()
|
|
6
|
-
let year = now.getFullYear()
|
|
7
|
-
let month = now.getMonth() + 1
|
|
8
|
-
let day = now.getDate()
|
|
9
|
-
let clock = year
|
|
10
|
-
if (month < 10) {
|
|
11
|
-
clock += "0"
|
|
12
|
-
}
|
|
13
|
-
clock += month.toString()
|
|
14
|
-
if (day < 10) {
|
|
15
|
-
clock += "0"
|
|
16
|
-
}
|
|
17
|
-
clock += day
|
|
18
|
-
return clock
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const isLocal = location.host.indexOf('uat') > -1 || location.host.indexOf('localhost') > -1 || location.host.indexOf('uip-uat.cmitry.com:18080') > -1
|
|
22
|
-
|
|
23
|
-
// 动态加载单条资源js、css
|
|
24
|
-
export const dynamicLoadScript = (src = { type: 'js', url: '', id: '' }) => {
|
|
25
|
-
return new Promise((resolve, reject) => {
|
|
26
|
-
if (!src.url) {
|
|
27
|
-
reject(new Error('Failed to load ' + 'url is empty'))
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
if (src.type === 'js') {
|
|
31
|
-
const script = document.createElement('script')
|
|
32
|
-
script.src = src.url
|
|
33
|
-
script.id = src.id
|
|
34
|
-
script.onload = function () {
|
|
35
|
-
resolve(src.url)
|
|
36
|
-
}
|
|
37
|
-
script.onerror = function () {
|
|
38
|
-
reject(new Error('Failed to load ' + src.url), script)
|
|
39
|
-
}
|
|
40
|
-
document.body.appendChild(script)
|
|
41
|
-
} else if (src.type === 'css') {
|
|
42
|
-
const link = document.createElement('link')
|
|
43
|
-
link.rel = 'stylesheet'
|
|
44
|
-
link.href = src.url
|
|
45
|
-
link.id = src.id
|
|
46
|
-
link.onload = function () {
|
|
47
|
-
resolve(src.url)
|
|
48
|
-
}
|
|
49
|
-
link.onerror = function () {
|
|
50
|
-
reject(new Error('Failed to load ' + src.url), link)
|
|
51
|
-
}
|
|
52
|
-
document.head.appendChild(link)
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// 动态加载多条资源
|
|
58
|
-
export const loadAllResource = (urls) => {
|
|
59
|
-
return Promise.all(urls.map((url) => dynamicLoadScript(url)))
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const getFeiShuTokensApi = async (params) => {
|
|
63
|
-
return fetch('/sa-base/api/v1/feishucommon/getFeiShuTokens', {
|
|
64
|
-
method: 'POST',
|
|
65
|
-
body: JSON.stringify(params),
|
|
66
|
-
headers: {
|
|
67
|
-
'content-type': 'application/json'
|
|
68
|
-
},
|
|
69
|
-
}).then(res => {
|
|
70
|
-
return new Promise((resolve) => {
|
|
71
|
-
res.json().then((data) => {
|
|
72
|
-
res.data = data
|
|
73
|
-
resolve(res)
|
|
74
|
-
})
|
|
75
|
-
})
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// https://cmitry.feishu.cn/docs/doccnCtL96HOryMUErjXBMBrn4c#
|
|
80
|
-
// 选人选部门Select组件(原生js版本)
|
|
81
|
-
let tokenAxiosInstance = null
|
|
82
|
-
|
|
83
|
-
export const useSelEmployeeJs = () => {
|
|
84
|
-
const getToken = async () => {
|
|
85
|
-
let currentAxiosInstance = tokenAxiosInstance
|
|
86
|
-
if (!currentAxiosInstance) {
|
|
87
|
-
currentAxiosInstance = getFeiShuTokensApi({ "busiType": "CONSULTING_HELP" })
|
|
88
|
-
tokenAxiosInstance = currentAxiosInstance
|
|
89
|
-
}
|
|
90
|
-
let ret = null
|
|
91
|
-
try {
|
|
92
|
-
ret = await currentAxiosInstance
|
|
93
|
-
} catch (error) {
|
|
94
|
-
tokenAxiosInstance = null
|
|
95
|
-
ret = null
|
|
96
|
-
}
|
|
97
|
-
if (ret) {
|
|
98
|
-
return ret?.data?.result
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const loadStyle = async () => {
|
|
103
|
-
if (!document.getElementById('selUserJqCss')) {
|
|
104
|
-
let url = `https://ncoa${isLocal ? '-uat' : ''}.cmitry.com/components/css/selUserJq.css?ver=${getDateTime()}`
|
|
105
|
-
return dynamicLoadScript({ type: 'css', url: url, id: 'selUserJqCss' })
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
const loadScript = async () => {
|
|
109
|
-
let url1 = ''
|
|
110
|
-
let url2 = ''
|
|
111
|
-
let urls = []
|
|
112
|
-
if (!window.xmSelect) {
|
|
113
|
-
url1 = `https://ncoa${isLocal ? '-uat' : ''}.cmitry.com/components/plugin/xm-select.js?ver=${getDateTime()}`
|
|
114
|
-
urls.push({ type: 'js', url: url1, id: 'xmSelectJs' })
|
|
115
|
-
}
|
|
116
|
-
if (!window.init_selUser) {
|
|
117
|
-
// url2 = `/selUserJq.min.js?ver=${getDateTime()}`
|
|
118
|
-
url2 = `https://ncoa${isLocal ? '-uat' : ''}.cmitry.com/components/lib/selUserJq.min.js?ver=${getDateTime()}`
|
|
119
|
-
urls.push({ type: 'js', url: url2, id: 'selUserJqJs' })
|
|
120
|
-
}
|
|
121
|
-
return loadAllResource(urls)
|
|
122
|
-
}
|
|
123
|
-
const loadScriptDepartment = async () => {
|
|
124
|
-
const urls = []
|
|
125
|
-
if (!window._DIC_COMMON_JS_) {
|
|
126
|
-
const url = `https://ncoa${isLocal ? '-uat' : ''}.cmitry.com/components/lib/call.min.js?ver=${getDateTime()}`
|
|
127
|
-
urls.push({ type: 'js', url, id: 'callJs' })
|
|
128
|
-
}
|
|
129
|
-
return loadAllResource(urls)
|
|
130
|
-
}
|
|
131
|
-
const initSelUser = (params) => {
|
|
132
|
-
return window.init_selUser(params)
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
loadScriptDepartment,
|
|
136
|
-
getToken,
|
|
137
|
-
loadStyle,
|
|
138
|
-
loadScript,
|
|
139
|
-
initSelUser
|
|
140
|
-
}
|
|
141
|
-
}
|