c5092ce9 by 杨威

户双击功能

1 parent 0fa2bed3
......@@ -46,6 +46,7 @@
<el-dialog
title="权利人信息"
:visible.sync="dialogVisible"
append-to-body
width="50%"
center
>
......
......@@ -72,12 +72,6 @@ const constantRoutes = [
component: () => import("@/views/systemDZ/index"),
},
{
path: "/h",
name: "户",
code: "1-3",
component: () => import("@/views/systemH/index"),
},
{
path: "/zd",
name: "宗地",
code: "1-5",
......
<template>
<div class="content_box">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="自然幢信息" name="hxx"><hxx></hxx></el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import hxx from "./hxx";
export default {
name: "",
components: {
hxx
},
props: {},
data() {
return {
activeName: "hxx",
};
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
},
},
created() {},
mounted() {},
computed: {},
watch: {},
};
</script>
<style scoped lang="less"></style>
......@@ -365,17 +365,17 @@
</tbody>
</table>
</el-form>
<div style="min-height: 40px;text-align: center;margin-top: 10px">
<!-- <div style="min-height: 40px;text-align: center;margin-top: 10px">
<el-button type="success" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
</div> -->
</div>
</template>
<script>
import Qlr from "../../../components/formMenu/qlr";
import Qlxz from "../../../components/formMenu/qlxz_simple";
import Qlr from "./../../../../../components/formMenu/qlr";
import Qlxz from "./../../../../../components/formMenu/qlxz";
export default {
name:'zrz',
components:{
......@@ -510,22 +510,28 @@
this.fwjgTitleRowspan=this.form.fwjgList.length;
}
},
onSave(){
console.log(this.form)
//保存户信息
onSave(bsm,yclx){
console.log(bsm);
console.log(yclx)
},
onSubmit(){
console.log(this.form)
onReset(){
},
//根据户bsm查询户信息
getHInfo(bsm){
}
}
}
</script>
<style rel="stylesheet/less" lang="less" scoped>
.h {
min-height: 200px;
width: 80%;
height: 600px;
width: 100%;
margin-top: 10px;
margin-left: 10%;
float: left;
overflow-y: scroll;
overflow-x: hidden;
/deep/.el-input__inner{
width: 100%;
......
......@@ -4,8 +4,8 @@
<el-row class="searchContent">
<el-col :span="8">
<el-radio-group v-model="tabPosition">
<el-radio-button label="sc">实测</el-radio-button>
<el-radio-button label="yc">预测</el-radio-button>
<el-radio-button label="1">实测</el-radio-button>
<el-radio-button label="0">预测</el-radio-button>
</el-radio-group>
<el-input
v-model="bdcdyh"
......@@ -98,6 +98,7 @@
</div>
</div>
<!-- 右键菜单弹出框 -->
<el-dialog title="添加" :visible.sync="dialogVisible" width="50%" center>
<!-- 根据菜单类型(menuType)和右键点击的楼盘类型(treeData.type)来区分弹框内容 -->
<div class="addCh" v-show="menuType == 'ljz'">
......@@ -117,9 +118,21 @@
>
</div>
</el-dialog>
<!-- 批量操作弹出框 -->
<pl-h :plh-visible="plhVisible" :bsms="bsms" @close="plhClose"></pl-h>
<pl-c :plc-visible="plcVisible" :bsms="bsms" @close="plcClose"></pl-c>
<pl-sh :plShVisible="plShVisible" :bsms="bsms" @close="plshClose"></pl-sh>
<!-- 双击户的弹出框 -->
<el-dialog title="户编辑" :visible.sync="hbjVisible" width="50%" center>
<hbj ref="hbj"></hbj>
<div class="btnGroup">
<el-button type="primary" @click="hbjSaveInfo">保存</el-button>
<el-button type="primary" @click="hbjResetInfo">重置</el-button>
<el-button type="primary" @click="hbjVisible = false"
>取消</el-button
>
</div>
</el-dialog>
</div>
</template>
......@@ -131,27 +144,29 @@ import LineTree from "../../../../components/lineTree/lineTree";
import addLjz from "./ljz/index";
import addZdy from "./zdy/index";
import addCh from "./ch/index";
import hbj from "./hbj/index"
import lpbContent from "./lpbContent/index";
import { getLpbMenuTree } from "../../../../api/lpb";
export default {
name: "",
components: { LineTree, addLjz, addZdy, addCh, lpbContent,PlC,PlSh,PlH },
components: { LineTree, addLjz, addZdy, addCh, lpbContent,PlC,PlSh,PlH,hbj },
props: {},
data() {
return {
bsms:["123","321","231"],
dialogVisible: false,
plcVisible:false,
plhVisible:false,
plShVisible:false,
tabPosition:'sc',
plShVisible:false,
hbjVisible:false,
tabPosition:'0',
radio1: "",
radio2: "",
createFlag: false,
bdcdyh: "",
islpb: true,
pd: [], //创建楼盘的树结构数据
dialogVisible: false,
menuType: "",
treeData: {},
inputWidth:74,
......@@ -307,9 +322,19 @@ export default {
this.legendToggleFlag = !this.legendToggleFlag;
},
//获取选中户bsm
getHbsm(data){
getHbsm(data,type){
this.bsms = data;
// console.log(this.bsms);
let self = this;
if(type){
// 双击
console.log('双击了');
this.hbjVisible = true;
self.$refs.hbj.getHInfo(this.bsms[this.bsms.length-1]);
}else{
//单击
console.log('单击了');
}
console.log(this.bsms);
},
inputFocus(){
this.inputWidth = 200
......@@ -321,6 +346,15 @@ export default {
if (this.bdcdyh!='') {
console.log('查询'+this.bdcdyh);
}
},
//户保存
hbjSaveInfo(){
let bsm = this.bsms[this.bsms.length-1]
this.$refs.hbj.onSave(bsm,this.tabPosition);
},
//户编辑表单重置
hbjResetInfo(){
this.$refs.hbj.onReset();
}
},
computed: {
......
......@@ -13,7 +13,7 @@
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<!-- 显示户 -->
<td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)">{{hs.hh}}</td>
<td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.hh}}</td>
</tr>
</table>
<!-- 幢单元名称 -->
......@@ -37,7 +37,7 @@
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<!-- 显示户 -->
<td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)">{{hs.hh}}</td>
<td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.hh}}</td>
</tr>
</table>
<!-- 幢单元名称 -->
......@@ -48,12 +48,12 @@
<!-- 循环自然幢下的独立层户 -->
<!-- <template > -->
<div class="zdy chTabel-wrap" :style="{'min-height':cHeight+'px'}">
<table class="chTable" ref="ch" border="1" cellspacing="0" cellpadding="0" v-show="lpbData.cs.length>0" >
<table class="chTable" ref="ch" border="1" cellspacing="0" cellpadding="0" v-show="lpbData.cs != null && lpbData.cs.length>0" >
<tr v-for="(cs,csIndex) in lpbData.cs" :key="csIndex">
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<!-- 显示户 -->
<td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)">{{hs.hh}}</td>
<td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.hh}}</td>
</tr>
</table>
</div>
......@@ -377,7 +377,8 @@ export default {
zdyWidth:2000,
cHeight:0,
loading:true,
hbsmList:[]
hbsmList:[],
time:null, //区分单双击事件的定时器
};
},
created() {
......@@ -397,6 +398,7 @@ export default {
getLpb(zrzbsm)
.then((res => {
if (res.code == 200) {
this.loading = false;
this.lpbData = res.result;
setTimeout(() => {
//计算逻辑幢宽度 20为marginRight值
......@@ -411,7 +413,6 @@ export default {
this.cHeight = item.offsetHeight > this.cHeight ? item.offsetHeight : this.cHeight;
})
this.zdyWidth += this.$refs.ch.offsetWidth;
this.loading = false
}, 200);
} else {
this.$message({
......@@ -421,19 +422,31 @@ export default {
}
}))
},
//td点击事件
//户单击事件
handleTdClick(e,bsm){
//判断点击的户是否选中
if(e.target.className.indexOf('tdSelect') == -1){
//未选中
e.target.className = 'tdSelect'; //加边框
this.hbsmList.push(bsm) // 将户bsm放进hbsmList
}else{
//选中
e.target.className = '';
this.deleteArrOption(this.hbsmList,bsm);
}
this.$parent.getHbsm(this.hbsmList);
let self = this;
// 开启延时器,200ms的间隔区分单击和双击,解决双击时执行两次单击事件
clearTimeout(self.time);
self.time = setTimeout(() => {
//判断点击的户是否选中
if(e.target.className.indexOf('tdSelect') == -1){
//未选中
e.target.className = 'tdSelect'; //加边框
this.hbsmList.push(bsm) // 将户bsm放进hbsmList
}else{
//选中
e.target.className = '';
this.deleteArrOption(this.hbsmList,bsm);
}
this.$parent.getHbsm(this.hbsmList,false);
}, 200);
},
//户双击事件
dbclick(bsm){
clearTimeout(this.time);
this.hbsmList.push(bsm) // 将户bsm放进hbsmList
this.$parent.getHbsm(this.hbsmList,true);
},
//删除多重数组中的某一项
deleteArrOption(arr, item) {
......