|
@@ -35,6 +35,14 @@
|
|
|
@click="toPage(1)"
|
|
|
>查询</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :disabled="
|
|
|
+ !filter.semesterId || !filter.examTypeId || !filter.collegeId
|
|
|
+ "
|
|
|
+ @click="toExport()"
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -55,7 +63,7 @@
|
|
|
{{ scope.row.publish ? "已发布" : "未发布" }}
|
|
|
</span>
|
|
|
</el-table-column>
|
|
|
- <el-table-column class-name="action-column" label="操作" width="120">
|
|
|
+ <el-table-column class-name="action-column" label="操作" width="140">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
class="btn-primary"
|
|
@@ -72,6 +80,14 @@
|
|
|
>
|
|
|
发布</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ v-if="isNotAssignUser"
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ @click="toExport(scope.row)"
|
|
|
+ >
|
|
|
+ 导出</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -92,7 +108,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { assignmentDataList, assignmentPublish } from "../api";
|
|
|
+import {
|
|
|
+ assignmentDataList,
|
|
|
+ assignmentPublish,
|
|
|
+ downloadAssignmentData,
|
|
|
+} from "../api";
|
|
|
+import { downloadByApi } from "@/plugins/download";
|
|
|
|
|
|
export default {
|
|
|
name: "assignment-calculate",
|
|
@@ -111,6 +132,7 @@ export default {
|
|
|
dataList: [],
|
|
|
publishing: false,
|
|
|
isAssignUser: [],
|
|
|
+ downloading: false,
|
|
|
};
|
|
|
},
|
|
|
async mounted() {
|
|
@@ -189,6 +211,31 @@ export default {
|
|
|
if (!res) return;
|
|
|
this.$message.success("发布成功!");
|
|
|
},
|
|
|
+ async toExport(row) {
|
|
|
+ if (this.downloading) return;
|
|
|
+ this.downloading = true;
|
|
|
+
|
|
|
+ let curAssignInfo = this.$objAssign(
|
|
|
+ {
|
|
|
+ semesterId: "",
|
|
|
+ examTypeId: "",
|
|
|
+ courseCode: "",
|
|
|
+ collegeId: "",
|
|
|
+ openCollege: "",
|
|
|
+ },
|
|
|
+ row ? { ...row, collegeId: this.filter.collegeId } : this.filter
|
|
|
+ );
|
|
|
+
|
|
|
+ const res = await downloadByApi(() => {
|
|
|
+ return downloadAssignmentData(curAssignInfo);
|
|
|
+ }).catch((e) => {
|
|
|
+ this.$message.error(e || "下载失败,请重新尝试!");
|
|
|
+ });
|
|
|
+ this.downloading = false;
|
|
|
+
|
|
|
+ if (!res) return;
|
|
|
+ this.$message.success("下载成功!");
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|