From 047bdad640248d7937f3951b77677a3156cf069f Mon Sep 17 00:00:00 2001 From: clay <20932067@zju.edu.cn> Date: Sun, 31 Jul 2022 21:04:29 +0800 Subject: [PATCH] =?UTF-8?q?top=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ebts-ui/.env.development | 1 + ebts-ui/src/api/system/data.js | 4 +- ebts-ui/src/components/Breadcrumb/index.vue | 2 +- ebts-ui/src/views/system/query/queryDate.vue | 28 +++--- .../views/tool/apiclass/apiclassInfoForm.vue | 6 +- ebts-ui/src/views/tool/apiclass/index.vue | 10 +-- ebts-ui/src/views/tool/gen/genInfoForm.vue | 2 +- ebts-ui/src/views/tool/gen/index.vue | 2 +- ebts-ui/src/views/tool/module/index.vue | 4 +- .../src/views/tool/module/moduleInfoForm.vue | 6 +- ebts-ui/src/views/tool/query/index.vue | 81 +++++++++++------ ebts-ui/src/views/tool/query/uniQuery.vue | 86 +++++++++++-------- ebts-ui/src/views/tool/top/index.vue | 80 ++++++++++++----- .../packages/topology/src/toolbar-edit.vue | 17 +++- .../top/packages/topology/src/topology.vue | 11 ++- ebts-ui/src/views/tool/top/topology.vue | 46 ++++++---- ebts-ui/src/views/tool/top/utils/eventBus.js | 3 + 17 files changed, 248 insertions(+), 141 deletions(-) create mode 100644 ebts-ui/src/views/tool/top/utils/eventBus.js diff --git a/ebts-ui/.env.development b/ebts-ui/.env.development index 610898e..810fc37 100644 --- a/ebts-ui/.env.development +++ b/ebts-ui/.env.development @@ -4,6 +4,7 @@ ENV = 'development' # EBTS/开发环境 #VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = 'http://localhost:8085/dev-api' +#VUE_APP_BASE_API = 'https://api.ebts.top/dev-api' # 路由懒加载 diff --git a/ebts-ui/src/api/system/data.js b/ebts-ui/src/api/system/data.js index 332fddd..5ead613 100644 --- a/ebts-ui/src/api/system/data.js +++ b/ebts-ui/src/api/system/data.js @@ -1,14 +1,14 @@ import request from "@/utils/request"; // 获取查询基本信息 -export function RealInfo(id){ +export function realInfo(id){ return request({ url: "/data/real/"+id, method: 'get', }) } // 查询数据 -export function RealData(data){ +export function realData(data){ return request({ url: "/data/real", method: 'put', diff --git a/ebts-ui/src/components/Breadcrumb/index.vue b/ebts-ui/src/components/Breadcrumb/index.vue index 97603c4..22fbd61 100644 --- a/ebts-ui/src/components/Breadcrumb/index.vue +++ b/ebts-ui/src/components/Breadcrumb/index.vue @@ -51,7 +51,7 @@ export default { }, pathCompile(path) { const { params } = this.$route - var toPath = pathToRegexp.compile(path) + let toPath = pathToRegexp.compile(path) return toPath(params) }, handleLink(item) { diff --git a/ebts-ui/src/views/system/query/queryDate.vue b/ebts-ui/src/views/system/query/queryDate.vue index 4fe4162..01738a0 100644 --- a/ebts-ui/src/views/system/query/queryDate.vue +++ b/ebts-ui/src/views/system/query/queryDate.vue @@ -5,13 +5,13 @@ :key="item.id" :label="item.ucName"> - -
+
@@ -22,14 +22,14 @@
- diff --git a/ebts-ui/src/views/tool/top/packages/topology/src/topology.vue b/ebts-ui/src/views/tool/top/packages/topology/src/topology.vue index 42fa782..6d514f1 100644 --- a/ebts-ui/src/views/tool/top/packages/topology/src/topology.vue +++ b/ebts-ui/src/views/tool/top/packages/topology/src/topology.vue @@ -840,7 +840,8 @@ export default { }, // 返回 reBack() { - this.$router.replace('/tool/er-top') + window.close() + // this.$router.replace('/tool/er-top') }, undoHandler() { if (this.historyIndex > 0 && this.historyIndex - (this.undoCount + 1) >= 0) { @@ -1374,8 +1375,12 @@ export default { this.$emit('doPreview', graphData) }, // 上线 - searchOnLine() { - this.$emit('doOnLine') + searchOnLine(release) { + this.$emit('doOnLine',release) + }, + // 上线 + undoOnLine(release) { + this.$emit('undoOnLine',release) }, // 保存函数 saveDataHandler() { diff --git a/ebts-ui/src/views/tool/top/topology.vue b/ebts-ui/src/views/tool/top/topology.vue index a76a324..f1b27a4 100644 --- a/ebts-ui/src/views/tool/top/topology.vue +++ b/ebts-ui/src/views/tool/top/topology.vue @@ -12,7 +12,8 @@ @doChangeMode="doChangeMode" @doSaveData="doSaveData" @doPreview="doPreview" - @doOnLine="doOnLine" + @doOnLine="changeOnLine" + @undoOnLine="changeOnLine" > @@ -23,13 +24,13 @@ :label="item.ucName" > - -
+
@@ -40,7 +41,7 @@
{ this.baseData = res.data + eventBus.$emit('isRelease',this.baseData.isRelease) + + console.log(res.data) if (res.data.topJson) { this.graphData = JSON.parse(res.data.topJson) } else { @@ -163,6 +169,7 @@ export default { edges: [] } } + this.baseData.topJson = null let graphData = deepClone(this.graphData) this.$refs.topology.initTopo(graphData) this.randomChange() @@ -183,7 +190,7 @@ export default { }, /** 导出按钮操作 */ handleExport() { - var that = this + let that = this this.$confirm('是否确认导出查询数据项?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', @@ -206,7 +213,7 @@ export default { } data.uniCons = this.previewDate.uconList //todo 需要修改 - RealData(data).then(res => { + realData(data).then(res => { this.previewDate.data = res.rows this.total = res.total }) @@ -245,13 +252,24 @@ export default { this.msgSuccess(res.msg) }) }, - doOnLine() { - this.$confirm('请确认top图结构无误并预览结果无误后上线?', '警告', { + changeOnLine(release) { + let that = this + this.$confirm(release === 1?'请确认top图结构无误并预览结果无误后上线?':'请确认是否撤销当前发布内容!', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(function() { - + let data = { + id: that.baseData.id, + isRelease: release + } + Release(data).then(res => { + that.$router.replace('/tool/er-top') + Message({ + message: res.msg, + type: 'success' + }) + }) }) }, //预览 @@ -286,10 +304,6 @@ export default { }), id: this.topId } - console.log({ - nodes: nodes, - edges: edges - }) preview(data).then(res => { this.previewDate.data = res.rows this.previewDate.total = res.total @@ -306,7 +320,6 @@ export default { prop: info.prop }) }) - this.previewDate.title = this.baseData.uqName + '数据预览' this.previewDate.open = true }) @@ -316,7 +329,6 @@ export default { }, randomChange() { let graphData = deepClone(this.$refs.topology.getGraphData()) - let { nodes } = graphData this.$refs.topology.changeGraphData(graphData) } } diff --git a/ebts-ui/src/views/tool/top/utils/eventBus.js b/ebts-ui/src/views/tool/top/utils/eventBus.js new file mode 100644 index 0000000..834e916 --- /dev/null +++ b/ebts-ui/src/views/tool/top/utils/eventBus.js @@ -0,0 +1,3 @@ +import Vue from "vue"; + +export const eventBus = new Vue();