42489761 by 杨威
2 parents 07f0b312 2986383b
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
12 "lint": "vue-cli-service lint" 12 "lint": "vue-cli-service lint"
13 }, 13 },
14 "dependencies": { 14 "dependencies": {
15 "@antv/g6": "^4.0.2",
15 "axios": "^0.19.0", 16 "axios": "^0.19.0",
16 "core-js": "^2.6.5", 17 "core-js": "^2.6.5",
17 "e-icon-picker": "^1.0.7", 18 "e-icon-picker": "^1.0.7",
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
20 "element-ui": "^2.13.2", 21 "element-ui": "^2.13.2",
21 "file-saver": "^2.0.2", 22 "file-saver": "^2.0.2",
22 "form-making": "^1.2.9", 23 "form-making": "^1.2.9",
24 "insert-css": "^2.0.0",
23 "js-cookie": "^2.2.1", 25 "js-cookie": "^2.2.1",
24 "mockjs": "^1.1.0", 26 "mockjs": "^1.1.0",
25 "screenfull": "^5.0.2", 27 "screenfull": "^5.0.2",
......
1 import request from "@/plugin/axios";
2
3 /**
4 * 历史回溯
5 * @param data
6 * @constructor
7 */
8 export function getLshs(data) {
9 return request({
10 url: "/bg/fwsxbg/lshs",
11 method: "post",
12 data: data,
13 });
14 }
15
...@@ -8,13 +8,15 @@ ...@@ -8,13 +8,15 @@
8 :modal-append-to-body="false" 8 :modal-append-to-body="false"
9 center> 9 center>
10 <div> 10 <div>
11 <el-radio-group v-model="moveHdata.sxzylx"> 11 <div class="bottom-radio">
12 <el-radio label="up">向上</el-radio> 12 <el-radio-group v-model="moveHdata.sxzylx">
13 <el-radio label="down">向下</el-radio> 13 <el-radio label="up">向上</el-radio>
14 <el-radio label="left">向左</el-radio> 14 <el-radio label="down">向下</el-radio>
15 <el-radio label="right">向右</el-radio> 15 <el-radio label="left">向左</el-radio>
16 </el-radio-group> 16 <el-radio label="right">向右</el-radio>
17 <div class=""> 17 </el-radio-group>
18 </div>
19 <div class="bottom-buttom">
18 <el-button type="primary" @click="save">确认</el-button> 20 <el-button type="primary" @click="save">确认</el-button>
19 <el-button type="primary" @click="cacel">取消</el-button> 21 <el-button type="primary" @click="cacel">取消</el-button>
20 </div> 22 </div>
...@@ -26,15 +28,16 @@ ...@@ -26,15 +28,16 @@
26 <script> 28 <script>
27 import {moveH} from './../../api/lpb' 29 import {moveH} from './../../api/lpb'
28 import {Message} from 'element-ui' 30 import {Message} from 'element-ui'
31
29 export default { 32 export default {
30 name: "moveH", 33 name: "moveH",
31 data() { 34 data() {
32 return { 35 return {
33 isVisible:false, 36 isVisible: false,
34 moveHdata: { 37 moveHdata: {
35 hbsm: "", 38 hbsm: "",
36 sxzylx: "", 39 sxzylx: "",
37 type:"" 40 type: ""
38 } 41 }
39 } 42 }
40 }, 43 },
...@@ -46,29 +49,29 @@ ...@@ -46,29 +49,29 @@
46 hbsm: { 49 hbsm: {
47 type: String 50 type: String
48 }, 51 },
49 type:{ 52 type: {
50 type:String 53 type: String
51 } 54 }
52 }, 55 },
53 methods: { 56 methods: {
54 loading:function(){ 57 loading: function () {
55 this.$emit('loading') 58 this.$emit('loading')
56 }, 59 },
57 save() { 60 save() {
58 this.moveHdata.hbsm=this.hbsm 61 this.moveHdata.hbsm = this.hbsm
59 this.moveHdata.type=this.type 62 this.moveHdata.type = this.type
60 moveH(this.moveHdata).then(res=>{ 63 moveH(this.moveHdata).then(res => {
61 console.log(res) 64 console.log(res)
62 if (res.success) { 65 if (res.success) {
63 this.loading(); 66 this.loading();
64 this.close(); 67 this.close();
65 Message.success("移动成功") 68 Message.success("移动成功")
66 }else{ 69 } else {
67 Message.error(res.message) 70 Message.error(res.message)
68 } 71 }
69 }) 72 })
70 }, 73 },
71 cacel(){ 74 cacel() {
72 this.close() 75 this.close()
73 }, 76 },
74 close() { 77 close() {
...@@ -83,6 +86,15 @@ ...@@ -83,6 +86,15 @@
83 } 86 }
84 </script> 87 </script>
85 88
86 <style scoped> 89 <style scoped lang="less">
87 90 .bottom-radio{
91 text-align: center;
92 }
93 .el-radio{
94 padding: 20px;
95 }
96 .bottom-buttom {
97 margin-top: 20px;
98 text-align: center;
99 }
88 </style> 100 </style>
......
...@@ -166,6 +166,7 @@ ...@@ -166,6 +166,7 @@
166 }, 166 },
167 mounted() { 167 mounted() {
168 let bsm = this.$store.state.zdbsm 168 let bsm = this.$store.state.zdbsm
169 this.bsm=bsm;
169 this.getData(bsm) 170 this.getData(bsm)
170 }, 171 },
171 methods: { 172 methods: {
...@@ -260,6 +261,7 @@ ...@@ -260,6 +261,7 @@
260 computed: {}, 261 computed: {},
261 watch: { 262 watch: {
262 "$store.state.zdbsm": function (bsm) { 263 "$store.state.zdbsm": function (bsm) {
264 this.bsm=bsm
263 this.getData(bsm) 265 this.getData(bsm)
264 } 266 }
265 }, 267 },
......
...@@ -233,6 +233,7 @@ ...@@ -233,6 +233,7 @@
233 }, 233 },
234 mounted() { 234 mounted() {
235 let bsm = this.$store.state.zdbsm 235 let bsm = this.$store.state.zdbsm
236 this.bsm=bsm;
236 this.getData(bsm) 237 this.getData(bsm)
237 }, 238 },
238 methods: { 239 methods: {
...@@ -327,6 +328,7 @@ ...@@ -327,6 +328,7 @@
327 computed: {}, 328 computed: {},
328 watch: { 329 watch: {
329 "$store.state.zdbsm": function (bsm) { 330 "$store.state.zdbsm": function (bsm) {
331 this.bsm=bsm;
330 this.getData(bsm) 332 this.getData(bsm)
331 } 333 }
332 }, 334 },
......
1 <template> 1 <template>
2 <div class="">历史回溯</div> 2 <div class="">历史回溯
3 <div id="mountNode"></div>
4 </div>
3 </template> 5 </template>
4 6
5 <script> 7 <script>
8
9 import G6 from '@antv/g6';
10 import insertCss from 'insert-css';
11 import { getLshs } from "./../../../../src/api/fwsxbg";
12
6 export default { 13 export default {
7 name:"", 14 name:"",
8 components:{}, 15 components:{},
9 props:{}, 16 props:{},
10 data(){ 17 data(){
18 insertCss(`
19 .g6-tooltip {
20 border-radius: 6px;
21 font-size: 12px;
22 color: #fff;
23 background-color: #000;
24 padding: 2px 8px;
25 text-align: center;
26 }
27 `);
11 return { 28 return {
29 data : {}
30 }
31 },
32 created(){
33
34 },
35 mounted(){
36 this.getLshsData();
37 },
38 methods: {
39 initG6() {
40 const data = this.data;
41 G6.registerNode(
42 'sql',
43 {
44 drawShape(cfg, group) {
45 const rect = group.addShape('rect', {
46 attrs: {
47 x: -75,
48 y: -25,
49 width: 150,
50 height: 50,
51 radius: 10,
52 stroke: '#5B8FF9',
53 fill: '#C6E5FF',
54 lineWidth: 1,
55 },
56 name: 'rect-shape',
57 });
58 if (cfg.name) {
59 group.addShape('text', {
60 attrs: {
61 text: cfg.name,
62 x: 0,
63 y: 0,
64 fill: '#00287E',
65 fontSize: 14,
66 textAlign: 'center',
67 textBaseline: 'middle',
68 fontWeight: 'bold',
69 },
70 name: 'text-shape',
71 });
72 }
73 return rect;
74 },
75 },
76 'single-node',
77 );
78
79 const container = document.getElementById('mountNode');
80
81 const graph = new G6.Graph({
82 container: 'mountNode',
83 width:1000,
84 height:800,
85 layout: {
86 type: 'dagre',
87 nodesepFunc: (d) => {
88 if (d.id === '3') {
89 return 500;
90 }
91 return 50;
92 },
93 ranksep: 70,
94 controlPoints: true,
95 },
96 defaultNode: {
97 type: 'sql',
98 },
99 defaultEdge: {
100 type: 'polyline',
101 style: {
102 radius: 20,
103 offset: 45,
104 endArrow: true,
105 lineWidth: 2,
106 stroke: '#C2C8D5',
107 },
108 },
109 nodeStateStyles: {
110 selected: {
111 stroke: '#d9d9d9',
112 fill: '#5394ef',
113 },
114 },
115
116 modes: {
117 default: [
118 'drag-canvas',
119 'zoom-canvas',
120 'click-select',
121 {
122 type: 'tooltip',
123 formatText(model) {
124 const cfg = model.conf;
125 const text = [];
126 cfg.forEach((row) => {
127 text.push(row.label + ':' + row.value + '<br>');
128 });
129 return text.join('\n');
130 },
131 offset: 30,
132 },
133 ],
134 },
135 fitView: true,
136 });
137
138 graph.data(data);
139 graph.render();
140
141 if (typeof window !== 'undefined')
142 window.onresize = () => {
143 if (!graph || graph.get('destroyed')) return;
144 if (!container || !container.scrollWidth || !container.scrollHeight) return;
145 graph.changeSize(container.scrollWidth, container.scrollHeight);
146 };
147
148 },
149
150 getLshsData(){
151 let _this = this;
152 const data = {
153 "bsm": "c0818d9e4286b35b8ee9b96d90b522aa",
154 "type": "zd"
155 };
156 getLshs(data).then((res)=>{
157 if(res.code===200){
158 _this.data=res.result;
159 this.initG6();
160 }
161 })
12 } 162 }
13 }, 163 },
14 created(){},
15 mounted(){},
16 methods:{},
17 computed: {}, 164 computed: {},
18 watch: {}, 165 watch: {},
19 } 166 }
20 </script> 167 </script>
21 <style scoped lang="less"> 168 <style scoped lang="less">
169
22 </style> 170 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
112 <el-button type="primary" @click="addCVisible = false">取消</el-button> 112 <el-button type="primary" @click="addCVisible = false">取消</el-button>
113 </div> 113 </div>
114 </el-dialog> 114 </el-dialog>
115 <move-h :hbsm="chData.bsm" @close="moveHClose" :move-hvisible="moveHvisible" :type="syclx" @loading="loadingData"></move-h> 115 <move-h :hbsm="chData.bsm" @close="moveHClose" :move-hvisible="moveHvisible" :type="scyclx" @loading="loadingData"></move-h>
116 </div> 116 </div>
117 </template> 117 </template>
118 <script> 118 <script>
...@@ -177,7 +177,7 @@ export default { ...@@ -177,7 +177,7 @@ export default {
177 }, 177 },
178 methods: { 178 methods: {
179 loadingData(){ 179 loadingData(){
180 this.getLpb(this.$store.state.zrzbsm,this.$parent.syclx); 180 this.getLpb(this.$store.state.zrzbsm,this.$parent.scyclx);
181 }, 181 },
182 //获取楼盘表数据 182 //获取楼盘表数据
183 getLpb(zrzbsm,scyclx) { 183 getLpb(zrzbsm,scyclx) {
...@@ -357,7 +357,7 @@ export default { ...@@ -357,7 +357,7 @@ export default {
357 handleMoveH(){ 357 handleMoveH(){
358 // 移动户 358 // 移动户
359 console.log(this.chData,"chData") 359 console.log(this.chData,"chData")
360 console.log(this.$parent.syclx,"实预测类型") 360 console.log(this.$parent.scyclx,"实预测类型")
361 this.moveHvisible=true; 361 this.moveHvisible=true;
362 }, 362 },
363 moveHClose(){ 363 moveHClose(){
...@@ -395,19 +395,19 @@ export default { ...@@ -395,19 +395,19 @@ export default {
395 this.$message({ 395 this.$message({
396 message: "删除成功", 396 message: "删除成功",
397 type: "success", 397 type: "success",
398 }); 398 });
399 this.getLpb(this.$store.state.zrzbsm,this.$parent.scyclx); 399 this.getLpb(this.$store.state.zrzbsm,this.$parent.scyclx);
400 }else{ 400 }else{
401 this.$message({ 401 this.$message({
402 message: res.message, 402 message: res.message,
403 type: "warning", 403 type: "warning",
404 }); 404 });
405 } 405 }
406 }); 406 });
407 }).catch(() => { 407 }).catch(() => {
408 408
409 }); 409 });
410 410
411 }, 411 },
412 //确认添加 412 //确认添加
413 saveAddC(){ 413 saveAddC(){
...@@ -416,7 +416,7 @@ export default { ...@@ -416,7 +416,7 @@ export default {
416 this.$message({ 416 this.$message({
417 message: "添加成功", 417 message: "添加成功",
418 type: "success", 418 type: "success",
419 }); 419 });
420 this.getLpb(this.$store.state.zrzbsm,this.$parent.scyclx); 420 this.getLpb(this.$store.state.zrzbsm,this.$parent.scyclx);
421 this.addCVisible = false; 421 this.addCVisible = false;
422 }else{ 422 }else{
...@@ -424,7 +424,7 @@ export default { ...@@ -424,7 +424,7 @@ export default {
424 message: res.message, 424 message: res.message,
425 type: "warning", 425 type: "warning",
426 }); 426 });
427 } 427 }
428 }); 428 });
429 }, 429 },
430 //end 430 //end
...@@ -632,7 +632,7 @@ export default { ...@@ -632,7 +632,7 @@ export default {
632 text-align: center; 632 text-align: center;
633 transition: 0.5s; 633 transition: 0.5s;
634 } 634 }
635 635
636 .btnGroup { 636 .btnGroup {
637 margin: 20px auto 0; 637 margin: 20px auto 0;
638 width: 150px; 638 width: 150px;
......