This commit is contained in:
lijing
2026-08-19 14:21:08 +08:00
parent fb17d564c7
commit 78424636ce
3 changed files with 51 additions and 45 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
<Col span="20" class="right-select-wrap" :style="'height:'+(useTableHeight({ isSearch: true, isOperat: true })+160)+'px'">
<div class="select-title">
学制选择
<Button class="fr" style="margin-right:10px;" type="primary" @click="openAddModal">添加学校</Button>
<Button v-if="selectnodeid==0" class="fr" style="margin-right:10px;" type="primary" @click="openAddModal">添加学校</Button>
</div>
<TreeSelect
v-model="addForm.systemlist"
+46 -44
View File
@@ -636,8 +636,6 @@ export default {
//导入成功返回
importFile(response, file, fileList){
const _this=this;
console.log(response);
console.log(file);
_this.spinShow=false;
_this.UpParmas.fileName=file.name;
_this.UpParmas.listData=response;
@@ -676,13 +674,17 @@ export default {
},
batchDeleteTeacher() {
if (!this.selectedRows.length) return this.$Message.warning('请先勾选教师')
if (!this.selectedRows.length) return this.$Message.warning('请先勾选教师');
this.batchDeleteModal = true
},
confirmBatchDelete() {
const idlist = this.selectedRows.map(i => i.id);
const url = APIConfig.BschClassSystem.teacherdelete+idlist.join(',');
this.$api.post(url,{}, resp => {
const url = APIConfig.BschClassSystem.teacherdelete;
let item={
groupId:this.selectnodeid,
ids:idlist.join(',')
};
this.$api.post(url,item, resp => {
if (resp.code == 0) {
this.$Message.success("删除成功!");
this.selectedRows = [];
@@ -695,37 +697,37 @@ export default {
},
// 弹窗打开初始化
openBatchMoveTeacherModal() {
if (!this.selectedRows.length) return this.$Message.warning('请先勾选教师')
this.moveTeacherName = this.selectedRows.map(i => i.name).join('、')
if (!this.selectedRows.length) return this.$Message.warning('请先勾选教师');
this.moveTeacherName = this.selectedRows.map(i => i.name).join('、');
// 清空数据
this.checkedTreeNodes = []
this.targetGroupList = []
this.checkedTreeNodes = [];
this.targetGroupList = [];
this.$nextTick(() => {
// 清空整棵树所有勾选
const ztree = this.$refs.moveTeacherLeftTree.getZtreeInstance()
ztree.checkAllNodes(false)
const ztree = this.$refs.moveTeacherLeftTree.getZtreeInstance();
ztree.checkAllNodes(false);
})
this.moveTeacherModal = true
this.moveTeacherModal = true;
},
// 右侧点击X删除单条 → 反向取消左侧树勾选
handleDeleteRightItem(delItem, index) {
// 删除右侧数组
this.targetGroupList.splice(index, 1)
this.targetGroupList.splice(index, 1);
// 获取树实例,取消对应节点复选框
const ztree = this.$refs.moveTeacherLeftTree.getZtreeInstance()
const targetNode = ztree.getNodeByParam('id', delItem.id)
const ztree = this.$refs.moveTeacherLeftTree.getZtreeInstance();
const targetNode = ztree.getNodeByParam('id', delItem.id);
if (targetNode) {
ztree.checkNode(targetNode, false, false)
ztree.checkNode(targetNode, false, false);
}
},
// 确定按钮 直接提交
submitMoveTeacher() {
if (this.targetGroupList.length === 0) {
return this.$Message.warning('请至少选择一个目标分组')
return this.$Message.warning('请至少选择一个目标分组');
}
const teacherIdArr = this.selectedRows.map(row => row.id)
const groupIdArr = this.targetGroupList.map(item => item.id)
const teacherIdArr = this.selectedRows.map(row => row.id);
const groupIdArr = this.targetGroupList.map(item => item.id);
// console.log('待移动教师ID', teacherIdArr)
// console.log('目标分组ID', groupIdArr)
@@ -750,8 +752,8 @@ export default {
});
},
batchTransferTeacher() {
if (!this.selectedRows.length) return this.$Message.warning('请先勾选教师')
this.transferTeacherModal = true
if (!this.selectedRows.length) return this.$Message.warning('请先勾选教师');
this.transferTeacherModal = true;
},
//转出事件
confirmTransferTeacher() {
@@ -770,19 +772,19 @@ export default {
},
openBatchMoveTeacherModal() {
if (!this.selectedRows.length) return this.$Message.warning('请先勾选教师')
this.moveTeacherName = this.selectedRows.map(i => i.name).join('、')
this.moveTeacherModal = true
if (!this.selectedRows.length) return this.$Message.warning('请先勾选教师');
this.moveTeacherName = this.selectedRows.map(i => i.name).join('、');
this.moveTeacherModal = true;
},
confirmMoveTeacher() {
this.moveTeacherModal = false
this.$Message.success('移动教师成功')
this.moveTeacherModal = false;
this.$Message.success('移动教师成功');
},
openSetStatusModal() {
if (!this.selectedRows.length) return this.$Message.warning('请先勾选教师')
this.statusFormData.status = '0'
this.setStatusModal = true
if (!this.selectedRows.length) return this.$Message.warning('请先勾选教师');
this.statusFormData.status = '0';
this.setStatusModal = true;
},
submitSetStatus() {
const idlist = this.selectedRows.map(i => i.id);
@@ -804,11 +806,11 @@ export default {
},
openAddGroupModal() {
if (!this.selectnodeid) return this.$Message.warning('请先选择父分组')
this.addGroupFormData.parentGroupName = this.selectnodetitle
this.addGroupFormData.groupName = ''
this.addGroupFormData.sort = ''
this.addGroupModal = true
if (!this.selectnodeid) return this.$Message.warning('请先选择父分组');
this.addGroupFormData.parentGroupName = this.selectnodetitle;
this.addGroupFormData.groupName = '';
this.addGroupFormData.sort = '';
this.addGroupModal = true;
},
submitAddGroup() {
this.$refs.addGroupForm.validate(valid => {
@@ -827,30 +829,30 @@ export default {
},
submitEditGroup() {
this.$refs.editGroupForm.validate(valid => {
if (!valid) return
this.selectedTreeNode.title = this.editGroupFormData.groupName
this.editGroupModal = false
if (!valid) return;
this.selectedTreeNode.title = this.editGroupFormData.groupName;
this.editGroupModal = false;
this.$Message.success('修改分组成功')
})
},
openMoveGroupModal() {
if (!this.selectnodeid) return this.$Message.warning('请先选择分组')
this.moveGroupTargetName = this.selectnodetitle
this.moveGroupModal = true
if (!this.selectnodeid) return this.$Message.warning('请先选择分组');
this.moveGroupTargetName = this.selectnodetitle;
this.moveGroupModal = true;
},
confirmMoveGroup() {
this.moveGroupModal = false
this.$Message.success('移动分组成功')
this.moveGroupModal = false;
this.$Message.success('移动分组成功');
},
delCurrentGroup() {
if (!this.selectnodeid) return this.$Message.warning('请先选择分组')
if (!this.selectnodeid) return this.$Message.warning('请先选择分组');
this.$Modal.confirm({
title: '提示',
content: `确定删除分组【${this.selectedTreeNode.title}】?`,
onOk: () => {
this.$Message.success('删除分组成功')
this.$Message.success('删除分组成功');
}
})
}
+4
View File
@@ -447,6 +447,10 @@ export default {
this.getteachssearch();
},
handleBatchImport() {
this.UpParmas.datapre={
schsystemId: this.majorVal,
gradeId: this.gradeVal
}
this.importModalVisible = true;
},
//导入成功返回