merge
parent
770bef07ce
commit
6e0bd3b2b8
|
|
@ -95,23 +95,8 @@
|
|||
<!-- <a-tooltip title="从现有数据表中选择">
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="handlerGetExistsTableList"/>
|
||||
</a-tooltip> -->
|
||||
<a-button type="" :icon="h(PlusOutlined)" @click="handlerGetExistsTableList()" />
|
||||
|
||||
<a-popover placement="topLeft">
|
||||
<template #content>
|
||||
<a-table :dataSource="dataSource" :columns="columns" :size="'small'" >
|
||||
<template #bodyCell="{ column,record }">
|
||||
<template v-if="column.key === 'operation'">
|
||||
<a-button type="" :icon="h(PlusOutlined)" @click="handlerGetExistsTableList(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</template>
|
||||
|
||||
<template #title>
|
||||
<span>从现有数据表中选择</span>
|
||||
</template>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" />
|
||||
</a-popover>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-item>
|
||||
|
|
@ -226,23 +211,7 @@
|
|||
<!-- <a-tooltip title="从现有数据表中选择">
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="handlerGetExistsTableList"/>
|
||||
</a-tooltip> -->
|
||||
|
||||
<a-popover placement="topLeft">
|
||||
<template #content>
|
||||
<a-table :dataSource="dataSource" :columns="columns" :size="'small'" >
|
||||
<template #bodyCell="{ column,record }">
|
||||
<template v-if="column.key === 'operation'">
|
||||
<a-button type="" :icon="h(PlusOutlined)" @click="handlerGetExistsTableList(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</template>
|
||||
|
||||
<template #title>
|
||||
<span>从现有数据表中选择</span>
|
||||
</template>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" />
|
||||
</a-popover>
|
||||
<a-button type="" :icon="h(PlusOutlined)" @click="handlerGetExistsTableList()" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-item>
|
||||
|
|
@ -258,12 +227,16 @@
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
<a-modal :open="openSelectTable" title="请选择数据表" @cancel="handlerCancleSelectTable" @ok="handlerSelectTable">
|
||||
<BasicTable @register="registerImportTable" />
|
||||
</a-modal>
|
||||
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineEmits, defineProps, ref, h, reactive, onUnmounted, toRaw } from 'vue';
|
||||
import DataObject from '@/views/demo/onlineform/formdesign/form/DataObject.vue'
|
||||
import {
|
||||
CloseCircleOutlined,
|
||||
PlusOutlined,
|
||||
|
|
@ -276,12 +249,19 @@
|
|||
import type { UploadChangeParam } from 'ant-design-vue';
|
||||
import type { UploadProps } from 'ant-design-vue';
|
||||
import { useModal } from '@/components/Modal';
|
||||
// import { uploadShp } from '@/api/sys/analysis.ts'
|
||||
import { BasicTable, useTable } from '@/components/Table';
|
||||
import { BasicColumn, FormSchema } from '@/components/Table';
|
||||
import axios from 'axios';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { FILETYPE } from '../util'
|
||||
import {ObjectToUrl} from '../src/tool'
|
||||
import { addLayer } from '@/api/sys/layerManagement'
|
||||
import {
|
||||
getDataBaseTableList,
|
||||
getImportBaseTableList,
|
||||
importDataBaseTable,
|
||||
} from '@/api/formdesign/index';
|
||||
|
||||
const dataSource = reactive([
|
||||
{
|
||||
"tablename":"monitor"
|
||||
|
|
@ -291,6 +271,7 @@
|
|||
},
|
||||
])
|
||||
|
||||
const openSelectTable = ref<boolean>(false)
|
||||
|
||||
const columns = reactive([
|
||||
{
|
||||
|
|
@ -304,6 +285,67 @@
|
|||
}
|
||||
])
|
||||
|
||||
function handleBackRows(ModuleId) {
|
||||
alert(ModuleId);
|
||||
}
|
||||
|
||||
function dataBaseClick() {
|
||||
let rows = getImportSelectRows();
|
||||
let param = {
|
||||
dbCode: receiceDbCode.value,
|
||||
tableList: rows,
|
||||
};
|
||||
importDataBaseTable(param).then((res: Recordable) => {
|
||||
console.log(res);
|
||||
message.success('导入成功', 2);
|
||||
closeImportModal();
|
||||
reload();
|
||||
});
|
||||
}
|
||||
|
||||
const importColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '表名',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
dataIndex: 'description',
|
||||
},
|
||||
];
|
||||
|
||||
const [
|
||||
registerImportTable,{ clearSelectedRowKeys: clearImportSelectedRowKeys, getSelectRows: getImportSelectRows },
|
||||
] = useTable({
|
||||
title: '',
|
||||
rowKey: 'name',
|
||||
api: getImportBaseTableList,
|
||||
formConfig: {
|
||||
labelWidth: 80,
|
||||
},
|
||||
columns: importColumns,
|
||||
size: 'small',
|
||||
rowSelection: {
|
||||
//多选框
|
||||
// type: 'checkbox',
|
||||
type: 'radio',
|
||||
},
|
||||
useSearchForm: false,
|
||||
showTableSetting: false,
|
||||
canResize: false,
|
||||
bordered: true,
|
||||
pagination: {
|
||||
pageSize: 10,
|
||||
},
|
||||
beforeFetch: () => {
|
||||
var temp = {
|
||||
code: "hcsystemdb",
|
||||
};
|
||||
return temp;
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
const activeKey = ref(1)
|
||||
|
|
@ -350,9 +392,6 @@ const beforeUpload:UploadProps['beforeUpload'] = (file) => {
|
|||
return false;
|
||||
};
|
||||
|
||||
function handleBackRows(ModuleId) {
|
||||
|
||||
}
|
||||
|
||||
const handlerUploadFile = ()=>{
|
||||
let url = "http://192.168.10.102:9500/api/Files/Upload"
|
||||
|
|
@ -552,8 +591,20 @@ const submitDataList = () => {
|
|||
|
||||
// 获取现有数据表
|
||||
const handlerGetExistsTableList = (record )=>{
|
||||
openSelectTable.value = true;
|
||||
uploadFrom.tableName = record.tablename
|
||||
}
|
||||
|
||||
const handlerSelectTable = ()=> {
|
||||
let table = getImportSelectRows();
|
||||
uploadFrom.relationTable = table[0].name
|
||||
openSelectTable.value = false;
|
||||
}
|
||||
|
||||
const handlerCancleSelectTable = ()=>{
|
||||
openSelectTable.value = false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
<div id="mapContainer" class="map-box"></div>
|
||||
|
||||
<!-- 图层控制 -->
|
||||
<div class="layer-control-center">
|
||||
<div class="layer-control-center" v-if="false">
|
||||
<a-collapse v-model:activeKey="activeKey" accordion expandIconPosition="end" expandIcon="">
|
||||
<a-collapse-panel key="1" header="图层">
|
||||
<p v-for="(item, index) in props.mapConfig.layers">
|
||||
<p v-for="(item, index) in props.mapConfig.layers" class="layer-item">
|
||||
<a-checkbox v-model:checked="item.checked" @change="handlerCheckboxChange(item)">{{
|
||||
item.name
|
||||
}}</a-checkbox>
|
||||
</p>
|
||||
<p v-for="(item, index) in props.mapConfig.baseLayers">
|
||||
<p v-for="(item, index) in props.mapConfig.baseLayers" class="layer-item">
|
||||
<a-checkbox v-model:checked="item.checked" @change="handlerCheckboxChange(item)">{{
|
||||
item.name
|
||||
}}</a-checkbox>
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
import { generateUUID,getGeometryCenter } from './src/tool'
|
||||
|
||||
// 测量工具
|
||||
import { SwitchLayerControl,MeasureControl } from 'mapbox-extensions'
|
||||
import { SwitchLayerControl,MeasureControl,SwitchMapControl } from 'mapbox-extensions'
|
||||
import 'mapbox-extensions/dist/index.css'
|
||||
|
||||
import U from 'mapbox-gl-utils';
|
||||
|
|
@ -201,6 +201,70 @@
|
|||
measurePolygonOptions:{
|
||||
}
|
||||
}),"top-right")
|
||||
|
||||
let applicationLayers = []
|
||||
let baseLayers = [];
|
||||
props.mapConfig.layers?.forEach((item,index)=>{
|
||||
let style = JSON.parse(item.style)
|
||||
let layers = {
|
||||
name:item.name,
|
||||
layer:style,
|
||||
fixed:true,
|
||||
zoom:-100,
|
||||
easeToOptions:{},
|
||||
mutex:true,
|
||||
mutexIdentity:"t1",
|
||||
active:false,
|
||||
backgroundImage:"",
|
||||
backgroundImageActive:"",
|
||||
|
||||
onVisibleChange:(visible:boolean)=>{}
|
||||
}
|
||||
applicationLayers.push(layers)
|
||||
})
|
||||
|
||||
props.mapConfig.baseLayers?.forEach((item,index)=>{
|
||||
let layers = {
|
||||
name:item.name,
|
||||
layer: item.layer,
|
||||
fixed:true,
|
||||
zoom:-100,
|
||||
easeToOptions:{},
|
||||
mutex:true,
|
||||
mutexIdentity:index,
|
||||
active:false,
|
||||
backgroundImage:"http://lbs.tianditu.gov.cn/images/cia_c.png",
|
||||
backgroundImageActive:"",
|
||||
onVisibleChange:(visible:boolean)=>{}
|
||||
}
|
||||
baseLayers.push(layers)
|
||||
})
|
||||
|
||||
map.addControl(new SwitchLayerControl({
|
||||
name:"图层管理" ,
|
||||
position:"top-left",
|
||||
selectAndClearAll:true,
|
||||
selectAllLabel:"select all",
|
||||
clearAllLabel:"clear all",
|
||||
showToTop:true,
|
||||
topLayerId:"",
|
||||
layerGroups:{
|
||||
"应用图层":{
|
||||
mutex:true,
|
||||
collapse:true,
|
||||
uiType:"SwitchBtn",
|
||||
layers:applicationLayers
|
||||
},
|
||||
"地图底图":{
|
||||
mutex:true,
|
||||
collapse:true,
|
||||
uiType:"ImgTxtBtn",
|
||||
layers:baseLayers
|
||||
},
|
||||
}
|
||||
}),"top-left");
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
// 销毁地图
|
||||
|
|
@ -735,10 +799,8 @@
|
|||
}
|
||||
|
||||
.mapboxgl-ctrl-group {
|
||||
padding: 10px;
|
||||
padding: 6px;
|
||||
border-radius: 12px;
|
||||
position: relative;
|
||||
right: 140px;
|
||||
top: 5px;
|
||||
}
|
||||
.mapbox-gl-draw_ctrl-draw-btn {
|
||||
|
|
@ -809,8 +871,26 @@
|
|||
|
||||
.jas-ctrl-measure-item{
|
||||
height:22px;
|
||||
color: #fff;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
.layer-item{
|
||||
padding:8px 16px;
|
||||
|
||||
}
|
||||
|
||||
.layer-item:hover{
|
||||
background:#c7dcf580;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
::v-deep .ant-collapse-content-box{
|
||||
padding:0px!important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
|
@ -101,8 +101,7 @@
|
|||
// import MapboxMap from '@/components/MapboxMaps/MapComponent.vue'
|
||||
import ShowFormModal from './ShowFormModal/index.vue';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { cardNestStructure } from '@/views/demo/onlineform/util.ts';
|
||||
|
||||
import { changeCardStructure, cardNestStructure } from '@/views/demo/onlineform/util.ts';
|
||||
const MapboxMap = defineAsyncComponent(() => import('@/components/MapboxMaps/MapComponent.vue'));
|
||||
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
|
|
@ -563,22 +562,42 @@
|
|||
}
|
||||
};
|
||||
|
||||
const chooseLayer = ref<string>("")
|
||||
const geomfield = ref<string>("");
|
||||
function findValue(obj, targetKey) {
|
||||
for (var key in obj) {
|
||||
if (typeof obj[key] === 'object') {
|
||||
// 如果当前值是对象,则递归调用findValue
|
||||
var result = findValue(obj[key], targetKey);
|
||||
if (result !== undefined && result == 'MapGeom') {
|
||||
return result;
|
||||
}
|
||||
} else if (key === targetKey && obj[key] == 'MapGeom') {
|
||||
// 如果当前键等于目标键,则返回对应的值
|
||||
chooseLayer.value = obj['mapSetData'].chooseLayer;
|
||||
geomfield.value = obj['field']
|
||||
return obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function handlerShowGeomtrys(currentNode,rows){
|
||||
findValue(currentNode.value.schemas,"component")
|
||||
|
||||
let info = currentNode.value.schemas?.find((item,index)=>{
|
||||
return item.component == "MapGeom"
|
||||
return item.component.match(/mapgeom/i)
|
||||
})
|
||||
let layer:string="";
|
||||
// let layer:string="drone_shp_data";
|
||||
if(info){
|
||||
layer = info?.mapSetData?.chooseLayer
|
||||
}
|
||||
// console.log("info",info);
|
||||
let layer:string=chooseLayer.value;
|
||||
// // let layer:string="drone_shp_data";
|
||||
// if(info){
|
||||
// layer = info?.mapSetData?.chooseLayer
|
||||
// }
|
||||
if(!layer){
|
||||
createMessage.error("图斑未绑定图层服务!");
|
||||
return;
|
||||
}
|
||||
let geomfiledValue = info.field;
|
||||
let geomfiledValue = geomfield.value;
|
||||
let gids = "";
|
||||
try {
|
||||
// geomfiledValue = geomfiledValue.charAt(0).toLowerCase();
|
||||
|
|
@ -683,8 +702,6 @@
|
|||
width: 50,
|
||||
layerFields: {},
|
||||
};
|
||||
|
||||
// 设置geom保存表单
|
||||
}
|
||||
codeId.value = res.entity.id;
|
||||
paramsId.value = res.formScheme.id;
|
||||
|
|
|
|||
|
|
@ -10,30 +10,31 @@
|
|||
@ok="dataBaseClick"
|
||||
>
|
||||
<BasicTable @register="registerImportTable" />
|
||||
|
||||
</BasicModal>
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
@register="registerModal"
|
||||
:canFullscreen="false"
|
||||
:defaultFullscreen="false"
|
||||
:maskClosable="false"
|
||||
:width="800"
|
||||
title="数据对象选择"
|
||||
@ok="modalSuReClick"
|
||||
>
|
||||
<BasicTable @register="registerDataTable">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'stateSlot'">
|
||||
<div>
|
||||
<span class="tbBtnBox" @click="tbBtnClick(record)">同步</span>
|
||||
</div>
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
@register="registerModal"
|
||||
:canFullscreen="false"
|
||||
:defaultFullscreen="false"
|
||||
:maskClosable="false"
|
||||
:width="800"
|
||||
title="数据对象选择"
|
||||
@ok="modalSuReClick"
|
||||
>
|
||||
<BasicTable @register="registerDataTable">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'stateSlot'">
|
||||
<div>
|
||||
<span class="tbBtnBox" @click="tbBtnClick(record)">同步</span>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<template #centerFooter>
|
||||
<a-button type="success" @click="handleAddForm"> 导入表 </a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<template #centerFooter>
|
||||
<a-button type="success" @click="handleAddForm"> 导入表 </a-button>
|
||||
</template>
|
||||
</BasicModal>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
|
|
@ -54,7 +55,6 @@
|
|||
clearBaseSelectedRowKeys();
|
||||
reload();
|
||||
});
|
||||
|
||||
const [registerImportModal, { openModal: openImportTableModal, closeModal: closeImportModal }] =
|
||||
useModal();
|
||||
|
||||
|
|
@ -91,6 +91,7 @@
|
|||
keyWord: data.key,
|
||||
dbCode: receiceDbCode.value,
|
||||
};
|
||||
alert(receiceDbCode.value)
|
||||
return temp;
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -382,6 +382,7 @@
|
|||
}
|
||||
|
||||
const [registerModal, { openModal: openBaseDataTableModal }] = useModal();
|
||||
|
||||
const [registerSqlModal, { openModal: openSqleModal }] = useModal();
|
||||
|
||||
let tabMainList: any = [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue