fix
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
[http]
|
||||
port=8081
|
||||
port=8083
|
||||
address=127.0.0.1
|
||||
|
||||
[title]
|
||||
@ -252,7 +252,7 @@
|
||||
<el-button type="primary" size="mini" @click="handleRouteAdd">新增</el-button>
|
||||
</div>
|
||||
<vxe-table
|
||||
height="300px"
|
||||
height="40%"
|
||||
ref="routeTable"
|
||||
:data="routeData"
|
||||
:row-config="{isCurrent: true, isHover: true, keyField: 'id'}"
|
||||
@ -313,7 +313,7 @@
|
||||
<el-button type="primary" size="mini" @click="handleHideAdd">新增</el-button>
|
||||
</div>
|
||||
<vxe-table
|
||||
height="300px"
|
||||
height="40%"
|
||||
ref="hideTable"
|
||||
:data="hideData"
|
||||
:row-config="{isCurrent: true, isHover: true, keyField: 'id'}"
|
||||
@ -359,8 +359,6 @@
|
||||
import Cookies from 'js-cookie'
|
||||
import axios from 'axios'
|
||||
import iniParser from 'ini-parser'
|
||||
import configIni from '/config.ini';
|
||||
import { saveAs } from 'file-saver';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -436,7 +434,6 @@ export default {
|
||||
.catch((error) => {})
|
||||
},
|
||||
async initMap() {
|
||||
const parsedData = iniParser.parse(configIni);
|
||||
this.viewer = new window.mars3d.Map(
|
||||
'map',
|
||||
{
|
||||
@ -1018,10 +1015,12 @@ export default {
|
||||
},
|
||||
// 保存列表数据
|
||||
suerCofirm() {
|
||||
const parsedData = iniParser.parse(configIni);
|
||||
fetch('./config.ini')
|
||||
.then(response => response.text())
|
||||
.then(text => {
|
||||
const parsedData = iniParser.parse(text);
|
||||
axios.post(`http://${parsedData.http.address}:${parsedData.http.port}/api/equpment`, JSON.stringify(this.tableData), {
|
||||
headers: {
|
||||
'Authorization': 'Bearer your_token_here',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
@ -1030,6 +1029,7 @@ export default {
|
||||
})
|
||||
.catch(error => {
|
||||
});
|
||||
});
|
||||
},
|
||||
// 导入json文件
|
||||
triggerFileUpload() {
|
||||
@ -2393,18 +2393,19 @@ export default {
|
||||
handleExport() {
|
||||
const hideData = []
|
||||
if (this.factoriesWithVehicles.length > 0) {
|
||||
this.factoriesWithVehicles.forEach((item) => [
|
||||
this.factoriesWithVehicles.forEach((item, index) => [
|
||||
hideData.push({
|
||||
FID_1: item.options.style.properties.FID_1,
|
||||
vehiclesNum: (item.vehicles.map(e => e.name)).join(','),
|
||||
area: item.area.toFixed(2)
|
||||
area: item.area.toFixed(2),
|
||||
id: index
|
||||
})
|
||||
])
|
||||
}
|
||||
this.hideData = JSON.parse(JSON.stringify(hideData))
|
||||
const routeData = []
|
||||
if (this.infoList.length > 0) {
|
||||
this.infoList.forEach((item) => [
|
||||
this.infoList.forEach((item, index) => [
|
||||
routeData.push({
|
||||
编码: item.编码,
|
||||
名称: item.名称,
|
||||
@ -2413,6 +2414,7 @@ export default {
|
||||
载重吨: item.载重吨,
|
||||
水深: item.水深,
|
||||
净空高: item.净空高,
|
||||
id: index
|
||||
})
|
||||
])
|
||||
}
|
||||
@ -2430,8 +2432,14 @@ export default {
|
||||
水深: null,
|
||||
净空高: null,
|
||||
editing: true,
|
||||
id: this.routeData.length + 1
|
||||
};
|
||||
this.routeData.push(newRow);
|
||||
// 等待数据更新后滚动到新增的行
|
||||
setTimeout(() => {
|
||||
this.$refs.routeTable.refreshScroll(); // 刷新滚动
|
||||
this.$refs.routeTable.scrollToRow(newRow, 'id');
|
||||
}, 50);
|
||||
},
|
||||
handleRouteDelete(row) {
|
||||
const index = this.routeData.findIndex(item => item.id === row.id);
|
||||
@ -2454,6 +2462,11 @@ export default {
|
||||
editing: true,
|
||||
};
|
||||
this.hideData.push(newRow);
|
||||
// 等待数据更新后滚动到新增的行
|
||||
setTimeout(() => {
|
||||
this.$refs.hideTable.refreshScroll(); // 刷新滚动
|
||||
this.$refs.hideTable.scrollToRow(newRow, 'id');
|
||||
}, 50);
|
||||
},
|
||||
handleHideDelete(row) {
|
||||
const index = this.hideData.findIndex(item => item.id === row.id);
|
||||
@ -2483,9 +2496,24 @@ export default {
|
||||
hideData: this.hideData,
|
||||
routeData: this.routeData,
|
||||
}, null, 2)
|
||||
const blob = new Blob([info], { type: 'application/json;charset=utf-8' })
|
||||
saveAs(blob, '机动路线规划.json')
|
||||
this.closeExport()
|
||||
// const blob = new Blob([info], { type: 'application/json;charset=utf-8' })
|
||||
// saveAs(blob, '机动路线规划.json')
|
||||
// this.closeExport()
|
||||
fetch('./config.ini')
|
||||
.then(response => response.text())
|
||||
.then(text => {
|
||||
const parsedData = iniParser.parse(text);
|
||||
axios.post(`http://${parsedData.http.address}:${parsedData.http.port}/api/route`, info, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
this.$message.success('导出成功')
|
||||
})
|
||||
.catch(error => {
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user