This commit is contained in:
zh
2025-09-26 19:14:47 +08:00
parent 6c6ba0a1eb
commit 334d22c3da
13 changed files with 256 additions and 239 deletions

View File

@ -210,16 +210,21 @@ function createWindow(): void {
} }
* */ * */
console.log('GetHomeDir()', GetHomeDir()) // console.log('GetHomeDir()', GetHomeDir())
let prefix =
process.env.NODE_ENV === "development"
? "src/renderer/public"
: "resources/app.asar/out/renderer";
let data = {}; let data = {};
for (const objKey in obj) { for (const objKey in obj) {
let files = fs.readdirSync( let files = fs.readdirSync(
path.join( path.join(
global.__static ? global.__static : GetHomeDir() + "/src/renderer/public", GetHomeDir(),
prefix,
obj[objKey] obj[objKey]
) )
); );
console.log(files); // console.log(files);
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
files[i] = obj[objKey] + "/" + files[i]; files[i] = obj[objKey] + "/" + files[i];
} }

View File

@ -9,7 +9,6 @@ export {}
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
BaseDialog: typeof import('./src/components/dialog/baseDialog.vue')['default'] BaseDialog: typeof import('./src/components/dialog/baseDialog.vue')['default']
copy: typeof import('./src/components/dialog/directory copy.vue')['default']
Directory: typeof import('./src/components/dialog/directory.vue')['default'] Directory: typeof import('./src/components/dialog/directory.vue')['default']
DirectoryEdit: typeof import('./src/components/dialog/directoryEdit.vue')['default'] DirectoryEdit: typeof import('./src/components/dialog/directoryEdit.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']

View File

@ -137,31 +137,37 @@ export const initMapData = async (type, data, cd) => {
} }
if (entityObject) { if (entityObject) {
options = structuredClone(entityObject.options) function getOptions() {
delete options.host let opt = structuredClone(entityObject.options)
delete opt.host
switch (type) { switch (type) {
case 'textBox': case 'textBox':
delete options.name delete opt.name
break break
case 'fountain': case 'fountain':
case 'fire': case 'fire':
case 'smoke': case 'smoke':
case 'waterL': case 'waterL':
delete options.url delete opt.url
break break
default: default:
break break
} }
return opt
}
options = getOptions()
console.log('--------------------onClick') console.log('--------------------onClick')
//鼠标左键点击事件 //鼠标左键点击事件
entityObject.onClick = () => { entityObject.onClick = () => {
// console.log('onClick') // console.log('onClick')
leftClick(options); leftClick(getOptions());
}; };
//鼠标右键点击事件 //鼠标右键点击事件
entityObject.onRightClick = () => { entityObject.onRightClick = () => {
rightClick(options); rightClick(getOptions());
}; };
} }
// options = entityObject // options = entityObject
return options return options

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="adddirectory"> <div class="editdirectoryBox">
<div class="box"> <div class="box">
<div class="boxHeader nav"> <div class="boxHeader nav">
<!-- <span></span> --> <!-- <span></span> -->
@ -19,7 +19,7 @@
<el-form-item> <el-form-item>
<div class="btnOption"> <div class="btnOption">
<el-button type="primary" @click="submitForm(ruleForm)">确定</el-button> <el-button type="primary" @click="submitForm(ruleForm)">确定</el-button>
<el-button @click="cancel">取消</el-button> <el-button @click="close">取消</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -34,10 +34,11 @@ import { throttle } from '@/utils/index'
import { ElMessage, FormInstance } from 'element-plus' import { ElMessage, FormInstance } from 'element-plus'
import { TreeApi } from '@/api/tree' import { TreeApi } from '@/api/tree'
import { useTreeNode } from '@/views/components/tree/hooks/treeNode' import { useTreeNode } from '@/views/components/tree/hooks/treeNode'
const { getKeyOfSelectedNode, getSelectedNode, cusAddNodes, getSameLevel } = useTreeNode() const { getKeyOfSelectedNode, getSelectedNode, cusUpdateNode, getSameLevel, getSelectedNodes } = useTreeNode()
const title = ref('编辑节点') const title = ref('编辑节点')
const sourceId = ref('')
let form: any = reactive({ let form: any = reactive({
sourceName: '图层' sourceName: ''
}) })
const ruleForm = ref() const ruleForm = ref()
const rules = reactive({ const rules = reactive({
@ -47,7 +48,10 @@ const removeSpaces = (value: string) => {
form.sourceName = value.replace(/\s/g, '') form.sourceName = value.replace(/\s/g, '')
} }
const close = () => { const close = () => {
$changeComponentPop('.adddirectory', false) $changeComponentPop('.editdirectoryBox', false)
sourceId.value = ''
form.sourceName = ''
ruleForm.value?.resetFields()
} }
const submitForm = async (formEl: FormInstance | undefined) => { const submitForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return if (!formEl) return
@ -60,41 +64,11 @@ const submitForm = async (formEl: FormInstance | undefined) => {
}) })
} }
const add = throttle(async () => { const add = throttle(async () => {
let parentId = getKeyOfSelectedNode(window.treeObj, 'id') const res: any = await TreeApi.updateDirectoryInfo({
let fnone = getSelectedNode(window.treeObj) id: sourceId.value,
const res: any = await TreeApi.addDirectory({ sourceName: form.sourceName
id: new YJ.Tools().randomString(),
sourceName: form.sourceName,
parentId: parentId || undefined
}) })
console.log(res) cusUpdateNode({ id: sourceId.value, sourceName: form.sourceName, params: undefined })
if (res.code == 0 || res.code == 200) {
const node = {
...res.data
}
let addNode = await cusAddNodes(window.treeObj, getSelectedNode(window.treeObj), [node], true) //添加节点
//获取该节点下的同级节点
const someNode: any = getSameLevel(window.treeObj, addNode[0])
console.log('someNode', someNode)
const newNode = someNode.map((item: any) => {
let index = item.getIndex()
item.treeIndex = index+1
return {
...item,
treeIndex: item.getIndex()
}
})
ElMessage({
message: '添加成功',
type: 'success'
})
cancel()
} else {
ElMessage({
message: '添加失败',
type: 'error'
})
}
// console.log(res) // console.log(res)
}, 3000) }, 3000)
// //上传或修改树的层级 // //上传或修改树的层级
@ -123,15 +97,23 @@ const add = throttle(async () => {
// } // }
// } // }
const cancel = () => { const open = () => {
$changeComponentPop('.adddirectory', false) let selectNodes = getSelectedNodes(window.treeObj);
form.sourceName = '图层' if (selectNodes && selectNodes[selectNodes.length - 1]) {
ruleForm.value?.resetFields() sourceId.value = selectNodes[selectNodes.length - 1].id
form.sourceName = selectNodes[selectNodes.length - 1].sourceName
$changeComponentPop('.editdirectoryBox', true)
} }
}
defineExpose({
open,
close
})
</script> </script>
<style lang="scss"> <style lang="scss">
.adddirectory { .editdirectoryBox {
user-select: none; user-select: none;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -97,7 +97,7 @@
ref="imageRef" ref="imageRef"
fit="contain" fit="contain"
:preview-teleported="true" :preview-teleported="true"
:preview-src-list="modelList.map((item) => 'http://127.0.0.1:8848' + item.data)" :preview-src-list="modelList.map((item:any) => 'http://127.0.0.1:8848' + item.data)"
style="width: 80px; height: 60px" style="width: 80px; height: 60px"
:src="'http://127.0.0.1:8848' + row.data" :src="'http://127.0.0.1:8848' + row.data"
:initial-index="currentIndex" :initial-index="currentIndex"
@ -109,7 +109,7 @@
ref="imageRef" ref="imageRef"
fit="contain" fit="contain"
:preview-teleported="true" :preview-teleported="true"
:preview-src-list="modelList.map((item) => 'http://localhost:55110/' + item.data)" :preview-src-list="modelList.map((item:any) => 'http://localhost:55110/' + item.data)"
style="width: 80px; height: 60px" style="width: 80px; height: 60px"
:src="'http://localhost:55110/' + row.data" :src="'http://localhost:55110/' + row.data"
:initial-index="currentIndex" :initial-index="currentIndex"
@ -772,6 +772,7 @@ const setPhotoList = () => {
dirName1s: 'GEMarker1s' dirName1s: 'GEMarker1s'
}) })
$recvElectronChanel('dirFiles', (e, res) => { $recvElectronChanel('dirFiles', (e, res) => {
console.log('dirFiles', res)
res.GEMarker1s.forEach((item) => { res.GEMarker1s.forEach((item) => {
let name = item.split('.')[0] let name = item.split('.')[0]
name = name.split('/')[1] name = name.split('/')[1]

View File

@ -110,7 +110,7 @@ const setList = ref([
width: 15vw; width: 15vw;
position: absolute; position: absolute;
right: 1vw; right: 1vw;
top: 7%; top: 0;
border-radius: 5px; border-radius: 5px;
// background: var(--svg-headColorbg); // background: var(--svg-headColorbg);
display: flex; display: flex;

View File

@ -10,6 +10,9 @@
<span>{{ date.ymd }}</span> <span>{{ date.ymd }}</span>
<span>{{ t(`week.${date.week}`) }}</span> <span>{{ t(`week.${date.week}`) }}</span>
</div> </div>
<div class="weather">
<svg-icon name="weather" :size="40"></svg-icon>
</div>
</div> </div>
<setTool ref="setToolRef"></setTool> <setTool ref="setToolRef"></setTool>
@ -101,7 +104,7 @@ onUnmounted(() => {
position: absolute; position: absolute;
left: 20px; left: 20px;
//top: 15px; //top: 15px;
top: 0.35vw; top: 0.55vw;
height: 50px; height: 50px;
//border: 1px solid red; //border: 1px solid red;
//width: 200px; //width: 200px;
@ -133,6 +136,14 @@ onUnmounted(() => {
font-size: 0.8rem; font-size: 0.8rem;
} }
} }
.weather {
margin-left: 15px;
svg {
fill: rgba(0, 255, 255, 1) !important;
cursor: pointer;
}
}
} }
.headButton { .headButton {

View File

@ -762,10 +762,14 @@ const close = () => {
} }
const clickChangeImage = () => { const clickChangeImage = () => {
eventBus?.emit('openSelectImg', entityOptions.value.billboardImage, entityOptions.value) eventBus?.emit('openPhoto', (img)=>{
entityOptions.value.billboardImage = img
})
} }
const clickChangeDefaultImage = () => { const clickChangeDefaultImage = () => {
eventBus?.emit('openSelectImg', entityOptions.value.billboardDefaultImage, entityOptions.value) eventBus?.emit('openPhoto', (img)=>{
entityOptions.value.billboardDefaultImage = img
})
} }
const fontChange = (val) => { const fontChange = (val) => {
entityOptions.value.labelFontFamily = val entityOptions.value.labelFontFamily = val

View File

@ -11,55 +11,29 @@
<div class="set_detail"> <div class="set_detail">
<div class="top"> <div class="top">
<div> <div>
<el-input <el-input v-model="modelName" class="w-50 m-2" placeholder="请输入图标类型进行搜索" :suffix-icon="Search" />
v-model="modelName"
class="w-50 m-2"
placeholder="请输入图标名称进行搜索"
:suffix-icon="Search"
/>
</div> </div>
<div class="typeBut"> <div class="typeBut">
<span <span v-for="(item, index) in butList" :key="index" :class="{ clickButClass: butActiveIndex === index }"
v-for="(item, index) in butList" @click="typeClick(index)">{{ item }}</span>
:key="index"
:class="{ clickButClass: butActiveIndex === index }"
@click="typeClick(index)"
>{{ item }}</span
>
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<!-- 左侧Tab导航 --> <!-- 左侧Tab导航 -->
<div class="treeCon"> <div class="treeCon">
<el-tree <el-tree style="max-width: 600px" :data="typeTreeData" ref="treeRef" node-key="id"
style="max-width: 600px" @node-click="handleTypeClick" :filter-node-method="filterNode">
:data="typeTreeData"
ref="treeRef"
node-key="id"
@node-click="handleTypeClick"
:filter-node-method="filterNode"
>
<template #default="{ node, data }"> <template #default="{ node, data }">
<!-- <span> {{ node.label }}</span> --> <!-- <span> {{ node.label }}</span> -->
<span <span :class="{
:class="{
'primary-type': !(node.childNodes.length != 0), 'primary-type': !(node.childNodes.length != 0),
'selected-text': node.id === currentTypeId 'selected-text': node.id === currentTypeId
}" }" @click.stop="toggleExpand(node)" class="allowDrag">
@click.stop="toggleExpand(node)" <svg-icon :name="node.expanded ? 'arrow' : 'more'" :size="12" color="rgba(0, 255, 255, 1)"
class="allowDrag" style="margin-right: 5px; margin-left: 5px" v-if="node.childNodes.length != 0"
> @click.stop="toggleExpand(node)"></svg-icon>
<svg-icon {{ node.label }}</span>
:name="node.expanded ? 'arrow' : 'more'"
:size="12"
color="rgba(0, 255, 255, 1)"
style="margin-right: 5px; margin-left: 5px"
v-if="node.childNodes.length != 0"
@click.stop="toggleExpand(node)"
></svg-icon>
{{ node.label }}</span
>
</template> </template>
</el-tree> </el-tree>
</div> </div>
@ -68,29 +42,17 @@
<div class="model-section" v-if="butActiveIndex === 2"> <div class="model-section" v-if="butActiveIndex === 2">
<!-- <h2 class="section-title">{{ categories[Number(currentTypeId)].name }}</h2> --> <!-- <h2 class="section-title">{{ categories[Number(currentTypeId)].name }}</h2> -->
<div class="model-grid"> <div class="model-grid">
<div <div v-for="(model, mIndex) in categories" :key="mIndex" class="model-item"
v-for="(model, mIndex) in categories" @click="modelClick(mIndex, model)">
:key="mIndex"
class="model-item"
@click="modelClick(mIndex, model)"
>
<div class="imgbg"> <div class="imgbg">
<el-image <el-image :src="service + model.data" fit="contain" class="thumbnail">
:src="'http://127.0.0.1:8848' + model.data"
fit="contain"
class="thumbnail"
>
<template #error> <template #error>
<div class="image-error">加载失败</div> <div class="image-error">加载失败</div>
</template> </template>
</el-image> </el-image>
</div> </div>
<div <div class="model-name" :class="{ isactive: activeIndex == mIndex }" :title="model.iconName">
class="model-name"
:class="{ isactive: activeIndex == mIndex }"
:title="model.iconName"
>
{{ model.iconName }} {{ model.iconName }}
</div> </div>
</div> </div>
@ -101,38 +63,21 @@
<div class="model-section2" v-else> <div class="model-section2" v-else>
<!-- <h2 class="section-title">{{ categories[Number(currentTypeId)].name }}</h2> --> <!-- <h2 class="section-title">{{ categories[Number(currentTypeId)].name }}</h2> -->
<div class="typeTitltName" v-if="categories.length"> <div class="typeTitltName" v-if="categories.length">
<svg-icon <svg-icon name="fk" :size="16" color="rgba(0, 255, 255, 1)" style="margin-right: 5px"></svg-icon>基本类型
name="fk"
:size="16"
color="rgba(0, 255, 255, 1)"
style="margin-right: 5px"
></svg-icon
>基本类型
</div> </div>
<div class="model-grid"> <div class="model-grid">
<div <div v-for="(model, mIndex) in categories" :key="mIndex" class="model-item"
v-for="(model, mIndex) in categories" @click="modelClick(mIndex, model)">
:key="mIndex"
class="model-item"
@click="modelClick(mIndex, model)"
>
<div class="imgbg"> <div class="imgbg">
<el-image <el-image :src="'http://localhost:' + availablePort + '/' + model.data" fit="contain"
:src="'http://localhost:55110/' + model.data" class="thumbnail">
fit="contain"
class="thumbnail"
>
<template #error> <template #error>
<div class="image-error">加载失败</div> <div class="image-error">加载失败</div>
</template> </template>
</el-image> </el-image>
</div> </div>
<div <div class="model-name" :class="{ isactive: activeIndex == mIndex }" :title="model.iconName">
class="model-name"
:class="{ isactive: activeIndex == mIndex }"
:title="model.iconName"
>
{{ model.iconName }} {{ model.iconName }}
</div> </div>
</div> </div>
@ -159,6 +104,8 @@ import {
$recvElectronChanel, $recvElectronChanel,
$changeComponentShow $changeComponentShow
} from '@/utils/communication' } from '@/utils/communication'
const { ipcRenderer } = require('electron')
const { t } = useI18n() const { t } = useI18n()
const { findParentId, findTreeIndex, cusAddNodes } = useTreeNode() const { findParentId, findTreeIndex, cusAddNodes } = useTreeNode()
const isShowPup = ref(false) const isShowPup = ref(false)
@ -166,6 +113,15 @@ const eventBus: any = inject('bus')
const { cusUpdateNode } = useTreeNode() const { cusUpdateNode } = useTreeNode()
var modelName = ref('') var modelName = ref('')
const availablePort = ref(55110)
const service = ref(localStorage.getItem("service"))
ipcRenderer.invoke('get-available-port').then((port) => {
availablePort.value = port
})
let selectCallback
//tab //tab
interface Model { interface Model {
id: string id: string
@ -290,6 +246,10 @@ const handleScroll = () => {
const currentTypeId = ref<string>('') const currentTypeId = ref<string>('')
var activeIndex: any = ref(null) var activeIndex: any = ref(null)
//立体图标、普通图标
let threePhoto: any = []
let ordinaryPhoto: any = []
interface TypeNode { interface TypeNode {
id: string id: string
label: string label: string
@ -330,14 +290,30 @@ let typeArr = {
const modelClick = (index, row) => { const modelClick = (index, row) => {
activeIndex.value = index activeIndex.value = index
isShowPup.value = false isShowPup.value = false
console.log(row, '点中了') console.log(index, row)
let selectedImg
if(selectCallback) {
if(butActiveIndex.value === 0)
{
selectedImg = 'http://localhost:' + availablePort.value + '/' + (row.data.indexOf("1s/") > -1 ? row.data.replace(/1s/g, "1") : row.data)
}
else if(butActiveIndex.value === 1)
{
selectedImg = 'http://localhost:' + availablePort.value + '/' + row.data
}
else if(butActiveIndex.value === 2)
{
selectedImg = service.value + row.data
}
selectCallback(selectedImg)
}
} }
const getModelListByType = (id) => { const getModelListByType = (id) => {
if (butActiveIndex.value === 0) { if (butActiveIndex.value === 0) {
categories.value = threePhoto categories.value = [...threePhoto]
} else if (butActiveIndex.value === 1) { } else if (butActiveIndex.value === 1) {
categories.value = ordinaryPhoto categories.value = [...ordinaryPhoto]
} else { } else {
let formData = new FormData() let formData = new FormData()
formData.append('iconTypeId', id) formData.append('iconTypeId', id)
@ -356,11 +332,20 @@ const getModelList = async () => {
parentId: null parentId: null
} }
] ]
if(butActiveIndex.value==0) {
categories.value = [...threePhoto]
}
if(butActiveIndex.value==1) {
categories.value = [...ordinaryPhoto]
}
} else { } else {
const res: any = await PhotoApi.modelTypeList() const res: any = await PhotoApi.modelTypeList()
if (res.code == 0 || res.code == 200) { if (res.code == 0 || res.code == 200) {
let data = transformNestedJson(res.data, 'name', 'label') let data = transformNestedJson(res.data, 'name', 'label')
typeTreeData.value = data typeTreeData.value = data
if(typeTreeData.value.length>0) {
getModelListByType(typeTreeData.value[0].id)
}
} }
} }
} }
@ -389,26 +374,18 @@ onBeforeUnmount(() => {
observer?.disconnect() observer?.disconnect()
}) })
//end //end
eventBus.on('openPhoto', async(cb) => {
eventBus.on('openPhoto', (data) => { isShowPup.value = true
isShowPup.value = data selectCallback = cb
if (data) {
getModelList() getModelList()
getSetting() getSetting()
setPhotoList() setPhotoList()
}
}) })
eventBus.on('closeModelSet', (data) => { eventBus.on('closePhoto', () => {
isShowPup.value = data isShowPup.value = false
if (data) {
getSetting() getSetting()
}
}) })
//立体图标、普通图标
let threePhoto: any = []
let ordinaryPhoto: any = []
const setPhotoList = () => { const setPhotoList = () => {
$sendElectronChanel('requireGEMarkerName', { $sendElectronChanel('requireGEMarkerName', {
dirName: 'GEMarker', dirName: 'GEMarker',
@ -431,6 +408,7 @@ const setPhotoList = () => {
data: item data: item
}) })
}) })
categories.value = [...threePhoto]
}) })
} }
@ -465,6 +443,7 @@ defineExpose({
.set_pup { .set_pup {
width: 40vw; width: 40vw;
height: 50vh; height: 50vh;
:deep(.el-dialog) { :deep(.el-dialog) {
background: background:
linear-gradient(180deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0) 100%), linear-gradient(180deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0) 100%),
@ -472,24 +451,30 @@ defineExpose({
border: 1px solid #00c9ff; border: 1px solid #00c9ff;
padding-left: 0 !important; padding-left: 0 !important;
} }
:deep(.el-dialog__body) { :deep(.el-dialog__body) {
padding: 0 !important; padding: 0 !important;
} }
:deep(.el-dialog__headerbtn) { :deep(.el-dialog__headerbtn) {
height: 30px; height: 30px;
width: 30px; width: 30px;
border-bottom-left-radius: 80%; border-bottom-left-radius: 80%;
background-color: #008989; background-color: #008989;
&:hover { &:hover {
background-color: #00ffff; background-color: #00ffff;
.el-dialog__close { .el-dialog__close {
color: rgba(0, 66, 66, 1); // 悬停时改变关闭图标为红色 color: rgba(0, 66, 66, 1); // 悬停时改变关闭图标为红色
} }
} }
} }
:deep(.el-dialog__headerbtn .el-dialog__close) { :deep(.el-dialog__headerbtn .el-dialog__close) {
color: #fff; color: #fff;
} }
.set_pup_header { .set_pup_header {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -498,6 +483,7 @@ defineExpose({
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding-bottom: 20px; padding-bottom: 20px;
.system_title { .system_title {
background: url('@/assets/images/titlebg.png') no-repeat; background: url('@/assets/images/titlebg.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
@ -511,26 +497,24 @@ defineExpose({
font-weight: 700; font-weight: 700;
} }
} }
.set_detail { .set_detail {
box-sizing: border-box; box-sizing: border-box;
// height: 50vh; // height: 50vh;
:deep( :deep(.el-tabs--left .el-tabs__active-bar.is-left,
.el-tabs--left .el-tabs__active-bar.is-left,
.el-tabs--left .el-tabs__active-bar.is-right, .el-tabs--left .el-tabs__active-bar.is-right,
.el-tabs--right .el-tabs__active-bar.is-left, .el-tabs--right .el-tabs__active-bar.is-left,
.el-tabs--right .el-tabs__active-bar.is-right .el-tabs--right .el-tabs__active-bar.is-right) {
) {
width: 3px; width: 3px;
background: rgba(0, 255, 255, 1); background: rgba(0, 255, 255, 1);
height: 40px !important; height: 40px !important;
} }
:deep( :deep(.el-tabs--left .el-tabs__nav-wrap.is-left::after,
.el-tabs--left .el-tabs__nav-wrap.is-left::after,
.el-tabs--left .el-tabs__nav-wrap.is-right::after, .el-tabs--left .el-tabs__nav-wrap.is-right::after,
.el-tabs--right .el-tabs__nav-wrap.is-left::after, .el-tabs--right .el-tabs__nav-wrap.is-left::after,
.el-tabs--right .el-tabs__nav-wrap.is-right::after .el-tabs--right .el-tabs__nav-wrap.is-right::after) {
) {
width: 3px; width: 3px;
} }
@ -563,13 +547,16 @@ defineExpose({
width: 5px; width: 5px;
height: 5px; height: 5px;
} }
:deep(.el-tabs__content::-webkit-scrollbar-thumb) { :deep(.el-tabs__content::-webkit-scrollbar-thumb) {
background-color: #0ff; background-color: #0ff;
border-radius: 5px; border-radius: 5px;
} }
:deep(.el-tabs__content::-webkit-scrollbar-track) { :deep(.el-tabs__content::-webkit-scrollbar-track) {
background-color: rgba(0, 255, 255, 0.2); background-color: rgba(0, 255, 255, 0.2);
} }
:deep(.el-tabs__item) { :deep(.el-tabs__item) {
width: 8vw; width: 8vw;
color: #fff !important; color: #fff !important;
@ -582,50 +569,45 @@ defineExpose({
margin-bottom: 3px; margin-bottom: 3px;
box-sizing: border-box; box-sizing: border-box;
} }
:deep(.el-tabs__item:hover) { :deep(.el-tabs__item:hover) {
background: linear-gradient( background: linear-gradient(90deg,
90deg,
rgba(0, 255, 255, 0) 0%, rgba(0, 255, 255, 0) 0%,
rgba(0, 255, 255, 0.5) 48.91%, rgba(0, 255, 255, 0.5) 48.91%,
rgba(0, 255, 255, 0) 100% rgba(0, 255, 255, 0) 100%);
);
border: 1px solid; border: 1px solid;
box-sizing: border-box; box-sizing: border-box;
border-image: linear-gradient( border-image: linear-gradient(90deg,
90deg,
rgba(0, 255, 255, 0) 0%, rgba(0, 255, 255, 0) 0%,
rgba(0, 255, 255, 1) 55.55%, rgba(0, 255, 255, 1) 55.55%,
rgba(0, 255, 255, 0) 100% rgba(0, 255, 255, 0) 100%) 1;
)
1;
} }
:deep(.el-tabs__item.is-active) { :deep(.el-tabs__item.is-active) {
background: linear-gradient( background: linear-gradient(90deg,
90deg,
rgba(0, 255, 255, 0) 0%, rgba(0, 255, 255, 0) 0%,
rgba(0, 255, 255, 0.5) 48.91%, rgba(0, 255, 255, 0.5) 48.91%,
rgba(0, 255, 255, 0) 100% rgba(0, 255, 255, 0) 100%) !important;
) !important;
border: 0.1px solid; border: 0.1px solid;
// box-sizing: border-box; // box-sizing: border-box;
border-image: linear-gradient( border-image: linear-gradient(90deg,
90deg,
rgba(0, 255, 255, 0) 0%, rgba(0, 255, 255, 0) 0%,
rgba(0, 255, 255, 1) 55.55%, rgba(0, 255, 255, 1) 55.55%,
rgba(0, 255, 255, 0) 100% rgba(0, 255, 255, 0) 100%) 1 !important;
)
1 !important;
} }
:deep(.el-tabs__header) { :deep(.el-tabs__header) {
height: 50vh !important; height: 50vh !important;
width: 8vw; width: 8vw;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
} }
:deep(.el-tabs__nav-next, .el-tabs__nav-prev) { :deep(.el-tabs__nav-next, .el-tabs__nav-prev) {
color: #fff; color: #fff;
} }
} }
.el-input { .el-input {
width: 300px; width: 300px;
margin-left: 30px; margin-left: 30px;
@ -637,9 +619,11 @@ defineExpose({
--el-input-hover-border-color: rgba(var(--color-sdk-base-rgb), 0.5) !important; --el-input-hover-border-color: rgba(var(--color-sdk-base-rgb), 0.5) !important;
--el-input-focus-border-color: rgba(var(--color-sdk-base-rgb), 0.5) !important; --el-input-focus-border-color: rgba(var(--color-sdk-base-rgb), 0.5) !important;
} }
::v-deep .el-input__wrapper { ::v-deep .el-input__wrapper {
background-color: rgba(0, 0, 0, 0.5) !important; background-color: rgba(0, 0, 0, 0.5) !important;
} }
.btn { .btn {
float: right; float: right;
height: 32px; height: 32px;
@ -650,9 +634,11 @@ defineExpose({
color: #fff !important; color: #fff !important;
padding: 0 15px; padding: 0 15px;
} }
.btn:hover { .btn:hover {
color: rgba(var(--color-sdk-base-rgb), 1) !important; color: rgba(var(--color-sdk-base-rgb), 1) !important;
border: 1px solid rgba(var(--color-sdk-base-rgb), 1) !important; border: 1px solid rgba(var(--color-sdk-base-rgb), 1) !important;
.setIcon { .setIcon {
color: rgba(var(--color-sdk-base-rgb), 1) !important; color: rgba(var(--color-sdk-base-rgb), 1) !important;
} }
@ -670,17 +656,20 @@ defineExpose({
display: flex; display: flex;
height: 100vh; height: 100vh;
} }
.model-tabs { .model-tabs {
width: 130px; width: 130px;
height: 100%; height: 100%;
float: left; float: left;
} }
.treeCon { .treeCon {
width: 140px; width: 140px;
height: 100%; height: 100%;
float: left; float: left;
border-right: 1px solid rgba(204, 204, 204, 0.2); border-right: 1px solid rgba(204, 204, 204, 0.2);
} }
.model-gallery { .model-gallery {
flex: 1; flex: 1;
/* padding: 20px; */ /* padding: 20px; */
@ -690,16 +679,19 @@ defineExpose({
float: left; float: left;
margin-left: 10px; margin-left: 10px;
} }
.model-section { .model-section {
min-height: 10vh; min-height: 10vh;
margin-bottom: 40px; margin-bottom: 40px;
} }
.model-grid { .model-grid {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
/* justify-content: space-around; */ /* justify-content: space-around; */
gap: 20px; gap: 20px;
} }
.model-name { .model-name {
width: 100%; width: 100%;
height: 30px; height: 30px;
@ -711,18 +703,22 @@ defineExpose({
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
} }
.isactive { .isactive {
color: rgba(var(--color-sdk-base-rgb), 1) !important; color: rgba(var(--color-sdk-base-rgb), 1) !important;
} }
.model-item { .model-item {
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
width: 70px; width: 70px;
/* box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); */ /* box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); */
} }
.model-item:hover { .model-item:hover {
cursor: pointer !important; cursor: pointer !important;
color: rgba(var(--color-sdk-base-rgb), 1) !important; color: rgba(var(--color-sdk-base-rgb), 1) !important;
.model-name { .model-name {
color: rgba(var(--color-sdk-base-rgb), 1) !important; color: rgba(var(--color-sdk-base-rgb), 1) !important;
} }
@ -734,17 +730,20 @@ defineExpose({
background: url('@/assets/images/model-bg.png') no-repeat; background: url('@/assets/images/model-bg.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.model-section2 { .model-section2 {
.imgbg { .imgbg {
background: unset; background: unset;
} }
} }
.thumbnail { .thumbnail {
width: 64px; width: 64px;
height: 64px; height: 64px;
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
} }
.loading-more { .loading-more {
text-align: center; text-align: center;
padding: 20px; padding: 20px;
@ -753,10 +752,12 @@ defineExpose({
::v-deep .el-tabs__content { ::v-deep .el-tabs__content {
display: none !important; display: none !important;
} }
/* 修改滚动条轨道的颜色 */ /* 修改滚动条轨道的颜色 */
::v-deep ::-webkit-scrollbar-track { ::v-deep ::-webkit-scrollbar-track {
background: rgba(var(--color-sdk-base-rgb), 0.1) !important; background: rgba(var(--color-sdk-base-rgb), 0.1) !important;
} }
/* 修改滚动条滑块的样式 */ /* 修改滚动条滑块的样式 */
::v-deep ::-webkit-scrollbar-thumb { ::v-deep ::-webkit-scrollbar-thumb {
background: rgba(var(--color-sdk-base-rgb), 1) !important; background: rgba(var(--color-sdk-base-rgb), 1) !important;
@ -773,11 +774,13 @@ defineExpose({
width: 5px; width: 5px;
height: 5px; height: 5px;
} }
/* 定义背景颜色和圆角 */ /* 定义背景颜色和圆角 */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
border-radius: 1em; border-radius: 1em;
background-color: rgba(50, 50, 50, 0.3); background-color: rgba(50, 50, 50, 0.3);
} }
/* //定义滚动条轨道 内阴影+圆角 */ /* //定义滚动条轨道 内阴影+圆角 */
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
border-radius: 1em; border-radius: 1em;
@ -788,6 +791,7 @@ defineExpose({
.el-tree-node__content>.el-tree-node__expand-icon { .el-tree-node__content>.el-tree-node__expand-icon {
display: none !important; display: none !important;
} }
.el-tree { .el-tree {
background: transparent !important; background: transparent !important;
--el-tree-node-hover-bg-color: rgba(var(--color-sdk-base-rgb), 0.2) !important; --el-tree-node-hover-bg-color: rgba(var(--color-sdk-base-rgb), 0.2) !important;
@ -797,16 +801,21 @@ defineExpose({
float: left; float: left;
margin-left: 10px; margin-left: 10px;
} }
::v-deep .el-text { ::v-deep .el-text {
color: rgba(255, 255, 255, 1) !important; color: rgba(255, 255, 255, 1) !important;
font-size: 12px !important; font-size: 12px !important;
} }
.selected-text { .selected-text {
color: rgba(var(--color-sdk-base-rgb), 1) !important; /* Element UI主色可自定义 */ color: rgba(var(--color-sdk-base-rgb), 1) !important;
/* Element UI主色可自定义 */
} }
::v-deep .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content { ::v-deep .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
border-right: 1px solid rgba(var(--color-sdk-base-rgb), 0.2) !important; border-right: 1px solid rgba(var(--color-sdk-base-rgb), 0.2) !important;
} }
.typeBut { .typeBut {
left: 527px; left: 527px;
top: 3764px; top: 3764px;
@ -816,6 +825,7 @@ defineExpose({
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: flex-start; align-items: flex-start;
span { span {
display: block; display: block;
width: 90px; width: 90px;
@ -835,21 +845,25 @@ defineExpose({
cursor: pointer; cursor: pointer;
color: #fff; color: #fff;
} }
span:hover { span:hover {
color: rgba(var(--color-sdk-base-rgb), 1); color: rgba(var(--color-sdk-base-rgb), 1);
border: 1px solid rgba(var(--color-sdk-base-rgb), 1); border: 1px solid rgba(var(--color-sdk-base-rgb), 1);
border-radius: 4px; border-radius: 4px;
} }
} }
.clickButClass { .clickButClass {
color: rgba(var(--color-sdk-base-rgb), 1); color: rgba(var(--color-sdk-base-rgb), 1);
border: 1px solid rgba(var(--color-sdk-base-rgb), 1) !important; border: 1px solid rgba(var(--color-sdk-base-rgb), 1) !important;
border-radius: 4px; border-radius: 4px;
} }
.top { .top {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.typeTitltName { .typeTitltName {
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;

View File

@ -6,7 +6,7 @@ import { initMapData } from '../../../../common/initMapData'
export const useTree = () => { export const useTree = () => {
const rightMenuRef: any = ref() //右键菜单的实例 const rightMenuRef: any = ref() //右键菜单的实例
const treeObj = ref() //树形的实例 const treeObj = ref() //树形的实例
const { getSelectedNodes, showRightMenu, cusSelectNode, getSameLevel, cusNodeIcon } = useTreeNode() //树上一系列的方法hooks const { getSelectedNodes, showRightMenu, cusSelectNode, getSameLevel, cusNodeIcon, nodeType } = useTreeNode() //树上一系列的方法hooks
const nodes: any = ref([]) const nodes: any = ref([])
/** /**
* 用于捕获zTree上鼠标按键按下后的事件回调函数 * 用于捕获zTree上鼠标按键按下后的事件回调函数
@ -107,7 +107,7 @@ export const useTree = () => {
return { return {
id: item.id, id: item.id,
treeIndex: item.treeIndex, treeIndex: item.treeIndex,
parentId: item.parentId parentId: item.parentId || ''
} }
}) })
const res = await TreeApi.updateTreeIndex(list) const res = await TreeApi.updateTreeIndex(list)
@ -190,29 +190,26 @@ export const useTree = () => {
* @returns {boolean} 返回 falsezTree 将恢复被拖拽的节点,也无法触发 onDrop 事件回调函数 * @returns {boolean} 返回 falsezTree 将恢复被拖拽的节点,也无法触发 onDrop 事件回调函数
*/ */
const beforeDrop = ( const beforeDrop = (
event: DragEvent,
treeId: any, treeId: any,
treeNodes: any, treeNodes: any,
targetNode: any, targetNode: any,
moveType: any moveType: any
) => { ) => {
console.log('开始拖拽之前') if (
['prev', 'next', 'inner'].includes(moveType) &&
// if ( ['pressModel', 'terrainDig'].includes(treeNodes[0].sourceType)
// ['prev', 'next', 'inner'].includes(moveType) && ) {
// ['pressModel', 'terrainDig'].includes(treeNodes[0].sourceType) return false
// ) { }
// return false if (['prev', 'next'].includes(moveType)) {
// } let parent = treeObj.value.getNodeByParam('id', targetNode.parentId, null)
// if (['prev', 'next'].includes(moveType)) { if (parent && !nodeType[parent.sourceType].allowChildren) return false
// let parent = this.treeObj.getNodeByParam('id', targetNode.parentId, null) }
// if (parent && !treeNodeOption.nodeType[parent.sourceType].allowChildren) return false if (targetNode) {
// } if (moveType == 'inner' && !nodeType[targetNode.sourceType].allowChildren) {
// if (targetNode) { return false
// if (moveType == 'inner' && !treeNodeOption.nodeType[targetNode.sourceType].allowChildren) { }
// return false }
// }
// }
} }
/** /**
* 捕获 checkbox / radio 被勾选 或 取消勾选的事件回调函数 * 捕获 checkbox / radio 被勾选 或 取消勾选的事件回调函数

View File

@ -661,6 +661,7 @@ export const useTreeNode = () => {
} }
return { return {
nodeType,
showRightMenu, showRightMenu,
cusNodeIcon, cusNodeIcon,
getSelectedNodes, getSelectedNodes,

View File

@ -11,14 +11,8 @@
<firstMenu class="absolute zIndex9" ref="firstMenuRef"></firstMenu> <firstMenu class="absolute zIndex9" ref="firstMenuRef"></firstMenu>
<!--底部菜单--> <!--底部菜单-->
<bottomMenu class="absolute zIndex9" ref="bottomMenuRef"></bottomMenu> <bottomMenu class="absolute zIndex9" ref="bottomMenuRef"></bottomMenu>
<input <input type="file" id="fileInputlink" style="display: none" multiple accept=".jpeg,.png,.jpg,.mp4,.pdf"
type="file" @input="uploadFile" />
id="fileInputlink"
style="display: none"
multiple
accept=".jpeg,.png,.jpg,.mp4,.pdf"
@input="uploadFile"
/>
<!-- 多点视线分析 --> <!-- 多点视线分析 -->
<Visibility ref="visibility"></Visibility> <Visibility ref="visibility"></Visibility>
@ -135,6 +129,7 @@ let dynamicComponentRef = ref()
let addStandTextRef = ref() let addStandTextRef = ref()
let tree = ref() let tree = ref()
let selectImgRef = ref() let selectImgRef = ref()
let editdirectoryBox = ref()
eventBus.on('openDialog', async (sourceType: any, id: any) => { eventBus.on('openDialog', async (sourceType: any, id: any) => {
console.log(sourceType, id) console.log(sourceType, id)
if (dynamicComponentRef.value && dynamicComponentRef.value.close) { if (dynamicComponentRef.value && dynamicComponentRef.value.close) {
@ -142,7 +137,7 @@ eventBus.on('openDialog', async (sourceType: any, id: any) => {
} }
switch (sourceType) { switch (sourceType) {
case 'directory': case 'directory':
$changeComponentPop('.editdirectoryBox', true) editdirectoryBox.value.open()
// currentComponent.value = addDirectory // currentComponent.value = addDirectory
// await nextTick() // await nextTick()
// dynamicComponentRef.value?.open() // dynamicComponentRef.value?.open()
@ -441,7 +436,8 @@ onMounted(async () => {
height: 100%; height: 100%;
} }
.adddirectoryBox, .editdirectoryBox { .adddirectoryBox,
.editdirectoryBox {
display: none; display: none;
} }
</style> </style>