|
@@ -56,7 +56,8 @@
|
|
|
<el-button
|
|
|
type="success"
|
|
|
icon="el-icon-refresh"
|
|
|
- :loading="loading"
|
|
|
+ :loading="syncLoading"
|
|
|
+ :disabled="!filter.semesterId || !filter.orgId"
|
|
|
@click="toSync"
|
|
|
>同步</el-button
|
|
|
>
|
|
@@ -65,6 +66,7 @@
|
|
|
type="primary"
|
|
|
icon="el-icon-download"
|
|
|
:loading="loading"
|
|
|
+ :disabled="!filter.semesterId || !filter.orgId"
|
|
|
@click="toDownloadAll"
|
|
|
>一键下载</el-button
|
|
|
>
|
|
@@ -72,7 +74,8 @@
|
|
|
v-if="checkPrivilege('button', 'export')"
|
|
|
type="primary"
|
|
|
icon="el-icon-download"
|
|
|
- :loading="loading"
|
|
|
+ :loading="exportLoading"
|
|
|
+ :disabled="!filter.semesterId || !filter.orgId"
|
|
|
@click="toExport"
|
|
|
>成绩导出</el-button
|
|
|
>
|
|
@@ -112,7 +115,7 @@
|
|
|
v-if="checkPrivilege('link', 'download')"
|
|
|
class="btn-primary"
|
|
|
type="text"
|
|
|
- :loading="downloading"
|
|
|
+ :disabled="downloading"
|
|
|
@click="toDownload(scope.row)"
|
|
|
>下载</el-button
|
|
|
>
|
|
@@ -174,6 +177,8 @@ export default {
|
|
|
curRow: {},
|
|
|
curPapers: [],
|
|
|
downloading: false,
|
|
|
+ syncLoading: false,
|
|
|
+ exportLoading: false,
|
|
|
loading: false,
|
|
|
// img view
|
|
|
curImageIndex: 0,
|
|
@@ -200,10 +205,13 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
async toSync() {
|
|
|
- if (this.loading) return;
|
|
|
- this.loading = true;
|
|
|
- const res = await scoreSync({ examId: "" }).catch(() => {});
|
|
|
- this.loading = false;
|
|
|
+ if (this.syncLoading) return;
|
|
|
+ this.syncLoading = true;
|
|
|
+ const res = await scoreSync({
|
|
|
+ semesterId: this.filter.semesterId,
|
|
|
+ orgId: this.filter.orgId
|
|
|
+ }).catch(() => {});
|
|
|
+ this.syncLoading = false;
|
|
|
if (!res) return;
|
|
|
this.$message.success("同步任务已经提交");
|
|
|
},
|
|
@@ -216,10 +224,10 @@ export default {
|
|
|
this.$message.success("下载任务已经提交");
|
|
|
},
|
|
|
async toExport() {
|
|
|
- if (this.loading) return;
|
|
|
- this.loading = true;
|
|
|
+ if (this.exportLoading) return;
|
|
|
+ this.exportLoading = true;
|
|
|
const res = await scoreExport(this.filter).catch(() => {});
|
|
|
- this.loading = false;
|
|
|
+ this.exportLoading = false;
|
|
|
if (!res) return;
|
|
|
this.$message.success("导出任务已经提交");
|
|
|
},
|
|
@@ -229,7 +237,7 @@ export default {
|
|
|
|
|
|
const res = await downloadByApi(() => {
|
|
|
return scoreDownload(row.studentCode);
|
|
|
- }, `${row.name}-原卷.zip`).catch(e => {
|
|
|
+ }).catch(e => {
|
|
|
console.log(e);
|
|
|
});
|
|
|
this.downloading = false;
|
|
@@ -248,7 +256,7 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
this.curImageIndex = 0;
|
|
|
- this.imageList = row.sheetUrls.map((item, index) => {
|
|
|
+ this.imageList = JSON.parse(row.sheetUrls).map((item, index) => {
|
|
|
return { url: item, name: index + 1 };
|
|
|
});
|
|
|
this.selectImage(this.curImageIndex);
|