Commit a2f38d94 authored by 张伯涛's avatar 张伯涛

bug修改

parent 5cc57b6f
...@@ -19,10 +19,11 @@ import request from '@/utils/request' ...@@ -19,10 +19,11 @@ import request from '@/utils/request'
// 查询最近一条数据 // 查询最近一条数据
export function findLatestData() { export function findLatestData(query) {
return request({ return request({
url: '/bichnography/findLatestData', url: '/bichnography/findLatestData',
method: 'get', method: 'get',
params: query
}) })
} }
......
...@@ -559,9 +559,9 @@ export default { ...@@ -559,9 +559,9 @@ export default {
mounted() { mounted() {
console.log('11111',this.$route.query.type)
let dataToWatch = JSON.parse(localStorage.getItem('dataToWatch')); let dataToWatch = JSON.parse(localStorage.getItem(this.$route.query.type + 'dataToWatch'));
console.log('dataToWatch',dataToWatch)
let backDiv = document.getElementById('popSuperBack') let backDiv = document.getElementById('popSuperBack')
backDiv.style.backgroundImage = dataToWatch.background backDiv.style.backgroundImage = dataToWatch.background
......
...@@ -14,6 +14,16 @@ ...@@ -14,6 +14,16 @@
<!-- 左侧控制列 --> <!-- 左侧控制列 -->
<div class="node-container"> <div class="node-container">
<div>
<el-select v-model="queryForm.type" placeholder="请选择" @change="changeType">
<el-option
v-for="(item,index) in typeOptions"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
<!-- 遍历nodeList里面的项,这应该就是左侧的选项卡列表 --> <!-- 遍历nodeList里面的项,这应该就是左侧的选项卡列表 -->
<!-- 这个卡也跟着缩放了,感觉不太对劲 --> <!-- 这个卡也跟着缩放了,感觉不太对劲 -->
<div <div
...@@ -25,10 +35,10 @@ ...@@ -25,10 +35,10 @@
@mousedown="evt => nodeItemMouseDown(evt, item.value)" @mousedown="evt => nodeItemMouseDown(evt, item.value)"
> >
<!-- 里面嵌套这层为卡片提供样式和信息之类,后面卡片样式判断可以在这里面做 --> <!-- 里面嵌套这层为卡片提供样式和信息之类,后面卡片样式判断可以在这里面做 -->
<div class="flow-node ellipsis all" <div
:style="{backgroundImage: 'url('+item.value().meta.img+')' }" class="flow-node ellipsis all"
> :style="{backgroundImage: 'url('+item.value().meta.img+')' }"
</div> />
</div> </div>
<!-- <el-input <!-- <el-input
...@@ -38,10 +48,11 @@ ...@@ -38,10 +48,11 @@
v-model="backgroundUrl"> v-model="backgroundUrl">
</el-input> --> </el-input> -->
<el-button <el-button
style=" style="
margin-top: 300px; " margin-top: 300px; "
type="success" type="success"
@click="showBackGroundPage">更换背景</el-button> @click="showBackGroundPage"
>更换背景</el-button>
</div> </div>
<!-- 最外层,加滚轮监听函数 --> <!-- 最外层,加滚轮监听函数 -->
...@@ -51,13 +62,13 @@ ...@@ -51,13 +62,13 @@
<div <div
class="super-flow-content" class="super-flow-content"
> >
<!-- @wheel="handleScroll" 阻止默认滚轮事件--> <!-- @wheel="handleScroll" 阻止默认滚轮事件-->
<!-- 这下面删了个v-drag就不能拖动画布了 --> <!-- 这下面删了个v-drag就不能拖动画布了 -->
<div <div
id="mainSuperBack"
ref="flowContainer" ref="flowContainer"
class="flow-container" class="flow-container"
style="width: 1920px;height: 1080px" style="width: 1920px;height: 1080px"
id="mainSuperBack"
> >
<super-flow <super-flow
ref="superFlow" ref="superFlow"
...@@ -73,21 +84,20 @@ ...@@ -73,21 +84,20 @@
> >
<template v-slot:node="{meta}"> <template v-slot:node="{meta}">
<div <div
slot="reference" slot="reference"
class="flow-node ellipsis all" class="flow-node ellipsis all"
:style="{backgroundImage: 'url('+meta.img+')' }" :style="{backgroundImage: 'url('+meta.img+')' }"
@mouseup="nodeMouseUp" @mouseup="nodeMouseUp"
@click="nodeClick(meta)" @click="nodeClick(meta)"
> >
<el-row> <el-row>
<div :class="[meta.name]" > <div :class="[meta.name]">
{{meta.desc}} {{ meta.desc }}
</div> </div>
</el-row>
</el-row> </div>
</div>
</template> </template>
</super-flow> </super-flow>
</div> </div>
...@@ -182,12 +192,11 @@ ...@@ -182,12 +192,11 @@
title="展示模式" title="展示模式"
:visible.sync="observationMode" :visible.sync="observationMode"
:close-on-click-modal="false" :close-on-click-modal="false"
custom-class = "watchDialog" custom-class="watchDialog"
> >
<div style="width: 100%;"> <div style="width: 100%;">
<superFlowWatch v-if="observationMode" :dataToWatch="dataToWatch"> <superFlowWatch v-if="observationMode" :data-to-watch="dataToWatch" />
</superFlowWatch> </div>
</div>
</el-dialog> </el-dialog>
<!-- 对话框,用来换图 --> <!-- 对话框,用来换图 -->
...@@ -197,11 +206,11 @@ ...@@ -197,11 +206,11 @@
:close-on-click-modal="false" :close-on-click-modal="false"
width="500px" width="500px"
> >
<el-input <el-input
v-model="backgroundUrl" v-model="backgroundUrl"
placeholder="请输入图片地址" placeholder="请输入图片地址"
maxlength="100" maxlength="100"
/> />
<!-- 底下的取消键是死的 --> <!-- 底下的取消键是死的 -->
<span <span
...@@ -298,6 +307,14 @@ export default { ...@@ -298,6 +307,14 @@ export default {
}, },
data() { data() {
return { return {
queryForm: {
type: '1'
},
typeOptions: [
{value: '1', label: 'a'},
{value: '2', label: 'b'},
{value: '3', label: 'c'},
],
timer: "", timer: "",
value: 0, value: 0,
//链接数据 //链接数据
...@@ -663,10 +680,11 @@ export default { ...@@ -663,10 +680,11 @@ export default {
this.dataToWatch.nodeList = this.nodeList this.dataToWatch.nodeList = this.nodeList
this.dataToWatch.linkList = this.linkList this.dataToWatch.linkList = this.linkList
this.dataToWatch.background = document.getElementsByClassName('flow-container')[0].style.backgroundImage this.dataToWatch.background = document.getElementsByClassName('flow-container')[0].style.backgroundImage
localStorage.removeItem(this.queryForm.type + 'dataToWatch')
localStorage.setItem('dataToWatch', JSON.stringify(this.dataToWatch)); localStorage.setItem(this.queryForm.type + 'dataToWatch', JSON.stringify(this.dataToWatch));
let page = this.$router.resolve({ let page = this.$router.resolve({
path:'/graphWatch', path:'/graphWatch',
query: { type: this.queryForm.type }
}) })
window.open(page.href, '_blank'); window.open(page.href, '_blank');
}, },
...@@ -775,14 +793,26 @@ export default { ...@@ -775,14 +793,26 @@ export default {
// console.log('baobaoaoa'); // console.log('baobaoaoa');
let post = {} let post = {}
post.graph = JSON.stringify(data) post.graph = JSON.stringify(data)
post.type = this.queryForm.type
console.log(post); console.log(post);
addBIchnography(post).then(res => { addBIchnography(post).then(res => {
console.log(res); if(res.code === 200) {
this.$message({
message: '添加成功',
type: 'success'
})
}
}) })
}, },
changeType() {
this.loadNodeListJson()
},
// 从服务器获取存档并加载 // 从服务器获取存档并加载
loadNodeListJson(){ loadNodeListJson(){
findLatestData().then(res => { const params = {
type: this.queryForm.type
}
findLatestData(params).then(res => {
let data = JSON.parse(res.data.graph) let data = JSON.parse(res.data.graph)
// data是获取到的信息 // data是获取到的信息
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment