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,737 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="pages">
|
|
3
|
+
<ed-dialog :close-on-press-escape="true" :fullscreen="fullscreen" :visible.sync="dialogVisible" title="视图属性管理">
|
|
4
|
+
<span slot="footer" class="dialog-footer">
|
|
5
|
+
<el-button type="primary" @click="saveControlInfo">保 存</el-button>
|
|
6
|
+
<el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
|
|
7
|
+
</span>
|
|
8
|
+
|
|
9
|
+
<el-row :gutter="20" class="es-row">
|
|
10
|
+
<el-col :span="5" class="es-row--col">
|
|
11
|
+
<el-card class="es-box-card">
|
|
12
|
+
<div slot="header" class="es-box-card--header">
|
|
13
|
+
<div>视图列表</div>
|
|
14
|
+
<div class="tab">
|
|
15
|
+
<el-button icon="el-icon-document-copy" size="small" type="text"
|
|
16
|
+
@click="copyViewOpenDialog">复制</el-button>
|
|
17
|
+
<el-button icon="el-icon-refresh" size="small" type="text"
|
|
18
|
+
@click="reloadAll">刷新</el-button>
|
|
19
|
+
<el-button icon="el-icon-plus" size="small" type="text" @click="addView">添加</el-button>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<el-menu class="es-menu" default-active="0">
|
|
23
|
+
<el-menu-item v-for="(item, index) in viewRecord" :key="index" :index="String(index)"
|
|
24
|
+
class="es-menu-item" @click.native="clickViewName(item)">
|
|
25
|
+
<p>{{ `${item.viewName} (${item.viewGroup})` }}</p>
|
|
26
|
+
<div class="es-menu-item--operate">
|
|
27
|
+
<el-popconfirm :title="`确定删除视图【${item.viewName}】?`" @confirm="deleteView(item)">
|
|
28
|
+
<el-button v-if="!item.notDelete" slot="reference" size="small" type="text"
|
|
29
|
+
@click.native.stop>删除</el-button>
|
|
30
|
+
</el-popconfirm>
|
|
31
|
+
<el-button v-if="!item.notDelete" size="small" type="text"
|
|
32
|
+
@click.native.stop="updateView(item)">修改</el-button>
|
|
33
|
+
</div>
|
|
34
|
+
</el-menu-item>
|
|
35
|
+
</el-menu>
|
|
36
|
+
</el-card>
|
|
37
|
+
</el-col>
|
|
38
|
+
<el-col :span="19" class="es-row--col">
|
|
39
|
+
<ed-table-editor v-model="controlRecords" :columns="tableColumns" :rules="controlRules" height="450px"
|
|
40
|
+
:loading="loading"
|
|
41
|
+
is-drag row-key="controlName"
|
|
42
|
+
size="small" title="控件信息">
|
|
43
|
+
<template #extra>
|
|
44
|
+
<el-button icon="el-icon-bottom" size="small" type="text" @click="pullControl">拉取</el-button>
|
|
45
|
+
<el-button icon="el-icon-folder" size="small" type="text" @click="saveControlInfo">保存</el-button>
|
|
46
|
+
<el-button icon="el-icon-plus" size="small" type="text" @click="addControl(addControlMaxLength)">添加</el-button>
|
|
47
|
+
<el-button v-show="changeAddControlFlag" icon="el-icon-edit" size="small" type="text"
|
|
48
|
+
@click="clickInsertControlButton">插入</el-button>
|
|
49
|
+
<el-input v-show="!changeAddControlFlag" ref="insertControlInput"
|
|
50
|
+
v-model="insertControlRow"
|
|
51
|
+
:placeholder="`请输入要插入的行:1~${addControlMaxLength}`"
|
|
52
|
+
oninput="value=value.replace(/[^0-9]/g,'')"
|
|
53
|
+
@blur="cancelInsertControlRow"
|
|
54
|
+
@keyup.enter.native="addControl(insertControlRow)"/>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<template v-slot:operate="{ self, row}">
|
|
58
|
+
<el-button type="text" @click="addControlProps(row)">属性</el-button>
|
|
59
|
+
<el-button type="text" @click="deleteControlInfo(row)">删除</el-button>
|
|
60
|
+
</template>
|
|
61
|
+
</ed-table-editor>
|
|
62
|
+
</el-col>
|
|
63
|
+
</el-row>
|
|
64
|
+
</ed-dialog>
|
|
65
|
+
<el-dialog :destroy-on-close="true" :visible.sync="addViewDialogVisible" center title="新增视图" width="30%">
|
|
66
|
+
<el-form ref="addNewViewFormRef" :model="addNewViewForm" label-position="right" label-width="80px">
|
|
67
|
+
<el-form-item :rules="[{ required: true, message: '视图名称不能为空' }]" label="视图名称" prop="viewName">
|
|
68
|
+
<el-input v-model="addNewViewForm.viewName" placeholder="请输入视图名称"></el-input>
|
|
69
|
+
</el-form-item>
|
|
70
|
+
<el-form-item :rules="[{ required: true, message: '分组名称不能为空' }]" label="分组名称" prop="viewGroup">
|
|
71
|
+
<el-input v-model="addNewViewForm.viewGroup" placeholder="请输入分组名称"></el-input>
|
|
72
|
+
</el-form-item>
|
|
73
|
+
</el-form>
|
|
74
|
+
<span slot="footer" class="dialog-footer">
|
|
75
|
+
<el-button @click="addViewDialogVisible = false">取 消</el-button>
|
|
76
|
+
<el-button type="primary" @click="saveNewView">确 定</el-button>
|
|
77
|
+
</span>
|
|
78
|
+
</el-dialog>
|
|
79
|
+
<el-dialog :destroy-on-close="true" :title="copyViewTitle" :visible.sync="copyViewDialogVisible" center
|
|
80
|
+
width="30%">
|
|
81
|
+
<el-form ref="copyNewViewFormRef" :model="copyNewViewForm" label-position="right" label-width="80px">
|
|
82
|
+
<el-form-item :rules="[{ required: true, message: '视图名称不能为空' }]" label="视图名称" prop="viewName">
|
|
83
|
+
<el-input v-model="copyNewViewForm.viewName" placeholder="请输入视图名称"></el-input>
|
|
84
|
+
</el-form-item>
|
|
85
|
+
<el-form-item :rules="[{ required: true, message: '分组名称不能为空' }]" label="分组名称" prop="viewGroup">
|
|
86
|
+
<el-input v-model="copyNewViewForm.viewGroup" placeholder="请输入分组名称"></el-input>
|
|
87
|
+
</el-form-item>
|
|
88
|
+
</el-form>
|
|
89
|
+
<span slot="footer" class="dialog-footer">
|
|
90
|
+
<el-button @click="copyViewDialogVisible = false">取 消</el-button>
|
|
91
|
+
<el-button type="primary" @click="copyCurrentView">确 定</el-button>
|
|
92
|
+
</span>
|
|
93
|
+
</el-dialog>
|
|
94
|
+
<ControlViews ref="controlProps"/>
|
|
95
|
+
</span>
|
|
96
|
+
</template>
|
|
97
|
+
<script>
|
|
98
|
+
import ds from '../../../../api/ds'
|
|
99
|
+
import Vue from 'vue';
|
|
100
|
+
import {controlType} from '../../../../utils/setting'
|
|
101
|
+
import ControlViews from './ControlViews'
|
|
102
|
+
|
|
103
|
+
export default {
|
|
104
|
+
components: {ControlViews},
|
|
105
|
+
data() {
|
|
106
|
+
return {
|
|
107
|
+
tableValue: [],
|
|
108
|
+
tableColumns: [
|
|
109
|
+
{
|
|
110
|
+
prop: 'controlName',
|
|
111
|
+
label: "虚拟列",
|
|
112
|
+
align: "center",
|
|
113
|
+
width: "240px",
|
|
114
|
+
children: {
|
|
115
|
+
tags: "el-select",
|
|
116
|
+
attrs: {
|
|
117
|
+
size: "small",
|
|
118
|
+
placeholder: "请选择虚拟列",
|
|
119
|
+
filterable: true,
|
|
120
|
+
allowCreate: true,
|
|
121
|
+
defaultFirstOption: true
|
|
122
|
+
},
|
|
123
|
+
options: []
|
|
124
|
+
},
|
|
125
|
+
change: this.handleChange
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
prop: 'controlType',
|
|
129
|
+
label: "控件类型",
|
|
130
|
+
align: "center",
|
|
131
|
+
width: "150px",
|
|
132
|
+
children: {
|
|
133
|
+
tags: "el-select",
|
|
134
|
+
attrs: {
|
|
135
|
+
size: "small",
|
|
136
|
+
clearable: true,
|
|
137
|
+
filterable: true,
|
|
138
|
+
placeholder: "请选择控件"
|
|
139
|
+
},
|
|
140
|
+
options: controlType
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
prop: 'label',
|
|
145
|
+
label: "标签",
|
|
146
|
+
align: "center",
|
|
147
|
+
width: "150px",
|
|
148
|
+
children: {
|
|
149
|
+
tags: "ed-input-pop",
|
|
150
|
+
attrs: {
|
|
151
|
+
size: "small",
|
|
152
|
+
placeholder: "请输入标签"
|
|
153
|
+
},
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
prop: 'isRequired',
|
|
158
|
+
label: "必输",
|
|
159
|
+
align: "center",
|
|
160
|
+
width: "auto",
|
|
161
|
+
children: {
|
|
162
|
+
size: "small",
|
|
163
|
+
tags: "el-switch",
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
prop: 'isQuery',
|
|
168
|
+
label: "查询项",
|
|
169
|
+
align: "center",
|
|
170
|
+
width: "auto",
|
|
171
|
+
children: {
|
|
172
|
+
size: "small",
|
|
173
|
+
tags: "el-switch",
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
prop: 'isAccurateQuery',
|
|
178
|
+
label: "精确查询",
|
|
179
|
+
align: "center",
|
|
180
|
+
width: "auto",
|
|
181
|
+
children: {
|
|
182
|
+
size: "small",
|
|
183
|
+
tags: "el-switch",
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
prop: 'isInput',
|
|
188
|
+
label: "录入项",
|
|
189
|
+
align: "center",
|
|
190
|
+
width: "auto",
|
|
191
|
+
children: {
|
|
192
|
+
size: "small",
|
|
193
|
+
tags: "el-switch",
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
prop: 'isShow',
|
|
198
|
+
label: "列表展示",
|
|
199
|
+
align: "center",
|
|
200
|
+
width: "auto",
|
|
201
|
+
children: {
|
|
202
|
+
size: "small",
|
|
203
|
+
tags: "el-switch",
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
prop: 'isVirtual',
|
|
207
|
+
label: "虚拟列",
|
|
208
|
+
align: "center",
|
|
209
|
+
width: "auto",
|
|
210
|
+
children: {
|
|
211
|
+
size: "small",
|
|
212
|
+
tags: "el-switch",
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
tabPosition: 'left',
|
|
217
|
+
dialogVisible: false,
|
|
218
|
+
fullscreen: true,
|
|
219
|
+
currentDataSource: {}, //当前数据源
|
|
220
|
+
viewRecord: [], //视图列表
|
|
221
|
+
currentView: {id: 'default', viewName: '默认视图'}, //默认选中视图
|
|
222
|
+
controlRecords: [], //视图对应控件列表
|
|
223
|
+
controlColumns: {
|
|
224
|
+
controlName: [],
|
|
225
|
+
controlType: controlType
|
|
226
|
+
}, //控件字段属性
|
|
227
|
+
loading: false,
|
|
228
|
+
controlRules: {
|
|
229
|
+
controlName: {message: '请选择虚拟列'},
|
|
230
|
+
controlType: {message: '请选择控件'},
|
|
231
|
+
label: {message: '请输入标签'}
|
|
232
|
+
}, //控件属性输入规则
|
|
233
|
+
addViewDialogVisible: false, //添加视图modal标识
|
|
234
|
+
addNewViewForm: {}, //添加视图form
|
|
235
|
+
copyViewDialogVisible: false, //复制视图modal标识
|
|
236
|
+
copyViewTitle: '复制视图',
|
|
237
|
+
copyNewViewForm: {}, //复制视图form
|
|
238
|
+
changeAddControlFlag: true, //点击插入控件标识
|
|
239
|
+
insertControlRow: null, //插入控件输入框值
|
|
240
|
+
originalColumns: [
|
|
241
|
+
{
|
|
242
|
+
label: 'id(主键)',
|
|
243
|
+
value: 'id',
|
|
244
|
+
text: '主键'
|
|
245
|
+
}, {
|
|
246
|
+
label: 'creator(创建人)',
|
|
247
|
+
value: 'creator',
|
|
248
|
+
text: '创建人'
|
|
249
|
+
}, {
|
|
250
|
+
label: 'org_code(机构编号)',
|
|
251
|
+
value: 'org_code',
|
|
252
|
+
text: '机构编号'
|
|
253
|
+
}, {
|
|
254
|
+
label: 'org_id(机构ID)',
|
|
255
|
+
value: 'org_id',
|
|
256
|
+
text: '机构ID'
|
|
257
|
+
}, {
|
|
258
|
+
label: 'create_time(创建时间)',
|
|
259
|
+
value: 'create_time',
|
|
260
|
+
text: '创建时间'
|
|
261
|
+
}, {
|
|
262
|
+
label: 'update_time(更新时间)',
|
|
263
|
+
value: 'update_time',
|
|
264
|
+
text: '更新时间'
|
|
265
|
+
}, {
|
|
266
|
+
label: 'updater(更新人)',
|
|
267
|
+
value: 'updater',
|
|
268
|
+
text: '更新人'
|
|
269
|
+
}, {
|
|
270
|
+
label: 'deleted(是否删除)',
|
|
271
|
+
value: 'deleted',
|
|
272
|
+
text: '是否删除'
|
|
273
|
+
}, {
|
|
274
|
+
label: 'tenant_id(租户编号)',
|
|
275
|
+
value: 'tenant_id',
|
|
276
|
+
text: '租户编号'
|
|
277
|
+
}]
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
watch: {
|
|
281
|
+
controlRecords: {
|
|
282
|
+
handler(nVal, oVal) {
|
|
283
|
+
if (nVal && nVal.length > 0) {
|
|
284
|
+
nVal.map((item, i) => item.orderNum = i + 1)
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
deep: true,
|
|
288
|
+
immediate: true
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
computed: {
|
|
292
|
+
addControlMaxLength() {
|
|
293
|
+
return this.controlRecords.length + 1
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
methods: {
|
|
297
|
+
showModal(record) {
|
|
298
|
+
this.init()
|
|
299
|
+
this.currentDataSource = record
|
|
300
|
+
this.reloadAll()
|
|
301
|
+
this.initFieldOptions();
|
|
302
|
+
this.dialogVisible = true
|
|
303
|
+
},
|
|
304
|
+
init() {
|
|
305
|
+
this.currentView = {id: 'default', viewName: '默认视图'}
|
|
306
|
+
this.cancelInsertControlRow()
|
|
307
|
+
},
|
|
308
|
+
//刷新
|
|
309
|
+
reloadAll() {
|
|
310
|
+
this.showViewInfo()
|
|
311
|
+
this.showControlInfo(this.currentView)
|
|
312
|
+
},
|
|
313
|
+
//添加视图
|
|
314
|
+
addView() {
|
|
315
|
+
Vue.delete(this.addNewViewForm, 'id')
|
|
316
|
+
this.addViewDialogVisible = true
|
|
317
|
+
},
|
|
318
|
+
//修改视图
|
|
319
|
+
updateView(item) {
|
|
320
|
+
this.addNewViewForm = Object.assign({}, item)
|
|
321
|
+
this.addViewDialogVisible = true
|
|
322
|
+
},
|
|
323
|
+
//保存新增的视图
|
|
324
|
+
saveNewView() {
|
|
325
|
+
this.$refs.addNewViewFormRef.validate((valid) => {
|
|
326
|
+
if (valid) {
|
|
327
|
+
ds.addViewModel({
|
|
328
|
+
dataSourceId: this.currentDataSource.id,
|
|
329
|
+
viewInfos: [this.addNewViewForm]
|
|
330
|
+
}).then(res => {
|
|
331
|
+
if (res.success) {
|
|
332
|
+
this.$message.success("保存成功")
|
|
333
|
+
this.showViewInfo()
|
|
334
|
+
this.addNewViewForm = {}
|
|
335
|
+
this.addViewDialogVisible = false
|
|
336
|
+
} else {
|
|
337
|
+
this.$message.warning(res.msg)
|
|
338
|
+
}
|
|
339
|
+
})
|
|
340
|
+
|
|
341
|
+
} else {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
})
|
|
345
|
+
},
|
|
346
|
+
deleteView(item) {
|
|
347
|
+
ds.deleteViewModel({id: item.id}).then(res => {
|
|
348
|
+
this.$message.success(res.msg)
|
|
349
|
+
this.showViewInfo()
|
|
350
|
+
})
|
|
351
|
+
},
|
|
352
|
+
//查询视图列表
|
|
353
|
+
showViewInfo() {
|
|
354
|
+
ds.controlInfoViewList({dataSourceId: this.currentDataSource.id}).then(res => {
|
|
355
|
+
if (res.success) {
|
|
356
|
+
this.viewRecord = res.data.map(item => {
|
|
357
|
+
return {
|
|
358
|
+
...item,
|
|
359
|
+
shadow: 'hover'
|
|
360
|
+
}
|
|
361
|
+
})
|
|
362
|
+
this.viewRecord.unshift({
|
|
363
|
+
id: 'default',
|
|
364
|
+
viewName: '默认视图',
|
|
365
|
+
viewGroup: 'default',
|
|
366
|
+
notDelete: true,
|
|
367
|
+
shadow: 'always'
|
|
368
|
+
})
|
|
369
|
+
this.changeViewShadow(this.currentView)
|
|
370
|
+
} else {
|
|
371
|
+
this.$message.warning(res.msg)
|
|
372
|
+
}
|
|
373
|
+
})
|
|
374
|
+
},
|
|
375
|
+
//查询选中的视图控件列表信息
|
|
376
|
+
showControlInfo(view) {
|
|
377
|
+
this.controlRecords.splice(0, this.controlRecords.length)
|
|
378
|
+
if (view.id) {
|
|
379
|
+
this.loading = true
|
|
380
|
+
ds.listControlInfo({dataSourceId: this.currentDataSource.id, viewId: view.id}).then(res => {
|
|
381
|
+
if (res.success) {
|
|
382
|
+
res.data.map(t => {
|
|
383
|
+
this.controlRecords.push(t)
|
|
384
|
+
})
|
|
385
|
+
} else {
|
|
386
|
+
this.$message.warning(res.msg)
|
|
387
|
+
}
|
|
388
|
+
}).finally(() => {
|
|
389
|
+
this.loading = false
|
|
390
|
+
})
|
|
391
|
+
} else {
|
|
392
|
+
this.$message.warning('请先保存视图')
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
//点击视图card
|
|
396
|
+
clickViewName(currentView) {
|
|
397
|
+
this.changeViewShadow(currentView)
|
|
398
|
+
if (this.currentView.id != currentView.id) {
|
|
399
|
+
this.showControlInfo(currentView)
|
|
400
|
+
this.currentView = currentView
|
|
401
|
+
} else {//获取当前视图ID
|
|
402
|
+
this.$message.success(currentView.id)
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
//切换视图
|
|
406
|
+
changeViewShadow(currentView) {
|
|
407
|
+
this.viewRecord = this.viewRecord.map(item => {
|
|
408
|
+
if (item.id == currentView.id) {
|
|
409
|
+
return {
|
|
410
|
+
...item,
|
|
411
|
+
shadow: 'always'
|
|
412
|
+
}
|
|
413
|
+
} else {
|
|
414
|
+
return {
|
|
415
|
+
...item,
|
|
416
|
+
shadow: 'hover'
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
})
|
|
420
|
+
},
|
|
421
|
+
//控件信息移动
|
|
422
|
+
handleBlurOrderNum(record) {
|
|
423
|
+
if (this.controlRecords.length > 0) {
|
|
424
|
+
let current = this.controlRecords.find(item => item.id == record.id)
|
|
425
|
+
let currentIndex = this.controlRecords.findIndex(item => item.id == record.id);
|
|
426
|
+
let newIndex = parseInt(record.orderNum);
|
|
427
|
+
this.controlRecords.splice(currentIndex, 1)
|
|
428
|
+
if (newIndex > this.controlRecords.length) {
|
|
429
|
+
this.controlRecords.push(current)
|
|
430
|
+
} else {
|
|
431
|
+
this.controlRecords.splice((newIndex <= 0 ? 1 : newIndex) - 1, 0, current)
|
|
432
|
+
}
|
|
433
|
+
this.orderControlRecords()
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
//控件排序
|
|
437
|
+
orderControlRecords() {
|
|
438
|
+
this.controlRecords = this.controlRecords.map((item, index) => {
|
|
439
|
+
return {
|
|
440
|
+
...item,
|
|
441
|
+
orderNum: index + 1
|
|
442
|
+
}
|
|
443
|
+
})
|
|
444
|
+
},
|
|
445
|
+
//初始化虚拟列下拉列表
|
|
446
|
+
async initFieldOptions() {
|
|
447
|
+
const res = await ds.listFieldInfo({dataSourceId: this.currentDataSource.id})
|
|
448
|
+
if (res.success) {
|
|
449
|
+
this.tableColumns.map(columns => {
|
|
450
|
+
if (columns.prop === 'controlName') {
|
|
451
|
+
columns.children.options = res.data.map(item => {
|
|
452
|
+
return {
|
|
453
|
+
label: `${item.fieldName}(${item.remark})`,
|
|
454
|
+
value: item.fieldName,
|
|
455
|
+
text: item.remark
|
|
456
|
+
}
|
|
457
|
+
}).concat(this.originalColumns)
|
|
458
|
+
}
|
|
459
|
+
})
|
|
460
|
+
|
|
461
|
+
this.controlColumns.controlName = res.data.map(item => {
|
|
462
|
+
return {
|
|
463
|
+
label: `${item.fieldName}(${item.remark})`,
|
|
464
|
+
value: item.fieldName,
|
|
465
|
+
text: item.remark
|
|
466
|
+
}
|
|
467
|
+
}).concat(this.originalColumns)
|
|
468
|
+
} else {
|
|
469
|
+
this.$message.error(res.msg)
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
//添加控件属性
|
|
473
|
+
addControl(command) {
|
|
474
|
+
if (command > this.addControlMaxLength) {
|
|
475
|
+
command = this.addControlMaxLength
|
|
476
|
+
}
|
|
477
|
+
this.controlRecords.splice(command - 1, 0, {
|
|
478
|
+
orderNum: command,
|
|
479
|
+
isVirtual: true,
|
|
480
|
+
isRequired: false,
|
|
481
|
+
isQuery: false,
|
|
482
|
+
isAccurateQuery: false,
|
|
483
|
+
isInput: false,
|
|
484
|
+
isShow: true
|
|
485
|
+
})
|
|
486
|
+
this.orderControlRecords()
|
|
487
|
+
this.cancelInsertControlRow()
|
|
488
|
+
},
|
|
489
|
+
handleChange(col, val, row, index) {
|
|
490
|
+
if (col.prop === 'controlName') {
|
|
491
|
+
let selectObj = this.controlColumns.controlName.filter(item => item.value === val);
|
|
492
|
+
row.label = selectObj && selectObj[0] ? selectObj[0].text : val
|
|
493
|
+
row.fieldInfo = selectObj && selectObj[0] ? selectObj[0].value : val
|
|
494
|
+
}
|
|
495
|
+
this.checkControleInfo([row])
|
|
496
|
+
},
|
|
497
|
+
|
|
498
|
+
//点击插入按钮
|
|
499
|
+
clickInsertControlButton() {
|
|
500
|
+
this.changeAddControlFlag = false;
|
|
501
|
+
this.$nextTick(() => {
|
|
502
|
+
this.$refs.insertControlInput.focus();
|
|
503
|
+
})
|
|
504
|
+
},
|
|
505
|
+
//取消插入输入框
|
|
506
|
+
cancelInsertControlRow() {
|
|
507
|
+
this.changeAddControlFlag = true;
|
|
508
|
+
this.insertControlRow = null
|
|
509
|
+
},
|
|
510
|
+
//检查table中填写的数据
|
|
511
|
+
checkControleInfo(records) {
|
|
512
|
+
let result = true;
|
|
513
|
+
records.forEach((item, index) => {
|
|
514
|
+
for (const rule in this.controlRules) {
|
|
515
|
+
if (!item[rule]) {
|
|
516
|
+
result = false;
|
|
517
|
+
this.$set(records[index], `${rule}Error`, true)
|
|
518
|
+
} else {
|
|
519
|
+
this.$set(records[index], `${rule}Error`, false)
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
})
|
|
523
|
+
//判断是否添加了重复字段
|
|
524
|
+
if (records.length == 1 && this.controlRecords.length > 1) {
|
|
525
|
+
let double = this.controlRecords.filter(t => t.controlName == records[0].controlName);
|
|
526
|
+
if (double.length > 1) {
|
|
527
|
+
result = false;
|
|
528
|
+
this.$set(records[0], 'controlNameError', true)
|
|
529
|
+
} else {
|
|
530
|
+
this.$set(records[0], 'controlNameError', false)
|
|
531
|
+
}
|
|
532
|
+
} else if (records.length > 1 && this.controlRecords.length > 1) {
|
|
533
|
+
let i = 0
|
|
534
|
+
const pre = this.controlRecords.reduce((pre, cur) => {
|
|
535
|
+
if (pre[cur.controlName]) {
|
|
536
|
+
pre[cur.controlName].push(i)
|
|
537
|
+
} else {
|
|
538
|
+
pre[cur.controlName] = [i]
|
|
539
|
+
}
|
|
540
|
+
i++;
|
|
541
|
+
return pre
|
|
542
|
+
}, {})
|
|
543
|
+
for (let t in pre) {
|
|
544
|
+
if (pre[t].length > 1) {
|
|
545
|
+
result = false;
|
|
546
|
+
pre[t].forEach(k => {
|
|
547
|
+
this.$set(records[k], 'controlNameError', true)
|
|
548
|
+
})
|
|
549
|
+
} else {
|
|
550
|
+
this.$set(records[pre[t][0]], 'controlNameError', false)
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
return result;
|
|
555
|
+
},
|
|
556
|
+
//保存控件信息
|
|
557
|
+
saveControlInfo() {
|
|
558
|
+
//检查表单
|
|
559
|
+
if (this.controlRecords.length == 0) {
|
|
560
|
+
return
|
|
561
|
+
}
|
|
562
|
+
let check = this.checkControleInfo(this.controlRecords)
|
|
563
|
+
if (!check) {
|
|
564
|
+
this.$message.error("请检查必填项")
|
|
565
|
+
} else {
|
|
566
|
+
this.loading = true;
|
|
567
|
+
ds.saveControlModel({
|
|
568
|
+
dataSourceId: this.currentDataSource.id,
|
|
569
|
+
viewId: this.currentView.id,
|
|
570
|
+
controlInfos: this.controlRecords
|
|
571
|
+
}).then(res => {
|
|
572
|
+
if (res.success) {
|
|
573
|
+
this.showControlInfo(this.currentView)
|
|
574
|
+
this.$message.success(res.msg)
|
|
575
|
+
} else {
|
|
576
|
+
this.$message.error(res.msg)
|
|
577
|
+
}
|
|
578
|
+
}).finally(() => {
|
|
579
|
+
this.loading = false;
|
|
580
|
+
})
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
//删除控件信息
|
|
584
|
+
deleteControlInfo(record) {
|
|
585
|
+
let currentIndex = this.controlRecords.findIndex(item => item.orderNum == record.orderNum);
|
|
586
|
+
this.controlRecords.splice(currentIndex, 1)
|
|
587
|
+
if (record.id) {
|
|
588
|
+
this.loading = true;
|
|
589
|
+
ds.deleteControlInfo({id: record.id}).then(res => {
|
|
590
|
+
this.$message.success(res.msg)
|
|
591
|
+
}).finally(() => {
|
|
592
|
+
this.loading = false;
|
|
593
|
+
})
|
|
594
|
+
}
|
|
595
|
+
this.orderControlRecords()
|
|
596
|
+
},
|
|
597
|
+
//控件信息查询属性
|
|
598
|
+
addControlProps(record) {
|
|
599
|
+
let check = this.checkControleInfo([record]);
|
|
600
|
+
if (!check) {
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
if (!record.id) {
|
|
604
|
+
let currentIndex = this.controlRecords.findIndex(item => item.orderNum == record.orderNum);
|
|
605
|
+
this.loading = true;
|
|
606
|
+
ds.saveControlModel({
|
|
607
|
+
dataSourceId: this.currentDataSource.id,
|
|
608
|
+
viewId: this.currentView.id,
|
|
609
|
+
controlInfos: [record]
|
|
610
|
+
}).then(res => {
|
|
611
|
+
if (res.success) {
|
|
612
|
+
this.controlRecords.splice(currentIndex, 1, res.data[0])
|
|
613
|
+
this.openControlProps(res.data[0])
|
|
614
|
+
} else {
|
|
615
|
+
this.$message.error(res.msg)
|
|
616
|
+
}
|
|
617
|
+
}).finally(() => {
|
|
618
|
+
this.loading = false;
|
|
619
|
+
})
|
|
620
|
+
} else {
|
|
621
|
+
this.openControlProps(record)
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
//打开属性框
|
|
625
|
+
openControlProps(currentRow) {
|
|
626
|
+
this.$refs.controlProps.showModal(currentRow)
|
|
627
|
+
},
|
|
628
|
+
pullControl() {
|
|
629
|
+
const arr = ['id', 'creator', 'createTime', 'updater', 'updateTime', 'deleted', 'tenantId', 'orgCode', 'orgId']
|
|
630
|
+
for (let field of this.controlColumns.controlName) {
|
|
631
|
+
let exist = false
|
|
632
|
+
for (let control of this.controlRecords) {
|
|
633
|
+
if (control.fieldInfo == field.value) {
|
|
634
|
+
exist = true
|
|
635
|
+
break
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
if (exist) {
|
|
639
|
+
continue
|
|
640
|
+
}
|
|
641
|
+
let controlType = 'input'
|
|
642
|
+
if (arr.indexOf(field.value) === -1) {
|
|
643
|
+
this.controlRecords.push({
|
|
644
|
+
fieldInfo: field.value,
|
|
645
|
+
controlName: field.value,
|
|
646
|
+
controlType: controlType,
|
|
647
|
+
label: field.text,
|
|
648
|
+
isVirtual: true,
|
|
649
|
+
isRequired: false,
|
|
650
|
+
isQuery: true,
|
|
651
|
+
isAccurateQuery: false,
|
|
652
|
+
isInput: false,
|
|
653
|
+
isShow: true,
|
|
654
|
+
orderNum: this.controlRecords.length + 1
|
|
655
|
+
})
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
copyViewOpenDialog() {
|
|
660
|
+
this.copyViewTitle = "复制视图-" + this.currentView.viewName;
|
|
661
|
+
this.copyViewDialogVisible = true;
|
|
662
|
+
this.copyNewViewForm = this.currentView;
|
|
663
|
+
},
|
|
664
|
+
copyCurrentView() {
|
|
665
|
+
this.$refs.copyNewViewFormRef.validate((valid) => {
|
|
666
|
+
if (valid) {
|
|
667
|
+
ds.copyViewModel({
|
|
668
|
+
dataSourceId: this.currentDataSource.id,
|
|
669
|
+
viewInfos: [this.copyNewViewForm]
|
|
670
|
+
}).then(res => {
|
|
671
|
+
if (res.success) {
|
|
672
|
+
this.$message.success("复制成功")
|
|
673
|
+
this.showViewInfo()
|
|
674
|
+
this.copyNewViewForm = {}
|
|
675
|
+
this.copyViewDialogVisible = false
|
|
676
|
+
} else {
|
|
677
|
+
this.$message.warning(res.msg)
|
|
678
|
+
}
|
|
679
|
+
})
|
|
680
|
+
} else {
|
|
681
|
+
return false;
|
|
682
|
+
}
|
|
683
|
+
})
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
</script>
|
|
688
|
+
|
|
689
|
+
<style lang="scss" scoped>
|
|
690
|
+
.cardview {
|
|
691
|
+
display: flex;
|
|
692
|
+
justify-content: space-between;
|
|
693
|
+
align-items: center;
|
|
694
|
+
|
|
695
|
+
.tab {
|
|
696
|
+
display: flex;
|
|
697
|
+
justify-content: flex-end;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.float-right-class {
|
|
703
|
+
float: right
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.border-shadow {
|
|
707
|
+
min-height: 400px;
|
|
708
|
+
border: 1px solid #dcdfe6;
|
|
709
|
+
border-radius: 4px;
|
|
710
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.el-button--small {
|
|
714
|
+
padding: 3px 0px;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.view-list-card.is-always-shadow {
|
|
718
|
+
background-color: rgb(225, 243, 216);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.pages :deep(.el-dialog) {
|
|
722
|
+
max-width: 100% !important;
|
|
723
|
+
max-height: 100% !important;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.el-dropdown-link {
|
|
727
|
+
color: #409EFF;
|
|
728
|
+
cursor: pointer;
|
|
729
|
+
font-size: 12px;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.is-error {
|
|
733
|
+
:deep(.el-input__inner) {
|
|
734
|
+
border-color: red;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
</style>
|