|
@@ -6,7 +6,28 @@
|
|
|
:style="{ display: type == 'upload_control_chs' ? 'flex' : 'block' }"
|
|
|
>
|
|
|
<div class="content">
|
|
|
- <template v-if="curQue.data">
|
|
|
+ <template v-if="curQue.Bookanswer&&type == 'upload_control_chs'">
|
|
|
+ <template
|
|
|
+ v-if="
|
|
|
+ curQue.Bookanswer.file_name.indexOf('png') != -1 ||
|
|
|
+ curQue.Bookanswer.file_name.indexOf('jpg') != -1 ||
|
|
|
+ curQue.Bookanswer.file_name.indexOf('jpeg') != -1
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <img :src="curQue.Bookanswer.file_url" alt="" />
|
|
|
+ </template>
|
|
|
+ <template v-else-if="curQue.Bookanswer.file_name.indexOf('pdf') != -1">
|
|
|
+ <pdf
|
|
|
+ ref="pdf"
|
|
|
+ :src="curQue.Bookanswer.fileRelativePath"
|
|
|
+ v-for="i in curQue.Bookanswer.numPages"
|
|
|
+ :key="i"
|
|
|
+ :page="i"
|
|
|
+ >
|
|
|
+ </pdf>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="curQue.data&&type == 'upload_control_preview_chs'">
|
|
|
<template
|
|
|
v-if="
|
|
|
curQue.data.file_name.indexOf('png') != -1 ||
|
|
@@ -16,11 +37,11 @@
|
|
|
>
|
|
|
<img :src="curQue.data.file_url" alt="" />
|
|
|
</template>
|
|
|
- <template v-else-if="curQue.data.file_name.indexOf('pdf') != -1">
|
|
|
+ <template v-else-if="curQue.Bookanswer.file_name.indexOf('pdf') != -1">
|
|
|
<pdf
|
|
|
ref="pdf"
|
|
|
- :src="curQue.data.fileRelativePath"
|
|
|
- v-for="i in curQue.data.numPages"
|
|
|
+ :src="curQue.Bookanswer.fileRelativePath"
|
|
|
+ v-for="i in curQue.Bookanswer.numPages"
|
|
|
:key="i"
|
|
|
:page="i"
|
|
|
>
|
|
@@ -30,7 +51,7 @@
|
|
|
<template v-else>
|
|
|
<div
|
|
|
style="display: flex; height: 40px"
|
|
|
- v-if="type == 'upload_control_chs'"
|
|
|
+ v-if="type == 'upload_control_chs'&&TaskModel!='ANSWER'"
|
|
|
>
|
|
|
<UploadView
|
|
|
:changeFillId="changeFillId"
|
|
@@ -54,8 +75,8 @@
|
|
|
/>
|
|
|
下载
|
|
|
</div>
|
|
|
- <div class="dv" v-if="curQue.data">
|
|
|
- <div v-if="type == 'upload_control_chs'" class="remove" @click="remove">
|
|
|
+ <div class="dv" v-if="curQue.Bookanswer">
|
|
|
+ <div v-if="type == 'upload_control_chs'" class="remove" :class="[TaskModel == 'ANSWER'?'notAllow':'']" @click="remove">
|
|
|
<img src="../../../assets/adult/red_remove.png" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
@@ -73,7 +94,7 @@ export default {
|
|
|
UploadView,
|
|
|
pdf,
|
|
|
},
|
|
|
- props: ["curQue", "fn_data", "type"],
|
|
|
+ props: ["curQue", "fn_data", "type", "TaskModel"],
|
|
|
data() {
|
|
|
return {
|
|
|
uploadType: "",
|
|
@@ -111,7 +132,7 @@ export default {
|
|
|
UserType = userInfor.user_type;
|
|
|
SessionID = userInfor.session_id;
|
|
|
}
|
|
|
- let FileID = this.curQue.data.file_id;
|
|
|
+ let FileID = this.curQue.Bookanswer.file_id;
|
|
|
let data = {
|
|
|
SessionID,
|
|
|
UserCode,
|
|
@@ -123,22 +144,25 @@ export default {
|
|
|
`/GCLSFileServer/WebFileDownload?UserCode=${data.UserCode}&UserType=${data.UserType}&SessionID=${data.SessionID}&FileID=${data.FileID}`;
|
|
|
},
|
|
|
remove() {
|
|
|
- if (this.curQue.data) {
|
|
|
- this.data = null;
|
|
|
- this.curQue.data = null;
|
|
|
- this.curQue.fileList = [];
|
|
|
- this.$message.success("删除成功");
|
|
|
- this.$forceUpdate()
|
|
|
- }
|
|
|
+ if(!this.TaskModel||this.TaskModel!='ANSWER'){
|
|
|
+ if (this.curQue.Bookanswer) {
|
|
|
+ this.data = null;
|
|
|
+ this.curQue.Bookanswer = null;
|
|
|
+ this.curQue.fileList = [];
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ this.$forceUpdate()
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
changeFillId(fileList, item, index) {
|
|
|
this.curQue.fileList = fileList;
|
|
|
// this.$set(this.curQue,data,fileList[0].response.file_info_list[0])
|
|
|
this.curQue.data = fileList[0].response.file_info_list[0];
|
|
|
- if (this.curQue.data.file_name.indexOf("pdf") != -1) {
|
|
|
- this.curQue.data = fileList[0].response.file_info_list[0];
|
|
|
- this.curQue.data.fileRelativePath =
|
|
|
- process.env.VUE_APP_BASE_API + this.curQue.data.file_relative_path;
|
|
|
+ this.curQue.Bookanswer = fileList[0].response.file_info_list[0];
|
|
|
+ if (this.curQue.Bookanswer.file_name.indexOf("pdf") != -1) {
|
|
|
+ this.curQue.Bookanswer = fileList[0].response.file_info_list[0];
|
|
|
+ this.curQue.Bookanswer.fileRelativePath =
|
|
|
+ process.env.VUE_APP_BASE_API + this.curQue.Bookanswer.file_relative_path;
|
|
|
this.getNumPages();
|
|
|
}
|
|
|
this.$forceUpdate();
|
|
@@ -147,12 +171,12 @@ export default {
|
|
|
getNumPages() {
|
|
|
let _this = this;
|
|
|
let loadingTask = pdf.createLoadingTask(
|
|
|
- _this.curQue.data.fileRelativePath
|
|
|
+ _this.curQue.Bookanswer.fileRelativePath
|
|
|
);
|
|
|
loadingTask.promise
|
|
|
.then((pdff) => {
|
|
|
_this.numPages = pdff.numPages;
|
|
|
- _this.curQue.data.numPages = pdff.numPages;
|
|
|
+ _this.curQue.Bookanswer.numPages = pdff.numPages;
|
|
|
this.$forceUpdate();
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -199,6 +223,9 @@ export default {
|
|
|
justify-content: center;
|
|
|
margin-left: 32px;
|
|
|
cursor: pointer;
|
|
|
+ &.notAllow{
|
|
|
+ cursor: not-allowed;
|
|
|
+ }
|
|
|
img {
|
|
|
width: 24px;
|
|
|
height: 24px;
|