Merge branch 'zyl' of http://xny.yj-3d.com:3000/zhouyulong/electron-4 into zyl
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
server:
|
||||
host: 127.0.0.1
|
||||
port: 8848
|
||||
path: C:\Users\MSI\AppData\Roaming\dzsp_shijingjun_offline_Y_save
|
||||
path: C:\Users\Administrator\AppData\Roaming\dzsp_shijingjun_offline_Y_save
|
||||
poi:
|
||||
global:
|
||||
enabled: false
|
||||
|
||||
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']
|
||||
|
||||
@ -511,6 +511,7 @@
|
||||
overflow-y: auto;
|
||||
scrollbar-gutter: stable;
|
||||
width: calc(100% + 1px);
|
||||
height: 194px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table .align-center,
|
||||
|
||||
@ -688,6 +688,9 @@
|
||||
},
|
||||
nodeTitle: function (setting, node) {
|
||||
var t = setting.data.key.title === '' ? setting.data.key.name : setting.data.key.title
|
||||
if(!node[t]) {
|
||||
t = setting.data.key.name
|
||||
}
|
||||
var rawTitle = '' + node[t]
|
||||
if (typeof setting.data.render.title === 'function') {
|
||||
return setting.data.render.title.call(this, rawTitle, node)
|
||||
@ -1489,6 +1492,7 @@
|
||||
html.push('</a>')
|
||||
},
|
||||
makeDOMNodeNameBefore: function (html, setting, node) {
|
||||
console.log('=================', setting, node)
|
||||
var title = data.nodeTitle(setting, node),
|
||||
url = view.makeNodeUrl(setting, node),
|
||||
fontcss = view.makeNodeFontCss(setting, node),
|
||||
|
||||
@ -96,6 +96,10 @@ window.newFuzzySearch = function (
|
||||
let str = '<span style="color: whitesmoke;background-color: darkred;">' + h + '</span>'
|
||||
return str
|
||||
})
|
||||
item.title = item.oldname.replace(F, function (h) {
|
||||
let str = h
|
||||
return str
|
||||
})
|
||||
|
||||
// let a = item.name
|
||||
// a = '<span style="color: whitesmoke;background-color: darkred;">' + a + "</span>"
|
||||
|
||||
@ -85,8 +85,12 @@ service.interceptors.response.use(
|
||||
if (response.data.code == 401) {
|
||||
router.push('/')
|
||||
localStorage.removeItem('Authorization')
|
||||
ElMessage({
|
||||
message: "登录过期,请重新登录",
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
if (![0, 200].includes(response.data.code)) {
|
||||
else if (![0, 200].includes(response.data.code)) {
|
||||
ElMessage({
|
||||
message: response.data.msg || response.data.message,
|
||||
type: 'error'
|
||||
@ -104,7 +108,7 @@ service.interceptors.response.use(
|
||||
pendingRequests.delete(key)
|
||||
}
|
||||
// 统一错误处理
|
||||
const {response} = error
|
||||
const { response } = error
|
||||
|
||||
if (response) {
|
||||
return Promise.reject(response)
|
||||
|
||||
@ -10,13 +10,22 @@ export const addMapSource = async ({type, id, sourceName = '未命名对象', op
|
||||
let options: any = await initMapData(type, opt, null)
|
||||
let selectedNodes = window.treeObj.getSelectedNodes()
|
||||
let node = selectedNodes && selectedNodes[selectedNodes.length - 1]
|
||||
function getParentId(nd: any) {
|
||||
if (nd.sourceType === 'directory') {
|
||||
return nd.id
|
||||
} else {
|
||||
let parentNode = window.treeObj.getNodeByParam("id", nd.parentId, null);
|
||||
if(parentNode) {
|
||||
return getParentId(parentNode)
|
||||
}
|
||||
else {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
let parentId
|
||||
if (node) {
|
||||
if (node.sourceType === 'directory') {
|
||||
parentId = node.id
|
||||
} else {
|
||||
parentId = node.parentId
|
||||
}
|
||||
parentId = getParentId(node)
|
||||
}
|
||||
delete options.host
|
||||
if(options.attribute && options.attribute.rtmp) {
|
||||
|
||||
@ -150,7 +150,7 @@ let pageSize: any = ref(10)
|
||||
let pageNum: any = ref(1)
|
||||
let total: any = ref(0)
|
||||
const back = () => {
|
||||
ipcRenderer.send('toggle-fullscreen', false)
|
||||
// ipcRenderer.send('toggle-fullscreen', false)
|
||||
router.push({path: '/home'})
|
||||
}
|
||||
const handleSizeChange = (val) => {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="bottomMenuBox zIndex9" ref="bottomMenuBox">
|
||||
<div class="animate__animated bottomMenu">
|
||||
<div class="bottom_box" v-for="(item, i) of bottomMenuList" :key="i" :title="t('bottomMenu.' + item.sourceType)">
|
||||
<div class="bottom_box_content" @click="addMarker(item, $event)">
|
||||
<div class="bottom_box" v-for="(item, i) of bottomMenuList" :key="i">
|
||||
<div class="bottom_box_content" @click="addMarker(item, $event)" :title="t('bottomMenu.' + item.sourceType)">
|
||||
<svg class="bottom_box_bg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="117.030029296875" height="44" viewBox="0 0 117.030029296875 44" fill="none"
|
||||
preserveAspectRatio="none">
|
||||
@ -40,7 +40,7 @@
|
||||
</div>
|
||||
<div class="bottom_children" v-if="item.children" v-show="item.childrenShow">
|
||||
<div class="bottom_childre_box" v-for="(item2, m) of item.children" :key="m"
|
||||
@click="addMarker(item2, $event)">
|
||||
@click="addMarker(item2, $event)" :title="t('bottomMenu.' + item2.sourceType)">
|
||||
<svg class="bottom_childre_box_bg" xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" width="6vw" height="44.5" viewBox="0 0 119 35.5" fill="none"
|
||||
preserveAspectRatio="none">
|
||||
@ -595,6 +595,7 @@ const fold = () => {
|
||||
const itemDuration = 300
|
||||
if (isFolded.value) {
|
||||
// 展开状态
|
||||
bottomMenuBox.value.style.pointerEvents = 'unset'
|
||||
items.forEach((item: any, index) => {
|
||||
setTimeout(() => {
|
||||
item.style.transition = 'transform 0.3s ease'
|
||||
@ -606,6 +607,7 @@ const fold = () => {
|
||||
bottom_left.style.transform = 'rotate(270deg)'
|
||||
} else {
|
||||
// 折叠状态
|
||||
bottomMenuBox.value.style.pointerEvents = 'none'
|
||||
items.forEach((item: any, index: any) => {
|
||||
setTimeout(() => {
|
||||
item.style.transition = 'transform 0.3s ease'
|
||||
@ -817,6 +819,7 @@ document.addEventListener('click', (e: any) => {
|
||||
transition: all 0.3s ease;
|
||||
transform: rotate(270deg);
|
||||
cursor: pointer;
|
||||
pointer-events: all;
|
||||
|
||||
>svg {
|
||||
width: 100%;
|
||||
|
||||
@ -38,10 +38,12 @@
|
||||
</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 style="color: rgba(var(--color-text2), 1)">{{ item.createdAt }}</span>
|
||||
<div class="but">
|
||||
<span v-if="item.isEnable">已启用</span>
|
||||
|
||||
<el-button
|
||||
@ -64,6 +66,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<div class="engineering_title2">
|
||||
<span class="fankuai"></span>
|
||||
@ -91,10 +94,13 @@
|
||||
</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 style="color: rgba(var(--color-text2), 1)">{{ item.createdAt }}</span>
|
||||
<div class="but">
|
||||
<span v-if="item.isEnable">已启用</span>
|
||||
|
||||
<el-button
|
||||
@ -117,6 +123,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<div class="engineering_title2">
|
||||
<span class="fankuai"></span>
|
||||
@ -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 {
|
||||
// .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);
|
||||
// }
|
||||
}
|
||||
// 滚动条优化
|
||||
.fileList::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.fileList_nav::-webkit-scrollbar-thumb {
|
||||
.fileList::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(var(--color-base1), 1);
|
||||
border-radius: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.fileList_nav::-webkit-scrollbar-track {
|
||||
.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 = []
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="leftBox">
|
||||
<div class="leftBox" ref="leftBoxRef">
|
||||
<div class="left animate__animated">
|
||||
<div class="menus">
|
||||
<div class="menus_itemBox" v-for="(item, index) in menuList" :title="t(`firstMenu.${item.name}`)">
|
||||
@ -20,20 +20,20 @@
|
||||
</svg> -->
|
||||
<svg class="item_icon_bg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="162" height="44" viewBox="0 0 162 44" fill="none" preserveAspectRatio="none">
|
||||
<path fill="#000000" fill-opacity="0.5" d="M0 44L136.639 44L162 18L162 0L0 0L0 44Z"/>
|
||||
<path fill="#000000" fill-opacity="0.5" d="M0 44L136.639 44L162 18L162 0L0 0L0 44Z" />
|
||||
<path fill-rule="evenodd" fill="url(#linear_border_2218_109_0)"
|
||||
d="M136.006 42.5L1.5 42.5L1.5 1.5L160.5 1.5L160.5 17.3896L136.006 42.5ZM136.639 44L0 44L0 0L162 0L162 18L136.639 44Z"/>
|
||||
d="M136.006 42.5L1.5 42.5L1.5 1.5L160.5 1.5L160.5 17.3896L136.006 42.5ZM136.639 44L0 44L0 0L162 0L162 18L136.639 44Z" />
|
||||
<path d="M0 0L15.0533 0L49.1742 41L98.4484 41.2681L102 44L0 44L0 0Z"
|
||||
fill="rgba(var(--color-base1), 0.2)"/>
|
||||
fill="rgba(var(--color-base1), 0.2)" />
|
||||
<path d="M3 34L3 41L10 41L3 34Z" stroke="rgba(var(--color-base2), 1)" stroke-width="0.5"
|
||||
stroke-linejoin="round"/>
|
||||
stroke-linejoin="round" />
|
||||
<path d="M159 10L159 3L152 3L159 10Z" stroke="rgba(var(--color-base2), 1)" stroke-width="0.5"
|
||||
stroke-linejoin="round"/>
|
||||
stroke-linejoin="round" />
|
||||
<defs>
|
||||
<linearGradient id="linear_border_2218_109_0" x1="0" y1="-1.7520751953125" x2="140.2142333984375"
|
||||
y2="40.473846435546875" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0625" stop-color="rgba(var(--color-base1), 1)"/>
|
||||
<stop offset="1" stop-color="var(--color-border1)"/>
|
||||
<stop offset="0.0625" stop-color="rgba(var(--color-base1), 1)" />
|
||||
<stop offset="1" stop-color="var(--color-border1)" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
@ -41,12 +41,12 @@
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" width="163" height="45" viewBox="0 0 163 45" fill="none"
|
||||
preserveAspectRatio="none">
|
||||
<path fill="url(#linear_fill_2218_82_1)"
|
||||
d="M0.5 44.5L137.139 44.5L162.5 18.5L162.5 0.5L0.5 0.5L0.5 44.5Z"/>
|
||||
d="M0.5 44.5L137.139 44.5L162.5 18.5L162.5 0.5L0.5 0.5L0.5 44.5Z" />
|
||||
<defs>
|
||||
<linearGradient id="linear_fill_2218_82_1" x1="84.9554443359375" y1="44.49997329711914"
|
||||
x2="84.95498657226562" y2="0.5" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.6"/>
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0"/>
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.6" />
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
@ -64,39 +64,39 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"
|
||||
viewBox="0 0 32 32" fill="none">
|
||||
<path fill="#000000" fill-opacity="0.6"
|
||||
d="M16 0C24.835 0 32 7.16496 32 16C32 24.835 24.835 32 16 32C7.16496 32 0 24.835 0 16C0 7.16496 7.16496 0 16 0Z"/>
|
||||
d="M16 0C24.835 0 32 7.16496 32 16C32 24.835 24.835 32 16 32C7.16496 32 0 24.835 0 16C0 7.16496 7.16496 0 16 0Z" />
|
||||
<path fill="url(#linear_fill_2442_491_1)"
|
||||
d="M16 0C24.835 0 32 7.16496 32 16C32 24.835 24.835 32 16 32C7.16496 32 0 24.835 0 16C0 7.16496 7.16496 0 16 0Z"/>
|
||||
d="M16 0C24.835 0 32 7.16496 32 16C32 24.835 24.835 32 16 32C7.16496 32 0 24.835 0 16C0 7.16496 7.16496 0 16 0Z" />
|
||||
<path fill-rule="evenodd" fill="url(#linear_border_2442_491_0)"
|
||||
d="M32 16C32 7.16496 24.835 0 16 0C7.16496 0 0 7.16496 0 16C0 24.835 7.16496 32 16 32C24.835 32 32 24.835 32 16ZM30.5 16C30.5 7.99187 24.0081 1.5 16 1.5C7.99187 1.5 1.5 7.99187 1.5 16C1.5 24.0081 7.99187 30.5 16 30.5C24.0081 30.5 30.5 24.0081 30.5 16Z"/>
|
||||
d="M32 16C32 7.16496 24.835 0 16 0C7.16496 0 0 7.16496 0 16C0 24.835 7.16496 32 16 32C24.835 32 32 24.835 32 16ZM30.5 16C30.5 7.99187 24.0081 1.5 16 1.5C7.99187 1.5 1.5 7.99187 1.5 16C1.5 24.0081 7.99187 30.5 16 30.5C24.0081 30.5 30.5 24.0081 30.5 16Z" />
|
||||
<g filter="url(#filter_2442_492)">
|
||||
<path
|
||||
d="M10.4025 16.1283L19.1887 9.77097C19.1941 9.76721 19.1995 9.76361 19.205 9.76018C19.2106 9.75678 19.2162 9.75356 19.222 9.75054C19.2278 9.74754 19.2337 9.74473 19.2396 9.74211C19.2456 9.73947 19.2517 9.73705 19.2578 9.73486C19.2639 9.73265 19.2701 9.73065 19.2764 9.72886C19.2827 9.72708 19.289 9.7255 19.2954 9.72415C19.3017 9.72279 19.3082 9.72166 19.3146 9.72075C19.3211 9.71985 19.3275 9.71916 19.334 9.71868C19.3405 9.71821 19.347 9.71794 19.3535 9.7179C19.3601 9.71787 19.3666 9.71808 19.3731 9.7185C19.3796 9.71891 19.3861 9.71954 19.3925 9.7204C19.399 9.72125 19.4054 9.72234 19.4118 9.72365C19.4182 9.72493 19.4245 9.72645 19.4308 9.72818C19.4371 9.7299 19.4433 9.73184 19.4495 9.734C19.4556 9.73615 19.4617 9.7385 19.4677 9.74108C19.4737 9.74365 19.4795 9.74641 19.4854 9.74936C19.4912 9.75234 19.4969 9.7555 19.5024 9.75886C19.508 9.76222 19.5135 9.76577 19.5188 9.7695C19.5242 9.77322 19.5294 9.77712 19.5345 9.78122C19.5395 9.78531 19.5445 9.78956 19.5492 9.79397C19.554 9.7984 19.5587 9.80298 19.5631 9.80772C19.5676 9.81246 19.5719 9.81735 19.5761 9.8224C19.5802 9.82742 19.5842 9.83259 19.588 9.8379C19.5917 9.84318 19.5953 9.8486 19.5987 9.85415C19.6022 9.8597 19.6054 9.86536 19.6084 9.87115C19.6115 9.87691 19.6143 9.88277 19.6169 9.88872C19.6196 9.8947 19.622 9.90074 19.6242 9.90686C19.6264 9.913 19.6284 9.91921 19.6302 9.92547C19.632 9.93173 19.6336 9.93805 19.635 9.94443C19.6363 9.95079 19.6375 9.9572 19.6384 9.96365C19.6393 9.9701 19.64 9.97658 19.6405 9.98308C19.641 9.98958 19.6413 9.99609 19.6413 10.0026L19.6413 11.6788C19.6413 12.0415 19.4676 12.3889 19.1705 12.6022L13.9773 16.3599L19.1705 20.1176C19.1887 20.1308 19.2065 20.1445 19.2239 20.1587C19.2413 20.1729 19.2583 20.1876 19.2749 20.2028C19.2914 20.218 19.3075 20.2337 19.3231 20.2499C19.3387 20.266 19.3539 20.2826 19.3685 20.2997C19.3831 20.3167 19.3972 20.3342 19.4109 20.3521C19.4245 20.37 19.4375 20.3883 19.45 20.407C19.4625 20.4256 19.4745 20.4446 19.4859 20.464C19.4973 20.4834 19.5081 20.5031 19.5183 20.5231C19.5285 20.5431 19.5381 20.5634 19.5471 20.584C19.5562 20.6046 19.5646 20.6254 19.5724 20.6465C19.5801 20.6676 19.5873 20.6889 19.5938 20.7104C19.6003 20.7319 19.6062 20.7536 19.6115 20.7754C19.6167 20.7973 19.6213 20.8193 19.6252 20.8414C19.6292 20.8635 19.6325 20.8858 19.6351 20.9081C19.6377 20.9304 19.6396 20.9528 19.6409 20.9752C19.6422 20.9977 19.6429 21.0201 19.6428 21.0426L19.6428 22.7173C19.6428 22.9489 19.3777 23.0845 19.1887 22.9489L10.4025 16.5915C10.3979 16.5882 10.3935 16.5848 10.3892 16.5812C10.3849 16.5776 10.3807 16.5739 10.3766 16.57C10.3725 16.5662 10.3686 16.5623 10.3647 16.5582C10.3608 16.5541 10.3571 16.5499 10.3535 16.5456C10.3499 16.5414 10.3464 16.537 10.343 16.5325C10.3396 16.528 10.3364 16.5234 10.3334 16.5187C10.3302 16.514 10.3273 16.5093 10.3245 16.5044C10.3217 16.4996 10.319 16.4946 10.3165 16.4896C10.3139 16.4846 10.3116 16.4796 10.3094 16.4744C10.3071 16.4693 10.305 16.464 10.3031 16.4588C10.3012 16.4535 10.2994 16.4482 10.2978 16.4428C10.2962 16.4375 10.2948 16.4321 10.2934 16.4266C10.2921 16.4211 10.291 16.4156 10.29 16.4101C10.2891 16.4046 10.2882 16.3991 10.2876 16.3935C10.2869 16.3879 10.2864 16.3824 10.2861 16.3768C10.2858 16.3711 10.2856 16.3655 10.2856 16.3599C10.2856 16.3543 10.2858 16.3487 10.2861 16.3431C10.2864 16.3375 10.2869 16.3319 10.2876 16.3264C10.2882 16.3208 10.2891 16.3153 10.29 16.3097C10.291 16.3042 10.2921 16.2987 10.2934 16.2933C10.2948 16.2878 10.2962 16.2824 10.2978 16.277C10.2994 16.2716 10.3012 16.2663 10.3031 16.2611C10.305 16.2558 10.3071 16.2506 10.3094 16.2455C10.3116 16.2403 10.3139 16.2352 10.3165 16.2302C10.319 16.2252 10.3217 16.2203 10.3245 16.2154C10.3273 16.2106 10.3302 16.2058 10.3334 16.2011C10.3364 16.1965 10.3396 16.1919 10.343 16.1874C10.3464 16.1829 10.3499 16.1785 10.3535 16.1742C10.3571 16.1699 10.3608 16.1658 10.3647 16.1617C10.3686 16.1576 10.3725 16.1536 10.3766 16.1498C10.3807 16.146 10.3849 16.1423 10.3892 16.1387C10.3935 16.1351 10.3979 16.1316 10.4025 16.1283Z"
|
||||
fill="rgba(var(--color-base2), 1)"/>
|
||||
fill="rgba(var(--color-base2), 1)" />
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="linear_fill_2442_491_1" x1="14.793701171875" y1="16.00537109375" x2="14.7939453125"
|
||||
y2="-6.678619384765625" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2"/>
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0"/>
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="linear_border_2442_491_0" x1="32" y1="-1.27423095703125" x2="4.303466796875"
|
||||
y2="29.435516357421875" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0625" stop-color="rgb(var(--color-base1))"/>
|
||||
<stop offset="1" stop-color="var(--color-border1)"/>
|
||||
<stop offset="0.0625" stop-color="rgb(var(--color-base1))" />
|
||||
<stop offset="1" stop-color="var(--color-border1)" />
|
||||
</linearGradient>
|
||||
<filter id="filter_2442_492" x="6.28564453125" y="5.717864990234375" width="17.357177734375"
|
||||
height="21.36663818359375" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="feFloodId_2442_492"/>
|
||||
<feFlood flood-opacity="0" result="feFloodId_2442_492" />
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha_2442_492"/>
|
||||
<feOffset dx="0" dy="0"/>
|
||||
<feGaussianBlur stdDeviation="2"/>
|
||||
<feComposite in2="hardAlpha_2442_492" operator="out"/>
|
||||
result="hardAlpha_2442_492" />
|
||||
<feOffset dx="0" dy="0" />
|
||||
<feGaussianBlur stdDeviation="2" />
|
||||
<feComposite in2="hardAlpha_2442_492" operator="out" />
|
||||
<feColorMatrix type="matrix"
|
||||
values="0 0 0 0 0.1450980392156863 0 0 0 0 0.7686274509803922 0 0 0 0 0.7686274509803922 0 0 0 1 0"/>
|
||||
<feBlend mode="normal" in2="feFloodId_2442_492" result="dropShadow_1_2442_492"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="dropShadow_1_2442_492" result="shape_2442_492"/>
|
||||
values="0 0 0 0 0.1450980392156863 0 0 0 0 0.7686274509803922 0 0 0 0 0.7686274509803922 0 0 0 1 0" />
|
||||
<feBlend mode="normal" in2="feFloodId_2442_492" result="dropShadow_1_2442_492" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="dropShadow_1_2442_492" result="shape_2442_492" />
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
@ -105,16 +105,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {useI18n} from 'vue-i18n'
|
||||
import {useRouter} from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
import {bus} from '@/utils/bus'
|
||||
import { bus } from '@/utils/bus'
|
||||
import leftSideSecond from '@/views/components/leftSide/leftSideSecond.vue'
|
||||
import {ElMessage, ElLoading} from 'element-plus'
|
||||
import { ElMessage, ElLoading } from 'element-plus'
|
||||
|
||||
const {ipcRenderer} = require('electron')
|
||||
const { ipcRenderer } = require('electron')
|
||||
const router = useRouter() // 路由实例
|
||||
const {t} = useI18n()
|
||||
const { t } = useI18n()
|
||||
const eventBus: any = inject('bus')
|
||||
const menuList: any = ref([
|
||||
// 方案推演
|
||||
@ -249,6 +249,7 @@ const menuList: any = ref([
|
||||
const isFolded: any = ref(false) // 添加折叠状态
|
||||
const initialPositions: any = ref({}) // 保存初始位置
|
||||
const isAnimating: any = ref(false) // 添加动画状态
|
||||
const leftBoxRef = ref()
|
||||
onMounted(() => {
|
||||
let menusHeight = menuList.value.length * 65 + 'px'
|
||||
let height = menuList.value.length * 65 + 30 + 'px'
|
||||
@ -259,6 +260,8 @@ onMounted(() => {
|
||||
items.forEach((item: any, index: any) => {
|
||||
initialPositions.value[index] = item.style.transform || 'translateX(0)'
|
||||
})
|
||||
|
||||
document.addEventListener('click', handleClickOutside, true);
|
||||
})
|
||||
const leftSideSecondRef = ref()
|
||||
const handleClick = (item: any, e) => {
|
||||
@ -276,7 +279,7 @@ const handleClick = (item: any, e) => {
|
||||
ipcRenderer.send('toggle-fullscreen', true)
|
||||
window['earth'].destroy()
|
||||
window['earth'] = null
|
||||
router.push({path: '/ts'})
|
||||
router.push({ path: '/ts' })
|
||||
|
||||
} else {
|
||||
ElMessage({
|
||||
@ -325,6 +328,7 @@ const fold = () => {
|
||||
const itemDelay = 100
|
||||
const itemDuration = 300
|
||||
if (isFolded.value) {
|
||||
leftBoxRef.value.style.pointerEvents = 'unset'
|
||||
left_bottom.style.bottom = '6.5vw'
|
||||
left_bottom.style.left = '72px'
|
||||
left_bottom.style.transform = 'rotate(0deg)'
|
||||
@ -337,6 +341,7 @@ const fold = () => {
|
||||
})
|
||||
} else {
|
||||
// 折叠状态
|
||||
leftBoxRef.value.style.pointerEvents = 'none'
|
||||
items.forEach((item: any, index: any) => {
|
||||
setTimeout(() => {
|
||||
item.style.transition = 'transform 0.3s ease'
|
||||
@ -364,23 +369,16 @@ const fold = () => {
|
||||
)
|
||||
}
|
||||
|
||||
const clickMenu = (item: any) => {
|
||||
console.log(item, 'item')
|
||||
switch (item.key) {
|
||||
case 'analysis':
|
||||
console.log('analysis')
|
||||
// eventBus.emit('analysisDialog')
|
||||
eventBus.emit('circleViewShedDialog') //添加高程后测试
|
||||
// eventBus.emit('submergeDialog')
|
||||
// eventBus.emit('profileDialog')
|
||||
// eventBus.emit('viewShedDialog')
|
||||
// eventBus.emit('cutFillDialog')
|
||||
// eventBus.emit('contourDialog')
|
||||
break
|
||||
default:
|
||||
break
|
||||
// 外部点击的处理函数
|
||||
const handleClickOutside = (e) => {
|
||||
if (leftSideSecondRef.value && leftSideSecondRef.value.leftSideSecondRef && !leftSideSecondRef.value.leftSideSecondRef.contains(e.target)) {
|
||||
$('.leftSideSecond')[0].style.display = 'none'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
document.removeEventListener('click', handleClickOutside, true);
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@ -449,7 +447,7 @@ const clickMenu = (item: any) => {
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
> .item_icon_bg {
|
||||
>.item_icon_bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
@ -461,7 +459,7 @@ const clickMenu = (item: any) => {
|
||||
// background: url('../../../assets/images/hongse/left1.png') no-repeat;
|
||||
// background-size: 100% 100%;
|
||||
|
||||
> .item_icon_bg_hover {
|
||||
>.item_icon_bg_hover {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
}
|
||||
@ -495,8 +493,9 @@ const clickMenu = (item: any) => {
|
||||
// background-size: 100% 100%;
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
pointer-events: all;
|
||||
|
||||
> svg {
|
||||
>svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="leftSideSecond">
|
||||
<div ref="leftSideSecondRef" class="leftSideSecond">
|
||||
<svg
|
||||
class="leftSideSecond_bg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@ -144,7 +144,7 @@ ipcRenderer.invoke('get-available-port').then((port) => {
|
||||
availablePort.value = port
|
||||
})
|
||||
const obj: any = ref(null)
|
||||
const isclick = ref(false)
|
||||
const leftSideSecondRef = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
const initList = (value) => {
|
||||
obj.value = value
|
||||
@ -1029,7 +1029,8 @@ const handleClick = (value = 'projectionDistanceMeasure') => {
|
||||
methodMap[value]()
|
||||
}
|
||||
defineExpose({
|
||||
initList
|
||||
initList,
|
||||
leftSideSecondRef
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
|
||||
@ -146,6 +146,7 @@ var submitProtal = () => {
|
||||
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('操作成功')
|
||||
console.log('ccccccccc')
|
||||
eventBus.emit('addOptionResuit')
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<Dialog ref="baseDialog" :title="t('bottomMenu.groundText')" left="calc(50% - 198px)" top="calc(50% - 120px)" :closeCallback="closeCallBack">
|
||||
<Dialog ref="baseDialog" :title="t('bottomMenu.groundText')" left="calc(50% - 198px)" top="calc(50% - 120px)"
|
||||
:closeCallback="closeCallBack">
|
||||
<template #content>
|
||||
<textarea style="height: 40px; width: 348px;" v-model="text"></textarea>
|
||||
</template>
|
||||
@ -31,7 +32,11 @@ const open = () => {
|
||||
baseDialog.value?.open()
|
||||
}
|
||||
const confirm = () => {
|
||||
if(!text.value) {
|
||||
if (!text.value) {
|
||||
return
|
||||
}
|
||||
text.value = text.value.trim()
|
||||
if (!text.value) {
|
||||
return
|
||||
}
|
||||
let name = text.value
|
||||
@ -56,13 +61,22 @@ const confirm = () => {
|
||||
delete options.positions
|
||||
let selectedNodes = window.treeObj.getSelectedNodes()
|
||||
let node = selectedNodes && selectedNodes[selectedNodes.length - 1]
|
||||
function getParentId(nd: any) {
|
||||
if (nd.sourceType === 'directory') {
|
||||
return nd.id
|
||||
} else {
|
||||
let parentNode = window.treeObj.getNodeByParam("id", nd.parentId, null);
|
||||
if (parentNode) {
|
||||
return getParentId(parentNode)
|
||||
}
|
||||
else {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
let parentId
|
||||
if (node) {
|
||||
if (node.sourceType === 'directory') {
|
||||
parentId = node.id
|
||||
} else {
|
||||
parentId = node.parentId
|
||||
}
|
||||
parentId = getParentId(node)
|
||||
}
|
||||
let params: any = {
|
||||
id: id,
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<Dialog ref="baseDialog" :title="t('bottomMenu.standText')" left="calc(50% - 198px)" top="calc(50% - 120px)" :closeCallback="closeCallBack">
|
||||
<Dialog ref="baseDialog" :title="t('bottomMenu.standText')" left="calc(50% - 198px)" top="calc(50% - 120px)"
|
||||
:closeCallback="closeCallBack">
|
||||
<template #content>
|
||||
<textarea style="height: 40px; width: 348px;" v-model="text"></textarea>
|
||||
</template>
|
||||
@ -31,7 +32,11 @@ const open = () => {
|
||||
baseDialog.value?.open()
|
||||
}
|
||||
const confirm = () => {
|
||||
if(!text.value) {
|
||||
if (!text.value) {
|
||||
return
|
||||
}
|
||||
text.value = text.value.trim()
|
||||
if (!text.value) {
|
||||
return
|
||||
}
|
||||
let name = text.value
|
||||
@ -52,17 +57,25 @@ const confirm = () => {
|
||||
delete options.name
|
||||
let selectedNodes = window.treeObj.getSelectedNodes()
|
||||
let node = selectedNodes && selectedNodes[selectedNodes.length - 1]
|
||||
let parentId
|
||||
if (node) {
|
||||
if (node.sourceType === 'directory') {
|
||||
parentId = node.id
|
||||
function getParentId(nd: any) {
|
||||
if (nd.sourceType === 'directory') {
|
||||
return nd.id
|
||||
} else {
|
||||
let parentNode = window.treeObj.getNodeByParam("id", nd.parentId, null);
|
||||
if (parentNode) {
|
||||
return getParentId(parentNode)
|
||||
}
|
||||
else {
|
||||
parentId = node.parentId
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
let parentId
|
||||
if (node) {
|
||||
parentId = getParentId(node)
|
||||
}
|
||||
|
||||
let params:any = {
|
||||
let params: any = {
|
||||
id: id,
|
||||
sourceName: name,
|
||||
sourceType: 'standText',
|
||||
|
||||
@ -47,9 +47,9 @@ const props = defineProps({
|
||||
|
||||
const setInitialStyle = () => {
|
||||
let style = getdefaultLabelStyle(props.sourceType)
|
||||
let defaultStyle = JSON.parse(localStorage.getItem('defaultStyle') || '{}')
|
||||
let defaultStyle = JSON.parse(localStorage.getItem('defaultLabelStyle') || '{}')
|
||||
defaultStyle[props.sourceType] = style
|
||||
localStorage.setItem('defaultStyle', JSON.stringify(defaultStyle))
|
||||
localStorage.setItem('defaultLabelStyle', JSON.stringify(defaultStyle))
|
||||
ElMessage({
|
||||
message: `新增${props.type}风格设置成功!`,
|
||||
type: "success",
|
||||
|
||||
@ -7,6 +7,6 @@ let defaultLabelStyle = {
|
||||
}
|
||||
}
|
||||
//@ts-ignore
|
||||
export const getdefaultLabelStyle = (type) => {
|
||||
export const getdefaultLabelStyle = (type:any) => {
|
||||
return (type ? defaultLabelStyle[type] : defaultLabelStyle)
|
||||
}
|
||||
|
||||
@ -48,6 +48,6 @@ let defaultStyle = {
|
||||
}
|
||||
}
|
||||
//@ts-ignore
|
||||
export const getdefaultStyle = (type) => {
|
||||
export const getdefaultStyle = (type:any) => {
|
||||
return (type ? defaultStyle[type] : defaultStyle)
|
||||
}
|
||||
|
||||
@ -126,6 +126,7 @@ const open = async (id: any) => {
|
||||
})
|
||||
}
|
||||
const confirm = () => {
|
||||
entityOptions.value.text = entityOptions.value.text.trim()
|
||||
entityOptions.value.text = entityOptions.value.text || t("default.untitled")
|
||||
originalOptions = structuredClone(that.options)
|
||||
let params = structuredClone(that.options)
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -22,7 +22,8 @@
|
||||
<span class="label">滚动速度</span>
|
||||
<input type="range" max="100" min="0" step="1" v-model="entityOptions.speed">
|
||||
<div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">
|
||||
<input class="input" type="number" title="" min="0" max="100" step="1" v-model="entityOptions.speed" @input="$handleInputLimit">
|
||||
<input class="input" type="number" title="" min="0" max="100" step="1" v-model="entityOptions.speed"
|
||||
@input="$handleInputLimit">
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,10 +47,13 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { inject } from "vue";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { TreeApi } from '@/api/tree'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
import { useTreeNode } from '@/views/components/tree/hooks/treeNode'
|
||||
|
||||
const { t } = useI18n()
|
||||
const { cusUpdateNode, getSelectedNodes, cusRemoveNode } = useTreeNode()
|
||||
|
||||
const baseDialog: any = ref(null);
|
||||
@ -83,6 +87,8 @@ const open = async (id: any) => {
|
||||
})
|
||||
}
|
||||
const confirm = () => {
|
||||
entityOptions.value.text = entityOptions.value.text.trim()
|
||||
entityOptions.value.text = entityOptions.value.text || t("default.untitled")
|
||||
originalOptions = structuredClone(that.options)
|
||||
let params = structuredClone(that.options)
|
||||
baseDialog.value?.close()
|
||||
|
||||
@ -26,7 +26,7 @@ export function renderVector(node, ifFly = true) {
|
||||
sourceName: it.name,
|
||||
isShow: true
|
||||
}
|
||||
cusAddNodes(window.treeObj, node.id, [childNode])
|
||||
cusAddNodes(window.treeObj, node.id, [childNode], true)
|
||||
let zijiNodes: any = [];
|
||||
if (it.features && it.features.length) {
|
||||
it.features.forEach((item) => {
|
||||
@ -45,7 +45,7 @@ export function renderVector(node, ifFly = true) {
|
||||
});
|
||||
}
|
||||
|
||||
cusAddNodes(window.treeObj, childNode.id, zijiNodes)
|
||||
cusAddNodes(window.treeObj, childNode.id, zijiNodes, true)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -512,6 +512,7 @@ export const useTree = () => {
|
||||
key: {
|
||||
//zdatas数据中表示节点name的属性key
|
||||
name: 'sourceName',
|
||||
title: 'title',
|
||||
checked: 'isShow'
|
||||
},
|
||||
simpleData: {
|
||||
|
||||
@ -532,7 +532,10 @@ export const useTreeNode = () => {
|
||||
parentNode = treeObj.getNodeByParam('id', parentNodeId, null)
|
||||
}
|
||||
let arr = treeObj.addNodes(parentNode, newNodes, isSilent)
|
||||
if(!isSilent) {
|
||||
treeObj.selectNode(arr[arr.length - 1])
|
||||
}
|
||||
|
||||
// 确保window.AllNodes存在并为数组
|
||||
window.AllNodes = (window.AllNodes || []).concat(arr)
|
||||
return arr
|
||||
|
||||
@ -265,7 +265,9 @@ const isShowTree = debounce(() => {
|
||||
isShow.value = !isShow.value
|
||||
const box1: any = document.querySelector('.box1')
|
||||
const arrow: any = document.querySelector('.arrowTree')
|
||||
const TreeIndex: any = document.querySelector('.TreeIndex')
|
||||
if (isShow.value) {
|
||||
TreeIndex.style.pointerEvents = 'none'
|
||||
// 隐藏box1
|
||||
box1.style.transform = 'translateX(110%)'
|
||||
setTimeout(() => {
|
||||
@ -275,6 +277,7 @@ const isShowTree = debounce(() => {
|
||||
arrow.style.right = '1em'
|
||||
}, 100)
|
||||
} else {
|
||||
TreeIndex.style.pointerEvents = 'unset'
|
||||
// 显示box1
|
||||
arrow.style.transform = 'rotate(180deg)'
|
||||
arrow.style.bottom = '-5px'
|
||||
@ -582,6 +585,7 @@ defineExpose({
|
||||
// background-size: 100% 100%;
|
||||
transition: transform 0.5s ease;
|
||||
transform: rotate(180deg);
|
||||
pointer-events: all;
|
||||
|
||||
> svg {
|
||||
width: 100%;
|
||||
|
||||
@ -126,6 +126,8 @@ import addMaterials from '../components/propertyBox/addMaterials.vue'
|
||||
|
||||
import { GisApi } from '@/api/gisApi'
|
||||
import { sysChange as utilsSysChange } from '@/utils/sysChange'
|
||||
import { getdefaultStyle } from '../components/propertyBox/defaultStyle/style'
|
||||
import { getdefaultLabelStyle } from '../components/propertyBox/defaultLabelStyle/style'
|
||||
|
||||
const { rightMenus } = useRightOperate()
|
||||
const firstMenuRef = ref(null)
|
||||
@ -137,6 +139,23 @@ let addStandTextRef = ref()
|
||||
let tree = ref()
|
||||
let selectImgRef = ref()
|
||||
let editdirectoryBox = ref()
|
||||
|
||||
// 标注标绘默认样式
|
||||
if (!localStorage.getItem('defaultStyle')) {
|
||||
let defaultStyle = getdefaultStyle(null)
|
||||
localStorage.setItem('defaultStyle', JSON.stringify(defaultStyle))
|
||||
}
|
||||
if (!localStorage.getItem('defaultLabelStyle')) {
|
||||
let defaultLabelStyle = getdefaultLabelStyle(null)
|
||||
localStorage.setItem('defaultLabelStyle', JSON.stringify(defaultLabelStyle))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
||||
if (dynamicComponentRef.value && dynamicComponentRef.value.close) {
|
||||
dynamicComponentRef.value.close()
|
||||
@ -455,30 +474,30 @@ const createEarth = async () => {
|
||||
window.earth = await new YJ.YJEarth('earthContainer')
|
||||
let openLeftClick = await new YJ.Global.openLeftClick(window.earth)
|
||||
let openRightClick = await new YJ.Global.openRightClick(window.earth)
|
||||
// YJ.Global.MouseRightMenu(window.earth, true, (text, object) => {
|
||||
// switch (text) {
|
||||
// case 'rotateAround':
|
||||
// YJ.Global.rotateAround(window.earth, 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.MouseRightMenu(window.earth, true, (text, object) => {
|
||||
switch (text) {
|
||||
case 'rotateAround':
|
||||
YJ.Global.rotateAround(window.earth, 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
|
||||
}
|
||||
})
|
||||
|
||||
tree.value.initTreeCallBack()
|
||||
utilsSysChange(eventBus)
|
||||
|
||||
Reference in New Issue
Block a user