实现文件全量下载功能,清除代码中的输出
This commit is contained in:
parent
f6b907eff0
commit
451454634d
28
src/api/mediaDownRecord.js
Normal file
28
src/api/mediaDownRecord.js
Normal file
|
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
}
|
||||
// 单个文件下载
|
||||
|
|
|
|||
|
|
@ -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, "系统提示", {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
104
src/views/mediaLibrary/downRecords.vue
Normal file
104
src/views/mediaLibrary/downRecords.vue
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
<template>
|
||||
<el-drawer v-model="open" title="下载任务" direction="ltr" :before-close="handleClose">
|
||||
<el-table v-loading="loading" :data="downRecords">
|
||||
<el-table-column label="文件名称" align="left" prop="fileName" />
|
||||
<el-table-column label="进度" align="left" prop="progress" width="180">
|
||||
<template #default="scope">
|
||||
<el-progress :text-inside="true" :stroke-width="24" :percentage="scope.row.progress"
|
||||
status="success" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-drawer>
|
||||
</template>
|
||||
<script setup name="Post">
|
||||
import { onMounted, defineExpose, nextTick, ref } from 'vue'
|
||||
import { busDownloadRecordPage, updateBusDownloadRecord } from "@/api/mediaDownRecord"
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const open = ref(false)
|
||||
const downRecords = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
const handleClose = () => {
|
||||
open.value = false
|
||||
}
|
||||
|
||||
const getDownRecords = () => {
|
||||
loading.value = true
|
||||
busDownloadRecordPage({ pageIndex: 1, pageSize: 500, state: 0 }).then(res => {
|
||||
if (res.code == 200) {
|
||||
res.data.list.forEach(item => {
|
||||
item.progress = 0
|
||||
});
|
||||
downRecords.value = res.data.list
|
||||
loading.value = false
|
||||
startDown()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 下载文件方法
|
||||
const startDown = async () => {
|
||||
for (const itemRecord of downRecords.value) { // ✅ 支持异步的 for...of 循环
|
||||
downFiles(itemRecord); // 执行下载逻辑
|
||||
await sleep(1000); // ✔️ 正确等待 1 秒
|
||||
}
|
||||
};
|
||||
// 下载文件方法
|
||||
const downFiles = (itemRecord) => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', itemRecord.filePath, true);
|
||||
xhr.responseType = 'blob';
|
||||
|
||||
// 监听下载进度
|
||||
xhr.onprogress = (event) => {
|
||||
if (event.lengthComputable) {
|
||||
var downloadProgress = (event.loaded / event.total) * 100;
|
||||
itemRecord.progress = downloadProgress
|
||||
if (downloadProgress == 100) {
|
||||
updateBusDownloadRecord({ id: itemRecord.id, state: 2 }).then(res => { })
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 下载完成
|
||||
xhr.onload = () => {
|
||||
if (xhr.status === 200) {
|
||||
const blob = xhr.response;
|
||||
const link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = itemRecord.fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
};
|
||||
|
||||
// 错误处理
|
||||
xhr.onerror = () => {
|
||||
console.error('下载失败');
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
// 定义一个通用的 sleep 函数
|
||||
const sleep = (ms) => {
|
||||
return new Promise(resolve => setTimeout(resolve, ms)); // ms 是毫秒数
|
||||
}
|
||||
|
||||
// 对外暴漏方法
|
||||
const initDownList = (_open) => {
|
||||
open.value = true
|
||||
downRecords.value = []
|
||||
nextTick(() => {
|
||||
getDownRecords()
|
||||
})
|
||||
}
|
||||
|
||||
// 暴露方法\属性给父组件
|
||||
defineExpose({
|
||||
initDownList
|
||||
});
|
||||
</script>
|
||||
|
|
@ -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("导入成功")
|
||||
|
|
|
|||
|
|
@ -259,18 +259,18 @@
|
|||
<media-logs ref="mediaLogsRef" v-if="showLogs" @handleShowList="handleCloseLogs" />
|
||||
<abolish-dialog ref="abolishRef" @handleReloadList="getMediaPageList" />
|
||||
<history-data ref="historyDataRef" />
|
||||
<down-files ref="downFileRef" />
|
||||
<down-files ref="downFileRef" @downBack="handleDownBack" />
|
||||
<view-file-dialog ref="viewFileRef" />
|
||||
<export-dialog ref="exportDialogRef" />
|
||||
<export-p-p-t-dialog ref="exportPPTDialogRef" />
|
||||
<importPrice ref="importPriceRef" />
|
||||
|
||||
|
||||
<down-records ref="downRecordsRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup name="Post">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import optionIcon from '@/assets/images/optionIcon.png'
|
||||
import optionIconHover from '@/assets/images/optionIconHover.png'
|
||||
|
|
@ -284,6 +284,7 @@ import { busTradingAreaPage } from "@/api/system/businessArea"
|
|||
import { mediaPageList } from "@/api/mediaLibrary"
|
||||
import { listDept } from "@/api/system/dept"
|
||||
import { pptTemplatePage } from "@/api/system/pptTemplate"
|
||||
import { busDownloadRecordPage } from "@/api/mediaDownRecord"
|
||||
// 注入组件
|
||||
import mediaForm from "./mediaForm.vue";
|
||||
import mediaDetail from "./mediaDetail.vue";
|
||||
|
|
@ -295,9 +296,9 @@ import exportDialog from './exportDialog.vue';
|
|||
import abolishDialog from './abolishDialog.vue';
|
||||
import exportPPTDialog from './exportPPTDialog.vue';
|
||||
import importPrice from './importPrice.vue';
|
||||
import downRecords from './downRecords.vue';
|
||||
import { useBackgroundStore } from '@/store/modules/background'
|
||||
|
||||
|
||||
const router = useRouter()
|
||||
const bgStore = useBackgroundStore()
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
|
@ -362,9 +363,9 @@ const mediaLogsRef = ref(null)
|
|||
// ppt模板数据
|
||||
const templateList = ref([])
|
||||
// 媒体多选数据
|
||||
const multipleChoseArr = ref([])
|
||||
const multipleChoseArr = ref([])
|
||||
const unfoldFlag = ref(false)
|
||||
|
||||
|
||||
const importPriceRef = ref(null)
|
||||
const abolishRef = ref(null)
|
||||
const historyDataRef = ref(null)
|
||||
|
|
@ -372,6 +373,7 @@ const downFileRef = ref(null)
|
|||
const viewFileRef = ref(null)
|
||||
const exportDialogRef = ref(null)
|
||||
const exportPPTDialogRef = ref(null)
|
||||
const downRecordsRef = ref(null)
|
||||
|
||||
// 获取PPT模板
|
||||
const getpptTemplatePageList = () => {
|
||||
|
|
@ -471,7 +473,7 @@ const getbusinessAreaList = (val) => {
|
|||
// 折叠展开
|
||||
const handleFlod = () => {
|
||||
unfoldFlag.value = !unfoldFlag.value
|
||||
}
|
||||
}
|
||||
/** 查询媒体信息列表 */
|
||||
const getMediaPageList = () => {
|
||||
loading.value = true
|
||||
|
|
@ -492,7 +494,7 @@ const getMediaPageList = () => {
|
|||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1
|
||||
getMediaPageList()
|
||||
}
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryParams.value = {
|
||||
|
|
@ -512,7 +514,7 @@ const resetQuery = () => {
|
|||
businessDistrictId: undefined
|
||||
}
|
||||
handleQuery()
|
||||
}
|
||||
}
|
||||
// 选择媒体事件
|
||||
const handleSelectionChange = (selection) => {
|
||||
multipleChoseArr.value = selection
|
||||
|
|
@ -577,12 +579,28 @@ const handleHistoryChart = (row) => {
|
|||
}
|
||||
// 打开文件下载
|
||||
const handleDownFiles = (row) => {
|
||||
downFileRef.value.initFileList(true, row.id)
|
||||
}
|
||||
busDownloadRecordPage({ pageIndex: 1, pageSize: 1, state: 0 }).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data.list.length == 0) downFileRef.value.initFileList(true, row.id)
|
||||
else {
|
||||
ElMessageBox.alert('您有待下载的文件等待下载...', '系统消息', {
|
||||
confirmButtonText: '查看下载任务',
|
||||
callback: (action) => {
|
||||
downRecordsRef.value.initDownList()
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 全部下载回调
|
||||
const handleDownBack = () => {
|
||||
downRecordsRef.value.initDownList()
|
||||
}
|
||||
// 查看文件
|
||||
const handleViewPhoto = (_fileType, row) => {
|
||||
viewFileRef.value.initFileList(_fileType, row.id)
|
||||
}
|
||||
}
|
||||
/** 导出Excel按钮操作 */
|
||||
const handleExportExcel = () => {
|
||||
if (multipleChoseArr.value.length == 0) {
|
||||
|
|
@ -598,13 +616,13 @@ const handleExportPPT = (tempId) => {
|
|||
proxy.$modal.msgWarning("请选择要导出的媒体!!!")
|
||||
return false
|
||||
}
|
||||
const mediaIds = multipleChoseArr.value.map(item => item.id);
|
||||
const mediaIds = multipleChoseArr.value.map(item => item.id);
|
||||
exportPPTDialogRef.value.initExportPPT(tempId, mediaIds, multipleChoseArr.value)
|
||||
}
|
||||
}
|
||||
/** 导入按钮操作 */
|
||||
const handleImport = (val) => {
|
||||
importPriceRef.value.initImportPriceExcel(val)
|
||||
}
|
||||
}
|
||||
// 打开媒体地图
|
||||
const handleGoMediaMap = () => {
|
||||
router.push('/mediaMap')
|
||||
|
|
|
|||
|
|
@ -517,13 +517,11 @@ const handleClose = () => {
|
|||
emit('handleShowList')
|
||||
}
|
||||
// 折叠面板点击
|
||||
const handleChange = (val) => {
|
||||
console.log(val)
|
||||
const handleChange = (val) => {
|
||||
activeNames.value = val
|
||||
}
|
||||
// 报价类型切换
|
||||
const handlePriceTypeClick = (tab, event) => {
|
||||
console.log(tab, event)
|
||||
const handlePriceTypeClick = (tab, event) => {
|
||||
activePriceType.value = tab
|
||||
}
|
||||
// 初始化
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ const getLocaleListList = (searchValue) => {
|
|||
selectLoading.value = true
|
||||
if (searchValue !== "") {
|
||||
placeSearch.value.search(searchValue, function (status, result) {
|
||||
// 查询成功时,result即对应匹配的POI信息
|
||||
console.log(result.poiList, result.poiList.pois, result.poiList.pois?.length)
|
||||
// 查询成功时,result即对应匹配的POI信息
|
||||
if (result.poiList.pois?.length) {
|
||||
localeList.value = result.poiList?.pois
|
||||
}
|
||||
|
|
@ -60,8 +59,7 @@ const getLocaleListList = (searchValue) => {
|
|||
|
||||
|
||||
// 地点选择
|
||||
const currentSelect = (val) => {
|
||||
console.log('val', val)
|
||||
const currentSelect = (val) => {
|
||||
localeKeyWord.value = val.name
|
||||
pickLatLableValue.value = { lng: val.location.lng, lat: val.location.lat }
|
||||
addmark(val)
|
||||
|
|
|
|||
|
|
@ -216,8 +216,7 @@ const handleViewMedia = (_mediaId) => {
|
|||
mediaDetail({ mediaId: _mediaId }).then(res => {
|
||||
detailForm.value = res.data
|
||||
if (detailForm.value.mediaFile && detailForm.value.mediaFile.length > 0) {
|
||||
fileList.value = detailForm.value.mediaFile.filter(item => item.fileType == 6)
|
||||
console.log('图片', fileList.value)
|
||||
fileList.value = detailForm.value.mediaFile.filter(item => item.fileType == 6)
|
||||
}
|
||||
open.value = true
|
||||
})
|
||||
|
|
@ -229,8 +228,7 @@ const getLocaleListList = (searchValue) => {
|
|||
selectLoading.value = true
|
||||
if (searchValue !== "") {
|
||||
placeSearch.value.search(searchValue, function (status, result) {
|
||||
// 查询成功时,result即对应匹配的POI信息
|
||||
console.log(result.poiList, result.poiList.pois, result.poiList.pois?.length)
|
||||
// 查询成功时,result即对应匹配的POI信息
|
||||
if (result.poiList.pois?.length) {
|
||||
localeList.value = result.poiList?.pois
|
||||
}
|
||||
|
|
@ -239,8 +237,7 @@ const getLocaleListList = (searchValue) => {
|
|||
}
|
||||
}
|
||||
// 中心点选择
|
||||
const currentSelect = (val) => {
|
||||
console.log('val', val)
|
||||
const currentSelect = (val) => {
|
||||
selectConfig.value = val
|
||||
centerPointName.value = val.name
|
||||
// queryParams.value.keyword = val.name
|
||||
|
|
@ -315,8 +312,7 @@ const createCircleHandle = () => {
|
|||
const handlePosition = new AMap.LngLat(
|
||||
center.lng + radius / (111320 * Math.cos(center.lat * Math.PI / 180)),
|
||||
center.lat
|
||||
);
|
||||
console.log('手柄', handlePosition)
|
||||
);
|
||||
// 创建手柄标记
|
||||
circleHandle.value = new AMap.Marker({
|
||||
position: [handlePosition.lng, handlePosition.lat],
|
||||
|
|
@ -635,8 +631,7 @@ const renderMassMarks = () => {
|
|||
if (itemPoint.businessType == 2) points.value.push({ "lnglat": [itemPoint.x, itemPoint.y], "mediaId": itemPoint.mediaId, "style": 1 })
|
||||
});
|
||||
}
|
||||
}).then(res => {
|
||||
console.log('points', points.value)
|
||||
}).then(res => {
|
||||
// 创建MassMarks对象
|
||||
massMarks.value = new AMap.MassMarks(points.value, {
|
||||
opacity: 1,
|
||||
|
|
@ -649,8 +644,7 @@ const renderMassMarks = () => {
|
|||
massMarks.value.setMap(mapInstance.value);
|
||||
|
||||
// 添加点击事件
|
||||
massMarks.value.on('click', function (e) {
|
||||
console.log('点击了节点', e.data)
|
||||
massMarks.value.on('click', function (e) {
|
||||
handleViewMedia(e.data.mediaId)
|
||||
});
|
||||
})
|
||||
|
|
|
|||
|
|
@ -86,8 +86,7 @@ const getMediaDetail = (_mediaId) => {
|
|||
mediaDetail({ mediaId: _mediaId }).then(res => {
|
||||
detailForm.value = res.data
|
||||
if (detailForm.value.mediaFile && detailForm.value.mediaFile.length > 0) {
|
||||
fileList.value = detailForm.value.mediaFile.filter(item => item.fileType == 6)
|
||||
console.log('图片', fileList.value)
|
||||
fileList.value = detailForm.value.mediaFile.filter(item => item.fileType == 6)
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
|
|
|
|||
|
|
@ -633,12 +633,10 @@ const renderMassMarks = () => {
|
|||
];
|
||||
// 调用接口,获取数据点
|
||||
points.value = []
|
||||
outdoorMediaList.value.forEach(itemPoint => {
|
||||
console.log('itemPoint', itemPoint)
|
||||
outdoorMediaList.value.forEach(itemPoint => {
|
||||
if (itemPoint.businessType == 1) points.value.push({ "lnglat": [itemPoint.mapX, itemPoint.mapY], "name": itemPoint.mediaName, "mediaId": itemPoint.id, "style": 0 })
|
||||
if (itemPoint.businessType == 2) points.value.push({ "lnglat": [itemPoint.mapX, itemPoint.mapY], "name": itemPoint.mediaName, "mediaId": itemPoint.id, "style": 1 })
|
||||
});
|
||||
console.log('points', points.value)
|
||||
});
|
||||
// 创建MassMarks对象
|
||||
massMarks.value = new AMap.MassMarks(points.value, {
|
||||
opacity: 1,
|
||||
|
|
@ -651,8 +649,7 @@ const renderMassMarks = () => {
|
|||
massMarks.value.setMap(mapInstance.value);
|
||||
|
||||
// 添加点击事件
|
||||
massMarks.value.on('click', function (e) {
|
||||
console.log('点击了节点', e.data)
|
||||
massMarks.value.on('click', function (e) {
|
||||
handleViewMedia(e.data.mediaId)
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,15 +384,13 @@ const requestDocUpload = (options) => {
|
|||
const { file } = options
|
||||
var formData = new FormData();
|
||||
formData.append('file', file);
|
||||
importSupplierComparePrice(formData).then(res => {
|
||||
console.log('接口接口', res)
|
||||
importSupplierComparePrice(formData).then(res => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess("导入成功")
|
||||
proxy.$modal.closeLoading()
|
||||
uploadOpen.value = false
|
||||
getPitchPricePage()
|
||||
} else {
|
||||
console.log('接口异常', res)
|
||||
} else {
|
||||
proxy.$modal.closeLoading()
|
||||
proxy.$modal.msgError(res.msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -388,15 +388,13 @@ const requestDocUpload = (options) => {
|
|||
const { file } = options
|
||||
var formData = new FormData();
|
||||
formData.append('file', file);
|
||||
importSupplier(formData).then(res => {
|
||||
console.log('接口接口', res)
|
||||
importSupplier(formData).then(res => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess("导入成功")
|
||||
proxy.$modal.closeLoading()
|
||||
uploadOpen.value = false
|
||||
getSupplierPageList()
|
||||
} else {
|
||||
console.log('接口异常', res)
|
||||
} else {
|
||||
proxy.$modal.closeLoading()
|
||||
proxy.$modal.msgError(res.msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,8 +195,7 @@ const getSupplierList = () => {
|
|||
loading.value = true
|
||||
listBusSupplierLog(queryParams.value).then(res => {
|
||||
res.data.forEach(item => {
|
||||
item.supplierName = supplierName.value
|
||||
console.log(JSON.parse(item.updateContent))
|
||||
item.supplierName = supplierName.value
|
||||
});
|
||||
supplierLogList.value = res.data
|
||||
loading.value = false
|
||||
|
|
|
|||
|
|
@ -173,8 +173,7 @@ const handleAdd = () => {
|
|||
const handleUpdate = (row) => {
|
||||
reset()
|
||||
getPptTemplate(row.id).then(response => {
|
||||
form.value = response.data
|
||||
console.log('请求结果', form.value)
|
||||
form.value = response.data
|
||||
docUploadList.value.push({
|
||||
name: form.value.originalFileName,
|
||||
url: form.value.fileUrl,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user