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

bug修改

parent 5cc57b6f
......@@ -19,10 +19,11 @@ import request from '@/utils/request'
// 查询最近一条数据
export function findLatestData() {
export function findLatestData(query) {
return request({
url: '/bichnography/findLatestData',
method: 'get',
params: query
})
}
......
......@@ -559,9 +559,9 @@ export default {
mounted() {
let dataToWatch = JSON.parse(localStorage.getItem('dataToWatch'));
console.log('11111',this.$route.query.type)
let dataToWatch = JSON.parse(localStorage.getItem(this.$route.query.type + 'dataToWatch'));
console.log('dataToWatch',dataToWatch)
let backDiv = document.getElementById('popSuperBack')
backDiv.style.backgroundImage = dataToWatch.background
......
......@@ -14,6 +14,16 @@
<!-- 左侧控制列 -->
<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里面的项,这应该就是左侧的选项卡列表 -->
<!-- 这个卡也跟着缩放了,感觉不太对劲 -->
<div
......@@ -25,10 +35,10 @@
@mousedown="evt => nodeItemMouseDown(evt, item.value)"
>
<!-- 里面嵌套这层为卡片提供样式和信息之类,后面卡片样式判断可以在这里面做 -->
<div class="flow-node ellipsis all"
<div
class="flow-node ellipsis all"
:style="{backgroundImage: 'url('+item.value().meta.img+')' }"
>
</div>
/>
</div>
<!-- <el-input
......@@ -41,7 +51,8 @@
style="
margin-top: 300px; "
type="success"
@click="showBackGroundPage">更换背景</el-button>
@click="showBackGroundPage"
>更换背景</el-button>
</div>
<!-- 最外层,加滚轮监听函数 -->
......@@ -51,13 +62,13 @@
<div
class="super-flow-content"
>
<!-- @wheel="handleScroll" 阻止默认滚轮事件-->
<!-- @wheel="handleScroll" 阻止默认滚轮事件-->
<!-- 这下面删了个v-drag就不能拖动画布了 -->
<div
id="mainSuperBack"
ref="flowContainer"
class="flow-container"
style="width: 1920px;height: 1080px"
id="mainSuperBack"
>
<super-flow
ref="superFlow"
......@@ -81,11 +92,10 @@
>
<el-row>
<div :class="[meta.name]" >
{{meta.desc}}
<div :class="[meta.name]">
{{ meta.desc }}
</div>
</el-row>
</div>
</template>
......@@ -182,11 +192,10 @@
title="展示模式"
:visible.sync="observationMode"
:close-on-click-modal="false"
custom-class = "watchDialog"
custom-class="watchDialog"
>
<div style="width: 100%;">
<superFlowWatch v-if="observationMode" :dataToWatch="dataToWatch">
</superFlowWatch>
<superFlowWatch v-if="observationMode" :data-to-watch="dataToWatch" />
</div>
</el-dialog>
......@@ -298,6 +307,14 @@ export default {
},
data() {
return {
queryForm: {
type: '1'
},
typeOptions: [
{value: '1', label: 'a'},
{value: '2', label: 'b'},
{value: '3', label: 'c'},
],
timer: "",
value: 0,
//链接数据
......@@ -663,10 +680,11 @@ export default {
this.dataToWatch.nodeList = this.nodeList
this.dataToWatch.linkList = this.linkList
this.dataToWatch.background = document.getElementsByClassName('flow-container')[0].style.backgroundImage
localStorage.setItem('dataToWatch', JSON.stringify(this.dataToWatch));
localStorage.removeItem(this.queryForm.type + 'dataToWatch')
localStorage.setItem(this.queryForm.type + 'dataToWatch', JSON.stringify(this.dataToWatch));
let page = this.$router.resolve({
path:'/graphWatch',
query: { type: this.queryForm.type }
})
window.open(page.href, '_blank');
},
......@@ -775,14 +793,26 @@ export default {
// console.log('baobaoaoa');
let post = {}
post.graph = JSON.stringify(data)
post.type = this.queryForm.type
console.log(post);
addBIchnography(post).then(res => {
console.log(res);
if(res.code === 200) {
this.$message({
message: '添加成功',
type: 'success'
})
}
})
},
changeType() {
this.loadNodeListJson()
},
// 从服务器获取存档并加载
loadNodeListJson(){
findLatestData().then(res => {
const params = {
type: this.queryForm.type
}
findLatestData(params).then(res => {
let data = JSON.parse(res.data.graph)
// 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