c5092ce9 by 杨威

户双击功能

1 parent 0fa2bed3
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
46 <el-dialog 46 <el-dialog
47 title="权利人信息" 47 title="权利人信息"
48 :visible.sync="dialogVisible" 48 :visible.sync="dialogVisible"
49 append-to-body
49 width="50%" 50 width="50%"
50 center 51 center
51 > 52 >
......
...@@ -72,12 +72,6 @@ const constantRoutes = [ ...@@ -72,12 +72,6 @@ const constantRoutes = [
72 component: () => import("@/views/systemDZ/index"), 72 component: () => import("@/views/systemDZ/index"),
73 }, 73 },
74 { 74 {
75 path: "/h",
76 name: "户",
77 code: "1-3",
78 component: () => import("@/views/systemH/index"),
79 },
80 {
81 path: "/zd", 75 path: "/zd",
82 name: "宗地", 76 name: "宗地",
83 code: "1-5", 77 code: "1-5",
......
1 <template>
2 <div class="content_box">
3 <el-tabs v-model="activeName" @tab-click="handleClick">
4 <el-tab-pane label="自然幢信息" name="hxx"><hxx></hxx></el-tab-pane>
5 </el-tabs>
6 </div>
7 </template>
8
9 <script>
10 import hxx from "./hxx";
11 export default {
12 name: "",
13 components: {
14 hxx
15 },
16 props: {},
17 data() {
18 return {
19 activeName: "hxx",
20 };
21 },
22 methods: {
23 handleClick(tab, event) {
24 console.log(tab, event);
25 },
26 },
27 created() {},
28 mounted() {},
29 computed: {},
30 watch: {},
31 };
32 </script>
33 <style scoped lang="less"></style>
...@@ -365,17 +365,17 @@ ...@@ -365,17 +365,17 @@
365 </tbody> 365 </tbody>
366 </table> 366 </table>
367 </el-form> 367 </el-form>
368 <div style="min-height: 40px;text-align: center;margin-top: 10px"> 368 <!-- <div style="min-height: 40px;text-align: center;margin-top: 10px">
369 <el-button type="success" @click="onSave">保存</el-button> 369 <el-button type="success" @click="onSave">保存</el-button>
370 <el-button type="primary" @click="onSubmit">提交</el-button> 370 <el-button type="primary" @click="onSubmit">提交</el-button>
371 </div> 371 </div> -->
372 </div> 372 </div>
373 373
374 </template> 374 </template>
375 375
376 <script> 376 <script>
377 import Qlr from "../../../components/formMenu/qlr"; 377 import Qlr from "./../../../../../components/formMenu/qlr";
378 import Qlxz from "../../../components/formMenu/qlxz_simple"; 378 import Qlxz from "./../../../../../components/formMenu/qlxz";
379 export default { 379 export default {
380 name:'zrz', 380 name:'zrz',
381 components:{ 381 components:{
...@@ -510,22 +510,28 @@ ...@@ -510,22 +510,28 @@
510 this.fwjgTitleRowspan=this.form.fwjgList.length; 510 this.fwjgTitleRowspan=this.form.fwjgList.length;
511 } 511 }
512 }, 512 },
513 onSave(){ 513 //保存户信息
514 console.log(this.form) 514 onSave(bsm,yclx){
515 console.log(bsm);
516 console.log(yclx)
515 }, 517 },
516 onSubmit(){ 518 onReset(){
517 console.log(this.form) 519
520 },
521 //根据户bsm查询户信息
522 getHInfo(bsm){
523
518 } 524 }
519 } 525 }
520 } 526 }
521 </script> 527 </script>
522 <style rel="stylesheet/less" lang="less" scoped> 528 <style rel="stylesheet/less" lang="less" scoped>
523 .h { 529 .h {
524 min-height: 200px; 530 height: 600px;
525 width: 80%; 531 width: 100%;
526 margin-top: 10px; 532 margin-top: 10px;
527 margin-left: 10%; 533 overflow-y: scroll;
528 float: left; 534 overflow-x: hidden;
529 535
530 /deep/.el-input__inner{ 536 /deep/.el-input__inner{
531 width: 100%; 537 width: 100%;
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
4 <el-row class="searchContent"> 4 <el-row class="searchContent">
5 <el-col :span="8"> 5 <el-col :span="8">
6 <el-radio-group v-model="tabPosition"> 6 <el-radio-group v-model="tabPosition">
7 <el-radio-button label="sc">实测</el-radio-button> 7 <el-radio-button label="1">实测</el-radio-button>
8 <el-radio-button label="yc">预测</el-radio-button> 8 <el-radio-button label="0">预测</el-radio-button>
9 </el-radio-group> 9 </el-radio-group>
10 <el-input 10 <el-input
11 v-model="bdcdyh" 11 v-model="bdcdyh"
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
98 </div> 98 </div>
99 </div> 99 </div>
100 100
101 <!-- 右键菜单弹出框 -->
101 <el-dialog title="添加" :visible.sync="dialogVisible" width="50%" center> 102 <el-dialog title="添加" :visible.sync="dialogVisible" width="50%" center>
102 <!-- 根据菜单类型(menuType)和右键点击的楼盘类型(treeData.type)来区分弹框内容 --> 103 <!-- 根据菜单类型(menuType)和右键点击的楼盘类型(treeData.type)来区分弹框内容 -->
103 <div class="addCh" v-show="menuType == 'ljz'"> 104 <div class="addCh" v-show="menuType == 'ljz'">
...@@ -117,9 +118,21 @@ ...@@ -117,9 +118,21 @@
117 > 118 >
118 </div> 119 </div>
119 </el-dialog> 120 </el-dialog>
121 <!-- 批量操作弹出框 -->
120 <pl-h :plh-visible="plhVisible" :bsms="bsms" @close="plhClose"></pl-h> 122 <pl-h :plh-visible="plhVisible" :bsms="bsms" @close="plhClose"></pl-h>
121 <pl-c :plc-visible="plcVisible" :bsms="bsms" @close="plcClose"></pl-c> 123 <pl-c :plc-visible="plcVisible" :bsms="bsms" @close="plcClose"></pl-c>
122 <pl-sh :plShVisible="plShVisible" :bsms="bsms" @close="plshClose"></pl-sh> 124 <pl-sh :plShVisible="plShVisible" :bsms="bsms" @close="plshClose"></pl-sh>
125 <!-- 双击户的弹出框 -->
126 <el-dialog title="户编辑" :visible.sync="hbjVisible" width="50%" center>
127 <hbj ref="hbj"></hbj>
128 <div class="btnGroup">
129 <el-button type="primary" @click="hbjSaveInfo">保存</el-button>
130 <el-button type="primary" @click="hbjResetInfo">重置</el-button>
131 <el-button type="primary" @click="hbjVisible = false"
132 >取消</el-button
133 >
134 </div>
135 </el-dialog>
123 </div> 136 </div>
124 </template> 137 </template>
125 138
...@@ -131,27 +144,29 @@ import LineTree from "../../../../components/lineTree/lineTree"; ...@@ -131,27 +144,29 @@ import LineTree from "../../../../components/lineTree/lineTree";
131 import addLjz from "./ljz/index"; 144 import addLjz from "./ljz/index";
132 import addZdy from "./zdy/index"; 145 import addZdy from "./zdy/index";
133 import addCh from "./ch/index"; 146 import addCh from "./ch/index";
147 import hbj from "./hbj/index"
134 import lpbContent from "./lpbContent/index"; 148 import lpbContent from "./lpbContent/index";
135 import { getLpbMenuTree } from "../../../../api/lpb"; 149 import { getLpbMenuTree } from "../../../../api/lpb";
136 150
137 export default { 151 export default {
138 name: "", 152 name: "",
139 components: { LineTree, addLjz, addZdy, addCh, lpbContent,PlC,PlSh,PlH }, 153 components: { LineTree, addLjz, addZdy, addCh, lpbContent,PlC,PlSh,PlH,hbj },
140 props: {}, 154 props: {},
141 data() { 155 data() {
142 return { 156 return {
143 bsms:["123","321","231"], 157 bsms:["123","321","231"],
158 dialogVisible: false,
144 plcVisible:false, 159 plcVisible:false,
145 plhVisible:false, 160 plhVisible:false,
146 plShVisible:false, 161 plShVisible:false,
147 tabPosition:'sc', 162 hbjVisible:false,
163 tabPosition:'0',
148 radio1: "", 164 radio1: "",
149 radio2: "", 165 radio2: "",
150 createFlag: false, 166 createFlag: false,
151 bdcdyh: "", 167 bdcdyh: "",
152 islpb: true, 168 islpb: true,
153 pd: [], //创建楼盘的树结构数据 169 pd: [], //创建楼盘的树结构数据
154 dialogVisible: false,
155 menuType: "", 170 menuType: "",
156 treeData: {}, 171 treeData: {},
157 inputWidth:74, 172 inputWidth:74,
...@@ -307,9 +322,19 @@ export default { ...@@ -307,9 +322,19 @@ export default {
307 this.legendToggleFlag = !this.legendToggleFlag; 322 this.legendToggleFlag = !this.legendToggleFlag;
308 }, 323 },
309 //获取选中户bsm 324 //获取选中户bsm
310 getHbsm(data){ 325 getHbsm(data,type){
311 this.bsms = data; 326 this.bsms = data;
312 // console.log(this.bsms); 327 let self = this;
328 if(type){
329 // 双击
330 console.log('双击了');
331 this.hbjVisible = true;
332 self.$refs.hbj.getHInfo(this.bsms[this.bsms.length-1]);
333 }else{
334 //单击
335 console.log('单击了');
336 }
337 console.log(this.bsms);
313 }, 338 },
314 inputFocus(){ 339 inputFocus(){
315 this.inputWidth = 200 340 this.inputWidth = 200
...@@ -321,6 +346,15 @@ export default { ...@@ -321,6 +346,15 @@ export default {
321 if (this.bdcdyh!='') { 346 if (this.bdcdyh!='') {
322 console.log('查询'+this.bdcdyh); 347 console.log('查询'+this.bdcdyh);
323 } 348 }
349 },
350 //户保存
351 hbjSaveInfo(){
352 let bsm = this.bsms[this.bsms.length-1]
353 this.$refs.hbj.onSave(bsm,this.tabPosition);
354 },
355 //户编辑表单重置
356 hbjResetInfo(){
357 this.$refs.hbj.onReset();
324 } 358 }
325 }, 359 },
326 computed: { 360 computed: {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 <!-- 显示层数 --> 13 <!-- 显示层数 -->
14 <td class="floor">{{cs.sjc}}</td> 14 <td class="floor">{{cs.sjc}}</td>
15 <!-- 显示户 --> 15 <!-- 显示户 -->
16 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)">{{hs.hh}}</td> 16 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.hh}}</td>
17 </tr> 17 </tr>
18 </table> 18 </table>
19 <!-- 幢单元名称 --> 19 <!-- 幢单元名称 -->
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
37 <!-- 显示层数 --> 37 <!-- 显示层数 -->
38 <td class="floor">{{cs.sjc}}</td> 38 <td class="floor">{{cs.sjc}}</td>
39 <!-- 显示户 --> 39 <!-- 显示户 -->
40 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)">{{hs.hh}}</td> 40 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.hh}}</td>
41 </tr> 41 </tr>
42 </table> 42 </table>
43 <!-- 幢单元名称 --> 43 <!-- 幢单元名称 -->
...@@ -48,12 +48,12 @@ ...@@ -48,12 +48,12 @@
48 <!-- 循环自然幢下的独立层户 --> 48 <!-- 循环自然幢下的独立层户 -->
49 <!-- <template > --> 49 <!-- <template > -->
50 <div class="zdy chTabel-wrap" :style="{'min-height':cHeight+'px'}"> 50 <div class="zdy chTabel-wrap" :style="{'min-height':cHeight+'px'}">
51 <table class="chTable" ref="ch" border="1" cellspacing="0" cellpadding="0" v-show="lpbData.cs.length>0" > 51 <table class="chTable" ref="ch" border="1" cellspacing="0" cellpadding="0" v-show="lpbData.cs != null && lpbData.cs.length>0" >
52 <tr v-for="(cs,csIndex) in lpbData.cs" :key="csIndex"> 52 <tr v-for="(cs,csIndex) in lpbData.cs" :key="csIndex">
53 <!-- 显示层数 --> 53 <!-- 显示层数 -->
54 <td class="floor">{{cs.sjc}}</td> 54 <td class="floor">{{cs.sjc}}</td>
55 <!-- 显示户 --> 55 <!-- 显示户 -->
56 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)">{{hs.hh}}</td> 56 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.hh}}</td>
57 </tr> 57 </tr>
58 </table> 58 </table>
59 </div> 59 </div>
...@@ -377,7 +377,8 @@ export default { ...@@ -377,7 +377,8 @@ export default {
377 zdyWidth:2000, 377 zdyWidth:2000,
378 cHeight:0, 378 cHeight:0,
379 loading:true, 379 loading:true,
380 hbsmList:[] 380 hbsmList:[],
381 time:null, //区分单双击事件的定时器
381 }; 382 };
382 }, 383 },
383 created() { 384 created() {
...@@ -397,6 +398,7 @@ export default { ...@@ -397,6 +398,7 @@ export default {
397 getLpb(zrzbsm) 398 getLpb(zrzbsm)
398 .then((res => { 399 .then((res => {
399 if (res.code == 200) { 400 if (res.code == 200) {
401 this.loading = false;
400 this.lpbData = res.result; 402 this.lpbData = res.result;
401 setTimeout(() => { 403 setTimeout(() => {
402 //计算逻辑幢宽度 20为marginRight值 404 //计算逻辑幢宽度 20为marginRight值
...@@ -411,7 +413,6 @@ export default { ...@@ -411,7 +413,6 @@ export default {
411 this.cHeight = item.offsetHeight > this.cHeight ? item.offsetHeight : this.cHeight; 413 this.cHeight = item.offsetHeight > this.cHeight ? item.offsetHeight : this.cHeight;
412 }) 414 })
413 this.zdyWidth += this.$refs.ch.offsetWidth; 415 this.zdyWidth += this.$refs.ch.offsetWidth;
414 this.loading = false
415 }, 200); 416 }, 200);
416 } else { 417 } else {
417 this.$message({ 418 this.$message({
...@@ -421,19 +422,31 @@ export default { ...@@ -421,19 +422,31 @@ export default {
421 } 422 }
422 })) 423 }))
423 }, 424 },
424 //td点击事件 425 //户单击事件
425 handleTdClick(e,bsm){ 426 handleTdClick(e,bsm){
426 //判断点击的户是否选中 427 let self = this;
427 if(e.target.className.indexOf('tdSelect') == -1){ 428 // 开启延时器,200ms的间隔区分单击和双击,解决双击时执行两次单击事件
428 //未选中 429 clearTimeout(self.time);
429 e.target.className = 'tdSelect'; //加边框 430 self.time = setTimeout(() => {
430 this.hbsmList.push(bsm) // 将户bsm放进hbsmList 431 //判断点击的户是否选中
431 }else{ 432 if(e.target.className.indexOf('tdSelect') == -1){
432 //选中 433 //未选中
433 e.target.className = ''; 434 e.target.className = 'tdSelect'; //加边框
434 this.deleteArrOption(this.hbsmList,bsm); 435 this.hbsmList.push(bsm) // 将户bsm放进hbsmList
435 } 436 }else{
436 this.$parent.getHbsm(this.hbsmList); 437 //选中
438 e.target.className = '';
439 this.deleteArrOption(this.hbsmList,bsm);
440 }
441 this.$parent.getHbsm(this.hbsmList,false);
442 }, 200);
443
444 },
445 //户双击事件
446 dbclick(bsm){
447 clearTimeout(this.time);
448 this.hbsmList.push(bsm) // 将户bsm放进hbsmList
449 this.$parent.getHbsm(this.hbsmList,true);
437 }, 450 },
438 //删除多重数组中的某一项 451 //删除多重数组中的某一项
439 deleteArrOption(arr, item) { 452 deleteArrOption(arr, item) {
......