feat(fg):删除多幢.自然幢功能
Showing
1 changed file
with
81 additions
and
36 deletions
... | @@ -22,9 +22,10 @@ | ... | @@ -22,9 +22,10 @@ |
22 | <span>多幢信息({{zdZxx.dzList.length}}个)</span> | 22 | <span>多幢信息({{zdZxx.dzList.length}}个)</span> |
23 | </div> | 23 | </div> |
24 | <ul> | 24 | <ul> |
25 | <li v-for="(item,index) in zdZxx.dzList" :key="index" @mouseenter="mouseenter" @mouseleave="mouseleave" | 25 | <li v-for="(item,index) in zdZxx.dzList" :key="index" |
26 | :class="[{'search':!zdDzList.includes(item)}]" | 26 | :class="[{'search':!zdDzList.includes(item)}]" |
27 | >{{item.displays}}</li> | 27 | >{{item.displays}} |
28 | </li> | ||
28 | </ul> | 29 | </ul> |
29 | </div> | 30 | </div> |
30 | <div class="zrz"> | 31 | <div class="zrz"> |
... | @@ -33,7 +34,8 @@ | ... | @@ -33,7 +34,8 @@ |
33 | </div> | 34 | </div> |
34 | <ul> | 35 | <ul> |
35 | <li v-for="(item,index) in zdZxx.zrzList" :key="index" | 36 | <li v-for="(item,index) in zdZxx.zrzList" :key="index" |
36 | :class="[{'oddborder':((index+1)%2) === 1},{'search':!zdZrzList.includes(item)}]">{{item.displays}} | 37 | :class="[{'oddborder':((index+1)%2) === 1},{'search':!zdZrzList.includes(item)}]"> |
38 | {{item.displays}} | ||
37 | </li> | 39 | </li> |
38 | </ul> | 40 | </ul> |
39 | </div> | 41 | </div> |
... | @@ -119,11 +121,20 @@ | ... | @@ -119,11 +121,20 @@ |
119 | <td class="xzzxx"> | 121 | <td class="xzzxx"> |
120 | <span>多幢:</span> | 122 | <span>多幢:</span> |
121 | <ul> | 123 | <ul> |
122 | <li v-for="(dzItem,dzIndex) in item.dz" :key="dzIndex">{{dzItem}}</li> | 124 | <li v-for="(dzItem,dzIndex) in item.dz" :key="dzIndex" |
125 | @mouseenter="mouseenter($event,index,dzIndex,'dz')" | ||
126 | @mouseleave="mouseleave($event)">{{dzItem.xmmc}} | ||
127 | <span v-if="dzIndex<item.dz.length-1">,</span> | ||
128 | </li> | ||
123 | </ul> | 129 | </ul> |
124 | <span>自然幢:</span> | 130 | <span>自然幢:</span> |
125 | <ul> | 131 | <ul> |
126 | <li v-for="(dzItem,dzIndex) in item.zrz" :key="dzIndex">{{dzItem}}</li> | 132 | <li v-for="(zrzItem,zrzIndex) in item.zrz" :key="zrzIndex" |
133 | @mouseenter="mouseenter($event,index,zrzIndex,'zrz')" | ||
134 | @mouseleave="mouseleave($event)" | ||
135 | >{{zrzItem.xmmc}} | ||
136 | <span v-if="zrzIndex<item.zrz.length-1">,</span> | ||
137 | </li> | ||
127 | </ul> | 138 | </ul> |
128 | </td> | 139 | </td> |
129 | <td class=""> | 140 | <td class=""> |
... | @@ -448,7 +459,7 @@ | ... | @@ -448,7 +459,7 @@ |
448 | </table> | 459 | </table> |
449 | </div> | 460 | </div> |
450 | <query-data @getData="getData" :centerDialogVisible.sync="centerDialogVisible" :dylxs="['h']" | 461 | <query-data @getData="getData" :centerDialogVisible.sync="centerDialogVisible" :dylxs="['h']" |
451 | :isZdClose="true" @close="close"></query-data> | 462 | :isZdClose="true" @close="close"></query-data> |
452 | <div class="header-button" :style="{width:fgBoxWidth+'px'}"> | 463 | <div class="header-button" :style="{width:fgBoxWidth+'px'}"> |
453 | <el-button type="primary" class="saveBtn" @click="save">保存</el-button> | 464 | <el-button type="primary" class="saveBtn" @click="save">保存</el-button> |
454 | </div> | 465 | </div> |
... | @@ -547,29 +558,60 @@ | ... | @@ -547,29 +558,60 @@ |
547 | }) | 558 | }) |
548 | }, | 559 | }, |
549 | methods: { | 560 | methods: { |
550 | mouseenter(){ | 561 | mouseenter(event, index, dzIndex,type) { |
551 | console.log("鼠标进入....") | 562 | let range = document.createRange(); |
563 | range.selectNodeContents(event.target); | ||
564 | let selection = window.getSelection(); | ||
565 | selection.removeAllRanges(); | ||
566 | selection.addRange(range); | ||
567 | var self=this; | ||
568 | document.onkeydown = function (e){ | ||
569 | let key = e || window.event || arguments.callee.caller.arguments[0]; | ||
570 | console.log(key.code, 'keycode') | ||
571 | if (key && (key.keyCode == '8' || key.code == 'Delete')) { | ||
572 | let dz={}; | ||
573 | switch (type) { | ||
574 | case "dz": | ||
575 | dz = self.zdFghData.newZdlist[index].dz[dzIndex]; | ||
576 | // 删除数据 | ||
577 | self.zdFghData.newZdlist[index].dz.splice(dzIndex, 1); | ||
578 | // 添加数据 | ||
579 | self.zdDzList.push(dz) | ||
580 | break; | ||
581 | case "zrz": | ||
582 | dz = self.zdFghData.newZdlist[index].zrz[dzIndex]; | ||
583 | // 删除数据 | ||
584 | self.zdFghData.newZdlist[index].zrz.splice(dzIndex, 1); | ||
585 | // 添加数据 | ||
586 | self.zdZrzList.push(dz) | ||
587 | break; | ||
588 | default: | ||
589 | break; | ||
590 | } | ||
591 | } | ||
592 | }; | ||
552 | }, | 593 | }, |
553 | mouseleave(){ | 594 | mouseleave(event) { |
554 | console.log("鼠标移出...") | 595 | let selection = window.getSelection(); |
596 | selection.removeAllRanges(); | ||
555 | }, | 597 | }, |
556 | // 重置数据 | 598 | // 重置数据 |
557 | result(){ | 599 | result() { |
558 | switch (this.tabName) { | 600 | switch (this.tabName) { |
559 | case "zd": | 601 | case "zd": |
560 | this.zdFghData={ | 602 | this.zdFghData = { |
561 | oldZdbsm: "", | 603 | oldZdbsm: "", |
562 | newZdlist: [] | 604 | newZdlist: [] |
563 | } | 605 | } |
564 | break | 606 | break |
565 | case "dz": | 607 | case "dz": |
566 | this.dzFghData={ | 608 | this.dzFghData = { |
567 | oldZdbsm: "", | 609 | oldZdbsm: "", |
568 | newZdlist: [] | 610 | newZdlist: [] |
569 | } | 611 | } |
570 | break | 612 | break |
571 | case "h": | 613 | case "h": |
572 | this.hFghData={ | 614 | this.hFghData = { |
573 | oldZdbsm: "", | 615 | oldZdbsm: "", |
574 | newZdlist: [] | 616 | newZdlist: [] |
575 | } | 617 | } |
... | @@ -596,7 +638,7 @@ | ... | @@ -596,7 +638,7 @@ |
596 | zbsm: command, | 638 | zbsm: command, |
597 | ztype: 'dz' | 639 | ztype: 'dz' |
598 | }); | 640 | }); |
599 | this.zdFghData.newZdlist[index].dz.push(item.xmmc) | 641 | this.zdFghData.newZdlist[index].dz.push(item) |
600 | this.zdDzList = this.zdDzList.filter(i => i.bsm !== command); | 642 | this.zdDzList = this.zdDzList.filter(i => i.bsm !== command); |
601 | }, | 643 | }, |
602 | zrzHandleCommand(command, index) { | 644 | zrzHandleCommand(command, index) { |
... | @@ -605,7 +647,7 @@ | ... | @@ -605,7 +647,7 @@ |
605 | zbsm: command, | 647 | zbsm: command, |
606 | ztype: 'zrz' | 648 | ztype: 'zrz' |
607 | }) | 649 | }) |
608 | this.zdFghData.newZdlist[index].zrz.push(item.xmmc) | 650 | this.zdFghData.newZdlist[index].zrz.push(item) |
609 | this.zdZrzList = this.zdZrzList.filter(i => i.bsm !== command); | 651 | this.zdZrzList = this.zdZrzList.filter(i => i.bsm !== command); |
610 | }, | 652 | }, |
611 | ZdgetDzXx(zdbsm) { | 653 | ZdgetDzXx(zdbsm) { |
... | @@ -643,7 +685,7 @@ | ... | @@ -643,7 +685,7 @@ |
643 | saveZd() { | 685 | saveZd() { |
644 | zdfg(this.zdFghData).then(res => { | 686 | zdfg(this.zdFghData).then(res => { |
645 | if (res.success) { | 687 | if (res.success) { |
646 | this.$store.state.zdbsms=res.result; | 688 | this.$store.state.zdbsms = res.result; |
647 | this.$router.push({ | 689 | this.$router.push({ |
648 | path: '/zd', | 690 | path: '/zd', |
649 | query: { | 691 | query: { |
... | @@ -668,10 +710,10 @@ | ... | @@ -668,10 +710,10 @@ |
668 | this.checkedData = res.result | 710 | this.checkedData = res.result |
669 | // 用户bsm暂时传空 | 711 | // 用户bsm暂时传空 |
670 | this.checkedData.userbsm = '' | 712 | this.checkedData.userbsm = '' |
671 | this.checkedData.dz=[], | 713 | this.checkedData.dz = [], |
672 | this.checkedData.zrz=[], | 714 | this.checkedData.zrz = [], |
673 | // fwlist 暂时传空 | 715 | // fwlist 暂时传空 |
674 | this.checkedData.fwlist = [] | 716 | this.checkedData.fwlist = [] |
675 | }) | 717 | }) |
676 | }, | 718 | }, |
677 | getDzZdjbxx(id) { | 719 | getDzZdjbxx(id) { |
... | @@ -679,10 +721,10 @@ | ... | @@ -679,10 +721,10 @@ |
679 | this.checkedData = res.result | 721 | this.checkedData = res.result |
680 | // 用户bsm暂时传空 | 722 | // 用户bsm暂时传空 |
681 | this.checkedData.userbsm = '' | 723 | this.checkedData.userbsm = '' |
682 | this.checkedData.dz=[], | 724 | this.checkedData.dz = [], |
683 | this.checkedData.zrz=[], | 725 | this.checkedData.zrz = [], |
684 | // fwlist 暂时传空 | 726 | // fwlist 暂时传空 |
685 | this.checkedData.fwlist = [] | 727 | this.checkedData.fwlist = [] |
686 | }) | 728 | }) |
687 | }, | 729 | }, |
688 | getHZdxx(id) { | 730 | getHZdxx(id) { |
... | @@ -690,10 +732,10 @@ | ... | @@ -690,10 +732,10 @@ |
690 | this.checkedData = res.result | 732 | this.checkedData = res.result |
691 | // 用户bsm暂时传空 | 733 | // 用户bsm暂时传空 |
692 | this.checkedData.userbsm = '' | 734 | this.checkedData.userbsm = '' |
693 | this.checkedData.dz=[], | 735 | this.checkedData.dz = [], |
694 | this.checkedData.zrz=[], | 736 | this.checkedData.zrz = [], |
695 | // fwlist 暂时传空 | 737 | // fwlist 暂时传空 |
696 | this.checkedData.fwlist = [] | 738 | this.checkedData.fwlist = [] |
697 | }) | 739 | }) |
698 | }, | 740 | }, |
699 | getzdtzm() { | 741 | getzdtzm() { |
... | @@ -947,7 +989,7 @@ | ... | @@ -947,7 +989,7 @@ |
947 | padding: 5px; | 989 | padding: 5px; |
948 | line-height: 20px; | 990 | line-height: 20px; |
949 | color: #BBB; | 991 | color: #BBB; |
950 | span{ | 992 | span { |
951 | color: #000; | 993 | color: #000; |
952 | } | 994 | } |
953 | } | 995 | } |
... | @@ -1071,8 +1113,8 @@ | ... | @@ -1071,8 +1113,8 @@ |
1071 | height: 480px; | 1113 | height: 480px; |
1072 | overflow: auto; | 1114 | overflow: auto; |
1073 | margin-top: 10px; | 1115 | margin-top: 10px; |
1074 | table{ | 1116 | table { |
1075 | margin: 0 20px ; | 1117 | margin: 0 20px; |
1076 | } | 1118 | } |
1077 | } | 1119 | } |
1078 | .header-button { | 1120 | .header-button { |
... | @@ -1105,13 +1147,15 @@ | ... | @@ -1105,13 +1147,15 @@ |
1105 | background-color: rgba(0, 202, 205, .8); | 1147 | background-color: rgba(0, 202, 205, .8); |
1106 | border-color: rgba(0, 202, 205, .8); | 1148 | border-color: rgba(0, 202, 205, .8); |
1107 | } | 1149 | } |
1108 | .xzzxx{ | 1150 | |
1109 | ul{ | 1151 | .xzzxx { |
1110 | li{ | 1152 | ul { |
1153 | li { | ||
1111 | display: inline-block; | 1154 | display: inline-block; |
1112 | } | 1155 | } |
1113 | } | 1156 | } |
1114 | } | 1157 | } |
1158 | |||
1115 | .cz, .xh { | 1159 | .cz, .xh { |
1116 | width: 100px; | 1160 | width: 100px; |
1117 | } | 1161 | } |
... | @@ -1119,7 +1163,8 @@ | ... | @@ -1119,7 +1163,8 @@ |
1119 | .xzq, .djq, .djzq { | 1163 | .xzq, .djq, .djzq { |
1120 | width: 150px; | 1164 | width: 150px; |
1121 | } | 1165 | } |
1122 | .search{ | 1166 | |
1167 | .search { | ||
1123 | color: #BBB !important; | 1168 | color: #BBB !important; |
1124 | } | 1169 | } |
1125 | </style> | 1170 | </style> | ... | ... |
-
Please register or sign in to post a comment