图像评估的功能

This commit is contained in:
lSun 2025-10-09 17:57:03 +08:00
parent 4d09b1e008
commit 360e0e690a
4 changed files with 115 additions and 43 deletions

View File

@ -8,3 +8,20 @@ export function getAllImagelist(query) {
params: query params: query
}) })
} }
export function deleteFile(data) {
return request({
url: '/image/caption/deleteFile',
method: 'POST',
params:data,
})
}
export function exportImages(data) {
return request({
url: '/image/caption/getPackageDownload',
method: 'POST',
data: data,
responseType: 'blob'
})
}

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" > <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" >
<el-form-item prop="date"> <el-form-item prop="operaTime">
<el-date-picker <el-date-picker
v-model="queryParams.date" v-model="queryParams.operaTime"
type="date" type="date"
placeholder="标注日期" placeholder="标注日期"
> >
@ -11,18 +11,18 @@
</el-form-item> </el-form-item>
<el-form-item label="" prop="roleName"> <el-form-item label="" prop="operaName">
<el-input <el-input
v-model="queryParams.roleName" v-model="queryParams.operaName"
placeholder="标注项" placeholder="标注项"
clearable clearable
style="width: 240px" style="width: 240px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="" prop="roleKey"> <el-form-item label="" prop="userName">
<el-input <el-input
v-model="queryParams.roleKey" v-model="queryParams.userName"
placeholder="审核人" placeholder="审核人"
clearable clearable
style="width: 240px" style="width: 240px"
@ -59,7 +59,7 @@
<div class="card-footer"> <div class="card-footer">
<div class="person-info"> <div class="person-info">
<span class="name">{{ item.userName }}</span> <span class="name">{{ item.userName }}</span>
<span class="date">{{ item.date }}</span> <span class="date">{{ item.operaTime }}</span>
</div> </div>
<div class="tags"> <div class="tags">
<el-tooltip :content="item.contentImage" placement="top" :effect="'light'" :enterable="false"> <el-tooltip :content="item.contentImage" placement="top" :effect="'light'" :enterable="false">
@ -96,7 +96,7 @@
</template> </template>
<script> <script>
import {getAllImagelist} from "@/api/imageCaptioning/imageLibrary"; import {getAllImagelist, deleteFile, exportImages} from "@/api/imageCaptioning/imageLibrary";
export default { export default {
name: "imageCaptioningLibrary", name: "imageCaptioningLibrary",
@ -108,9 +108,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 8, pageSize: 8,
roleName: undefined, operaTime: '',
roleKey: undefined,
status: undefined,
operaType: 1 operaType: 1
}, },
// //
@ -144,19 +142,42 @@ export default {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
//
if (this.queryParams.operaTime) {
const date = new Date(this.queryParams.operaTime)
// 使getFullYeargetMonthgetDate
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
this.queryParams.operaTime = `${year}-${month}-${day}`
}
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm") this.resetForm("queryForm")
this.queryParams.operaTime = null
this.handleQuery() this.handleQuery()
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('system/role/export', { const imageIds = this.showProMaterialsDuctList.map(item => item.imageId);
...this.queryParams exportImages({
}, `role_${new Date().getTime()}.xlsx`) imageId: imageIds
}).then(response => {
//
const blob = new Blob([response]);
const link = document.createElement('a');
const fileName = `图片压缩包_${new Date().getTime()}.zip`;
link.href = URL.createObjectURL(blob);
link.download = fileName;
link.click();
URL.revokeObjectURL(link.href);
}).catch(error => {
console.error('下载失败:', error);
this.$message.error('下载失败');
});
}, },
// //
@ -166,11 +187,18 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// //
console.log('删除:', item) console.log('删除:', item)
// deleteFile({"imageId":item.imageId}).then(response => {
this.showProMaterialsDuctList = this.showProMaterialsDuctList.filter(i => i.id !== item.id) console.log('删除结果:', response)
this.$message.success('删除成功') if (response.code === 200) {
this.$message.success('删除成功')
this.getList()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => { }).catch(() => {
this.$message.info('已取消删除') this.$message.info('已取消删除')
}) })

View File

@ -3,7 +3,7 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" > <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" >
<el-form-item prop="date"> <el-form-item prop="date">
<el-date-picker <el-date-picker
v-model="queryParams.date" v-model="queryParams.operaTime"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
> >
@ -27,10 +27,10 @@
<div class="card-image"> <div class="card-image">
<ImagePreview <ImagePreview
style="margin-top: 10px" style="margin-top: 10px"
:height="188" :height="180"
:borderRadius="10" :borderRadius="10"
:width="itemWidth" :width="itemWidth"
:src1="item.image" :src1="item.bjUrl"
/> />
</div> </div>
@ -38,19 +38,19 @@
<div class="card-content"> <div class="card-content">
<div class="card-footer"> <div class="card-footer">
<div class="person-info"> <div class="person-info">
<span class="name">综合得分:{{ item.name }}</span> <span class="name">综合得分:{{ item.overallScore }}</span>
<span class="date">{{ item.date }}</span> <span class="date">{{ item.operaName }}</span>
</div> </div>
<div class="tags"> <div class="tags">
<div class="tag-row"> <div class="tag-row">
<span class="tag-item" style="padding-left: 16px;">清晰度: 20</span> <span class="tag-item" style="padding-left: 16px;">清晰度: {{ item.clarity }}</span>
<span class="tag-item" style="padding-left: 16px;">干净度: 10</span> <span class="tag-item" style="padding-left: 16px;">干净度: {{ item.cleanliness }}</span>
<span class="tag-item">压缩痕迹: 10</span> <span class="tag-item">压缩痕迹: {{ item.compressMarks }}</span>
</div> </div>
<div class="tag-row"> <div class="tag-row">
<span class="tag-item">明暗均衡: 10</span> <span class="tag-item">明暗均衡: {{ item.balance }}</span>
<span class="tag-item">整体观感: 15</span> <span class="tag-item">整体观感: {{ item.impression }}</span>
<span class="tag-item">细节体验: 15</span> <span class="tag-item">细节体验: {{ item.detail }}</span>
</div> </div>
</div> </div>
<div style="border-top: 1px solid #CFD4D7;margin-top: 10px"></div> <div style="border-top: 1px solid #CFD4D7;margin-top: 10px"></div>
@ -83,7 +83,7 @@
</template> </template>
<script> <script>
import {getAllImagelist} from "@/api/imageCaptioning/imageLibrary"; import {deleteFile, exportImages, getAllImagelist} from "@/api/imageCaptioning/imageLibrary";
export default { export default {
name: "imageCaptioningLibrary", name: "imageCaptioningLibrary",
@ -94,10 +94,8 @@ export default {
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 8,
roleName: undefined, date: '',
roleKey: undefined,
status: undefined,
operaType: 2 operaType: 2
}, },
// //
@ -132,19 +130,43 @@ export default {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
//
if (this.queryParams.operaTime) {
const date = new Date(this.queryParams.operaTime)
// 使getFullYeargetMonthgetDate
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
this.queryParams.operaTime = `${year}-${month}-${day}`
}
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm") this.resetForm("queryForm")
// null
this.queryParams.operaTime = null
this.handleQuery() this.handleQuery()
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('system/role/export', { const imageIds = this.showProMaterialsDuctList.map(item => item.imageId);
...this.queryParams exportImages({
}, `role_${new Date().getTime()}.xlsx`) imageId: imageIds
}).then(response => {
//
const blob = new Blob([response]);
const link = document.createElement('a');
const fileName = `图片压缩包_${new Date().getTime()}.zip`;
link.href = URL.createObjectURL(blob);
link.download = fileName;
link.click();
URL.revokeObjectURL(link.href);
}).catch(error => {
console.error('下载失败:', error);
this.$message.error('下载失败');
});
}, },
// //
@ -154,11 +176,15 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// //
console.log('删除:', item) deleteFile({"imageId":item.imageId}).then(response => {
// if (response.code === 200) {
this.showProMaterialsDuctList = this.showProMaterialsDuctList.filter(i => i.id !== item.id) this.$message.success('删除成功')
this.$message.success('删除成功') this.getList()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => { }).catch(() => {
this.$message.info('已取消删除') this.$message.info('已取消删除')
}) })
@ -204,6 +230,7 @@ export default {
border-radius: 10px; border-radius: 10px;
align-content: flex-start; align-content: flex-start;
justify-items: center; justify-items: center;
height: 47%;
} }
.card-image { .card-image {

View File

@ -80,7 +80,7 @@ export default {
imageResults: [], imageResults: [],
selectedImages: {}, // selectedImages: {}, //
isSidebarVisible: true, // / isSidebarVisible: true, // /
addId: null, addId: '',
} }
}, },