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,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ed-dialog ref="TemplatePreview" v-loading="loading" :destroy-on-close="true" :fullscreen="true" :title="title"
|
|
3
|
+
:visible="visible"
|
|
4
|
+
@close="close">
|
|
5
|
+
<el-form v-if="showBizParams" ref="form" label-width="80px" size="mini">
|
|
6
|
+
<el-form-item v-for="(bizParam, index) in bizParamMaps" :key="index" :label="bizParam.label">
|
|
7
|
+
<el-input v-model="bizParam.value" @change="onChange"/>
|
|
8
|
+
</el-form-item>
|
|
9
|
+
<el-form-item>
|
|
10
|
+
<el-button type="primary" @click="onSubmit">查询</el-button>
|
|
11
|
+
<el-button @click="onReset">重置</el-button>
|
|
12
|
+
</el-form-item>
|
|
13
|
+
</el-form>
|
|
14
|
+
<easy-data-template v-if="visible" ref="TemplateView" :bizParams="bizParams" :templateConfig="config" ></easy-data-template>
|
|
15
|
+
</ed-dialog>
|
|
16
|
+
</template>
|
|
17
|
+
<script>
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: "TemplatePreview2",
|
|
21
|
+
props: {
|
|
22
|
+
showBizParams: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
title: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ''
|
|
29
|
+
},
|
|
30
|
+
bizParamStr: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ''
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
watch:{
|
|
36
|
+
bizParamStr: {
|
|
37
|
+
immediate: true,
|
|
38
|
+
handler: function (newVal, oldVal) {
|
|
39
|
+
if (newVal && newVal !== oldVal) {
|
|
40
|
+
const temp = newVal.split(",")
|
|
41
|
+
this.bizParamMaps = []
|
|
42
|
+
temp.map(i=>this.bizParamMaps.push({label: i, value: ""}))
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
visible: false,
|
|
50
|
+
loading: false,
|
|
51
|
+
url: {
|
|
52
|
+
getTemplate: '/easydata/template/getModule'
|
|
53
|
+
},
|
|
54
|
+
templateId: null,
|
|
55
|
+
config: {},
|
|
56
|
+
bizParams: {},
|
|
57
|
+
bizParamMaps: []
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
/**
|
|
62
|
+
* 根据模版编号查询加载
|
|
63
|
+
* @param {*} templateId
|
|
64
|
+
* @param config
|
|
65
|
+
*/
|
|
66
|
+
showModal(config) {
|
|
67
|
+
this.config = config
|
|
68
|
+
this.visible = true;
|
|
69
|
+
},
|
|
70
|
+
onChange() {
|
|
71
|
+
|
|
72
|
+
},
|
|
73
|
+
onSubmit() {
|
|
74
|
+
this.bizParamMaps.map(item => {
|
|
75
|
+
this.$set(this.bizParams, item.label, item.value)
|
|
76
|
+
})
|
|
77
|
+
},
|
|
78
|
+
onReset() {
|
|
79
|
+
this.bizParamMaps.map(item => {
|
|
80
|
+
item.value = ""
|
|
81
|
+
})
|
|
82
|
+
},
|
|
83
|
+
close() {
|
|
84
|
+
this.visible = false
|
|
85
|
+
this.bizParams = {}
|
|
86
|
+
this.bizParamMaps = []
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<style scoped>
|
|
93
|
+
.my-label {
|
|
94
|
+
background: #E1F3D8;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.pages :deep(.el-dialog) {
|
|
98
|
+
max-width: 95% !important;
|
|
99
|
+
max-height: 98% !important;
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
methods: {
|
|
5
|
+
/**
|
|
6
|
+
* 点击动态模版操作右侧属性
|
|
7
|
+
* @param {*} command
|
|
8
|
+
*/
|
|
9
|
+
async updateRightProp(command) {
|
|
10
|
+
this.propActiveName = command;
|
|
11
|
+
await this.recordRightProp()
|
|
12
|
+
//获取参数属性
|
|
13
|
+
let module
|
|
14
|
+
if ('oneProp' === command) {
|
|
15
|
+
module = this.oneModules[this.oneModuleActive]
|
|
16
|
+
} else if ('twoProp' === command) {
|
|
17
|
+
let twoModules = this.oneModules[this.oneModuleActive]?.twoModules;
|
|
18
|
+
module = twoModules[this.twoModuleActive]
|
|
19
|
+
}
|
|
20
|
+
if (module) {
|
|
21
|
+
this.$set(this[command], 'formData', Object.assign({ id: module.id }, { key: module.prop? module.prop : {}}))
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
//记录右侧模块属性
|
|
25
|
+
async recordRightProp() {
|
|
26
|
+
let {GlobalPropEasyDataList, OnePropEasyDataList, TwoPropEasyDataList } = this.$refs;
|
|
27
|
+
//记录全局模块属性
|
|
28
|
+
if(GlobalPropEasyDataList) {
|
|
29
|
+
let oldGlobalModuleProp = await GlobalPropEasyDataList.getFormData();
|
|
30
|
+
if (oldGlobalModuleProp.key && this.templateModel) {
|
|
31
|
+
this.$set(this.templateModel, 'prop', oldGlobalModuleProp.key)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//记录历史一级模块属性
|
|
35
|
+
if (OnePropEasyDataList) {
|
|
36
|
+
let oldOneModuleProp = await OnePropEasyDataList.getFormData();
|
|
37
|
+
if (oldOneModuleProp.id) {
|
|
38
|
+
let oldOneModuleIndex = this.oneModules.findIndex(t => t.id === oldOneModuleProp.id);
|
|
39
|
+
let oldOneModule = this.oneModules.find(t => t.id === oldOneModuleProp.id);
|
|
40
|
+
if (oldOneModule) {
|
|
41
|
+
let temp = Object.assign({}, oldOneModule)
|
|
42
|
+
temp.prop = Object.assign({},oldOneModuleProp.key)
|
|
43
|
+
this.oneModules.splice(oldOneModuleIndex, 1, temp)
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//记录历史二级模块属性
|
|
49
|
+
if (TwoPropEasyDataList) {
|
|
50
|
+
let oldTwoModuleProp = await TwoPropEasyDataList.getFormData();
|
|
51
|
+
let twoModules = this.oneModules[this.oneModuleActive]?.twoModules;
|
|
52
|
+
if (oldTwoModuleProp.id && twoModules) {
|
|
53
|
+
let oldTwoModuleIndex = twoModules.findIndex(t => t.id === oldTwoModuleProp.id);
|
|
54
|
+
let oldTwoModule = twoModules.find(t => t.id === oldTwoModuleProp.id);
|
|
55
|
+
if (oldTwoModule) {
|
|
56
|
+
oldTwoModule.prop = oldTwoModuleProp.key
|
|
57
|
+
twoModules.splice(oldTwoModuleIndex, 1, oldTwoModule)
|
|
58
|
+
this.$set(this.oneModules[this.oneModuleActive], 'twoModules', twoModules)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<easy-data-list ref="EasyDataList" :dataSourceName="dataSourceName" :formProps="formProps" :tableProps="{operateFixed: 'right', operateWidth: 280}">
|
|
4
|
+
<template v-slot:extra>
|
|
5
|
+
<el-upload :file-list="fileList" :http-request="handlerImport" :limit="1" :multiple="false"
|
|
6
|
+
:show-file-list="false" action="" style="display: inline-block;margin: 0px 10px">
|
|
7
|
+
<el-button :loading="operLoading" icon="el-icon-upload2" plain size="mini" type="primary">导入</el-button>
|
|
8
|
+
</el-upload>
|
|
9
|
+
</template>
|
|
10
|
+
<template #tableSlot="{ row }">
|
|
11
|
+
<div class="operation" data-width="180">
|
|
12
|
+
<el-button size="mini" type="text" @click="handlerEdit(row)">编辑</el-button>
|
|
13
|
+
<el-divider direction='vertical'/>
|
|
14
|
+
<el-button size="mini" type="text" @click="handlerDesigner(row)">定义</el-button>
|
|
15
|
+
<el-divider direction='vertical'/>
|
|
16
|
+
<el-button size="mini" type="text" @click="handlerPreview(row)">预览</el-button>
|
|
17
|
+
<el-divider direction='vertical'/>
|
|
18
|
+
<el-dropdown trigger="click">
|
|
19
|
+
<span class="el-dropdown-link">
|
|
20
|
+
更多<i class="el-icon-arrow-down el-icon--right"></i>
|
|
21
|
+
</span>
|
|
22
|
+
<el-dropdown-menu slot="dropdown">
|
|
23
|
+
<el-dropdown-item @click.native="handlerCopy(row)">复制</el-dropdown-item>
|
|
24
|
+
<el-dropdown-item @click.native="handlerExport(row)">导出</el-dropdown-item>
|
|
25
|
+
</el-dropdown-menu>
|
|
26
|
+
</el-dropdown>
|
|
27
|
+
<el-divider direction='vertical'/>
|
|
28
|
+
<el-popconfirm title="确定删除数据吗?" @confirm="handlerDelete(row.id)">
|
|
29
|
+
<el-button slot="reference" size="mini" style="color: red" type="text">删除</el-button>
|
|
30
|
+
</el-popconfirm>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
</easy-data-list>
|
|
34
|
+
<DefineModal ref="DefineModal"></DefineModal>
|
|
35
|
+
<TemplatePreview ref="TemplatePreview" :title="previewTitle"></TemplatePreview>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import DefineModal from "./components/DefineModal";
|
|
41
|
+
import TemplatePreview from "./components/TemplatePreview";
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: "TemplateList",
|
|
45
|
+
components: {DefineModal, TemplatePreview},
|
|
46
|
+
data() {
|
|
47
|
+
return {
|
|
48
|
+
dataSourceName: 'easy_template_info',
|
|
49
|
+
actionProps: {showAddBtn: true, showExportBtn: false},
|
|
50
|
+
previewTitle: '',
|
|
51
|
+
fileList: [],
|
|
52
|
+
operLoading: false,
|
|
53
|
+
url: {
|
|
54
|
+
copyTemplate: "/easydata/template/copyTemplate",
|
|
55
|
+
exportTemplate: '/easydata/template/exportTemplate',
|
|
56
|
+
importTemplate: '/easydata/template/importTemplate'
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
handlerPreview(record) {
|
|
62
|
+
this.previewTitle = record.keyInfoObject.template_name + ' -预览'
|
|
63
|
+
this.$refs.TemplatePreview.showModal(record.id)
|
|
64
|
+
},
|
|
65
|
+
handlerDesigner(record) {
|
|
66
|
+
this.$refs.DefineModal.showModal(record)
|
|
67
|
+
},
|
|
68
|
+
handlerEdit(record) {
|
|
69
|
+
this.$refs.EasyDataList.handlerEdit(record)
|
|
70
|
+
},
|
|
71
|
+
handlerDelete(record) {
|
|
72
|
+
this.$refs.EasyDataList.handlerDelete(record)
|
|
73
|
+
},
|
|
74
|
+
handlerCopy(record) {
|
|
75
|
+
this.$EdFrame.getAction(this.url.copyTemplate, {templateId: record.id}).then(res => {
|
|
76
|
+
if (res && res.success) {
|
|
77
|
+
this.$message.success(res.msg)
|
|
78
|
+
this.$refs.EasyDataList.searchQuery()
|
|
79
|
+
} else {
|
|
80
|
+
this.$message.error(res.msg)
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
},
|
|
84
|
+
handlerExport(record) {
|
|
85
|
+
this.$EdFrame.getAction(this.url.exportTemplate, {templateId: record.id}).then((resp) => {
|
|
86
|
+
if (resp.success) {
|
|
87
|
+
let blob = new Blob([JSON.stringify(resp.data)], {
|
|
88
|
+
type: 'text/plain'
|
|
89
|
+
})
|
|
90
|
+
console.log(blob)
|
|
91
|
+
let fileName = record.keyInfoObject.template_name + '.tex'
|
|
92
|
+
if (window.navigator.msSaveOrOpenBlob) {
|
|
93
|
+
navigator.msSaveBlob(blob, fileName)
|
|
94
|
+
} else {
|
|
95
|
+
var link = document.createElement('a')
|
|
96
|
+
link.href = window.URL.createObjectURL(blob)
|
|
97
|
+
link.download = fileName
|
|
98
|
+
link.click()
|
|
99
|
+
//释放内存
|
|
100
|
+
window.URL.revokeObjectURL(link.href)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}).finally(() => {
|
|
104
|
+
this.$refs.EasyDataList.initLoading = false
|
|
105
|
+
})
|
|
106
|
+
},
|
|
107
|
+
handlerImport(param) {
|
|
108
|
+
let reader = new FileReader(); //新建一个FileReader
|
|
109
|
+
reader.readAsText(param.file, "UTF-8"); //读取文件
|
|
110
|
+
reader.onload = (evt) => { //读取完文件之后会回来这里
|
|
111
|
+
this.operLoading = true;
|
|
112
|
+
let fileString = evt.target.result; // 读取文件内容
|
|
113
|
+
this.$EdFrame.postAction(this.url.importTemplate, fileString).then((resp) => {
|
|
114
|
+
this.$message.success(resp.data || "操作成功!")
|
|
115
|
+
this.fileList = []
|
|
116
|
+
this.loadData()
|
|
117
|
+
}).finally(() => {
|
|
118
|
+
this.operLoading = false;
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</script>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export {default as DataSourceChoose} from './src/DataSourceChoose'
|
|
2
|
+
export {default as DataSourceViewIdChoose} from './src/DataSourceViewIdChoose'
|
|
3
|
+
export {default as UserChoose} from './src/UserChoose'
|
|
4
|
+
export {default as OrgChoose} from './src/OrgChoose'
|
|
5
|
+
export {default as DictChoose} from './src/DictChoose'
|
|
6
|
+
export {default as InterfaceChoose} from './src/InterfaceChoose'
|
|
7
|
+
export {default as RoleChoose} from './src/RoleChoose'
|
|
8
|
+
export {default as TemplateChoose} from './src/TemplateChoose'
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DataSourceList ref="DataSource" :columns="columns" :is-choose-model="true"
|
|
3
|
+
@handleCurrentChange="handleCurrentChange"/>
|
|
4
|
+
</template>
|
|
5
|
+
|
|
6
|
+
<script>
|
|
7
|
+
import DataSourceList from '../../pages/DataSource'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: 'DataSourceChoose',
|
|
11
|
+
components: {
|
|
12
|
+
DataSourceList
|
|
13
|
+
},
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
currentVal: {},
|
|
17
|
+
columns: [
|
|
18
|
+
{
|
|
19
|
+
label: '数据源名称',
|
|
20
|
+
prop: 'dataSourceName',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: '分类',
|
|
24
|
+
prop: 'classify',
|
|
25
|
+
formatter: this.classifyFmt
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: '数据源备注',
|
|
29
|
+
prop: 'remark',
|
|
30
|
+
}]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
handleCurrentChange(val) {
|
|
35
|
+
this.currentVal = val
|
|
36
|
+
},
|
|
37
|
+
getData() {
|
|
38
|
+
if (this.currentVal) {
|
|
39
|
+
return {label: this.currentVal.remark, value: this.currentVal.dataSourceName}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ed-table :columns="columns" :loading="loading" :data="tableData" border
|
|
3
|
+
@current-change="handleCurrentChange">
|
|
4
|
+
</ed-table>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
import { getVarType } from "../../utils/utils";
|
|
8
|
+
import { controlInfoViewList } from '../../api/ds'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'DataSourceViewIdChoose',
|
|
12
|
+
data() {
|
|
13
|
+
return {
|
|
14
|
+
loading: false,
|
|
15
|
+
dataSourceName: '',
|
|
16
|
+
url: "/easydata/controlInfo/viewList",
|
|
17
|
+
tableData: [],
|
|
18
|
+
currentData: {}, //选中的数据
|
|
19
|
+
columns: [{
|
|
20
|
+
label: '视图名称',
|
|
21
|
+
prop: 'viewName'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: '视图ID',
|
|
25
|
+
prop: 'id'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: '分组名称',
|
|
29
|
+
prop: 'viewGroup'
|
|
30
|
+
},]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
getData() {
|
|
35
|
+
return { label: this.currentData.viewName, value: this.currentData.id }
|
|
36
|
+
},
|
|
37
|
+
loadData(params) {
|
|
38
|
+
if (params) {
|
|
39
|
+
if (getVarType(params.dataSourceName) === 'object') {
|
|
40
|
+
this.dataSourceName = params.dataSourceName.value
|
|
41
|
+
} else {
|
|
42
|
+
this.dataSourceName = params.dataSourceName
|
|
43
|
+
}
|
|
44
|
+
if (getVarType(this.dataSourceName) != 'string') {
|
|
45
|
+
this.$message.error('数据源名称不允许为空')
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
controlInfoViewList({ data_source_name: this.dataSourceName }).then(res => {
|
|
49
|
+
if (res.success) {
|
|
50
|
+
this.tableData = res.data ? res.data : []
|
|
51
|
+
this.tableData.unshift({
|
|
52
|
+
id: 'default',
|
|
53
|
+
viewName: '默认视图',
|
|
54
|
+
viewGroup: 'default'
|
|
55
|
+
})
|
|
56
|
+
} else {
|
|
57
|
+
this.$message.warning(res.msg)
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
handleCurrentChange(row) {
|
|
63
|
+
this.currentData = row
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-form ref="searchForm" :inline="true" :model="searchForm" class="demo-form-inline">
|
|
4
|
+
<el-form-item label="字典编号" prop="dataSourceName">
|
|
5
|
+
<el-input v-model="searchForm.type" placeholder="字典编号"></el-input>
|
|
6
|
+
</el-form-item>
|
|
7
|
+
<el-form-item>
|
|
8
|
+
<el-button type="primary" @click="loadData">查询</el-button>
|
|
9
|
+
</el-form-item>
|
|
10
|
+
<!-- <el-form-item>-->
|
|
11
|
+
<!-- <el-button @click="resetForm('searchForm')">重置</el-button>-->
|
|
12
|
+
<!-- </el-form-item>-->
|
|
13
|
+
</el-form>
|
|
14
|
+
<el-table
|
|
15
|
+
:data="tableData"
|
|
16
|
+
highlight-current-row @current-change="handleCurrentChange"
|
|
17
|
+
>
|
|
18
|
+
<!-- <el-table-column align="center" label="选择" width="55">-->
|
|
19
|
+
<!-- <template slot-scope="scope">-->
|
|
20
|
+
<!-- <!– 可以手动的修改label的值,从而控制选择哪一项 –>-->
|
|
21
|
+
<!-- <el-radio v-model="selectVal" :label="scope.row.dictType" class="radio"-->
|
|
22
|
+
<!-- > -->
|
|
23
|
+
<!-- </el-radio-->
|
|
24
|
+
<!-- >-->
|
|
25
|
+
<!-- </template>-->
|
|
26
|
+
<!-- </el-table-column>-->
|
|
27
|
+
<el-table-column align="center" label="字段名称" prop="name"></el-table-column>
|
|
28
|
+
<el-table-column align="center" label="字段类型" prop="dictType"></el-table-column>
|
|
29
|
+
<el-table-column align="center" label="状态" prop="usable">
|
|
30
|
+
<template slot-scope="scope">
|
|
31
|
+
<el-tag v-if="scope.row.usable">可用</el-tag>
|
|
32
|
+
<el-tag v-else>禁用</el-tag>
|
|
33
|
+
</template>
|
|
34
|
+
</el-table-column>
|
|
35
|
+
</el-table>
|
|
36
|
+
<div style="float: right">
|
|
37
|
+
<el-pagination
|
|
38
|
+
:page-size="page.pageSize"
|
|
39
|
+
:total="page.total"
|
|
40
|
+
layout="total, prev, pager, next"
|
|
41
|
+
@current-change="currentChange">
|
|
42
|
+
</el-pagination>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import {getDictList} from '../../api/easyData'
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
name: "DictChoose",
|
|
52
|
+
data() {
|
|
53
|
+
return {
|
|
54
|
+
//列表显示数据
|
|
55
|
+
tableData: [],
|
|
56
|
+
//前端分页,这里是所有数据
|
|
57
|
+
tableList: [],
|
|
58
|
+
page: {total: 0, pageSize: 10},
|
|
59
|
+
//选择的数据
|
|
60
|
+
currentRow: {},
|
|
61
|
+
searchForm: {type: ''}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
mounted() {
|
|
65
|
+
this.loadData();
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
loadData() {
|
|
69
|
+
this.tableData = []
|
|
70
|
+
getDictList(this.searchForm).then((resp) => {
|
|
71
|
+
if (resp.data) {
|
|
72
|
+
this.tableList = resp.data
|
|
73
|
+
if (this.tableList.length > 10) {
|
|
74
|
+
this.tableData = this.tableList.slice(0, 10)
|
|
75
|
+
} else {
|
|
76
|
+
this.tableData = this.tableList
|
|
77
|
+
}
|
|
78
|
+
this.page.total = resp.data.length
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
},
|
|
82
|
+
currentChange(val) {
|
|
83
|
+
const index = (val - 1) * 10
|
|
84
|
+
if (this.tableList.length >= val * 10) {
|
|
85
|
+
this.tableData = this.tableList.slice(index, val * 10)
|
|
86
|
+
} else {
|
|
87
|
+
this.tableData = this.tableList.slice(index, this.tableList.length)
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
handleCurrentChange(row) {
|
|
91
|
+
this.currentRow = row
|
|
92
|
+
},
|
|
93
|
+
getData() {
|
|
94
|
+
return {value: this.currentRow.dictType, label: this.currentRow.name}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<style scoped>
|
|
101
|
+
:deep(.el-dialog) {
|
|
102
|
+
height: 85vh;
|
|
103
|
+
}
|
|
104
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<EasyDataList :data-source-name="dataSourceName" :diy-colums="columns"
|
|
4
|
+
:action-props="{showExportBtn:false,showAddBtn:false}"
|
|
5
|
+
:table-props="{isOperate: false}"
|
|
6
|
+
@handleCurrentChange="handleCurrentChange">
|
|
7
|
+
|
|
8
|
+
</EasyDataList>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<script lang="jsx">
|
|
12
|
+
import EasyDataList from "../../packages/EasyDataList/EasyDataList.vue";
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'InterfaceChoose',
|
|
16
|
+
components: {EasyDataList},
|
|
17
|
+
data() {
|
|
18
|
+
return {
|
|
19
|
+
dataSourceName: 'interface_info',
|
|
20
|
+
currentData: {}, //选中的数据
|
|
21
|
+
columns: [
|
|
22
|
+
{
|
|
23
|
+
label: 'Id',
|
|
24
|
+
prop: 'id',
|
|
25
|
+
}, {
|
|
26
|
+
label: '接口名称',
|
|
27
|
+
prop: 'keyInfoObject.api_name',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: '分类',
|
|
31
|
+
prop: 'keyInfoObject.api_group.label',
|
|
32
|
+
formatter: this.classifyFmt
|
|
33
|
+
},
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
getData() {
|
|
39
|
+
return {value: this.currentData.id, label: this.currentData.keyInfoObject.api_name};
|
|
40
|
+
},
|
|
41
|
+
handleCurrentChange(row) {
|
|
42
|
+
this.currentData = row
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-container">
|
|
3
|
+
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" size="small">
|
|
4
|
+
<el-form-item label="部门名称" prop="name">
|
|
5
|
+
<el-input v-model="queryParams.name" clearable placeholder="请输入部门名称" @keyup.enter.native="handleQuery"/>
|
|
6
|
+
</el-form-item>
|
|
7
|
+
<el-form-item>
|
|
8
|
+
<el-button icon="el-icon-search" type="primary" @click="handleQuery">搜索</el-button>
|
|
9
|
+
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
10
|
+
</el-form-item>
|
|
11
|
+
</el-form>
|
|
12
|
+
|
|
13
|
+
<el-table v-if="refreshTable" v-loading="loading" :data="deptList" :default-expand-all="isExpandAll"
|
|
14
|
+
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
15
|
+
highlight-current-row row-key="id"
|
|
16
|
+
style="width: 100%"
|
|
17
|
+
@current-change="handleCurrentChange" @selection-change="handleSelectionChange">
|
|
18
|
+
<el-table-column
|
|
19
|
+
v-if="!isSearchForm&&controlProp.multiple"
|
|
20
|
+
type="selection" width="55">
|
|
21
|
+
</el-table-column>
|
|
22
|
+
<el-table-column label="部门编号" prop="id"></el-table-column>
|
|
23
|
+
<el-table-column label="部门名称" prop="name"></el-table-column>
|
|
24
|
+
<el-table-column :formatter="userNicknameFormat" label="负责人" prop="leader"/>
|
|
25
|
+
</el-table>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
import {listDept, listSimpleUsers} from "../../api/system";
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
name: "OrgChoose",
|
|
34
|
+
props: ['controlProp', 'isSearchForm'],
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
// 遮罩层
|
|
38
|
+
loading: true,
|
|
39
|
+
// 显示搜索条件
|
|
40
|
+
showSearch: true,
|
|
41
|
+
// 表格树数据
|
|
42
|
+
deptList: [],
|
|
43
|
+
// 部门树选项
|
|
44
|
+
deptOptions: [],
|
|
45
|
+
// 用户下拉列表
|
|
46
|
+
users: [],
|
|
47
|
+
// 是否展开,默认全部展开
|
|
48
|
+
isExpandAll: true,
|
|
49
|
+
// 重新渲染表格状态
|
|
50
|
+
refreshTable: true,
|
|
51
|
+
// 是否展开
|
|
52
|
+
expand: false,
|
|
53
|
+
// 查询参数
|
|
54
|
+
queryParams: {
|
|
55
|
+
name: undefined,
|
|
56
|
+
status: undefined
|
|
57
|
+
},
|
|
58
|
+
// 表单参数
|
|
59
|
+
form: {},
|
|
60
|
+
currentRow: {},
|
|
61
|
+
multipleSelection: []
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
created() {
|
|
65
|
+
this.loadData();
|
|
66
|
+
// 获得用户列表
|
|
67
|
+
listSimpleUsers().then(response => {
|
|
68
|
+
this.users = response.data;
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
methods: {
|
|
72
|
+
getData() {
|
|
73
|
+
if (this.controlProp.multiple && !this.isSearchForm) {
|
|
74
|
+
|
|
75
|
+
let data = []
|
|
76
|
+
this.multipleSelection.forEach(item => {
|
|
77
|
+
data.push({value: item.id, label: item.name})
|
|
78
|
+
})
|
|
79
|
+
return data;
|
|
80
|
+
}
|
|
81
|
+
return {value: this.currentRow.id, label: this.currentRow.name}
|
|
82
|
+
},
|
|
83
|
+
handleCurrentChange(row) {
|
|
84
|
+
this.currentRow = row;
|
|
85
|
+
},
|
|
86
|
+
handleSelectionChange(row) {
|
|
87
|
+
this.multipleSelection = row;
|
|
88
|
+
},
|
|
89
|
+
/** 查询部门列表 */
|
|
90
|
+
loadData() {
|
|
91
|
+
this.loading = true;
|
|
92
|
+
listDept(this.queryParams).then(response => {
|
|
93
|
+
this.deptList = this.handleTree(response.data, "id");
|
|
94
|
+
this.loading = false;
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
// 用户昵称展示
|
|
98
|
+
userNicknameFormat(row, column) {
|
|
99
|
+
if (!row.leaderUserId) {
|
|
100
|
+
return '未设置';
|
|
101
|
+
}
|
|
102
|
+
for (const user of this.users) {
|
|
103
|
+
if (row.leaderUserId === user.id) {
|
|
104
|
+
return user.nickname;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return '未知【' + row.leaderUserId + '】';
|
|
108
|
+
},
|
|
109
|
+
/** 搜索按钮操作 */
|
|
110
|
+
handleQuery() {
|
|
111
|
+
this.loadData();
|
|
112
|
+
},
|
|
113
|
+
/** 重置按钮操作 */
|
|
114
|
+
resetQuery() {
|
|
115
|
+
this.$refs['queryForm'].resetFields();
|
|
116
|
+
this.resetForm("queryForm");
|
|
117
|
+
this.handleQuery();
|
|
118
|
+
},
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
</script>
|