|
@@ -65,6 +65,22 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="part-box-action">
|
|
|
+ <el-button
|
|
|
+ v-if="checkPrivilege('button', 'Delete')"
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ :loading="loading"
|
|
|
+ @click="toBatDelete"
|
|
|
+ >批量删除</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="checkPrivilege('button', 'Freshen')"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-refresh"
|
|
|
+ :loading="loading"
|
|
|
+ @click="toFresh"
|
|
|
+ >刷新数据</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
type="success"
|
|
|
icon="el-icon-download"
|
|
@@ -85,7 +101,16 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<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
|
|
|
type="index"
|
|
|
label="序号"
|
|
@@ -125,7 +150,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { statisticsList } from "../api";
|
|
|
+import { statisticsList, statisticsDelete, statisticsFreshen } from "../api";
|
|
|
import { organizationFindByTypeList } from "../../base/api";
|
|
|
import UploadButton from "../../../components/UploadButton";
|
|
|
|
|
@@ -141,12 +166,14 @@ export default {
|
|
|
teacherName: "",
|
|
|
status: ""
|
|
|
},
|
|
|
+ loading: false,
|
|
|
current: 1,
|
|
|
size: this.GLOBAL.pageSize,
|
|
|
total: 0,
|
|
|
dataList: [],
|
|
|
curRow: {},
|
|
|
teachingRooms: [],
|
|
|
+ multipleSelection: [],
|
|
|
FINISH_STATUS: { UN_FINISH: "未完成", FINISH: "已完成" },
|
|
|
// import
|
|
|
uploadUrl: "/api/admin/statistics/import",
|
|
@@ -188,6 +215,40 @@ export default {
|
|
|
if (!val) return;
|
|
|
this.getTeachingRooms();
|
|
|
},
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val.map(item => item.id);
|
|
|
+ },
|
|
|
+ async toBatDelete() {
|
|
|
+ if (this.loading) return;
|
|
|
+
|
|
|
+ if (!this.multipleSelection.length) {
|
|
|
+ this.$message.error("请选择要删除的数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const result = await this.$confirm("确定要删除选择的数据吗?", "提示", {
|
|
|
+ type: "warning"
|
|
|
+ }).catch(() => {});
|
|
|
+ if (result !== "confirm") return;
|
|
|
+
|
|
|
+ this.loading = true;
|
|
|
+ const data = await statisticsDelete(
|
|
|
+ this.multipleSelection
|
|
|
+ ).catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+ if (!data) return;
|
|
|
+
|
|
|
+ this.$message.success("提交成功!");
|
|
|
+ this.toPage(this.current);
|
|
|
+ },
|
|
|
+ async toFresh() {
|
|
|
+ this.loading = true;
|
|
|
+ const data = await statisticsFreshen().catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+ if (!data) return;
|
|
|
+
|
|
|
+ this.$message.success("刷新成功!");
|
|
|
+ this.toPage(1);
|
|
|
+ },
|
|
|
// import
|
|
|
uplaodError(errorData) {
|
|
|
this.$notify.error({ title: "错误提示", message: errorData.message });
|