|
@@ -7,8 +7,8 @@
|
|
|
<el-table class="table-content" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%">
|
|
|
<el-table-column label="序号">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-radio v-model="currentFactor" :label="getRowIndex(scope.$index)"
|
|
|
- @change="changeRowIndex(scope.row)"></el-radio>
|
|
|
+ <el-radio v-model="currentIndex" :label="getRowIndex(scope.$index)"
|
|
|
+ @change="changeRowIndex(getRowIndex(scope.$index), scope.row)"></el-radio>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="选择车辆">
|
|
@@ -51,7 +51,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- currentFactor: "",
|
|
|
+ currentIndex: null,
|
|
|
tableData: [],
|
|
|
carList: [],
|
|
|
algorithmList: [],
|
|
@@ -100,7 +100,13 @@
|
|
|
},
|
|
|
computed: {
|
|
|
getSelectPathText(row) {
|
|
|
- return (row) => "轨迹" + row.pathSort + " (" + row.pathStartJson.name + "," + row.pathEndJson.name + ")";
|
|
|
+ return (row) => {
|
|
|
+ if (row.pathStartJson.name == null || row.pathEndJson.name == null) {
|
|
|
+ return "请选择轨迹";
|
|
|
+ } else {
|
|
|
+ return "轨迹" + row.pathSort + " (" + row.pathStartJson.name + "," + row.pathEndJson.name + ")"
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -125,7 +131,8 @@
|
|
|
getRowIndex(rowIndex) {
|
|
|
return rowIndex + 1;
|
|
|
},
|
|
|
- changeRowIndex(row) {
|
|
|
+ changeRowIndex(index, row) {
|
|
|
+ this.currentIndex = index;
|
|
|
this.selectRow = row;
|
|
|
this.$emit("changeRow", row);
|
|
|
},
|
|
@@ -153,9 +160,20 @@
|
|
|
}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.tableData = res.info.list;
|
|
|
+ this.initCurrentIndex();
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ initCurrentIndex(){
|
|
|
+ this.currentIndex = null;
|
|
|
+ let length = this.tableData.length;
|
|
|
+ for(let index = 0; index < length; index ++){
|
|
|
+ let record = this.tableData[index];
|
|
|
+ if(record.isSimulationCar == 1){
|
|
|
+ this.currentIndex = this.getRowIndex(index);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
getCarList() {
|
|
|
this.$axios({
|
|
|
method: "post",
|
|
@@ -196,6 +214,7 @@
|
|
|
})
|
|
|
},
|
|
|
deleteRecord(row) {
|
|
|
+
|
|
|
this.$confirm('此操作将删除该记录, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
@@ -213,6 +232,7 @@
|
|
|
}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.removeViewTableRecord(row);
|
|
|
+ this.initCurrentIndex();
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -249,7 +269,19 @@
|
|
|
})
|
|
|
},
|
|
|
settingsSimulation() {
|
|
|
- this.$emit("simulationBtnCallBack", this.selectRow);
|
|
|
+ this.$emit("simulationBtnCallBack", this.selectRow, this.settingsSimulationConfirm);
|
|
|
+ },
|
|
|
+ settingsSimulationConfirm(row) {
|
|
|
+ // this.searchSimulation(row.id)
|
|
|
+ },
|
|
|
+ searchSimulation(id) {
|
|
|
+ let length = this.tableData.length;
|
|
|
+ for (let index = 0; index < length; index++) {
|
|
|
+ let record = this.tableData[index];
|
|
|
+ if(record.id == id){
|
|
|
+ this.currentIndex = this.getRowIndex(index);
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
saveAll(mapId) {
|
|
|
this.$axios({
|
|
@@ -346,7 +378,8 @@
|
|
|
}
|
|
|
|
|
|
.delete-btn {
|
|
|
- color: #FFFFFF;
|
|
|
+ background-color: #f56c6c !important;
|
|
|
+ color: #ffffff !important;
|
|
|
border-radius: 0.5rem;
|
|
|
}
|
|
|
|
|
@@ -359,7 +392,9 @@
|
|
|
height: 100%;
|
|
|
overflow-y: scroll;
|
|
|
}
|
|
|
- /deep/ .el-input,/deep/ .el-input__inner{
|
|
|
+
|
|
|
+ /deep/ .el-input,
|
|
|
+ /deep/ .el-input__inner {
|
|
|
width: 100px !important;
|
|
|
}
|
|
|
</style>
|