修改
This commit is contained in:
@ -1,2 +1,5 @@
|
||||
1,Ψһ<EFBFBD><EFBFBD>ʶ,id
|
||||
2,<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,name
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭ<EFBFBD><EFBFBD>ͷ,<EFBFBD>±<EFBFBD>ͷ,
|
||||
1,apple(<28><>),ƻ<EFBFBD><EFBFBD>(<28><>),"<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߸<EFBFBD>ʽ<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>Ӧ<EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD>ͷ<EFBFBD><EFBFBD>"
|
||||
2,water(<28><>),ˮ(<28><>),
|
||||
3,...,,
|
||||
|
||||
|
2
src/renderer/public/excel/header_old.csv
Normal file
2
src/renderer/public/excel/header_old.csv
Normal file
@ -0,0 +1,2 @@
|
||||
1,Ψһ<EFBFBD><EFBFBD>ʶ,id
|
||||
2,<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,name
|
||||
|
@ -1,31 +1,37 @@
|
||||
<template>
|
||||
<Dialog ref="baseDialog" :title="title" width="900px" left="calc(50% - 450px)" top="calc(50% - 360px)"
|
||||
:closeCallback="closeCallback">
|
||||
<Dialog
|
||||
ref="baseDialog"
|
||||
:title="title"
|
||||
width="900px"
|
||||
left="calc(50% - 450px)"
|
||||
top="calc(50% - 360px)"
|
||||
:closeCallback="closeCallback"
|
||||
>
|
||||
<template #content>
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item" style="display: flex;">
|
||||
<button @click="importHeader" style="margin-right: 15px;">
|
||||
<div class="div-item" style="display: flex">
|
||||
<button @click="importHeader" style="margin-right: 15px">
|
||||
<svg class="icon-updateheigh">
|
||||
<use xlink:href="#icon-importHeader"></use>
|
||||
</svg>{{ t('vector.导入表头') }}
|
||||
<use xlink:href="#icon-importHeader"></use></svg
|
||||
>{{ t('vector.导入表头') }}
|
||||
</button>
|
||||
<button @click="downloadHeader">
|
||||
<svg>
|
||||
<use xlink:href="#icon-download"></use>
|
||||
</svg>{{ t('vector.下载字典模板') }}
|
||||
<use xlink:href="#icon-download"></use></svg
|
||||
>{{ t('vector.下载字典模板') }}
|
||||
</button>
|
||||
<button @click="exportExcel" style="position: absolute; right: 25px;">
|
||||
<button @click="exportExcel" style="position: absolute; right: 25px">
|
||||
<svg>
|
||||
<use xlink:href="#icon-export"></use>
|
||||
</svg>{{ t('vector.导出') }}
|
||||
<use xlink:href="#icon-export"></use></svg
|
||||
>{{ t('vector.导出') }}
|
||||
</button>
|
||||
</div>
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<input type="text" placeholder="输入关键字搜索" v-model="keyword" @input="search">
|
||||
<svg style="position: relative;left: -22px;width: 14px;height: 14px;">
|
||||
<input type="text" placeholder="输入关键字搜索" v-model="keyword" @input="search" />
|
||||
<svg style="position: relative; left: -22px; width: 14px; height: 14px">
|
||||
<use xlink:href="#icon-search"></use>
|
||||
</svg>
|
||||
</div>
|
||||
@ -58,7 +64,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<Pagination :total="total" v-model:page="pageNum" v-model:limit="pageSize" :pageSizes="pageSizes" @pagination="getTableList" />
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="pageNum"
|
||||
v-model:limit="pageSize"
|
||||
:pageSizes="pageSizes"
|
||||
@pagination="getTableList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -89,7 +101,7 @@ const baseDialog: any = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
const keyData: any = ref([])
|
||||
const keyword: any = ref('')
|
||||
const entityOptions: any = ref({});
|
||||
const entityOptions: any = ref({})
|
||||
let originalOptions: any
|
||||
let that: any
|
||||
const tableData: any = ref([])
|
||||
@ -103,7 +115,7 @@ const title = ref('')
|
||||
const closeCallback = () => {
|
||||
entityOptions.value.originalOptions = structuredClone(originalOptions)
|
||||
entityOptions.value.reset()
|
||||
eventBus.emit("destroyComponent")
|
||||
eventBus.emit('destroyComponent')
|
||||
}
|
||||
const getKeys = () => {
|
||||
keyData.value = []
|
||||
@ -126,12 +138,13 @@ let parentNode
|
||||
let features
|
||||
const open = async (id: any) => {
|
||||
// that = window.earth.entityMap.get(id)
|
||||
node = window.treeObj.getNodeByParam("id", id, null);
|
||||
node = window.treeObj.getNodeByParam('id', id, null)
|
||||
entityOptions.value.field = JSON.parse(node.params).field
|
||||
that = getThat(node)
|
||||
console.log(node, that, entityOptions.field, 'yyyyyyyyyyyyyy')
|
||||
if (that.options.id === id) {
|
||||
features = that.geojson.features
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
features = [node.params]
|
||||
}
|
||||
console.log(features, that, id)
|
||||
@ -139,6 +152,7 @@ const open = async (id: any) => {
|
||||
let arr = JSON.parse(JSON.stringify(features))
|
||||
filterData.value = JSON.parse(JSON.stringify(arr))
|
||||
total.value = filterData.value.length
|
||||
console.log(arr, 'arrarrarrarrarrarr')
|
||||
let spliceData = arrSplice(arr, pageSize.value)
|
||||
maxPageNum.value = spliceData.length
|
||||
tableData.value = spliceData[pageNum.value - 1]
|
||||
@ -155,10 +169,9 @@ const getThat = (n) => {
|
||||
if (t) {
|
||||
parentNode = n
|
||||
return t
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (n.parentId) {
|
||||
return getThat(window.treeObj.getNodeByParam("id", n.parentId, null))
|
||||
return getThat(window.treeObj.getNodeByParam('id', n.parentId, null))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -212,30 +225,46 @@ const getTableList = ({ page, limit }) => {
|
||||
maxPageNum.value = spliceData.length
|
||||
tableData.value = spliceData[pageNum.value - 1]
|
||||
}
|
||||
const changeFieId = () => {
|
||||
const changeFieId = async (e) => {
|
||||
console.log(e, 'eeeeeeeee')
|
||||
let data = JSON.parse(node.params)
|
||||
data.field = e
|
||||
let params2 = {
|
||||
id: data.id,
|
||||
sourceName: data.name,
|
||||
params: data,
|
||||
isShow: data.show ? 1 : 0
|
||||
}
|
||||
await TreeApi.updateDirectoryInfo(params2)
|
||||
updateNode(parentNode.children, entityOptions.value.field)
|
||||
}
|
||||
const updateNode = (children, field) => {
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
if (children[i].children) {
|
||||
updateNode(children[i].children, field)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (children[i].params) {
|
||||
cusUpdateNode({ "id": children[i].id, "sourceName": children[i].params.properties[field], "params": children[i].params })
|
||||
cusUpdateNode({
|
||||
id: children[i].id,
|
||||
sourceName:
|
||||
children[i].params.properties[field] === undefined
|
||||
? ''
|
||||
: children[i].params.properties[field],
|
||||
params: children[i].params
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const exportExcel = () => {
|
||||
const exportExcel = async () => {
|
||||
let prepareData: any = [[]]
|
||||
for (let m = 0; m < keyData.value.length; m++) {
|
||||
prepareData[0].push(keyData.value[m].label)
|
||||
}
|
||||
for (let i = 0; i < tableData.value.length; i++) {
|
||||
for (let i = 0; i < filterData.value.length; i++) {
|
||||
let array: any = []
|
||||
for (let m = 0; m < keyData.value.length; m++) {
|
||||
array.push(tableData.value[i].properties[keyData.value[m].key])
|
||||
array.push(filterData.value[i].properties[keyData.value[m].key])
|
||||
}
|
||||
prepareData.push(array)
|
||||
}
|
||||
@ -248,23 +277,23 @@ const exportExcel = () => {
|
||||
}
|
||||
const importHeader = () => {
|
||||
let node
|
||||
let selectNodes = getSelectedNodes(window.treeObj);
|
||||
let selectNodes = getSelectedNodes(window.treeObj)
|
||||
if (selectNodes && selectNodes[selectNodes.length - 1]) {
|
||||
node = selectNodes[selectNodes.length - 1]
|
||||
}
|
||||
const dialogParams = {
|
||||
properties: ["openFile", "multiSelections"],
|
||||
properties: ['openFile', 'multiSelections'],
|
||||
filters: [
|
||||
{
|
||||
name: "excel",
|
||||
extensions: ["csv"],
|
||||
},
|
||||
],
|
||||
};
|
||||
name: 'excel',
|
||||
extensions: ['csv']
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
openDirectoryDialog(dialogParams, (paths) => {
|
||||
if (!paths.length) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
let entity = (window as any)._entityMap.get(node.id)
|
||||
if (!entity) {
|
||||
@ -276,17 +305,21 @@ const importHeader = () => {
|
||||
params.headTables = res.data
|
||||
entity.options.headTables = [...params.headTables]
|
||||
let params2 = {
|
||||
"id": node.id,
|
||||
"sourceName": node.sourceName,
|
||||
"params": params,
|
||||
"isShow": node.isShow ? 1 : 0,
|
||||
id: node.id,
|
||||
sourceName: node.sourceName,
|
||||
params: params,
|
||||
isShow: node.isShow ? 1 : 0
|
||||
}
|
||||
TreeApi.updateDirectoryInfo(params2)
|
||||
cusUpdateNode({ "id": params2.id, "sourceName": params2.sourceName, "params": JSON.stringify(params) })
|
||||
cusUpdateNode({
|
||||
id: params2.id,
|
||||
sourceName: params2.sourceName,
|
||||
params: JSON.stringify(params)
|
||||
})
|
||||
getKeys()
|
||||
}
|
||||
})
|
||||
});
|
||||
})
|
||||
}
|
||||
const downloadHeader = async () => {
|
||||
let p = 'csv'
|
||||
@ -319,10 +352,10 @@ const close = () => {
|
||||
|
||||
function openDirectoryDialog(option, cb) {
|
||||
const { ipcRenderer } = require('electron')
|
||||
ipcRenderer.send("open-directory-dialog", option);
|
||||
ipcRenderer.once("selectedItem", (e, paths) => {
|
||||
cb(paths);
|
||||
});
|
||||
ipcRenderer.send('open-directory-dialog', option)
|
||||
ipcRenderer.once('selectedItem', (e, paths) => {
|
||||
cb(paths)
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
open,
|
||||
@ -370,4 +403,4 @@ defineExpose({
|
||||
padding: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -210,6 +210,15 @@
|
||||
:no-data-text="t('btn.selectNoText')"
|
||||
popper-class="custom-dropdown"
|
||||
>
|
||||
<template #empty>
|
||||
<div
|
||||
class="treeSearchEmpty"
|
||||
style="padding: 10px; text-align: center; color: #909399"
|
||||
>
|
||||
<i class="el-icon-warning-outline"></i>
|
||||
<div>暂无数据</div>
|
||||
</div>
|
||||
</template>
|
||||
<el-option
|
||||
v-for="(item, index) in poiOptions"
|
||||
:key="item.search_key + index"
|
||||
@ -804,4 +813,8 @@ defineExpose({
|
||||
// .custom-dropdown2 {
|
||||
// width: 380px !important;
|
||||
// }
|
||||
.el-select-dropdown__empty,
|
||||
.el-select-dropdown__loading {
|
||||
margin-top: -150px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -160,7 +160,6 @@ eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
||||
if (dynamicComponentRef.value && dynamicComponentRef.value.close) {
|
||||
dynamicComponentRef.value.close()
|
||||
}
|
||||
console.log(sourceType, 'sourceType')
|
||||
switch (sourceType) {
|
||||
case 'directory':
|
||||
editdirectoryBox.value.open()
|
||||
@ -396,7 +395,6 @@ eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
||||
break
|
||||
case 'roam': //飞行漫游
|
||||
case 'flyRoamDialog': //飞行漫游
|
||||
console.log(FlyRoam, 'FlyRoam')
|
||||
currentComponent.value = FlyRoam
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
@ -507,9 +505,9 @@ const createEarth = async () => {
|
||||
// @ts-ignore
|
||||
let options = JSON.parse(localStorage.getItem('defaultView'))
|
||||
YJ.Global.setDefaultView(window.earth, options)
|
||||
setTimeout(() => {
|
||||
new YJ.Tools(window.earth).flyHome()
|
||||
}, 1000)
|
||||
// setTimeout(() => {
|
||||
new YJ.Tools(window.earth).flyHome(0)
|
||||
// }, 1000)
|
||||
// YJ.Global.setDefaultView(window.earth, {
|
||||
// destination: { lng: 100, lat: 30, alt: 10 },
|
||||
// orientation: {
|
||||
|
||||
Reference in New Issue
Block a user