Merge branch 'ly'
commit
1e1ecca58c
|
|
@ -10,6 +10,7 @@ VITE_GLOB_API_URL=http://192.168.10.104:9020
|
|||
|
||||
|
||||
# File upload address, optional
|
||||
# VITE_GLOB_UPLOAD_URL=http://192.168.10.104:9011
|
||||
VITE_GLOB_UPLOAD_URL=http://60.213.14.14:6070
|
||||
|
||||
# Interface prefix
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ enum Api {
|
|||
PicListTask = '/api/DroneShpImageexif/ListTask',
|
||||
// 图片上传,创建任务
|
||||
PicAddTask = '/api/DroneShpImageexif/AddTask',
|
||||
// 图片上传
|
||||
AddImageexif = '/api/DroneShpImageexif/AddImageexif',
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -90,3 +92,10 @@ export function addPicTask(params) {
|
|||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export function addImageexif(params) {
|
||||
return defHttp.post({
|
||||
url: Api.AddImageexif,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,8 +48,9 @@
|
|||
columns,
|
||||
rowKey: 'id',
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
labelWidth: 80,
|
||||
schemas: searchFormSchema,
|
||||
showAdvancedButton: false,
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
|
|
|
|||
|
|
@ -100,18 +100,29 @@ export const searchFormSchema: FormSchema[] = [
|
|||
component: 'Input',
|
||||
label: '案件编号',
|
||||
colProps: { span: 4 },
|
||||
componentProps: {
|
||||
placeholder: '案件编号',
|
||||
},
|
||||
ifShow: false,
|
||||
},
|
||||
{
|
||||
field: 'is_intact',
|
||||
component: 'Select',
|
||||
label: '案件状态',
|
||||
colProps: { span: 4 },
|
||||
defaultValue: 1,
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '未判读', value: 0, key: '0' },
|
||||
{ label: '已提交', value: 1, key: '1' },
|
||||
{ label: '已关闭', value: 99, key: '99' },
|
||||
{ label: '全部', value: null, key: '' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'is_drawback',
|
||||
component: 'Select',
|
||||
label: '新增退回',
|
||||
colProps: { span: 4 },
|
||||
componentProps: {
|
||||
placeholder: '新增退回',
|
||||
options: [
|
||||
{ label: '新增', value: 0, key: '0' },
|
||||
{ label: '退回', value: 1, key: '1' },
|
||||
|
|
@ -168,7 +179,6 @@ export const searchFormSchema: FormSchema[] = [
|
|||
colProps: { span: 4 },
|
||||
label: '现场状况',
|
||||
componentProps: {
|
||||
placeholder: '现场状况',
|
||||
options: [
|
||||
{ value: 0, label: '合法' },
|
||||
{ value: 1, label: '违法' },
|
||||
|
|
@ -181,36 +191,24 @@ export const searchFormSchema: FormSchema[] = [
|
|||
component: 'Input',
|
||||
label: '案件编号',
|
||||
colProps: { span: 4 },
|
||||
componentProps: {
|
||||
placeholder: '案件编号',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'key',
|
||||
component: 'Input',
|
||||
label: '关键字',
|
||||
colProps: { span: 4 },
|
||||
componentProps: {
|
||||
placeholder: '请输入关键字',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'identification_user',
|
||||
label: '判读人姓名',
|
||||
component: 'Input',
|
||||
colProps: { span: 4 },
|
||||
componentProps: {
|
||||
placeholder: '判读人姓名',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deal_username',
|
||||
component: 'Input',
|
||||
label: '处理人姓名',
|
||||
colProps: { span: 4 },
|
||||
componentProps: {
|
||||
placeholder: '处理人姓名',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: '[report_start_time, report_end_time]',
|
||||
|
|
@ -220,6 +218,6 @@ export const searchFormSchema: FormSchema[] = [
|
|||
format: 'YYYY-MM-DD',
|
||||
placeholder: ['开始日期', '结束日期'],
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<div :class="prefixCls" v-if="disabledType">
|
||||
<div :class="`${prefixCls}__top`">
|
||||
<a-form ref="formRef" :model="listQuery" labelAlign="left">
|
||||
<a-form-item label="案件状态" placeholder="状态">
|
||||
<a-form-item label="案件状态">
|
||||
<a-select
|
||||
v-model:value="listQuery.is_intact"
|
||||
placeholder="请选择"
|
||||
|
|
@ -28,17 +28,17 @@
|
|||
:dropdown-style="{ maxHeight: '400px', width: '600px', overflow: 'auto' }"
|
||||
:tree-data="data.OrgList"
|
||||
:field-names="{ label: 'name', value: 'id' }"
|
||||
placeholder="查询地区"
|
||||
placeholder="请选择"
|
||||
:allow-clear="true"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="关 键 字 ">
|
||||
<a-input v-model:value="listQuery.key" placeholder="请输入关键字" :allow-clear="true" />
|
||||
<a-input v-model:value="listQuery.key" placeholder="请输入" :allow-clear="true" />
|
||||
</a-form-item>
|
||||
<a-form-item label="姓名">
|
||||
<a-input
|
||||
v-model:value="listQuery.identification_user"
|
||||
placeholder="判读人姓名"
|
||||
placeholder="请输入"
|
||||
:allow-clear="true"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
|
|
|||
|
|
@ -165,10 +165,10 @@
|
|||
});
|
||||
}
|
||||
async function imgApi(file, progress) {
|
||||
const data: any = await uploadApi(file, progress);
|
||||
if (data.result.length > 0) {
|
||||
const obj: any = await uploadApi(file, progress);
|
||||
if (obj.data.result.length > 0) {
|
||||
fileList.value.push(file);
|
||||
filSuccessList.value.push(data.data.result[0]);
|
||||
filSuccessList.value.push(obj.data.result[0]);
|
||||
}
|
||||
}
|
||||
function handleRemove(file) {
|
||||
|
|
|
|||
|
|
@ -19,25 +19,38 @@
|
|||
</template>
|
||||
</BasicTable>
|
||||
<TaskModal @register="registerModal" @success="handleSuccess" />
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
@register="registerPicModal"
|
||||
title="上传图片"
|
||||
:showCancelBtn="false"
|
||||
:showOkBtn="false"
|
||||
:draggable="false"
|
||||
width="80%"
|
||||
wrapClassName="upload-pictures-modal"
|
||||
minHeight="600"
|
||||
>
|
||||
<Pictures :taskId="taskId" @closeModel="closePicModal" />
|
||||
</BasicModal>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive } from 'vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { getRoleListByPage, deleteRole } from '@/api/demo/system';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useModal } from '@/components/Modal';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import Pictures from './src/pictures.vue';
|
||||
import TaskModal from './src/taskModel.vue';
|
||||
import { PermissionBtn } from '@/components/PermissionBtn/index';
|
||||
|
||||
import { columns, searchFormSchema } from './data';
|
||||
|
||||
defineOptions({ name: 'RoleManagement' });
|
||||
|
||||
const taskId = ref('');
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
const [registerModal, { openModal: openRoleModal }] = useModal();
|
||||
const [registerModulesModal, { openModal: openModulesModal }] = useModal();
|
||||
const [registerAccountModal, { openModal: openAccountModal }] = useModal();
|
||||
const [registerPicModal, { openModal: openPicModal, closeModal: closePicModal }] = useModal();
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
|
||||
const [registerTable, { reload, getSelectRows, clearSelectedRowKeys }] = useTable({
|
||||
|
|
@ -126,21 +139,15 @@
|
|||
case 'btnAdd':
|
||||
handleCreate();
|
||||
break;
|
||||
case 'btnEdit':
|
||||
handleEdit();
|
||||
break;
|
||||
case 'btnDelete':
|
||||
handleDelete();
|
||||
break;
|
||||
case 'btnModules':
|
||||
case 'btnUpload':
|
||||
let rows = getSelectRows();
|
||||
if (rows.length == 0) {
|
||||
return createMessage.warn('请勾选一个角色进行编辑');
|
||||
return createMessage.warn('请勾选一个任务进行图片上传');
|
||||
}
|
||||
const record = rows[0];
|
||||
openModulesModal(true, {
|
||||
record,
|
||||
});
|
||||
console.log(record);
|
||||
taskId.value = record.id;
|
||||
openPicModal();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,143 @@
|
|||
<template>
|
||||
<div class="pic-box">
|
||||
<div class="pic-header">
|
||||
<span>{{ filSuccessList.length }}张图片正在上传,已上传{{ picturesNum }}张。</span>
|
||||
<a-progress :percent="percentage" status="active" />
|
||||
</div>
|
||||
<div class="pic-list">
|
||||
<ImageUpload
|
||||
file-list="fileList"
|
||||
:maxSize="20"
|
||||
:maxNumber="10"
|
||||
:api="imgApi"
|
||||
:multiple="true"
|
||||
@delete="handleRemove"
|
||||
/>
|
||||
</div>
|
||||
<div class="btn-box">
|
||||
<a-button type="primary" class="ml-2" color="info" @click="submit">确认</a-button>
|
||||
<a-button type="primary" class="ml-2" color="info" danger>重置</a-button>
|
||||
<a-button class="ml-2" color="info" @click="close">关闭</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { ImageUpload } from '@/components/Upload';
|
||||
import { uploadApi } from '@/api/sys/upload';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { addImageexif } from '@/api/monitor';
|
||||
|
||||
const emit = defineEmits(['closeModel']);
|
||||
const { createMessage } = useMessage();
|
||||
const picturesNum = ref(0);
|
||||
const percentage = ref(0);
|
||||
const props = defineProps({
|
||||
taskId: String,
|
||||
});
|
||||
const fileList: any = ref([]);
|
||||
const filSuccessList: any = ref([]);
|
||||
async function imgApi(file, progress) {
|
||||
const obj: any = await uploadApi(file, progress);
|
||||
console.log(obj);
|
||||
if (obj.data.result.length > 0) {
|
||||
fileList.value.push(file);
|
||||
filSuccessList.value.push(obj.data.result[0]);
|
||||
}
|
||||
console.log(fileList.value);
|
||||
console.log(filSuccessList.value);
|
||||
}
|
||||
function handleRemove(file) {
|
||||
console.log(file);
|
||||
var currentIndex = (fileList.value || []).findIndex((element) => element.uid === file.uid);
|
||||
fileList.value.splice(currentIndex, 1);
|
||||
filSuccessList.value.splice(currentIndex, 1);
|
||||
}
|
||||
function getArr(arr, num) {
|
||||
let newArr = [...arr]; // 因为splice会改变原数组,要深拷贝一下
|
||||
let list = [];
|
||||
for (let i = 0; i < newArr.length; ) {
|
||||
list.push(newArr.splice(i, num));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
async function submit() {
|
||||
console.log(filSuccessList.value);
|
||||
if (filSuccessList.value.length == 0) {
|
||||
return createMessage.warning('请选择上传文件');
|
||||
}
|
||||
var fileList = filSuccessList.value;
|
||||
// 把所有文件分为以五个为单位的二维数组
|
||||
fileList = getArr(filSuccessList.value, 5);
|
||||
for (let i = 0; i < fileList.length; i++) {
|
||||
var list: any = [];
|
||||
fileList[i].forEach((obj) => {
|
||||
list.push({
|
||||
lng: obj.lng,
|
||||
lat: obj.lat,
|
||||
path: obj.path,
|
||||
uploadTime: obj.dateTime,
|
||||
remark: obj.remark,
|
||||
taskId: props.taskId,
|
||||
});
|
||||
});
|
||||
console.log(list);
|
||||
const obj = await addImageexif(list);
|
||||
if (obj) {
|
||||
picturesNum.value = picturesNum.value + 5;
|
||||
percentage.value = accMul(
|
||||
accDiv(picturesNum.value, filSuccessList.value.length),
|
||||
100,
|
||||
).toFixed(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 除法
|
||||
function accDiv(arg1, arg2) {
|
||||
let t1 = 0,
|
||||
t2 = 0,
|
||||
r1,
|
||||
r2;
|
||||
try {
|
||||
t1 = arg1.toString().split('.')[1].length;
|
||||
} catch (e) {}
|
||||
try {
|
||||
t2 = arg2.toString().split('.')[1].length;
|
||||
} catch (e) {}
|
||||
r1 = Number(arg1.toString().replace('.', ''));
|
||||
r2 = Number(arg2.toString().replace('.', ''));
|
||||
return (r1 / r2) * Math.pow(10, t2 - t1);
|
||||
}
|
||||
//乘法:
|
||||
function accMul(arg1, arg2) {
|
||||
let m = 0,
|
||||
s1 = arg1.toString(),
|
||||
s2 = arg2.toString();
|
||||
try {
|
||||
m += s1.split('.')[1].length;
|
||||
} catch (e) {}
|
||||
try {
|
||||
m += s2.split('.')[1].length;
|
||||
} catch (e) {}
|
||||
return (Number(s1.replace('.', '')) * Number(s2.replace('.', ''))) / Math.pow(10, m);
|
||||
}
|
||||
function close() {
|
||||
emit('closeModel');
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.pic-box {
|
||||
.pic-header {
|
||||
}
|
||||
.pic-list {
|
||||
height: 55vh;
|
||||
overflow: auto;
|
||||
}
|
||||
.btn-box {
|
||||
padding: 10px 0 0 0;
|
||||
display: flex;
|
||||
align-items: ce nter;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,53 +1,47 @@
|
|||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="添加任务" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '@/components/Modal';
|
||||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { formSchema } from '../data';
|
||||
import { addPicTask } from '@/api/monitor/index';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
const { createMessage } = useMessage();
|
||||
|
||||
defineOptions({ name: 'DeptModal' });
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const isUpdate = ref(true);
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
labelWidth: 100,
|
||||
baseColProps: { span: 24 },
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
resetFields();
|
||||
setModalProps({ confirmLoading: false });
|
||||
});
|
||||
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
let query = values;
|
||||
const data = await addPicTask(query);
|
||||
if (data) {
|
||||
setModalProps({ confirmLoading: true });
|
||||
// TODO custom api
|
||||
closeModal();
|
||||
emit('success');
|
||||
return createMessage.success('新增成功');
|
||||
} else {
|
||||
return createMessage.error('新增失败');
|
||||
}
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="添加任务" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '@/components/Modal';
|
||||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { formSchema } from '../data';
|
||||
import { addPicTask } from '@/api/monitor/index';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
defineOptions({ name: 'DeptModal' });
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
labelWidth: 100,
|
||||
baseColProps: { span: 24 },
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
resetFields();
|
||||
setModalProps({ confirmLoading: false });
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
let query = values;
|
||||
const data = await addPicTask(query);
|
||||
if (data) {
|
||||
setModalProps({ confirmLoading: true });
|
||||
// TODO custom api
|
||||
closeModal();
|
||||
emit('success');
|
||||
return createMessage.success('新增成功');
|
||||
} else {
|
||||
return createMessage.error('新增失败');
|
||||
}
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
</script>
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue