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,310 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-show="isShow" class="ed-viewer">
|
|
3
|
+
<!-- 蒙层 -->
|
|
4
|
+
<div class="ed-viewer--mask"></div>
|
|
5
|
+
<!-- 关闭按钮 -->
|
|
6
|
+
<div class="ed-viewer__btn ed-viewer--close" @click="close">
|
|
7
|
+
<i class="el-icon-circle-close"></i>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<!-- 上一张按钮 -->
|
|
11
|
+
<div v-if="isRow" class="ed-viewer__btn ed-viewer__prev" @click="handlePrev">
|
|
12
|
+
<i class="el-icon-arrow-left"></i>
|
|
13
|
+
</div>
|
|
14
|
+
<!-- 下一张按钮 -->
|
|
15
|
+
<div v-if="isRow" class="ed-viewer__btn ed-viewer__next" @click="handleNext">
|
|
16
|
+
<i class="el-icon-arrow-right"></i>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<!-- 内容层 -->
|
|
20
|
+
<div ref="content" class="ed-viewer__content">
|
|
21
|
+
<el-carousel ref="carousel"
|
|
22
|
+
:initial-index="index"
|
|
23
|
+
:initial-swipe="index"
|
|
24
|
+
:interval="0"
|
|
25
|
+
:show-indicators="false"
|
|
26
|
+
arrow="never"
|
|
27
|
+
indicator-position="none"
|
|
28
|
+
@change="handleChange">
|
|
29
|
+
<el-carousel-item v-for="(item, indexes) in list"
|
|
30
|
+
:key="indexes"
|
|
31
|
+
@click.native.self="close()">
|
|
32
|
+
<component :is="isMediaType(item)"
|
|
33
|
+
v-if="isMediaType(item)"
|
|
34
|
+
:id="'ed-preview__'+indexes"
|
|
35
|
+
:class="'ed-preview__'+isMediaType(item)"
|
|
36
|
+
ref="item"
|
|
37
|
+
:src="item.url"
|
|
38
|
+
:style="[styleName,styleBoxName]"
|
|
39
|
+
controls="controls"
|
|
40
|
+
ondragstart="return false"
|
|
41
|
+
@click="handleClick(item,indexes)"
|
|
42
|
+
@mousedown="move"></component>
|
|
43
|
+
</el-carousel-item>
|
|
44
|
+
</el-carousel>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<!-- 操作区 -->
|
|
48
|
+
<div class="ed-viewer__btn ed-viewer__actions">
|
|
49
|
+
<div class="ed-viewer__actions__inner">
|
|
50
|
+
<i class="el-icon-zoom-out" @click="subScale"></i>
|
|
51
|
+
<i class="el-icon-zoom-in" @click="addScale"></i>
|
|
52
|
+
<i class="el-image-viewer__actions__divider"></i>
|
|
53
|
+
<i class="el-icon-printer" @click="handlePrint"></i>
|
|
54
|
+
<i class="el-image-viewer__actions__divider"></i>
|
|
55
|
+
<i class="el-icon-refresh-left" @click="rotate=rotate-90"></i>
|
|
56
|
+
<i class="el-icon-refresh-right" @click="rotate=rotate+90"></i>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<script>
|
|
63
|
+
import {isMediaType, setPx} from '../../../tools/utils'
|
|
64
|
+
|
|
65
|
+
export default {
|
|
66
|
+
name: "EdViewer",
|
|
67
|
+
props: {
|
|
68
|
+
list: {
|
|
69
|
+
type: Array
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
data() {
|
|
73
|
+
return {
|
|
74
|
+
scale: 1,
|
|
75
|
+
rotate: 0,
|
|
76
|
+
left: 0,
|
|
77
|
+
top: 0,
|
|
78
|
+
index: 0,
|
|
79
|
+
isShow: false,
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
computed: {
|
|
83
|
+
styleBoxName() {
|
|
84
|
+
return {
|
|
85
|
+
marginLeft: setPx(this.left),
|
|
86
|
+
marginTop: setPx(this.top)
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
styleName() {
|
|
90
|
+
return {
|
|
91
|
+
transform: `scale(${this.scale}) rotate(${this.rotate}deg)`,
|
|
92
|
+
maxWidth: '100%',
|
|
93
|
+
maxHeight: '100%',
|
|
94
|
+
minWidth: '50vw',
|
|
95
|
+
minHeight: '50vh'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
isRow() {
|
|
99
|
+
return this.list.length > 1
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
methods: {
|
|
103
|
+
isMediaType(item) {
|
|
104
|
+
const {url, type} = item;
|
|
105
|
+
console.log(isMediaType(url, type))
|
|
106
|
+
return isMediaType(url, type)
|
|
107
|
+
},
|
|
108
|
+
open() {
|
|
109
|
+
this.isShow = true
|
|
110
|
+
},
|
|
111
|
+
move(e) {
|
|
112
|
+
//算出鼠标相对元素的位置
|
|
113
|
+
let disX = e.clientX;
|
|
114
|
+
let disY = e.clientY;
|
|
115
|
+
let scale = 2;
|
|
116
|
+
document.onmousemove = (e) => { //鼠标按下并移动的事件
|
|
117
|
+
//用鼠标的位置减去鼠标相对元素的位置,得到元素的位置
|
|
118
|
+
let left = e.clientX - disX;
|
|
119
|
+
let top = e.clientY - disY;
|
|
120
|
+
disX = e.clientX;
|
|
121
|
+
disY = e.clientY;
|
|
122
|
+
//移动当前元素
|
|
123
|
+
this.left = this.left + (left * scale)
|
|
124
|
+
this.top = this.top + (top * scale)
|
|
125
|
+
};
|
|
126
|
+
document.onmouseup = (e) => {
|
|
127
|
+
document.onmousemove = null;
|
|
128
|
+
document.onmouseup = null;
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
close() {
|
|
132
|
+
this.isShow = false
|
|
133
|
+
if (Object.prototype.hasOwnProperty.call(this.$listeners, 'beforeClose')) {
|
|
134
|
+
this.$emit('beforeClose', this.list, this.index)
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
// 上一张按钮
|
|
138
|
+
handlePrev() {
|
|
139
|
+
this.$refs.carousel.prev()
|
|
140
|
+
this.index = this.$refs.carousel.activeIndex
|
|
141
|
+
this.stopItem()
|
|
142
|
+
},
|
|
143
|
+
// 下一张按钮
|
|
144
|
+
handleNext() {
|
|
145
|
+
this.$refs.carousel.next()
|
|
146
|
+
this.index = this.$refs.carousel.activeIndex
|
|
147
|
+
this.stopItem()
|
|
148
|
+
},
|
|
149
|
+
// 缩小
|
|
150
|
+
subScale () {
|
|
151
|
+
if (this.scale !== 0.2) {
|
|
152
|
+
this.scale = parseFloat((this.scale - 0.2).toFixed(2))
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
// 放大
|
|
157
|
+
addScale () {
|
|
158
|
+
this.scale = parseFloat((this.scale + 0.2).toFixed(2))
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
// 打印
|
|
162
|
+
handlePrint(){
|
|
163
|
+
this.$print(`#ed-preview__${this.index}`)
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
handleClick() {
|
|
167
|
+
},
|
|
168
|
+
handleChange () {
|
|
169
|
+
this.scale = 1;
|
|
170
|
+
this.rotate = 0;
|
|
171
|
+
},
|
|
172
|
+
stopItem() {
|
|
173
|
+
this.left = 0;
|
|
174
|
+
this.top = 0;
|
|
175
|
+
this.$refs.item.forEach(ele => {
|
|
176
|
+
ele.pause && ele.pause()
|
|
177
|
+
})
|
|
178
|
+
},
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
</script>
|
|
182
|
+
|
|
183
|
+
<style lang="scss" scoped>
|
|
184
|
+
.ed-viewer {
|
|
185
|
+
position: fixed;
|
|
186
|
+
top: 0;
|
|
187
|
+
left: 0;
|
|
188
|
+
width: 100%;
|
|
189
|
+
height: 100%;
|
|
190
|
+
transition: all .5s;
|
|
191
|
+
z-index: 9998;
|
|
192
|
+
|
|
193
|
+
.ed-viewer--mask {
|
|
194
|
+
position: absolute;
|
|
195
|
+
top: 0;
|
|
196
|
+
left: 0;
|
|
197
|
+
width: 100%;
|
|
198
|
+
height: 100%;
|
|
199
|
+
background: rgba(0, 0, 0, .5);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.ed-viewer__btn {
|
|
203
|
+
z-index: 1024;
|
|
204
|
+
position: absolute;
|
|
205
|
+
display: flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
justify-content: center;
|
|
208
|
+
border-radius: 50%;
|
|
209
|
+
opacity: .8;
|
|
210
|
+
cursor: pointer;
|
|
211
|
+
-webkit-user-select: none;
|
|
212
|
+
box-sizing: border-box;
|
|
213
|
+
-moz-user-select: none;
|
|
214
|
+
user-select: none;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.ed-viewer--close {
|
|
218
|
+
top: 40px;
|
|
219
|
+
right: 40px;
|
|
220
|
+
width: 40px;
|
|
221
|
+
height: 40px;
|
|
222
|
+
font-size: 24px;
|
|
223
|
+
color: #fff;
|
|
224
|
+
background-color: #606266;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.ed-viewer__prev {
|
|
228
|
+
width: 44px;
|
|
229
|
+
height: 44px;
|
|
230
|
+
font-size: 24px;
|
|
231
|
+
color: #fff;
|
|
232
|
+
background-color: #606266;
|
|
233
|
+
border-color: #fff;
|
|
234
|
+
top: 50%;
|
|
235
|
+
transform: translateY(-50%);
|
|
236
|
+
left: 40px
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.ed-viewer__next {
|
|
240
|
+
transform: translateY(-50%);
|
|
241
|
+
right: 40px;
|
|
242
|
+
text-indent: 2px;
|
|
243
|
+
width: 44px;
|
|
244
|
+
height: 44px;
|
|
245
|
+
font-size: 24px;
|
|
246
|
+
color: #fff;
|
|
247
|
+
background-color: #606266;
|
|
248
|
+
border-color: #fff;
|
|
249
|
+
top: 50%;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.ed-viewer__actions {
|
|
253
|
+
left: 50%;
|
|
254
|
+
bottom: 30px;
|
|
255
|
+
transform: translateX(-50%);
|
|
256
|
+
width: 282px;
|
|
257
|
+
height: 44px;
|
|
258
|
+
padding: 0 23px;
|
|
259
|
+
background-color: #606266;
|
|
260
|
+
border-color: #fff;
|
|
261
|
+
border-radius: 22px;
|
|
262
|
+
|
|
263
|
+
.ed-viewer__actions__inner {
|
|
264
|
+
width: 100%;
|
|
265
|
+
height: 100%;
|
|
266
|
+
text-align: justify;
|
|
267
|
+
cursor: default;
|
|
268
|
+
font-size: 23px;
|
|
269
|
+
color: #fff;
|
|
270
|
+
display: flex;
|
|
271
|
+
align-items: center;
|
|
272
|
+
justify-content: space-around;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
::v-deep {
|
|
279
|
+
.ed-viewer__content {
|
|
280
|
+
width: 100%;
|
|
281
|
+
height: 100%;
|
|
282
|
+
display: flex;
|
|
283
|
+
align-items: center;
|
|
284
|
+
justify-content: center;
|
|
285
|
+
|
|
286
|
+
.el-carousel {
|
|
287
|
+
width: 90%;
|
|
288
|
+
height: 100%;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.el-carousel__container {
|
|
292
|
+
height: 100%;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.el-carousel__item {
|
|
296
|
+
width: 100%;
|
|
297
|
+
height: 100%;
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
justify-content: center;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.ed-preview__iframe {
|
|
306
|
+
width: 60vw;
|
|
307
|
+
height: 75vh;
|
|
308
|
+
border: none;
|
|
309
|
+
}
|
|
310
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wangEditor文本编辑器使用
|
|
3
|
+
* @link https://www.wangeditor.com/
|
|
4
|
+
* @description Web 富文本编辑器
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import EdWangEditor from './src/EdWangEditor.vue'
|
|
8
|
+
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
EdWangEditor.install = function (Vue) {
|
|
11
|
+
Vue.component(EdWangEditor.name, EdWangEditor)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default EdWangEditor
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 富文本编辑器 -->
|
|
3
|
+
<div class="editor">
|
|
4
|
+
<Toolbar :defaultConfig="toolbarConfig" :editor="editor" :mode="mode" class="editor-toolbar"/>
|
|
5
|
+
|
|
6
|
+
<Editor
|
|
7
|
+
v-model="defaultHtml"
|
|
8
|
+
:defaultConfig="editorConfigs"
|
|
9
|
+
:mode="mode"
|
|
10
|
+
class="editor-content"
|
|
11
|
+
@customPaste="customPaste"
|
|
12
|
+
@onChange="onChange"
|
|
13
|
+
@onCreated="onCreated"
|
|
14
|
+
/>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import {Editor, Toolbar} from '@wangeditor/editor-for-vue';
|
|
20
|
+
import "@wangeditor/editor/dist/css/style.css";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 富文本编辑器
|
|
24
|
+
* - 示例
|
|
25
|
+
*
|
|
26
|
+
* ```vue
|
|
27
|
+
* <ed-wang-editor v-model="value"></ed-wang-editor>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export default {
|
|
31
|
+
name: 'EdWangEditor',
|
|
32
|
+
components: {Editor, Toolbar},
|
|
33
|
+
props: {
|
|
34
|
+
value: {type: String, default: '',},
|
|
35
|
+
// 'default' or 'simple'
|
|
36
|
+
mode: {type: String, default: 'default'},
|
|
37
|
+
// 工具栏配置
|
|
38
|
+
toolbarConfig: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default: ()=>{
|
|
41
|
+
return {
|
|
42
|
+
//排除某些菜单,其他都保留
|
|
43
|
+
excludeKeys: ["group-video"],
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
// 编辑器配置(图片如配置颜色、字体、链接校验、上传图片等)
|
|
48
|
+
editorConfig: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default: ()=>{
|
|
51
|
+
return {
|
|
52
|
+
placeholder: "<p style='font-size: 14px'>请输入内容...</p>",
|
|
53
|
+
// 所有的菜单配置,都要在 MENU_CONF 属性下
|
|
54
|
+
MENU_CONF: {}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
// 文章编辑相关配置
|
|
60
|
+
data() {
|
|
61
|
+
return {
|
|
62
|
+
editor: null,
|
|
63
|
+
// 这里的 HTML 内容必须是 wangEditor 生成的(即 editor.getHtml() 返回的) HTML 格式,不可以自己随意写
|
|
64
|
+
defaultHtml: this.value,
|
|
65
|
+
// 默认编辑器配置
|
|
66
|
+
defaultConfig: {
|
|
67
|
+
placeholder: "<p style='font-size: 14px'>请输入内容...</p>",
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
computed: {
|
|
72
|
+
editorConfigs(){
|
|
73
|
+
return Object.assign({}, this.defaultConfig, this.editorConfig)
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
// 编辑器创建完毕时的回调函数。
|
|
78
|
+
onCreated(editor) {
|
|
79
|
+
this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
// 对用户剪切板内容的处理
|
|
83
|
+
customPaste(editor, event) {
|
|
84
|
+
// event 是 ClipboardEvent 类型,可以拿到粘贴的数据
|
|
85
|
+
const text = event.clipboardData.getData('text/plain'); // 获取粘贴的纯文本
|
|
86
|
+
editor.insertText(text);
|
|
87
|
+
event.preventDefault(); // 阻止默认的粘贴行为
|
|
88
|
+
return false;
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
//onChange 时获取编辑器最新内容
|
|
92
|
+
onChange(e) {
|
|
93
|
+
this.$emit("input", e.getHtml())
|
|
94
|
+
},
|
|
95
|
+
// 编辑器 focus 时的回调函数。
|
|
96
|
+
onFocus(e){
|
|
97
|
+
this.$emit("onFocus", e)
|
|
98
|
+
},
|
|
99
|
+
// 编辑器 blur 时的回调函数。
|
|
100
|
+
onBlur(e){
|
|
101
|
+
this.$emit("onBlur", e)
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
//组件销毁时,及时销毁编辑器
|
|
105
|
+
beforeDestroy() {
|
|
106
|
+
const editor = this.editor
|
|
107
|
+
if (editor == null) return
|
|
108
|
+
editor.destroy() // 组件销毁时,及时销毁编辑器
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style lang="scss" scoped>
|
|
114
|
+
.editor {
|
|
115
|
+
border: 1px solid #ccc;
|
|
116
|
+
|
|
117
|
+
.editor-toolbar {
|
|
118
|
+
border-bottom: 1px solid #ccc
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.editor-content {
|
|
122
|
+
height: 500px;
|
|
123
|
+
overflow-y: hidden;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
127
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// 用于处理option插槽
|
|
2
|
+
export default {
|
|
3
|
+
name: 'EdOptionSlot',
|
|
4
|
+
props: {
|
|
5
|
+
// 组件类型
|
|
6
|
+
tags: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
// option 的相关属性
|
|
12
|
+
optionAttrs: Object,
|
|
13
|
+
|
|
14
|
+
// 数据
|
|
15
|
+
data: {
|
|
16
|
+
type: [Object, String],
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
// 子元素
|
|
21
|
+
child: {
|
|
22
|
+
type: String,
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
data() {
|
|
26
|
+
return {
|
|
27
|
+
optionTypes: {
|
|
28
|
+
'el-select': {
|
|
29
|
+
type: 'el-option',
|
|
30
|
+
value: 'value'
|
|
31
|
+
},
|
|
32
|
+
'el-checkbox-group': {
|
|
33
|
+
type: 'el-checkbox',
|
|
34
|
+
value: 'label'
|
|
35
|
+
},
|
|
36
|
+
'el-radio-group': {
|
|
37
|
+
type: 'el-radio',
|
|
38
|
+
value: 'label'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
render(h) {
|
|
44
|
+
let optionType = this.child ? this.child : this.optionTypes[this.tags].type
|
|
45
|
+
const config = this.getOptionConfig(this.optionAttrs, optionType, this.data)
|
|
46
|
+
return h(optionType, config.attrs, config.children)
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
// 获取配置
|
|
50
|
+
getOptionConfig(customAttrs, type, data) {
|
|
51
|
+
let options = {}
|
|
52
|
+
|
|
53
|
+
if (type !== 'el-option') {
|
|
54
|
+
options.label = data.value
|
|
55
|
+
options.value = data.label
|
|
56
|
+
options = Object.assign({}, data, options)
|
|
57
|
+
} else {
|
|
58
|
+
options = data
|
|
59
|
+
}
|
|
60
|
+
const attrs = Object.assign({}, customAttrs, options)
|
|
61
|
+
let children = type !== 'el-option' ? data.label : null
|
|
62
|
+
return {attrs: {attrs}, children: children}
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import Main from './main.vue';
|
|
3
|
+
import { PopupManager } from 'element-ui/src/utils/popup';
|
|
4
|
+
import { isVNode } from 'element-ui/src/utils/vdom';
|
|
5
|
+
import { isObject } from 'element-ui/src/utils/types';
|
|
6
|
+
let MessageConstructor = Vue.extend(Main);
|
|
7
|
+
|
|
8
|
+
let instance;
|
|
9
|
+
let instances = [];
|
|
10
|
+
let seed = 1;
|
|
11
|
+
|
|
12
|
+
const Message = function(options) {
|
|
13
|
+
if (Vue.prototype.$isServer) return;
|
|
14
|
+
options = options || {};
|
|
15
|
+
if (typeof options === 'string') {
|
|
16
|
+
options = {
|
|
17
|
+
message: options
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
let userOnClose = options.onClose;
|
|
21
|
+
let id = 'message_' + seed++;
|
|
22
|
+
|
|
23
|
+
options.onClose = function() {
|
|
24
|
+
Message.close(id, userOnClose);
|
|
25
|
+
};
|
|
26
|
+
instance = new MessageConstructor({
|
|
27
|
+
data: options
|
|
28
|
+
});
|
|
29
|
+
instance.id = id;
|
|
30
|
+
if (isVNode(instance.message)) {
|
|
31
|
+
instance.$slots.default = [instance.message];
|
|
32
|
+
instance.message = null;
|
|
33
|
+
}
|
|
34
|
+
instance.$mount();
|
|
35
|
+
document.body.appendChild(instance.$el);
|
|
36
|
+
let verticalOffset = options.offset || 20;
|
|
37
|
+
instances.forEach(item => {
|
|
38
|
+
verticalOffset += item.$el.offsetHeight + 16;
|
|
39
|
+
});
|
|
40
|
+
instance.verticalOffset = verticalOffset;
|
|
41
|
+
instance.visible = true;
|
|
42
|
+
instance.$el.style.zIndex = instance.zIndex ? instance.zIndex : PopupManager.nextZIndex();
|
|
43
|
+
instances.push(instance);
|
|
44
|
+
return instance;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
['success', 'warning', 'info', 'error'].forEach(type => {
|
|
48
|
+
Message[type] = (options) => {
|
|
49
|
+
if (isObject(options) && !isVNode(options)) {
|
|
50
|
+
return Message({
|
|
51
|
+
...options,
|
|
52
|
+
type
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return Message({
|
|
56
|
+
type,
|
|
57
|
+
message: options
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
Message.close = function(id, userOnClose) {
|
|
63
|
+
let len = instances.length;
|
|
64
|
+
let index = -1;
|
|
65
|
+
let removedHeight;
|
|
66
|
+
for (let i = 0; i < len; i++) {
|
|
67
|
+
if (id === instances[i].id) {
|
|
68
|
+
removedHeight = instances[i].$el.offsetHeight;
|
|
69
|
+
index = i;
|
|
70
|
+
if (typeof userOnClose === 'function') {
|
|
71
|
+
userOnClose(instances[i]);
|
|
72
|
+
}
|
|
73
|
+
instances.splice(i, 1);
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (len <= 1 || index === -1 || index > instances.length - 1) return;
|
|
78
|
+
for (let i = index; i < len - 1 ; i++) {
|
|
79
|
+
let dom = instances[i].$el;
|
|
80
|
+
dom.style['top'] =
|
|
81
|
+
parseInt(dom.style['top'], 10) - removedHeight - 16 + 'px';
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
Message.closeAll = function() {
|
|
86
|
+
for (let i = instances.length - 1; i >= 0; i--) {
|
|
87
|
+
instances[i].close();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default Message;
|