Merge branch 'main' of http://123.132.248.154:10000/gitY/LinYeFangHuo
commit
4ea4e53fa4
|
|
@ -65266,7 +65266,7 @@ function isnan (val) {
|
||||||
// | tag: vint | size: vint | data: Buffer(size) |
|
// | tag: vint | size: vint | data: Buffer(size) |
|
||||||
this._tag_stack.push(tagObj);
|
this._tag_stack.push(tagObj);
|
||||||
// <<<<<<<<
|
// <<<<<<<<
|
||||||
// ポインタを進める
|
// ポインタを進めるs
|
||||||
this._cursor += tag.length;
|
this._cursor += tag.length;
|
||||||
this._total += tag.length;
|
this._total += tag.length;
|
||||||
// 読み込み状態変更
|
// 読み込み状態変更
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ enum Api {
|
||||||
TempeleteByTableName = '/api/Layer/TempeleteByTableName',
|
TempeleteByTableName = '/api/Layer/TempeleteByTableName',
|
||||||
// 更新单条数据
|
// 更新单条数据
|
||||||
UpdateTableData = '/api/Layer/UpdateTableData',
|
UpdateTableData = '/api/Layer/UpdateTableData',
|
||||||
|
// 添加单条数据
|
||||||
|
AddTableData = '/api/Layer/AddTableData',
|
||||||
// 上传样式
|
// 上传样式
|
||||||
UploadSldStyle = '/api/Layer/UploadSldStyle',
|
UploadSldStyle = '/api/Layer/UploadSldStyle',
|
||||||
}
|
}
|
||||||
|
|
@ -23,6 +25,7 @@ export function tableDataByTableName(params: TableDataByTableNameParams) {
|
||||||
return defHttp.get({ url: Api.TableDataByTableName, params });
|
return defHttp.get({ url: Api.TableDataByTableName, params });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 编辑打卡点
|
* @description: 编辑打卡点
|
||||||
*/
|
*/
|
||||||
|
|
@ -32,6 +35,17 @@ export function updateTableData(params: any) {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 编辑图斑
|
||||||
|
*/
|
||||||
|
export function addTableData(params: any) {
|
||||||
|
return defHttp.post({
|
||||||
|
url: Api.AddTableData,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 下载模板
|
* @description: 下载模板
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -231,6 +231,32 @@ export const eventCommonHandler = (
|
||||||
console.log(error);
|
console.log(error);
|
||||||
window['$message'].error('URL地址格式有误!');
|
window['$message'].error('URL地址格式有误!');
|
||||||
}
|
}
|
||||||
|
} else if (elementList[j].movement == 'revealInGroup') {
|
||||||
|
// 分组内组件显示
|
||||||
|
for (let k = 0; k < elementList[j].elementId.length; k++) {
|
||||||
|
componentList.forEach((list)=>{
|
||||||
|
if(list.isGroup && list.groupList.some((li) => li.id == elementList[j].elementId[k])){
|
||||||
|
list.groupList.forEach((l) => {
|
||||||
|
if(l.id == elementList[j].elementId[k]){
|
||||||
|
l.status.hide = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (elementList[j].movement == 'hiddenInGroup') {
|
||||||
|
// 分组内组件隐藏
|
||||||
|
for (let k = 0; k < elementList[j].elementId.length; k++) {
|
||||||
|
componentList.forEach((list)=>{
|
||||||
|
if(list.isGroup && list.groupList.some((li) => li.id == elementList[j].elementId[k])){
|
||||||
|
list.groupList.forEach((l) => {
|
||||||
|
if(l.id == elementList[j].elementId[k]){
|
||||||
|
l.status.hide = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -242,22 +268,26 @@ export const eventHandlerHook = (
|
||||||
type: string,
|
type: string,
|
||||||
params: any = null,
|
params: any = null,
|
||||||
) => {
|
) => {
|
||||||
const elementList: any = [];
|
if(interactConfigEvents) {
|
||||||
for (let i = 0; i < interactConfigEvents.length; i++) {
|
const elementList: any = [];
|
||||||
if (interactConfigEvents[i].type == type) {
|
for (let i = 0; i < interactConfigEvents.length; i++) {
|
||||||
if (!interactConfigEvents[i].movementList) {
|
if (interactConfigEvents[i].type == type) {
|
||||||
return false;
|
if (!interactConfigEvents[i].movementList) {
|
||||||
}
|
return false;
|
||||||
for (let j = 0; j < interactConfigEvents[i].movementList.length; j++) {
|
}
|
||||||
elementList.push(interactConfigEvents[i].movementList[j]);
|
for (let j = 0; j < interactConfigEvents[i].movementList.length; j++) {
|
||||||
|
elementList.push(interactConfigEvents[i].movementList[j]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (componentList.length == 0 || elementList.length == 0) {
|
if (componentList.length == 0 || elementList.length == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
eventCommonHandler(componentList, elementList, type, params);
|
||||||
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
eventCommonHandler(componentList, elementList, type, params);
|
|
||||||
};
|
};
|
||||||
// websocket事件
|
// websocket事件
|
||||||
export const websocketEvent = (interactConfigEvents: any, params: any = null) => {
|
export const websocketEvent = (interactConfigEvents: any, params: any = null) => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="go-title-xuncha">
|
<div class="go-title-xuncha" @click="clickBtn">
|
||||||
<img class="img" src="@/assets/images/chart/xunchaguiji/back.png" />
|
<img class="img" src="@/assets/images/chart/xunchaguiji/back.png" />
|
||||||
<span class="span">返回</span>
|
<span class="span">返回</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -8,7 +8,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType, toRefs } from 'vue'
|
import { PropType, toRefs } from 'vue'
|
||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
|
||||||
|
import { eventHandlerHook } from '@/hooks/eventHandler.hook';
|
||||||
|
|
||||||
|
const chartEditStore = useChartEditStore();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
chartConfig: {
|
chartConfig: {
|
||||||
type: Object as PropType<CreateComponentType>,
|
type: Object as PropType<CreateComponentType>,
|
||||||
|
|
@ -21,6 +24,14 @@ const {
|
||||||
textColor,
|
textColor,
|
||||||
textSize,
|
textSize,
|
||||||
} = toRefs(props.chartConfig.option)
|
} = toRefs(props.chartConfig.option)
|
||||||
|
// 单击交互
|
||||||
|
const clickBtn = () => {
|
||||||
|
eventHandlerHook(
|
||||||
|
chartEditStore.getComponentList,
|
||||||
|
props.chartConfig.events.interactConfigEvents,
|
||||||
|
'click'
|
||||||
|
);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="go-title-xuncha">
|
<div class="go-title-xuncha">
|
||||||
<div class="selbox">
|
<div class="selbox">
|
||||||
<!-- <n-tree-select
|
|
||||||
v-model:value="areaValue"
|
|
||||||
:options="areaOptions"
|
|
||||||
label-field="name"
|
|
||||||
key-field="id"
|
|
||||||
children-field="children"
|
|
||||||
placeholder="请选择行政区划"
|
|
||||||
clearable
|
|
||||||
style="width: 240px"
|
|
||||||
/> -->
|
|
||||||
<el-tree-select
|
<el-tree-select
|
||||||
v-model="areaValue"
|
v-model="areaValue"
|
||||||
:data="areaOptions"
|
:data="areaOptions"
|
||||||
|
|
@ -78,8 +68,12 @@ import { EventBus } from '@/utils/eventBus'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import * as mars3d from "mars3d";
|
import * as mars3d from "mars3d";
|
||||||
import { getAppEnvConfig } from '@/utils/env'
|
import { getAppEnvConfig } from '@/utils/env'
|
||||||
var { VITE_GLOB_API_URL } = getAppEnvConfig();
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
|
||||||
|
import { eventHandlerHook } from '@/hooks/eventHandler.hook';
|
||||||
|
|
||||||
|
const chartEditStore = useChartEditStore();
|
||||||
|
|
||||||
|
var { VITE_GLOB_API_URL } = getAppEnvConfig();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
chartConfig: {
|
chartConfig: {
|
||||||
type: Object as PropType<CreateComponentType>,
|
type: Object as PropType<CreateComponentType>,
|
||||||
|
|
@ -150,6 +144,11 @@ const getAreaListData=(id)=>{
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const lisClick=(e)=>{
|
const lisClick=(e)=>{
|
||||||
|
eventHandlerHook(
|
||||||
|
chartEditStore.getComponentList,
|
||||||
|
props.chartConfig.events.interactConfigEvents,
|
||||||
|
'click'
|
||||||
|
);
|
||||||
EventBus.emit('clockinlistsenddata' , e);
|
EventBus.emit('clockinlistsenddata' , e);
|
||||||
if(entityArr.value.length>0){
|
if(entityArr.value.length>0){
|
||||||
entityArr.value.forEach(item =>{
|
entityArr.value.forEach(item =>{
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,6 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
function getDatasetValue(values) {
|
function getDatasetValue(values) {
|
||||||
console.log(values);
|
|
||||||
|
|
||||||
let result = '';
|
let result = '';
|
||||||
values.forEach((val) => {
|
values.forEach((val) => {
|
||||||
result = result + ' ' + option.dataset[0][val];
|
result = result + ' ' + option.dataset[0][val];
|
||||||
|
|
@ -72,11 +70,11 @@
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(() => {
|
||||||
// 组件通信
|
// 组件通信
|
||||||
const sql = props.chartConfig.request?.requestSQLContent?.sql;
|
const sql = props.chartConfig.request?.requestSQLContent?.sql;
|
||||||
EventBus.on(props.chartConfig.id + 'dataupdate', (data) => {
|
EventBus.on(props.chartConfig.id + 'dataupdate', (data) => {
|
||||||
props.chartConfig.request.requestSQLContent.sql = replaceSqlParams(sql,{Id:data.id});
|
props.chartConfig.request.requestSQLContent.sql = replaceSqlParams(sql, { Id: data.id });
|
||||||
// 数据callback处理(预览时触发)
|
// 数据callback处理(预览时触发)
|
||||||
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
||||||
option.dataset = resData;
|
option.dataset = resData;
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@
|
||||||
preview-disabled
|
preview-disabled
|
||||||
/>
|
/>
|
||||||
<MonitorHK
|
<MonitorHK
|
||||||
|
:ref="(el) => setMonitorRef(el, videoIndex)"
|
||||||
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '海康'"
|
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '海康'"
|
||||||
:index="videoIndex"
|
:index="videoIndex"
|
||||||
:serialNumberValue="videoItem.videourl"
|
:serialNumberValue="videoItem.videourl"
|
||||||
|
|
@ -128,6 +129,8 @@
|
||||||
:dataStyle="option.dataStyle"
|
:dataStyle="option.dataStyle"
|
||||||
@changeThisVideo="changeThisVideo"
|
@changeThisVideo="changeThisVideo"
|
||||||
@closeThisVideo="closeThisVideo"
|
@closeThisVideo="closeThisVideo"
|
||||||
|
@hideHKVideo="hideHKVideo"
|
||||||
|
@showHKVideo="showHKVideo"
|
||||||
/>
|
/>
|
||||||
<MonitorTX
|
<MonitorTX
|
||||||
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '腾讯'"
|
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '腾讯'"
|
||||||
|
|
@ -140,6 +143,8 @@
|
||||||
:dataStyle="option.dataStyle"
|
:dataStyle="option.dataStyle"
|
||||||
@changeThisVideo="changeThisVideo"
|
@changeThisVideo="changeThisVideo"
|
||||||
@closeThisVideo="closeThisVideo"
|
@closeThisVideo="closeThisVideo"
|
||||||
|
@hideHKVideo="hideHKVideo"
|
||||||
|
@showHKVideo="showHKVideo"
|
||||||
/>
|
/>
|
||||||
<MonitorQX
|
<MonitorQX
|
||||||
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '青犀'"
|
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '青犀'"
|
||||||
|
|
@ -151,6 +156,8 @@
|
||||||
:dataStyle="option.dataStyle"
|
:dataStyle="option.dataStyle"
|
||||||
@changeThisVideo="changeThisVideo"
|
@changeThisVideo="changeThisVideo"
|
||||||
@closeThisVideo="closeThisVideo"
|
@closeThisVideo="closeThisVideo"
|
||||||
|
@hideHKVideo="hideHKVideo"
|
||||||
|
@showHKVideo="showHKVideo"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -345,8 +352,18 @@
|
||||||
|
|
||||||
// 隐藏弹窗
|
// 隐藏弹窗
|
||||||
function hideModal() {
|
function hideModal() {
|
||||||
option.videoList = [{}];
|
|
||||||
option.status.hide = true;
|
option.status.hide = true;
|
||||||
|
switch (option.dataStyle.nowType) {
|
||||||
|
case '1':
|
||||||
|
option.videoList = [{}];
|
||||||
|
break;
|
||||||
|
case '4':
|
||||||
|
option.videoList = [{}, {}, {}, {}];
|
||||||
|
break;
|
||||||
|
case '9':
|
||||||
|
option.videoList = [{}, {}, {}, {}, {}, {}, {}, {}, {}];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改视频
|
// 修改视频
|
||||||
|
|
@ -393,6 +410,31 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 其他视频组件全屏,隐藏海康视频组件
|
||||||
|
const monitorRefs: any = ref([]);
|
||||||
|
let monitorHKList: any = [];
|
||||||
|
function setMonitorRef(el, index) {
|
||||||
|
monitorHKList.push(index);
|
||||||
|
monitorHKList = [...new Set(monitorHKList)];
|
||||||
|
monitorRefs.value[index] = el;
|
||||||
|
}
|
||||||
|
// 隐藏海康视频组件
|
||||||
|
function hideHKVideo() {
|
||||||
|
monitorHKList.forEach((index) => {
|
||||||
|
if (monitorRefs.value[index]?.hideHkVideo) {
|
||||||
|
monitorRefs.value[index].hideHkVideo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 展示被隐藏的海康视频组件
|
||||||
|
function showHKVideo() {
|
||||||
|
monitorHKList.forEach((index) => {
|
||||||
|
if (monitorRefs.value[index]?.hideHkVideo) {
|
||||||
|
monitorRefs.value[index].showHkVideo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化视频控件
|
// 初始化视频控件
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 用于规避视频id重复
|
// 用于规避视频id重复
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 标签显示
|
||||||
|
function showHkVideo() {
|
||||||
|
if (oWebControl != null) {
|
||||||
|
oWebControl.JS_ShowWnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 标签隐藏
|
||||||
|
function hideHkVideo() {
|
||||||
|
if (oWebControl != null) {
|
||||||
|
oWebControl.JS_HideWnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 重定大小
|
// 重定大小
|
||||||
function reSizeVideo() {
|
function reSizeVideo() {
|
||||||
// 实际宽高
|
// 实际宽高
|
||||||
|
|
@ -278,6 +292,8 @@
|
||||||
initPlugin,
|
initPlugin,
|
||||||
init,
|
init,
|
||||||
closeHkVideo,
|
closeHkVideo,
|
||||||
|
showHkVideo,
|
||||||
|
hideHkVideo,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,11 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- 视频 -->
|
<!-- 视频 -->
|
||||||
<div class="box-container">
|
<div class="box-container">
|
||||||
<div :id="'root' + props.index + props.timestamp" @click="clickThisVideo" />
|
<div
|
||||||
|
:id="'root' + props.index + props.timestamp"
|
||||||
|
class="LCPlayer-video-contaiiner"
|
||||||
|
@click="clickThisVideo"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 控制栏 -->
|
<!-- 控制栏 -->
|
||||||
<div class="box-controls">
|
<div class="box-controls">
|
||||||
|
|
@ -118,7 +122,7 @@
|
||||||
'timestamp',
|
'timestamp',
|
||||||
'dataStyle',
|
'dataStyle',
|
||||||
]);
|
]);
|
||||||
const emit = defineEmits(['changeThisVideo', 'closeThisVideo']);
|
const emit = defineEmits(['changeThisVideo', 'closeThisVideo', 'hideHKVideo', 'showHKVideo']);
|
||||||
|
|
||||||
let clPlayer: any = null;
|
let clPlayer: any = null;
|
||||||
|
|
||||||
|
|
@ -161,6 +165,22 @@
|
||||||
// 全屏
|
// 全屏
|
||||||
function fullScreenClick() {
|
function fullScreenClick() {
|
||||||
clPlayer.fullScreen();
|
clPlayer.fullScreen();
|
||||||
|
// 隐藏海康视频
|
||||||
|
emit('hideHKVideo');
|
||||||
|
// 开始检查宽度,全屏继续检查,非全屏后展示隐藏的海康视频
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开始检查宽度,全屏继续检查,非全屏展示隐藏的海康视频
|
||||||
|
function checkSize() {
|
||||||
|
const element = document.querySelector('.LCPlayer-video-contaiiner');
|
||||||
|
const currentWidth = element.offsetWidth;
|
||||||
|
// 设置下一次检查
|
||||||
|
if (currentWidth > props.width) {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
} else {
|
||||||
|
emit('showHKVideo');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取kitToken
|
// 获取kitToken
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,10 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Close } from '@vicons/ionicons5';
|
import { Close } from '@vicons/ionicons5';
|
||||||
|
import { onMounted } from 'vue';
|
||||||
|
|
||||||
const props = defineProps(['title', 'videourl', 'index', 'width', 'height', 'dataStyle']);
|
const props = defineProps(['title', 'videourl', 'index', 'width', 'height', 'dataStyle']);
|
||||||
const emit = defineEmits(['changeThisVideo', 'closeThisVideo']);
|
const emit = defineEmits(['changeThisVideo', 'closeThisVideo', 'hideHKVideo', 'showHKVideo']);
|
||||||
|
|
||||||
function getUrl(value) {
|
function getUrl(value) {
|
||||||
return 'http://221.2.83.254:7012/live/' + value + '.m3u8';
|
return 'http://221.2.83.254:7012/live/' + value + '.m3u8';
|
||||||
|
|
@ -65,6 +66,24 @@
|
||||||
function closeVideo() {
|
function closeVideo() {
|
||||||
emit('closeThisVideo', props.index);
|
emit('closeThisVideo', props.index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 开始检查宽度,全屏继续检查,非全屏后展示隐藏的海康视频
|
||||||
|
function checkSize() {
|
||||||
|
// 设置下一次检查
|
||||||
|
if (document.querySelector('.vjs-default-skin').offsetWidth > props.width) {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
// 隐藏海康视频
|
||||||
|
emit('hideHKVideo');
|
||||||
|
} else {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
// 展示隐藏的海康视频
|
||||||
|
emit('showHKVideo');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@
|
||||||
'timestamp',
|
'timestamp',
|
||||||
'dataStyle',
|
'dataStyle',
|
||||||
]);
|
]);
|
||||||
const emit = defineEmits(['changeThisVideo', 'closeThisVideo']);
|
const emit = defineEmits(['changeThisVideo', 'closeThisVideo', 'hideHKVideo', 'showHKVideo']);
|
||||||
|
|
||||||
// 关闭此视频;
|
// 关闭此视频;
|
||||||
function closeVideo() {
|
function closeVideo() {
|
||||||
|
|
@ -157,6 +157,22 @@
|
||||||
// 全屏
|
// 全屏
|
||||||
function fullScreenClick() {
|
function fullScreenClick() {
|
||||||
txPlayer.requestFullscreen();
|
txPlayer.requestFullscreen();
|
||||||
|
// 隐藏海康视频
|
||||||
|
emit('hideHKVideo');
|
||||||
|
// 开始检查宽度,全屏继续检查,非全屏展示隐藏的海康视频
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开始检查宽度,全屏继续检查,非全屏后展示隐藏的海康视频
|
||||||
|
function checkSize() {
|
||||||
|
const element = document.querySelector('.TCPlayer-video-contaiiner');
|
||||||
|
const currentWidth = element.offsetWidth;
|
||||||
|
// 设置下一次检查
|
||||||
|
if (currentWidth > props.width) {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
} else {
|
||||||
|
emit('showHKVideo');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
@ -206,7 +222,7 @@
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
handlerPlayVideo();
|
handlerPlayVideo();
|
||||||
control_volume.value = props.videoMuted;
|
control_volume.value = props.dataStyle.videoMuted;
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@
|
||||||
src="@/assets/images/chart/zhichu/component/SheXiangTouModal_Image.png"
|
src="@/assets/images/chart/zhichu/component/SheXiangTouModal_Image.png"
|
||||||
/>
|
/>
|
||||||
<MonitorHK
|
<MonitorHK
|
||||||
|
:ref="(el) => setMonitorRef(el, index)"
|
||||||
v-if="!isEdit && !option.status.hide && item.manufacturer == '海康'"
|
v-if="!isEdit && !option.status.hide && item.manufacturer == '海康'"
|
||||||
:index="index"
|
:index="index"
|
||||||
:serialNumberValue="item.videourl"
|
:serialNumberValue="item.videourl"
|
||||||
|
|
@ -74,6 +75,8 @@
|
||||||
:height="`${option.dataStyle.videoheight - 2 * option.dataStyle.borderWidth - 2 * option.dataStyle.padding}`"
|
:height="`${option.dataStyle.videoheight - 2 * option.dataStyle.borderWidth - 2 * option.dataStyle.padding}`"
|
||||||
:timestamp="option.dataStyle.timestamp"
|
:timestamp="option.dataStyle.timestamp"
|
||||||
:videoMuted="option.dataStyle.videoMuted"
|
:videoMuted="option.dataStyle.videoMuted"
|
||||||
|
@hideHKVideo="hideHKVideo"
|
||||||
|
@showHKVideo="showHKVideo"
|
||||||
/>
|
/>
|
||||||
<MonitorTX
|
<MonitorTX
|
||||||
v-if="!isEdit && !option.status.hide && item.manufacturer == '腾讯'"
|
v-if="!isEdit && !option.status.hide && item.manufacturer == '腾讯'"
|
||||||
|
|
@ -85,6 +88,8 @@
|
||||||
:videoLoop="option.dataStyle.videoLoop"
|
:videoLoop="option.dataStyle.videoLoop"
|
||||||
:videoMuted="option.dataStyle.videoMuted"
|
:videoMuted="option.dataStyle.videoMuted"
|
||||||
:videoFit="option.dataStyle.videoFit"
|
:videoFit="option.dataStyle.videoFit"
|
||||||
|
@hideHKVideo="hideHKVideo"
|
||||||
|
@showHKVideo="showHKVideo"
|
||||||
/>
|
/>
|
||||||
<MonitorQX
|
<MonitorQX
|
||||||
v-if="!isEdit && !option.status.hide && item.manufacturer == '青犀'"
|
v-if="!isEdit && !option.status.hide && item.manufacturer == '青犀'"
|
||||||
|
|
@ -94,6 +99,8 @@
|
||||||
:videoLoop="option.dataStyle.videoLoop"
|
:videoLoop="option.dataStyle.videoLoop"
|
||||||
:videoMuted="option.dataStyle.videoMuted"
|
:videoMuted="option.dataStyle.videoMuted"
|
||||||
:videoFit="option.dataStyle.videoFit"
|
:videoFit="option.dataStyle.videoFit"
|
||||||
|
@hideHKVideo="hideHKVideo"
|
||||||
|
@showHKVideo="showHKVideo"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Title
|
<Title
|
||||||
|
|
@ -168,6 +175,31 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 其他视频组件全屏,隐藏海康视频组件
|
||||||
|
const monitorRefs: any = ref([]);
|
||||||
|
let monitorHKList: any = [];
|
||||||
|
function setMonitorRef(el, index) {
|
||||||
|
monitorHKList.push(index);
|
||||||
|
monitorHKList = [...new Set(monitorHKList)];
|
||||||
|
monitorRefs.value[index] = el;
|
||||||
|
}
|
||||||
|
// 隐藏海康视频组件
|
||||||
|
function hideHKVideo() {
|
||||||
|
monitorHKList.forEach((index) => {
|
||||||
|
if (monitorRefs.value[index]?.hideHkVideo) {
|
||||||
|
monitorRefs.value[index].hideHkVideo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 展示被隐藏的海康视频组件
|
||||||
|
function showHKVideo() {
|
||||||
|
monitorHKList.forEach((index) => {
|
||||||
|
if (monitorRefs.value[index]?.hideHkVideo) {
|
||||||
|
monitorRefs.value[index].showHkVideo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化视频控件
|
// 初始化视频控件
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 用于规避视频id重复
|
// 用于规避视频id重复
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 标签显示
|
||||||
|
function showHkVideo() {
|
||||||
|
if (oWebControl != null) {
|
||||||
|
oWebControl.JS_ShowWnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 标签隐藏
|
||||||
|
function hideHkVideo() {
|
||||||
|
if (oWebControl != null) {
|
||||||
|
oWebControl.JS_HideWnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 获取公钥
|
// 获取公钥
|
||||||
function getPubKey(callback) {
|
function getPubKey(callback) {
|
||||||
oWebControl
|
oWebControl
|
||||||
|
|
@ -265,6 +279,8 @@
|
||||||
initPlugin,
|
initPlugin,
|
||||||
init,
|
init,
|
||||||
closeHkVideo,
|
closeHkVideo,
|
||||||
|
showHkVideo,
|
||||||
|
hideHkVideo,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-container">
|
<div class="box-container">
|
||||||
<div :id="'root' + props.index + props.timestamp"></div>
|
<div :id="'root' + props.index + props.timestamp" class="LCPlayer-video-contaiiner"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-controls">
|
<div class="box-controls">
|
||||||
<div class="left-controls">
|
<div class="left-controls">
|
||||||
|
|
@ -85,6 +85,8 @@
|
||||||
'timestamp',
|
'timestamp',
|
||||||
'videoMuted',
|
'videoMuted',
|
||||||
]);
|
]);
|
||||||
|
const emit = defineEmits(['hideHKVideo', 'showHKVideo']);
|
||||||
|
|
||||||
let clPlayer: any = null;
|
let clPlayer: any = null;
|
||||||
|
|
||||||
// 开始播放/暂停播放
|
// 开始播放/暂停播放
|
||||||
|
|
@ -117,6 +119,22 @@
|
||||||
// 全屏
|
// 全屏
|
||||||
function fullScreenClick() {
|
function fullScreenClick() {
|
||||||
clPlayer.fullScreen();
|
clPlayer.fullScreen();
|
||||||
|
// 隐藏海康视频
|
||||||
|
emit('hideHKVideo');
|
||||||
|
// 开始检查宽度,全屏继续检查,非全屏后展示隐藏的海康视频
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开始检查宽度,全屏继续检查,非全屏展示隐藏的海康视频
|
||||||
|
function checkSize() {
|
||||||
|
const element = document.querySelector('.LCPlayer-video-contaiiner');
|
||||||
|
const currentWidth = element.offsetWidth;
|
||||||
|
// 设置下一次检查
|
||||||
|
if (currentWidth > props.width) {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
} else {
|
||||||
|
emit('showHKVideo');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取kitToken
|
// 获取kitToken
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,31 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { onMounted } from 'vue';
|
||||||
const props = defineProps(['videourl', 'width', 'height', 'videoMuted', 'videoLoop', 'videoFit']);
|
const props = defineProps(['videourl', 'width', 'height', 'videoMuted', 'videoLoop', 'videoFit']);
|
||||||
|
const emit = defineEmits(['hideHKVideo', 'showHKVideo']);
|
||||||
|
|
||||||
function getUrl(value) {
|
function getUrl(value) {
|
||||||
return 'http://221.2.83.254:7012/live/' + value + '.m3u8';
|
return 'http://221.2.83.254:7012/live/' + value + '.m3u8';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 开始检查宽度,全屏继续检查,非全屏后展示隐藏的海康视频
|
||||||
|
function checkSize() {
|
||||||
|
// 设置下一次检查
|
||||||
|
if (document.querySelector('.vjs-default-skin').offsetWidth > props.width) {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
// 隐藏海康视频
|
||||||
|
emit('hideHKVideo');
|
||||||
|
} else {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
// 展示隐藏的海康视频
|
||||||
|
emit('showHKVideo');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
setTimeout(checkSize, 10 * 1000);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,10 @@
|
||||||
'videoMuted',
|
'videoMuted',
|
||||||
'videoFit',
|
'videoFit',
|
||||||
]);
|
]);
|
||||||
|
const emit = defineEmits(['hideHKVideo', 'showHKVideo']);
|
||||||
|
|
||||||
// 视频控件初始化
|
// 视频控件初始化
|
||||||
let player: any = null;
|
let txPlayer: any = null;
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.videourl,
|
() => props.videourl,
|
||||||
|
|
@ -40,22 +41,40 @@
|
||||||
|
|
||||||
function handlerPlayVideo() {
|
function handlerPlayVideo() {
|
||||||
nextTick(function () {
|
nextTick(function () {
|
||||||
if (player) {
|
if (txPlayer) {
|
||||||
player.src(props.videourl);
|
txPlayer.src(props.videourl);
|
||||||
} else {
|
} else {
|
||||||
player = TCPlayer('ZhiGan_WuRenJiShiShiHuaMian' + props.index + props.timestamp, {});
|
txPlayer = TCPlayer('ZhiGan_WuRenJiShiShiHuaMian' + props.index + props.timestamp, {});
|
||||||
player.src(props.videourl);
|
txPlayer.src(props.videourl);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function closePlayerVideo() {
|
function closePlayerVideo() {
|
||||||
if (player) {
|
if (txPlayer) {
|
||||||
player.dispose();
|
txPlayer.dispose();
|
||||||
player = null;
|
txPlayer = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 开始检查宽度,全屏继续检查,非全屏后展示隐藏的海康视频
|
||||||
|
function checkSize() {
|
||||||
|
// 设置下一次检查
|
||||||
|
if (document.querySelector('.TCPlayer-video-contaiiner').offsetWidth > props.width) {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
// 隐藏海康视频
|
||||||
|
emit('hideHKVideo');
|
||||||
|
} else {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
// 展示隐藏的海康视频
|
||||||
|
emit('showHKVideo');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
setTimeout(checkSize, 1000);
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
handlerPlayVideo();
|
handlerPlayVideo();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@ import { chartInitConfig } from '@/settings/designSetting'
|
||||||
import { HuoQingDetailInfoConfig } from './index'
|
import { HuoQingDetailInfoConfig } from './index'
|
||||||
import dataJson from './data.json'
|
import dataJson from './data.json'
|
||||||
|
|
||||||
const { source } = dataJson;
|
const { source, header } = dataJson;
|
||||||
|
|
||||||
export const option = {
|
export const option = {
|
||||||
|
header: header,
|
||||||
dataset: source,
|
dataset: source,
|
||||||
dataStyle:{
|
dataStyle:{
|
||||||
backgroud: '#FFFFFF00',
|
backgroud: '#FFFFFF00',
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,61 @@
|
||||||
<template>
|
<template>
|
||||||
|
<CollapseItem name="数据设置" :expanded="true">
|
||||||
|
<div style="overflow-x: auto">
|
||||||
|
<n-table
|
||||||
|
class="go-request-header-table-box"
|
||||||
|
style="margin-top: 12px"
|
||||||
|
:single-line="false"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>标题名称</th>
|
||||||
|
<th>标题内容</th>
|
||||||
|
<th>
|
||||||
|
<n-button
|
||||||
|
class="go-ml-2"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
ghost
|
||||||
|
@click="add(props.optionData.header.length - 1)"
|
||||||
|
>
|
||||||
|
+
|
||||||
|
</n-button></th
|
||||||
|
>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="(item, index) in props.optionData.header" :key="index">
|
||||||
|
<td>
|
||||||
|
<n-input v-model:value="item.label" type="text" size="small" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<n-select
|
||||||
|
v-model:value="item.value"
|
||||||
|
multiple
|
||||||
|
:options="datasetOptions"
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div style="width: 40px">
|
||||||
|
<n-button
|
||||||
|
class="go-ml-2"
|
||||||
|
type="warning"
|
||||||
|
size="small"
|
||||||
|
ghost
|
||||||
|
:disabled="props.optionData.header.length === 1"
|
||||||
|
@click="remove(index)"
|
||||||
|
>
|
||||||
|
-
|
||||||
|
</n-button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</n-table>
|
||||||
|
</div>
|
||||||
|
</CollapseItem>
|
||||||
<CollapseItem name="设置" :expanded="true">
|
<CollapseItem name="设置" :expanded="true">
|
||||||
<SettingItemBox name="整体设置">
|
<SettingItemBox name="整体设置">
|
||||||
<SettingItem name="背景颜色">
|
<SettingItem name="背景颜色">
|
||||||
|
|
@ -122,7 +179,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType, watch, ref } from 'vue';
|
import { PropType, watch, ref, computed } from 'vue';
|
||||||
import { option } from './config';
|
import { option } from './config';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting';
|
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting';
|
||||||
|
|
@ -133,4 +190,27 @@
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const datasetOptions = computed(() => {
|
||||||
|
const result = Object.entries(option.dataset[0]).map(([key, value]) => ({
|
||||||
|
label: key,
|
||||||
|
value: key,
|
||||||
|
}));
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = (index: number) => {
|
||||||
|
props.optionData.header.splice(index + 1, 0, {
|
||||||
|
label: '',
|
||||||
|
value: [],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 减少
|
||||||
|
const remove = (index: number) => {
|
||||||
|
if (props.optionData.header.length !== 1) {
|
||||||
|
props.optionData.header.splice(index, 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,43 @@
|
||||||
{
|
{
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"label": "风向",
|
||||||
|
"value": ["windDirection"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "风速",
|
||||||
|
"value": ["windSpeed"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "温度",
|
||||||
|
"value": ["temperature"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "湿度",
|
||||||
|
"value": ["humidity"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "持续时间",
|
||||||
|
"value": ["duration"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "可燃物类型",
|
||||||
|
"value": ["fuelType"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "隔离带宽度",
|
||||||
|
"value": ["width"]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
{
|
{
|
||||||
"title": "风向",
|
"windDirection": "西风",
|
||||||
"content": "西风"
|
"windSpeed": "34m/s",
|
||||||
},
|
"temperature": "98°C",
|
||||||
{
|
"humidity": "34%RH",
|
||||||
"title": "风速",
|
"duration": "54分钟",
|
||||||
"content": "34m/s"
|
"fuelType": "枯叶落枝 草本植物",
|
||||||
},
|
"width": "10米"
|
||||||
{
|
|
||||||
"title": "温度",
|
|
||||||
"content": "98°C"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "湿度",
|
|
||||||
"content": "34%RH"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "持续时间",
|
|
||||||
"content": "54分钟"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "可燃物类型",
|
|
||||||
"content": "枯叶落枝 草本植物"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "隔离带宽度",
|
|
||||||
"content": "10米"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="HuoQingDetailInfo">
|
<div class="HuoQingDetailInfo">
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<div v-for="item in option.dataset" :key="item.key">
|
<div v-for="item in option.header" :key="item.key">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<Dot :dotSize="option.dataStyle.dotSize" :dotColor="option.dataStyle.dotColor" />
|
<Dot :dotSize="option.dataStyle.dotSize" :dotColor="option.dataStyle.dotColor" />
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<span :class="checkLength(item.title) ? 'dot1' : 'dot2'">{{ item.title }}</span>
|
<span :class="checkLength(item.label) ? 'dot1' : 'dot2'">{{ item.label }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="content"> {{ item.content }} </div>
|
<div class="content"> {{ getDatasetValue(item.value) }} </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
const { w, h } = toRefs(props.chartConfig.attr);
|
const { w, h } = toRefs(props.chartConfig.attr);
|
||||||
|
|
||||||
const option = reactive({
|
const option = reactive({
|
||||||
|
header: props.chartConfig.option.header,
|
||||||
dataset: props.chartConfig.option.dataset,
|
dataset: props.chartConfig.option.dataset,
|
||||||
dataStyle: props.chartConfig.option.dataStyle,
|
dataStyle: props.chartConfig.option.dataStyle,
|
||||||
});
|
});
|
||||||
|
|
@ -76,6 +77,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDatasetValue(values) {
|
||||||
|
let result = '';
|
||||||
|
values.forEach((val) => {
|
||||||
|
result = result + ' ' + option.dataset[0][val];
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 组件通信
|
// 组件通信
|
||||||
const sql = props.chartConfig.request?.requestSQLContent?.sql;
|
const sql = props.chartConfig.request?.requestSQLContent?.sql;
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@
|
||||||
|
|
||||||
// 点击列表项
|
// 点击列表项
|
||||||
function clickLi(item) {
|
function clickLi(item) {
|
||||||
item.visible = !item.visible;
|
// item.visible = !item.visible;
|
||||||
// option.value.series.data = option.value.dataset.source
|
// option.value.series.data = option.value.dataset.source
|
||||||
// .filter((item) => item.visible)
|
// .filter((item) => item.visible)
|
||||||
// .map((item) => ({
|
// .map((item) => ({
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="movement-type__element" v-if="panel.movement == 'callBackRequest'">
|
<div class="movement-type__element" v-else-if="panel.movement == 'callBackRequest'">
|
||||||
<CallBackEndApi
|
<CallBackEndApi
|
||||||
:panel="panel"
|
:panel="panel"
|
||||||
:index="panelIndex"
|
:index="panelIndex"
|
||||||
|
|
@ -73,6 +73,18 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="movement-type__element"
|
||||||
|
v-else-if="['revealInGroup', 'hiddenInGroup'].includes(panel.movement)"
|
||||||
|
>
|
||||||
|
分组内关联组件(可多选)
|
||||||
|
<n-select
|
||||||
|
v-model:value="panel.elementId"
|
||||||
|
placeholder="请选择"
|
||||||
|
:options="elementSelectOptionsInGroup"
|
||||||
|
multiple
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div class="movement-type__element" v-else>
|
<div class="movement-type__element" v-else>
|
||||||
关联组件(可多选)
|
关联组件(可多选)
|
||||||
<n-select
|
<n-select
|
||||||
|
|
@ -177,7 +189,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, defineEmits, onMounted, watch, defineAsyncComponent } from 'vue';
|
import { ref, defineEmits, onMounted, watch, defineAsyncComponent, computed } from 'vue';
|
||||||
import { eventTypeOptions, movementTypeOptions } from '../../../../hooks/eventData.hook';
|
import { eventTypeOptions, movementTypeOptions } from '../../../../hooks/eventData.hook';
|
||||||
import { goDialog, acquiesceAsyncComponent, previewPath, loadAsyncComponent } from '@/utils';
|
import { goDialog, acquiesceAsyncComponent, previewPath, loadAsyncComponent } from '@/utils';
|
||||||
import { DesktopOutline } from '@vicons/ionicons5';
|
import { DesktopOutline } from '@vicons/ionicons5';
|
||||||
|
|
@ -186,9 +198,9 @@
|
||||||
import { projectListApi } from '@/api/path/project.api';
|
import { projectListApi } from '@/api/path/project.api';
|
||||||
import { funSelectOptions, layerOptions } from '@/hooks/ceshiFun.hook';
|
import { funSelectOptions, layerOptions } from '@/hooks/ceshiFun.hook';
|
||||||
import { getLoad } from '@/api/sys/sysDataItemDetail';
|
import { getLoad } from '@/api/sys/sysDataItemDetail';
|
||||||
import CallBackEndApi from './CallBackRequest.vue';
|
|
||||||
|
|
||||||
const EventComponent = loadAsyncComponent(() => import('./EventComponent.vue'));
|
const EventComponent = loadAsyncComponent(() => import('./EventComponent.vue'));
|
||||||
|
const CallBackEndApi = loadAsyncComponent(() => import('./CallBackRequest.vue'));
|
||||||
const { targetData, chartEditStore } = useTargetData();
|
const { targetData, chartEditStore } = useTargetData();
|
||||||
const targetDataOption = ref([]);
|
const targetDataOption = ref([]);
|
||||||
const chartConfig = ref([]);
|
const chartConfig = ref([]);
|
||||||
|
|
@ -314,6 +326,27 @@
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 组件-分组内的组件
|
||||||
|
const elementSelectOptionsInGroup = computed(() => {
|
||||||
|
let optionsInGroup = [];
|
||||||
|
chartEditStore.getComponentList.forEach((element) => {
|
||||||
|
if (
|
||||||
|
element.isGroup &&
|
||||||
|
element?.groupList.some(
|
||||||
|
(li) => li.key == targetData.value.key && li.id == targetData.value.id,
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
optionsInGroup = element.groupList.map((item) => {
|
||||||
|
return {
|
||||||
|
label: '本分组内组件-' + item.chartConfig.title,
|
||||||
|
value: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return optionsInGroup;
|
||||||
|
});
|
||||||
// 修改组件样式,可以选择分组里的某个单组件
|
// 修改组件样式,可以选择分组里的某个单组件
|
||||||
const elementSelectSingleOptions: any = ref([]);
|
const elementSelectSingleOptions: any = ref([]);
|
||||||
const treeIterator = (tree) => {
|
const treeIterator = (tree) => {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,14 @@ export const movementTypeOptions: EventOptionsItemType[] = [
|
||||||
label: '隐藏',
|
label: '隐藏',
|
||||||
value: 'hidden',
|
value: 'hidden',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '分组内显示',
|
||||||
|
value: 'revealInGroup',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '分组内隐藏',
|
||||||
|
value: 'hiddenInGroup',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '跳转新地址',
|
label: '跳转新地址',
|
||||||
value: 'newaddress',
|
value: 'newaddress',
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
:clickRowToExpand="false"
|
:clickRowToExpand="false"
|
||||||
:checkable="true"
|
:checkable="true"
|
||||||
@check="handleCheck"
|
@check="handleCheck"
|
||||||
|
@change="handleChange"
|
||||||
:treeData="treeData"
|
:treeData="treeData"
|
||||||
:fieldNames="{ key: 'id', title: 'applicationName', children: 'child' }"
|
:fieldNames="{ key: 'id', title: 'applicationName', children: 'child' }"
|
||||||
:defaultExpandAll="true"
|
:defaultExpandAll="true"
|
||||||
|
|
@ -33,7 +34,7 @@
|
||||||
import { deleteLayer } from '@/api/sys/layerManagement';
|
import { deleteLayer } from '@/api/sys/layerManagement';
|
||||||
|
|
||||||
const { createMessage, createConfirm } = useMessage();
|
const { createMessage, createConfirm } = useMessage();
|
||||||
const emit = defineEmits(['select', 'edit', 'add', 'remove']);
|
const emit = defineEmits(['select', 'edit', 'add', 'remove','checked']);
|
||||||
|
|
||||||
defineOptions({ name: 'DeptTree' });
|
defineOptions({ name: 'DeptTree' });
|
||||||
const treeData = ref<TreeItem[]>([]);
|
const treeData = ref<TreeItem[]>([]);
|
||||||
|
|
@ -48,6 +49,8 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
|
|
||||||
// 展开全部
|
// 展开全部
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
unref(asyncExpandTreeRef)?.expandAll(true);
|
unref(asyncExpandTreeRef)?.expandAll(true);
|
||||||
|
|
@ -60,7 +63,15 @@
|
||||||
selectItem.value = item;
|
selectItem.value = item;
|
||||||
}
|
}
|
||||||
function handleCheck(checkedKeys, e) {
|
function handleCheck(checkedKeys, e) {
|
||||||
|
|
||||||
console.log('onChecked', checkedKeys, e);
|
console.log('onChecked', checkedKeys, e);
|
||||||
|
|
||||||
|
emit("checked",checkedKeys);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleChange(key,e){
|
||||||
|
console.log(key,e);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 根据id值或某个属性的值从树结构中查询数据
|
* 根据id值或某个属性的值从树结构中查询数据
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ export const formSchema: FormSchema[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'tableName',
|
field: 'tablename',
|
||||||
component: 'ApiSelect',
|
component: 'ApiSelect',
|
||||||
label: '空间数据表',
|
label: '空间数据表',
|
||||||
required: true,
|
required: true,
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,179 @@ const EditDrawingGeometry = (map,geometry) => {
|
||||||
flyTo: true
|
flyTo: true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
map.addLayer(drawingGraphicLayer)
|
||||||
|
|
||||||
|
// 绑定菜单
|
||||||
|
geometryBindMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加图斑
|
||||||
|
const AddDrawingGeometry = (map,type) => {
|
||||||
|
|
||||||
|
// 加载图层
|
||||||
|
if(drawingGraphicLayer){
|
||||||
|
drawingGraphicLayer.clear();
|
||||||
|
map.removeLayer(drawingGraphicLayer);
|
||||||
|
drawingGraphicLayer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
let geojson = {
|
||||||
|
"type": "FeatureCollection",
|
||||||
|
"features": []
|
||||||
|
}
|
||||||
|
|
||||||
|
drawingGraphicLayer = new mars3d.layer.GeoJsonLayer({
|
||||||
|
name: "编辑图层",
|
||||||
|
data:geojson,
|
||||||
|
isAutoEditing:true,
|
||||||
|
symbol: {
|
||||||
|
styleOptions: {
|
||||||
|
color: "#0d3685",
|
||||||
|
outlineColor: "#0d3685",
|
||||||
|
opacity: 0.8,
|
||||||
|
clampToGround:true,
|
||||||
|
"color": "#2f00b0",
|
||||||
|
"pixelSize": 10,
|
||||||
|
"opacity": 1,
|
||||||
|
"outline": true,
|
||||||
|
"outlineColor": "#ffffff",
|
||||||
|
"outlineOpacity": 0.6,
|
||||||
|
"outlineWidth": 2,
|
||||||
|
"scaleByDistance_far": 1000000,
|
||||||
|
"scaleByDistance_farValue": 0.1,
|
||||||
|
"scaleByDistance_near": 1000,
|
||||||
|
"scaleByDistance_nearValue": 1,
|
||||||
|
"distanceDisplayCondition_far": 10000,
|
||||||
|
"visibleDepth": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
popup: [],
|
||||||
|
popupOptions: {
|
||||||
|
showNull: true
|
||||||
|
},
|
||||||
|
flyTo: true
|
||||||
|
})
|
||||||
|
|
||||||
|
map.addLayer(drawingGraphicLayer);
|
||||||
|
|
||||||
|
// 开始绘制
|
||||||
|
switch(type){
|
||||||
|
case "point":
|
||||||
|
drawingGraphicLayer.startDraw({
|
||||||
|
type: "pointP",
|
||||||
|
style: {
|
||||||
|
pixelSize: 12,
|
||||||
|
color: "#3388ff",
|
||||||
|
label: {
|
||||||
|
// 不需要文字时,去掉label配置即可
|
||||||
|
text: "",
|
||||||
|
font_size: 20,
|
||||||
|
color: "#ffffff",
|
||||||
|
outline: true,
|
||||||
|
outlineColor: "#000000",
|
||||||
|
pixelOffsetY: -20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "polygon":
|
||||||
|
// 贴地面
|
||||||
|
drawingGraphicLayer.startDraw({
|
||||||
|
type: "polygonP",
|
||||||
|
style: {
|
||||||
|
color: "#3388ff",
|
||||||
|
opacity: 0.5,
|
||||||
|
outline: true,
|
||||||
|
outlineColor: "#ffffff",
|
||||||
|
outlineWidth: 2.0,
|
||||||
|
clampToGround:true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "polyline":
|
||||||
|
drawingGraphicLayer.startDraw({
|
||||||
|
type: "polylineP",
|
||||||
|
style: {
|
||||||
|
color:"#3388ff",
|
||||||
|
width: 3,
|
||||||
|
clampToGround:true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
geometryBindMenu();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查看图斑
|
||||||
|
const PreviewDrawingGeometry = (map,geometry) => {
|
||||||
|
// 获取geojson
|
||||||
|
let geojson = null;
|
||||||
|
|
||||||
|
if(typeof geometry == 'string'){
|
||||||
|
let jsonData = WktToGeojson(geometry)
|
||||||
|
|
||||||
|
geojson = {
|
||||||
|
"type": "FeatureCollection",
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"type": "Feature",
|
||||||
|
"geometry": jsonData
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(drawingGraphicLayer){
|
||||||
|
drawingGraphicLayer.clear();
|
||||||
|
map.removeLayer(drawingGraphicLayer);
|
||||||
|
drawingGraphicLayer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载图层
|
||||||
|
drawingGraphicLayer = new mars3d.layer.GeoJsonLayer({
|
||||||
|
name: "编辑图层",
|
||||||
|
data:geojson,
|
||||||
|
isAutoEditing:true,
|
||||||
|
symbol: {
|
||||||
|
styleOptions: {
|
||||||
|
color: "#0d3685",
|
||||||
|
outlineColor: "#0d3685",
|
||||||
|
opacity: 0.8,
|
||||||
|
clampToGround:true,
|
||||||
|
"color": "#2f00b0",
|
||||||
|
"pixelSize": 10,
|
||||||
|
"opacity": 1,
|
||||||
|
"outline": true,
|
||||||
|
"outlineColor": "#ffffff",
|
||||||
|
"outlineOpacity": 0.6,
|
||||||
|
"outlineWidth": 2,
|
||||||
|
"scaleByDistance_far": 1000000,
|
||||||
|
"scaleByDistance_farValue": 0.1,
|
||||||
|
"scaleByDistance_near": 1000,
|
||||||
|
"scaleByDistance_nearValue": 1,
|
||||||
|
"distanceDisplayCondition_far": 10000,
|
||||||
|
"visibleDepth": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
popup: [],
|
||||||
|
popupOptions: {
|
||||||
|
showNull: true
|
||||||
|
},
|
||||||
|
flyTo: true
|
||||||
|
})
|
||||||
|
|
||||||
|
map.addLayer(drawingGraphicLayer)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 图斑菜单
|
||||||
|
const geometryBindMenu = () => {
|
||||||
|
// 绑定菜单
|
||||||
drawingGraphicLayer.bindContextMenu([
|
drawingGraphicLayer.bindContextMenu([
|
||||||
{
|
{
|
||||||
text: "开始编辑对象",
|
text: "开始编辑对象",
|
||||||
|
|
@ -206,7 +379,6 @@ const EditDrawingGeometry = (map,geometry) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
map.addLayer(drawingGraphicLayer)
|
|
||||||
|
|
||||||
// 获取编辑结果
|
// 获取编辑结果
|
||||||
drawingGraphicLayer.on(mars3d.EventType.editStop, function (e) {
|
drawingGraphicLayer.on(mars3d.EventType.editStop, function (e) {
|
||||||
|
|
@ -216,34 +388,21 @@ const EditDrawingGeometry = (map,geometry) => {
|
||||||
EventBus.emit("editLayerEnd",resultWkt)
|
EventBus.emit("editLayerEnd",resultWkt)
|
||||||
})
|
})
|
||||||
|
|
||||||
//
|
// 绘制完成
|
||||||
}
|
drawingGraphicLayer.on(mars3d.EventType.drawCreated, function (e) {
|
||||||
|
|
||||||
// 添加图斑
|
|
||||||
const AddDrawingGeometry = (map) => {
|
|
||||||
|
|
||||||
}
|
let resultGeojson = e.graphic.toGeoJSON({standard:true,noAlt:true})
|
||||||
|
|
||||||
// 查看图斑
|
if(resultGeojson.geometry.type == "Polygon"){
|
||||||
const DetailDrawingGeometryy = (map,geometry) => {
|
resultGeojson.geometry.coordinates [0].push(resultGeojson.geometry.coordinates [0][0])
|
||||||
// 获取geojson
|
|
||||||
let geojson = null;
|
|
||||||
|
|
||||||
if(typeof geometry == 'string'){
|
|
||||||
let jsonData = WktToGeojson(geometry)
|
|
||||||
|
|
||||||
geojson = {
|
|
||||||
"type": "FeatureCollection",
|
|
||||||
"features": [
|
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"geometry": jsonData
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
console.log("resultGeoJson",resultGeojson);
|
||||||
|
|
||||||
|
let resultWkt = GeojsonToWkt(resultGeojson.geometry)
|
||||||
|
|
||||||
|
EventBus.emit("editLayerEnd",resultWkt)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 结束停止编辑
|
// 结束停止编辑
|
||||||
|
|
@ -252,4 +411,4 @@ const DrawingEnd = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export {WktToGeojson,GeojsonToWkt,GetGeometryCenter,EditDrawingGeometry,AddDrawingGeometry,DrawingEnd}
|
export {WktToGeojson,GeojsonToWkt,GetGeometryCenter,EditDrawingGeometry,AddDrawingGeometry,PreviewDrawingGeometry,DrawingEnd}
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
@select="handleSelect"
|
@select="handleSelect"
|
||||||
@edit="editLayer"
|
@edit="editLayer"
|
||||||
@add="addLayer"
|
@add="addLayer"
|
||||||
|
@checked="checkedLayer"
|
||||||
@remove="tableVisible = false"
|
@remove="tableVisible = false"
|
||||||
/>
|
/>
|
||||||
<div class="map-container w-3/4 xl:w-4/5">
|
<div class="map-container w-3/4 xl:w-4/5">
|
||||||
|
|
@ -24,6 +25,30 @@
|
||||||
style="width: 200px; margin-right: 10px"
|
style="width: 200px; margin-right: 10px"
|
||||||
/>
|
/>
|
||||||
<a-button type="primary" @click="getList"> 查询 </a-button>
|
<a-button type="primary" @click="getList"> 查询 </a-button>
|
||||||
|
|
||||||
|
<a-dropdown>
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu >
|
||||||
|
<a-menu-item key="1" @click="addData('point')" >
|
||||||
|
<UserOutlined />
|
||||||
|
点数据
|
||||||
|
</a-menu-item>
|
||||||
|
<a-menu-item key="2" @click="addData('polyline')">
|
||||||
|
<UserOutlined />
|
||||||
|
线数据
|
||||||
|
</a-menu-item>
|
||||||
|
<a-menu-item key="3" @click="addData('polygon')">
|
||||||
|
<UserOutlined />
|
||||||
|
面数据
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
<a-button>
|
||||||
|
添加
|
||||||
|
<DownOutlined />
|
||||||
|
</a-button>
|
||||||
|
</a-dropdown>
|
||||||
|
|
||||||
<a-button type="primary" @click="exportTemplate"> 导出模版 </a-button>
|
<a-button type="primary" @click="exportTemplate"> 导出模版 </a-button>
|
||||||
<a-upload
|
<a-upload
|
||||||
:accept="'.xlsx,.csv,.xls,.zip'"
|
:accept="'.xlsx,.csv,.xls,.zip'"
|
||||||
|
|
@ -87,7 +112,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 编辑 -->
|
<!-- 编辑 -->
|
||||||
<div class="data-edit" v-if="showTable == 'edit'">
|
<div class="data-edit" v-if="showTable == 'edit' || showTable == 'add'">
|
||||||
<a-form
|
<a-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="formState"
|
:model="formState"
|
||||||
|
|
@ -172,7 +197,7 @@
|
||||||
import { CloseOutlined, InboxOutlined } from '@ant-design/icons-vue';
|
import { CloseOutlined, InboxOutlined } from '@ant-design/icons-vue';
|
||||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||||
import { columns } from './data';
|
import { columns } from './data';
|
||||||
import { tableDataByTableName, updateTableData, uploadSldStyle } from '@/api/application/layer';
|
import { tableDataByTableName, updateTableData, addTableData, uploadSldStyle } from '@/api/application/layer';
|
||||||
import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
|
import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
|
||||||
import { useMessage } from '@/hooks/web/useMessage';
|
import { useMessage } from '@/hooks/web/useMessage';
|
||||||
import { uploadFile, fun_Delete } from '@/api/demo/files';
|
import { uploadFile, fun_Delete } from '@/api/demo/files';
|
||||||
|
|
@ -182,25 +207,217 @@
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { EventBus } from '@/utils/eventBus';
|
import { EventBus } from '@/utils/eventBus';
|
||||||
import {
|
|
||||||
GetGeometryCenter,
|
import {GetGeometryCenter,EditDrawingGeometry,AddDrawingGeometry,PreviewDrawingGeometry,DrawingEnd} from "./geometryHandler.ts"
|
||||||
EditDrawingGeometry,
|
|
||||||
AddDrawingGeometry,
|
|
||||||
DrawingEnd,
|
|
||||||
} from './geometryHandler.ts';
|
|
||||||
import * as mars3d from 'mars3d';
|
import * as mars3d from 'mars3d';
|
||||||
|
|
||||||
let globalMap: mars3d.Map;
|
let globalMap: mars3d.Map;
|
||||||
|
|
||||||
const onMapLoad = (map) => {
|
const onMapLoad = (map) => {
|
||||||
globalMap = map;
|
globalMap = map;
|
||||||
};
|
|
||||||
|
|
||||||
EventBus.on('editLayerEnd', function (e) {
|
}
|
||||||
|
|
||||||
|
EventBus.on("editLayerEnd",function(e){
|
||||||
formState.value.geom = e;
|
formState.value.geom = e;
|
||||||
|
})
|
||||||
|
|
||||||
console.log('formState', formState.value);
|
|
||||||
});
|
// 加载图层
|
||||||
|
const handlerLoadLayer = (record) => {
|
||||||
|
|
||||||
|
//
|
||||||
|
let layer = globalMap.getLayerById(record.id);
|
||||||
|
|
||||||
|
if(layer){
|
||||||
|
layer.show = !layer.show
|
||||||
|
}else{
|
||||||
|
|
||||||
|
let tileLayer = new mars3d.layer.WmsLayer({
|
||||||
|
name: "合肥WMS",
|
||||||
|
url: "http://192.168.10.163:8080/geoserver/my_workspace/wms",
|
||||||
|
layers: "my_workspace:fm_waterresourcetest",
|
||||||
|
parameters: {
|
||||||
|
transparent: true,
|
||||||
|
format: "image/png"
|
||||||
|
},
|
||||||
|
getFeatureInfoParameters: {
|
||||||
|
feature_count: 10
|
||||||
|
},
|
||||||
|
// 单击高亮及其样式
|
||||||
|
highlight: {
|
||||||
|
type: "wallP",
|
||||||
|
diffHeight: 100,
|
||||||
|
materialType: mars3d.MaterialType.LineFlow,
|
||||||
|
materialOptions: {
|
||||||
|
image: "https://data.mars3d.cn/img/textures/fence.png",
|
||||||
|
color: "#ffff00",
|
||||||
|
speed: 10, // 速度,建议取值范围1-100
|
||||||
|
axisY: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
popup: "all",
|
||||||
|
flyTo: true
|
||||||
|
})
|
||||||
|
globalMap.addLayer(tileLayer);
|
||||||
|
let drawingGraphicLayer = new mars3d.layer.GeoJsonLayer({
|
||||||
|
id:record.id,
|
||||||
|
name: "编辑图层",
|
||||||
|
data:{
|
||||||
|
"type": "FeatureCollection",
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"type": "Feature",
|
||||||
|
"id": "fm_fireproofbarracks.4",
|
||||||
|
"geometry": {
|
||||||
|
"type": "Point",
|
||||||
|
"coordinates": [118.037111, 35.402398]
|
||||||
|
},
|
||||||
|
"geometry_name": "geom",
|
||||||
|
"properties": {
|
||||||
|
"Name": "4号防火驿站",
|
||||||
|
"Info": null,
|
||||||
|
"Lng": null,
|
||||||
|
"Lat": null,
|
||||||
|
"State": "1",
|
||||||
|
"UpdateTime": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Feature",
|
||||||
|
"id": "fm_fireproofbarracks.5",
|
||||||
|
"geometry": {
|
||||||
|
"type": "Point",
|
||||||
|
"coordinates": [118.032671, 35.406068]
|
||||||
|
},
|
||||||
|
"geometry_name": "geom",
|
||||||
|
"properties": {
|
||||||
|
"Name": "5号防火驿站",
|
||||||
|
"Info": null,
|
||||||
|
"Lng": null,
|
||||||
|
"Lat": null,
|
||||||
|
"State": "1",
|
||||||
|
"UpdateTime": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Feature",
|
||||||
|
"id": "fm_fireproofbarracks.2",
|
||||||
|
"geometry": {
|
||||||
|
"type": "Point",
|
||||||
|
"coordinates": [118.044773, 35.398101]
|
||||||
|
},
|
||||||
|
"geometry_name": "geom",
|
||||||
|
"properties": {
|
||||||
|
"Name": "2号防火驿站",
|
||||||
|
"Info": null,
|
||||||
|
"Lng": null,
|
||||||
|
"Lat": null,
|
||||||
|
"State": "1",
|
||||||
|
"UpdateTime": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Feature",
|
||||||
|
"id": "fm_fireproofbarracks.1",
|
||||||
|
"geometry": {
|
||||||
|
"type": "Point",
|
||||||
|
"coordinates": [118.046801, 35.397552]
|
||||||
|
},
|
||||||
|
"geometry_name": "geom",
|
||||||
|
"properties": {
|
||||||
|
"Name": "1号防火驿站",
|
||||||
|
"Info": null,
|
||||||
|
"Lng": null,
|
||||||
|
"Lat": null,
|
||||||
|
"State": "1",
|
||||||
|
"UpdateTime": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Feature",
|
||||||
|
"id": "fm_fireproofbarracks.3",
|
||||||
|
"geometry": {
|
||||||
|
"type": "Polygon",
|
||||||
|
"coordinates": [
|
||||||
|
[
|
||||||
|
[118.196381, 35.356013],
|
||||||
|
[118.196421, 35.356022],
|
||||||
|
[118.196433, 35.355985],
|
||||||
|
[118.196331, 35.35596],
|
||||||
|
[118.196339, 35.355921],
|
||||||
|
[118.19644, 35.355946],
|
||||||
|
[118.196449, 35.355921],
|
||||||
|
[118.196347, 35.355897],
|
||||||
|
[118.196355, 35.355847],
|
||||||
|
[118.196409, 35.355859],
|
||||||
|
[118.19646, 35.355871],
|
||||||
|
[118.196468, 35.355842],
|
||||||
|
[118.196365, 35.355819],
|
||||||
|
[118.196316, 35.355808],
|
||||||
|
[118.196307, 35.355846],
|
||||||
|
[118.196294, 35.355908],
|
||||||
|
[118.196277, 35.355979],
|
||||||
|
[118.196381, 35.356013]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"geometry_name": "geom",
|
||||||
|
"properties": {
|
||||||
|
"Name": "3号防火驿站",
|
||||||
|
"Info": null,
|
||||||
|
"Lng": null,
|
||||||
|
"Lat": null,
|
||||||
|
"State": "1",
|
||||||
|
"UpdateTime": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"totalFeatures": 5,
|
||||||
|
"numberMatched": 5,
|
||||||
|
"numberReturned": 5,
|
||||||
|
"timeStamp": "2025-04-29T03:03:26.650Z",
|
||||||
|
"crs": {
|
||||||
|
"type": "name",
|
||||||
|
"properties": {
|
||||||
|
"name": "urn:ogc:def:crs:EPSG::404000"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isAutoEditing:true,
|
||||||
|
symbol: {
|
||||||
|
styleOptions: {
|
||||||
|
color: "#0d3685",
|
||||||
|
outlineColor: "#0d3685",
|
||||||
|
opacity: 0.8,
|
||||||
|
clampToGround:true,
|
||||||
|
"color": "#2f00b0",
|
||||||
|
"pixelSize": 10,
|
||||||
|
"opacity": 1,
|
||||||
|
"outline": true,
|
||||||
|
"outlineColor": "#ffffff",
|
||||||
|
"outlineOpacity": 0.6,
|
||||||
|
"outlineWidth": 2,
|
||||||
|
"scaleByDistance_far": 1000000,
|
||||||
|
"scaleByDistance_farValue": 0.1,
|
||||||
|
"scaleByDistance_near": 1000,
|
||||||
|
"scaleByDistance_nearValue": 1,
|
||||||
|
"distanceDisplayCondition_far": 10000,
|
||||||
|
"visibleDepth": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
popup: [],
|
||||||
|
popupOptions: {
|
||||||
|
showNull: true
|
||||||
|
},
|
||||||
|
flyTo: true
|
||||||
|
})
|
||||||
|
// globalMap.addLayer(drawingGraphicLayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
||||||
const { createConfirm, createMessage } = useMessage();
|
const { createConfirm, createMessage } = useMessage();
|
||||||
|
|
@ -283,22 +500,51 @@
|
||||||
tableName: tableName.value,
|
tableName: tableName.value,
|
||||||
list: [],
|
list: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
for (const key in formState.value) {
|
for (const key in formState.value) {
|
||||||
params.list.push({
|
params.list.push({
|
||||||
name: key,
|
name: key,
|
||||||
value: formState.value[key],
|
value: formState.value[key],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
updateTableData(params).then((res) => {
|
|
||||||
console.log('res', res);
|
|
||||||
if (res) {
|
if(showTable.value == 'edit'){
|
||||||
createMessage.success('编辑成功!');
|
updateTableData(params).then((res) => {
|
||||||
DrawingEnd();
|
console.log('res', res);
|
||||||
showTable.value = '';
|
if (res) {
|
||||||
} else {
|
createMessage.success('编辑成功!');
|
||||||
createMessage.error('编辑失败!');
|
DrawingEnd();
|
||||||
}
|
showTable.value = '';
|
||||||
});
|
} else {
|
||||||
|
createMessage.error('编辑失败!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else if(showTable.value == 'add'){
|
||||||
|
|
||||||
|
params.list = [];
|
||||||
|
|
||||||
|
headData.value?.forEach((item,index)=>{
|
||||||
|
params.list.push({
|
||||||
|
name: item,
|
||||||
|
value: formState.value[item] ? formState.value[item] : null,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
console.log("params",params.list);
|
||||||
|
|
||||||
|
addTableData(params).then((res) => {
|
||||||
|
console.log('res', res);
|
||||||
|
if (res) {
|
||||||
|
createMessage.success('添加成功!');
|
||||||
|
DrawingEnd();
|
||||||
|
showTable.value = '';
|
||||||
|
} else {
|
||||||
|
createMessage.error('添加失败!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch((error: ValidateErrorEntity<FormState>) => {
|
.catch((error: ValidateErrorEntity<FormState>) => {
|
||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
|
|
@ -310,6 +556,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSelect = (record) => {
|
const handleSelect = (record) => {
|
||||||
|
|
||||||
tableName.value = record.tableName;
|
tableName.value = record.tableName;
|
||||||
applicationName.value = record.applicationName;
|
applicationName.value = record.applicationName;
|
||||||
tableVisible.value = true;
|
tableVisible.value = true;
|
||||||
|
|
@ -330,9 +577,21 @@
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const checkedLayer = (e) => {
|
||||||
|
console.log("e",e);
|
||||||
|
handlerLoadLayer(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
const hanlerLoadLayer = () => {
|
||||||
|
|
||||||
|
}
|
||||||
const handleSuccess = () => {
|
const handleSuccess = () => {
|
||||||
treeRef.value.fetch();
|
treeRef.value.fetch();
|
||||||
};
|
};
|
||||||
|
const addData = (type) => {
|
||||||
|
AddDrawingGeometry(globalMap,type);
|
||||||
|
showTable.value = 'add';
|
||||||
|
}
|
||||||
const detailData = ref([]);
|
const detailData = ref([]);
|
||||||
const editData = (record) => {
|
const editData = (record) => {
|
||||||
selectVal.value = record;
|
selectVal.value = record;
|
||||||
|
|
@ -342,6 +601,8 @@
|
||||||
EditDrawingGeometry(globalMap, record.geom);
|
EditDrawingGeometry(globalMap, record.geom);
|
||||||
};
|
};
|
||||||
const viewData = (record) => {
|
const viewData = (record) => {
|
||||||
|
console.log('record', record);
|
||||||
|
PreviewDrawingGeometry(globalMap,record.geom);
|
||||||
selectVal.value = record;
|
selectVal.value = record;
|
||||||
formState.value = record;
|
formState.value = record;
|
||||||
showTable.value = 'detail';
|
showTable.value = 'detail';
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,7 @@ function reload() {
|
||||||
sandbox.contentWindow?.location.reload()
|
sandbox.contentWindow?.location.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
defineExpose({ reload })
|
defineExpose({ reload })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue