修改bug,对接校准平台接口
This commit is contained in:
parent
48e750152c
commit
d47b29ad26
52
src/api/calibration.js
Normal file
52
src/api/calibration.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取校准任务分页列表
|
||||
export function calibraTionPage(query) {
|
||||
return request({
|
||||
url: '/media/align/tasks/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 上传校准文件 单个
|
||||
export function calibraTionImport(data) {
|
||||
return request({
|
||||
url: '/media/align/compare/import',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 300000, // 300秒 = 5分钟,根据文件大小调整
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 获取校准结果
|
||||
export function calibraTionResult(query) {
|
||||
return request({
|
||||
url: '/media/align/tasks/result',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除校准任务
|
||||
export function deleteCalibraTionTask(query) {
|
||||
return request({
|
||||
url: '/media/align/result/remove',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 存为历史报价
|
||||
export function saveHistoryPrice(query) {
|
||||
return request({
|
||||
url: '/media/align/saveHistoryPrice',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -866,6 +866,9 @@ const setTown = (value) => {
|
|||
if (choseTown) {
|
||||
ruleForm.value.mediaCity = ruleForm.value.provinceName + '/' + ruleForm.value.cityName + '/' + ruleForm.value.areaName + '/' + choseTown.name
|
||||
ruleForm.value.townName = choseTown.name
|
||||
} else {
|
||||
ruleForm.value.mediaCity = ruleForm.value.provinceName + '/' + ruleForm.value.cityName + '/' + ruleForm.value.areaName
|
||||
ruleForm.value.townName = undefined
|
||||
}
|
||||
getbusinessAreaList()
|
||||
}
|
||||
|
|
|
@ -46,8 +46,7 @@
|
|||
<div class="mediaName">{{ detailForm.mediaName }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<el-form ref="detailFormRef" :model="detailForm" label-width="130px" class="myMediaDetailForm"
|
||||
v-loading="loading">
|
||||
<el-form ref="detailFormRef" :model="detailForm" label-width="130px" class="myMediaDetailForm">
|
||||
<el-form-item label="业务">
|
||||
{{ detailForm.dataScopeDeptName }}
|
||||
</el-form-item>
|
||||
|
@ -105,8 +104,45 @@
|
|||
<el-form-item label="媒体图片" class="moreRowContent">
|
||||
<el-row :gutter="30" class="my_form_row">
|
||||
<el-col :span="12" v-for="itemFile in fileList">
|
||||
<img :src="baseUrl + itemFile.fileName" fit="fill"
|
||||
style="width: 80px; height: 80px; border-radius: 4px; background: #1a75e6; border: 1px solid #d2d2d2; margin-bottom: 20px;" />
|
||||
<!-- <img :src="baseUrl + itemFile.fileName" fit="fill"
|
||||
@click.stop="handleCardPreview(itemFile.fileName)"
|
||||
style="width: 80px; height: 80px; border-radius: 4px; background: #1a75e6; border: 1px solid #d2d2d2; margin-bottom: 20px; cursor: pointer;" /> -->
|
||||
<el-image
|
||||
style="width: 80px; height: 80px; border-radius: 4px; background: #1a75e6; border: 1px solid #d2d2d2; margin-bottom: 20px; cursor: pointer;"
|
||||
:src="baseUrl + itemFile.fileName" :preview-src-list="previewImg" fit="cover"
|
||||
show-progress>
|
||||
<template #toolbar="{ actions, prev, next, reset, activeIndex, setActiveItem }">
|
||||
<el-icon @click="prev">
|
||||
<Back />
|
||||
</el-icon>
|
||||
<el-icon @click="next">
|
||||
<Right />
|
||||
</el-icon>
|
||||
<el-icon @click="setActiveItem(previewImg.length - 1)">
|
||||
<DArrowRight />
|
||||
</el-icon>
|
||||
<el-icon @click="actions('zoomOut')">
|
||||
<ZoomOut />
|
||||
</el-icon>
|
||||
<el-icon @click="actions('zoomIn', { enableTransition: false, zoomRate: 2 })">
|
||||
<ZoomIn />
|
||||
</el-icon>
|
||||
<el-icon @click="
|
||||
actions('clockwise', { rotateDeg: 180, enableTransition: false })
|
||||
">
|
||||
<RefreshRight />
|
||||
</el-icon>
|
||||
<el-icon @click="actions('anticlockwise')">
|
||||
<RefreshLeft />
|
||||
</el-icon>
|
||||
<el-icon @click="reset">
|
||||
<Refresh />
|
||||
</el-icon>
|
||||
<!-- <el-icon @click="download(activeIndex)">
|
||||
<Download />
|
||||
</el-icon> -->
|
||||
</template>
|
||||
</el-image>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
@ -119,7 +155,16 @@
|
|||
|
||||
<script setup name="Post">
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import {
|
||||
Back,
|
||||
DArrowRight,
|
||||
Refresh,
|
||||
RefreshLeft,
|
||||
RefreshRight,
|
||||
Right,
|
||||
ZoomIn,
|
||||
ZoomOut,
|
||||
} from '@element-plus/icons-vue'
|
||||
import AMapLoader from "@amap/amap-jsapi-loader"; // 引入地图服务
|
||||
import { useBackgroundStore } from '@/store/modules/background'
|
||||
import otherbg from '@/assets/images/otherbg.png'
|
||||
|
@ -133,6 +178,7 @@ const { apiKey, secretKey } = window._CONFIG
|
|||
const open = ref(false)
|
||||
const detailForm = ref({})
|
||||
const fileList = ref([])
|
||||
const previewImg = ref([])
|
||||
// 中心点名称
|
||||
const centerPointName = ref(null)
|
||||
// map实例
|
||||
|
@ -217,6 +263,9 @@ const handleViewMedia = (_mediaId) => {
|
|||
detailForm.value = res.data
|
||||
if (detailForm.value.mediaFile && detailForm.value.mediaFile.length > 0) {
|
||||
fileList.value = detailForm.value.mediaFile.filter(item => item.fileType == 6)
|
||||
fileList.value.forEach(item => {
|
||||
previewImg.value.push(baseUrl + item.fileName)
|
||||
})
|
||||
}
|
||||
open.value = true
|
||||
})
|
||||
|
@ -881,4 +930,10 @@ onMounted(() => {
|
|||
height: 1px;
|
||||
background: #E6EAF1;
|
||||
}
|
||||
|
||||
.preview-image {
|
||||
width: 100%;
|
||||
max-height: 70vh;
|
||||
object-fit: contain;
|
||||
}
|
||||
</style>
|
|
@ -40,41 +40,34 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="文件名称" align="left" prop="fileName" min-width="180"
|
||||
:show-overflow-tooltip="true" />
|
||||
<el-table-column label="任务进度" align="center" prop="process" min-width="150">
|
||||
<el-table-column label="任务进度" align="center" prop="progress" min-width="150">
|
||||
<template #default="scope">
|
||||
<el-progress class="myprogress" type="circle" :percentage="scope.row.process" width="40"
|
||||
stroke-width="2" :color="colors" />
|
||||
<el-progress class="myprogress" type="circle" :percentage="scope.row.progress" :width="40"
|
||||
:stroke-width="2" :color="colors" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作时间" align="center" prop="optionTime" width="210" />
|
||||
<el-table-column label="操作时间" align="center" prop="createTime" width="210" />
|
||||
<el-table-column label="操作" :width="160" align="center">
|
||||
<template #default="scope">
|
||||
<el-button v-if="scope.row.process == 0" link type="primary"
|
||||
v-hasPermi="['system:pptTemplate:edit']">
|
||||
<span v-if="toolType == 1">开始比对</span>
|
||||
<span v-if="toolType == 2">开始分析</span>
|
||||
<span v-if="toolType == 3">开始执行</span>
|
||||
<el-button v-if="scope.row.progress == 100" link type="primary"
|
||||
@click="handleResultOption(scope.row)">
|
||||
查看结果
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.process != 0" link type="primary"
|
||||
@click="handleResultOption(scope.row)" v-hasPermi="['system:pptTemplate:remove']">
|
||||
<span v-if="toolType == 1">比对结果</span>
|
||||
<span v-else>导出结果</span>
|
||||
</el-button>
|
||||
<el-button link type="primary" v-hasPermi="['system:pptTemplate:remove']">
|
||||
<!-- <el-button link type="primary" @click="handleDeleteTask(scope.row)">
|
||||
删除
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination :total="total" v-model:page="queryParams.pageIndex" v-model:limit="queryParams.pageSize"
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getTaskRecordPageList" />
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 比对结果查看对话框 -->
|
||||
<el-dialog title="比对结果" v-model="open" width="1450px" class="my_dialog" align-center :destroy-on-close="true"
|
||||
:close-on-click-modal="false">
|
||||
<el-table v-loading="loading" :data="taskList" height="calc(100% - 422px)">
|
||||
<el-table v-loading="loading" :data="resultRecords" height="calc(100% - 422px)">
|
||||
<el-table-column label="序号" align="center" width="80">
|
||||
<template #default="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
|
@ -106,8 +99,8 @@
|
|||
</el-table>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button class="my-cancel-btn" @click="open = false">取 消</el-button>
|
||||
<el-button class="my-confirm-btn" type="primary">存为历史报价</el-button>
|
||||
<el-button class="my-cancel-btn" @click="handleCloseModal">取 消</el-button>
|
||||
<el-button class="my-confirm-btn" type="primary" @click="handleSaveHistoryPrice">存为历史报价</el-button>
|
||||
<el-button class="my-confirm-btn" type="primary">导出Excel</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -118,8 +111,8 @@
|
|||
<script setup>
|
||||
import { onMounted, nextTick, defineEmits, ref } from 'vue'
|
||||
import { Close } from '@element-plus/icons-vue'
|
||||
import { mediaPageList, addBusGeoConvert, deleteBusGeoConvertTask, startBusGeoConvert, exportBusGeoConvert } from "@/api/geoConvert"
|
||||
import { uploadFile } from "@/api/common"
|
||||
import { calibraTionPage, calibraTionImport, calibraTionResult, deleteCalibraTionTask, saveHistoryPrice } from "@/api/calibration"
|
||||
|
||||
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
@ -135,13 +128,17 @@ const colors = [
|
|||
{ color: '#FFC63D', percentage: 99 },
|
||||
{ color: '#ADE8BD', percentage: 100 },
|
||||
]
|
||||
// 任务id
|
||||
const taskId = ref(null)
|
||||
// 任务列表
|
||||
const taskList = ref([])
|
||||
// 比对结果
|
||||
const resultRecords = ref([])
|
||||
const total = ref(0)
|
||||
const loading = ref(false)
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageIndex: 1,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
})
|
||||
|
@ -151,7 +148,12 @@ const open = ref(false)
|
|||
|
||||
// 查询任务记录
|
||||
const getTaskRecordPageList = () => {
|
||||
|
||||
loading.value = true
|
||||
calibraTionPage(queryParams.value).then(res => {
|
||||
taskList.value = res.data.rows
|
||||
total.value = res.data.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 自定义上传经纬度文件
|
||||
|
@ -159,23 +161,15 @@ const requestDocUpload = (options) => {
|
|||
const { file } = options
|
||||
var formData = new FormData();
|
||||
formData.append('file', file);
|
||||
uploadFile(formData).then(res => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess("上传成功")
|
||||
docUploadList.value.push({
|
||||
name: res.originalFilename,
|
||||
url: baseUrl + res.fileName,
|
||||
suffix: res.suffix
|
||||
})
|
||||
// form.value.fileUrl = baseUrl + res.fileName
|
||||
// form.value.fileName = res.fileName
|
||||
// form.value.newFileName = res.newFileName
|
||||
// form.value.originalFileName = res.originalFilename
|
||||
// form.value.size = res.size
|
||||
// form.value.suffix = res.suffix
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg);
|
||||
}
|
||||
proxy.$modal.loading('正在上传文件,请耐心等待...')
|
||||
calibraTionImport(formData).then(res => {
|
||||
proxy.$modal.msgSuccess("上传成功")
|
||||
proxy.$modal.closeLoading()
|
||||
docUploadList.value = []
|
||||
getTaskRecordPageList()
|
||||
}).catch(res => {
|
||||
proxy.$modal.msgError(res.msg);
|
||||
proxy.$modal.closeLoading()
|
||||
})
|
||||
}
|
||||
//自定义上传文件资料校验
|
||||
|
@ -197,9 +191,34 @@ const removeDocUpload = (file, fileList) => {
|
|||
);
|
||||
}
|
||||
|
||||
// 结果操作
|
||||
// 查看结果
|
||||
const handleResultOption = (row) => {
|
||||
open.value = true
|
||||
calibraTionResult({ taskId: row.id }).then(res => {
|
||||
taskId.value = row.id
|
||||
resultRecords.value = res.data
|
||||
open.value = true
|
||||
})
|
||||
}
|
||||
// 关闭结果
|
||||
const handleCloseModal = () => {
|
||||
taskId.value = null
|
||||
open.value = false
|
||||
}
|
||||
// 存为历史报价
|
||||
const handleSaveHistoryPrice = () => {
|
||||
saveHistoryPrice({ taskId: taskId.value }).then(res => {
|
||||
proxy.$modal.msgSuccess("保存成功")
|
||||
handleCloseModal()
|
||||
})
|
||||
}
|
||||
// 删除任务
|
||||
const handleDeleteTask = (row) => {
|
||||
proxy.$modal.confirm('是否确认该任务?').then(function () {
|
||||
return deleteCalibraTionTask({ id: row.id })
|
||||
}).then(() => {
|
||||
getTaskRecordPageList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => { })
|
||||
}
|
||||
// 关闭
|
||||
const handleClose = () => {
|
||||
|
@ -208,7 +227,8 @@ const handleClose = () => {
|
|||
|
||||
// 初始化
|
||||
const initTool = () => {
|
||||
formTitle.value = '校准平台'
|
||||
formTitle.value = '校准平台'
|
||||
getTaskRecordPageList()
|
||||
}
|
||||
// 暴露方法\属性给父组件
|
||||
defineExpose({
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<el-form-item label="生成失败报告数量">
|
||||
{{ detailForm.task_statistics.failed_tasks }}
|
||||
</el-form-item>
|
||||
<div class="splineBar" />
|
||||
<div class="splineBar" />
|
||||
<el-form-item label="Adobe图片数量">
|
||||
{{ detailForm.analysis_statistics.adobe_images }}
|
||||
</el-form-item>
|
||||
|
@ -159,6 +159,23 @@ const beforeDocUpload = (file) => {
|
|||
proxy.$modal.msgError("文件格式错误,请上传.pptx后缀的文件。");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 定义大小限制:500MB = 500 * 1024 * 1024 字节
|
||||
const MAX_SIZE = 500 * 1024 * 1024
|
||||
|
||||
if (file.size > MAX_SIZE) {
|
||||
// 文件大小超出限制
|
||||
proxy.$modal.msgError(`文件大小不能超过 500MB!当前文件为 ${formatFileSize(file.size)}`);
|
||||
// 返回 false 会阻止上传
|
||||
return false
|
||||
}
|
||||
}
|
||||
const formatFileSize = (bytes) => {
|
||||
if (bytes === 0) return '0 B'
|
||||
const k = 1024
|
||||
const sizes = ['B', 'KB', 'MB', 'GB']
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k))
|
||||
return (bytes / Math.pow(k, i)).toFixed(2) + ' ' + sizes[i]
|
||||
}
|
||||
// 移除已上传文件列表
|
||||
const removeDocUpload = (file, fileList) => {
|
||||
|
@ -208,7 +225,7 @@ const getCurrentTime = () => {
|
|||
}
|
||||
// 获取使用统计
|
||||
const getStatistics = () => {
|
||||
pptAnalysisStatistics().then(res => {
|
||||
pptAnalysisStatistics().then(res => {
|
||||
detailForm.value = res
|
||||
})
|
||||
|
||||
|
@ -216,7 +233,7 @@ const getStatistics = () => {
|
|||
// 获取分析任务列表
|
||||
const getTaskRecordPageList = () => {
|
||||
loading.value = true
|
||||
pptAnalysisTaskPageList(queryParams.value).then(res => {
|
||||
pptAnalysisTaskPageList(queryParams.value).then(res => {
|
||||
taskList.value = res.tasks
|
||||
total.value = res.pagination.total
|
||||
loading.value = false
|
||||
|
|
|
@ -347,6 +347,11 @@ const businessLicenseRef = ref(null)
|
|||
const otherFileRef = ref(null)
|
||||
const mediaRightsRef = ref(null)
|
||||
|
||||
|
||||
const businessLicenseList = ref([])
|
||||
const otherFileList = ref([])
|
||||
const mediaRightsList = ref([])
|
||||
|
||||
const data = reactive({
|
||||
ruleForm: {},
|
||||
rules: {
|
||||
|
@ -398,7 +403,10 @@ const getProvinceList = () => {
|
|||
// 获取地级市/区数据
|
||||
const getCityList = (value) => {
|
||||
var choseProvince = province.value.filter(item => item.id == value)[0]
|
||||
if (choseProvince) ruleForm.value.supplierCity = choseProvince.name
|
||||
if (choseProvince) {
|
||||
ruleForm.value.supplierCity = choseProvince.name
|
||||
ruleForm.value.provinceName = choseProvince.name
|
||||
}
|
||||
else ruleForm.value.supplierCity = undefined
|
||||
sysRegionListByPid({ parentId: value }).then(res => {
|
||||
ruleForm.value.cityId = undefined
|
||||
|
@ -417,7 +425,10 @@ const getCityList2 = (value) => {
|
|||
// 获取区/县数据
|
||||
const getCountyList = (value) => {
|
||||
var choseCity = city.value.filter(item => item.id == value)[0]
|
||||
if (choseCity) ruleForm.value.supplierCity = ruleForm.value.provinceName + '/' + choseCity.name
|
||||
if (choseCity) {
|
||||
ruleForm.value.supplierCity = ruleForm.value.provinceName + '/' + choseCity.name
|
||||
ruleForm.value.cityName = choseCity.name
|
||||
} else ruleForm.value.supplierCity = ruleForm.value.provinceName
|
||||
sysRegionListByPid({ parentId: value }).then(res => {
|
||||
ruleForm.value.countyId = undefined
|
||||
county.value = res.data
|
||||
|
@ -427,7 +438,11 @@ const getCountyList = (value) => {
|
|||
// 设置末级供应商城市
|
||||
const setCounty = (value) => {
|
||||
var choseCounty = county.value.filter(item => item.id == value)[0]
|
||||
if (choseCounty) ruleForm.value.supplierCity =ruleForm.value.provinceName+ '/' + ruleForm.value.cityName + '/' + choseCounty.name
|
||||
if (choseCounty) {
|
||||
ruleForm.value.supplierCity = ruleForm.value.provinceName + '/' + ruleForm.value.cityName + '/' + choseCounty.name
|
||||
ruleForm.value.countyName = choseCounty.name
|
||||
}
|
||||
else ruleForm.value.supplierCity = ruleForm.value.provinceName + '/' + ruleForm.value.cityName
|
||||
}
|
||||
|
||||
// 详情信息联动 设置区/县数据
|
||||
|
@ -459,20 +474,18 @@ const getDepList = () => {
|
|||
}
|
||||
|
||||
// 设置营业执照
|
||||
const businessLicenseList = ref([])
|
||||
const handleSetBusinessLicense = (_files) => {
|
||||
const handleSetBusinessLicense = (_fileType, _files) => {
|
||||
businessLicenseList.value = _files
|
||||
console.log('文件', businessLicenseList.value)
|
||||
}
|
||||
|
||||
// 设置其他附件
|
||||
const otherFileList = ref([])
|
||||
const handleSetOtherFile = (_files) => {
|
||||
const handleSetOtherFile = (_fileType, _files) => {
|
||||
otherFileList.value = _files
|
||||
}
|
||||
|
||||
// 设置媒体权属附件
|
||||
const mediaRightsList = ref([])
|
||||
const handleSetMediaRights = (_files) => {
|
||||
const handleSetMediaRights = (_fileType, _files) => {
|
||||
mediaRightsList.value = _files
|
||||
}
|
||||
|
||||
|
|
|
@ -97,11 +97,11 @@
|
|||
<el-form-item label="字典类型">
|
||||
<el-input v-model="form.dictType" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据标签" prop="dictLabel">
|
||||
<el-input v-model="form.dictLabel" placeholder="请输入数据标签" />
|
||||
<el-form-item label="字典标签" prop="dictLabel">
|
||||
<el-input v-model="form.dictLabel" placeholder="请输入字典标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据键值" prop="dictValue">
|
||||
<el-input v-model="form.dictValue" placeholder="请输入数据键值" />
|
||||
<el-form-item label="字典键值" prop="dictValue">
|
||||
<el-input v-model="form.dictValue" placeholder="请输入字典键值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="样式属性" prop="cssClass">
|
||||
<el-input v-model="form.cssClass" placeholder="请输入样式属性" />
|
||||
|
@ -180,8 +180,8 @@ const data = reactive({
|
|||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
dictLabel: [{ required: true, message: "数据标签不能为空", trigger: "blur" }],
|
||||
dictValue: [{ required: true, message: "数据键值不能为空", trigger: "blur" }],
|
||||
dictLabel: [{ required: true, message: "字典标签不能为空", trigger: "blur" }],
|
||||
dictValue: [{ required: true, message: "字典键值不能为空", trigger: "blur" }],
|
||||
dictSort: [{ required: true, message: "数据顺序不能为空", trigger: "blur" }]
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user