4e928d97 by weimo934

feat(fg):删除多幢.自然幢功能

1 parent 1c24f3f9
......@@ -22,9 +22,10 @@
<span>多幢信息({{zdZxx.dzList.length}}个)</span>
</div>
<ul>
<li v-for="(item,index) in zdZxx.dzList" :key="index" @mouseenter="mouseenter" @mouseleave="mouseleave"
<li v-for="(item,index) in zdZxx.dzList" :key="index"
:class="[{'search':!zdDzList.includes(item)}]"
>{{item.displays}}</li>
>{{item.displays}}
</li>
</ul>
</div>
<div class="zrz">
......@@ -33,7 +34,8 @@
</div>
<ul>
<li v-for="(item,index) in zdZxx.zrzList" :key="index"
:class="[{'oddborder':((index+1)%2) === 1},{'search':!zdZrzList.includes(item)}]">{{item.displays}}
:class="[{'oddborder':((index+1)%2) === 1},{'search':!zdZrzList.includes(item)}]">
{{item.displays}}
</li>
</ul>
</div>
......@@ -119,11 +121,20 @@
<td class="xzzxx">
<span>多幢:</span>
<ul>
<li v-for="(dzItem,dzIndex) in item.dz" :key="dzIndex">{{dzItem}}</li>
<li v-for="(dzItem,dzIndex) in item.dz" :key="dzIndex"
@mouseenter="mouseenter($event,index,dzIndex,'dz')"
@mouseleave="mouseleave($event)">{{dzItem.xmmc}}
<span v-if="dzIndex<item.dz.length-1">,</span>
</li>
</ul>
<span>自然幢:</span>
<ul>
<li v-for="(dzItem,dzIndex) in item.zrz" :key="dzIndex">{{dzItem}}</li>
<li v-for="(zrzItem,zrzIndex) in item.zrz" :key="zrzIndex"
@mouseenter="mouseenter($event,index,zrzIndex,'zrz')"
@mouseleave="mouseleave($event)"
>{{zrzItem.xmmc}}
<span v-if="zrzIndex<item.zrz.length-1">,</span>
</li>
</ul>
</td>
<td class="">
......@@ -547,29 +558,60 @@
})
},
methods: {
mouseenter(){
console.log("鼠标进入....")
mouseenter(event, index, dzIndex,type) {
let range = document.createRange();
range.selectNodeContents(event.target);
let selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
var self=this;
document.onkeydown = function (e){
let key = e || window.event || arguments.callee.caller.arguments[0];
console.log(key.code, 'keycode')
if (key && (key.keyCode == '8' || key.code == 'Delete')) {
let dz={};
switch (type) {
case "dz":
dz = self.zdFghData.newZdlist[index].dz[dzIndex];
// 删除数据
self.zdFghData.newZdlist[index].dz.splice(dzIndex, 1);
// 添加数据
self.zdDzList.push(dz)
break;
case "zrz":
dz = self.zdFghData.newZdlist[index].zrz[dzIndex];
// 删除数据
self.zdFghData.newZdlist[index].zrz.splice(dzIndex, 1);
// 添加数据
self.zdZrzList.push(dz)
break;
default:
break;
}
}
};
},
mouseleave(){
console.log("鼠标移出...")
mouseleave(event) {
let selection = window.getSelection();
selection.removeAllRanges();
},
// 重置数据
result(){
result() {
switch (this.tabName) {
case "zd":
this.zdFghData={
this.zdFghData = {
oldZdbsm: "",
newZdlist: []
}
break
case "dz":
this.dzFghData={
this.dzFghData = {
oldZdbsm: "",
newZdlist: []
}
break
case "h":
this.hFghData={
this.hFghData = {
oldZdbsm: "",
newZdlist: []
}
......@@ -596,7 +638,7 @@
zbsm: command,
ztype: 'dz'
});
this.zdFghData.newZdlist[index].dz.push(item.xmmc)
this.zdFghData.newZdlist[index].dz.push(item)
this.zdDzList = this.zdDzList.filter(i => i.bsm !== command);
},
zrzHandleCommand(command, index) {
......@@ -605,7 +647,7 @@
zbsm: command,
ztype: 'zrz'
})
this.zdFghData.newZdlist[index].zrz.push(item.xmmc)
this.zdFghData.newZdlist[index].zrz.push(item)
this.zdZrzList = this.zdZrzList.filter(i => i.bsm !== command);
},
ZdgetDzXx(zdbsm) {
......@@ -643,7 +685,7 @@
saveZd() {
zdfg(this.zdFghData).then(res => {
if (res.success) {
this.$store.state.zdbsms=res.result;
this.$store.state.zdbsms = res.result;
this.$router.push({
path: '/zd',
query: {
......@@ -668,8 +710,8 @@
this.checkedData = res.result
// 用户bsm暂时传空
this.checkedData.userbsm = ''
this.checkedData.dz=[],
this.checkedData.zrz=[],
this.checkedData.dz = [],
this.checkedData.zrz = [],
// fwlist 暂时传空
this.checkedData.fwlist = []
})
......@@ -679,8 +721,8 @@
this.checkedData = res.result
// 用户bsm暂时传空
this.checkedData.userbsm = ''
this.checkedData.dz=[],
this.checkedData.zrz=[],
this.checkedData.dz = [],
this.checkedData.zrz = [],
// fwlist 暂时传空
this.checkedData.fwlist = []
})
......@@ -690,8 +732,8 @@
this.checkedData = res.result
// 用户bsm暂时传空
this.checkedData.userbsm = ''
this.checkedData.dz=[],
this.checkedData.zrz=[],
this.checkedData.dz = [],
this.checkedData.zrz = [],
// fwlist 暂时传空
this.checkedData.fwlist = []
})
......@@ -947,7 +989,7 @@
padding: 5px;
line-height: 20px;
color: #BBB;
span{
span {
color: #000;
}
}
......@@ -1071,8 +1113,8 @@
height: 480px;
overflow: auto;
margin-top: 10px;
table{
margin: 0 20px ;
table {
margin: 0 20px;
}
}
.header-button {
......@@ -1105,13 +1147,15 @@
background-color: rgba(0, 202, 205, .8);
border-color: rgba(0, 202, 205, .8);
}
.xzzxx{
ul{
li{
.xzzxx {
ul {
li {
display: inline-block;
}
}
}
.cz, .xh {
width: 100px;
}
......@@ -1119,7 +1163,8 @@
.xzq, .djq, .djzq {
width: 150px;
}
.search{
.search {
color: #BBB !important;
}
</style>
......