From 451454634d7b307548544b7fc7bc964bd9ffbd18 Mon Sep 17 00:00:00 2001 From: wangchengming <15110151257@163.com> Date: Mon, 15 Sep 2025 23:14:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=96=87=E4=BB=B6=E5=85=A8?= =?UTF-8?q?=E9=87=8F=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E4=BB=A3=E7=A0=81=E4=B8=AD=E7=9A=84=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mediaDownRecord.js | 28 +++++ src/components/FileUpload/PdfPreview.vue | 6 +- .../FileUpload/supplierDetailFile.vue | 3 +- src/components/ViewFile/index.vue | 3 +- src/plugins/modal.js | 8 ++ .../components/accessControlPrice.vue | 3 +- .../components/barrierGatePrice.vue | 3 +- .../components/competitiveOffer.vue | 9 +- .../components/garageLightBox.vue | 3 +- .../components/highSpeedRailway.vue | 3 +- .../components/officeBuilding.vue | 3 +- .../mediaLibrary/components/subwayPrice.vue | 3 +- .../components/waitingHallPrice.vue | 3 +- src/views/mediaLibrary/downFiles.vue | 20 +++- src/views/mediaLibrary/downRecords.vue | 104 ++++++++++++++++++ src/views/mediaLibrary/importPrice.vue | 6 +- src/views/mediaLibrary/index.vue | 50 ++++++--- src/views/mediaLibrary/mediaDetail.vue | 6 +- src/views/mediaLibrary/pickLat.vue | 6 +- src/views/mediaMap/index.vue | 18 +-- src/views/outdoorMedia/detail.vue | 3 +- src/views/outdoorMedia/index.vue | 9 +- src/views/pitchPrice/index.vue | 6 +- src/views/supplier/index.vue | 6 +- src/views/supplier/supplierLogs.vue | 3 +- src/views/system/pptTemplate/index.vue | 3 +- 26 files changed, 228 insertions(+), 90 deletions(-) create mode 100644 src/api/mediaDownRecord.js create mode 100644 src/views/mediaLibrary/downRecords.vue diff --git a/src/api/mediaDownRecord.js b/src/api/mediaDownRecord.js new file mode 100644 index 0000000..5ed656b --- /dev/null +++ b/src/api/mediaDownRecord.js @@ -0,0 +1,28 @@ +import request from '@/utils/request' + +// 分页获取下载任务 +export function busDownloadRecordPage(query) { + return request({ + url: '/admin/busDownloadRecord/getBusDownloadRecordPage', + method: 'post', + data: query + }) +} + +// 批量添加任务 +export function addBusDownloadRecord(query) { + return request({ + url: '/admin/busDownloadRecord/addBatch', + method: 'post', + data: query + }) +} + +// 修改下载任务状态 +export function updateBusDownloadRecord(query) { + return request({ + url: '/admin/busDownloadRecord/updateBusDownloadRecord', + method: 'post', + data: query + }) +} \ No newline at end of file diff --git a/src/components/FileUpload/PdfPreview.vue b/src/components/FileUpload/PdfPreview.vue index 8e2002c..cc117e9 100644 --- a/src/components/FileUpload/PdfPreview.vue +++ b/src/components/FileUpload/PdfPreview.vue @@ -36,15 +36,13 @@ const scale = ref(1) const progress = ref(0) const loading = ref(false) -const handlePdfLoaded = (pdf) => { - console.log('PDF 加载完成', pdf) +const handlePdfLoaded = (pdf) => { loading.value = false pageCount.value = pdf.numPages } const handleProgress = (progressData) => { - progress.value = Math.round(progressData.loaded / progressData.total * 100) - console.log(progress.value) + progress.value = Math.round(progressData.loaded / progressData.total * 100) if(progress.value < 100) loading.value = true else loading.value = false } diff --git a/src/components/FileUpload/supplierDetailFile.vue b/src/components/FileUpload/supplierDetailFile.vue index c846d04..e9d4da5 100644 --- a/src/components/FileUpload/supplierDetailFile.vue +++ b/src/components/FileUpload/supplierDetailFile.vue @@ -66,8 +66,7 @@ const setFileInfo = (files) => { } // 判断是否为图片文件 -const isImageFile = (suffix) => { - console.log('是否图片', suffix, ['jpeg', 'jpg', 'png'].includes(suffix.toLowerCase())) +const isImageFile = (suffix) => { return ['jpeg', 'jpg', 'png'].includes(suffix.toLowerCase()) } diff --git a/src/components/ViewFile/index.vue b/src/components/ViewFile/index.vue index e7b0f17..c4d28e9 100644 --- a/src/components/ViewFile/index.vue +++ b/src/components/ViewFile/index.vue @@ -54,8 +54,7 @@ const viewTitle = ref('查看文件') const viewFileOpen = ref(false) const fileList = ref([]) // 判断是否为图片文件 -const isImageFile = (suffix) => { - console.log('是否图片', suffix, ['jpeg', 'jpg', 'png'].includes(suffix.toLowerCase())) +const isImageFile = (suffix) => { return ['jpeg', 'jpg', 'png'].includes(suffix.toLowerCase()) } // 单个文件下载 diff --git a/src/plugins/modal.js b/src/plugins/modal.js index 3c43124..ea810ae 100644 --- a/src/plugins/modal.js +++ b/src/plugins/modal.js @@ -60,6 +60,14 @@ export default { type: "warning", }) }, + myConfirm(content, option) { + return ElMessageBox.confirm(content, "系统提示", { + confirmButtonText: option.confirmButtonText, + // cancelButtonText: '取消', + closeOnClickModal: false, // 禁止点击遮罩层关闭 + type: "warning", + }) + }, // 提交内容 prompt(content) { return ElMessageBox.prompt(content, "系统提示", { diff --git a/src/views/mediaLibrary/components/accessControlPrice.vue b/src/views/mediaLibrary/components/accessControlPrice.vue index 9e5ca34..0850cf9 100644 --- a/src/views/mediaLibrary/components/accessControlPrice.vue +++ b/src/views/mediaLibrary/components/accessControlPrice.vue @@ -268,8 +268,7 @@ const handleSubmit = () => { const getMediaPrice = (_mediaId, _showOptionColumn) => { showOptionColumn.value = _showOptionColumn if (_mediaId) { - mediaPrice({ mediaId: _mediaId }).then(res => { - console.log('历史报价', res) + mediaPrice({ mediaId: _mediaId }).then(res => { quotationList.value = res.data.filter(item => item.mediaType == 1) quotationList.value.forEach(element => { element.currentImageSrc = defaultImageSrc.value diff --git a/src/views/mediaLibrary/components/barrierGatePrice.vue b/src/views/mediaLibrary/components/barrierGatePrice.vue index 674bb65..3fde1f5 100644 --- a/src/views/mediaLibrary/components/barrierGatePrice.vue +++ b/src/views/mediaLibrary/components/barrierGatePrice.vue @@ -246,8 +246,7 @@ const handleSubmit = () => { const getMediaPrice = (_mediaId, _showOptionColumn) => { showOptionColumn.value = _showOptionColumn if (_mediaId) { - mediaPrice({ mediaId: _mediaId }).then(res => { - console.log('历史报价', res) + mediaPrice({ mediaId: _mediaId }).then(res => { quotationList.value = res.data.filter(item => item.mediaType == 3) quotationList.value.forEach(element => { element.currentImageSrc = defaultImageSrc.value diff --git a/src/views/mediaLibrary/components/competitiveOffer.vue b/src/views/mediaLibrary/components/competitiveOffer.vue index 0dae7d1..0e4ee3e 100644 --- a/src/views/mediaLibrary/components/competitiveOffer.vue +++ b/src/views/mediaLibrary/components/competitiveOffer.vue @@ -278,17 +278,14 @@ const handleSubmit = () => { }) } // 获取历史报价 -const getMediaPrice = (_mediaId, _showOptionColumn) => { - console.log('进来了?', _mediaId, _showOptionColumn) +const getMediaPrice = (_mediaId, _showOptionColumn) => { showOptionColumn.value = _showOptionColumn if (_mediaId) { - mediaPrice({ mediaId: _mediaId }).then(res => { - console.log('历史报价', res) + mediaPrice({ mediaId: _mediaId }).then(res => { quotationList.value = res.data.filter(item => item.mediaType == 0) quotationList.value.forEach(element => { element.currentImageSrc = defaultImageSrc.value - }); - console.log('历史报价结果', quotationList.value) + }); }) } } diff --git a/src/views/mediaLibrary/components/garageLightBox.vue b/src/views/mediaLibrary/components/garageLightBox.vue index 9300c59..b5b80c8 100644 --- a/src/views/mediaLibrary/components/garageLightBox.vue +++ b/src/views/mediaLibrary/components/garageLightBox.vue @@ -259,8 +259,7 @@ const handleSubmit = () => { const getMediaPrice = (_mediaId, _showOptionColumn) => { showOptionColumn.value = _showOptionColumn if (_mediaId) { - mediaPrice({ mediaId: _mediaId }).then(res => { - console.log('历史报价', res) + mediaPrice({ mediaId: _mediaId }).then(res => { quotationList.value = res.data.filter(item => item.mediaType == 7) quotationList.value.forEach(element => { element.currentImageSrc = defaultImageSrc.value diff --git a/src/views/mediaLibrary/components/highSpeedRailway.vue b/src/views/mediaLibrary/components/highSpeedRailway.vue index f552bca..bb7b39d 100644 --- a/src/views/mediaLibrary/components/highSpeedRailway.vue +++ b/src/views/mediaLibrary/components/highSpeedRailway.vue @@ -253,8 +253,7 @@ const handleSubmit = () => { const getMediaPrice = (_mediaId, _showOptionColumn) => { showOptionColumn.value = _showOptionColumn if (_mediaId) { - mediaPrice({ mediaId: _mediaId }).then(res => { - console.log('历史报价', res) + mediaPrice({ mediaId: _mediaId }).then(res => { quotationList.value = res.data.filter(item => item.mediaType == 5) quotationList.value.forEach(element => { element.currentImageSrc = defaultImageSrc.value diff --git a/src/views/mediaLibrary/components/officeBuilding.vue b/src/views/mediaLibrary/components/officeBuilding.vue index 7149a49..ad80739 100644 --- a/src/views/mediaLibrary/components/officeBuilding.vue +++ b/src/views/mediaLibrary/components/officeBuilding.vue @@ -259,8 +259,7 @@ const handleSubmit = () => { const getMediaPrice = (_mediaId, _showOptionColumn) => { showOptionColumn.value = _showOptionColumn if (_mediaId) { - mediaPrice({ mediaId: _mediaId }).then(res => { - console.log('历史报价', res) + mediaPrice({ mediaId: _mediaId }).then(res => { quotationList.value = res.data.filter(item => item.mediaType == 6) quotationList.value.forEach(element => { element.currentImageSrc = defaultImageSrc.value diff --git a/src/views/mediaLibrary/components/subwayPrice.vue b/src/views/mediaLibrary/components/subwayPrice.vue index 92a1f71..66b219a 100644 --- a/src/views/mediaLibrary/components/subwayPrice.vue +++ b/src/views/mediaLibrary/components/subwayPrice.vue @@ -358,8 +358,7 @@ const handleSubmit = () => { const getMediaPrice = (_mediaId, _showOptionColumn) => { showOptionColumn.value = _showOptionColumn if (_mediaId) { - mediaPrice({ mediaId: _mediaId }).then(res => { - console.log('历史报价', res) + mediaPrice({ mediaId: _mediaId }).then(res => { quotationList.value = res.data.filter(item => item.mediaType == 4) quotationList.value.forEach(element => { element.currentImageSrc = defaultImageSrc.value diff --git a/src/views/mediaLibrary/components/waitingHallPrice.vue b/src/views/mediaLibrary/components/waitingHallPrice.vue index c855892..f26385d 100644 --- a/src/views/mediaLibrary/components/waitingHallPrice.vue +++ b/src/views/mediaLibrary/components/waitingHallPrice.vue @@ -319,8 +319,7 @@ const handleSubmit = () => { const getMediaPrice = (_mediaId, _showOptionColumn) => { showOptionColumn.value = _showOptionColumn if (_mediaId) { - mediaPrice({ mediaId: _mediaId }).then(res => { - console.log('历史报价', res) + mediaPrice({ mediaId: _mediaId }).then(res => { quotationList.value = res.data.filter(item => item.mediaType == 2) quotationList.value.forEach(element => { element.currentImageSrc = defaultImageSrc.value diff --git a/src/views/mediaLibrary/downFiles.vue b/src/views/mediaLibrary/downFiles.vue index 3fb8161..9138786 100644 --- a/src/views/mediaLibrary/downFiles.vue +++ b/src/views/mediaLibrary/downFiles.vue @@ -55,8 +55,10 @@ import iconTxt from '@/assets/images/iconTxt.png' import iconPpt from '@/assets/images/iconPpt.png' import { mediaFiles } from "@/api/mediaLibrary" import { downFile } from "@/api/common" +import { addBusDownloadRecord } from "@/api/mediaDownRecord" const { proxy } = getCurrentInstance() +const emit = defineEmits(['downBack']); const downFileOpen = ref(false) // 全量媒体文件列表 const allFileList = ref([]) @@ -76,8 +78,10 @@ const fileTypeArr = ref([ { fileType: 12, fileTypeName: 'MR和制作要求', typeFileList: [] } ]) +const downloadRecords = ref([]) + // 判断是否为图片文件 -const isImageFile = (suffix) => { +const isImageFile = (suffix) => { return ['jpeg', 'jpg', 'png'].includes(suffix.toLowerCase()) } // 单个文件下载 @@ -95,7 +99,18 @@ const handleDownFile = (fileUrl, downLoadName) => { } // 多文件下载 const handleDownAllFile = () => { - + allFileList.value.forEach(item => { + downloadRecords.value.push({ filePath: item.fileUrl, fileName: item.originalFileName, state: 0 }) + }) + if (downloadRecords.value.length > 0) { + addBusDownloadRecord({ downloadRecordList: downloadRecords.value }).then(res => { + if (res.code == 200) { + downloadRecords.value = [] + emit('downBack') + downFileOpen.value = false + } + }) + } } // 按类型获取媒体文件列表 const getMediaFileList = (_mediaId, itemFileType) => { @@ -109,6 +124,7 @@ const getMediaFileList = (_mediaId, itemFileType) => { // 对外暴漏方法 const initFileList = (_open, _mediaId) => { downFileOpen.value = true + allFileList.value = [] nextTick(() => { fileTypeArr.value.forEach(item => { getMediaFileList(_mediaId, item) diff --git a/src/views/mediaLibrary/downRecords.vue b/src/views/mediaLibrary/downRecords.vue new file mode 100644 index 0000000..76cf17e --- /dev/null +++ b/src/views/mediaLibrary/downRecords.vue @@ -0,0 +1,104 @@ + + \ No newline at end of file diff --git a/src/views/mediaLibrary/importPrice.vue b/src/views/mediaLibrary/importPrice.vue index 7879fe2..dcc0b4c 100644 --- a/src/views/mediaLibrary/importPrice.vue +++ b/src/views/mediaLibrary/importPrice.vue @@ -39,14 +39,12 @@ const mediaType = ref(null) const docUploadList = ref([]) // 自定义上传文件资料 -const requestDocUpload = (options) => { - console.log('options', options) +const requestDocUpload = (options) => { proxy.$modal.loading('正在上传文件,请耐心等待...') const { file } = options var formData = new FormData(); formData.append('mediaType', mediaType.value); - formData.append('file', file); - console.log('formData', formData) + formData.append('file', file); importPriceByExcel(formData).then(res => { if (res.code == 200) { proxy.$modal.msgSuccess("导入成功") diff --git a/src/views/mediaLibrary/index.vue b/src/views/mediaLibrary/index.vue index 01c0f99..a9c9834 100644 --- a/src/views/mediaLibrary/index.vue +++ b/src/views/mediaLibrary/index.vue @@ -259,18 +259,18 @@ - + - - +