工程导入

This commit is contained in:
2025-10-21 17:59:47 +08:00
parent a2f81dbe29
commit 4f5c0b5095
6 changed files with 131 additions and 116 deletions

View File

@ -11,7 +11,6 @@ declare module 'vue' {
BaseDialog: typeof import('./src/components/dialog/baseDialog.vue')['default']
Directory: typeof import('./src/components/dialog/directory.vue')['default']
DirectoryEdit: typeof import('./src/components/dialog/directoryEdit.vue')['default']
ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
@ -21,7 +20,6 @@ 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']
@ -32,7 +30,6 @@ declare module 'vue' {
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTableV2: typeof import('element-plus/es')['ElTableV2']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTree: typeof import('element-plus/es')['ElTree']

View File

@ -117,17 +117,17 @@
<div class="engineering_title2">
<span class="fankuai"></span>
<span class="setting_title">工程数据</span>
<el-button color="#004b4b" style="border: 1px solid rgba(0, 255, 255, 0.5)">
<template #icon>
<svg-icon name="leading_in" />
</template>
<span>工程覆盖导入</span>
</el-button>
<el-button
@click="importProject"
color="#004b4b"
style="border: 1px solid rgba(0, 255, 255, 0.5)"
>
<template #icon>
<svg-icon name="leading_in" />
</template>
<span>工程覆盖导入</span>
</el-button>
<el-button color="#004b4b" style="border: 1px solid rgba(0, 255, 255, 0.5)">
<template #icon>
<svg-icon name="leading_in" />
</template>
@ -326,10 +326,11 @@ const importProject = () => {
if (paths.length > 0) {
// let loadingInstance = this.$openLoading('拼命导入中...')
importWin = false
// let arr = getElectronPath().replaceAll('\\', '/').split('/')
// arr.pop()
let path: any = 'C:/Users/Administrator/AppData/Roaming/yjearth'
unzip_file(paths[0], path)
let arr = getElectronPath().replaceAll('\\', '/').split('/')
console.log(arr, 'arrarr')
arr.pop()
// let path: any = 'C:/Users/Administrator/AppData/Roaming/yjearth'
unzip_file(paths[0], arr.join('/'))
.then((res) => {
// loadingInstance.close()
ElMessage({
@ -348,6 +349,10 @@ const importProject = () => {
})
.catch((err) => {
console.log(err)
ElMessage({
message: err,
type: 'warning'
})
})
} else {
importWin = false
@ -358,7 +363,7 @@ const importProject = () => {
// import Store from 'electron-store'
const getElectronPath = () => {
const Store = require('electron-store')
let Store = require('electron-store')
const store = new Store()
console.log(store.path)
return store.path
@ -461,11 +466,12 @@ function derive() {
// let loadingInstance = this.$openLoading('拼命导出中...')
exportWin = !exportWin
console.log('111111')
// let arr = getElectronPath().replaceAll('\\', '/').split('/')
// console.log(arr, '222222')
// arr[arr.length - 1] = 'database.ydb'
// let db_path: any = arr.join('/')
let db_path: any = 'C:/Users/Administrator/AppData/Roaming/yjearth/app.db'
let arr = getElectronPath().replaceAll('\\', '/').split('/')
console.log(arr, '222222')
arr.pop()
arr[arr.length - 1] = 'yjearth/app.db'
let db_path: any = arr.join('/')
// let db_path: any = 'C:/Users/Administrator/AppData/Roaming/yjearth/app.db'
zip_file([db_path], path, () => {
// loadingInstance.close()
ElMessage({

View File

@ -75,7 +75,7 @@ import attackArrow from '../components/propertyBox/attackArrow.vue'
import richText from '../components/propertyBox/richText.vue'
import groundText from '../components/propertyBox/groundText.vue'
import standText from '../components/propertyBox/standText.vue'
import circleObject from '../components/propertyBox/circleObject.vue'
import circleObject from '../components/propertyBox/CircleObject.vue'
import addDirectory from '@/components/dialog/directory.vue'
import editDirectory from '@/components/dialog/directoryEdit.vue'
import firstMenu from '@/views/components/leftSide/leftSideFirst.vue'
@ -493,7 +493,7 @@ eventBus.on('defineClickAddLinkCb', (fun) => {
})
const sysChange = async () => {
let systemSetting = JSON.parse(localStorage.getItem('systemSetting')||'{}')
let systemSetting = JSON.parse(localStorage.getItem('systemSetting') || '{}')
const obj = {
compass: systemSetting.showCompass, //罗盘
legend: systemSetting.showDistanceLegend, //比例尺