Browse Source

1.修改ApiTreeSelect组件配置

2.修复区域管理显示、防区列表管理功能,与菜单设置匹配
master
DIAMOND 1 year ago
parent
commit
162e3d68d0
  1. 3
      src/components/Form/src/components/ApiTreeSelect.vue
  2. 5
      src/views/earthMap/edit/EarthComp.vue
  3. 12
      src/views/military/modules/earthMap/msMapLine/MsMapLine.api.ts
  4. 15
      src/views/military/modules/earthMap/msMapLine/MsMapLine.data.ts
  5. 38
      src/views/military/modules/earthMap/msMapLine/MsMapLineList.vue
  6. 24
      src/views/military/modules/earthMap/msMapLine/components/MsMapLineForm.vue
  7. 16
      src/views/military/modules/earthMap/scene/SceneManage.vue
  8. 14
      src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue

3
src/components/Form/src/components/ApiTreeSelect.vue

@ -1,5 +1,5 @@
<template> <template>
<a-tree-select v-bind="getAttrs" @change="handleChange"> <a-tree-select v-bind="getAttrs" @change="handleChange" :placeholder=placeholder allow-clear>
<template #[item]="data" v-for="item in Object.keys($slots)"> <template #[item]="data" v-for="item in Object.keys($slots)">
<slot :name="item" v-bind="data || {}"></slot> <slot :name="item" v-bind="data || {}"></slot>
</template> </template>
@ -24,6 +24,7 @@
params: { type: Object }, params: { type: Object },
immediate: { type: Boolean, default: true }, immediate: { type: Boolean, default: true },
resultField: propTypes.string.def(''), resultField: propTypes.string.def(''),
placeholder: { type: String, default:'' }
}, },
emits: ['options-change', 'change'], emits: ['options-change', 'change'],
setup(props, { attrs, emit }) { setup(props, { attrs, emit }) {

5
src/views/earthMap/edit/EarthComp.vue

@ -2190,13 +2190,16 @@
let radarShifting = data.angularRadian; let radarShifting = data.angularRadian;
let left = Number(radarShifting) - Number(radarRange) / 2; let left = Number(radarShifting) - Number(radarRange) / 2;
// //
pickedFeature.id._xbsjOwner.addViewShedReturn = addViewShedRadar( console.log("雷达扫描范围",data);
let a
pickedFeature.id._xbsjOwner.addViewShedReturn =a= addViewShedRadar(
pickedFeature.id._xbsjOwner.position, pickedFeature.id._xbsjOwner.position,
radarRadius, radarRadius,
left, left,
Number(radarRange) / 2 + Number(radarShifting), Number(radarRange) / 2 + Number(radarShifting),
[rgb.r / 255, rgb.g / 255, rgb.b / 255, rgb.a] [rgb.r / 255, rgb.g / 255, rgb.b / 255, rgb.a]
); );
console.log("a",a);
} }
} }
}); });

12
src/views/military/modules/earthMap/msMapLine/MsMapLine.api.ts

@ -1,8 +1,8 @@
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage"; import { useMessage } from "/@/hooks/web/useMessage";
import { useUserStore } from '/@/store/modules/user';
const { createConfirm } = useMessage(); const { createConfirm } = useMessage();
const userStore = useUserStore();
enum Api { enum Api {
list = '/military/msMapLine/list', list = '/military/msMapLine/list',
save = '/military/msMapLine/add', save = '/military/msMapLine/add',
@ -13,6 +13,7 @@ enum Api {
exportXls = '/military/msMapLine/exportXls', exportXls = '/military/msMapLine/exportXls',
} }
/** /**
* api * api
* @param params * @param params
@ -27,8 +28,13 @@ export const getImportUrl = Api.importExcel;
/** /**
* *
* @param params * @param params
* @description
*/ */
export const list = (params) => defHttp.get({ url: Api.list, params }); export const list = (params) => {
if (params.sceneId == undefined)
params.sceneId = userStore.userInfo?.sceneId + "*";
return defHttp.get({ url: Api.list, params });
}
/** /**
* *

15
src/views/military/modules/earthMap/msMapLine/MsMapLine.data.ts

@ -5,7 +5,14 @@ import { render } from '/@/utils/common/renderUtils';
//列表数据 //列表数据
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '线路名称', title: '所属区域',
align: "center",
dataIndex: 'sceneId_dictText',
width: 180
},
{
// title: '线路名称',
title: '防区名称',
align: "center", align: "center",
dataIndex: 'name', dataIndex: 'name',
width: 180 width: 180
@ -88,7 +95,7 @@ export const columns: BasicColumn[] = [
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
label: "线路名称", label: "防区名称",
field: 'name', field: 'name',
component: 'Input', component: 'Input',
colProps: { span: 6 }, colProps: { span: 6 },
@ -98,12 +105,12 @@ export const searchFormSchema: FormSchema[] = [
//表单数据 //表单数据
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
{ {
label: '线路名称', label: '防区名称',
field: 'name', field: 'name',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [
{ required: true, message: '请输入线路名称!' }, { required: true, message: '请输入防区名称!' },
]; ];
}, },
}, },

38
src/views/military/modules/earthMap/msMapLine/MsMapLineList.vue

@ -1,25 +1,32 @@
<!-- <!--
地图线路管理 地图线路管理
目录位置三维地图管理 -> 地图线路管理 目录位置三维地图管理 -> 地图线路管理防区管理
功能概述管理所在场景下的区域如雷达防区测试区域 功能概述管理所在场景下的区域如雷达防区测试区域
--> -->
<template> <template>
<div> <div>
<!--查询区域--> <!--查询区域-->
<div class="jeecg-basic-table-form-container"> <div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol"> <a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :lg="8"> <a-col :lg="8">
<a-form-item label="线路名称" name="name"> <a-form-item label="防区名称" name="name">
<a-input placeholder="请输入线路名称" v-model:value="queryParam.name"></a-input> <a-input placeholder="请输入防区名称" v-model:value="queryParam.name"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="所属区域" name="sceneId">
<ApiTreeSelect :api="sceneIdTree" v-model:value="queryParam.sceneId"></ApiTreeSelect>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons"> <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6"> <a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button> <a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button> <a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
<!-- <a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px"> <!-- <a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }} {{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" /> <Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
@ -46,8 +53,7 @@
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</template> </template>
<a-button <a-button>批量操作
>批量操作
<Icon icon="mdi:chevron-down"></Icon> <Icon icon="mdi:chevron-down"></Icon>
</a-button> </a-button>
</a-dropdown> </a-dropdown>
@ -66,7 +72,8 @@
</template> </template>
<template #fileSlot="{ text }"> <template #fileSlot="{ text }">
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span> <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small"
@click="downloadFile(text)">下载</a-button>
</template> </template>
</BasicTable> </BasicTable>
<!-- 表单区域 --> <!-- 表单区域 -->
@ -82,11 +89,22 @@
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './MsMapLine.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './MsMapLine.api';
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import MsMapLineModal from './components/MsMapLineModal.vue'; import MsMapLineModal from './components/MsMapLineModal.vue';
import { BasicForm, ApiSelect, JAreaLinkage, JPopup, JAreaSelect, FormActionType, JCheckbox, JInput, JEllipsis } from '/@/components/Form'; import { BasicForm, ApiSelect, JAreaLinkage, JPopup, JAreaSelect, FormActionType, JCheckbox, JInput, JEllipsis, ApiTreeSelect } from '/@/components/Form';
import { defHttp } from '/@/utils/http/axios';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
const formRef = ref(); const formRef = ref();
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
// const toggleSearchStatus = ref<boolean>(false); // const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref(); const registerModal = ref();
//
const sceneIdTree = () => defHttp.get<Recordable[]>
({ url: "/military/msMapScene/queryTreeByCode",
params:{
sceneId: userStore.userInfo?.sceneId + "*"
} }).then(res=>{ return [res];})
;
// (params?: Recordable) => defHttp.get({ url: "/military/msMapScene/queryTreeByCode", params }).then(res=>{ return [res];}),
//table //table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: { tableProps: {
@ -100,6 +118,8 @@
fixed: 'right', fixed: 'right',
}, },
beforeFetch: (params) => { beforeFetch: (params) => {
//api
// params.sceneId = userStore.userInfo?.sceneId + "*"
return Object.assign(params, queryParam); return Object.assign(params, queryParam);
}, },
}, },

24
src/views/military/modules/earthMap/msMapLine/components/MsMapLineForm.vue

@ -3,8 +3,14 @@
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="线路名称" v-bind="validateInfos.name"> <a-form-item label="所属区域" v-bind="validateInfos.sceneId">
<a-input v-model:value="formData.name" placeholder="请输入线路名称" :disabled="disabled"></a-input> <!-- <a-input v-model:value="formData.sceneId" placeholder="请选择所属区域" :disabled="disabled"></a-input> -->
<ApiTreeSelect :api="sceneIdTree" v-model:value="formData.sceneId" placeholder="请选择所属区域" :disabled="disabled"></ApiTreeSelect>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="防区名称" v-bind="validateInfos.name">
<a-input v-model:value="formData.name" placeholder="请输入防区名称" :disabled="disabled"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -91,12 +97,22 @@ import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue'; import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { ApiTreeSelect } from '/@/components/Form';
import { getValueType } from '/@/utils'; import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../MsMapLine.api'; import { saveOrUpdate } from '../MsMapLine.api';
import { Form } from 'ant-design-vue'; import { Form } from 'ant-design-vue';
import { ColorPicker } from "vue3-colorpicker"; import { ColorPicker } from "vue3-colorpicker";
import "vue3-colorpicker/style.css"; import "vue3-colorpicker/style.css";
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
//
const sceneIdTree = () => defHttp.get<Recordable[]>
({ url: "/military/msMapScene/queryTreeByCode",
params:{
sceneId: userStore.userInfo?.sceneId + "*"
} }).then(res=>{ return [res];})
;
const props = defineProps({ const props = defineProps({
formDisabled: { type: Boolean, default: false }, formDisabled: { type: Boolean, default: false },
@ -120,6 +136,7 @@ const formData = reactive<Record<string, any>>({
dashStyle: undefined, dashStyle: undefined,
cycleFrame: undefined, cycleFrame: undefined,
positions: '', positions: '',
sceneId: '',
}); });
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } }); const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
@ -127,7 +144,8 @@ const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false); const confirmLoading = ref<boolean>(false);
// //
const validatorRules = { const validatorRules = {
name: [{ required: true, message: '请输入线路名称!' },], sceneId: [{ required: true, message: '请选择所属区域!' },],
name: [{ required: true, message: '请输入防区名称!' },],
materialType: [{ required: true, message: '请选择模型材质类型!' },], materialType: [{ required: true, message: '请选择模型材质类型!' },],
interpolation: [{ required: true, message: '请选择插值方式!' },], interpolation: [{ required: true, message: '请选择插值方式!' },],
color: [{ required: true, message: '请输入颜色!' },], color: [{ required: true, message: '请输入颜色!' },],

16
src/views/military/modules/earthMap/scene/SceneManage.vue

@ -2,17 +2,17 @@
监控站管理 监控站管理
目录位置三维地图管理 -> 监控站管理 目录位置三维地图管理 -> 监控站管理
功能概述场景管理上帝视角控制飞入视角 功能概述场景管理区域管理上帝视角控制飞入视角
--> -->
<template> <template>
<div class="mainContainer"> <div class="mainContainer">
<a-row> <a-row>
<a-col :span="24" class="container1"> <a-col :span="24" class="container1">
<span class="textdisplay">场景管理</span> <span class="textdisplay">区域管理</span>
<!-- <a-input class="inputText" v-model:value="filter"></a-input> <!-- <a-input class="inputText" v-model:value="filter"></a-input>
<a-button type="primary" class="buttonQuery" @click="getDataSource">查询</a-button> --> <a-button type="primary" class="buttonQuery" @click="getDataSource">查询</a-button> -->
<a-button type="primary" class="addProject" @click="addScene">新增场景</a-button> <a-button type="primary" class="addProject" @click="addScene">新增区域</a-button>
</a-col> </a-col>
<hr class="hrDivider" /> <hr class="hrDivider" />
<a-col :span="24" style="display: flex"> <a-col :span="24" style="display: flex">
@ -225,7 +225,7 @@
// width: '6%', // width: '6%',
// }, // },
{ {
title: '场景名称', title: '区域名称',
dataIndex: 'sceneName', dataIndex: 'sceneName',
key: 'sceneName', key: 'sceneName',
width: '10%', width: '10%',
@ -463,7 +463,7 @@
// //
dataSource.value = allData; dataSource.value = allData;
} else { } else {
message.error('无法获取到场景信息'); message.error('无法获取到区域信息');
} }
}); });
}; };
@ -575,10 +575,10 @@
//0 //0
// console.log(treeData.value, selectedKeys.value); // console.log(treeData.value, selectedKeys.value);
if (treeData.value.length > 0 && selectedKeys.value.length == 0) { if (treeData.value.length > 0 && selectedKeys.value.length == 0) {
message.warn('请先选中场景,再进行新增!'); message.warn('请先选中区域,再进行新增!');
return; return;
} }
title.value = '新增站点'; title.value = '新增区域';
// //
beforeDo(); beforeDo();
// //
@ -593,7 +593,7 @@
const doItem = ref({}); const doItem = ref({});
const doSomething = function (item, doType) { const doSomething = function (item, doType) {
if (treeData.value.length > 0 && !selectedKeys.value) { if (treeData.value.length > 0 && !selectedKeys.value) {
message.warn('请先选中场景,再进行修改!'); message.warn('请先选中区域,再进行修改!');
return; return;
} }
if (doType === 'edit') { if (doType === 'edit') {

14
src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue

@ -9,16 +9,16 @@
<slot name="header"></slot> <slot name="header"></slot>
</a-col> </a-col>
<a-col :span="11" :offset="1"> <a-col :span="11" :offset="1">
<div>站点名称:</div> <div>区域名称:</div>
<a-input class="inputWidthCss1" v-model:value="subObject.sceneName" placeholder="请输入场景编号名称" :disabled="disable"></a-input> <a-input class="inputWidthCss1" v-model:value="subObject.sceneName" placeholder="请输入区域编号名称" :disabled="disable"></a-input>
</a-col> </a-col>
<a-col :span="11" :offset="1"> <a-col :span="11" :offset="1">
<div>站点视距:</div> <div>区域视距:</div>
<a-input-number class="inputWidthCss1" v-model:value="subObject.viewDistance" :disabled="disable" :min="0.5" :step="0.0001"></a-input-number> <a-input-number class="inputWidthCss1" v-model:value="subObject.viewDistance" :disabled="disable" :min="0.5" :step="0.0001"></a-input-number>
</a-col> </a-col>
<a-col :span="11" :offset="1"> <a-col :span="11" :offset="1">
<div>站点类型:</div> <div>区域类型:</div>
<a-select v-model:value="subObject.sceneType" :disabled="disable" placeholder="请选择站点类型"> <a-select v-model:value="subObject.sceneType" :disabled="disable" placeholder="请选择区域类型">
<template :key="Number(sceneType.value)" v-for="sceneType in sceneTypes"> <template :key="Number(sceneType.value)" v-for="sceneType in sceneTypes">
<a-select-option :value="Number(sceneType.value)">{{ sceneType.text }}</a-select-option> <a-select-option :value="Number(sceneType.value)">{{ sceneType.text }}</a-select-option>
</template> </template>
@ -58,7 +58,7 @@
<div> <div>相机高度:</div><a-input-number class="inputWidthCss1" v-model:value="subObject.cameraAltitude" :disabled="disable" /> </div> <div> <div>相机高度:</div><a-input-number class="inputWidthCss1" v-model:value="subObject.cameraAltitude" :disabled="disable" /> </div>
</a-col> </a-col>
<a-col :span="11" :offset="1"> <a-col :span="11" :offset="1">
<div>站点图标:</div> <div>区域图标:</div>
<a-upload <a-upload
name="avatar" name="avatar"
list-type="picture-card" list-type="picture-card"
@ -150,7 +150,7 @@
// //
const handleOk = function () { const handleOk = function () {
if (!subObject.value.sceneName || subObject.value.sceneName.length <= 0) { if (!subObject.value.sceneName || subObject.value.sceneName.length <= 0) {
message.warn('站点名称不能为空!'); message.warn('区域名称不能为空!');
return; return;
} }
let submitUrl = ''; let submitUrl = '';

Loading…
Cancel
Save