|
@@ -21,6 +21,13 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div class="part-box-action">
|
|
<div class="part-box-action">
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'delete')"
|
|
|
|
+ type="danger"
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
+ @click="toBatchDelete"
|
|
|
|
+ >批量删除</el-button
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
v-if="checkPrivilege('button', 'add')"
|
|
v-if="checkPrivilege('button', 'add')"
|
|
type="primary"
|
|
type="primary"
|
|
@@ -31,7 +38,16 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="part-box part-box-pad">
|
|
<div class="part-box part-box-pad">
|
|
- <el-table ref="TableList" :data="dataList">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ ref="TableList"
|
|
|
|
+ :data="dataList"
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column
|
|
|
|
+ type="selection"
|
|
|
|
+ width="55"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
type="index"
|
|
type="index"
|
|
label="序号"
|
|
label="序号"
|
|
@@ -101,6 +117,7 @@ export default {
|
|
size: this.GLOBAL.pageSize,
|
|
size: this.GLOBAL.pageSize,
|
|
total: 0,
|
|
total: 0,
|
|
dataList: [],
|
|
dataList: [],
|
|
|
|
+ multipleSelection: [],
|
|
curRow: {}
|
|
curRow: {}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -121,6 +138,7 @@ export default {
|
|
this.total = data.total;
|
|
this.total = data.total;
|
|
},
|
|
},
|
|
toPage(page) {
|
|
toPage(page) {
|
|
|
|
+ this.multipleSelection = [];
|
|
this.current = page;
|
|
this.current = page;
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
@@ -132,12 +150,32 @@ export default {
|
|
this.curRow = row;
|
|
this.curRow = row;
|
|
this.$refs.ModifyMajor.open();
|
|
this.$refs.ModifyMajor.open();
|
|
},
|
|
},
|
|
|
|
+ handleSelectionChange(val) {
|
|
|
|
+ this.multipleSelection = val.map(item => item.id);
|
|
|
|
+ },
|
|
|
|
+ toBatchDelete() {
|
|
|
|
+ if (!this.multipleSelection.length) {
|
|
|
|
+ this.$message.error("请选择要删除的数据");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.$confirm(`确定要删除选中的这些数据吗?`, "提示", {
|
|
|
|
+ type: "warning"
|
|
|
|
+ })
|
|
|
|
+ .then(async () => {
|
|
|
|
+ await deleteMajor(this.multipleSelection);
|
|
|
|
+ this.$message.success("删除成功!");
|
|
|
|
+ this.deletePageLastItem(this.multipleSelection.length);
|
|
|
|
+ this.multipleSelection = [];
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ },
|
|
toDelete(row) {
|
|
toDelete(row) {
|
|
this.$confirm(`确定要删除专业【${row.majorName}】吗?`, "提示", {
|
|
this.$confirm(`确定要删除专业【${row.majorName}】吗?`, "提示", {
|
|
type: "warning"
|
|
type: "warning"
|
|
})
|
|
})
|
|
.then(async () => {
|
|
.then(async () => {
|
|
- await deleteMajor(row.id);
|
|
|
|
|
|
+ await deleteMajor([row.id]);
|
|
this.$message.success("删除成功!");
|
|
this.$message.success("删除成功!");
|
|
this.deletePageLastItem();
|
|
this.deletePageLastItem();
|
|
})
|
|
})
|