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

Merge remote-tracking branch 'origin/master'

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