diff --git a/src/views/mediaLibrary/exportPPTDialog.vue b/src/views/mediaLibrary/exportPPTDialog.vue index 59fe8ed..6d63f71 100644 --- a/src/views/mediaLibrary/exportPPTDialog.vue +++ b/src/views/mediaLibrary/exportPPTDialog.vue @@ -54,14 +54,118 @@ const exportForm = ref({ const pptFieldCheckAll = ref(false) const pptFieldIsIndeterminate = ref(true) // ppt字段 -const pptFields = ref([]) +const pptFields = ref([ + { + displayName: "媒体名称", + propertyPath: "mediaName" + }, + { + displayName: "媒体位置", + propertyPath: "address" + }, + { + displayName: "纬度", + propertyPath: "mapY" + }, + { + displayName: "经度", + propertyPath: "mapX" + }, + { + displayName: "媒体类型", + propertyPath: "mediaTypeStr" + }, + { + displayName: "媒体大类", + propertyPath: "mediaCategoryStr" + }, + { + displayName: "区域属性", + propertyPath: "businessDistrictName" + }, + { + displayName: "播放时间", + propertyPath: "playbackTime" + }, + { + displayName: "是否照明", + propertyPath: "hasLighting" + }, + { + displayName: "展示形式", + propertyPath: "displayFormStr" + }, + { + displayName: "媒体尺寸", + propertyPath: "mediaSize" + }, + { + displayName: "mr", + propertyPath: "mr" + }, + { + displayName: "媒体朝向", + propertyPath: "mediaOrientation" + }, + { + displayName: "媒体流量", + propertyPath: "dailyAvgVehicleFlow" + }, + { + displayName: "媒体优势", + propertyPath: "advantages" + }, + { + displayName: "首次制作安装费", + propertyPath: "firstInstallFee" + }, + { + displayName: "换刊制作安装费", + propertyPath: "changeInstallFee" + }, + { + displayName: "最小购买周期", + propertyPath: "minPurchaseCycle" + }, + { + displayName: "省", + propertyPath: "provinceName" + }, + { + displayName: "市", + propertyPath: "cityName" + }, + { + displayName: "区", + propertyPath: "areaName" + }, + { + displayName: "镇", + propertyPath: "townName" + }, + { + displayName: "部门", + propertyPath: "dataScopeDeptName" + }, + { + displayName: "状态", + propertyPath: "state" + }, + { + displayName: "作废原因", + propertyPath: "invalidReason" + } +]) + + + // 已选择的ppt字段 const checkedPPTFields = ref([]) // 移除已选媒体 const handleCloseTag = (tag) => { const rowIndex = chosedMediaList.value.findIndex(item => item.id == tag.id) - chosedMediaList.value.splice(rowIndex, 1) + chosedMediaList.value.splice(rowIndex, 1) // 重新计算导出媒体id exportForm.value.mediaIds = chosedMediaList.value.map(item => item.id); } @@ -85,7 +189,7 @@ const handleCheckedPPTFieldChange = (value) => { // 导出ppt实现代码 const handleSubmitExportPPT = () => { - exportForm.value.exportFields = checkedPPTFields + exportForm.value.exportFields = checkedPPTFields exportMediaPPT(exportForm.value).then(res => { const downLoadName = '媒体信息_' + getCurrentTime() + '.pptx' // 通过a标签打开新页面下载文件 @@ -114,18 +218,18 @@ const getCurrentTime = () => { return gettime } -// 获取ppt信息字段 -const getMediaExcelPPTField = () => { - mediaPPTField().then(res => { - pptFields.value = res.data - }) -} +// // 获取ppt信息字段 +// const getMediaExcelPPTField = () => { +// mediaPPTField().then(res => { +// pptFields.value = res.data +// }) +// } // 初始化 const initExportPPT = (_tempId, _mediaIds, multipleChoseArr) => { exportForm.value.templateId = _tempId exportForm.value.mediaIds = _mediaIds chosedMediaList.value = JSON.parse(JSON.stringify(multipleChoseArr)) - getMediaExcelPPTField() + // getMediaExcelPPTField() exportOpen.value = true } diff --git a/src/views/mediaLibrary/index.vue b/src/views/mediaLibrary/index.vue index ff8d63b..0a7e12d 100644 --- a/src/views/mediaLibrary/index.vue +++ b/src/views/mediaLibrary/index.vue @@ -186,7 +186,7 @@ @@ -246,6 +246,8 @@ v-hasPermi="['mediaLibrary:historicalData']">历史数据
废除
+
删除
日志
- +
@@ -291,7 +293,7 @@ import { listBusSupplier } from "@/api/supplier" import { sysRegionListByPid } from "@/api/system/administrativeRegion" import { sysMediaTypeListByPid } from "@/api/system/mediaType" import { busTradingAreaPage } from "@/api/system/businessArea" -import { mediaPageList } from "@/api/mediaLibrary" +import { mediaPageList, deleteMedia } from "@/api/mediaLibrary" import { listDept } from "@/api/system/dept" import { pptTemplatePage } from "@/api/system/pptTemplate" import { busDownloadRecordPage } from "@/api/mediaDownRecord" @@ -541,7 +543,7 @@ const handleSelectionChange = (selection) => { if (isSettingSelection.value) { return } - + // 获取当前页所有行的ID const currentPageIds = mediaList.value.map(item => item.id) @@ -553,7 +555,7 @@ const handleSelectionChange = (selection) => { ) // 如果当前页有应该选中的数据但selection为空,说明是页面切换,不处理 - if (shouldHaveSelections) { + if (shouldHaveSelections) { return } } @@ -569,7 +571,7 @@ const handleSelectionChange = (selection) => { if (!multipleChoseArr.value.some(item => item.id === newItem.id)) { multipleChoseArr.value.push(newItem) } - }) + }) } // 设置表格选中状态 - 完善版本 const setTableSelection = () => { @@ -635,6 +637,15 @@ const handleUpdate = (row) => { mediaFormRef.value.initForm('编辑媒体信息', row) }) } +// 删除 +const handleDelete = (row) => { + proxy.$modal.confirm('是否确认删除名称为"' + row.mediaName + '"的媒体数据?').then(function () { + return deleteMedia({ mediaId: row.id }) + }).then(() => { + getMediaPageList() + proxy.$modal.msgSuccess("删除成功") + }).catch(() => { }) +} // 详情 const handleOpenDetail = (row) => { showDetail.value = true diff --git a/src/views/mediaLibrary/mediaDetail.vue b/src/views/mediaLibrary/mediaDetail.vue index b07e07b..617a17f 100644 --- a/src/views/mediaLibrary/mediaDetail.vue +++ b/src/views/mediaLibrary/mediaDetail.vue @@ -74,7 +74,7 @@ - + {{ detailForm.dailyAvgVehicleFlow }} @@ -122,7 +122,7 @@ - + {{ detailForm.businessDistrictName }} diff --git a/src/views/mediaLibrary/mediaForm.vue b/src/views/mediaLibrary/mediaForm.vue index 9b85394..e6fb7d2 100644 --- a/src/views/mediaLibrary/mediaForm.vue +++ b/src/views/mediaLibrary/mediaForm.vue @@ -116,12 +116,8 @@ - - - - + + @@ -173,7 +169,7 @@ - + - 添加商圈 + 添加区域属性