simple-frame-unit 1.0.2
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/.env.dev +14 -0
- package/CHANGELOG.md +9 -0
- package/README.md +24 -0
- package/dist/ed-frame-vue.common.1.js +11046 -0
- package/dist/ed-frame-vue.common.1.js.map +1 -0
- package/dist/ed-frame-vue.common.2.js +1715 -0
- package/dist/ed-frame-vue.common.2.js.map +1 -0
- package/dist/ed-frame-vue.common.js +53427 -0
- package/dist/ed-frame-vue.common.js.map +1 -0
- package/dist/ed-frame-vue.umd.1.js +11046 -0
- package/dist/ed-frame-vue.umd.1.js.map +1 -0
- package/dist/ed-frame-vue.umd.2.js +1715 -0
- package/dist/ed-frame-vue.umd.2.js.map +1 -0
- package/dist/ed-frame-vue.umd.js +53437 -0
- package/dist/ed-frame-vue.umd.js.map +1 -0
- package/dist/ed-frame-vue.umd.min.1.js +17 -0
- package/dist/ed-frame-vue.umd.min.1.js.map +1 -0
- package/dist/ed-frame-vue.umd.min.2.js +4 -0
- package/dist/ed-frame-vue.umd.min.2.js.map +1 -0
- package/dist/ed-frame-vue.umd.min.js +470 -0
- package/dist/ed-frame-vue.umd.min.js.map +1 -0
- package/import.easydata.js +46 -0
- package/lib/CHANGELOG.md +18 -0
- package/lib/README.md +27 -0
- package/lib/api/ds/index.js +124 -0
- package/lib/api/easyData.js +90 -0
- package/lib/api/easyform/easyForm.js +32 -0
- package/lib/api/index.js +61 -0
- package/lib/api/interface/index.js +32 -0
- package/lib/api/system.js +20 -0
- package/lib/index.js +80 -0
- package/lib/packages/BasicTemplate/EasyDataTemplate.vue +189 -0
- package/lib/packages/BasicTemplate/Props.js +64 -0
- package/lib/packages/BasicTemplate/components/TemplateComp.vue +263 -0
- package/lib/packages/BasicTemplate/components/TemplateViews.vue +292 -0
- package/lib/packages/BasicTemplate/hooks/business.js +74 -0
- package/lib/packages/BasicTemplate/hooks/getFormData.js +89 -0
- package/lib/packages/BasicTemplate/hooks/queryFormData.js +194 -0
- package/lib/packages/BasicTemplate/hooks/submitForm.js +53 -0
- package/lib/packages/BasicTemplate/hooks/useEmits.js +15 -0
- package/lib/packages/BasicTemplate/hooks/validate.js +42 -0
- package/lib/packages/EasyDataForm/EasyDataForm.vue +597 -0
- package/lib/packages/EasyDataForm/Props.js +22 -0
- package/lib/packages/EasyDataForm/components/FormItem.vue +228 -0
- package/lib/packages/EasyDataForm/hooks/useChosePopup.js +85 -0
- package/lib/packages/EasyDataForm/hooks/useEmits.js +19 -0
- package/lib/packages/EasyDataForm/hooks/useForm.js +169 -0
- package/lib/packages/EasyDataForm/hooks/useUpload.js +168 -0
- package/lib/packages/EasyDataList/EasyDataList.vue +348 -0
- package/lib/packages/EasyDataList/Props.js +116 -0
- package/lib/packages/EasyDataList/components/BasicModal.vue +150 -0
- package/lib/packages/EasyDataList/components/FormAction.vue +63 -0
- package/lib/packages/EasyDataList/hooks/useEmits.js +30 -0
- package/lib/packages/EasyDataList/hooks/useForm.js +62 -0
- package/lib/packages/EasyDataList/hooks/useTable.js +314 -0
- package/lib/packages/EasyDataTable/EasyDataTable.vue +233 -0
- package/lib/packages/EasyDataView/EasyDataView.vue +105 -0
- package/lib/packages/EdRichPreview/index.js +32 -0
- package/lib/packages/EdRichText/index.vue +167 -0
- package/lib/packages/EdRichText/replaceUrl.js +49 -0
- package/lib/packages/components/FileView.vue +97 -0
- package/lib/packages/index.js +11 -0
- package/lib/packages/mixins/EasyDataMixins.js +133 -0
- package/lib/packages/mixins/useTable.jsx +130 -0
- package/lib/pages/DataSource/index.js +8 -0
- package/lib/pages/DataSource/src/components/ControlViews/BaseProps.js +103 -0
- package/lib/pages/DataSource/src/components/ControlViews/control.js +1089 -0
- package/lib/pages/DataSource/src/components/ControlViews/index.vue +301 -0
- package/lib/pages/DataSource/src/components/TableOperationModal.vue +225 -0
- package/lib/pages/DataSource/src/components/TablePropsModal.vue +367 -0
- package/lib/pages/DataSource/src/components/ViewPropsModal.vue +737 -0
- package/lib/pages/DataSource/src/components/modal/ChooseDict.vue +119 -0
- package/lib/pages/DataSource/src/hooks/useTable.js +138 -0
- package/lib/pages/DataSource/src/index.vue +431 -0
- package/lib/pages/Interface/index.js +8 -0
- package/lib/pages/Interface/src/components/InterfaceCall.vue +73 -0
- package/lib/pages/Interface/src/components/InterfaceDepend.vue +299 -0
- package/lib/pages/Interface/src/components/InterfaceFee.vue +131 -0
- package/lib/pages/Interface/src/components/InterfaceMessage.vue +878 -0
- package/lib/pages/Interface/src/components/InterfaceMock.vue +203 -0
- package/lib/pages/Interface/src/components/InterfaceParam.vue +308 -0
- package/lib/pages/Interface/src/components/InterfaceRepeat.vue +281 -0
- package/lib/pages/Interface/src/components/InterfaceVariable.vue +31 -0
- package/lib/pages/Interface/src/index.vue +216 -0
- package/lib/pages/Template/index.js +8 -0
- package/lib/pages/Template/src/components/DefineModal.vue +524 -0
- package/lib/pages/Template/src/components/TemplatePreview.vue +109 -0
- package/lib/pages/Template/src/components/model/AddDialog.vue +60 -0
- package/lib/pages/Template/src/components/model/TemplatePreview2.vue +101 -0
- package/lib/pages/Template/src/hooks/index.js +3 -0
- package/lib/pages/Template/src/hooks/useEmits.js +64 -0
- package/lib/pages/Template/src/index.vue +124 -0
- package/lib/popup/index.js +8 -0
- package/lib/popup/src/DataSourceChoose.vue +44 -0
- package/lib/popup/src/DataSourceViewIdChoose.vue +67 -0
- package/lib/popup/src/DictChoose.vue +104 -0
- package/lib/popup/src/InterfaceChoose.vue +46 -0
- package/lib/popup/src/OrgChoose.vue +121 -0
- package/lib/popup/src/RoleChoose.vue +101 -0
- package/lib/popup/src/TemplateChoose.vue +43 -0
- package/lib/popup/src/UserChoose.vue +161 -0
- package/lib/popup//347/273/204/344/273/266/345/274/200/345/217/221/350/247/204/350/214/203.md +25 -0
- package/lib/style/custom.scss +126 -0
- package/lib/style/deep.scss +109 -0
- package/lib/style/index.scss +4 -0
- package/lib/utils/MapLoader.js +48 -0
- package/lib/utils/dateUtils.js +58 -0
- package/lib/utils/index.js +8 -0
- package/lib/utils/setting.js +25 -0
- package/lib/utils/sortable/index.js +3784 -0
- package/lib/utils/useBusiness.js +212 -0
- package/lib/utils/utils.js +588 -0
- package/package.json +77 -0
- package/src/App.vue +12 -0
- package/src/assets/Vue.png +0 -0
- package/src/assets/avatar.png +0 -0
- package/src/assets/images/bg.png +0 -0
- package/src/assets/images/logo-bills.png +0 -0
- package/src/assets/images/pic.png +0 -0
- package/src/assets/images/weplus-logo.png +0 -0
- package/src/assets/marker.png +0 -0
- package/src/assets/styles/common.scss +359 -0
- package/src/assets/styles/ele-docs.css +3278 -0
- package/src/assets/styles/fonts/icomoon.eot +0 -0
- package/src/assets/styles/fonts/icomoon.svg +14 -0
- package/src/assets/styles/fonts/icomoon.ttf +0 -0
- package/src/assets/styles/fonts/icomoon.woff +0 -0
- package/src/assets/styles/fonts/style.css +39 -0
- package/src/assets/styles/higtlightEle.css +84 -0
- package/src/assets/svg/code.svg +7 -0
- package/src/assets/svg/password.svg +1 -0
- package/src/components/Popups/DiyCompDictChoose.vue +112 -0
- package/src/components/Popups/index.js +28 -0
- package/src/components/ed-base-vue/global/variable.js +8 -0
- package/src/components/ed-base-vue/index.js +81 -0
- package/src/components/ed-base-vue/package/EdCard/index.js +7 -0
- package/src/components/ed-base-vue/package/EdCard/src/index.vue +87 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/index.js +8 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/AceConfig.js +71 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/Editor.vue +137 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/Toolbar.vue +68 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/index.vue +119 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/webpack-resolver.js +51 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/Toolbar.vue +57 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/config.js +64 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/index.vue +309 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/EdCodeEditor.vue +238 -0
- package/src/components/ed-base-vue/package/EdDate/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDate/src/index.js +50 -0
- package/src/components/ed-base-vue/package/EdDescriptions/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDescriptions/src/EdDescriptions.vue +46 -0
- package/src/components/ed-base-vue/package/EdDescriptions/src/EdDescriptionsItem.js +20 -0
- package/src/components/ed-base-vue/package/EdDescriptions/src/Props.js +20 -0
- package/src/components/ed-base-vue/package/EdDialog/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDialog/src/EdDialog.vue +138 -0
- package/src/components/ed-base-vue/package/EdDialog/src/Props.js +91 -0
- package/src/components/ed-base-vue/package/EdDialog/src/components/DialogFooter.vue +42 -0
- package/src/components/ed-base-vue/package/EdDialog/src/components/DialogWrapper.vue +53 -0
- package/src/components/ed-base-vue/package/EdDrawer/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDrawer/src/DrawerFooter.vue +41 -0
- package/src/components/ed-base-vue/package/EdDrawer/src/EdDrawer.vue +150 -0
- package/src/components/ed-base-vue/package/EdDrawer/src/props.js +71 -0
- package/src/components/ed-base-vue/package/EdFlow/index.js +8 -0
- package/src/components/ed-base-vue/package/EdFlow/src/EdFlowItem.vue +733 -0
- package/src/components/ed-base-vue/package/EdFlow/src/index.vue +148 -0
- package/src/components/ed-base-vue/package/EdForm/index.js +8 -0
- package/src/components/ed-base-vue/package/EdForm/src/EdForm.vue +172 -0
- package/src/components/ed-base-vue/package/EdForm/src/Props.js +33 -0
- package/src/components/ed-base-vue/package/EdForm/src/components/EdFormItem.vue +34 -0
- package/src/components/ed-base-vue/package/EdIcons/index.js +8 -0
- package/src/components/ed-base-vue/package/EdIcons/src/hooks/Icons.js +406 -0
- package/src/components/ed-base-vue/package/EdIcons/src/hooks/Icons1.js +830 -0
- package/src/components/ed-base-vue/package/EdIcons/src/index.vue +13 -0
- package/src/components/ed-base-vue/package/EdImage/index.js +8 -0
- package/src/components/ed-base-vue/package/EdImage/src/index.vue +28 -0
- package/src/components/ed-base-vue/package/EdInputArray/index.js +8 -0
- package/src/components/ed-base-vue/package/EdInputArray/src/Props.js +26 -0
- package/src/components/ed-base-vue/package/EdInputArray/src/index.vue +97 -0
- package/src/components/ed-base-vue/package/EdInputColor/index.js +8 -0
- package/src/components/ed-base-vue/package/EdInputColor/src/InputColor.vue +81 -0
- package/src/components/ed-base-vue/package/EdInputMap/index.js +9 -0
- package/src/components/ed-base-vue/package/EdInputMap/src/EdInputMap.vue +246 -0
- package/src/components/ed-base-vue/package/EdInputMap/src/EdInputMapProps.js +6 -0
- package/src/components/ed-base-vue/package/EdInputPop/index.js +13 -0
- package/src/components/ed-base-vue/package/EdInputPop/src/EdInputPop.vue +144 -0
- package/src/components/ed-base-vue/package/EdInputPop/src/Props.js +48 -0
- package/src/components/ed-base-vue/package/EdInputTable/index.js +8 -0
- package/src/components/ed-base-vue/package/EdInputTable/src/EdInputTable.vue +368 -0
- package/src/components/ed-base-vue/package/EdInputTable/src/Fetch.js +40 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/index.js +13 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/EdJsonEditor.vue +198 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/img/jsoneditor-icons.svg +749 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/jsoneditor.css +2031 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/plus.svg +1 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/hooks.js +63 -0
- package/src/components/ed-base-vue/package/EdJsonViewer/index.js +8 -0
- package/src/components/ed-base-vue/package/EdJsonViewer/src/EdJsonViewer.vue +44 -0
- package/src/components/ed-base-vue/package/EdLable/index.js +8 -0
- package/src/components/ed-base-vue/package/EdLable/src/index.vue +34 -0
- package/src/components/ed-base-vue/package/EdLink/index.js +8 -0
- package/src/components/ed-base-vue/package/EdLink/src/index.vue +43 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/index.js +15 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/src/EdMarkEditor.vue +368 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/src/extra-function.js +538 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/src/highlight.js +95 -0
- package/src/components/ed-base-vue/package/EdTable/index.js +8 -0
- package/src/components/ed-base-vue/package/EdTable/src/EdTable.vue +240 -0
- package/src/components/ed-base-vue/package/EdTable/src/Props.js +97 -0
- package/src/components/ed-base-vue/package/EdTable/src/components/TableColumnItem.js +24 -0
- package/src/components/ed-base-vue/package/EdTable/src/components/TablePagination.vue +73 -0
- package/src/components/ed-base-vue/package/EdTableEditor/index.js +8 -0
- package/src/components/ed-base-vue/package/EdTableEditor/src/EdTableEditor.vue +282 -0
- package/src/components/ed-base-vue/package/EdTableEditor/src/Props.js +107 -0
- package/src/components/ed-base-vue/package/EdTableEditor/src/hooks/validate.js +90 -0
- package/src/components/ed-base-vue/package/EdUpload/index.js +8 -0
- package/src/components/ed-base-vue/package/EdUpload/src/Props.js +90 -0
- package/src/components/ed-base-vue/package/EdUpload/src/index.vue +88 -0
- package/src/components/ed-base-vue/package/EdViewer/index.js +8 -0
- package/src/components/ed-base-vue/package/EdViewer/src/EdViewer.vue +310 -0
- package/src/components/ed-base-vue/package/EdWangEditor/index.js +14 -0
- package/src/components/ed-base-vue/package/EdWangEditor/src/EdWangEditor.vue +127 -0
- package/src/components/ed-base-vue/package/ExtendSlot.js +12 -0
- package/src/components/ed-base-vue/package/OptionSlot.js +65 -0
- package/src/components/ed-base-vue/plugin/Message/index.js +2 -0
- package/src/components/ed-base-vue/plugin/Message/src/main.js +91 -0
- package/src/components/ed-base-vue/plugin/Message/src/main.vue +253 -0
- package/src/components/ed-base-vue/plugin/print/index.js +156 -0
- package/src/components/ed-base-vue/plugin/sortable/index.js +3784 -0
- package/src/components/ed-base-vue/style/custom.scss +107 -0
- package/src/components/ed-base-vue/style/deep.scss +100 -0
- package/src/components/ed-base-vue/style/index.scss +4 -0
- package/src/components/ed-base-vue/tools/date-format.js +315 -0
- package/src/components/ed-base-vue/tools/utils.js +124 -0
- package/src/layouts/components/AppMain.vue +17 -0
- package/src/layouts/components/Header.vue +256 -0
- package/src/layouts/components/Logo.vue +56 -0
- package/src/layouts/components/Navbar.vue +169 -0
- package/src/layouts/components/SideBar.vue +107 -0
- package/src/layouts/components/index.js +5 -0
- package/src/layouts/index.vue +57 -0
- package/src/main.js +42 -0
- package/src/request/config.js +6 -0
- package/src/request/index.js +85 -0
- package/src/request/request.js +147 -0
- package/src/router/index.js +65 -0
- package/src/router/modules/baseRouter.js +43 -0
- package/src/router/modules/easydata.js +49 -0
- package/src/views/base/BaseRichPreview.vue +23 -0
- package/src/views/base/BaseRichText.vue +28 -0
- package/src/views/base/EdFormView.vue +54 -0
- package/src/views/base/EdTable.vue +98 -0
- package/src/views/base/inputTable.vue +103 -0
- package/src/views/easydata/Interface.vue +3 -0
- package/src/views/easydata/dataSource.vue +13 -0
- package/src/views/easydata/dataSourceView.vue +71 -0
- package/src/views/easydata/templateDemo.vue +89 -0
- package/src/views/easydata/templateInfo.vue +13 -0
- package/src/views/index.vue +17 -0
- package/src/views/login.vue +208 -0
- package/src/views/redirect.vue +15 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog v-bind="getBindValue()" @close="handleClose" @closed="handleClosed" @open="handlerOpen"
|
|
3
|
+
@opened="handlerOpened">
|
|
4
|
+
|
|
5
|
+
<template #title>
|
|
6
|
+
<slot name="title"></slot>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<!-- 内容层: 关闭时销毁 -->
|
|
10
|
+
<template v-if="destroyOnClose">
|
|
11
|
+
<DialogWrapper v-if="visible" :footerHeight="footerHeight" :fullscreen="fullscreen" :height="height"
|
|
12
|
+
:showFooter="showFooter">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</DialogWrapper>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<!-- 内容层 -->
|
|
18
|
+
<template v-else>
|
|
19
|
+
<DialogWrapper :footerHeight="footerHeight" :fullscreen="fullscreen" :height="height" :showFooter="showFooter">
|
|
20
|
+
<slot></slot>
|
|
21
|
+
</DialogWrapper>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<!-- 底部按钮区与 -->
|
|
25
|
+
<template v-if="showFooter" #footer>
|
|
26
|
+
<DialogFooter ref="element" v-bind="getFooterProps()" @close="handleClose" @ok="handleOk">
|
|
27
|
+
<template v-for="item in Object.keys($slots)" #[item]="data">
|
|
28
|
+
<slot :name="item" v-bind="data || {}"></slot>
|
|
29
|
+
</template>
|
|
30
|
+
</DialogFooter>
|
|
31
|
+
</template>
|
|
32
|
+
</el-dialog>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
import props, {FooterProps} from './Props'
|
|
37
|
+
import DialogFooter from "./components/DialogFooter.vue";
|
|
38
|
+
import DialogWrapper from "./components/DialogWrapper.vue";
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
name: "EdDialog",
|
|
42
|
+
props: props,
|
|
43
|
+
components: {DialogFooter, DialogWrapper},
|
|
44
|
+
// 双向绑定
|
|
45
|
+
model: {
|
|
46
|
+
prop: 'visible',
|
|
47
|
+
event: 'change'
|
|
48
|
+
},
|
|
49
|
+
data() {
|
|
50
|
+
return {
|
|
51
|
+
defHeight: ""
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
/**
|
|
56
|
+
* @name getBindValue
|
|
57
|
+
* @return {Object}
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
getBindValue() {
|
|
61
|
+
let props = Object.assign({}, this.$attrs, this.$props)
|
|
62
|
+
for (const key in FooterProps) {
|
|
63
|
+
if (props[key]) delete props[key]
|
|
64
|
+
}
|
|
65
|
+
return props
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @name getFooterProps
|
|
70
|
+
* @returns {Object}
|
|
71
|
+
* @private
|
|
72
|
+
*/
|
|
73
|
+
getFooterProps() {
|
|
74
|
+
let props = Object.assign({}, this.$props)
|
|
75
|
+
for (const key in props) {
|
|
76
|
+
if (!FooterProps[key]) delete props[key]
|
|
77
|
+
}
|
|
78
|
+
return props
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Dialog 关闭按钮的回调
|
|
83
|
+
* @name handleClose
|
|
84
|
+
*/
|
|
85
|
+
handleClose() {
|
|
86
|
+
/**
|
|
87
|
+
* 关闭弹窗的回调 change 函数
|
|
88
|
+
*/
|
|
89
|
+
this.$emit('change', false)
|
|
90
|
+
/**
|
|
91
|
+
* 关闭弹窗的回调 update 函数
|
|
92
|
+
* @deprecated update
|
|
93
|
+
* @private
|
|
94
|
+
*/
|
|
95
|
+
this.$emit('update:visible', false)
|
|
96
|
+
/**
|
|
97
|
+
* 关闭弹窗的回调 close 函数
|
|
98
|
+
*/
|
|
99
|
+
this.$emit('close')
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Dialog 关闭动画结束时的回调
|
|
104
|
+
* @name handleClose
|
|
105
|
+
*/
|
|
106
|
+
handleClosed() {
|
|
107
|
+
this.$emit('closed')
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Dialog 确定按钮的回调
|
|
112
|
+
* @name handleClose
|
|
113
|
+
*/
|
|
114
|
+
handleOk() {
|
|
115
|
+
this.$emit('ok')
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @name handlerOpen
|
|
120
|
+
* @description Dialog 打开的回调
|
|
121
|
+
*/
|
|
122
|
+
handlerOpen() {
|
|
123
|
+
this.$emit('open')
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @name handlerOpened
|
|
128
|
+
* @description Dialog 打开动画结束时的回调
|
|
129
|
+
*/
|
|
130
|
+
handlerOpened() {
|
|
131
|
+
this.$emit('opened')
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
</script>
|
|
136
|
+
<style lang="scss" scoped>
|
|
137
|
+
@import "../../../style/index";
|
|
138
|
+
</style>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EdDialog组件底部按钮属性
|
|
3
|
+
*/
|
|
4
|
+
export const FooterProps = {
|
|
5
|
+
loading: {type: Boolean},
|
|
6
|
+
/**
|
|
7
|
+
* @description: Show close button
|
|
8
|
+
*/
|
|
9
|
+
showCancelBtn: {type: Boolean, default: true},
|
|
10
|
+
cancelButtonProps: {
|
|
11
|
+
type: Object, default: () => {
|
|
12
|
+
return {size: 'small'}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
cancelText: {type: String, default: '关 闭'},
|
|
16
|
+
/**
|
|
17
|
+
* @description: Show confirmation button
|
|
18
|
+
*/
|
|
19
|
+
showOkBtn: {type: Boolean, default: true},
|
|
20
|
+
okButtonProps: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: () => {
|
|
23
|
+
return {
|
|
24
|
+
size: 'small',
|
|
25
|
+
type: "primary"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
okText: {type: String, default: '确 定'},
|
|
30
|
+
showFooter: {type: Boolean, default: true},
|
|
31
|
+
footerHeight: {type: [String, Number], default: 60,},
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* EdDialog组件属性
|
|
36
|
+
*/
|
|
37
|
+
export default {
|
|
38
|
+
// 是否显示 Dialog,支持 .sync 修饰符
|
|
39
|
+
visible: {type: Boolean, default: false},
|
|
40
|
+
|
|
41
|
+
// Dialog 的标题,也可通过具名 slot (见下表)传入
|
|
42
|
+
title: {type: String, default: ""},
|
|
43
|
+
|
|
44
|
+
// Dialog 的宽度 Number类型为px单位
|
|
45
|
+
width: {type: [String, Number], default: '50%'},
|
|
46
|
+
|
|
47
|
+
// Dialog 的高度 Number类型为px单位,请勿用百分比高度(如50%),因为父元素没有初始高度
|
|
48
|
+
height: {type: [String, Number]},
|
|
49
|
+
|
|
50
|
+
// 是否为全屏 Dialog
|
|
51
|
+
fullscreen: {type: Boolean, default: false},
|
|
52
|
+
|
|
53
|
+
// Dialog CSS 中的 margin-top 值
|
|
54
|
+
top: {type: String, default: "12vh"},
|
|
55
|
+
|
|
56
|
+
// 是否需要遮罩层
|
|
57
|
+
modal: {type: Boolean, default: true},
|
|
58
|
+
|
|
59
|
+
// 遮罩层是否插入至 body 元素上,若为 false,则遮罩层会插入至 Dialog 的父元素上
|
|
60
|
+
modalAppendToBody: {type: Boolean, default: true},
|
|
61
|
+
|
|
62
|
+
// Dialog 自身是否插入至 body 元素上。嵌套的 Dialog 必须指定该属性并赋值为 true
|
|
63
|
+
appendToBody: {type: Boolean, default: true},
|
|
64
|
+
|
|
65
|
+
// 是否在 Dialog 出现时将 body 滚动锁定
|
|
66
|
+
lockScroll: {type: Boolean, default: true},
|
|
67
|
+
|
|
68
|
+
// Dialog 的自定义类名
|
|
69
|
+
customClass: {type: String, default: "ed-dialog"},
|
|
70
|
+
|
|
71
|
+
// 是否可以通过点击 modal 关闭 Dialog
|
|
72
|
+
closeOnClickModal: {type: Boolean, default: true},
|
|
73
|
+
|
|
74
|
+
// 是否可以通过按下 ESC 关闭 Dialog
|
|
75
|
+
closeOnPressEscape: {type: Boolean, default: true},
|
|
76
|
+
|
|
77
|
+
// 是否显示关闭按钮
|
|
78
|
+
showClose: {type: Boolean, default: true},
|
|
79
|
+
|
|
80
|
+
// 关闭前的回调,会暂停 Dialog 的关闭
|
|
81
|
+
beforeClose: {type: Function},
|
|
82
|
+
|
|
83
|
+
// 是否对头部和底部采用居中布局
|
|
84
|
+
center: {type: Boolean, default: false},
|
|
85
|
+
|
|
86
|
+
// 关闭时销毁 Dialog 中的元素
|
|
87
|
+
destroyOnClose: {type: Boolean, default: true},
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
...FooterProps
|
|
91
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="{height: height}" class="ed-dialog-footer--warp">
|
|
3
|
+
<slot name="footer">
|
|
4
|
+
<slot name="insertFooter"></slot>
|
|
5
|
+
<el-button v-if="showCancelBtn" v-bind="cancelButtonProps" @click="handleClose"> {{ cancelText }}</el-button>
|
|
6
|
+
<slot name="centerFooter"></slot>
|
|
7
|
+
<el-button v-if="showOkBtn" :loading="loading" v-bind="okButtonProps" @click="handleOk"> {{ okText }}</el-button>
|
|
8
|
+
<slot name="appendFooter"></slot>
|
|
9
|
+
</slot>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import {FooterProps} from '../Props'
|
|
15
|
+
import {getVarType} from "../../../../tools/utils";
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: "DialogFooter",
|
|
19
|
+
props: FooterProps,
|
|
20
|
+
computed: {
|
|
21
|
+
height() {
|
|
22
|
+
return getVarType(this.footerHeight) === "string" ? this.footerHeight : `${this.footerHeight}px`;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
handleClose(e) {
|
|
27
|
+
this.$emit('close', e)
|
|
28
|
+
},
|
|
29
|
+
handleOk(e) {
|
|
30
|
+
this.$emit('ok', e)
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style scoped>
|
|
37
|
+
.ed-dialog-footer--warp {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
padding: 0 16px;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="{height: fullscreen ? fullHeight : warpHeight }" class="ed-dialog--wrapper">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import {getVarType} from "../../../../tools/utils";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: "DialogWrapper",
|
|
12
|
+
props: {
|
|
13
|
+
//
|
|
14
|
+
height: {
|
|
15
|
+
type: [String, Number]
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
// 是否为全屏 Dialog
|
|
19
|
+
fullscreen: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
23
|
+
showFooter: {type: Boolean, default: true},
|
|
24
|
+
footerHeight: {type: [String, Number], default: 60,},
|
|
25
|
+
},
|
|
26
|
+
computed: {
|
|
27
|
+
warpHeight() {
|
|
28
|
+
if (!this.height) {
|
|
29
|
+
return this.showFooter ? '55vh' : '65vh'
|
|
30
|
+
}
|
|
31
|
+
return getVarType(this.height) === 'number' ? this.height + 'px' : this.height
|
|
32
|
+
},
|
|
33
|
+
fullHeight() {
|
|
34
|
+
let innerHeight = window.innerHeight;
|
|
35
|
+
|
|
36
|
+
if (this.showFooter) {
|
|
37
|
+
let height = getVarType(this.footerHeight) === 'number' ? this.footerHeight : this.footerHeight.slice(0, -2)
|
|
38
|
+
return `${innerHeight - 57 - height - 30}px`
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return `${innerHeight - 57 - 30}px`
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
<style lang="scss" scoped>
|
|
48
|
+
.ed-dialog--wrapper {
|
|
49
|
+
overflow-y: auto;
|
|
50
|
+
overflow-x: hidden;
|
|
51
|
+
padding: 15px;
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ed-drawer__footer" :style="{height: height}">
|
|
3
|
+
<slot name="footer">
|
|
4
|
+
<slot name="insertFooter"></slot>
|
|
5
|
+
<el-button v-if="showCancelBtn" v-bind="cancelButtonProps" @click="handleClose">
|
|
6
|
+
{{ cancelText }}
|
|
7
|
+
</el-button>
|
|
8
|
+
<slot name="centerFooter"></slot>
|
|
9
|
+
<el-button v-if="showOkBtn" :loading="loading" v-bind="okButtonProps" @click="handleOk">
|
|
10
|
+
{{ loading ? '提交中 ...' : okText }}
|
|
11
|
+
</el-button>
|
|
12
|
+
<slot name="appendFooter"></slot>
|
|
13
|
+
</slot>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import { FooterProps } from './props'
|
|
19
|
+
import {getVarType} from "../../../tools/utils";
|
|
20
|
+
export default {
|
|
21
|
+
name: "DrawerFooter",
|
|
22
|
+
props: FooterProps,
|
|
23
|
+
computed:{
|
|
24
|
+
height(){
|
|
25
|
+
return getVarType(this.footerHeight) === "string" ? this.footerHeight : `${this.footerHeight}px`;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
methods: {
|
|
29
|
+
handleClose() {
|
|
30
|
+
this.$emit('close')
|
|
31
|
+
},
|
|
32
|
+
handleOk() {
|
|
33
|
+
this.$emit('ok')
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style scoped>
|
|
40
|
+
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer ref="ElDrawer" v-bind="getBindValues()" @close="handleClose" @closed="handleClosed" @open="handlerOpen"
|
|
3
|
+
@opened="handlerOpened">
|
|
4
|
+
<!-- 标题区 -->
|
|
5
|
+
<template #title>
|
|
6
|
+
<slot name="header"></slot>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<!-- 内容层 -->
|
|
11
|
+
<div :style="{height: contentHeight}" class="ed-drawer__content">
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<!-- 操作区域 -->
|
|
16
|
+
<DrawerFooter v-bind="getFooterProps()" @close="handleClose" @ok="handleOk">
|
|
17
|
+
<template v-for="item in Object.keys($slots)" #[item]="data">
|
|
18
|
+
<slot :name="item" v-bind="data || {}"></slot>
|
|
19
|
+
</template>
|
|
20
|
+
</DrawerFooter>
|
|
21
|
+
</el-drawer>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import props, {FooterProps} from './props'
|
|
26
|
+
import DrawerFooter from './DrawerFooter'
|
|
27
|
+
import {getVarType} from "../../../tools/utils";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 统一的抽屉式弹出组件
|
|
31
|
+
*
|
|
32
|
+
* - 示例
|
|
33
|
+
*
|
|
34
|
+
* ```vue
|
|
35
|
+
* <ed-drawer ref="elsDrawer" :title="title" :visible="visible" @close="handlerClose" @ok="handlerOk">
|
|
36
|
+
* </ed-drawer>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* [](./EdDrawerProps.md ':include')
|
|
40
|
+
*
|
|
41
|
+
* [](./EdDrawerFooterProps.md ':include')
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
export default {
|
|
45
|
+
name: "EdDrawer",
|
|
46
|
+
components: {DrawerFooter},
|
|
47
|
+
props: props,
|
|
48
|
+
// 双向绑定
|
|
49
|
+
model: {
|
|
50
|
+
prop: 'visible',
|
|
51
|
+
event: 'change'
|
|
52
|
+
},
|
|
53
|
+
computed: {
|
|
54
|
+
contentHeight() {
|
|
55
|
+
let innerHeight = window.innerHeight;
|
|
56
|
+
let height = getVarType(this.footerHeight) === 'number' ? this.footerHeight : this.footerHeight.slice(0, -2)
|
|
57
|
+
return `${innerHeight - 58 - height}px`
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
/**
|
|
62
|
+
* @name getBindValues
|
|
63
|
+
* @returns {Object}
|
|
64
|
+
* @private
|
|
65
|
+
*/
|
|
66
|
+
getBindValues() {
|
|
67
|
+
let props = Object.assign({}, this.$attrs, this.$props)
|
|
68
|
+
for (const key in FooterProps) {
|
|
69
|
+
if (props[key]) delete props[key]
|
|
70
|
+
}
|
|
71
|
+
return props
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @name getFooterProps
|
|
76
|
+
* @returns {Object}
|
|
77
|
+
* @private
|
|
78
|
+
*/
|
|
79
|
+
getFooterProps() {
|
|
80
|
+
let props = Object.assign({}, this.$props)
|
|
81
|
+
for (const key in props) {
|
|
82
|
+
if (!FooterProps[key]) delete props[key]
|
|
83
|
+
}
|
|
84
|
+
return props
|
|
85
|
+
},
|
|
86
|
+
/**
|
|
87
|
+
* Drawer 点击关闭按钮时触发
|
|
88
|
+
*/
|
|
89
|
+
handleClose() {
|
|
90
|
+
/**
|
|
91
|
+
* 关闭弹窗的回调 change 函数
|
|
92
|
+
*/
|
|
93
|
+
this.$emit('change', false)
|
|
94
|
+
/**
|
|
95
|
+
* 关闭弹窗的回调 update 函数
|
|
96
|
+
* @deprecated update
|
|
97
|
+
* @private
|
|
98
|
+
*/
|
|
99
|
+
this.$emit('update:visible', false)
|
|
100
|
+
/**
|
|
101
|
+
* 关闭弹窗的回调 close 函数
|
|
102
|
+
*/
|
|
103
|
+
this.$emit('close')
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Drawer 关闭动画结束时的回调
|
|
108
|
+
* @name handleClose
|
|
109
|
+
*/
|
|
110
|
+
handleClosed() {
|
|
111
|
+
this.$emit('closed')
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Drawer 点击确定按钮时触发
|
|
116
|
+
*/
|
|
117
|
+
handleOk() {
|
|
118
|
+
this.$emit('ok')
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @name handlerOpen
|
|
123
|
+
* @description Drawer 打开的回调
|
|
124
|
+
*/
|
|
125
|
+
handlerOpen() {
|
|
126
|
+
this.$emit('open')
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @name handlerOpened
|
|
131
|
+
* @description Drawer 打开动画结束时的回调
|
|
132
|
+
*/
|
|
133
|
+
handlerOpened() {
|
|
134
|
+
this.$emit('opened')
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @name closeDrawer
|
|
139
|
+
* @description 用于关闭 Drawer, 该方法会调用传入的 before-close 方法
|
|
140
|
+
*/
|
|
141
|
+
closeDrawer() {
|
|
142
|
+
this.$refs.ElDrawer.closeDrawer()
|
|
143
|
+
},
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<style lang="scss" scoped>
|
|
149
|
+
@import "../../../style/index";
|
|
150
|
+
</style>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EdDrawer组件底部按钮属性
|
|
3
|
+
*/
|
|
4
|
+
export const FooterProps = {
|
|
5
|
+
loading: {type: Boolean},
|
|
6
|
+
/**
|
|
7
|
+
* @description: Show close button
|
|
8
|
+
*/
|
|
9
|
+
showCancelBtn: {type: Boolean, default: true},
|
|
10
|
+
cancelButtonProps: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => {
|
|
13
|
+
return {
|
|
14
|
+
size: 'small',
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
cancelText: {type: String, default: '关 闭'},
|
|
19
|
+
/**
|
|
20
|
+
* @description: Show confirmation button
|
|
21
|
+
*/
|
|
22
|
+
showOkBtn: {type: Boolean, default: true},
|
|
23
|
+
okButtonProps: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => {
|
|
26
|
+
return {
|
|
27
|
+
size: 'small',
|
|
28
|
+
type: "primary"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
okText: {type: String, default: '确 定'},
|
|
33
|
+
showFooter: {type: Boolean, },
|
|
34
|
+
footerHeight: {type: [String, Number], default: 60,},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* EdDrawer组件属性
|
|
39
|
+
*/
|
|
40
|
+
export default {
|
|
41
|
+
// Drawer 自身是否插入至 body 元素上。嵌套的 Drawer 必须指定该属性并赋值为 true
|
|
42
|
+
appendToBody: {type: Boolean, default: true},
|
|
43
|
+
// 关闭前的回调,会暂停 Drawer 的关闭
|
|
44
|
+
beforeClose: {type: Function},
|
|
45
|
+
// 是否可以通过按下 ESC 关闭 Drawer
|
|
46
|
+
closeOnPressEscape: {type: Boolean, default: true},
|
|
47
|
+
// Drawer 的自定义类名
|
|
48
|
+
customClass: {type: String, default: "ed-drawer"},
|
|
49
|
+
// 控制是否在关闭 Drawer 之后将子元素全部销毁
|
|
50
|
+
destroyOnClose: {type: Boolean, default: true},
|
|
51
|
+
// 是否需要遮罩层
|
|
52
|
+
modal: {type: Boolean, default: true},
|
|
53
|
+
// 遮罩层是否插入至 body 元素上,若为 false,则遮罩层会插入至 Drawer 的父元素上
|
|
54
|
+
modalAppendToBody: {type: Boolean, default: true},
|
|
55
|
+
// Drawer 打开的方向 rtl / ltr / ttb / btt
|
|
56
|
+
direction: {type: String, default: 'rtl'},
|
|
57
|
+
// 是否显示关闭按钮
|
|
58
|
+
showClose: {type: Boolean, default: true},
|
|
59
|
+
// Drawer 窗体的大小, 当使用 number 类型时, 以像素为单位, 当使用 string 类型时, 请传入 'x%', 否则便会以 number 类型解释
|
|
60
|
+
size: {type: [Number, String], default: '40%'},
|
|
61
|
+
// Drawer 的标题,也可通过具名 slot (见下表)传入
|
|
62
|
+
title: {type: String},
|
|
63
|
+
// 是否显示 Drawer,支持 .sync 修饰符
|
|
64
|
+
visible: {type: Boolean, default: false},
|
|
65
|
+
// 点击遮罩层是否可以关闭 Drawer
|
|
66
|
+
wrapperClosable: {type: Boolean, default: true},
|
|
67
|
+
// 控制是否显示 header 栏, 默认为 true, 当此项为 false 时, title attribute 和 title slot 均不生效
|
|
68
|
+
withHeader: {type: Boolean, default: true},
|
|
69
|
+
|
|
70
|
+
...FooterProps
|
|
71
|
+
}
|