Commit aaecec4e authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents bf3b65f8 833a5482
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<div class="check-site"> <div class="check-site">
<span>您的选择是:</span> <span>您的选择是:</span>
<span <span
style="cursor: pointer"
v-for="(item, index) in checkarr" v-for="(item, index) in checkarr"
:key="index" :key="index"
@click="updataSite(item)" @click="updataSite(item)"
...@@ -29,15 +30,16 @@ ...@@ -29,15 +30,16 @@
> >
</div> </div>
<div class="site-btn"> <div class="site-btn">
<el-button size="small" @click="show = false">取消</el-button>
<el-button <el-button
type="primary" class="addclass" type="primary"
class="addclass"
size="small" size="small"
style="margin-right: 10px"
@click="onSucessSite" @click="onSucessSite"
:disabled="isSite" :disabled="isSite"
>确定</el-button >确定</el-button
> >
<el-button size="small" @click="show = false">取消</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -75,16 +77,22 @@ export default { ...@@ -75,16 +77,22 @@ export default {
this.checkid = undefined; this.checkid = undefined;
// 为子节点不添加数据 // 为子节点不添加数据
let data = this.checkarr[this.checkarr.length - 1]; let data = this.checkarr[this.checkarr.length - 1];
if (data && (data.isLeaf || data.children.length == 0)) { if (data && (data.isLeaf || data.children.length == 0)) {
// 如果为子节点更新最后一个数据 // 如果为子节点更新最后一个数据
this.checkid = obj.id; this.checkid = obj.id;
this.checkarr[this.checkarr.length - 1] = obj; this.checkarr[this.checkarr.length - 1] = obj;
// 如果选中数据有子集更新站点列表
if (obj.children && obj.children.length > 0) {
this.sitelist = obj.children;
}
} else { } else {
this.checkarr.push(obj); this.checkarr.push(obj);
if (obj.children && obj.children.length > 0) { if (obj.children && obj.children.length > 0) {
this.sitelist = obj.children; this.sitelist = obj.children;
} }
} }
if (obj && obj.type == "site") { if (obj && obj.type == "site") {
this.isSite = false; this.isSite = false;
} else { } else {
...@@ -96,8 +104,13 @@ export default { ...@@ -96,8 +104,13 @@ export default {
const { id } = row; const { id } = row;
this.checkid = undefined; this.checkid = undefined;
let index = this.checkarr.findIndex((v) => v.id == id); let index = this.checkarr.findIndex((v) => v.id == id);
this.checkarr.length = index + 1;
this.sitelist = row.children; if (index > -1) {
this.checkarr.splice(index + 1, this.checkarr.length - (index + 1));
}
if (row.children && row.children.length > 0) {
this.sitelist = row.children;
}
if (row && row.type == "site") { if (row && row.type == "site") {
this.isSite = false; this.isSite = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment