Merge branch 'zyl' of http://xny.yj-3d.com:3000/zhouyulong/electron-4 into zyl
This commit is contained in:
2
src/renderer/components.d.ts
vendored
2
src/renderer/components.d.ts
vendored
@ -20,12 +20,10 @@ declare module 'vue' {
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElForm: typeof import('element-plus/es')['ElForm']
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElImage: typeof import('element-plus/es')['ElImage']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
|
||||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElSlider: typeof import('element-plus/es')['ElSlider']
|
||||
|
||||
@ -108,7 +108,7 @@ service.interceptors.response.use(
|
||||
pendingRequests.delete(key)
|
||||
}
|
||||
// 统一错误处理
|
||||
const {response} = error
|
||||
const { response } = error
|
||||
|
||||
if (response) {
|
||||
return Promise.reject(response)
|
||||
|
||||
1
src/renderer/src/icons/svg/closeLeftTs.svg
Normal file
1
src/renderer/src/icons/svg/closeLeftTs.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="12.4248046875" viewBox="0 0 14 12.4248046875" fill="none"><path d="M13.4332 11.2955L0.585683 11.2955C0.283401 11.2955 0.0188816 11.559 0.0188816 11.8602C0.0188816 12.1614 0.283401 12.425 0.585683 12.425L13.4332 12.425C13.7355 12.425 14 12.1614 14 11.8602C14 11.559 13.7355 11.2955 13.4332 11.2955ZM0.585683 1.12955L13.4332 1.12955C13.7355 1.12955 14 0.865991 14 0.564773C14 0.263555 13.7355 0 13.4332 0L0.585683 0C0.283401 0 0.0188816 0.263555 0.0188816 0.564773C0.0188816 0.865991 0.283401 1.12955 0.585683 1.12955ZM3.98649 5.64773C3.68421 5.64773 3.41969 5.91128 3.41969 6.2125C3.41969 6.51372 3.68421 6.77727 3.98649 6.77727L13.0553 6.77727C13.3576 6.77727 13.6221 6.51372 13.6221 6.2125C13.6221 5.91128 13.3576 5.64773 13.0553 5.64773L3.98649 5.64773ZM2.81511 9.26227C2.92847 9.37523 3.07961 9.41287 3.23077 9.41287C3.38193 9.41287 3.53305 9.37523 3.64641 9.26227C3.87313 9.03636 3.87313 8.6975 3.64641 8.47159L1.37921 6.2125L3.60863 3.99105C3.83535 3.76515 3.83535 3.42628 3.60863 3.20037C3.38191 2.97446 3.04183 2.97446 2.81511 3.20037L0.17004 5.83599C-0.0566802 6.0619 -0.0566802 6.40076 0.17004 6.62667L2.81511 9.26227Z" fill="#FFFFFF" ></path></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
1
src/renderer/src/icons/svg/closeRightTs.svg
Normal file
1
src/renderer/src/icons/svg/closeRightTs.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="12.4248046875" viewBox="0 0 14 12.4248046875" fill="none"><path d="M0.566802 11.2955L13.4143 11.2955C13.7166 11.2955 13.9811 11.559 13.9811 11.8602C13.9811 12.1614 13.7166 12.425 13.4143 12.425L0.566802 12.425C0.26452 12.425 0 12.1614 0 11.8602C0 11.559 0.26452 11.2955 0.566802 11.2955ZM13.4143 1.12955L0.566802 1.12955C0.26452 1.12955 0 0.865991 0 0.564773C0 0.263555 0.26452 0 0.566802 0L13.4143 0C13.7166 0 13.9811 0.263555 13.9811 0.564773C13.9811 0.865991 13.7166 1.12955 13.4143 1.12955ZM10.0135 5.64773C10.3158 5.64773 10.5803 5.91128 10.5803 6.2125C10.5803 6.51372 10.3158 6.77727 10.0135 6.77727L0.944681 6.77727C0.642382 6.77727 0.37788 6.51372 0.37788 6.2125C0.37788 5.91128 0.642382 5.64773 0.944681 5.64773L10.0135 5.64773ZM11.1849 9.26227C11.0715 9.37523 10.9204 9.41287 10.7692 9.41287C10.6181 9.41287 10.4669 9.37523 10.3536 9.26227C10.1269 9.03636 10.1269 8.6975 10.3536 8.47159L12.6208 6.2125L10.3914 3.99105C10.1646 3.76515 10.1646 3.42628 10.3914 3.20037C10.6181 2.97446 10.9582 2.97446 11.1849 3.20037L13.83 5.83599C14.0567 6.0619 14.0567 6.40076 13.83 6.62667L11.1849 9.26227Z" fill="#FFFFFF" ></path></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@ -1,32 +1,45 @@
|
||||
<template>
|
||||
<div class="cabin">
|
||||
<div>
|
||||
<span>仿真演练图层指挥舱</span>
|
||||
<div>
|
||||
<div class="miniCabin" :style="!mini?'display:none':''">
|
||||
<div class="switch-node-outer" @click="mini=false">
|
||||
<div class="switch-node-inner">
|
||||
展开指挥舱
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex">
|
||||
<el-input
|
||||
v-model="searchKey"
|
||||
class="responsive-input"
|
||||
placeholder="搜索"
|
||||
:prefix-icon="Search"
|
||||
@input="clearResult"
|
||||
id="keyword"
|
||||
/>
|
||||
<!--@click="searchPlace"-->
|
||||
<!--:loading="loading"-->
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="searchPlace"
|
||||
id="queryButton"
|
||||
>搜索
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="treeBox">
|
||||
<ul id="treeDemos" class="ztree"></ul>
|
||||
<rightMenuTs ref="rightMenuRef" class="absolute zIndex99"></rightMenuTs>
|
||||
<div class="cabin" :style="mini?'display:none':''">
|
||||
<div class="titleBox">
|
||||
<span class="title">仿真演练图层指挥舱</span>
|
||||
<span class="close" @click="mini=true">
|
||||
<svg-icon :size="15" class="icon-svg-item" name="closeRightTs"/>收起
|
||||
</span>
|
||||
</div>
|
||||
<div style="display: flex">
|
||||
<el-input
|
||||
v-model="searchKey"
|
||||
class="responsive-input"
|
||||
placeholder="搜索"
|
||||
:prefix-icon="Search"
|
||||
@input="clearResult"
|
||||
id="keyword"
|
||||
/>
|
||||
<!--@click="searchPlace"-->
|
||||
<!--:loading="loading"-->
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="searchPlace"
|
||||
id="queryButton"
|
||||
>搜索
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="treeBox">
|
||||
<ul id="treeDemos" class="ztree"></ul>
|
||||
<rightMenuTs ref="rightMenuRef" class="absolute zIndex99"></rightMenuTs>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -48,6 +61,7 @@ const treeObj = ref() //树形的实例
|
||||
let zNodes: any = ref([])//树形结构数据
|
||||
let nodes: any = ref([])//选中的node节点
|
||||
let searchKey = ref('')
|
||||
let mini = ref(false)
|
||||
let formData = new FormData()
|
||||
formData.append('id', window["planId"])
|
||||
|
||||
@ -325,8 +339,28 @@ defineExpose({
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.titleBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
padding: 5px 0;
|
||||
//line-height: 34px;
|
||||
}
|
||||
|
||||
.close {
|
||||
&:hover {
|
||||
color: #0ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.treeBox {
|
||||
border: 1px solid red;
|
||||
//border: 1px solid red;
|
||||
flex: auto;
|
||||
|
||||
.ztree {
|
||||
@ -354,4 +388,48 @@ defineExpose({
|
||||
color: #fff;
|
||||
//border: 1px solid #0ff;
|
||||
}
|
||||
|
||||
.miniCabin {
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
right: 0;
|
||||
top: 35%;
|
||||
|
||||
.switch-node-outer {
|
||||
position: relative;
|
||||
|
||||
//width: 30px;
|
||||
clip-path: polygon(0% calc(30px + 3px),
|
||||
100% 0%,
|
||||
100% 100%,
|
||||
0% calc(100% - 30px - 3px));
|
||||
/*clip-path: polygon(0% 0%,
|
||||
100% calc(30px + 3px),
|
||||
100% calc(100% - 30px - 3px),
|
||||
0% 100%);*/
|
||||
//clip-path: polygon(0% 0%, 100% 33px, 100% calc(100% - 33px), 0% 100%);
|
||||
padding: calc(3px * 1.42) 3px;
|
||||
//padding: 4.6px 3px;
|
||||
background: #0ff;
|
||||
|
||||
.switch-node-inner {
|
||||
clip-path: polygon(0% 30px,
|
||||
100% 3px,
|
||||
100% calc(100% - 3px),
|
||||
0% calc(100% - 30px));
|
||||
//clip-path: polygon(0% 3px, 100% 30px, 100% calc(100% - 30px), 0% calc(100% - 3px));
|
||||
cursor: pointer;
|
||||
writing-mode: vertical-lr;
|
||||
padding: calc(30px * 1.1) 0;
|
||||
width: 30px;
|
||||
line-height: 30px;
|
||||
background: linear-gradient(to right, rgba(0, 255, 255, 0.3) 0%, rgba(0, 255, 255, 0) 100%), rgba(0, 0, 0, 0.8);
|
||||
color: #0ff;
|
||||
letter-spacing: 2.5px;
|
||||
/* border: 1.5px solid rgba(0, 255, 255, 1); */
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -91,8 +91,11 @@ let getWidth = (durationTime) => {
|
||||
// 6. 让 progressStyle 间接依赖 refreshKey(通过 getWidth)
|
||||
let progressStyle = (task) => {
|
||||
let taskLeft = task.startTime - window['tsObj']._Store._startTimestamp;
|
||||
let width = 1
|
||||
if (!['display', 'hide'].includes(task.callback))
|
||||
width = getWidth(task.duration_time) * 1000
|
||||
let style: any = {
|
||||
width: getWidth(task.duration_time) * 1000 + "px",
|
||||
width: width + "px",
|
||||
left: getWidth(taskLeft) + "px",
|
||||
};
|
||||
if (task.id == selectedEventId.value) {
|
||||
|
||||
@ -92,6 +92,8 @@ import {ElPopover} from 'element-plus'; // 确保导入ElPopover(按需导入
|
||||
// import {dragElement} from "./util/drag.js";
|
||||
import dragLeftRight from './util/dragLeftRight.js';
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
|
||||
const instance = getCurrentInstance();
|
||||
if (instance) {
|
||||
// 2. 注册局部指令(kebab-case 命名,与模板中一致)
|
||||
@ -227,16 +229,27 @@ function todoEvent(timeId: number, res: any, isEnd: boolean) {
|
||||
console.log("执行事件对象", res, '1111111111111111111111111111');
|
||||
window['did_ts_Arr'].push(res.id)
|
||||
switch (res.callback) {
|
||||
case 'flicker':
|
||||
let tsEntity = (window as any)._entityMap.get(res.sourceId);
|
||||
tsEntity.flicker(Number(res.detail.times) * 1000, Number(res.detail.numbers))
|
||||
break;
|
||||
/* case 'flicker':
|
||||
let tsEntity = (window as any)._entityMap.get(res.sourceId);
|
||||
tsEntity.flicker(Number(res.detail.times) * 1000, Number(res.detail.numbers))
|
||||
break;*/
|
||||
case 'move':
|
||||
let TrajectoryMotionObject = (window as any)._entityMap.get(res.id + res.callback + res.sourceId);
|
||||
|
||||
TrajectoryMotionObject.speed = TrajectoryMotionObject.oldSpeed * props.TSOBJ._Store._multiplier
|
||||
TrajectoryMotionObject.state = true
|
||||
break
|
||||
default:
|
||||
//新增0918
|
||||
let tsEntity = window['_entityMap'].get(res.sourceId);
|
||||
if (tsEntity && typeof tsEntity[res.callback] == "function") {
|
||||
if (res.callback == "flicker") {
|
||||
let detail = res.detail;
|
||||
typeof detail == "string" && (detail = JSON.parse(detail));
|
||||
tsEntity[res.callback](detail.times * 1000 / props.TSOBJ._Store._multiplier, detail.numbers);
|
||||
} else tsEntity[res.callback]();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -271,11 +284,46 @@ let eventCallback = () => {
|
||||
fun(dataMap)
|
||||
}
|
||||
// 拖拽时间指示器预览
|
||||
let timing = () => {
|
||||
console.log("拖拽时间指示器预览")
|
||||
}
|
||||
const handleDrag = (newLeft: number) => {
|
||||
console.log("handleDrag", newLeft)
|
||||
// console.log("handleDrag", newLeft)
|
||||
let {cursorLeft, scrollLeft, preSecondPx} = window['tsObj']._Store._scales
|
||||
console.log("_currentTimestamp", window['tsObj']._Store._currentTimestamp)
|
||||
|
||||
let offset = cursorLeft + scrollLeft
|
||||
let currentTimeStamp = (offset / preSecondPx) * 1000 + window['tsObj']._Store._startTimestamp
|
||||
window['tsObj']._Store.currentTimestamp = Number(parseInt(String(currentTimeStamp / 1000))) * 1000
|
||||
|
||||
/*let timeInput = $(".timePicker .el-input__inner")
|
||||
if (timeInput && timeInput[0])
|
||||
timeInput[0]['value'] = formatTime(window['tsObj']._Store._currentTimestamp)*/
|
||||
|
||||
eventBus.emit('event-startTime', window['tsObj']._Store._currentTimestamp)
|
||||
|
||||
let currentTasks = window['tsObj']._Store.getTaskInStamp()
|
||||
// console.log(currentTasks)
|
||||
currentTasks.forEach(task => {
|
||||
switch (task.callback) {
|
||||
case 'move':
|
||||
let TrajectoryMotionObject = window['_entityMap'].get(task.id + task.callback + task.sourceId);
|
||||
let tsEntitys = window['_entityMap'].get(task.sourceId);
|
||||
tsEntitys.show = true
|
||||
// TrajectoryMotionObject.speed = TrajectoryMotionObject.oldSpeed
|
||||
TrajectoryMotionObject.setMovePositionByTime((window['tsObj']._Store._currentTimestamp - task.startTime) / 1000)
|
||||
break;
|
||||
default:
|
||||
//新增0918
|
||||
let tsEntity = window['_entityMap'].get(task.sourceId);
|
||||
if (tsEntity && typeof tsEntity[task.callback] == "function") {
|
||||
if (task.callback == "flicker") {
|
||||
/* let detail = task.detail;
|
||||
typeof detail == "string" && (detail = JSON.parse(detail));
|
||||
tsEntity[task.callback](detail.times / window['tsObj']._Store._multiplier, detail.numbers);*/
|
||||
tsEntity[task.callback](1, 1)
|
||||
} else tsEntity[task.callback]();
|
||||
}
|
||||
break;
|
||||
}
|
||||
})
|
||||
// cursorLeft.value = newLeft;
|
||||
// 同步到Store(如果需要保存拖拽后的位置到全局状态)
|
||||
// props.TSOBJ._Store.setScale('cursorLeft', newLeft);
|
||||
|
||||
@ -121,6 +121,7 @@ import {TS} from "./sdk";
|
||||
import * as domain from "domain";
|
||||
import {TsApi} from "../../api/ts";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {addMapSource} from "../../common/addMapSource";
|
||||
|
||||
const isShowPup = ref(false)
|
||||
const des_detail = ref("")
|
||||
@ -248,6 +249,32 @@ onMounted(async () => {
|
||||
})
|
||||
const createEarth = async () => {
|
||||
(window as any).earth_ts = await new YJ.YJEarth('earthContainer', {navigationHelpButton: false})
|
||||
let openRightClick = await new YJ.Global.openRightClick(window.earth_ts)
|
||||
/*YJ.Global.MouseRightMenu(window.earth_ts, true, (text, object) => {
|
||||
switch (text) {
|
||||
case 'rotateAround':
|
||||
YJ.Global.rotateAround(window.earth_ts, object.position)
|
||||
break
|
||||
case 'textBox':
|
||||
let id = new YJ.Tools().randomString()
|
||||
let name = '文本框'
|
||||
addMapSource({
|
||||
type: 'textBox',
|
||||
id: id,
|
||||
sourceName: name,
|
||||
opt: {
|
||||
id: id,
|
||||
position: object.position
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'attribute':
|
||||
let node = window.treeObj.getNodeByParam('id', object.id, null)
|
||||
// rightMenus.edit.callback(eventBus, node)
|
||||
break
|
||||
}
|
||||
})*/
|
||||
|
||||
YJ.Global.CesiumContainer((window as any).earth_ts, {compass: false, legend: false});
|
||||
setTimeout(() => {
|
||||
new YJ.Tools((window as any).earth_ts).flyHome()
|
||||
|
||||
@ -1,53 +1,66 @@
|
||||
<template>
|
||||
<div class="element">
|
||||
<div class="title">
|
||||
<span>元素库</span>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<el-input
|
||||
v-model="input2"
|
||||
class="responsive-input"
|
||||
placeholder="搜索"
|
||||
:prefix-icon="Search"
|
||||
/>
|
||||
</div>-->
|
||||
<div class="tabsBox">
|
||||
<div class="tabs">
|
||||
<div v-for="(item,index) in tabs" @click="handleTabClick(item,index)" :class="index==activIndex?'active':''">
|
||||
{{ item.name }}
|
||||
<div>
|
||||
<div class="miniElement" :style="!mini?'display:none':''">
|
||||
<div class="switch-node-outer" @click="mini=false">
|
||||
<div class="switch-node-inner">
|
||||
展开元素库
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div class="treeOrList" :style="currentTypeId!=''?'height: calc(100% - 300px);':''">
|
||||
<template v-if="dataType=='tree'">
|
||||
<el-tree
|
||||
:data="treeData"
|
||||
:props="defaultProps"
|
||||
@node-click="handleNodeClick"
|
||||
</div>
|
||||
<div class="element" :style="mini?'display:none':''">
|
||||
<div class="titleBox">
|
||||
<span class="title">元素库</span>
|
||||
<span class="close" @click="mini=true">
|
||||
<svg-icon :size="15" class="icon-svg-item" name="closeLeftTs"/>收起
|
||||
</span>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<el-input
|
||||
v-model="input2"
|
||||
class="responsive-input"
|
||||
placeholder="搜索"
|
||||
:prefix-icon="Search"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="dataType=='list'">
|
||||
<div v-for="item in lists" @click="addMarker(item)" class="markerItem">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div>-->
|
||||
<div class="tabsBox">
|
||||
<div class="tabs">
|
||||
<div v-for="(item,index) in tabs" @click="handleTabClick(item,index)" :class="index==activIndex?'active':''">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="list" v-if="currentTypeId!=''">
|
||||
<div v-for="item in elementList" class="itemBox" @click="addMarker(item)">
|
||||
<div class="imgbg">
|
||||
<img :src="service + (item.posterDataUrl||item.militaryDataUrl)"/>
|
||||
</div>
|
||||
<!--fit="contain"-->
|
||||
<div class="panel">
|
||||
<div class="treeOrList" :style="currentTypeId!=''?'height: calc(100% - 300px);':''">
|
||||
<template v-if="dataType=='tree'">
|
||||
<el-tree
|
||||
:data="treeData"
|
||||
:props="defaultProps"
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="dataType=='list'">
|
||||
<div v-for="item in lists" @click="addMarker(item)" class="markerItem">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="label">
|
||||
{{ item.modelName || item.militaryName }}
|
||||
</div>
|
||||
<div class="list" v-if="currentTypeId!=''">
|
||||
<div v-for="item in elementList" class="itemBox" @click="addMarker(item)">
|
||||
<div class="imgbg">
|
||||
<img :src="service + (item.posterDataUrl||item.militaryDataUrl)"/>
|
||||
</div>
|
||||
<!--fit="contain"-->
|
||||
|
||||
<div class="label">
|
||||
{{ item.modelName || item.militaryName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@ -62,6 +75,7 @@ import {useTreeNode} from "../components/tree/hooks/treeNode";
|
||||
|
||||
const {getSelectedNodes} = useTreeNode()
|
||||
const service = ref(localStorage.getItem('ip'))
|
||||
let mini = ref(false)
|
||||
|
||||
interface Tree {
|
||||
name: string
|
||||
@ -226,9 +240,23 @@ let addMarker = (item) => {
|
||||
padding: 0 5px;
|
||||
//display: flex;
|
||||
//flex-direction: column;
|
||||
.title {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
.titleBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
padding: 5px 0;
|
||||
//line-height: 34px;
|
||||
}
|
||||
|
||||
.close {
|
||||
&:hover {
|
||||
color: #0ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabsBox {
|
||||
@ -359,4 +387,39 @@ let addMarker = (item) => {
|
||||
:deep(.el-text ) {
|
||||
--el-text-color: #fff !important;
|
||||
}
|
||||
|
||||
.miniElement {
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
left: 0;
|
||||
top: 35%;
|
||||
|
||||
.switch-node-outer {
|
||||
position: relative;
|
||||
clip-path: polygon(0% 0%,
|
||||
100% calc(30px + 3px),
|
||||
100% calc(100% - 30px - 3px),
|
||||
0% 100%);
|
||||
padding: calc(3px * 1.42) 3px;
|
||||
background: #0ff;
|
||||
|
||||
.switch-node-inner {
|
||||
clip-path: polygon(0% 3px,
|
||||
100% 30px,
|
||||
100% calc(100% - 30px),
|
||||
0% calc(100% - 3px));
|
||||
cursor: pointer;
|
||||
writing-mode: vertical-lr;
|
||||
padding: calc(30px * 1.1) 0;
|
||||
width: 30px;
|
||||
line-height: 30px;
|
||||
background: linear-gradient(to right, rgba(0, 255, 255, 0.3) 0%, rgba(0, 255, 255, 0) 100%), rgba(0, 0, 0, 0.8);
|
||||
color: #0ff;
|
||||
letter-spacing: 2.5px;
|
||||
/* border: 1.5px solid rgba(0, 255, 255, 1); */
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import {TsApi} from "../../api/ts";
|
||||
import {useTreeNode} from '@/views/components/tree/hooks/treeNode'
|
||||
import {rightClick} from "../components/tree/entityClick";
|
||||
|
||||
const {cusAddNodes, getSelectedNode} = useTreeNode()
|
||||
|
||||
@ -67,6 +68,15 @@ export function initMapData(type, data, cb: any = null) {
|
||||
TrajectoryMotionObject.moveCallBack(tsEntitys);*/
|
||||
|
||||
}
|
||||
//鼠标右键点击事件
|
||||
entityObject.onRightClick = () => {
|
||||
// rightClick(getOptions());
|
||||
console.log("鼠标右键点击事件")
|
||||
let id = options.id;
|
||||
let node = window.treeObj.getNodeByParam("id", id, null);
|
||||
if (node) window.treeObj.selectNode(node);
|
||||
YJ.Global.splitScreen.setActiveId([id]);
|
||||
};
|
||||
return options
|
||||
|
||||
} else return null
|
||||
|
||||
@ -67,9 +67,9 @@
|
||||
{{ scope.row.desc }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="createdBy" label="创建人" sortable/>
|
||||
<el-table-column align="center" prop="createdAt" label="创建日期" sortable/>
|
||||
<el-table-column align="center" label="操作">
|
||||
<el-table-column align="center" prop="createdBy" label="创建人" sortable width="240"/>
|
||||
<el-table-column align="center" prop="createdAt" label="创建日期" sortable width="180"/>
|
||||
<el-table-column align="center" label="操作" width="160">
|
||||
<template #default="scope">
|
||||
|
||||
<!--<el-button text size="small" type="primary" :icon="Edit" @click="toTSEdit(scope.row)">编辑</el-button>-->
|
||||
@ -88,9 +88,10 @@
|
||||
</template>
|
||||
</el-popconfirm>-->
|
||||
|
||||
<div>
|
||||
<Edit style="width: 16px; height: 16px; " @click="toTSEdit(scope.row)"></Edit>
|
||||
<Delete style="width: 16px; height: 16px;" @click="delPlanBtn(scope.row.id)"/>
|
||||
<div style="display: flex;justify-content: space-evenly">
|
||||
<Edit style="width: 16px; height: 16px; cursor:pointer;" @click="toTSEdit(scope.row)"></Edit>
|
||||
<Warning style="width: 16px; height: 16px; cursor:pointer; "></Warning>
|
||||
<Delete style="width: 16px; height: 16px; cursor:pointer;" @click="delPlanBtn(scope.row.id)"/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -125,7 +126,7 @@
|
||||
<script setup lang="ts">
|
||||
import {ref, onUnmounted} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {Delete, Edit, CirclePlus, Download, Upload} from '@element-plus/icons-vue'
|
||||
import {Delete, Edit, Warning, CirclePlus, Download, Upload} from '@element-plus/icons-vue'
|
||||
import {ElMessage, ElMessageBox, TableV2SortOrder} from 'element-plus'
|
||||
import type {SortBy} from 'element-plus'
|
||||
import {TsApi} from "../../api/ts";
|
||||
|
||||
@ -33,36 +33,33 @@
|
||||
v-model="form.datetime"
|
||||
type="datetime"
|
||||
placeholder="选择触发时间"
|
||||
class="timePicker"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="持续时间">
|
||||
<div class="duration">
|
||||
<span>
|
||||
<el-input v-model="hour"/>时
|
||||
</span>
|
||||
<span>
|
||||
<el-input v-model="minute"/>分
|
||||
</span><span>
|
||||
<el-input v-model="second"/>秒
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
</el-form-item>
|
||||
<template v-if="currentKey=='flicker'">
|
||||
<el-form-item label="闪烁间隔">
|
||||
<template v-if="!['display','hide'].includes(currentKey)">
|
||||
<el-form-item label="持续时间">
|
||||
<div class="duration">
|
||||
<span>
|
||||
<el-input v-model="times"/>秒
|
||||
</span>
|
||||
<span><el-input v-model="hour"/>时</span>
|
||||
<span><el-input v-model="minute"/>分 </span>
|
||||
<span><el-input v-model="second"/>秒</span>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-if="currentKey=='flicker'">
|
||||
<!-- <el-form-item label="闪烁间隔">
|
||||
<div class="duration">
|
||||
<span>
|
||||
<el-input v-model="times"/>秒
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</el-form-item>-->
|
||||
<el-form-item label="闪烁次数">
|
||||
<div class="duration">
|
||||
<span>
|
||||
<el-input v-model="numbers"/>次
|
||||
</span>
|
||||
<span>
|
||||
<el-input v-model="numbers"/>次
|
||||
</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@ -74,14 +71,12 @@
|
||||
</template>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<div class="optionbtn">
|
||||
<el-button @click="addEvent">确定</el-button>
|
||||
<el-button @click="isShowPup=false">取消</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<div class="optionbtn">
|
||||
<el-button @click="addEvent">确定</el-button>
|
||||
<el-button @click="isShowPup=false">取消</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="placeholder"></div>
|
||||
@ -115,7 +110,7 @@ const zNode = ref({})
|
||||
const hour = ref(0)
|
||||
const minute = ref(0)
|
||||
const second = ref(0)
|
||||
const times = ref(0)//闪烁间隔
|
||||
const times = ref(1)//闪烁间隔
|
||||
const numbers = ref(0)//闪烁次数
|
||||
|
||||
const isContainModelPosition = ref(true)
|
||||
@ -129,6 +124,16 @@ const eventTree: { children: ({ label: string } | { label: string })[]; id: stri
|
||||
id: "normal",
|
||||
label: '常用推演事件',
|
||||
children: [
|
||||
{
|
||||
id: "display",
|
||||
label: '显示事件',
|
||||
name: '显示'
|
||||
},
|
||||
{
|
||||
id: "hide",
|
||||
label: '隐藏事件',
|
||||
name: '隐藏'
|
||||
},
|
||||
{
|
||||
id: "flicker",
|
||||
label: '闪烁事件',
|
||||
@ -205,8 +210,7 @@ const addEvent = () => {
|
||||
endTime: startTime + duration_S * 1000,
|
||||
"detail": JSON.stringify(obj)
|
||||
}
|
||||
console.log(obj)
|
||||
|
||||
console.log("dbParams", dbParams)
|
||||
TsApi.addTsEvent(dbParams).then(res => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
@ -239,7 +243,7 @@ const reset = () => {
|
||||
minute.value = 0
|
||||
second.value = 0
|
||||
numbers.value = 0
|
||||
times.value = 0
|
||||
times.value = 1
|
||||
form = {
|
||||
name: '闪烁-',
|
||||
// datetime: '',
|
||||
@ -260,6 +264,9 @@ eventBus.on('openAddEvent', (data, cb, type) => {
|
||||
// getSetting()
|
||||
// }
|
||||
})
|
||||
eventBus.on('event-startTime', (data) => {
|
||||
form['datetime'] = new Date(data)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -303,7 +310,7 @@ eventBus.on('openAddEvent', (data, cb, type) => {
|
||||
|
||||
.set_detail {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
height: calc(100% - 64px);
|
||||
|
||||
.sort {
|
||||
height: 100%;
|
||||
@ -327,6 +334,9 @@ eventBus.on('openAddEvent', (data, cb, type) => {
|
||||
//flex: auto;
|
||||
width: calc(100% - 170px);
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
:deep(.el-input ) {
|
||||
--el-date-editor-width: 100%;
|
||||
@ -363,7 +373,7 @@ eventBus.on('openAddEvent', (data, cb, type) => {
|
||||
}
|
||||
|
||||
.optionbtn {
|
||||
margin: 0 auto;
|
||||
margin: 5px auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -169,7 +169,9 @@ export class Store {
|
||||
}
|
||||
|
||||
set currentTimestamp(val) {
|
||||
console.log("currentTimestamp", val)
|
||||
this._currentTimestamp = val
|
||||
window['updateProp']("currentStamp", val)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -21,11 +21,12 @@ export default {
|
||||
event.preventDefault();
|
||||
currentX = event.pageX - startX;
|
||||
currentY = event.pageY - startY;
|
||||
// drag(event, el)
|
||||
drag(event, el)
|
||||
};
|
||||
|
||||
// 鼠标松开事件
|
||||
const handleMouseup = () => {
|
||||
window['tsObj']._Store.setCursorLeft(window['tsObj']._Store._currentTimestamp)
|
||||
document.removeEventListener("mousemove", handleMousemove);
|
||||
document.removeEventListener("mouseup", handleMouseup);
|
||||
clearInterval(window.intervalID)
|
||||
@ -45,9 +46,52 @@ export default {
|
||||
function drag(event, el) {
|
||||
let newX = currentX + startX - (window['tsObj']._Store._scales.gridWidth || 400)
|
||||
let isSide = (newX > window['tsObj']._Store._panelWidth - 50) || (newX < 50)
|
||||
console.log("isSide", isSide)
|
||||
console.log("newX", newX)
|
||||
// console.log("isSide", isSide)
|
||||
// console.log("newX", newX)
|
||||
if (isSide) {
|
||||
if (window.intervalID)
|
||||
return
|
||||
if (newX <= 0) {
|
||||
newX = 0
|
||||
window['tsObj']._Store.setScale("cursorLeft", newX)
|
||||
} else if (newX < 50) {
|
||||
if (window['tsObj']._Store._scales.scrollLeft == 0) {
|
||||
window['tsObj']._Store.setScale("cursorLeft", newX)
|
||||
clearInterval(window.intervalID);
|
||||
window.intervalID = null
|
||||
} else {
|
||||
window.intervalID = setInterval(() => {
|
||||
let newLeft = window['tsObj']._Store._scales.scrollLeft - 1;
|
||||
let finalX = newLeft
|
||||
if (newLeft < 0)
|
||||
finalX = 0
|
||||
window['tsObj']._Store.setScale("scrollLeft", finalX)
|
||||
}, 10)
|
||||
}
|
||||
} else if (newX + window['tsObj']._Store._scales.scrollLeft >= window['tsObj']._Store._scales.fullWidth) {
|
||||
newX = window['tsObj']._Store._panelWidth
|
||||
window['tsObj']._Store.setScale("cursorLeft", newX)
|
||||
} else {
|
||||
let maxScroll = window['tsObj']._Store._scales.fullWidth - window['tsObj']._Store._panelWidth
|
||||
if (window['tsObj']._Store._scales.scrollLeft == maxScroll) {
|
||||
window['tsObj']._Store.setScale("cursorLeft", newX)
|
||||
clearInterval(window.intervalID);
|
||||
window.intervalID = null
|
||||
} else {
|
||||
window['intervalID'] = setInterval(() => {
|
||||
// console.log("intervalID",intervalID)
|
||||
let newLeft = window['tsObj']._Store._scales.scrollLeft + 1;
|
||||
let finalX = newLeft
|
||||
if (newLeft >= maxScroll) {
|
||||
window['tsObj']._Store.setScale("cursorLeft", newX)
|
||||
clearInterval(window.intervalID);
|
||||
window.intervalID = null
|
||||
finalX = maxScroll
|
||||
}
|
||||
window['tsObj']._Store.setScale("scrollLeft", finalX)
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
clearInterval(window.intervalID)
|
||||
window.intervalID = null
|
||||
|
||||
@ -38,28 +38,31 @@
|
||||
</div>
|
||||
<div class="file_name">
|
||||
<span>{{ item.name }}</span>
|
||||
<span>{{ item.createdAt }}</span>
|
||||
<span class="pdfPath" :title="item.path">{{ item.path }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item_right">
|
||||
<span v-if="item.isEnable">已启用</span>
|
||||
<span style="color: rgba(var(--color-text2), 1)">{{ item.createdAt }}</span>
|
||||
<div class="but">
|
||||
<span v-if="item.isEnable">已启用</span>
|
||||
|
||||
<el-button
|
||||
v-if="!item.isEnable"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="enableRouteData(item)"
|
||||
>
|
||||
<span>启用</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!item.isEnable"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="delRouteData(item)"
|
||||
>
|
||||
<span>删除</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!item.isEnable"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="enableRouteData(item)"
|
||||
>
|
||||
<span>启用</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!item.isEnable"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="delRouteData(item)"
|
||||
>
|
||||
<span>删除</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -91,28 +94,32 @@
|
||||
</div>
|
||||
<div class="file_name">
|
||||
<span>{{ item.name }}</span>
|
||||
<span>{{ item.createdAt }}</span>
|
||||
<!-- <span>{{ item.createdAt }}</span> -->
|
||||
<span class="pdfPath" :title="item.path">{{ item.path }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item_right">
|
||||
<span v-if="item.isEnable">已启用</span>
|
||||
<span style="color: rgba(var(--color-text2), 1)">{{ item.createdAt }}</span>
|
||||
<div class="but">
|
||||
<span v-if="item.isEnable">已启用</span>
|
||||
|
||||
<el-button
|
||||
v-if="!item.isEnable"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="enablePoieData(item)"
|
||||
>
|
||||
<span>启用</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!item.isEnable"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="delPoiData(item)"
|
||||
>
|
||||
<span>删除</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!item.isEnable"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="enablePoieData(item)"
|
||||
>
|
||||
<span>启用</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!item.isEnable"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="delPoiData(item)"
|
||||
>
|
||||
<span>删除</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -242,6 +249,10 @@ const poiImport = () => {
|
||||
if (res.code === 200) {
|
||||
PoiApi.getPoiList().then((list) => {
|
||||
poiList.splice(0, poiList.length, ...list.data)
|
||||
poiList.map((item) => {
|
||||
let arr = item.path.split('/')
|
||||
item.name = arr[arr.length - 1]
|
||||
})
|
||||
//只有一个poi时默认启用
|
||||
if (poiList.length == 1) {
|
||||
let formData = new FormData()
|
||||
@ -390,6 +401,10 @@ var routeList: any = reactive([])
|
||||
const getList = async () => {
|
||||
let list = await RouteApi.getRouteList()
|
||||
routeList.splice(0, routeList.length, ...list.data)
|
||||
routeList.map((item) => {
|
||||
let arr = item.path.split('/')
|
||||
item.name = arr[arr.length - 1]
|
||||
})
|
||||
}
|
||||
getList()
|
||||
|
||||
@ -398,6 +413,10 @@ var poiList: any = reactive([])
|
||||
const getPoiList = async () => {
|
||||
let list = await PoiApi.getPoiList()
|
||||
poiList.splice(0, poiList.length, ...list.data)
|
||||
poiList.map((item) => {
|
||||
let arr = item.path.split('/')
|
||||
item.name = arr[arr.length - 1]
|
||||
})
|
||||
}
|
||||
getPoiList()
|
||||
|
||||
@ -680,7 +699,7 @@ function derive() {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
line-height: 32px; // padding: 20px 0;
|
||||
padding: 0 0 20px 0;
|
||||
padding: 0 0 15px 0;
|
||||
.fankuai {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
@ -723,10 +742,10 @@ function derive() {
|
||||
.fileList {
|
||||
width: 100%;
|
||||
// height: 20vh;
|
||||
max-height: 20vh;
|
||||
max-height: 15vh;
|
||||
box-sizing: border-box;
|
||||
padding: 0 0 20px 0;
|
||||
|
||||
// padding: 0 0 16px 0;
|
||||
overflow-y: auto;
|
||||
.fileList_nav {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@ -734,7 +753,7 @@ function derive() {
|
||||
overflow-y: auto; /* 垂直方向超出时显示滚动条 */
|
||||
.fileList_nav_item {
|
||||
width: 100%;
|
||||
height: 8vh;
|
||||
height: 7vh;
|
||||
// background-color: aqua;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
@ -759,28 +778,57 @@ function derive() {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 10px;
|
||||
width: calc(100% - 45px);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 滚动条优化
|
||||
.fileList_nav::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
}
|
||||
// .fileList::-webkit-scrollbar {
|
||||
// width: 5px;
|
||||
// height: 5px;
|
||||
// }
|
||||
|
||||
.fileList_nav::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(var(--color-base1), 1);
|
||||
border-radius: 5px;
|
||||
}
|
||||
// .fileList::-webkit-scrollbar-thumb {
|
||||
// background-color: rgba(var(--color-base1), 1);
|
||||
// border-radius: 5px;
|
||||
// }
|
||||
|
||||
.fileList_nav::-webkit-scrollbar-track {
|
||||
background-color: rgba(var(--color-base1), 0.2);
|
||||
}
|
||||
// .fileList::-webkit-scrollbar-track {
|
||||
// background-color: rgba(var(--color-base1), 0.2);
|
||||
// }
|
||||
}
|
||||
// 滚动条优化
|
||||
.fileList::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
.fileList::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(var(--color-base1), 1);
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.fileList::-webkit-scrollbar-track {
|
||||
background-color: rgba(var(--color-base1), 0.2);
|
||||
}
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: rgba(204, 204, 204, 0.2);
|
||||
}
|
||||
.pdfPath {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: rgba(var(--color-text2), 1);
|
||||
}
|
||||
.but {
|
||||
display: inline-block;
|
||||
width: 140px;
|
||||
text-align: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -147,9 +147,20 @@ const getTableList = async () => {
|
||||
}
|
||||
|
||||
getTableList()
|
||||
|
||||
eventBus.on('addOptionResuit', () => {
|
||||
let func = () => {
|
||||
console.log('111111')
|
||||
getTableList()
|
||||
}
|
||||
// eventBus.on('addOptionResuit', () => {
|
||||
// console.log('111111')
|
||||
// getTableList()
|
||||
// })
|
||||
|
||||
onMounted(() => {
|
||||
eventBus.on('addOptionResuit', func)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
eventBus.off('addOptionResuit', func)
|
||||
})
|
||||
|
||||
//------------------添加--------------------
|
||||
@ -232,7 +243,6 @@ const attachUpload = async () => {
|
||||
const params = new URLSearchParams()
|
||||
params.append('filePath', path[0])
|
||||
deviceApi.uploadSingle(params).then((res) => {
|
||||
console.log(res, 'res')
|
||||
ElMessage.success('导入成功')
|
||||
getTableList()
|
||||
})
|
||||
|
||||
@ -23,10 +23,16 @@
|
||||
</div>
|
||||
|
||||
<div class="nav_table">
|
||||
<el-table :data="tableData" height="40vh" style="width: 100%">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
height="40vh"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="num" label="总计数量" width="120" />
|
||||
<el-table-column prop="num" label="总计数量" />
|
||||
<el-table-column prop="unit" label="单位" />
|
||||
<el-table-column fixed="right" label="操作" width="160">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" @click="edit('编辑物资', scope.row)">
|
||||
@ -116,9 +122,15 @@ const getTableList = async () => {
|
||||
}
|
||||
|
||||
getTableList()
|
||||
|
||||
eventBus.on('addOptionResuit2', () => {
|
||||
let func = () => {
|
||||
getTableList()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
eventBus.on('addOptionResuit2', func)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
eventBus.off('addOptionResuit2', func)
|
||||
})
|
||||
|
||||
//------------------添加--------------------
|
||||
@ -144,7 +156,7 @@ var edit = (type, row) => {
|
||||
addForm = JSON.parse(JSON.stringify(row))
|
||||
// addForm.areaId = +row.areaId
|
||||
}
|
||||
eventBus.emit('openAddMaterial', { title: type, data: addForm })
|
||||
eventBus.emit('openAddMaterial', { title: row ? 'edit' : 'add', data: addForm })
|
||||
}
|
||||
|
||||
var delFun = (row) => {
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
</el-button>
|
||||
</div>
|
||||
<el-input
|
||||
v-model="photoName"
|
||||
v-model.trim="photoName"
|
||||
style="max-width: 150px"
|
||||
placeholder="请输入模型名称进行搜索"
|
||||
class="input-with-select"
|
||||
@ -97,7 +97,7 @@
|
||||
<template #default="{ row }">
|
||||
<el-image
|
||||
style="width: 80px; height: 60px"
|
||||
:src="service + row.posterDataUrl"
|
||||
:src="service + row.posterDataUrl + '?t=' + row.updatedAt"
|
||||
fit="contain"
|
||||
/>
|
||||
</template>
|
||||
@ -132,7 +132,7 @@
|
||||
|
||||
<!-- 添加类型弹窗 -->
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="30%" :before-close="handleClose">
|
||||
<el-input v-model="modelType" placeholder="请输入模型类型名称" />
|
||||
<el-input v-model.trim="modelType" placeholder="请输入模型类型名称" />
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
@ -522,7 +522,9 @@ const toggleExpand = (row: any) => {
|
||||
// loadModelsByType(row.id)
|
||||
contextMenu.visible && (contextMenu.visible = false)
|
||||
}
|
||||
let clickTypeId = null //存储点击数据,用来删除时更新右侧列表
|
||||
const getModelListByType = (id) => {
|
||||
clickTypeId = id
|
||||
let formData = new FormData()
|
||||
formData.append('modelTypeId', id)
|
||||
ModelApi.showModelByType(formData).then((res) => {
|
||||
@ -624,11 +626,16 @@ const handleDeleteType = (row: TypeNode) => {
|
||||
})
|
||||
.then(() => {
|
||||
let formData = new FormData()
|
||||
|
||||
formData.append('modelTypeId', row.id)
|
||||
ModelApi.delModelType(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('删除成功')
|
||||
getModelList()
|
||||
//如果删除当前选中数据 清空右侧列表
|
||||
if (row.id === clickTypeId) {
|
||||
modelList.value = []
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@ -146,6 +146,7 @@ var submitProtal = () => {
|
||||
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('操作成功')
|
||||
console.log('ccccccccc')
|
||||
eventBus.emit('addOptionResuit')
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -9,15 +9,18 @@
|
||||
>
|
||||
<template #content>
|
||||
<el-form
|
||||
label-width="0px"
|
||||
label-width="80px"
|
||||
style="width: 300px"
|
||||
:model="addForm"
|
||||
:rules="peopleRules"
|
||||
ref="peopleFormRef"
|
||||
>
|
||||
<el-form-item label="" prop="name">
|
||||
<el-form-item label="物资名称" prop="name">
|
||||
<el-input v-model.trim="addForm.name" placeholder="请输入物资名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="物资单位" prop="unit">
|
||||
<el-input v-model.trim="addForm.unit" placeholder="请输入物资单位" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<template #footer>
|
||||
@ -46,11 +49,13 @@ var addTitle = ref('')
|
||||
var peopleFormRef: any = ref('')
|
||||
|
||||
var addForm: any = ref({
|
||||
name: ''
|
||||
name: '',
|
||||
unit: ''
|
||||
})
|
||||
|
||||
const peopleRules: any = reactive({
|
||||
name: [{ required: true, message: '请输入名称', trigger: 'blur' }]
|
||||
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||
unit: [{ required: true, message: '请输入单位', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
var cancel = () => {
|
||||
@ -68,12 +73,14 @@ var submitProtal = () => {
|
||||
const res = await MaterialApi.add(addForm.value)
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('操作成功')
|
||||
console.log('aaaaaaaaaaaaa')
|
||||
eventBus.emit('addOptionResuit2')
|
||||
}
|
||||
} else {
|
||||
const res = await MaterialApi.update(addForm.value)
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('操作成功')
|
||||
console.log('bbbbbbbbbbbb')
|
||||
eventBus.emit('addOptionResuit2')
|
||||
}
|
||||
}
|
||||
@ -87,13 +94,15 @@ var submitProtal = () => {
|
||||
}
|
||||
eventBus.on('openAddMaterial', (params) => {
|
||||
console.log(params, 'iuiuuiuiu')
|
||||
addTitle.value = params.title
|
||||
if (addTitle.value != '添加物资') {
|
||||
addTitle.value = params.title == 'add' ? '添加物资' : '修改物资'
|
||||
if (params.title == 'edit') {
|
||||
addForm.value.name = params.data.name
|
||||
addForm.value.unit = params.data.unit
|
||||
addForm.value.id = params.data.id
|
||||
} else {
|
||||
addForm.value = {
|
||||
name: ''
|
||||
name: '',
|
||||
unit: ''
|
||||
}
|
||||
}
|
||||
baseDialog.value?.open()
|
||||
|
||||
@ -13,6 +13,12 @@
|
||||
<div class="imageCon" ref="threeCanvas">
|
||||
<!-- <img class="image" :src="rowData.thumbnail" alt="" /> -->
|
||||
</div>
|
||||
<span
|
||||
class="label"
|
||||
style="display: inline-block; height: 30px; line-height: 30px; padding-left: 10px"
|
||||
>属性信息</span
|
||||
>
|
||||
<span class="custom-divider"></span>
|
||||
<div class="inputCon">
|
||||
<span class="label">模型名称</span>
|
||||
<input class="input" maxlength="40" type="text" v-model="rowData.name" />
|
||||
@ -21,7 +27,9 @@
|
||||
</template>
|
||||
<template #footer>
|
||||
<div style="position: absolute; left: -400px; display: flex">
|
||||
<button @click="setImage">设置预览图</button>
|
||||
<button @click="setImage">
|
||||
<svg-icon name="sys_set" :size="14" style="margin-top: -1px"></svg-icon>设置预览图
|
||||
</button>
|
||||
</div>
|
||||
<button @click="save">保存</button>
|
||||
<button @click="close">关闭</button>
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
let index = 0;
|
||||
let option = {
|
||||
width: 1300,
|
||||
@ -22,8 +21,9 @@ let option = {
|
||||
devTools: true,
|
||||
},
|
||||
}
|
||||
|
||||
function leftClick(options) {
|
||||
const { ipcRenderer } = require('electron')
|
||||
const {ipcRenderer} = require('electron')
|
||||
console.log('leftClick', options)
|
||||
let id = options.id;
|
||||
let node = window.treeObj.getNodeByParam("id", id, null);
|
||||
@ -213,18 +213,21 @@ function leftClick(options) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function rightClick(options) {
|
||||
console.log("rightClick", options);
|
||||
let id = options.id;
|
||||
let node = window.treeObj.getNodeByParam("id", id, null);
|
||||
if (node) window.treeObj.selectNode(node);
|
||||
YJ.Global.splitScreen.setActiveId([id]);
|
||||
// 自定义,实例右键点击菜单
|
||||
// YJ.Global.splitScreen.setActiveId([id]);
|
||||
}
|
||||
|
||||
let a = new Map()
|
||||
|
||||
async function tankuang(id, node, info) {
|
||||
const electron = require("electron");
|
||||
const { ipcRenderer } = require('electron')
|
||||
const {ipcRenderer} = require('electron')
|
||||
|
||||
let availablePort = await ipcRenderer.invoke('get-available-port');
|
||||
window.treeObj.selectNode(node);
|
||||
@ -274,4 +277,4 @@ async function tankuang(id, node, info) {
|
||||
}
|
||||
}
|
||||
|
||||
export { leftClick, rightClick };
|
||||
export {leftClick, rightClick};
|
||||
|
||||
Reference in New Issue
Block a user