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,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
title="选择码值"
|
|
4
|
+
:visible.sync="dialogVisible"
|
|
5
|
+
:modal="false"
|
|
6
|
+
>
|
|
7
|
+
<el-form :inline="true" :model="searchForm" class="demo-form-inline" ref="searchForm">
|
|
8
|
+
<el-form-item label="字典编号" prop="dataSourceName">
|
|
9
|
+
<el-input v-model="searchForm.type" placeholder="字典编号"></el-input>
|
|
10
|
+
</el-form-item>
|
|
11
|
+
<el-form-item>
|
|
12
|
+
<el-button type="primary" @click="loadData">查询</el-button>
|
|
13
|
+
</el-form-item>
|
|
14
|
+
<!-- <el-form-item>-->
|
|
15
|
+
<!-- <el-button @click="resetForm('searchForm')">重置</el-button>-->
|
|
16
|
+
<!-- </el-form-item>-->
|
|
17
|
+
</el-form>
|
|
18
|
+
<el-table
|
|
19
|
+
:data="tableData"
|
|
20
|
+
@row-click="singleElection"
|
|
21
|
+
>
|
|
22
|
+
<el-table-column align="center" width="55" label="选择">
|
|
23
|
+
<template slot-scope="scope">
|
|
24
|
+
<!-- 可以手动的修改label的值,从而控制选择哪一项 -->
|
|
25
|
+
<el-radio class="radio" v-model="selectVal" :label="scope.row.dictType"
|
|
26
|
+
>
|
|
27
|
+
</el-radio
|
|
28
|
+
>
|
|
29
|
+
</template>
|
|
30
|
+
</el-table-column>
|
|
31
|
+
<el-table-column align="center" prop="name" label="字段名称"></el-table-column>
|
|
32
|
+
<el-table-column align="center" prop="dictType" label="字段类型"></el-table-column>
|
|
33
|
+
<el-table-column align="center" prop="usable" label="状态">
|
|
34
|
+
<template slot-scope="scope">
|
|
35
|
+
<el-tag v-if="scope.row.usable">可用</el-tag>
|
|
36
|
+
<el-tag v-else>禁用</el-tag>
|
|
37
|
+
</template>
|
|
38
|
+
</el-table-column>
|
|
39
|
+
</el-table>
|
|
40
|
+
<div style="float: right">
|
|
41
|
+
<el-pagination
|
|
42
|
+
@current-change="currentChange"
|
|
43
|
+
:page-size="page.pageSize"
|
|
44
|
+
layout="total, prev, pager, next"
|
|
45
|
+
:total="page.total">
|
|
46
|
+
</el-pagination>
|
|
47
|
+
</div>
|
|
48
|
+
<span slot="footer" class="dialog-footer">
|
|
49
|
+
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
50
|
+
<el-button type="primary" @click="choose">确 定</el-button>
|
|
51
|
+
</span>
|
|
52
|
+
</el-dialog>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
import {getDictList} from '../../../../../api/easyData'
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
name: "ChooseDict",
|
|
60
|
+
data() {
|
|
61
|
+
return {
|
|
62
|
+
dialogVisible: false,
|
|
63
|
+
//列表显示数据
|
|
64
|
+
tableData: [],
|
|
65
|
+
//前端分页,这里是所有数据
|
|
66
|
+
tableList: [],
|
|
67
|
+
page: {total: 0, pageSize: 10},
|
|
68
|
+
//选择的数据
|
|
69
|
+
selectVal: '',
|
|
70
|
+
searchForm: {type: ''}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
show() {
|
|
75
|
+
this.loadData()
|
|
76
|
+
this.dialogVisible = true
|
|
77
|
+
},
|
|
78
|
+
loadData() {
|
|
79
|
+
this.tableData = []
|
|
80
|
+
getDictList(this.searchForm).then((resp) => {
|
|
81
|
+
if (resp.data) {
|
|
82
|
+
this.tableList = resp.data
|
|
83
|
+
if (this.tableList.length > 10) {
|
|
84
|
+
this.tableData = this.tableList.slice(0, 10)
|
|
85
|
+
} else {
|
|
86
|
+
this.tableData = this.tableList
|
|
87
|
+
}
|
|
88
|
+
this.page.total = resp.data.length
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
},
|
|
92
|
+
currentChange(val) {
|
|
93
|
+
const index = (val - 1) * 10
|
|
94
|
+
if (this.tableList.length >= val * 10) {
|
|
95
|
+
this.tableData = this.tableList.slice(index, val * 10)
|
|
96
|
+
} else {
|
|
97
|
+
this.tableData = this.tableList.slice(index, this.tableList.length)
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
singleElection(row) {
|
|
101
|
+
this.selectVal = row.dictType
|
|
102
|
+
},
|
|
103
|
+
choose() {
|
|
104
|
+
if (!this.selectVal) {
|
|
105
|
+
this.$message.error("请选择一行数据")
|
|
106
|
+
return
|
|
107
|
+
}
|
|
108
|
+
this.dialogVisible = false
|
|
109
|
+
this.$emit('choose', this.selectVal)
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<style scoped>
|
|
116
|
+
:deep(.el-dialog) {
|
|
117
|
+
height: 85vh;
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import ds from "../../../../api/ds";
|
|
2
|
+
import {formatDate} from "../../../../utils/dateUtils";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
methods: {
|
|
6
|
+
getTableColumns() {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
label: '数据源名称',
|
|
10
|
+
prop: 'dataSourceName',
|
|
11
|
+
width: 180
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: '分类',
|
|
15
|
+
prop: 'classify',
|
|
16
|
+
width: 100,
|
|
17
|
+
formatter: this.classifyFmt
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: '数据源备注',
|
|
21
|
+
prop: 'remark',
|
|
22
|
+
width: 200,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: '新增时间',
|
|
26
|
+
prop: 'createTime',
|
|
27
|
+
width: 150,
|
|
28
|
+
formatter: this.formatDate
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: '更新时间',
|
|
32
|
+
prop: 'updateTime',
|
|
33
|
+
width: 150,
|
|
34
|
+
formatter: this.formatDate
|
|
35
|
+
}]
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
classifyFmt(row, column) {
|
|
39
|
+
let data = row[column.property]
|
|
40
|
+
return this.classifyList[data]
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @name formatDate
|
|
45
|
+
* @param row
|
|
46
|
+
* @param column
|
|
47
|
+
* @return {*|string}
|
|
48
|
+
* @description 设置时间格式
|
|
49
|
+
*/
|
|
50
|
+
formatDate(row, column) {
|
|
51
|
+
let data = row[column.property]
|
|
52
|
+
return data ? formatDate(new Date(data), 'yyyy-MM-dd hh:mm:ss') : ''
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// 查看页面
|
|
56
|
+
viewPages({row}) {
|
|
57
|
+
console.log(row)
|
|
58
|
+
const {dataSourceName} = row
|
|
59
|
+
this.$router.push({
|
|
60
|
+
path: '/easydata/dataSource/EasyDataList/' + dataSourceName
|
|
61
|
+
})
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
async delDs(id) {
|
|
65
|
+
this.loading = true
|
|
66
|
+
const resp = await ds.delDs({id: id})
|
|
67
|
+
if (resp.success) {
|
|
68
|
+
this.$message.success(resp.msg || "操作成功!")
|
|
69
|
+
this.loadData()
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
async copyDs(id) {
|
|
73
|
+
this.loading = true
|
|
74
|
+
const resp = await ds.copyDataSource({id: id})
|
|
75
|
+
if (resp.success) {
|
|
76
|
+
this.$message.success(resp.msg || "操作成功!")
|
|
77
|
+
this.loadData()
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
editDs(row) {
|
|
82
|
+
this.dsFormDesc.map(desc => {
|
|
83
|
+
desc.children.attrs.disabled = false
|
|
84
|
+
if (row.dataSourceName.indexOf('_copy') === -1) {
|
|
85
|
+
if (desc.prop === 'dataSourceName' || desc.prop === 'isGeneralColumn') {
|
|
86
|
+
//包含copy就走false不禁用
|
|
87
|
+
desc.children.attrs.disabled = !!row
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
this.dsForm = row
|
|
93
|
+
this.$nextTick(() => {
|
|
94
|
+
this.visibleDrawer = true
|
|
95
|
+
})
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
showAddView() {
|
|
99
|
+
this.dsForm = {}
|
|
100
|
+
this.dsFormDesc.map(desc => {
|
|
101
|
+
desc.children.attrs.disabled = false
|
|
102
|
+
})
|
|
103
|
+
this.$nextTick(() => {
|
|
104
|
+
this.visibleDrawer = true
|
|
105
|
+
})
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
// 表操作
|
|
109
|
+
openTableOper(record) {
|
|
110
|
+
this.$refs.tableOperationModal.showModal(record)
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
// 表属性
|
|
114
|
+
openTableModal(record) {
|
|
115
|
+
this.$refs.tablePropsModal.showModal(record)
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
// 视图属性
|
|
119
|
+
openViewModal(record) {
|
|
120
|
+
this.$refs.viewPropsModal.showModal(record)
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* @name handleTableChange
|
|
124
|
+
* @param pagination
|
|
125
|
+
*/
|
|
126
|
+
handleTableChange({pagination}) {
|
|
127
|
+
const param = {pageNo: pagination.current, pageSize: pagination.pageSize}
|
|
128
|
+
this.loadData(param)
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* 选中一行数据
|
|
132
|
+
* @param {*} row
|
|
133
|
+
*/
|
|
134
|
+
handleCurrentChange(row) {
|
|
135
|
+
this.$emit('handleCurrentChange', row)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-card class="box-card">
|
|
3
|
+
<ed-form ref="searchForm" v-model="searchForm" :form-desc="searchFormDesc" :inline="true"
|
|
4
|
+
class="demo-form-inline" @keyup.enter.native="loadData"></ed-form>
|
|
5
|
+
<div v-if="!isChooseModel" class="operator-btn">
|
|
6
|
+
<el-button :loading="operLoading" icon="el-icon-plus" plain size="small" type="primary" @click="showAddView()">
|
|
7
|
+
新增数据源
|
|
8
|
+
</el-button>
|
|
9
|
+
<el-popconfirm
|
|
10
|
+
class="pop-confirm-button"
|
|
11
|
+
title="确定删除所有虚拟列吗?"
|
|
12
|
+
@confirm="deleteAllViCol">
|
|
13
|
+
<el-button slot="reference" :loading="operLoading" icon="el-icon-minus" plain size="small" type="danger">删除所有虚拟列</el-button>
|
|
14
|
+
</el-popconfirm>
|
|
15
|
+
<el-popconfirm
|
|
16
|
+
class="pop-confirm-button"
|
|
17
|
+
title="确定重载所有虚拟列吗?"
|
|
18
|
+
@confirm="reloadAllViCol">
|
|
19
|
+
<el-button slot="reference" :loading="operLoading" icon="el-icon-refresh-right" plain size="small" type="info">重载所有虚拟列</el-button>
|
|
20
|
+
</el-popconfirm>
|
|
21
|
+
<el-upload :file-list="fileList" :http-request="importDs" :limit="1" :multiple="false"
|
|
22
|
+
:show-file-list="false" action="" style="display: inline-block;margin-left: 10px">
|
|
23
|
+
<el-button :loading="operLoading" icon="el-icon-upload2" plain size="small" type="primary">导入数据源
|
|
24
|
+
</el-button>
|
|
25
|
+
</el-upload>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<ed-table :columns="tableColumns" :loading="loading" :pagination.sync="pagination" :data="tableData"
|
|
29
|
+
@change="handleTableChange" @current-change="handleCurrentChange">
|
|
30
|
+
<template v-if="!isChooseModel" v-slot:operate="scope">
|
|
31
|
+
<el-button size="mini" type="text" @click="viewPages(scope)">查看页面</el-button>
|
|
32
|
+
<el-divider direction="vertical"></el-divider>
|
|
33
|
+
<el-button size="mini" type="text" @click="copyDs(scope.row.id)">复制</el-button>
|
|
34
|
+
<el-divider direction="vertical"></el-divider>
|
|
35
|
+
<el-button size="mini" style="color: green" type="text" @click="editDs(scope.row)">编辑</el-button>
|
|
36
|
+
<el-divider direction="vertical"></el-divider>
|
|
37
|
+
<el-button size="mini" style="color: red" type="text" @click="openTableOper(scope.row)">表操作</el-button>
|
|
38
|
+
<el-divider direction="vertical"></el-divider>
|
|
39
|
+
<el-dropdown size="mini" trigger="click">
|
|
40
|
+
<span class="el-dropdown-link">
|
|
41
|
+
属性控制<i class="el-icon-arrow-down el-icon--right"></i>
|
|
42
|
+
</span>
|
|
43
|
+
<el-dropdown-menu slot="dropdown">
|
|
44
|
+
<el-dropdown-item @click.native="openTableModal(scope.row)">表属性</el-dropdown-item>
|
|
45
|
+
<el-dropdown-item @click.native="openViewModal(scope.row)">视图属性</el-dropdown-item>
|
|
46
|
+
</el-dropdown-menu>
|
|
47
|
+
</el-dropdown>
|
|
48
|
+
<el-divider direction="vertical"></el-divider>
|
|
49
|
+
<el-button :loading="exportLoading" size="mini" type="text"
|
|
50
|
+
@click="exportDsOne(scope.row.id,scope.row.dataSourceName)">
|
|
51
|
+
导出
|
|
52
|
+
</el-button>
|
|
53
|
+
<el-divider direction="vertical"></el-divider>
|
|
54
|
+
<el-popconfirm
|
|
55
|
+
:title="`确定删除[ ${scope.row.dataSourceName} ]该数据源吗?`"
|
|
56
|
+
@confirm="delDs(scope.row.id)"
|
|
57
|
+
>
|
|
58
|
+
<el-button slot="reference" size="mini" style="color: red" type="text">删除</el-button>
|
|
59
|
+
</el-popconfirm>
|
|
60
|
+
</template>
|
|
61
|
+
</ed-table>
|
|
62
|
+
|
|
63
|
+
<ViewPropsModal ref="viewPropsModal"/>
|
|
64
|
+
<TablePropsModal ref="tablePropsModal"/>
|
|
65
|
+
<TableOperationModal ref="tableOperationModal"/>
|
|
66
|
+
|
|
67
|
+
<!-- 编辑数据源 -->
|
|
68
|
+
<ed-drawer ref="BasicDrawer" :loading="saveLoading" :visible="visibleDrawer" ok-text="保存并关闭"
|
|
69
|
+
title="编辑数据源"
|
|
70
|
+
@close="visibleDrawer = false;dsForm = {}" @ok="addDsInfo">
|
|
71
|
+
<ed-form ref="dsForm" v-model="dsForm" :form-desc="dsFormDesc" :rules="rules"
|
|
72
|
+
label-position="right"></ed-form>
|
|
73
|
+
</ed-drawer>
|
|
74
|
+
|
|
75
|
+
</el-card>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<script lang="jsx">
|
|
79
|
+
import ds from '../../../api/ds'
|
|
80
|
+
import ViewPropsModal from './components/ViewPropsModal'
|
|
81
|
+
import TablePropsModal from './components/TablePropsModal'
|
|
82
|
+
import TableOperationModal from "./components/TableOperationModal";
|
|
83
|
+
import useTable from './hooks/useTable'
|
|
84
|
+
import {getDictItemByType} from '../../../api/easyData'
|
|
85
|
+
|
|
86
|
+
export default {
|
|
87
|
+
name: 'DataSourceList',
|
|
88
|
+
props: {
|
|
89
|
+
//是否为选择弹窗,弹窗时只展示部分内容
|
|
90
|
+
isChooseModel: {type: Boolean, default: false},
|
|
91
|
+
columns: {type: Array, default: () => []}
|
|
92
|
+
},
|
|
93
|
+
components: {
|
|
94
|
+
TableOperationModal,
|
|
95
|
+
ViewPropsModal,
|
|
96
|
+
TablePropsModal
|
|
97
|
+
},
|
|
98
|
+
mixins: [useTable],
|
|
99
|
+
data() {
|
|
100
|
+
return {
|
|
101
|
+
exportLoading: false,
|
|
102
|
+
fileList: [],
|
|
103
|
+
loading: false,
|
|
104
|
+
saveLoading: false,
|
|
105
|
+
operLoading: false,
|
|
106
|
+
isEdit: false,
|
|
107
|
+
visibleDrawer: false,
|
|
108
|
+
tableData: [],
|
|
109
|
+
searchForm: {
|
|
110
|
+
dataSourceName: '',
|
|
111
|
+
remark: '',
|
|
112
|
+
classify: '',
|
|
113
|
+
column: '',
|
|
114
|
+
orderBy: 'desc'
|
|
115
|
+
},
|
|
116
|
+
searchFormAttrs: {
|
|
117
|
+
inline: true
|
|
118
|
+
},
|
|
119
|
+
searchFormDesc: [
|
|
120
|
+
{
|
|
121
|
+
label: "数据源名称",
|
|
122
|
+
prop: "dataSourceName",
|
|
123
|
+
children: {
|
|
124
|
+
tags: "el-input",
|
|
125
|
+
attrs: {
|
|
126
|
+
placeholder: "数据源名称",
|
|
127
|
+
size: "small"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: "数据源分类",
|
|
133
|
+
prop: "classify",
|
|
134
|
+
children: {
|
|
135
|
+
tags: "el-select",
|
|
136
|
+
attrs: {
|
|
137
|
+
placeholder: "数据源分类",
|
|
138
|
+
size: "small"
|
|
139
|
+
},
|
|
140
|
+
options: []
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: "数据源备注",
|
|
145
|
+
prop: "remark",
|
|
146
|
+
children: {
|
|
147
|
+
tags: "el-input",
|
|
148
|
+
attrs: {
|
|
149
|
+
placeholder: "数据源备注",
|
|
150
|
+
size: "small"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
btns: [
|
|
156
|
+
{
|
|
157
|
+
text: "查询",
|
|
158
|
+
click: this.searchData,
|
|
159
|
+
attrs: {
|
|
160
|
+
size: "small",
|
|
161
|
+
type: "primary"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
text: "重置",
|
|
166
|
+
click: this.resetForm,
|
|
167
|
+
attrs: {
|
|
168
|
+
size: "small",
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
dsForm: {
|
|
175
|
+
dataSourceName: '',
|
|
176
|
+
remark: '',
|
|
177
|
+
classify: ''
|
|
178
|
+
},
|
|
179
|
+
dsFormDesc: [
|
|
180
|
+
{
|
|
181
|
+
label: "数据源名称",
|
|
182
|
+
prop: "dataSourceName",
|
|
183
|
+
children: {
|
|
184
|
+
tags: "el-input",
|
|
185
|
+
attrs: {
|
|
186
|
+
placeholder: "数据源名称",
|
|
187
|
+
size: "small"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
label: "数据源分类",
|
|
193
|
+
prop: "classify",
|
|
194
|
+
children: {
|
|
195
|
+
tags: "el-select",
|
|
196
|
+
attrs: {
|
|
197
|
+
placeholder: "数据源分类",
|
|
198
|
+
size: "small"
|
|
199
|
+
},
|
|
200
|
+
options: []
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
label: "真实字段",
|
|
205
|
+
prop: "isGeneralColumn",
|
|
206
|
+
children: {
|
|
207
|
+
tags: "el-switch",
|
|
208
|
+
attrs: {
|
|
209
|
+
activeValue: 1,
|
|
210
|
+
inactiveValue: 0,
|
|
211
|
+
size: "small",
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
label: "数据源备注",
|
|
217
|
+
prop: "remark",
|
|
218
|
+
children: {
|
|
219
|
+
tags: "el-input",
|
|
220
|
+
attrs: {
|
|
221
|
+
placeholder: "数据源备注",
|
|
222
|
+
size: "small"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
],
|
|
227
|
+
classifyList: {
|
|
228
|
+
system: '系统',
|
|
229
|
+
other: '其他',
|
|
230
|
+
},
|
|
231
|
+
tableColumns: [],
|
|
232
|
+
// 分页
|
|
233
|
+
pagination: {
|
|
234
|
+
current: 1,
|
|
235
|
+
pageSize: 10,
|
|
236
|
+
total: 0,
|
|
237
|
+
pageSizes: [10, 20, 30]
|
|
238
|
+
},
|
|
239
|
+
rules: {
|
|
240
|
+
dataSourceName: [
|
|
241
|
+
{required: true, message: '请输入数据源名称', trigger: 'blur'},
|
|
242
|
+
],
|
|
243
|
+
remark: [
|
|
244
|
+
{required: true, message: '请选择数据源备注', trigger: 'blur'}
|
|
245
|
+
],
|
|
246
|
+
classify: [
|
|
247
|
+
{required: true, message: '请选择数据源分类', trigger: 'change'}
|
|
248
|
+
],
|
|
249
|
+
},
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
mounted() {
|
|
253
|
+
this.loadData()
|
|
254
|
+
},
|
|
255
|
+
async created() {
|
|
256
|
+
let res = await getDictItemByType({type: "ed_ds_classify"});
|
|
257
|
+
res.data.forEach(item => {
|
|
258
|
+
this.searchFormDesc[1].children.options.push({
|
|
259
|
+
label: item.itemLabel,
|
|
260
|
+
value: item.itemValue
|
|
261
|
+
})
|
|
262
|
+
this.dsFormDesc[1].children.options.push({
|
|
263
|
+
label: item.itemLabel,
|
|
264
|
+
value: item.itemValue
|
|
265
|
+
})
|
|
266
|
+
this.classifyList[item.itemValue] = item.itemLabel
|
|
267
|
+
})
|
|
268
|
+
},
|
|
269
|
+
methods: {
|
|
270
|
+
/**
|
|
271
|
+
* @name loadData
|
|
272
|
+
* @param param
|
|
273
|
+
* @description 初始化table数据
|
|
274
|
+
*/
|
|
275
|
+
async loadData(param) {
|
|
276
|
+
this.loading = true
|
|
277
|
+
let params = param || {}
|
|
278
|
+
Object.assign(params, this.searchForm)
|
|
279
|
+
const resp = await ds.dataSourcePage(params)
|
|
280
|
+
const data = resp.data
|
|
281
|
+
this.tableData = data.records
|
|
282
|
+
this.pagination.current = data.current
|
|
283
|
+
this.pagination.total = data.total
|
|
284
|
+
this.pagination.pageSize = data.size
|
|
285
|
+
this.loading = false
|
|
286
|
+
this.tableColumns = this.columns.length === 0 ? this.getTableColumns() : this.columns
|
|
287
|
+
},
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @name searchData
|
|
291
|
+
* @param formName
|
|
292
|
+
* @description 查询
|
|
293
|
+
*/
|
|
294
|
+
async searchData(formName) {
|
|
295
|
+
const valid = await this.$refs.searchForm.validate()
|
|
296
|
+
if (valid) {
|
|
297
|
+
let param = {}
|
|
298
|
+
param.pageNo = 1
|
|
299
|
+
param.pageSize = this.pagination.pageSize
|
|
300
|
+
this.loadData(param)
|
|
301
|
+
} else {
|
|
302
|
+
console.log('error submit!!');
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* @name addDsInfo
|
|
309
|
+
* @description 保存并关闭
|
|
310
|
+
*/
|
|
311
|
+
addDsInfo() {
|
|
312
|
+
this.$refs.dsForm.validate().then(valid => {
|
|
313
|
+
this.saveLoading = true
|
|
314
|
+
ds.addDsInfo(JSON.stringify(this.dsForm)).then((resp) => {
|
|
315
|
+
if (resp.success) {
|
|
316
|
+
this.$message.success(resp.msg || "操作成功!")
|
|
317
|
+
this.dsForm = {}
|
|
318
|
+
this.visibleDrawer = false
|
|
319
|
+
this.loadData()
|
|
320
|
+
}
|
|
321
|
+
}).finally(() => {
|
|
322
|
+
this.saveLoading = false
|
|
323
|
+
})
|
|
324
|
+
}).catch(err => {
|
|
325
|
+
console.log('error submit!!');
|
|
326
|
+
})
|
|
327
|
+
},
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @bane resetForm
|
|
331
|
+
* @description 重置
|
|
332
|
+
*/
|
|
333
|
+
resetForm() {
|
|
334
|
+
this.$refs.searchForm.resetFields();
|
|
335
|
+
this.loadData()
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* @name deleteAllViCol
|
|
341
|
+
* @description 删除所有虚拟列
|
|
342
|
+
*/
|
|
343
|
+
deleteAllViCol() {
|
|
344
|
+
this.operLoading = true
|
|
345
|
+
ds.deleteAllViCol({}).then((resp) => {
|
|
346
|
+
if (resp.success) {
|
|
347
|
+
this.$message.success(resp.msg || "操作成功!")
|
|
348
|
+
}
|
|
349
|
+
}).finally(() => {
|
|
350
|
+
this.operLoading = false
|
|
351
|
+
})
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* @name reloadAllViCol
|
|
356
|
+
* @description 重载所有虚拟列
|
|
357
|
+
*/
|
|
358
|
+
reloadAllViCol() {
|
|
359
|
+
this.operLoading = true
|
|
360
|
+
ds.reloadAllViCol({}).then((resp) => {
|
|
361
|
+
if (resp.success) {
|
|
362
|
+
this.$message.success(resp.msg || "操作成功!")
|
|
363
|
+
}
|
|
364
|
+
}).finally(() => {
|
|
365
|
+
this.operLoading = false
|
|
366
|
+
})
|
|
367
|
+
},
|
|
368
|
+
exportDsOne(id, name) {
|
|
369
|
+
this.exportLoading = true
|
|
370
|
+
ds.exportOne({id: id}).then((resp) => {
|
|
371
|
+
if (resp.success) {
|
|
372
|
+
let blob = new Blob([resp.data], {
|
|
373
|
+
type: 'text/plain'
|
|
374
|
+
})
|
|
375
|
+
console.log(blob)
|
|
376
|
+
let fileName = name + '.tex'
|
|
377
|
+
if (window.navigator.msSaveOrOpenBlob) {
|
|
378
|
+
navigator.msSaveBlob(blob, fileName)
|
|
379
|
+
} else {
|
|
380
|
+
var link = document.createElement('a')
|
|
381
|
+
link.href = window.URL.createObjectURL(blob)
|
|
382
|
+
link.download = fileName
|
|
383
|
+
link.click()
|
|
384
|
+
//释放内存
|
|
385
|
+
window.URL.revokeObjectURL(link.href)
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}).finally(() => {
|
|
389
|
+
this.exportLoading = false
|
|
390
|
+
})
|
|
391
|
+
},
|
|
392
|
+
importDs(param) {
|
|
393
|
+
let reader = new FileReader(); //新建一个FileReader
|
|
394
|
+
reader.readAsText(param.file, "UTF-8"); //读取文件
|
|
395
|
+
reader.onload = (evt) => { //读取完文件之后会回来这里
|
|
396
|
+
let fileString = evt.target.result; // 读取文件内容
|
|
397
|
+
ds.importDs(fileString).then((resp) => {
|
|
398
|
+
this.$message.success(resp.data || "操作成功!")
|
|
399
|
+
this.fileList = []
|
|
400
|
+
this.loadData()
|
|
401
|
+
})
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
</script>
|
|
407
|
+
<style lang="scss" scoped>
|
|
408
|
+
@import "../../../style/index.scss";
|
|
409
|
+
|
|
410
|
+
.el-dropdown-link {
|
|
411
|
+
cursor: pointer;
|
|
412
|
+
color: #1890ff;
|
|
413
|
+
font-size: 12px;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.el-icon-arrow-down {
|
|
417
|
+
font-size: 12px;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.page {
|
|
421
|
+
float: right;
|
|
422
|
+
margin: 20px 0px;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.operator-btn {
|
|
426
|
+
margin: 0px 0px 20px 0px;
|
|
427
|
+
}
|
|
428
|
+
.pop-confirm-button {
|
|
429
|
+
display: inline-block; margin-left: 10px;
|
|
430
|
+
}
|
|
431
|
+
</style>
|