违法用地-持续监管-审核按钮独立出来→继续持续监管按钮,图片插入批量化

main
滕嵩 2025-06-04 15:49:15 +08:00
parent 22ca2171e9
commit 665c6ed554
3 changed files with 133 additions and 130 deletions

View File

@ -95,9 +95,10 @@
}}</a-descriptions-item>
</a-descriptions>
<div
style="display: flex; justify-content: right; margin-top: 10px"
v-if="isKeepSupervision"
style="display: flex; justify-content: right; margin-top: 10px; gap: 10px"
>
<a-button type="primary" @click="funCheckCxjgPic"> </a-button>
<a-button type="primary" @click="moveInIllegalSubejctOpen = true">
转入违法用地
</a-button>
@ -509,7 +510,7 @@
import { defineProps, ref, computed, onBeforeMount, watch } from 'vue';
import MapboxMap from '@/components/MapboxMaps/MapComponent.vue';
import { getConfig, getGeom } from '@/api/sys/layerManagement';
import { MoveInIllegalSubject } from '@/api/demo/system';
import { MoveInIllegalSubject, CheckCxjgPic } from '@/api/demo/system';
import { getLoadCaseImgList } from '@/api/tiankongdi';
import { useMessage } from '@/hooks/web/useMessage';
import axios from 'axios';
@ -809,6 +810,18 @@
}
});
};
//
const funCheckCxjgPic = async () => {
let querys = {
id: props.showInfoData.case_no,
};
await CheckCxjgPic(querys).then((res) => {
if (res) {
createMessage.success('图片审核成功,持续监管中!');
}
});
};
</script>
<style lang="scss" scoped>

View File

@ -30,7 +30,7 @@ export const columns: BasicColumn[] = [
{
title: '图斑编号',
dataIndex: 'caseno',
width: 200,
width: 250,
},
{
title: '图斑类型',
@ -120,16 +120,15 @@ export const searchFormSchema: FormSchema[] = [
};
},
},
{
field: 'picihao',
label: '批次',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [],
},
},
// {
// field: 'picihao',
// label: '批次',
// component: 'Select',
// colProps: { span: 4 },
// componentProps: {
// options: [],
// },
// },
{
field: 'typename',
label: '图斑类型',
@ -187,37 +186,37 @@ export const searchFormSchema: FormSchema[] = [
};
},
},
{
field: 'nowStatus',
label: '当前状态',
component: 'Select',
componentProps: {
options: nowStatusOptions,
},
colProps: { span: 4 },
slot: 'dangqianzhuangtai',
},
{
field: 'isIllegal',
label: '判定结果',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: mapTypeOptions,
},
},
{
field: 'weifaleixing',
label: '违法类型',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{ label: '非农化违法用地', value: '0' },
{ label: '非粮化违法用地', value: '1' },
],
},
},
// {
// field: 'nowStatus',
// label: '当前状态',
// component: 'Select',
// componentProps: {
// options: nowStatusOptions,
// },
// colProps: { span: 4 },
// slot: 'dangqianzhuangtai',
// },
// {
// field: 'isIllegal',
// label: '判定结果',
// component: 'Select',
// colProps: { span: 4 },
// componentProps: {
// options: mapTypeOptions,
// },
// },
// {
// field: 'weifaleixing',
// label: '违法类型',
// component: 'Select',
// colProps: { span: 4 },
// componentProps: {
// options: [
// { label: '非农化违法用地', value: '0' },
// { label: '非粮化违法用地', value: '1' },
// ],
// },
// },
{
field: 'measureName',
label: '整改措施',
@ -256,6 +255,19 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
colProps: { span: 4 },
},
{
field: 'picCheck',
label: '审核状态',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{ label: '未上传', value: '0' },
{ label: '待审核', value: '1' },
{ label: '已审核', value: '2' },
],
},
},
{
field: '[startTime, endTime]',
label: '下发时间',

View File

@ -5,6 +5,7 @@
v-model:file-list="fileList"
list-type="picture-card"
multiple
:accept="'.jpg,.jpeg,.png'"
:showUploadList="false"
:custom-request="customRequest"
>
@ -79,17 +80,6 @@
</template>
</a-table>
<div class="updateDiv">
<a-tooltip
v-if="
fileList && fileList.length > 0 && fileList.find((item) => item.status == 'updateError')
"
>
<template #title>在报有未审核的图片不允许上传的错误时可以点击</template>
<a-button type="primary" @click="funCheckCxjgPic" style="margin-right: 10px">
审核图片
</a-button>
</a-tooltip>
<!-- {{ .length }} -->
<a-button type="primary" @click="startUploadCXJGData">
将上传成功的图片插入到数据库
</a-button>
@ -102,7 +92,7 @@
import { PlusOutlined, CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons-vue';
import { getAppEnvConfig } from '@/utils/env';
import axios from 'axios';
import { UpdateCxjgData, CheckCxjgPic } from '@/api/demo/system';
import { UpdateCxjgData } from '@/api/demo/system';
import { uploadColumns } from './keepSupervision.data';
import { message } from 'ant-design-vue';
@ -156,80 +146,15 @@
};
// -
let uoloadArray: any = [];
async function startUploadCXJGData() {
const list = fileList.value;
uoloadArray = [];
if (!list || list.length === 0) return;
for (let i = 0; i < list.length; i++) {
const item = list[i];
list.forEach((item) => {
if (item.status === 'done' || item.status === 'updateError') {
// true
await UpdateUploadCXJGData(item);
}
}
}
// -
async function UpdateUploadCXJGData(value) {
let caseid = value.name.split('.').slice(0, -1).join('.');
let flag = false;
if (caseid.includes('_CX')) {
flag = true;
}
if (caseid.includes('_')) {
caseid = caseid.split('_').slice(0, 1).join('_');
}
if (flag) {
caseid = caseid + '_CX';
}
const index = fileList.value.findIndex((item) => item.uid === value.uid);
if (index === -1) return false; //
let querys = {
caseid: caseid,
path: value.url,
};
try {
const res1 = await UpdateCxjgData(querys);
if (res1) {
//
const res2 = await CheckCxjgPic({ id: caseid });
if (res2) {
//
fileList.value[index] = {
...fileList.value[index],
status: 'updateSuccess',
};
} else {
//
fileList.value[index] = {
...fileList.value[index],
status: 'updateError',
};
}
} else {
//
fileList.value[index] = {
...fileList.value[index],
status: 'updateError',
};
message.error('有未审核的图片,不允许上传');
}
} catch (error) {
console.error('上传或审核出错:', error);
fileList.value[index] = {
...fileList.value[index],
status: 'updateError',
};
}
}
// -
async function funCheckCxjgPic() {
const list = fileList.value;
if (!list || list.length === 0) return;
for (let i = 0; i < list.length; i++) {
const item = list[i];
if (item.status === 'updateError') {
// true
//
let caseid = item.name.split('.').slice(0, -1).join('.');
let flag = false;
if (caseid.includes('_CX')) {
@ -241,13 +166,66 @@
if (flag) {
caseid = caseid + '_CX';
}
await CheckCxjgPic({ id: caseid });
const index = fileList.value.findIndex((item) => item.uid === item.uid);
const index = fileList.value.findIndex((l) => l.uid === item.uid);
const path = item.url;
//
const uoloadArrayIndex = uoloadArray.findIndex((l) => l.caseid === caseid);
if (uoloadArrayIndex != -1) {
uoloadArray[uoloadArrayIndex].index += ',' + index;
uoloadArray[uoloadArrayIndex].path += ',' + path;
} else {
uoloadArray.push({
caseid: caseid,
index: index.toString(),
path: path,
});
}
}
});
// -
if (!uoloadArray || uoloadArray.length === 0) return;
for (let i = 0; i < uoloadArray.length; i++) {
await UpdateUploadCXJGData(uoloadArray[i]);
}
}
// -
async function UpdateUploadCXJGData(value) {
let querys = {
caseid: value.caseid,
path: value.path,
};
try {
await UpdateCxjgData(querys).then((res) => {
if (res) {
const indexs = value.index.split(',');
indexs?.forEach((index) => {
fileList.value[index] = {
...fileList.value[index],
status: 'updateSuccess',
};
});
} else {
const indexs = value.index.split(',');
indexs?.forEach((index) => {
fileList.value[index] = {
...fileList.value[index],
status: 'updateError',
};
});
message.error(`当前图斑【${value.caseid}】有未审核的图片,不允许继续上传,请先审核!`);
}
});
} catch (error) {
const indexs = value.index.split(',');
indexs?.forEach((index) => {
fileList.value[index] = {
...fileList.value[index],
status: 'updateSuccess',
status: 'updateError',
};
}
});
console.error('上传或审核出错:', error);
}
}
</script>