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,203 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ed-drawer ref="BasicDrawer" :title="title"
|
|
3
|
+
:visible="visible"
|
|
4
|
+
ok-text="保存并关闭"
|
|
5
|
+
@close="closeDialog"
|
|
6
|
+
@ok="saveMock">
|
|
7
|
+
<el-form :key="dataId" ref="form" :model="form"
|
|
8
|
+
class="demo-form-inline">
|
|
9
|
+
<el-form-item label="是否启用Mock"
|
|
10
|
+
prop="is_mock">
|
|
11
|
+
<el-switch v-model="form.is_mock"></el-switch>
|
|
12
|
+
</el-form-item>
|
|
13
|
+
<el-form-item label="接口请求数据"
|
|
14
|
+
prop="requestData">
|
|
15
|
+
<ed-code-editor :value="form.requestData"
|
|
16
|
+
language="javascript" @input="changeTextReq"></ed-code-editor>
|
|
17
|
+
</el-form-item>
|
|
18
|
+
<el-form-item
|
|
19
|
+
label="接口返回数据" prop="responseData">
|
|
20
|
+
<ed-code-editor ref="codeEditor" :value="form.responseData"
|
|
21
|
+
language="javascript" @input="changeTextResp"></ed-code-editor>
|
|
22
|
+
</el-form-item>
|
|
23
|
+
</el-form>
|
|
24
|
+
</ed-drawer>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
import {getOneData, updateData, insertData} from "../../../../api/easyData";
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
name: "InterfaceMock",
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
dataId: '',
|
|
35
|
+
visible: false,
|
|
36
|
+
title: '',
|
|
37
|
+
row: {},
|
|
38
|
+
form: {requestData: '', responseData: '', is_mock: false},
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
methods: {
|
|
42
|
+
show(row, title) {
|
|
43
|
+
this.row = row
|
|
44
|
+
this.title = title
|
|
45
|
+
this.visible = true
|
|
46
|
+
this.initRequestData()
|
|
47
|
+
},
|
|
48
|
+
changeTextResp(val) {
|
|
49
|
+
this.form.responseData = val;
|
|
50
|
+
},
|
|
51
|
+
changeTextReq(val) {
|
|
52
|
+
this.form.requestData = val;
|
|
53
|
+
},
|
|
54
|
+
initRequestData() {
|
|
55
|
+
let param = {
|
|
56
|
+
dataSourceName: 'interface_params',
|
|
57
|
+
wheres: [{
|
|
58
|
+
fieldName: 'interface_id',
|
|
59
|
+
fieldValue: this.row.id,
|
|
60
|
+
operator: '='
|
|
61
|
+
}]
|
|
62
|
+
}
|
|
63
|
+
let interfaceParams = {}
|
|
64
|
+
getOneData(param).then((res) => {
|
|
65
|
+
if (res.success) {
|
|
66
|
+
if (res.data) {
|
|
67
|
+
let params = res.data.dataInfoArray
|
|
68
|
+
params.forEach((p) => {
|
|
69
|
+
interfaceParams[p.fieldName] = ''
|
|
70
|
+
})
|
|
71
|
+
this.initMockData(JSON.stringify(interfaceParams))
|
|
72
|
+
} else {
|
|
73
|
+
this.initMockData()
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
this.$message.warning(res.msg);
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
},
|
|
80
|
+
initMockData(requestData) {
|
|
81
|
+
if (this.row.id) {
|
|
82
|
+
let param = {
|
|
83
|
+
dataSourceName: 'interface_mock',
|
|
84
|
+
wheres: [{
|
|
85
|
+
fieldName: 'interface_id',
|
|
86
|
+
fieldValue: this.row.id,
|
|
87
|
+
operator: '='
|
|
88
|
+
}]
|
|
89
|
+
}
|
|
90
|
+
getOneData(param).then((res) => {
|
|
91
|
+
if (res.success) {
|
|
92
|
+
if (res.data) {
|
|
93
|
+
let result = res.data.keyInfoObject
|
|
94
|
+
this.dataId = res.data.id
|
|
95
|
+
this.form = Object.assign(result, {})
|
|
96
|
+
if (requestData) {
|
|
97
|
+
this.form.requestData = requestData
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
if (requestData) {
|
|
101
|
+
this.form.requestData = requestData
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
this.$message.warning(res.msg);
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
getFormData() {
|
|
111
|
+
//查询参数
|
|
112
|
+
let param = {}
|
|
113
|
+
param.dataSourceName = 'interface_mock'
|
|
114
|
+
param.key = {
|
|
115
|
+
interface_id: this.row.id,
|
|
116
|
+
is_mock: this.form.is_mock,
|
|
117
|
+
responseData: this.form.responseData
|
|
118
|
+
}
|
|
119
|
+
if (this.dataId) {
|
|
120
|
+
param.id = this.dataId
|
|
121
|
+
}
|
|
122
|
+
return param;
|
|
123
|
+
},
|
|
124
|
+
closeDialog() {
|
|
125
|
+
this.visible = false
|
|
126
|
+
},
|
|
127
|
+
saveMock() {
|
|
128
|
+
if (this.form.is_mock) {
|
|
129
|
+
this.$refs['form'].validate((valid) => {
|
|
130
|
+
if (valid) {
|
|
131
|
+
const loading = this.$loading({
|
|
132
|
+
lock: true,
|
|
133
|
+
text: 'Loading',
|
|
134
|
+
spinner: 'el-icon-loading',
|
|
135
|
+
});
|
|
136
|
+
const that = this;
|
|
137
|
+
let formData = this.getFormData()
|
|
138
|
+
if (this.dataId) {
|
|
139
|
+
updateData(formData).then((res) => {
|
|
140
|
+
if (res.success) {
|
|
141
|
+
that.$message.success(res.msg);
|
|
142
|
+
this.visible = false
|
|
143
|
+
} else {
|
|
144
|
+
that.$message.warning(res.msg);
|
|
145
|
+
}
|
|
146
|
+
}).finally(() => {
|
|
147
|
+
loading.close();
|
|
148
|
+
});
|
|
149
|
+
} else {
|
|
150
|
+
insertData(formData).then((res) => {
|
|
151
|
+
if (res.success) {
|
|
152
|
+
that.$message.success(res.msg);
|
|
153
|
+
this.visible = false
|
|
154
|
+
} else {
|
|
155
|
+
that.$message.warning(res.msg);
|
|
156
|
+
}
|
|
157
|
+
}).finally(() => {
|
|
158
|
+
loading.close();
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
} else {
|
|
165
|
+
const loading = this.$loading({
|
|
166
|
+
lock: true,
|
|
167
|
+
text: 'Loading',
|
|
168
|
+
spinner: 'el-icon-loading',
|
|
169
|
+
});
|
|
170
|
+
const that = this;
|
|
171
|
+
let formData = this.getFormData()
|
|
172
|
+
if (formData.id) {
|
|
173
|
+
updateData(formData).then((res) => {
|
|
174
|
+
if (res.success) {
|
|
175
|
+
that.$message.success(res.msg);
|
|
176
|
+
this.visible = false
|
|
177
|
+
} else {
|
|
178
|
+
that.$message.warning(res.msg);
|
|
179
|
+
}
|
|
180
|
+
}).finally(() => {
|
|
181
|
+
loading.close();
|
|
182
|
+
});
|
|
183
|
+
} else {
|
|
184
|
+
insertData(formData).then((res) => {
|
|
185
|
+
if (res.success) {
|
|
186
|
+
that.$message.success(res.msg);
|
|
187
|
+
this.visible = false
|
|
188
|
+
} else {
|
|
189
|
+
that.$message.warning(res.msg);
|
|
190
|
+
}
|
|
191
|
+
}).finally(() => {
|
|
192
|
+
loading.close();
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
</script>
|
|
201
|
+
|
|
202
|
+
<style scoped>
|
|
203
|
+
</style>
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ed-dialog ref="BasicDialog" :fullscreen="true" :showOkBtn="false" :title="title"
|
|
3
|
+
:visible="visibleMainDialog"
|
|
4
|
+
@close="closeMainDialog">
|
|
5
|
+
|
|
6
|
+
<el-card class="box-card">
|
|
7
|
+
<div slot="header" class="clearfix">
|
|
8
|
+
<span>参数</span>
|
|
9
|
+
<el-button-group style="float: right;">
|
|
10
|
+
<el-button :loading="loading" icon="el-icon-document-add" size="small" type="primary"
|
|
11
|
+
@click="saveFieldInfo">保存
|
|
12
|
+
</el-button>
|
|
13
|
+
<el-button :loading="loading" icon="el-icon-refresh-right" size="small"
|
|
14
|
+
@click="refresh">刷新
|
|
15
|
+
</el-button>
|
|
16
|
+
<el-button :loading="loading" icon="el-icon-plus" size="small"
|
|
17
|
+
@click="addParamObj">添加
|
|
18
|
+
</el-button>
|
|
19
|
+
<el-button :loading="loading" icon="el-icon-plus" size="small"
|
|
20
|
+
@click="showAddParamFast">快速添加
|
|
21
|
+
</el-button>
|
|
22
|
+
</el-button-group>
|
|
23
|
+
</div>
|
|
24
|
+
<el-form ref="tableInfoForm" :inline="true" :model="tableInfoForm"
|
|
25
|
+
class="demo-form-inline">
|
|
26
|
+
<el-table
|
|
27
|
+
:data="tableInfoForm.params"
|
|
28
|
+
border>
|
|
29
|
+
<el-table-column
|
|
30
|
+
label="字段名称"
|
|
31
|
+
prop="fieldName"
|
|
32
|
+
>
|
|
33
|
+
<template slot-scope="scope">
|
|
34
|
+
<el-form-item :prop="`params[${scope.$index}].fieldName`"
|
|
35
|
+
:rules="[{required: true, message: '必填', trigger: 'blur'}]">
|
|
36
|
+
<el-input v-model="scope.row.fieldName"
|
|
37
|
+
placeholder="字段名称"></el-input>
|
|
38
|
+
</el-form-item>
|
|
39
|
+
</template>
|
|
40
|
+
</el-table-column>
|
|
41
|
+
<el-table-column
|
|
42
|
+
label="映射名称"
|
|
43
|
+
prop="mappingFieldName"
|
|
44
|
+
>
|
|
45
|
+
<template slot-scope="scope">
|
|
46
|
+
<el-form-item :prop="`params[${scope.$index}].mappingFieldName`"
|
|
47
|
+
:rules="[{required: true, message: '必填', trigger: 'blur'}]">
|
|
48
|
+
<el-input v-model="scope.row.mappingFieldName"
|
|
49
|
+
placeholder="字段映射"></el-input>
|
|
50
|
+
</el-form-item>
|
|
51
|
+
</template>
|
|
52
|
+
</el-table-column>
|
|
53
|
+
<el-table-column
|
|
54
|
+
label="字段类型"
|
|
55
|
+
prop="dataType"
|
|
56
|
+
>
|
|
57
|
+
<template slot-scope="scope">
|
|
58
|
+
<el-form-item>
|
|
59
|
+
<el-select v-model="scope.row.dataType">
|
|
60
|
+
<el-option label="VARCHAR" value="VARCHAR"></el-option>
|
|
61
|
+
<el-option label="INTEGER" value="INTEGER"></el-option>
|
|
62
|
+
<el-option label="LONGTEXT" value="LONGTEXT"></el-option>
|
|
63
|
+
<el-option label="DATETIME" value="DATETIME"></el-option>
|
|
64
|
+
<el-option label="ARRAY" value="ARRAY"></el-option>
|
|
65
|
+
<el-option label="OBJECT" value="OBJECT"></el-option>
|
|
66
|
+
</el-select>
|
|
67
|
+
</el-form-item>
|
|
68
|
+
</template>
|
|
69
|
+
</el-table-column>
|
|
70
|
+
<el-table-column
|
|
71
|
+
label="输入输出"
|
|
72
|
+
prop="paramType"
|
|
73
|
+
>
|
|
74
|
+
<template slot-scope="scope">
|
|
75
|
+
<el-form-item>
|
|
76
|
+
<el-select v-model="scope.row.paramType">
|
|
77
|
+
<el-option label="输入参数" value="in"></el-option>
|
|
78
|
+
<el-option label="输出参数" value="out"></el-option>
|
|
79
|
+
</el-select>
|
|
80
|
+
</el-form-item>
|
|
81
|
+
</template>
|
|
82
|
+
</el-table-column>
|
|
83
|
+
<el-table-column
|
|
84
|
+
label="默认值"
|
|
85
|
+
prop="defaultValue"
|
|
86
|
+
>
|
|
87
|
+
<template slot-scope="scope">
|
|
88
|
+
<el-form-item>
|
|
89
|
+
<el-input v-model="scope.row.defaultValue"
|
|
90
|
+
placeholder="默认值"></el-input>
|
|
91
|
+
</el-form-item>
|
|
92
|
+
</template>
|
|
93
|
+
</el-table-column>
|
|
94
|
+
<el-table-column
|
|
95
|
+
label="备注"
|
|
96
|
+
prop="remark"
|
|
97
|
+
width="150">
|
|
98
|
+
<template slot-scope="scope">
|
|
99
|
+
<el-form-item>
|
|
100
|
+
<el-input v-model="scope.row.remark"
|
|
101
|
+
placeholder="备注"></el-input>
|
|
102
|
+
</el-form-item>
|
|
103
|
+
</template>
|
|
104
|
+
</el-table-column>
|
|
105
|
+
<el-table-column
|
|
106
|
+
label="主键字段"
|
|
107
|
+
prop="primaryKey"
|
|
108
|
+
width="150">
|
|
109
|
+
<template slot-scope="scope">
|
|
110
|
+
<el-form-item>
|
|
111
|
+
<el-switch
|
|
112
|
+
v-model="scope.row.primaryKey">
|
|
113
|
+
</el-switch>
|
|
114
|
+
</el-form-item>
|
|
115
|
+
</template>
|
|
116
|
+
</el-table-column>
|
|
117
|
+
<el-table-column
|
|
118
|
+
label="是否模糊匹配"
|
|
119
|
+
prop="isFuzzyMatch"
|
|
120
|
+
>
|
|
121
|
+
<template slot-scope="scope">
|
|
122
|
+
<el-form-item>
|
|
123
|
+
<el-switch
|
|
124
|
+
v-model="scope.row.isFuzzyMatch">
|
|
125
|
+
</el-switch>
|
|
126
|
+
</el-form-item>
|
|
127
|
+
</template>
|
|
128
|
+
</el-table-column>
|
|
129
|
+
<el-table-column label="操作">
|
|
130
|
+
<template slot-scope="scope">
|
|
131
|
+
<el-button slot="reference" style="color: red" type="text" @click="deleteRow(scope)">删除</el-button>
|
|
132
|
+
</template>
|
|
133
|
+
</el-table-column>
|
|
134
|
+
</el-table>
|
|
135
|
+
</el-form>
|
|
136
|
+
</el-card>
|
|
137
|
+
<ed-dialog ref="BasicDialog" :showOkBtn="true" :visible="visible"
|
|
138
|
+
title="快速添加"
|
|
139
|
+
@close="closeDialog"
|
|
140
|
+
@ok="addParamObjFast">
|
|
141
|
+
<ed-code-editor
|
|
142
|
+
:value="fastText"
|
|
143
|
+
language="javascript"
|
|
144
|
+
placeholder="例:fieldName1|mappingFieldName1,fieldName2|mappingFieldName2,fieldName3|mappingFieldName3 以逗号分隔"
|
|
145
|
+
@input="changeText"
|
|
146
|
+
></ed-code-editor>
|
|
147
|
+
</ed-dialog>
|
|
148
|
+
</ed-dialog>
|
|
149
|
+
</template>
|
|
150
|
+
|
|
151
|
+
<script>
|
|
152
|
+
import {listFieldInfo, saveParams} from "../../../../api/interface";
|
|
153
|
+
|
|
154
|
+
export default {
|
|
155
|
+
name: "InterfaceParam",
|
|
156
|
+
data() {
|
|
157
|
+
return {
|
|
158
|
+
loading: false,
|
|
159
|
+
visibleMainDialog: false,
|
|
160
|
+
visible: false,
|
|
161
|
+
title: '',
|
|
162
|
+
row: {},
|
|
163
|
+
tableInfoForm: {
|
|
164
|
+
params: []
|
|
165
|
+
},
|
|
166
|
+
fastText: '',
|
|
167
|
+
dataId: ''
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
methods: {
|
|
171
|
+
show(row, title) {
|
|
172
|
+
this.row = row
|
|
173
|
+
this.title = title
|
|
174
|
+
this.visibleMainDialog = true
|
|
175
|
+
this.showFieldInfo()
|
|
176
|
+
},
|
|
177
|
+
refresh() {
|
|
178
|
+
this.dataId = ''
|
|
179
|
+
this.fastText = ''
|
|
180
|
+
this.showFieldInfo()
|
|
181
|
+
},
|
|
182
|
+
saveFieldInfo() {
|
|
183
|
+
this.$refs['tableInfoForm'].validate((valid) => {
|
|
184
|
+
if (valid) {
|
|
185
|
+
let formData = {
|
|
186
|
+
dataSourceName: 'interface_params',
|
|
187
|
+
id: this.dataId,
|
|
188
|
+
key: {
|
|
189
|
+
interface_id: this.row.id
|
|
190
|
+
},
|
|
191
|
+
data: this.tableInfoForm.params,
|
|
192
|
+
}
|
|
193
|
+
// 发起请求
|
|
194
|
+
return this.requestAddOrEditFieldInfo(formData)
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
},
|
|
198
|
+
requestAddOrEditFieldInfo(formData) {
|
|
199
|
+
this.loading = true
|
|
200
|
+
let dataSourceId = this.row.id
|
|
201
|
+
formData.dataSourceId = dataSourceId
|
|
202
|
+
saveParams(formData).then((res) => {
|
|
203
|
+
if (res.success) {
|
|
204
|
+
// if (!this.dataId)
|
|
205
|
+
// this.dataId = res.data
|
|
206
|
+
this.$message.success(res.msg||'操作成功!');
|
|
207
|
+
} else {
|
|
208
|
+
this.$message.warning(res.msg||'操作失败!');
|
|
209
|
+
}
|
|
210
|
+
}).finally(() => {
|
|
211
|
+
this.loading = false
|
|
212
|
+
})
|
|
213
|
+
},
|
|
214
|
+
addParamObj() {
|
|
215
|
+
const paramObj = {
|
|
216
|
+
fieldName: '',
|
|
217
|
+
mappingFieldName: '',
|
|
218
|
+
dataType: 'VARCHAR',
|
|
219
|
+
paramType: 'in',
|
|
220
|
+
defaultValue: '',
|
|
221
|
+
remark: '',
|
|
222
|
+
primaryKey: false,
|
|
223
|
+
isFuzzyMatch: false
|
|
224
|
+
}
|
|
225
|
+
this.tableInfoForm.params.push(paramObj)
|
|
226
|
+
},
|
|
227
|
+
addParamObjFast() {
|
|
228
|
+
return new Promise((resolve, reject) => {
|
|
229
|
+
if (this.fastText) {
|
|
230
|
+
//解析dataQuick
|
|
231
|
+
let dataQ = this.fastText.split(',')
|
|
232
|
+
dataQ.forEach((d) => {
|
|
233
|
+
let fieldNames = d.split('|')
|
|
234
|
+
this.tableInfoForm.params.push({
|
|
235
|
+
fieldName: fieldNames[0],
|
|
236
|
+
mappingFieldName: fieldNames[1],
|
|
237
|
+
dataType: 'varchar',
|
|
238
|
+
isFuzzyMatch: true
|
|
239
|
+
})
|
|
240
|
+
})
|
|
241
|
+
this.visible = false
|
|
242
|
+
resolve()
|
|
243
|
+
} else {
|
|
244
|
+
this.$message.warning('输入框为空')
|
|
245
|
+
}
|
|
246
|
+
}).catch((e) => {
|
|
247
|
+
this.$message.warning(e)
|
|
248
|
+
});
|
|
249
|
+
},
|
|
250
|
+
showFieldInfo() {
|
|
251
|
+
//显示表信息
|
|
252
|
+
let params = {
|
|
253
|
+
dataSourceName: 'interface_params',
|
|
254
|
+
wheres: [
|
|
255
|
+
{
|
|
256
|
+
fieldName: 'interface_id',
|
|
257
|
+
fieldValue: this.row.id,
|
|
258
|
+
operator: '='
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
const loading = this.$loading({
|
|
263
|
+
lock: true,
|
|
264
|
+
text: 'Loading',
|
|
265
|
+
spinner: 'el-icon-loading',
|
|
266
|
+
});
|
|
267
|
+
listFieldInfo(params).then(res => {
|
|
268
|
+
if (res.success) {
|
|
269
|
+
if (res.data) {
|
|
270
|
+
this.tableInfoForm.params = res.data.dataInfoArray
|
|
271
|
+
this.dataId = res.data.id
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
this.$message.warning(res.message)
|
|
275
|
+
}
|
|
276
|
+
}).finally(() => {
|
|
277
|
+
loading.close()
|
|
278
|
+
})
|
|
279
|
+
},
|
|
280
|
+
changeText(val) {
|
|
281
|
+
this.fastText = val
|
|
282
|
+
},
|
|
283
|
+
showAddParamFast() {
|
|
284
|
+
this.visible = true
|
|
285
|
+
},
|
|
286
|
+
deleteRow(data) {
|
|
287
|
+
if (data.row.id) {
|
|
288
|
+
this.deleteIds.push(data.row.id)
|
|
289
|
+
}
|
|
290
|
+
this.tableInfoForm.params.splice(data.$index, 1)
|
|
291
|
+
},
|
|
292
|
+
closeDialog() {
|
|
293
|
+
this.visible = false;
|
|
294
|
+
},
|
|
295
|
+
closeMainDialog() {
|
|
296
|
+
this.visibleMainDialog = false;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
</script>
|
|
302
|
+
|
|
303
|
+
<style scoped>
|
|
304
|
+
.el-form-item {
|
|
305
|
+
margin-bottom: 0px
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
</style>
|