diff --git a/src/api/system/motionPrescriptionLibrary.js b/src/api/system/motionPrescriptionLibrary.js index db307cc..155efcc 100644 --- a/src/api/system/motionPrescriptionLibrary.js +++ b/src/api/system/motionPrescriptionLibrary.js @@ -69,4 +69,13 @@ export function deletePrescriptionVideo(prescriptionVideoUrl) { url: `/system/motionPrescriptionLibrary/deletePrescriptionVideo?prescriptionVideoUrl=${prescriptionVideoUrl}`, method: 'post', }) +} + + +//获得图列表 +export function prescriptionVideoUpload(id) { + return request({ + url: `/system/motionPrescriptionLibrary/prescriptionVideoUpload?id=${id}`, + method: 'get', + }) } \ No newline at end of file diff --git a/src/views/system/motionPrescriptionLibrary/index.vue b/src/views/system/motionPrescriptionLibrary/index.vue index db760bb..2865ba7 100644 --- a/src/views/system/motionPrescriptionLibrary/index.vue +++ b/src/views/system/motionPrescriptionLibrary/index.vue @@ -213,7 +213,6 @@ :data="upload.data" :file-list="fileList" :on-change="handleChange" - :limit="5" :before-remove="handleFileremove" drag > @@ -258,7 +257,8 @@ import { updateMotionPrescriptionLibrary, getPrescriptionVideoInfo, confirmUploadVideo, - deletePrescriptionVideo + deletePrescriptionVideo, + prescriptionVideoUpload } from "@/api/system/motionPrescriptionLibrary"; import { getToken } from "@/utils/auth"; import baseurl from "@/api/baseurl"; @@ -535,10 +535,27 @@ export default { }, //打开视频上传窗口 uploadopentrue(e) { - this.upload.data.motionPrescriptionId = e.id; - this.upload.open = true; this.videourl = []; this.fileList = []; + this.upload.data.motionPrescriptionId = e.id; + prescriptionVideoUpload(e.id).then(res => { + if ( + res.data.prescriptionVideoUrlList && + res.data.prescriptionVideoUrlList.length > 0 + ) { + res.data.prescriptionVideoUrlList.forEach(e => { + var arr = e.split("/"); + var obj = { + name: arr[4], + response: { + prescriptionVideoUrl: e + } + }; + this.fileList.push(obj); + }); + } + this.upload.open = true; + }); }, //文件上传 handleChange(file, fileList) {}, @@ -548,9 +565,9 @@ export default { }, //删除文件 handleFileremove(file, fileList) { - deletePrescriptionVideo(file.response.prescriptionVideoUrl).then(res => { - this.$modal.msgSuccess("删除视频成功"); - }); + // deletePrescriptionVideo(file.response.prescriptionVideoUrl).then(res => { + // this.$modal.msgSuccess("删除视频成功"); + // }); this.fileList = this.fileList.filter(e => e != file); }, // 文件上传成功处理