resolver-egretimp-plus 0.1.114 → 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/package.json +1 -1
- package/src/components/packages-H5/CustomComponentCollapseH5.vue +6 -2
- 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-bak/theme/element/components/table.scss +218 -0
- package/src-bak/theme/element/components/tabs.scss +128 -0
- package/src-bak/theme/element/components/tag.scss +6 -0
- package/src-bak/theme/element/components/text.scss +20 -0
- 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,223 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineComponent,
|
|
3
|
+
getCurrentInstance,
|
|
4
|
+
nextTick,
|
|
5
|
+
provide,
|
|
6
|
+
ref,
|
|
7
|
+
renderSlot,
|
|
8
|
+
watch,
|
|
9
|
+
} from 'vue'
|
|
10
|
+
import {
|
|
11
|
+
buildProps,
|
|
12
|
+
definePropType,
|
|
13
|
+
isNumber,
|
|
14
|
+
isString,
|
|
15
|
+
isUndefined,
|
|
16
|
+
} from 'element-plus/es/utils/index.mjs'
|
|
17
|
+
import { EVENT_CODE, UPDATE_MODEL_EVENT } from 'element-plus/es/constants/index.mjs'
|
|
18
|
+
import ElIcon from 'element-plus/es/components/icon/index.mjs'
|
|
19
|
+
import { Plus } from '@element-plus/icons-vue'
|
|
20
|
+
import { useNamespace, useOrderedChildren } from 'element-plus/es/hooks/index.mjs'
|
|
21
|
+
import { tabsRootContextKey } from './constants.js'
|
|
22
|
+
import TabNav from './tab-nav'
|
|
23
|
+
|
|
24
|
+
// import type { TabNavInstance } from './tab-nav'
|
|
25
|
+
// import type { TabsPaneContext } from './constants'
|
|
26
|
+
// import type { ExtractPropTypes } from 'vue'
|
|
27
|
+
// import type { Awaitable } from '@element-plus/utils'
|
|
28
|
+
|
|
29
|
+
// export type TabPaneName = string | number
|
|
30
|
+
|
|
31
|
+
export const tabsProps = buildProps({
|
|
32
|
+
type: {
|
|
33
|
+
type: String,
|
|
34
|
+
values: ['card', 'border-card', ''],
|
|
35
|
+
default: '',
|
|
36
|
+
},
|
|
37
|
+
closable: Boolean,
|
|
38
|
+
addable: Boolean,
|
|
39
|
+
modelValue: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
},
|
|
42
|
+
editable: Boolean,
|
|
43
|
+
tabPosition: {
|
|
44
|
+
type: String,
|
|
45
|
+
values: ['top', 'right', 'bottom', 'left'],
|
|
46
|
+
default: 'top',
|
|
47
|
+
},
|
|
48
|
+
beforeLeave: {
|
|
49
|
+
type: Function,
|
|
50
|
+
default: () => true,
|
|
51
|
+
},
|
|
52
|
+
showBar: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
stretch: Boolean,
|
|
57
|
+
})
|
|
58
|
+
// export type TabsProps = ExtractPropTypes<typeof tabsProps>
|
|
59
|
+
|
|
60
|
+
const isPaneName = (value) =>
|
|
61
|
+
isString(value) || isNumber(value)
|
|
62
|
+
|
|
63
|
+
export const tabsEmits = {
|
|
64
|
+
[UPDATE_MODEL_EVENT]: (name) => isPaneName(name),
|
|
65
|
+
tabClick: (pane, ev) => ev instanceof Event,
|
|
66
|
+
tabChange: (name) => isPaneName(name),
|
|
67
|
+
edit: (paneName, action) =>
|
|
68
|
+
['remove', 'add'].includes(action),
|
|
69
|
+
tabRemove: (name) => isPaneName(name),
|
|
70
|
+
tabAdd: () => true,
|
|
71
|
+
}
|
|
72
|
+
// export type TabsEmits = typeof tabsEmits
|
|
73
|
+
|
|
74
|
+
// export type TabsPanes = Record<number, TabsPaneContext>
|
|
75
|
+
|
|
76
|
+
const Tabs = defineComponent({
|
|
77
|
+
name: 'ElTabs',
|
|
78
|
+
|
|
79
|
+
props: tabsProps,
|
|
80
|
+
emits: tabsEmits,
|
|
81
|
+
|
|
82
|
+
setup(props, { emit, slots, expose }) {
|
|
83
|
+
const ns = useNamespace('tabs')
|
|
84
|
+
|
|
85
|
+
const {
|
|
86
|
+
children: panes,
|
|
87
|
+
addChild: registerPane,
|
|
88
|
+
removeChild: unregisterPane,
|
|
89
|
+
} = useOrderedChildren(getCurrentInstance(), 'ElTabPane')
|
|
90
|
+
|
|
91
|
+
const nav$ = ref({})
|
|
92
|
+
const currentName = ref(props.modelValue ?? '0')
|
|
93
|
+
|
|
94
|
+
const setCurrentName = async (value, trigger = false) => {
|
|
95
|
+
// should do nothing.
|
|
96
|
+
if (currentName.value === value || isUndefined(value)) return
|
|
97
|
+
|
|
98
|
+
try {
|
|
99
|
+
const canLeave = await props.beforeLeave?.(value, currentName.value)
|
|
100
|
+
if (canLeave !== false) {
|
|
101
|
+
currentName.value = value
|
|
102
|
+
if (trigger) {
|
|
103
|
+
emit(UPDATE_MODEL_EVENT, value)
|
|
104
|
+
emit('tabChange', value)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
nav$.value?.removeFocus?.()
|
|
108
|
+
}
|
|
109
|
+
} catch {}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const handleTabClick = (
|
|
113
|
+
tab,
|
|
114
|
+
tabName,
|
|
115
|
+
event
|
|
116
|
+
) => {
|
|
117
|
+
if (tab.props.disabled) return
|
|
118
|
+
setCurrentName(tabName, true)
|
|
119
|
+
emit('tabClick', tab, event)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const handleTabRemove = (pane, ev) => {
|
|
123
|
+
if (pane.props.disabled || isUndefined(pane.props.name)) return
|
|
124
|
+
ev.stopPropagation()
|
|
125
|
+
emit('edit', pane.props.name, 'remove')
|
|
126
|
+
emit('tabRemove', pane.props.name)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const handleTabAdd = () => {
|
|
130
|
+
emit('edit', undefined, 'add')
|
|
131
|
+
emit('tabAdd')
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
watch(
|
|
135
|
+
() => props.modelValue,
|
|
136
|
+
(modelValue) => setCurrentName(modelValue)
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
watch(currentName, async () => {
|
|
140
|
+
await nextTick()
|
|
141
|
+
nav$.value?.scrollToActiveTab()
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
provide(tabsRootContextKey, {
|
|
145
|
+
props,
|
|
146
|
+
currentName,
|
|
147
|
+
registerPane,
|
|
148
|
+
unregisterPane,
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
expose({
|
|
152
|
+
currentName,
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
return () => {
|
|
156
|
+
const addSlot = slots['add-icon']
|
|
157
|
+
const newButton =
|
|
158
|
+
props.editable || props.addable ? (
|
|
159
|
+
<span
|
|
160
|
+
class={ns.e('new-tab')}
|
|
161
|
+
tabindex="0"
|
|
162
|
+
onClick={handleTabAdd}
|
|
163
|
+
onKeydown={(ev) => {
|
|
164
|
+
if (ev.code === EVENT_CODE.enter) handleTabAdd()
|
|
165
|
+
}}
|
|
166
|
+
>
|
|
167
|
+
{addSlot ? (
|
|
168
|
+
renderSlot(slots, 'add-icon')
|
|
169
|
+
) : (
|
|
170
|
+
<ElIcon class={ns.is('icon-plus')}>
|
|
171
|
+
<Plus />
|
|
172
|
+
</ElIcon>
|
|
173
|
+
)}
|
|
174
|
+
</span>
|
|
175
|
+
) : null
|
|
176
|
+
|
|
177
|
+
const header = (
|
|
178
|
+
<div class={[ns.e('header'), ns.is(props.tabPosition)]}>
|
|
179
|
+
{newButton}
|
|
180
|
+
<TabNav
|
|
181
|
+
ref={nav$}
|
|
182
|
+
currentName={currentName.value}
|
|
183
|
+
editable={props.editable}
|
|
184
|
+
showBar={props.showBar}
|
|
185
|
+
type={props.type}
|
|
186
|
+
panes={panes.value}
|
|
187
|
+
stretch={props.stretch}
|
|
188
|
+
onTabClick={handleTabClick}
|
|
189
|
+
onTabRemove={handleTabRemove}
|
|
190
|
+
/>
|
|
191
|
+
</div>
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
const panels = (
|
|
195
|
+
<div class={ns.e('content')}>{renderSlot(slots, 'default')}</div>
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
<div
|
|
200
|
+
class={[
|
|
201
|
+
'resolver-tabs',
|
|
202
|
+
ns.b(),
|
|
203
|
+
ns.m(props.tabPosition),
|
|
204
|
+
{
|
|
205
|
+
[ns.m('card')]: props.type === 'card',
|
|
206
|
+
[ns.m('border-card')]: props.type === 'border-card',
|
|
207
|
+
},
|
|
208
|
+
]}
|
|
209
|
+
>
|
|
210
|
+
{...props.tabPosition !== 'bottom'
|
|
211
|
+
? [panels, header]
|
|
212
|
+
: [header, panels]}
|
|
213
|
+
</div>
|
|
214
|
+
)
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
// export type TabsInstance = InstanceType<typeof Tabs> & {
|
|
220
|
+
// currentName: TabPaneName
|
|
221
|
+
// }
|
|
222
|
+
|
|
223
|
+
export default Tabs
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import ThirdPartyFrame from './src/ThirdPartyFrame.vue'
|
|
2
|
+
import { createVNode, render } from 'vue'
|
|
3
|
+
|
|
4
|
+
let instance = null
|
|
5
|
+
|
|
6
|
+
export default function (options = {}) {
|
|
7
|
+
if (instance) {
|
|
8
|
+
Object.keys(options).forEach(key => {
|
|
9
|
+
instance.props[key] = options[key]
|
|
10
|
+
|
|
11
|
+
instance.vm.exposed.dialogVisible.value = true
|
|
12
|
+
})
|
|
13
|
+
return instance.close
|
|
14
|
+
}
|
|
15
|
+
const container = document.createElement('div')
|
|
16
|
+
const vnode = createVNode(ThirdPartyFrame, {
|
|
17
|
+
...options,
|
|
18
|
+
})
|
|
19
|
+
render(vnode, container)
|
|
20
|
+
document.body.appendChild(container.firstElementChild)
|
|
21
|
+
|
|
22
|
+
instance = {
|
|
23
|
+
vnode,
|
|
24
|
+
vm: vnode.component,
|
|
25
|
+
props: vnode.component?.props,
|
|
26
|
+
close: () => {
|
|
27
|
+
vnode.component.exposed.dialogVisible.value = false
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
vnode.component.exposed.dialogVisible.value = true
|
|
31
|
+
return instance.close
|
|
32
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElDialog class="third-party-frame custom-component-dialog" width="90%" v-model="dialogVisible" :close-on-click-modal="false">
|
|
3
|
+
<div class="header" v-if="!!props.title">
|
|
4
|
+
<span>{{ props.title }}</span>
|
|
5
|
+
</div>
|
|
6
|
+
<!-- :style="{marginTop: !!props.title ? 0 : '16px'}" -->
|
|
7
|
+
<iframe ref="iframeRef" class="iframe-box" :src="dialogVisible ? props.src : ''"></iframe>
|
|
8
|
+
<div class="footer">
|
|
9
|
+
<div class="dialog-footer">
|
|
10
|
+
<ElButton @click="dialogVisible = false" v-if="showClose">
|
|
11
|
+
{{lang.indexOf('zh') > -1 ? '关闭' : 'Close'}}
|
|
12
|
+
</ElButton>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</ElDialog>
|
|
16
|
+
</template>
|
|
17
|
+
<script setup>
|
|
18
|
+
import { ElDialog, ElButton } from "element-plus"
|
|
19
|
+
import { ref, defineProps, defineExpose, onMounted, computed, watch, onUnmounted } from "vue";
|
|
20
|
+
|
|
21
|
+
const iframeRef = ref(null)
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
src: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: ''
|
|
26
|
+
},
|
|
27
|
+
awalyCloseCb: {
|
|
28
|
+
type: Function,
|
|
29
|
+
default: null
|
|
30
|
+
},
|
|
31
|
+
closeCb: {
|
|
32
|
+
type: Function,
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
title: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ''
|
|
38
|
+
},
|
|
39
|
+
showClose: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
lang: String,
|
|
44
|
+
})
|
|
45
|
+
const lang = computed(() => {
|
|
46
|
+
return props.lang
|
|
47
|
+
})
|
|
48
|
+
let closeCb = null
|
|
49
|
+
const dialogVisible = ref(false)
|
|
50
|
+
defineExpose({
|
|
51
|
+
dialogVisible
|
|
52
|
+
})
|
|
53
|
+
watch(dialogVisible, (val, old) => {
|
|
54
|
+
if (!val && old) {
|
|
55
|
+
closeCb && closeCb()
|
|
56
|
+
props.awalyCloseCb?.()
|
|
57
|
+
iframeRef.value = null
|
|
58
|
+
closeCb = null
|
|
59
|
+
// changeSlide(true)//隐藏致远侧边框
|
|
60
|
+
} else{
|
|
61
|
+
// changeSlide(false)//显示致远侧边框
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
const messageCb = (event) => {
|
|
65
|
+
console.log('event===:', event)
|
|
66
|
+
let data = event.data;
|
|
67
|
+
switch (data.submitType) {
|
|
68
|
+
case 'CCM_CLOSE': // 这个是合同中心的message回调判断
|
|
69
|
+
case 'PROCUREMENT_CONTRACT_SUBMIT': // 这个是scm的message回调判断
|
|
70
|
+
console.log('props===:', props)
|
|
71
|
+
closeCb = props.closeCb
|
|
72
|
+
dialogVisible.value = false
|
|
73
|
+
break
|
|
74
|
+
default:
|
|
75
|
+
// closeDialog()
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// const contentHeight = computed(() => {
|
|
80
|
+
// let reduceNum = 0
|
|
81
|
+
// if (!!props.title.value) {
|
|
82
|
+
// reduceNum += 46
|
|
83
|
+
// }
|
|
84
|
+
// reduceNum += 72
|
|
85
|
+
// return `calc(100% - ${reduceNum}px)`
|
|
86
|
+
// })
|
|
87
|
+
|
|
88
|
+
onMounted(() => {
|
|
89
|
+
watch(iframeRef, (val) => {
|
|
90
|
+
if (val) {
|
|
91
|
+
window && window.addEventListener('message', messageCb)
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
immediate: true
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
onUnmounted(() => {
|
|
98
|
+
window && window.removeEventListener('message', messageCb)
|
|
99
|
+
})
|
|
100
|
+
</script>
|
|
101
|
+
<style lang="scss">
|
|
102
|
+
.third-party-frame {
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
&.el-dialog {
|
|
105
|
+
margin-top: 30px !important;
|
|
106
|
+
margin-bottom: 30px;
|
|
107
|
+
iframe {
|
|
108
|
+
border: 1px solid #dee0e3;
|
|
109
|
+
height: 80vh;
|
|
110
|
+
width: 100%;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
115
|
+
<style scoped lang="scss">
|
|
116
|
+
.iframe-box {
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
display: block;
|
|
119
|
+
}
|
|
120
|
+
.dialog-footer {
|
|
121
|
+
margin-top: 10px;
|
|
122
|
+
text-align: right;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DATA_VALID_RULE_EXECUTE, FIND_FILEA_NND_CONENT_BY_ID, GET_SYS_PARAM_CACHE, LCP_LOGIN, QUERY_PAGE_CONFIG_DATA } from "../api/builtIn"
|
|
2
|
+
|
|
3
|
+
export const USER_NAME = 'caowb3'
|
|
4
|
+
export const PASSWORD = '123456'
|
|
5
|
+
// export const USER_NAME = 'lcpsupport'
|
|
6
|
+
// export const PASSWORD = '8ik,*IK<'
|
|
7
|
+
export const USER_TYPE = '1'
|
|
8
|
+
export const AUTH_CODE = '9887'
|
|
9
|
+
|
|
10
|
+
export const NOT_AUTH_APIS = [
|
|
11
|
+
LCP_LOGIN,
|
|
12
|
+
GET_SYS_PARAM_CACHE,
|
|
13
|
+
QUERY_PAGE_CONFIG_DATA,
|
|
14
|
+
DATA_VALID_RULE_EXECUTE,
|
|
15
|
+
FIND_FILEA_NND_CONENT_BY_ID
|
|
16
|
+
]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { definePrivatelyProp, findComponent, NOT_LOAD_CHILD_TYPE } from "../utils"
|
|
2
|
+
import { inject, onMounted, provide } from "vue"
|
|
3
|
+
|
|
4
|
+
const CONFIG_LOAD_KEY = Symbol()
|
|
5
|
+
export const useConfigLoad = (config) => {
|
|
6
|
+
const injectLoadFn = inject(CONFIG_LOAD_KEY) // 加载父组件传递下来的 加载完成的 回调函数
|
|
7
|
+
const loadFn = (childConfig) => {
|
|
8
|
+
const multiPmPageMetaList = config.multiPmPageMetaList
|
|
9
|
+
const pmPageMetaList = config.pmPageMetaList
|
|
10
|
+
// if (config.metaCode == 'rackRental') {
|
|
11
|
+
// debugger
|
|
12
|
+
// }
|
|
13
|
+
if (multiPmPageMetaList && multiPmPageMetaList.length) {
|
|
14
|
+
const allLoad = multiPmPageMetaList.every(configList => configList.every(config => config._componentLoad))
|
|
15
|
+
if (allLoad) {
|
|
16
|
+
config._componentLoad = true
|
|
17
|
+
injectLoadFn?.(config)
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
const allLoad = pmPageMetaList.every(config => config._componentLoad)
|
|
21
|
+
if (allLoad) {
|
|
22
|
+
config._componentLoad = true
|
|
23
|
+
injectLoadFn?.(config)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
provide(CONFIG_LOAD_KEY, loadFn)
|
|
28
|
+
|
|
29
|
+
onMounted(() => {
|
|
30
|
+
const multiPmPageMetaList = config.multiPmPageMetaList
|
|
31
|
+
const pmPageMetaList = config.pmPageMetaList
|
|
32
|
+
|
|
33
|
+
if (
|
|
34
|
+
(
|
|
35
|
+
(!multiPmPageMetaList || multiPmPageMetaList.length === 0) &&
|
|
36
|
+
(!pmPageMetaList || pmPageMetaList.length === 0)
|
|
37
|
+
) ||
|
|
38
|
+
config.renderby ||
|
|
39
|
+
findComponent(NOT_LOAD_CHILD_TYPE, config.metaType) !== -1
|
|
40
|
+
) {
|
|
41
|
+
config._componentLoad = true
|
|
42
|
+
injectLoadFn?.(config)
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { computed, inject, nextTick, reactive } from "vue"
|
|
2
|
+
import rulesDriver from '../rules/rulesDriver'
|
|
3
|
+
import defaultVal from '../utils/defaultVal.js'
|
|
4
|
+
import {definePrivatelyProp, isNonRefType, modelValueDeepMerge } from "../utils"
|
|
5
|
+
|
|
6
|
+
export function useVModel(config, props, emit, modelKey = 'update:modelValue') {
|
|
7
|
+
const { hireRelatMapRules, messageInstance, rootValue, ruleExecuter, dataLoad, dynamicMapComp, lang, _mapComp } = this
|
|
8
|
+
const currentRules = hireRelatMapRules.value[config.hireRelat]
|
|
9
|
+
let metaCodeKey = config.metaCode
|
|
10
|
+
if (modelKey !== 'update:modelValue') {
|
|
11
|
+
const matchs = modelKey.match(/^update:(\w+)$/)
|
|
12
|
+
if (!matchs) {
|
|
13
|
+
return
|
|
14
|
+
}
|
|
15
|
+
metaCodeKey = matchs[1]
|
|
16
|
+
const dynamicMapKey = config.dynamicHireRelat.replace(/->\w+$/, `->${metaCodeKey}`)
|
|
17
|
+
config = dynamicMapComp[dynamicMapKey]
|
|
18
|
+
}
|
|
19
|
+
const retModelVale = computed({
|
|
20
|
+
get() {
|
|
21
|
+
if (!config) {
|
|
22
|
+
// 如果使用v-model:[]方式绑定非modelValue,可能会出现没有对应的config
|
|
23
|
+
return
|
|
24
|
+
}
|
|
25
|
+
const val = (metaCodeKey ? props.modelValue?.[metaCodeKey] : props.modelValue) ?? null
|
|
26
|
+
if (modelKey === 'update:modelValue' && (val === undefined || val === null)) {
|
|
27
|
+
defaultVal(config)
|
|
28
|
+
// setTimeout(() => {
|
|
29
|
+
// defaultVal(config)
|
|
30
|
+
// }, 0)
|
|
31
|
+
}
|
|
32
|
+
config && (config.bindValue = val)
|
|
33
|
+
if (config) {
|
|
34
|
+
// 事件初始化执行,在dataLoaded请求完成之后,执行一次事件
|
|
35
|
+
if (dataLoad.value && !config.eventInit && !config.notInit) {
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
ruleExecuter?.run({
|
|
38
|
+
rootValue,
|
|
39
|
+
rules: currentRules,
|
|
40
|
+
config,
|
|
41
|
+
dynamicMapComp,
|
|
42
|
+
lang,
|
|
43
|
+
messageInstance,
|
|
44
|
+
_mapComp,
|
|
45
|
+
isInit: true,
|
|
46
|
+
})
|
|
47
|
+
rulesDriver.call({
|
|
48
|
+
config,
|
|
49
|
+
dynamicMapComp,
|
|
50
|
+
lang,
|
|
51
|
+
_mapComp,
|
|
52
|
+
messageInstance
|
|
53
|
+
}, currentRules, true)
|
|
54
|
+
definePrivatelyProp(config, 'eventInit', true)
|
|
55
|
+
}, 0)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return val
|
|
59
|
+
},
|
|
60
|
+
set(val) {
|
|
61
|
+
if (!config) {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
const modelValue = props.modelValue
|
|
65
|
+
const metaCode = metaCodeKey
|
|
66
|
+
// if (!metaCode) return
|
|
67
|
+
if (!modelValue) {
|
|
68
|
+
// frameSet 表示的是一帧之内重复设置对应metaCode的值
|
|
69
|
+
// 一帧之内重复设置metaCode的值需要进行merge,也就是下面modelValueDeepMerge走的逻辑
|
|
70
|
+
//(
|
|
71
|
+
// 原因是因为一帧之后重复设置,如果不走merge,会出现val值直接覆盖原本对应的metaCode的值,
|
|
72
|
+
// 这个在正常情况下没什么问题,但是如果刚开始根数据对应的层级对应出现断层为空,在进行emit(update:modelValue)进行赋值之后
|
|
73
|
+
// 并不能立即更新到对应的props.modelValue下面去,所以会出现 同时通过config.refValue设置同层级,并且是根数据断层的情况下;会出现覆盖
|
|
74
|
+
// )
|
|
75
|
+
config.parent && (config.parent.frameSet = true)
|
|
76
|
+
nextTick(() => {
|
|
77
|
+
config.parent && (config.parent.frameSet = false)
|
|
78
|
+
})
|
|
79
|
+
let updateValue = {
|
|
80
|
+
[metaCode]: val
|
|
81
|
+
}
|
|
82
|
+
if (!metaCode) {
|
|
83
|
+
updateValue = val
|
|
84
|
+
}
|
|
85
|
+
emit('update:modelValue', updateValue)
|
|
86
|
+
} else {
|
|
87
|
+
let updateValue = modelValue?.[metaCode]
|
|
88
|
+
if (config?.frameSet) {
|
|
89
|
+
if (!metaCode) {
|
|
90
|
+
updateValue = modelValue
|
|
91
|
+
}
|
|
92
|
+
if (updateValue) {
|
|
93
|
+
if (typeof updateValue === 'object' || typeof val === 'object') {
|
|
94
|
+
val = modelValueDeepMerge(updateValue, val)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (isNonRefType(updateValue) && isNonRefType(val) && updateValue === val) {
|
|
99
|
+
// 这边的值没有变,就不用出触发下面的其他动作了
|
|
100
|
+
return
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
if (!metaCode) {
|
|
104
|
+
props.modelValue = val
|
|
105
|
+
} else {
|
|
106
|
+
props.modelValue[metaCode] = val
|
|
107
|
+
}
|
|
108
|
+
} catch (error) {
|
|
109
|
+
console.log('config', config, metaCode)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (config) {
|
|
113
|
+
setTimeout(() => {
|
|
114
|
+
ruleExecuter?.run({
|
|
115
|
+
rootValue,
|
|
116
|
+
rules: currentRules,
|
|
117
|
+
config,
|
|
118
|
+
dynamicMapComp,
|
|
119
|
+
lang,
|
|
120
|
+
messageInstance,
|
|
121
|
+
_mapComp,
|
|
122
|
+
})
|
|
123
|
+
rulesDriver.call({
|
|
124
|
+
config,
|
|
125
|
+
dynamicMapComp,
|
|
126
|
+
lang,
|
|
127
|
+
_mapComp,
|
|
128
|
+
messageInstance
|
|
129
|
+
}, currentRules)
|
|
130
|
+
}, 0)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
return retModelVale
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function useVmodels(props, emit) {
|
|
138
|
+
const hireRelatMapRules = inject('hireRelatMapRules')
|
|
139
|
+
const dataLoad = inject('dataLoad')
|
|
140
|
+
const dynamicMapComp = inject('dynamicMapComp')
|
|
141
|
+
const lang = inject('lang')
|
|
142
|
+
const _mapComp = inject('_mapComp')
|
|
143
|
+
const rootValue = inject('rootValue')
|
|
144
|
+
const ruleExecuter = inject('_ruleExecuter')
|
|
145
|
+
const messageInstance = inject('_messageInstance')
|
|
146
|
+
|
|
147
|
+
const thisObj = {
|
|
148
|
+
hireRelatMapRules,
|
|
149
|
+
dataLoad,
|
|
150
|
+
dynamicMapComp,
|
|
151
|
+
lang,
|
|
152
|
+
rootValue,
|
|
153
|
+
_mapComp,
|
|
154
|
+
ruleExecuter,
|
|
155
|
+
messageInstance: messageInstance?.value
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const vModelObjs = reactive({})
|
|
159
|
+
const modelValue = useVModel.call(thisObj, props.config, props, emit)
|
|
160
|
+
|
|
161
|
+
vModelObjs['onUpdate:modelValue'] = (val) => { modelValue.value = val }
|
|
162
|
+
vModelObjs['modelValue'] = modelValue
|
|
163
|
+
|
|
164
|
+
function initVmodels(emitKeys = []) {
|
|
165
|
+
if (!Array.isArray(emitKeys)) {
|
|
166
|
+
emitKeys = Object.keys(emitKeys)
|
|
167
|
+
}
|
|
168
|
+
emitKeys = emitKeys.filter(key => {
|
|
169
|
+
return key.match(/^update:(\w+)$/)
|
|
170
|
+
})
|
|
171
|
+
emitKeys.forEach(key => {
|
|
172
|
+
if (typeof key !== 'string') return
|
|
173
|
+
const modelValue = useVModel.call(thisObj, props.config, props, emit, key)
|
|
174
|
+
if (modelValue) {
|
|
175
|
+
const matchs = key.match(/^update:(\w+)$/)
|
|
176
|
+
vModelObjs[`onUpdate:${matchs[1]}`] = (val) => { modelValue.value = val }
|
|
177
|
+
vModelObjs[matchs[1]] = modelValue
|
|
178
|
+
}
|
|
179
|
+
})
|
|
180
|
+
vModelObjs['onUpdate:modelValue'] = (val) => { modelValue.value = val }
|
|
181
|
+
vModelObjs['modelValue'] = modelValue
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
modelValue,
|
|
185
|
+
vModelObjs,
|
|
186
|
+
initVmodels
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
}
|