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,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="shouldBeRender"
|
|
4
|
+
v-show="active"
|
|
5
|
+
:id="`pane-${paneName}`"
|
|
6
|
+
:class="ns.b()"
|
|
7
|
+
role="tabpanel"
|
|
8
|
+
:aria-hidden="!active"
|
|
9
|
+
:aria-labelledby="`tab-${paneName}`"
|
|
10
|
+
>
|
|
11
|
+
<slot />
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup>
|
|
16
|
+
import {
|
|
17
|
+
computed,
|
|
18
|
+
getCurrentInstance,
|
|
19
|
+
inject,
|
|
20
|
+
onMounted,
|
|
21
|
+
onUnmounted,
|
|
22
|
+
reactive,
|
|
23
|
+
ref,
|
|
24
|
+
useSlots,
|
|
25
|
+
watch,
|
|
26
|
+
} from 'vue'
|
|
27
|
+
import { eagerComputed } from '@vueuse/core'
|
|
28
|
+
import { throwError } from 'element-plus/es/utils/index.mjs'
|
|
29
|
+
import { useNamespace } from 'element-plus/es/hooks/index.mjs'
|
|
30
|
+
import { tabsRootContextKey } from './constants.js'
|
|
31
|
+
import { tabPaneProps } from './tab-pane'
|
|
32
|
+
|
|
33
|
+
const COMPONENT_NAME = 'ElTabPane'
|
|
34
|
+
defineOptions({
|
|
35
|
+
name: COMPONENT_NAME,
|
|
36
|
+
})
|
|
37
|
+
const props = defineProps(tabPaneProps)
|
|
38
|
+
|
|
39
|
+
const instance = getCurrentInstance()
|
|
40
|
+
const slots = useSlots()
|
|
41
|
+
|
|
42
|
+
const tabsRoot = inject(tabsRootContextKey)
|
|
43
|
+
if (!tabsRoot)
|
|
44
|
+
throwError(COMPONENT_NAME, 'usage: <el-tabs><el-tab-pane /></el-tabs/>')
|
|
45
|
+
|
|
46
|
+
const ns = useNamespace('tab-pane')
|
|
47
|
+
|
|
48
|
+
const index = ref()
|
|
49
|
+
const isClosable = computed(() => props.closable || tabsRoot.props.closable)
|
|
50
|
+
const active = eagerComputed(
|
|
51
|
+
() => tabsRoot.currentName.value === (props.name ?? index.value)
|
|
52
|
+
)
|
|
53
|
+
const loaded = ref(active.value)
|
|
54
|
+
const paneName = computed(() => props.name ?? index.value)
|
|
55
|
+
const shouldBeRender = eagerComputed(
|
|
56
|
+
() => !props.lazy || loaded.value || active.value
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
watch(active, (val) => {
|
|
60
|
+
if (val) loaded.value = true
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const pane = reactive({
|
|
64
|
+
uid: instance.uid,
|
|
65
|
+
slots,
|
|
66
|
+
props,
|
|
67
|
+
paneName,
|
|
68
|
+
active,
|
|
69
|
+
index,
|
|
70
|
+
isClosable,
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
onMounted(() => {
|
|
74
|
+
tabsRoot.registerPane(pane)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
onUnmounted(() => {
|
|
78
|
+
tabsRoot.unregisterPane(pane.uid)
|
|
79
|
+
})
|
|
80
|
+
</script>
|
|
@@ -0,0 +1,217 @@
|
|
|
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
|
+
stretch: Boolean,
|
|
53
|
+
})
|
|
54
|
+
// export type TabsProps = ExtractPropTypes<typeof tabsProps>
|
|
55
|
+
|
|
56
|
+
const isPaneName = (value) =>
|
|
57
|
+
isString(value) || isNumber(value)
|
|
58
|
+
|
|
59
|
+
export const tabsEmits = {
|
|
60
|
+
[UPDATE_MODEL_EVENT]: (name) => isPaneName(name),
|
|
61
|
+
tabClick: (pane, ev) => ev instanceof Event,
|
|
62
|
+
tabChange: (name) => isPaneName(name),
|
|
63
|
+
edit: (paneName, action) =>
|
|
64
|
+
['remove', 'add'].includes(action),
|
|
65
|
+
tabRemove: (name) => isPaneName(name),
|
|
66
|
+
tabAdd: () => true,
|
|
67
|
+
}
|
|
68
|
+
// export type TabsEmits = typeof tabsEmits
|
|
69
|
+
|
|
70
|
+
// export type TabsPanes = Record<number, TabsPaneContext>
|
|
71
|
+
|
|
72
|
+
const Tabs = defineComponent({
|
|
73
|
+
name: 'ElTabs',
|
|
74
|
+
|
|
75
|
+
props: tabsProps,
|
|
76
|
+
emits: tabsEmits,
|
|
77
|
+
|
|
78
|
+
setup(props, { emit, slots, expose }) {
|
|
79
|
+
const ns = useNamespace('tabs')
|
|
80
|
+
|
|
81
|
+
const {
|
|
82
|
+
children: panes,
|
|
83
|
+
addChild: registerPane,
|
|
84
|
+
removeChild: unregisterPane,
|
|
85
|
+
} = useOrderedChildren(getCurrentInstance(), 'ElTabPane')
|
|
86
|
+
|
|
87
|
+
const nav$ = ref({})
|
|
88
|
+
const currentName = ref(props.modelValue ?? '0')
|
|
89
|
+
|
|
90
|
+
const setCurrentName = async (value, trigger = false) => {
|
|
91
|
+
// should do nothing.
|
|
92
|
+
if (currentName.value === value || isUndefined(value)) return
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
const canLeave = await props.beforeLeave?.(value, currentName.value)
|
|
96
|
+
if (canLeave !== false) {
|
|
97
|
+
currentName.value = value
|
|
98
|
+
if (trigger) {
|
|
99
|
+
emit(UPDATE_MODEL_EVENT, value)
|
|
100
|
+
emit('tabChange', value)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
nav$.value?.removeFocus?.()
|
|
104
|
+
}
|
|
105
|
+
} catch {}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const handleTabClick = (
|
|
109
|
+
tab,
|
|
110
|
+
tabName,
|
|
111
|
+
event
|
|
112
|
+
) => {
|
|
113
|
+
if (tab.props.disabled) return
|
|
114
|
+
setCurrentName(tabName, true)
|
|
115
|
+
emit('tabClick', tab, event)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const handleTabRemove = (pane, ev) => {
|
|
119
|
+
if (pane.props.disabled || isUndefined(pane.props.name)) return
|
|
120
|
+
ev.stopPropagation()
|
|
121
|
+
emit('edit', pane.props.name, 'remove')
|
|
122
|
+
emit('tabRemove', pane.props.name)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const handleTabAdd = () => {
|
|
126
|
+
emit('edit', undefined, 'add')
|
|
127
|
+
emit('tabAdd')
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
watch(
|
|
131
|
+
() => props.modelValue,
|
|
132
|
+
(modelValue) => setCurrentName(modelValue)
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
watch(currentName, async () => {
|
|
136
|
+
await nextTick()
|
|
137
|
+
nav$.value?.scrollToActiveTab()
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
provide(tabsRootContextKey, {
|
|
141
|
+
props,
|
|
142
|
+
currentName,
|
|
143
|
+
registerPane,
|
|
144
|
+
unregisterPane,
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
expose({
|
|
148
|
+
currentName,
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
return () => {
|
|
152
|
+
const addSlot = slots['add-icon']
|
|
153
|
+
const newButton =
|
|
154
|
+
props.editable || props.addable ? (
|
|
155
|
+
<span
|
|
156
|
+
class={ns.e('new-tab')}
|
|
157
|
+
tabindex="0"
|
|
158
|
+
onClick={handleTabAdd}
|
|
159
|
+
onKeydown={(ev) => {
|
|
160
|
+
if (ev.code === EVENT_CODE.enter) handleTabAdd()
|
|
161
|
+
}}
|
|
162
|
+
>
|
|
163
|
+
{addSlot ? (
|
|
164
|
+
renderSlot(slots, 'add-icon')
|
|
165
|
+
) : (
|
|
166
|
+
<ElIcon class={ns.is('icon-plus')}>
|
|
167
|
+
<Plus />
|
|
168
|
+
</ElIcon>
|
|
169
|
+
)}
|
|
170
|
+
</span>
|
|
171
|
+
) : null
|
|
172
|
+
|
|
173
|
+
const header = (
|
|
174
|
+
<div class={[ns.e('header'), ns.is(props.tabPosition)]}>
|
|
175
|
+
{newButton}
|
|
176
|
+
<TabNav
|
|
177
|
+
ref={nav$}
|
|
178
|
+
currentName={currentName.value}
|
|
179
|
+
editable={props.editable}
|
|
180
|
+
type={props.type}
|
|
181
|
+
panes={panes.value}
|
|
182
|
+
stretch={props.stretch}
|
|
183
|
+
onTabClick={handleTabClick}
|
|
184
|
+
onTabRemove={handleTabRemove}
|
|
185
|
+
/>
|
|
186
|
+
</div>
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
const panels = (
|
|
190
|
+
<div class={ns.e('content')}>{renderSlot(slots, 'default')}</div>
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
return (
|
|
194
|
+
<div
|
|
195
|
+
class={[
|
|
196
|
+
ns.b(),
|
|
197
|
+
ns.m(props.tabPosition),
|
|
198
|
+
{
|
|
199
|
+
[ns.m('card')]: props.type === 'card',
|
|
200
|
+
[ns.m('border-card')]: props.type === 'border-card',
|
|
201
|
+
},
|
|
202
|
+
]}
|
|
203
|
+
>
|
|
204
|
+
{...props.tabPosition !== 'bottom'
|
|
205
|
+
? [header, panels]
|
|
206
|
+
: [panels, header]}
|
|
207
|
+
</div>
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
// export type TabsInstance = InstanceType<typeof Tabs> & {
|
|
214
|
+
// currentName: TabPaneName
|
|
215
|
+
// }
|
|
216
|
+
|
|
217
|
+
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,123 @@
|
|
|
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
|
+
<iframe ref="iframeRef" class="iframe-box" :src="dialogVisible ? props.src : ''" :style="{marginTop: !!props.title ? 0 : '16px'}"></iframe>
|
|
7
|
+
<div class="footer">
|
|
8
|
+
<div class="dialog-footer">
|
|
9
|
+
<ElButton @click="dialogVisible = false" v-if="showClose">
|
|
10
|
+
{{lang.indexOf('zh') > -1 ? '关闭' : 'Close'}}
|
|
11
|
+
</ElButton>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</ElDialog>
|
|
15
|
+
</template>
|
|
16
|
+
<script setup>
|
|
17
|
+
import { ElDialog, ElButton } from "element-plus"
|
|
18
|
+
import { ref, defineProps, defineExpose, onMounted, computed, watch, onUnmounted } from "vue";
|
|
19
|
+
|
|
20
|
+
const iframeRef = ref(null)
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
src: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ''
|
|
25
|
+
},
|
|
26
|
+
awalyCloseCb: {
|
|
27
|
+
type: Function,
|
|
28
|
+
default: null
|
|
29
|
+
},
|
|
30
|
+
closeCb: {
|
|
31
|
+
type: Function,
|
|
32
|
+
default: null
|
|
33
|
+
},
|
|
34
|
+
title: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ''
|
|
37
|
+
},
|
|
38
|
+
showClose: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
42
|
+
lang: String,
|
|
43
|
+
})
|
|
44
|
+
const lang = computed(() => {
|
|
45
|
+
return props.lang
|
|
46
|
+
})
|
|
47
|
+
let closeCb = null
|
|
48
|
+
const dialogVisible = ref(false)
|
|
49
|
+
defineExpose({
|
|
50
|
+
dialogVisible
|
|
51
|
+
})
|
|
52
|
+
watch(dialogVisible, (val, old) => {
|
|
53
|
+
if (!val && old) {
|
|
54
|
+
closeCb && closeCb()
|
|
55
|
+
props.awalyCloseCb?.()
|
|
56
|
+
iframeRef.value = null
|
|
57
|
+
closeCb = null
|
|
58
|
+
// changeSlide(true)//隐藏致远侧边框
|
|
59
|
+
} else{
|
|
60
|
+
// changeSlide(false)//显示致远侧边框
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
const messageCb = (event) => {
|
|
64
|
+
console.log('event===:', event)
|
|
65
|
+
let data = event.data;
|
|
66
|
+
switch (data.submitType) {
|
|
67
|
+
case 'CCM_CLOSE': // 这个是合同中心的message回调判断
|
|
68
|
+
case 'PROCUREMENT_CONTRACT_SUBMIT': // 这个是scm的message回调判断
|
|
69
|
+
console.log('props===:', props)
|
|
70
|
+
closeCb = props.closeCb
|
|
71
|
+
dialogVisible.value = false
|
|
72
|
+
break
|
|
73
|
+
default:
|
|
74
|
+
// closeDialog()
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// const contentHeight = computed(() => {
|
|
79
|
+
// let reduceNum = 0
|
|
80
|
+
// if (!!props.title.value) {
|
|
81
|
+
// reduceNum += 46
|
|
82
|
+
// }
|
|
83
|
+
// reduceNum += 72
|
|
84
|
+
// return `calc(100% - ${reduceNum}px)`
|
|
85
|
+
// })
|
|
86
|
+
|
|
87
|
+
onMounted(() => {
|
|
88
|
+
watch(iframeRef, (val) => {
|
|
89
|
+
if (val) {
|
|
90
|
+
window && window.addEventListener('message', messageCb)
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
immediate: true
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
onUnmounted(() => {
|
|
97
|
+
window && window.removeEventListener('message', messageCb)
|
|
98
|
+
})
|
|
99
|
+
</script>
|
|
100
|
+
<style lang="scss">
|
|
101
|
+
.third-party-frame {
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
&.el-dialog {
|
|
104
|
+
margin-top: 30px !important;
|
|
105
|
+
margin-bottom: 30px;
|
|
106
|
+
iframe {
|
|
107
|
+
border: 1px solid #dee0e3;
|
|
108
|
+
height: 80vh;
|
|
109
|
+
width: 100%;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
114
|
+
<style scoped lang="scss">
|
|
115
|
+
.iframe-box {
|
|
116
|
+
box-sizing: border-box;
|
|
117
|
+
display: block;
|
|
118
|
+
}
|
|
119
|
+
.dialog-footer {
|
|
120
|
+
margin-top: 10px;
|
|
121
|
+
text-align: right;
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { computed, inject, nextTick, reactive } from "vue"
|
|
2
|
+
import rulesDriver from '../rules/rulesDriver'
|
|
3
|
+
import defaultVal from '../utils/defaultVal.js'
|
|
4
|
+
import { isNonRefType } from "../utils"
|
|
5
|
+
// import { deepMerge } from '../utils'
|
|
6
|
+
|
|
7
|
+
export function useVModel(config, props, emit, modelKey = 'update:modelValue') {
|
|
8
|
+
// const hireRelatMapRules = inject('hireRelatMapRules')
|
|
9
|
+
// const dataLoad = inject('dataLoad')
|
|
10
|
+
// const dynamicMapComp = inject('dynamicMapComp')
|
|
11
|
+
// const lang = inject('lang')
|
|
12
|
+
const { hireRelatMapRules, dataLoad, dynamicMapComp, lang, _mapComp } = this
|
|
13
|
+
const currentRules = hireRelatMapRules.value[config.hireRelat]
|
|
14
|
+
let metaCodeKey = config.metaCode
|
|
15
|
+
if (modelKey !== 'update:modelValue') {
|
|
16
|
+
const matchs = modelKey.match(/^update:(\w+)$/)
|
|
17
|
+
if (!matchs) {
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
metaCodeKey = matchs[1]
|
|
21
|
+
const dynamicMapKey = config.dynamicHireRelat.replace(/->\w+$/, `->${metaCodeKey}`)
|
|
22
|
+
config = dynamicMapComp[dynamicMapKey]
|
|
23
|
+
}
|
|
24
|
+
return computed({
|
|
25
|
+
get() {
|
|
26
|
+
const val = (metaCodeKey ? props.modelValue?.[metaCodeKey] : props.modelValue) ?? null
|
|
27
|
+
if (modelKey === 'update:modelValue' && !val) {
|
|
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
|
+
rulesDriver.call({
|
|
38
|
+
config,
|
|
39
|
+
dynamicMapComp,
|
|
40
|
+
lang,
|
|
41
|
+
_mapComp
|
|
42
|
+
}, currentRules, true)
|
|
43
|
+
config.eventInit = true
|
|
44
|
+
}, 0)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return val
|
|
48
|
+
},
|
|
49
|
+
set(val) {
|
|
50
|
+
const modelValue = props.modelValue
|
|
51
|
+
const metaCode = metaCodeKey
|
|
52
|
+
if (!metaCode) return
|
|
53
|
+
if (!modelValue) {
|
|
54
|
+
emit('update:modelValue', {
|
|
55
|
+
[metaCode]: val
|
|
56
|
+
})
|
|
57
|
+
} else {
|
|
58
|
+
// if (modelValue?.[metaCode]) {
|
|
59
|
+
// if (typeof modelValue?.[metaCode] === 'object' || typeof val === 'object') {
|
|
60
|
+
// val = deepMerge(val, modelValue?.[metaCode], 'union')
|
|
61
|
+
// }
|
|
62
|
+
// }
|
|
63
|
+
if (isNonRefType(modelValue[metaCode]) && isNonRefType(val) && modelValue[metaCode] === val) {
|
|
64
|
+
// 这边的值没有变,就不用出触发下面的其他动作了
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
modelValue[metaCode] = val
|
|
68
|
+
}
|
|
69
|
+
if (config) {
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
rulesDriver.call({
|
|
72
|
+
config,
|
|
73
|
+
dynamicMapComp,
|
|
74
|
+
lang,
|
|
75
|
+
_mapComp
|
|
76
|
+
}, currentRules)
|
|
77
|
+
}, 0)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function useVmodels(props, emit) {
|
|
84
|
+
const hireRelatMapRules = inject('hireRelatMapRules')
|
|
85
|
+
const dataLoad = inject('dataLoad')
|
|
86
|
+
const dynamicMapComp = inject('dynamicMapComp')
|
|
87
|
+
const lang = inject('lang')
|
|
88
|
+
const _mapComp = inject('_mapComp')
|
|
89
|
+
|
|
90
|
+
const thisObj = {
|
|
91
|
+
hireRelatMapRules,
|
|
92
|
+
dataLoad,
|
|
93
|
+
dynamicMapComp,
|
|
94
|
+
lang,
|
|
95
|
+
_mapComp
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const vModelObjs = reactive({})
|
|
99
|
+
const modelValue = useVModel.call(thisObj, props.config, props, emit)
|
|
100
|
+
|
|
101
|
+
vModelObjs['onUpdate:modelValue'] = (val) => { modelValue.value = val }
|
|
102
|
+
vModelObjs['modelValue'] = modelValue
|
|
103
|
+
|
|
104
|
+
function initVmodels(emitKeys = []) {
|
|
105
|
+
if (!Array.isArray(emitKeys)) {
|
|
106
|
+
emitKeys = Object.keys(emitKeys)
|
|
107
|
+
}
|
|
108
|
+
emitKeys = emitKeys.filter(key => {
|
|
109
|
+
return key.match(/^update:(\w+)$/)
|
|
110
|
+
})
|
|
111
|
+
emitKeys.forEach(key => {
|
|
112
|
+
if (typeof key !== 'string') return
|
|
113
|
+
const modelValue = useVModel.call(thisObj, props.config, props, emit, key)
|
|
114
|
+
if (modelValue) {
|
|
115
|
+
const matchs = key.match(/^update:(\w+)$/)
|
|
116
|
+
vModelObjs[`onUpdate:${matchs[1]}`] = (val) => { modelValue.value = val }
|
|
117
|
+
vModelObjs[matchs[1]] = modelValue
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
vModelObjs['onUpdate:modelValue'] = (val) => { modelValue.value = val }
|
|
121
|
+
vModelObjs['modelValue'] = modelValue
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
modelValue,
|
|
125
|
+
vModelObjs,
|
|
126
|
+
initVmodels
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { parsePageConfig } from "../utils"
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
export function usePageConfig() {
|
|
5
|
+
const pageConfigRef = ref(null)
|
|
6
|
+
const hireRelatMapRulesRef = ref(null)
|
|
7
|
+
const mapCompRef = ref(null)
|
|
8
|
+
function initPageConfig(config, lang, polyfillConfigs, instance, isH5) {
|
|
9
|
+
const { pageConfig, mapComp, hireRelatMapRules } = parsePageConfig(config, lang, polyfillConfigs, instance, isH5)
|
|
10
|
+
pageConfigRef.value = pageConfig
|
|
11
|
+
hireRelatMapRulesRef.value = hireRelatMapRules
|
|
12
|
+
mapCompRef.value = mapComp
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
mapCompRef,
|
|
16
|
+
initPageConfig,
|
|
17
|
+
pageConfigRef,
|
|
18
|
+
hireRelatMapRulesRef,
|
|
19
|
+
}
|
|
20
|
+
}
|