diff --git a/src/components/pro-tabs/bns-kkFile-preview.vue b/src/components/pro-tabs/bns-kkFile-preview.vue index fa4cee3..68ad26e 100644 --- a/src/components/pro-tabs/bns-kkFile-preview.vue +++ b/src/components/pro-tabs/bns-kkFile-preview.vue @@ -107,6 +107,8 @@ export default { } console.log('filePreviewPath', filePreviewPath) this.file = filePreviewPath + + // alert(this.file, ' this.file') this.fileUploadPath = fileUploadPath }, onIframeLoad() { diff --git a/src/utils/bonus.js b/src/utils/bonus.js index 3168f8b..21b4da0 100644 --- a/src/utils/bonus.js +++ b/src/utils/bonus.js @@ -1,7 +1,7 @@ import { getToDoNum } from '@/api/system/notice' //0 测试 1生产 -let fileType = process.env.VUE_APP_ENV === 'testing' ? 0 : 1 -// let fileType = 0 +// let fileType = process.env.VUE_APP_ENV === 'testing' ? 0 : 1 +let fileType = 0 export function lookFile() { if (fileType === 0) { diff --git a/src/utils/upload.js b/src/utils/upload.js index a4ca158..72fc704 100644 --- a/src/utils/upload.js +++ b/src/utils/upload.js @@ -1,13 +1,11 @@ import request from '@/utils/request' - - //上传信息 -export function uploadFileInfo(data){ +export function uploadFileInfo(data) { return request({ - url:'/exam/multipart/uploadFileInfo', - method:'post', - data:data + url: '/exam/multipart/uploadFileInfo', + method: 'post', + data: data, }) } @@ -16,39 +14,36 @@ export function checkUpload(MD5) { return request({ url: '/exam/multipart/check', method: 'get', - params: {"md5":MD5} + params: { md5: MD5 }, }) -}; - +} // 初始化上传 export function initUpload(data) { return request({ url: '/exam/multipart/init', method: 'post', - data:data + data: data, }) -}; - +} // 文件合并 export function mergeUpload(data) { return request({ url: '/exam/multipart/merge', method: 'post', - data:data + data: data, }) -}; - +} //判断文件是否存在 export function fileIsExits(data) { return request({ url: '/exam/multipart/fileIsExits', method: 'post', - data:data + data: data, }) -}; +} // 上传文件 export function uploadFiles(formData) { @@ -59,7 +54,19 @@ export function uploadFiles(formData) { timeout: 600000, // 设置超时时间为 10 秒(10000 毫秒) headers: { 'Content-Type': 'application/x-www-form-urlencoded', - repeatSubmit:false - } + repeatSubmit: false, + }, + }) +} +export function uploadFilesNew(formData) { + return request({ + url: '/exam/multipart/uploadFiles', + method: 'post', + data: formData, + timeout: 600000, // 设置超时时间为 10 秒(10000 毫秒) + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + repeatSubmit: false, + }, }) } diff --git a/src/views/IndexPage/index_other.vue b/src/views/IndexPage/index_other.vue index bdf18d0..7c2bbcb 100644 --- a/src/views/IndexPage/index_other.vue +++ b/src/views/IndexPage/index_other.vue @@ -9,7 +9,7 @@ :style="{ marginTop: '-8px', float: 'right', marginRight: '10px;', fontSize: '18px' }" @click="admissionRequest" v-hasPermi="['system:entrance:apply']" - v-if="this.enterStatus === '草稿'" + v-if="this.enterStatus === '草稿' && proId" > 入场申请 @@ -35,7 +35,7 @@ - + @@ -81,6 +81,8 @@ + +
-

工程基础信息----

- +

工程基础信息

+ @@ -156,7 +158,7 @@ - + @@ -173,7 +175,7 @@ - + @@ -190,7 +192,7 @@ - + @@ -198,6 +200,7 @@ +

入场材料示例模板

@@ -261,9 +264,11 @@ export default { directorPhone: '', address: '', }, + proId: '', } }, created() { + this.proId = this.$store.state.user.thisIds.proId if (this.$store.state.user.userType !== '00') { this.init() if (this.$store.state.user.userType !== '01') { diff --git a/src/views/educationalTraining/resourceAdministration/coursewareStore/index.vue b/src/views/educationalTraining/resourceAdministration/coursewareStore/index.vue index 24e9272..df40312 100644 --- a/src/views/educationalTraining/resourceAdministration/coursewareStore/index.vue +++ b/src/views/educationalTraining/resourceAdministration/coursewareStore/index.vue @@ -78,7 +78,7 @@ icon="el-icon-upload" @click="handleUpload(scope.row)" > - 上传 + 上传***
@@ -203,9 +203,16 @@
- +
- +
@@ -442,9 +449,15 @@ export default { // 下载 async handleDownload(row) { this.downLoading = true + this.$message.closeAll() console.log('下载', row) if (!row) { // 批量下载 + + if (this.coursewareIds.length === 0) { + this.$message.error('请先选择文件') + return + } const params = { coursewareId: this.coursewareIds, fileType: 1, @@ -457,73 +470,74 @@ export default { this.downLoading = false }, 300) return + } else { + const params = { + coursewareId: row.coursewareId, + fileType: row.fileType, + } + // dev-api/exam/coursewareLibrary/downLoadFile + // 获取当前的 location.origin + const origin = window.location.origin + console.log('🚀 ~ handleDownload ~ origin:', origin) + // window.open( + // // `${origin}/prod-api/exam/coursewareLibrary/downLoadFile?coursewareId=${row.coursewareId}&fileType=${row.fileType}` + // `${origin}/dev-api/exam/coursewareLibrary/downLoadFile?coursewareId=${row.coursewareId}&fileType=${row.fileType}` + // ) + download('/exam/coursewareLibrary/downLoadFile', params, row.coursewareName + row.suffix).then(res => { + console.log('🚀 ~ handleDownload ~ res:', res) + }) + setTimeout(() => { + this.downLoading = false + }, 300) + // let type = '' + // if (row.fileType == 1) { + // // 文件夹-zip压缩包 + // type = 'application/zip' + // } else if (row.fileType == 2) { + // // 视频 + // type = 'video/mp4' + // } else if (row.fileType == 3) { + // // excel + // type = 'application/vnd.ms-excel' + // } else if (row.fileType == 4) { + // // pdf + // type = 'application/pdf' + // } else if (row.fileType == 5) { + // // txt + // type = 'text/plain' + // } else if (row.fileType == 6) { + // // word + // type = 'application/msword' + // } + // downLoadFile(params).then(res => { + // console.log('🚀 ~ handleDownload ~ res-下载:', res) + // // 返回的是文件流, 使用blob处理 + // // 创建 Blob 对象 + // const blob = new Blob([res.data], { type: type }) + // console.log('🚀 ~ downLoadFile ~ blob:', blob) + // const url = window.URL.createObjectURL(blob) // 创建一个指向该 Blob 的 URL + // console.log('🚀 ~ downLoadFile ~ url:', url) + + // // 创建下载链接 + // const link = document.createElement('a') + // link.href = url + // // link.download = fileName === '' ? filePath.split('/')[filePath.split('/').length - 1] : fileName + // link.download = '下载文件.pdf' + // document.body.appendChild(link) + // link.click() + // // window.URL.revokeObjectURL(url) + // // let fileName = link.href.split('/')[link.href.split('/').length - 1] + // // link.setAttribute('download', fileName) // 设置下载文件名 + + // // 触发下载 + // // document.body.appendChild(link) + // // link.click() + + // // 清理 + // document.body.removeChild(link) + // window.URL.revokeObjectURL(url) // 释放内存 + // }) } - const params = { - coursewareId: row.coursewareId, - fileType: row.fileType, - } - // dev-api/exam/coursewareLibrary/downLoadFile - // 获取当前的 location.origin - const origin = window.location.origin - console.log('🚀 ~ handleDownload ~ origin:', origin) - // window.open( - // // `${origin}/prod-api/exam/coursewareLibrary/downLoadFile?coursewareId=${row.coursewareId}&fileType=${row.fileType}` - // `${origin}/dev-api/exam/coursewareLibrary/downLoadFile?coursewareId=${row.coursewareId}&fileType=${row.fileType}` - // ) - download('/exam/coursewareLibrary/downLoadFile', params, row.coursewareName + row.suffix).then(res => { - console.log('🚀 ~ handleDownload ~ res:', res) - }) - setTimeout(() => { - this.downLoading = false - }, 300) - // let type = '' - // if (row.fileType == 1) { - // // 文件夹-zip压缩包 - // type = 'application/zip' - // } else if (row.fileType == 2) { - // // 视频 - // type = 'video/mp4' - // } else if (row.fileType == 3) { - // // excel - // type = 'application/vnd.ms-excel' - // } else if (row.fileType == 4) { - // // pdf - // type = 'application/pdf' - // } else if (row.fileType == 5) { - // // txt - // type = 'text/plain' - // } else if (row.fileType == 6) { - // // word - // type = 'application/msword' - // } - // downLoadFile(params).then(res => { - // console.log('🚀 ~ handleDownload ~ res-下载:', res) - // // 返回的是文件流, 使用blob处理 - // // 创建 Blob 对象 - // const blob = new Blob([res.data], { type: type }) - // console.log('🚀 ~ downLoadFile ~ blob:', blob) - // const url = window.URL.createObjectURL(blob) // 创建一个指向该 Blob 的 URL - // console.log('🚀 ~ downLoadFile ~ url:', url) - - // // 创建下载链接 - // const link = document.createElement('a') - // link.href = url - // // link.download = fileName === '' ? filePath.split('/')[filePath.split('/').length - 1] : fileName - // link.download = '下载文件.pdf' - // document.body.appendChild(link) - // link.click() - // // window.URL.revokeObjectURL(url) - // // let fileName = link.href.split('/')[link.href.split('/').length - 1] - // // link.setAttribute('download', fileName) // 设置下载文件名 - - // // 触发下载 - // // document.body.appendChild(link) - // // link.click() - - // // 清理 - // document.body.removeChild(link) - // window.URL.revokeObjectURL(url) // 释放内存 - // }) }, // 移动 handleMove(row) { @@ -707,6 +721,8 @@ export default { // 文件预览按钮 handlePreview(row) { + console.log(row.filePath) + // alert(row.filePath) this.kkFilePreview.filePreviewUrl = row.filePath this.kkFilePreview.fileName = row.coursewareName this.documentPreview = true diff --git a/src/views/educationalTraining/resourceAdministration/coursewareStore/miniFileUpload.vue b/src/views/educationalTraining/resourceAdministration/coursewareStore/miniFileUpload.vue index e19eb0d..ce8bcb0 100644 --- a/src/views/educationalTraining/resourceAdministration/coursewareStore/miniFileUpload.vue +++ b/src/views/educationalTraining/resourceAdministration/coursewareStore/miniFileUpload.vue @@ -74,7 +74,8 @@