|
@@ -130,6 +130,29 @@
|
|
|
:instance="course"
|
|
|
ref="PaperApproveTable"
|
|
|
></paper-approve-table>
|
|
|
+ <!-- paper view -->
|
|
|
+ <el-dialog
|
|
|
+ class="paper-view-dialog"
|
|
|
+ :visible.sync="paperViewDialogVisible"
|
|
|
+ title="请选择卷型"
|
|
|
+ top="10vh"
|
|
|
+ width="300px"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <div class="text-center">
|
|
|
+ <el-button
|
|
|
+ v-for="item in papers"
|
|
|
+ :key="item.name"
|
|
|
+ type="primary"
|
|
|
+ size="large"
|
|
|
+ @click="toViewUrl(item.url)"
|
|
|
+ >{{ item.name }}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div slot="footer"></div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -191,6 +214,9 @@ export default {
|
|
|
format: ["docx", "doc", "xlsx", "xls", "pdf", "jpg", "png", "zip"],
|
|
|
toolUrl: "",
|
|
|
bloading: false,
|
|
|
+ // paper view
|
|
|
+ paperViewDialogVisible: false,
|
|
|
+ papers: [],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -242,6 +268,26 @@ export default {
|
|
|
this.dataList = res || [];
|
|
|
},
|
|
|
toView(row) {
|
|
|
+ // 试卷样卷
|
|
|
+ if (row.type === "PAPER") {
|
|
|
+ const filePath = row.filePath ? JSON.parse(filePath) : [];
|
|
|
+ if (!filePath.length) {
|
|
|
+ this.$message.error("当前无文档可查看");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (filePath.length === 1) {
|
|
|
+ window.open(filePath[0]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.papers = [
|
|
|
+ { name: "A", url: filePath[0] },
|
|
|
+ { name: "B", url: filePath[1] },
|
|
|
+ ];
|
|
|
+ this.paperViewDialogVisible = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 试卷审批记录
|
|
|
if (row.type === "APPROVE_RECORD") {
|
|
|
this.$refs.PaperApproveTable.open();
|
|
@@ -257,15 +303,15 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- this.toDownloadUrl(row);
|
|
|
+ this.toViewUrl(row.filePath);
|
|
|
},
|
|
|
- toDownloadUrl(row) {
|
|
|
- if (!row.filePath) {
|
|
|
- this.$message.error("当前无文档可下载");
|
|
|
+ toViewUrl(url) {
|
|
|
+ if (!url) {
|
|
|
+ this.$message.error("当前无文档可查看");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- window.open(row.filePath);
|
|
|
+ window.open(url);
|
|
|
},
|
|
|
async toDownload(row) {
|
|
|
if (this.downloading) return;
|