42489761 by 杨威
2 parents 07f0b312 2986383b
......@@ -12,6 +12,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@antv/g6": "^4.0.2",
"axios": "^0.19.0",
"core-js": "^2.6.5",
"e-icon-picker": "^1.0.7",
......@@ -20,6 +21,7 @@
"element-ui": "^2.13.2",
"file-saver": "^2.0.2",
"form-making": "^1.2.9",
"insert-css": "^2.0.0",
"js-cookie": "^2.2.1",
"mockjs": "^1.1.0",
"screenfull": "^5.0.2",
......
import request from "@/plugin/axios";
/**
* 历史回溯
* @param data
* @constructor
*/
export function getLshs(data) {
return request({
url: "/bg/fwsxbg/lshs",
method: "post",
data: data,
});
}
......@@ -8,13 +8,15 @@
:modal-append-to-body="false"
center>
<div>
<div class="bottom-radio">
<el-radio-group v-model="moveHdata.sxzylx">
<el-radio label="up">向上</el-radio>
<el-radio label="down">向下</el-radio>
<el-radio label="left">向左</el-radio>
<el-radio label="right">向右</el-radio>
</el-radio-group>
<div class="">
</div>
<div class="bottom-buttom">
<el-button type="primary" @click="save">确认</el-button>
<el-button type="primary" @click="cacel">取消</el-button>
</div>
......@@ -26,15 +28,16 @@
<script>
import {moveH} from './../../api/lpb'
import {Message} from 'element-ui'
export default {
name: "moveH",
data() {
return {
isVisible:false,
isVisible: false,
moveHdata: {
hbsm: "",
sxzylx: "",
type:""
type: ""
}
}
},
......@@ -46,29 +49,29 @@
hbsm: {
type: String
},
type:{
type:String
type: {
type: String
}
},
methods: {
loading:function(){
loading: function () {
this.$emit('loading')
},
save() {
this.moveHdata.hbsm=this.hbsm
this.moveHdata.type=this.type
moveH(this.moveHdata).then(res=>{
this.moveHdata.hbsm = this.hbsm
this.moveHdata.type = this.type
moveH(this.moveHdata).then(res => {
console.log(res)
if (res.success) {
this.loading();
this.close();
Message.success("移动成功")
}else{
} else {
Message.error(res.message)
}
})
},
cacel(){
cacel() {
this.close()
},
close() {
......@@ -83,6 +86,15 @@
}
</script>
<style scoped>
<style scoped lang="less">
.bottom-radio{
text-align: center;
}
.el-radio{
padding: 20px;
}
.bottom-buttom {
margin-top: 20px;
text-align: center;
}
</style>
......
......@@ -166,6 +166,7 @@
},
mounted() {
let bsm = this.$store.state.zdbsm
this.bsm=bsm;
this.getData(bsm)
},
methods: {
......@@ -260,6 +261,7 @@
computed: {},
watch: {
"$store.state.zdbsm": function (bsm) {
this.bsm=bsm
this.getData(bsm)
}
},
......
......@@ -233,6 +233,7 @@
},
mounted() {
let bsm = this.$store.state.zdbsm
this.bsm=bsm;
this.getData(bsm)
},
methods: {
......@@ -327,6 +328,7 @@
computed: {},
watch: {
"$store.state.zdbsm": function (bsm) {
this.bsm=bsm;
this.getData(bsm)
}
},
......
<template>
<div class="">历史回溯</div>
<div class="">历史回溯
<div id="mountNode"></div>
</div>
</template>
<script>
import G6 from '@antv/g6';
import insertCss from 'insert-css';
import { getLshs } from "./../../../../src/api/fwsxbg";
export default {
name:"",
components:{},
props:{},
data(){
insertCss(`
.g6-tooltip {
border-radius: 6px;
font-size: 12px;
color: #fff;
background-color: #000;
padding: 2px 8px;
text-align: center;
}
`);
return {
data : {}
}
},
created(){
},
mounted(){
this.getLshsData();
},
methods: {
initG6() {
const data = this.data;
G6.registerNode(
'sql',
{
drawShape(cfg, group) {
const rect = group.addShape('rect', {
attrs: {
x: -75,
y: -25,
width: 150,
height: 50,
radius: 10,
stroke: '#5B8FF9',
fill: '#C6E5FF',
lineWidth: 1,
},
name: 'rect-shape',
});
if (cfg.name) {
group.addShape('text', {
attrs: {
text: cfg.name,
x: 0,
y: 0,
fill: '#00287E',
fontSize: 14,
textAlign: 'center',
textBaseline: 'middle',
fontWeight: 'bold',
},
name: 'text-shape',
});
}
return rect;
},
},
'single-node',
);
const container = document.getElementById('mountNode');
const graph = new G6.Graph({
container: 'mountNode',
width:1000,
height:800,
layout: {
type: 'dagre',
nodesepFunc: (d) => {
if (d.id === '3') {
return 500;
}
return 50;
},
ranksep: 70,
controlPoints: true,
},
defaultNode: {
type: 'sql',
},
defaultEdge: {
type: 'polyline',
style: {
radius: 20,
offset: 45,
endArrow: true,
lineWidth: 2,
stroke: '#C2C8D5',
},
},
nodeStateStyles: {
selected: {
stroke: '#d9d9d9',
fill: '#5394ef',
},
},
modes: {
default: [
'drag-canvas',
'zoom-canvas',
'click-select',
{
type: 'tooltip',
formatText(model) {
const cfg = model.conf;
const text = [];
cfg.forEach((row) => {
text.push(row.label + ':' + row.value + '<br>');
});
return text.join('\n');
},
offset: 30,
},
],
},
fitView: true,
});
graph.data(data);
graph.render();
if (typeof window !== 'undefined')
window.onresize = () => {
if (!graph || graph.get('destroyed')) return;
if (!container || !container.scrollWidth || !container.scrollHeight) return;
graph.changeSize(container.scrollWidth, container.scrollHeight);
};
},
getLshsData(){
let _this = this;
const data = {
"bsm": "c0818d9e4286b35b8ee9b96d90b522aa",
"type": "zd"
};
getLshs(data).then((res)=>{
if(res.code===200){
_this.data=res.result;
this.initG6();
}
})
}
},
created(){},
mounted(){},
methods:{},
computed: {},
watch: {},
}
</script>
<style scoped lang="less">
</style>
\ No newline at end of file
......
......@@ -112,7 +112,7 @@
<el-button type="primary" @click="addCVisible = false">取消</el-button>
</div>
</el-dialog>
<move-h :hbsm="chData.bsm" @close="moveHClose" :move-hvisible="moveHvisible" :type="syclx" @loading="loadingData"></move-h>
<move-h :hbsm="chData.bsm" @close="moveHClose" :move-hvisible="moveHvisible" :type="scyclx" @loading="loadingData"></move-h>
</div>
</template>
<script>
......@@ -177,7 +177,7 @@ export default {
},
methods: {
loadingData(){
this.getLpb(this.$store.state.zrzbsm,this.$parent.syclx);
this.getLpb(this.$store.state.zrzbsm,this.$parent.scyclx);
},
//获取楼盘表数据
getLpb(zrzbsm,scyclx) {
......@@ -357,7 +357,7 @@ export default {
handleMoveH(){
// 移动户
console.log(this.chData,"chData")
console.log(this.$parent.syclx,"实预测类型")
console.log(this.$parent.scyclx,"实预测类型")
this.moveHvisible=true;
},
moveHClose(){
......