This commit is contained in:
@@ -231,7 +231,7 @@
|
||||
</div>
|
||||
<div style="margin-top:10px">
|
||||
<span>移动至:</span>
|
||||
<Tree :data="treeData" ref="moveGroupTreeRef"></Tree>
|
||||
<my-tree :treeData="treeData" @on-tree-click="movetreeLink"></my-tree>
|
||||
</div>
|
||||
<div slot="footer" align="right">
|
||||
<Button @click="moveGroupModal = false" style="margin-right:10px">取消</Button>
|
||||
@@ -339,6 +339,8 @@ export default {
|
||||
selectnodetitle: '',
|
||||
selectnodetype:7,
|
||||
searchKeyword: '',
|
||||
selectparentId:0,
|
||||
moveselectnodeid:0,
|
||||
selectedRows: [],
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
@@ -499,6 +501,7 @@ export default {
|
||||
_this.selectnodeid=resp.data.id;
|
||||
_this.selectnodetitle=resp.data.name;
|
||||
_this.selectnodetype=resp.data.type;
|
||||
_this.selectparentId=resp.data.parentId;
|
||||
_this.loadData();
|
||||
}
|
||||
});
|
||||
@@ -508,6 +511,8 @@ export default {
|
||||
this.selectnodeid=treeNode.id;
|
||||
this.selectnodetitle=treeNode.name;
|
||||
this.selectnodetype=treeNode.type;
|
||||
this.editGroupFormData.sort=treeNode.sort;
|
||||
this.selectparentId=treeNode.parentId;
|
||||
this.pageNum = 1
|
||||
this.loadData()
|
||||
},
|
||||
@@ -814,8 +819,21 @@ export default {
|
||||
submitAddGroup() {
|
||||
this.$refs.addGroupForm.validate(valid => {
|
||||
if (!valid) return;
|
||||
this.$Message.success('新增分组成功');
|
||||
this.addGroupModal = false;
|
||||
let item={
|
||||
name:this.addGroupFormData.groupName,
|
||||
parentId:this.selectnodeid,
|
||||
sort:this.addGroupFormData.sort
|
||||
};
|
||||
const url = APIConfig.BschClassSystem.addGroup;
|
||||
this.$api.post(url,JSON.stringify(item), resp => {
|
||||
if (resp.code == 0) {
|
||||
this.$Message.success('新增分组成功');
|
||||
this.addGroupModal = false;
|
||||
this.getTeaTree();
|
||||
} else if (resp.code == 4) {
|
||||
this.$Message.info(resp.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
@@ -823,15 +841,27 @@ export default {
|
||||
if (!this.selectnodeid) return this.$Message.warning('请先选择分组')
|
||||
this.editGroupIndex = this.selectnodeid;
|
||||
this.editGroupFormData.groupName = this.selectnodetitle;
|
||||
this.editGroupFormData.sort = '';
|
||||
this.editGroupModal = true;
|
||||
},
|
||||
submitEditGroup() {
|
||||
this.$refs.editGroupForm.validate(valid => {
|
||||
if (!valid) return;
|
||||
this.selectedTreeNode.title = this.editGroupFormData.groupName;
|
||||
this.editGroupModal = false;
|
||||
this.$Message.success('修改分组成功')
|
||||
let item={
|
||||
name:this.editGroupFormData.groupName,
|
||||
id:this.selectnodeid,
|
||||
parentId:this.selectparentId,
|
||||
sort:this.editGroupFormData.sort
|
||||
};
|
||||
const url = APIConfig.BschClassSystem.editGroup;
|
||||
this.$api.post(url,JSON.stringify(item), resp => {
|
||||
if (resp.code == 0) {
|
||||
this.$Message.success('修改分组成功');
|
||||
this.editGroupModal = false;
|
||||
this.getTeaTree();
|
||||
} else if (resp.code == 4) {
|
||||
this.$Message.info(resp.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
@@ -840,18 +870,37 @@ export default {
|
||||
this.moveGroupTargetName = this.selectnodetitle;
|
||||
this.moveGroupModal = true;
|
||||
},
|
||||
// 移动组树形选中切换
|
||||
movetreeLink(treeNode) {
|
||||
this.moveselectnodeid=treeNode.id;
|
||||
},
|
||||
confirmMoveGroup() {
|
||||
this.moveGroupModal = false;
|
||||
this.$Message.success('移动分组成功');
|
||||
let item={
|
||||
moveId:this.selectnodeid,
|
||||
pid:this.moveselectnodeid
|
||||
};
|
||||
var url=APIConfig.BschClassSystem.moveGroup;
|
||||
this.$api.post(url,JSON.stringify(item),(resp)=>{
|
||||
this.moveGroupModal = false;
|
||||
this.$Message.success('移动分组成功!');
|
||||
this.getTeaTree();
|
||||
});
|
||||
},
|
||||
|
||||
delCurrentGroup() {
|
||||
if (!this.selectnodeid) return this.$Message.warning('请先选择分组');
|
||||
this.$Modal.confirm({
|
||||
title: '提示',
|
||||
content: `确定删除分组【${this.selectedTreeNode.title}】?`,
|
||||
content: `确定删除分组【${this.selectnodetitle}】?`,
|
||||
onOk: () => {
|
||||
this.$Message.success('删除分组成功');
|
||||
let item={
|
||||
id:this.selectnodeid
|
||||
};
|
||||
var url=APIConfig.BschClassSystem.deleteGroup;
|
||||
this.$api.post(url,item,(resp)=>{
|
||||
this.$Message.success('删除分组成功!');
|
||||
this.getTeaTree();
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user