优化
This commit is contained in:
63
src/api/drone/droneConfig/index.ts
Normal file
63
src/api/drone/droneConfig/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DroneConfigVO, DroneConfigForm, DroneConfigQuery } from '@/api/drone/droneConfig/types';
|
||||
|
||||
/**
|
||||
* 查询无人机配置列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDroneConfig = (query?: DroneConfigQuery): AxiosPromise<DroneConfigVO[]> => {
|
||||
return request({
|
||||
url: '/drone/droneConfig/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询无人机配置详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDroneConfig = (id: string | number): AxiosPromise<DroneConfigVO> => {
|
||||
return request({
|
||||
url: '/drone/droneConfig/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增无人机配置
|
||||
* @param data
|
||||
*/
|
||||
export const addDroneConfig = (data: DroneConfigForm) => {
|
||||
return request({
|
||||
url: '/drone/droneConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改无人机配置
|
||||
* @param data
|
||||
*/
|
||||
export const updateDroneConfig = (data: DroneConfigForm) => {
|
||||
return request({
|
||||
url: '/drone/droneConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除无人机配置
|
||||
* @param id
|
||||
*/
|
||||
export const delDroneConfig = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/drone/droneConfig/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
80
src/api/drone/droneConfig/types.ts
Normal file
80
src/api/drone/droneConfig/types.ts
Normal file
@ -0,0 +1,80 @@
|
||||
export interface DroneConfigVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 配置名称
|
||||
*/
|
||||
configName: string;
|
||||
|
||||
/**
|
||||
* 配置地址
|
||||
*/
|
||||
configUrl: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
}
|
||||
|
||||
export interface DroneConfigForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 配置名称
|
||||
*/
|
||||
configName?: string;
|
||||
|
||||
/**
|
||||
* 配置地址
|
||||
*/
|
||||
configUrl?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
dockSocketUrl?: string;
|
||||
aiUrl?: string;
|
||||
srsUrl?: string;
|
||||
rtmpPort?: string;
|
||||
rtcPort?: string;
|
||||
}
|
||||
|
||||
export interface DroneConfigQuery extends PageQuery {
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 配置名称
|
||||
*/
|
||||
configName?: string;
|
||||
|
||||
/**
|
||||
* 配置地址
|
||||
*/
|
||||
configUrl?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
12
src/main.ts
12
src/main.ts
@ -49,12 +49,12 @@ VXETable.config({
|
||||
|
||||
//本地保存飞机配置
|
||||
import { setLocal } from './utils';
|
||||
setLocal('dockAir', 'http://192.168.110.24:9136');
|
||||
setLocal('aiUrl', 'http://192.168.110.23:8000');
|
||||
setLocal('host', '192.168.110.199');
|
||||
setLocal('rtmpPort', '1935');
|
||||
setLocal('rtcPort', '1985');
|
||||
setLocal('dockSocketUrl', 'ws://192.168.110.8:9136/websocket');
|
||||
setLocal('dockAir', 'http://58.17.134.85:9512');
|
||||
setLocal('aiUrl', 'http://58.17.134.85:9512');
|
||||
setLocal('host', '121.37.237.116');
|
||||
setLocal('rtmpPort', '28451');
|
||||
setLocal('rtcPort', '28453');
|
||||
setLocal('dockSocketUrl', 'ws://58.17.134.85:9512/websocket');
|
||||
|
||||
// 修改 el-dialog 默认点击遮照为不关闭
|
||||
/*import { ElDialog } from 'element-plus';
|
||||
|
@ -7,39 +7,23 @@ import { Style, Stroke, Fill } from 'ol/style';
|
||||
import GeoJSON from 'ol/format/GeoJSON';
|
||||
import { polygon as turfPolygon, booleanIntersects } from '@turf/turf';
|
||||
import { toLonLat } from 'ol/proj';
|
||||
import DragPan from 'ol/interaction/DragPan';
|
||||
import MouseWheelZoom from 'ol/interaction/MouseWheelZoom';
|
||||
|
||||
export class LassoSelector {
|
||||
private map: OLMap;
|
||||
private drawLayer: VectorLayer<VectorSource>;
|
||||
private drawSource: VectorSource;
|
||||
private overlaySource: VectorSource;
|
||||
private overlaySource: VectorSource; // 新增用于闭合多边形
|
||||
private overlayLayer: VectorLayer<VectorSource>;
|
||||
private drawing = false;
|
||||
private coordinates: [number, number][] = [];
|
||||
private targetSource: VectorSource;
|
||||
private isShiftKeyDown = false;
|
||||
private onSelectCallback: (selected: Feature[], isInvert?: boolean) => void;
|
||||
private dragPanInteraction: DragPan | null = null;
|
||||
private mouseWheelZoomInteraction: MouseWheelZoom | null = null;
|
||||
private onSelectCallback: (selected: Feature[]) => void;
|
||||
|
||||
constructor(map: OLMap, targetSource: VectorSource, onSelect: (selected: Feature[], isInvert?: boolean) => void) {
|
||||
constructor(map: OLMap, targetSource: VectorSource, onSelect: (selected: Feature[]) => void) {
|
||||
this.map = map;
|
||||
this.targetSource = targetSource;
|
||||
this.onSelectCallback = onSelect;
|
||||
|
||||
// 找出拖动和滚轮缩放交互
|
||||
this.dragPanInteraction = this.map
|
||||
.getInteractions()
|
||||
.getArray()
|
||||
.find((interaction) => interaction instanceof DragPan) as DragPan;
|
||||
|
||||
this.mouseWheelZoomInteraction = this.map
|
||||
.getInteractions()
|
||||
.getArray()
|
||||
.find((interaction) => interaction instanceof MouseWheelZoom) as MouseWheelZoom;
|
||||
|
||||
this.drawSource = new VectorSource();
|
||||
this.drawLayer = new VectorLayer({
|
||||
source: this.drawSource,
|
||||
@ -52,6 +36,7 @@ export class LassoSelector {
|
||||
});
|
||||
this.map.addLayer(this.drawLayer);
|
||||
|
||||
// 新增:闭合多边形图层(半透明填充)
|
||||
this.overlaySource = new VectorSource();
|
||||
this.overlayLayer = new VectorLayer({
|
||||
source: this.overlaySource,
|
||||
@ -74,25 +59,17 @@ export class LassoSelector {
|
||||
// 禁用默认右键菜单
|
||||
this.map.getViewport().addEventListener('contextmenu', (e) => e.preventDefault());
|
||||
|
||||
// pointerdown 捕获左键按下
|
||||
this.map.getViewport().addEventListener('pointerdown', (e) => {
|
||||
if (e.button === 0 && !this.drawing) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
this.isShiftKeyDown = e.shiftKey;
|
||||
// 右键按下开始绘制
|
||||
this.map.getViewport().addEventListener('mousedown', (e) => {
|
||||
if (e.button === 2 && !this.drawing) {
|
||||
this.drawing = true;
|
||||
this.coordinates = [];
|
||||
this.drawSource.clear();
|
||||
this.overlaySource.clear();
|
||||
|
||||
// 禁用拖动和缩放
|
||||
if (this.dragPanInteraction) this.dragPanInteraction.setActive(false);
|
||||
if (this.mouseWheelZoomInteraction) this.mouseWheelZoomInteraction.setActive(false);
|
||||
}
|
||||
});
|
||||
|
||||
// pointermove 画线
|
||||
// 鼠标移动实时绘制线和闭合多边形
|
||||
this.map.on('pointermove', (evt) => {
|
||||
if (!this.drawing) return;
|
||||
const coord = evt.coordinate as [number, number];
|
||||
@ -101,30 +78,11 @@ export class LassoSelector {
|
||||
this.renderPolygon();
|
||||
});
|
||||
|
||||
// pointerup 捕获左键抬起
|
||||
this.map.getViewport().addEventListener('pointerup', (e) => {
|
||||
if (e.button === 0 && this.drawing) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
// 右键抬起结束绘制并选中
|
||||
this.map.getViewport().addEventListener('mouseup', (e) => {
|
||||
if (e.button === 2 && this.drawing) {
|
||||
this.drawing = false;
|
||||
this.handleDrawEnd();
|
||||
|
||||
// 恢复拖动和缩放
|
||||
if (this.dragPanInteraction) this.dragPanInteraction.setActive(true);
|
||||
if (this.mouseWheelZoomInteraction) this.mouseWheelZoomInteraction.setActive(true);
|
||||
}
|
||||
});
|
||||
|
||||
// 防止拖动导致意外事件
|
||||
this.map.getViewport().addEventListener('pointercancel', (e) => {
|
||||
if (this.drawing) {
|
||||
this.drawing = false;
|
||||
this.drawSource.clear();
|
||||
this.overlaySource.clear();
|
||||
|
||||
if (this.dragPanInteraction) this.dragPanInteraction.setActive(true);
|
||||
if (this.mouseWheelZoomInteraction) this.mouseWheelZoomInteraction.setActive(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -142,6 +100,7 @@ export class LassoSelector {
|
||||
this.overlaySource.clear();
|
||||
if (this.coordinates.length < 3) return;
|
||||
|
||||
// 闭合多边形坐标(首尾闭合)
|
||||
const polygonCoords = [...this.coordinates, this.coordinates[0]];
|
||||
const polygon = new Polygon([polygonCoords]);
|
||||
const feature = new Feature({ geometry: polygon });
|
||||
@ -181,10 +140,7 @@ export class LassoSelector {
|
||||
}
|
||||
});
|
||||
|
||||
if (selected.length) {
|
||||
this.onSelectCallback(selected, this.isShiftKeyDown);
|
||||
}
|
||||
|
||||
this.onSelectCallback(selected);
|
||||
this.drawSource.clear();
|
||||
this.overlaySource.clear();
|
||||
}
|
||||
@ -192,5 +148,6 @@ export class LassoSelector {
|
||||
destroy() {
|
||||
this.map.removeLayer(this.drawLayer);
|
||||
this.map.removeLayer(this.overlayLayer);
|
||||
// 如有需要,解绑事件
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ export const globalHeaders = () => {
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
|
||||
axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID;
|
||||
axios.defaults.headers['projectId'] = cache.local.getJSON('selectedProject').id;
|
||||
axios.defaults.headers['projectId'] = cache.local.getJSON('selectedProject')?.id || '';
|
||||
|
||||
// 创建 axios 实例
|
||||
const service = axios.create({
|
||||
|
@ -306,7 +306,19 @@ const selectType = (value: string) => {
|
||||
const resetForm = () => {
|
||||
formRef.value?.resetFields();
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -70,7 +70,7 @@
|
||||
<!-- <el-table-column label="变更费用估算" align="center" prop="costEstimation" /> -->
|
||||
<el-table-column label="变更文件" align="center" prop="fileId">
|
||||
<template #default="scope">
|
||||
<span style="color: rgb(41 145 255);cursor: pointer" @click="onOpen(scope.row.file.url)"> {{ scope.row.file.originalName }}</span>
|
||||
<span style="color: rgb(41 145 255); cursor: pointer" @click="onOpen(scope.row.file.url)"> {{ scope.row.file.originalName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
@ -120,7 +120,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="提出日期" prop="submitDate">
|
||||
<el-date-picker clearable v-model="form.submitDate" type="date" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择提出日期">
|
||||
<el-date-picker clearable v-model="form.submitDate" type="date" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择提出日期">
|
||||
</el-date-picker> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12">
|
||||
@ -332,13 +332,26 @@ const handleDelete = async (row?: DesignChangeVO) => {
|
||||
};
|
||||
const handleView = (row) => {
|
||||
// 查看详情
|
||||
wordDetialRef.value?.openDialog(row,design_change_reason_type.value);
|
||||
wordDetialRef.value?.openDialog(row, design_change_reason_type.value);
|
||||
};
|
||||
// 预览
|
||||
const onOpen = (path: string) => {
|
||||
window.open(path, '_blank');
|
||||
window.open(path, '_blank');
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
|
@ -216,7 +216,7 @@ const handleSelectionChange = (selection: DrawingVO[]) => {
|
||||
const handleAdd = () => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/drawing/indexEdit`,
|
||||
path: `/workflows/drawing/indexEdit`,
|
||||
query: {
|
||||
type: 'add'
|
||||
}
|
||||
@ -227,7 +227,7 @@ const handleAdd = () => {
|
||||
const handleUpdate = async (row?: DrawingVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/drawing/indexEdit`,
|
||||
path: `/workflows/drawing/indexEdit`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'update'
|
||||
@ -253,7 +253,7 @@ const handleView = (row) => {
|
||||
const handleViewInfo = (row?: LeaveVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/drawing/indexEdit`,
|
||||
path: `/workflows/drawing/indexEdit`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'view'
|
||||
@ -283,4 +283,17 @@ const handleClick = (val) => {
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
|
@ -14,8 +14,8 @@
|
||||
<el-input v-model="queryParams.originalName" placeholder="请输入原文件名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable >
|
||||
<el-option v-for="dict in wf_business_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
<el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable>
|
||||
<el-option v-for="dict in wf_business_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@ -46,12 +46,11 @@
|
||||
<el-table-column label="原文件名" align="center" prop="originalName" />
|
||||
<el-table-column label="流程状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="wf_business_status" :value="scope.row.status"/>
|
||||
<dict-tag :options="wf_business_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="上传时间" align="center" prop="createTime" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column label="上传时间" align="center" prop="createTime" width="180"> </el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding">
|
||||
<template #default="scope">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
@ -68,7 +67,9 @@
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" size="small" icon="View" v-if="scope.row.status != 'draft'" @click="handleViewInfo(scope.row)">查看</el-button>
|
||||
<el-button type="primary" size="small" icon="View" v-if="scope.row.status != 'draft'" @click="handleViewInfo(scope.row)"
|
||||
>查看</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'waiting'">
|
||||
<el-button size="small" type="primary" icon="Notification" @click="handleCancelProcessApply(scope.row.id)">撤销</el-button>
|
||||
@ -119,10 +120,10 @@ const initFormData: SpecialSchemeForm = {
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
fileSuffix: undefined,
|
||||
remark: undefined,
|
||||
}
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<SpecialSchemeForm, SpecialSchemeQuery>>({
|
||||
form: {...initFormData},
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@ -131,16 +132,11 @@ const data = reactive<PageData<SpecialSchemeForm, SpecialSchemeQuery>>({
|
||||
fileName: undefined,
|
||||
originalName: undefined,
|
||||
status: undefined,
|
||||
params: {
|
||||
}
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
versionNumber: [
|
||||
{ required: true, message: "版本号不能为空", trigger: "blur" }
|
||||
],
|
||||
fileName: [
|
||||
{ required: true, message: "文件名称不能为空", trigger: "blur" }
|
||||
],
|
||||
versionNumber: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
|
||||
fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
@ -153,61 +149,61 @@ const getList = async () => {
|
||||
specialSchemeList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
form.value = { ...initFormData };
|
||||
specialSchemeFormRef.value?.resetFields();
|
||||
}
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: SpecialSchemeVO[]) => {
|
||||
ids.value = selection.map(item => item.id);
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/specialScheme/indexEdit`,
|
||||
path: `/workflows/specialScheme/indexEdit`,
|
||||
query: {
|
||||
type: 'add'
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: SpecialSchemeVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/specialScheme/indexEdit`,
|
||||
path: `/workflows/specialScheme/indexEdit`,
|
||||
query: {
|
||||
id: row.id,
|
||||
id: row.id,
|
||||
type: 'update'
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
@ -215,34 +211,34 @@ const submitForm = () => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateSpecialScheme(form.value).finally(() => buttonLoading.value = false);
|
||||
await updateSpecialScheme(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addSpecialScheme(form.value).finally(() => buttonLoading.value = false);
|
||||
await addSpecialScheme(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: SpecialSchemeVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除专项方案管理编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除专项方案管理编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delSpecialScheme(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
}
|
||||
};
|
||||
const handleView = (row) => {
|
||||
var url= row.file.url
|
||||
var url = row.file.url;
|
||||
window.open(url, '_blank');
|
||||
};
|
||||
/** 查看按钮操作 */
|
||||
const handleViewInfo = (row) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/specialScheme/indexEdit`,
|
||||
path: `/workflows/specialScheme/indexEdit`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'view'
|
||||
@ -264,4 +260,17 @@ const handleCancelProcessApply = async (id: string) => {
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
|
@ -443,6 +443,24 @@ const onBook = () => {
|
||||
onMounted(() => {
|
||||
gettreeStructureData();
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
state.projectId = nid;
|
||||
state.paramsQuery.projectId = nid;
|
||||
if (activeName.value === 'first') {
|
||||
gettreeStructureData();
|
||||
} else {
|
||||
// 回收站
|
||||
recylingRef.value.getDocumentDataList();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -430,6 +430,8 @@ export default {
|
||||
return new Promise((resovle, reject) => {
|
||||
if (this.info) {
|
||||
const { cameraIndex, gateway, sn, videoIndex } = this.info;
|
||||
console.log(this.info);
|
||||
|
||||
liveStart({
|
||||
cameraIndex,
|
||||
definition: 0,
|
||||
|
266
src/views/drone/droneConfig/index.vue
Normal file
266
src/views/drone/droneConfig/index.vue
Normal file
@ -0,0 +1,266 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<!-- <el-form-item label="配置名称" prop="configName">
|
||||
<el-input v-model="queryParams.configName" placeholder="请输入配置名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="配置地址" prop="configUrl">
|
||||
<el-input v-model="queryParams.configUrl" placeholder="请输入配置地址" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['drone:droneConfig:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['drone:droneConfig:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['drone:droneConfig:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['drone:droneConfig:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="droneConfigList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" width="50" />
|
||||
<!-- <el-table-column label="配置名称" align="center" prop="configName" /> -->
|
||||
<el-table-column label="rtmp端口" align="center" prop="rtmpPort" />
|
||||
<el-table-column label="rtcp端口" align="center" prop="rtcPort" />
|
||||
<el-table-column label="rtmp服务地址" align="center" prop="dockSocketUrl" />
|
||||
<el-table-column label="ai识别服务地址" align="center" prop="aiUrl" />
|
||||
<el-table-column label="srs服务地址" align="center" prop="srsUrl" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['drone:droneConfig:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['drone:droneConfig:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改无人机配置对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="droneConfigFormRef" :model="form" :rules="rules" label-width="150px">
|
||||
<el-form-item label="无人机服务地址" prop="dockSocketUrl">
|
||||
<el-input v-model="form.dockSocketUrl" placeholder="请输入无人机服务地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="ai识别服务地址" prop="aiUrl">
|
||||
<el-input v-model="form.aiUrl" placeholder="请输入ai识别服务地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="srs服务器地址" prop="srsUrl">
|
||||
<el-input v-model="form.srsUrl" placeholder="请输入srs服务器地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="srs(rtmp服务端口)" prop="rtmpPort">
|
||||
<el-input v-model="form.rtmpPort" placeholder="请输入srs(rtmp服务端口)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="srs(webrtc服务端口)" prop="rtcPort">
|
||||
<el-input v-model="form.rtcPort" placeholder="请输入srs(webrtc服务端口)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DroneConfig" lang="ts">
|
||||
import { listDroneConfig, getDroneConfig, delDroneConfig, addDroneConfig, updateDroneConfig } from '@/api/drone/droneConfig';
|
||||
import { DroneConfigVO, DroneConfigQuery, DroneConfigForm } from '@/api/drone/droneConfig/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const droneConfigList = ref<DroneConfigVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const droneConfigFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: DroneConfigForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
configName: undefined,
|
||||
configUrl: undefined,
|
||||
dockSocketUrl: undefined,
|
||||
aiUrl: undefined,
|
||||
srsUrl: undefined,
|
||||
rtmpPort: undefined,
|
||||
rtcPort: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<DroneConfigForm, DroneConfigQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
configName: undefined,
|
||||
configUrl: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询无人机配置列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listDroneConfig(queryParams.value);
|
||||
droneConfigList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
droneConfigFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DroneConfigVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加无人机配置';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DroneConfigVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getDroneConfig(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改无人机配置';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
droneConfigFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateDroneConfig(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addDroneConfig(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DroneConfigVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除无人机配置编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delDroneConfig(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'drone/droneConfig/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`droneConfig_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
@ -227,8 +227,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<span style="color:#ff0000ab;margin-bottom: 10px;display: block;">注意:请上传doc/xls/ppt/txt/pdf/png/jpg/jpeg/zip格式文件</span>
|
||||
</el-col><el-col :span="24">
|
||||
<span style="color: #ff0000ab; margin-bottom: 10px; display: block"
|
||||
>注意:请上传doc/xls/ppt/txt/pdf/png/jpg/jpeg/zip格式文件</span
|
||||
> </el-col
|
||||
><el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
@ -446,6 +448,19 @@ const handleView = (row) => {
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.detail {
|
||||
|
@ -460,6 +460,19 @@ const handleView = (row) => {
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.detail {
|
||||
|
@ -447,6 +447,19 @@ const handleView = (row) => {
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.detail {
|
||||
|
@ -451,6 +451,19 @@ const handleView = (row) => {
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.detail {
|
||||
|
@ -454,12 +454,6 @@ const initOLMap = () => {
|
||||
})
|
||||
});
|
||||
map.on('click', (e: any) => {
|
||||
var coordinate = e.coordinate;
|
||||
|
||||
// 将投影坐标转换为经纬度坐标
|
||||
var lonLatCoordinate = toLonLat(coordinate);
|
||||
// 输出转换后的经纬度坐标
|
||||
console.log('经纬度坐标:', lonLatCoordinate);
|
||||
const zoom = map.getView().getZoom();
|
||||
const scale = Math.max(zoom / 10, 1); // 缩放比例,根据需要调整公式
|
||||
map.forEachFeatureAtPixel(e.pixel, (feature: Feature) => {
|
||||
@ -539,38 +533,6 @@ const initOLMap = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// 你已有的 imageExtent 是 [minX, minY, maxX, maxY]
|
||||
const createExtentBorderLayer = (extent: number[]) => {
|
||||
// 构造矩形坐标,闭合成环,顺序可以是顺时针或逆时针
|
||||
const coords = [
|
||||
[
|
||||
[extent[0], extent[1]],
|
||||
[extent[0], extent[3]],
|
||||
[extent[2], extent[3]],
|
||||
[extent[2], extent[1]],
|
||||
[extent[0], extent[1]]
|
||||
]
|
||||
];
|
||||
|
||||
const polygonFeature = new Feature(new Polygon(coords));
|
||||
|
||||
polygonFeature.setStyle(
|
||||
new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'red', // 你想要的边框颜色
|
||||
width: 3 // 线宽
|
||||
}),
|
||||
fill: null // 不填充,纯边框
|
||||
})
|
||||
);
|
||||
|
||||
return new VectorLayer({
|
||||
source: new VectorSource({
|
||||
features: [polygonFeature]
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
const highlightStyle = (name, scale) => {
|
||||
return new Style({
|
||||
stroke: new Stroke({
|
||||
@ -721,7 +683,7 @@ const addPointToMap = (features: Array<any>) => {
|
||||
};
|
||||
|
||||
//选中几何图形
|
||||
const toggleFeatureHighlight = (feature: Feature, addIfNotExist = true) => {
|
||||
const toggleFeatureHighlight = (feature: Feature) => {
|
||||
const zoom = map.getView().getZoom();
|
||||
const scale = Math.max(zoom / 10, 1);
|
||||
if (feature.get('status') === '2') return;
|
||||
@ -730,41 +692,35 @@ const toggleFeatureHighlight = (feature: Feature, addIfNotExist = true) => {
|
||||
const isHighlighted = feature.get('highlighted') === true;
|
||||
|
||||
if (isHighlighted) {
|
||||
// 如果是反选或 toggle 模式,允许取消
|
||||
feature.setStyle(defaultStyle(feature.get('name'), scale));
|
||||
feature.set('highlighted', false);
|
||||
const id = feature.get('id');
|
||||
const idx = submitForm.value.finishedDetailIdList.indexOf(id);
|
||||
if (idx > -1) submitForm.value.finishedDetailIdList.splice(idx, 1);
|
||||
} else if (addIfNotExist) {
|
||||
} else {
|
||||
feature.setStyle(highlightStyle(feature.get('name'), scale));
|
||||
feature.set('highlighted', true);
|
||||
const id = feature.get('id');
|
||||
if (!submitForm.value.finishedDetailIdList.includes(id)) submitForm.value.finishedDetailIdList.push(id);
|
||||
if (!submitForm.value.finishedDetailIdList.includes(id)) {
|
||||
submitForm.value.finishedDetailIdList.push(id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
// 地图初始化
|
||||
initOLMap();
|
||||
// geoTiffLoading.value = false;
|
||||
map.addLayer(sharedLayer);
|
||||
selector.value = new LassoSelector(map, sharedSource, (features, isInvert = false) => {
|
||||
features.forEach((feature) => {
|
||||
if (isInvert) {
|
||||
// Shift + 左键 -> 只执行取消选中
|
||||
if (feature.get('highlighted') === true) {
|
||||
toggleFeatureHighlight(feature, false); // 取消选中,addIfNotExist = false
|
||||
}
|
||||
} else {
|
||||
// 普通左键 -> 只执行选中
|
||||
if (feature.get('highlighted') !== true) {
|
||||
toggleFeatureHighlight(feature, true); // 选中,addIfNotExist = true
|
||||
}
|
||||
}
|
||||
console.log(feature.get('status'));
|
||||
|
||||
toggleFeatureHighlight(feature);
|
||||
});
|
||||
});
|
||||
|
||||
enableMiddleMousePan(map);
|
||||
// enableMiddleMousePan(map);
|
||||
getList();
|
||||
creatPoint(fromLonLat([107.13149145799198, 23.804125705140834]), 'Point', '1', '测试点1', '1');
|
||||
});
|
||||
|
@ -1,156 +0,0 @@
|
||||
<template>
|
||||
<div ref="mapContainer" class="map-container"></div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import Map from 'ol/Map';
|
||||
import View from 'ol/View';
|
||||
import TileLayer from 'ol/layer/Tile';
|
||||
import XYZ from 'ol/source/XYZ';
|
||||
import TileGrid from 'ol/tilegrid/TileGrid';
|
||||
import { fromLonLat, transform, transformExtent } from 'ol/proj';
|
||||
import { fromUrl } from 'geotiff';
|
||||
import gcoord from 'gcoord';
|
||||
import ImageLayer from 'ol/layer/Image';
|
||||
import Static from 'ol/source/ImageStatic';
|
||||
import { Feature } from 'ol';
|
||||
import { Polygon } from 'ol/geom';
|
||||
import { Stroke, Style } from 'ol/style';
|
||||
import VectorLayer from 'ol/layer/Vector';
|
||||
import VectorSource from 'ol/source/Vector';
|
||||
const mapContainer = ref<HTMLDivElement | null>(null);
|
||||
|
||||
// 您提供的经纬度范围(EPSG:4326)
|
||||
const extent4326 = [107.13149481208748, 23.80411597354268, 107.13487254421389, 23.80801427852998];
|
||||
|
||||
// 计算中心点(经纬度)
|
||||
const centerLon = (extent4326[0] + extent4326[2]) / 2;
|
||||
const centerLat = (extent4326[1] + extent4326[3]) / 2;
|
||||
|
||||
// 转换 extent 到 EPSG:3857
|
||||
const extent3857 = transformExtent(extent4326, 'EPSG:4326', 'EPSG:3857');
|
||||
|
||||
// 生成 resolutions(256像素瓦片)
|
||||
const resolutions = Array.from({ length: 20 }, (_, z) => 156543.03392804097 / Math.pow(2, z));
|
||||
|
||||
onMounted(async () => {
|
||||
// const tiff = await fromUrl('/image/clean_rgba_cleaned.tif');
|
||||
// const image = await tiff.getImage();
|
||||
// const width = image.getWidth();
|
||||
// const height = image.getHeight();
|
||||
// const bbox = image.getBoundingBox(); // [minX, minY, maxX, maxY]
|
||||
// console.log('bbox', bbox);
|
||||
// const rasters = await image.readRasters({ interleave: true });
|
||||
// // 创建 Canvas
|
||||
// const canvas = document.createElement('canvas');
|
||||
// canvas.width = width;
|
||||
// canvas.height = height;
|
||||
// const ctx = canvas.getContext('2d')!;
|
||||
// const imageData: any = ctx.createImageData(width, height);
|
||||
// // 设置 RGBA 数据
|
||||
// imageData.data.set(rasters); // ✅ 完整设置,不用手动循环
|
||||
// ctx.putImageData(imageData, 0, 0);
|
||||
// // 将 canvas 转成 Data URL 用作图层 source
|
||||
// const imageUrl = canvas.toDataURL();
|
||||
// // 转换为 WGS84 经纬度
|
||||
// const minLonLat = transform([bbox[0], bbox[1]], 'EPSG:32648', 'EPSG:4326');
|
||||
// const maxLonLat = transform([bbox[2], bbox[3]], 'EPSG:32648', 'EPSG:4326');
|
||||
// console.log('minLonLat', minLonLat);
|
||||
// console.log('maxLonLat', maxLonLat);
|
||||
// // 转为 GCJ02(高德地图坐标系)
|
||||
// const gcjMin = gcoord.transform(minLonLat as [number, number, number], gcoord.WGS84, gcoord.GCJ02);
|
||||
// const gcjMax = gcoord.transform(maxLonLat as [number, number, number], gcoord.WGS84, gcoord.GCJ02);
|
||||
// // 再转 EPSG:3857 供 OpenLayers 使用
|
||||
// const minXY = fromLonLat(gcjMin);
|
||||
// const maxXY = fromLonLat(gcjMax);
|
||||
|
||||
let imageExtent = [11926280.148303444, 2729254.667731837, 11926657.474014785, 2729714.281185133];
|
||||
console.log('imageExtent', imageExtent);
|
||||
console.log('extent3857', extent3857);
|
||||
if (!mapContainer.value) return;
|
||||
const tileGrid = new TileGrid({
|
||||
extent: imageExtent,
|
||||
origin: [-20037508.342789244, 20037508.342789244], // Web Mercator 左上角
|
||||
resolutions,
|
||||
tileSize: 256
|
||||
});
|
||||
// 高德卫星图图层 (EPSG:3857)
|
||||
const gaodeLayer = new TileLayer({
|
||||
source: new XYZ({
|
||||
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
|
||||
maxZoom: 19,
|
||||
wrapX: true
|
||||
}),
|
||||
opacity: 1
|
||||
});
|
||||
|
||||
// 自定义瓦片图层(EPSG:3857)
|
||||
const customLayer = new TileLayer({
|
||||
source: new XYZ({
|
||||
url: 'http://192.168.110.2:8000/api/projects/3/tasks/c2e3227f-343f-48b1-88c0-1432d6eab33f/orthophoto/tiles/{z}/{x}/{y}'
|
||||
// extent: imageExtent
|
||||
})
|
||||
});
|
||||
const layer = customLayer; // eg: TileLayer<XYZ>
|
||||
const source = layer.getSource();
|
||||
const projection = source?.getProjection();
|
||||
|
||||
console.log('图层坐标系:', projection?.getCode());
|
||||
const borderLayer = createExtentBorderLayer(imageExtent);
|
||||
const testLayer = createExtentBorderLayer([
|
||||
...fromLonLat([107.13149481208748, 23.80411597354268]),
|
||||
...fromLonLat([107.13487254421389, 23.80801427852998])
|
||||
]);
|
||||
// 创建地图
|
||||
const map = new Map({
|
||||
target: mapContainer.value,
|
||||
layers: [gaodeLayer, customLayer, borderLayer, testLayer],
|
||||
view: new View({
|
||||
projection: 'EPSG:3857',
|
||||
center: fromLonLat([centerLon, centerLat]),
|
||||
zoom: 16,
|
||||
minZoom: 10
|
||||
// extent: extent3857 // 限制视图范围
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
const createExtentBorderLayer = (extent: number[]) => {
|
||||
// 构造矩形坐标,闭合成环,顺序可以是顺时针或逆时针
|
||||
const coords = [
|
||||
[
|
||||
[extent[0], extent[1]],
|
||||
[extent[0], extent[3]],
|
||||
[extent[2], extent[3]],
|
||||
[extent[2], extent[1]],
|
||||
[extent[0], extent[1]]
|
||||
]
|
||||
];
|
||||
|
||||
const polygonFeature = new Feature(new Polygon(coords));
|
||||
|
||||
polygonFeature.setStyle(
|
||||
new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'red', // 你想要的边框颜色
|
||||
width: 3 // 线宽
|
||||
}),
|
||||
fill: null // 不填充,纯边框
|
||||
})
|
||||
);
|
||||
|
||||
return new VectorLayer({
|
||||
source: new VectorSource({
|
||||
features: [polygonFeature]
|
||||
})
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.map-container {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
@ -18,7 +18,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['workflow:category:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['workflows:category:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
||||
@ -41,13 +41,13 @@
|
||||
<el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['workflow:category:edit']" />
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['workflows:category:edit']" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="新增" placement="top">
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['workflow:category:add']" />
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['workflows:category:add']" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['workflow:category:remove']" />
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['workflows:category:remove']" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
@ -22,10 +22,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['workflow:leave:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
<el-button v-hasPermi="['workflows:leave:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['workflow:leave:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
<el-button v-hasPermi="['workflows:leave:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -60,12 +60,12 @@
|
||||
<template #default="scope">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button v-hasPermi="['workflow:leave:edit']" size="small" type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
<el-button v-hasPermi="['workflows:leave:edit']" size="small" type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button v-hasPermi="['workflow:leave:remove']" size="small" type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
<el-button v-hasPermi="['workflows:leave:remove']" size="small" type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
@ -167,7 +167,7 @@ const handleSelectionChange = (selection: LeaveVO[]) => {
|
||||
const handleAdd = () => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/leaveEdit/index`,
|
||||
path: `/workflows/leaveEdit/index`,
|
||||
query: {
|
||||
type: 'add'
|
||||
}
|
||||
@ -178,7 +178,7 @@ const handleAdd = () => {
|
||||
const handleUpdate = (row?: LeaveVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/leaveEdit/index`,
|
||||
path: `/workflows/leaveEdit/index`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'update'
|
||||
@ -190,7 +190,7 @@ const handleUpdate = (row?: LeaveVO) => {
|
||||
const handleView = (row?: LeaveVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/leaveEdit/index`,
|
||||
path: `/workflows/leaveEdit/index`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'view'
|
||||
@ -210,7 +210,7 @@ const handleDelete = async (row?: LeaveVO) => {
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'workflow/leave/export',
|
||||
'workflows/leave/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
@ -23,14 +23,14 @@ const iframeLoaded = () => {
|
||||
}
|
||||
};
|
||||
};
|
||||
//baseUrl +
|
||||
//baseUrl +
|
||||
const open = async (definitionId, disabled) => {
|
||||
const url = `/warm-flow-ui/index.html?id=${definitionId}&disabled=${disabled}`;
|
||||
iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
|
||||
};
|
||||
/** 关闭按钮 */
|
||||
function close() {
|
||||
const obj = { path: '/workflow/processDefinition', query: { activeName: proxy.$route.query.activeName } };
|
||||
const obj = { path: '/workflows/processDefinition', query: { activeName: proxy.$route.query.activeName } };
|
||||
proxy.$tab.closeOpenPage(obj);
|
||||
}
|
||||
|
@ -10,13 +10,13 @@
|
||||
class="mt-2"
|
||||
node-key="id"
|
||||
:data="categoryOptions"
|
||||
:props="{ label: 'label', children: 'children' } as any"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
></el-tree>
|
||||
/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="20" :xs="24">
|
||||
@ -132,7 +132,7 @@
|
||||
<el-tree-select
|
||||
v-model="selectCategory"
|
||||
:data="categoryOptions"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' } as any"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' }"
|
||||
filterable
|
||||
value-key="id"
|
||||
:render-after-expand="false"
|
||||
@ -164,7 +164,7 @@
|
||||
<el-tree-select
|
||||
v-model="form.category"
|
||||
:data="categoryOptions"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' } as any"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' }"
|
||||
filterable
|
||||
value-key="id"
|
||||
:render-after-expand="false"
|
||||
@ -174,7 +174,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="流程编码" prop="flowCode">
|
||||
<el-input v-model="form.flowCode" placeholder="请输入流程编码" maxlength="20" show-word-limit>
|
||||
<template #prepend >{{ currentProject.id }}</template>
|
||||
<template #prepend>{{ currentProject.id }}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程名称" prop="flowName">
|
||||
@ -442,7 +442,7 @@ const handlerImportDefinition = (data: UploadRequestOptions): XMLHttpRequest =>
|
||||
*/
|
||||
const design = async (row: FlowDefinitionVo) => {
|
||||
proxy.$router.push({
|
||||
path: `/workflow/design/index`,
|
||||
path: `/workflows/design/index`,
|
||||
query: {
|
||||
definitionId: row.id,
|
||||
disabled: false,
|
||||
@ -456,13 +456,10 @@ const design = async (row: FlowDefinitionVo) => {
|
||||
* @param row
|
||||
*/
|
||||
const designView = async (row: FlowDefinitionVo) => {
|
||||
proxy.$router.push({
|
||||
path: `/workflow/design/index`,
|
||||
query: {
|
||||
definitionId: row.id,
|
||||
disabled: true,
|
||||
activeName: activeName.value
|
||||
}
|
||||
proxy.$tab.openPage(`/workflows/design/index`, '', {
|
||||
definitionId: row.id,
|
||||
disabled: true,
|
||||
activeName: activeName.value
|
||||
});
|
||||
};
|
||||
/** 表单重置 */
|
Reference in New Issue
Block a user