|
@@ -1,172 +1,94 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <search-layout :needBox="true">
|
|
|
- <template slot="searchItem1">
|
|
|
- <span class="label">配置ID</span>
|
|
|
- <el-input
|
|
|
- v-model="searchParams.configCode"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- placeholder="请输入"
|
|
|
- maxlength="60"
|
|
|
- @keyup.enter.native="doSearch"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- <template slot="searchItem2">
|
|
|
- <span class="label">配置名称</span>
|
|
|
- <el-input
|
|
|
- v-model="searchParams.configName"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- placeholder="请输入"
|
|
|
- maxlength="60"
|
|
|
- @keyup.enter.native="doSearch"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- <template slot="searchItem3">
|
|
|
- <span class="label">配置描述</span>
|
|
|
- <el-input
|
|
|
- v-model="searchParams.configDescription"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- placeholder="请输入"
|
|
|
- maxlength="200"
|
|
|
- @keyup.enter.native="doSearch"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- <template slot="searchItem4">
|
|
|
- <span class="label">车辆名称</span>
|
|
|
- <el-input
|
|
|
- v-model="searchParams.vehicleName"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- placeholder="请输入"
|
|
|
- maxlength="60"
|
|
|
- @keyup.enter.native="doSearch"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- <template slot="searchItem5">
|
|
|
- <span class="label">车辆描述</span>
|
|
|
- <el-input
|
|
|
- v-model="searchParams.vehicleDescription"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- placeholder="请输入"
|
|
|
- maxlength="200"
|
|
|
- @keyup.enter.native="doSearch"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
+ <div v-show="!$route.path.includes('vehicleConfigurationDetail')">
|
|
|
+ <search-layout :needBox="true">
|
|
|
+ <template slot="searchItem1">
|
|
|
+ <span class="label">配置ID</span>
|
|
|
+ <el-input v-model="searchParams.configCode" size="small" clearable placeholder="请输入" maxlength="60"
|
|
|
+ @keyup.enter.native="doSearch(false)">
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template slot="searchItem2">
|
|
|
+ <span class="label">配置名称</span>
|
|
|
+ <el-input v-model="searchParams.configName" size="small" clearable placeholder="请输入" maxlength="60"
|
|
|
+ @keyup.enter.native="doSearch(false)">
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template slot="searchItem3">
|
|
|
+ <span class="label">配置描述</span>
|
|
|
+ <el-input v-model="searchParams.configDescription" size="small" clearable placeholder="请输入"
|
|
|
+ maxlength="200" @keyup.enter.native="doSearch(false)">
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template slot="searchItem4">
|
|
|
+ <span class="label">车辆名称</span>
|
|
|
+ <el-input v-model="searchParams.vehicleName" size="small" clearable placeholder="请输入" maxlength="60"
|
|
|
+ @keyup.enter.native="doSearch(false)">
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template slot="searchItem5">
|
|
|
+ <span class="label">车辆描述</span>
|
|
|
+ <el-input v-model="searchParams.vehicleDescription" size="small" clearable placeholder="请输入"
|
|
|
+ maxlength="200" @keyup.enter.native="doSearch(false)">
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
|
|
|
- <template slot="searchBtn1">
|
|
|
- <el-button type="primary" @click="doSearch">查询</el-button>
|
|
|
- </template>
|
|
|
- <template slot="searchBtn2">
|
|
|
- <el-button type="primary" @click="doReset">重置</el-button>
|
|
|
- </template>
|
|
|
- </search-layout>
|
|
|
+ <template slot="searchBtn1">
|
|
|
+ <el-button type="primary" @click="doSearch(false)">查询</el-button>
|
|
|
+ </template>
|
|
|
+ <template slot="searchBtn2">
|
|
|
+ <el-button type="primary" @click="doReset">重置</el-button>
|
|
|
+ </template>
|
|
|
+ </search-layout>
|
|
|
|
|
|
- <div class="myTabsBox">
|
|
|
- <el-tabs v-model="activeName" type="card" @tab-click="pageControl">
|
|
|
- <el-tab-pane label="公有" name="1"></el-tab-pane>
|
|
|
- <el-tab-pane label="私有" name="2"></el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- <el-button
|
|
|
- v-bind:class="{ addBtn: true, disabled: activeName === '1' }"
|
|
|
- icon="el-icon-circle-plus-outline"
|
|
|
- @click="addOne"
|
|
|
- type="primary"
|
|
|
- :disabled="activeName === '1'"
|
|
|
- >新增</el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
+ <div class="myTabsBox">
|
|
|
+ <el-tabs v-model="activeName" type="card" @tab-click="pageControl">
|
|
|
+ <el-tab-pane label="公有" name="1"></el-tab-pane>
|
|
|
+ <el-tab-pane label="私有" name="2"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-button v-show="activeName === '2'" class="addBtn" icon="el-icon-circle-plus-outline" @click="addOne"
|
|
|
+ type="primary">新增</el-button>
|
|
|
+ <!-- <el-button
|
|
|
+ v-bind:class="{ addBtn: true, disabled: activeName === '1' }"
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ @click="addOne"
|
|
|
+ type="primary"
|
|
|
+ :disabled="activeName === '1'"
|
|
|
+ >新增</el-button
|
|
|
+ > -->
|
|
|
+ </div>
|
|
|
|
|
|
- <tableList
|
|
|
- ref="table"
|
|
|
- class="myTable"
|
|
|
- style="margin: 0 30px"
|
|
|
- :columns="columns"
|
|
|
- :getDataWay="getDataWay"
|
|
|
- :pagination="pagination"
|
|
|
- index
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- label="传感器配置"
|
|
|
- slot="sensorCount"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template v-slot="scope">
|
|
|
- <i
|
|
|
- class="sensorIcon sensorIconA"
|
|
|
- v-show="scope.row.sensorCount.camera"
|
|
|
- title="摄像头"
|
|
|
- ></i
|
|
|
- ><span
|
|
|
- class="sensorCount"
|
|
|
- v-show="scope.row.sensorCount.camera"
|
|
|
- >{{ scope.row.sensorCount.camera }}</span
|
|
|
- >
|
|
|
- <i
|
|
|
- class="sensorIcon sensorIconB"
|
|
|
- v-show="scope.row.sensorCount.ogt"
|
|
|
- title="完美传感器"
|
|
|
- ></i
|
|
|
- ><span
|
|
|
- class="sensorCount"
|
|
|
- v-show="scope.row.sensorCount.ogt"
|
|
|
- >{{ scope.row.sensorCount.ogt }}</span
|
|
|
- >
|
|
|
- <i
|
|
|
- class="sensorIcon sensorIconC"
|
|
|
- v-show="scope.row.sensorCount.lidar"
|
|
|
- title="激光雷达"
|
|
|
- ></i
|
|
|
- ><span
|
|
|
- class="sensorCount"
|
|
|
- v-show="scope.row.sensorCount.lidar"
|
|
|
- >{{ scope.row.sensorCount.lidar }}</span
|
|
|
- >
|
|
|
- <i
|
|
|
- class="sensorIcon sensorIconE"
|
|
|
- v-show="scope.row.sensorCount.gps"
|
|
|
- title="GPS"
|
|
|
- ></i
|
|
|
- ><span
|
|
|
- class="sensorCount"
|
|
|
- v-show="scope.row.sensorCount.gps"
|
|
|
- >{{ scope.row.sensorCount.gps }}</span
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" slot="cgInfos" align="center">
|
|
|
- <template v-slot="scope">
|
|
|
- <i
|
|
|
- v-if="
|
|
|
+ <tableList ref="table" class="myTable" style="margin: 0 30px" :columns="columns" :getDataWay="getDataWay"
|
|
|
+ :pagination="pagination" index>
|
|
|
+ <el-table-column label="传感器配置" slot="sensorCount" align="center">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <i class="sensorIcon sensorIconA" v-show="scope.row.sensorCount.camera" title="摄像头"></i><span
|
|
|
+ class="sensorCount" v-show="scope.row.sensorCount.camera">{{ scope.row.sensorCount.camera
|
|
|
+ }}</span>
|
|
|
+ <i class="sensorIcon sensorIconB" v-show="scope.row.sensorCount.ogt" title="完美传感器"></i><span
|
|
|
+ class="sensorCount" v-show="scope.row.sensorCount.ogt">{{ scope.row.sensorCount.ogt }}</span>
|
|
|
+ <i class="sensorIcon sensorIconC" v-show="scope.row.sensorCount.lidar" title="激光雷达"></i><span
|
|
|
+ class="sensorCount" v-show="scope.row.sensorCount.lidar">{{ scope.row.sensorCount.lidar
|
|
|
+ }}</span>
|
|
|
+ <i class="sensorIcon sensorIconE" v-show="scope.row.sensorCount.gps" title="GPS"></i><span
|
|
|
+ class="sensorCount" v-show="scope.row.sensorCount.gps">{{ scope.row.sensorCount.gps }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" slot="cgInfos" align="center">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <i v-if="
|
|
|
(roleCode === '0' || roleCode === '1') &&
|
|
|
activeName === '2'
|
|
|
- "
|
|
|
- @click="shareRow(scope.row)"
|
|
|
- class="el-icon-share elIcon"
|
|
|
- title="分享"
|
|
|
- ></i>
|
|
|
- <i
|
|
|
- @click="editRow(scope.row)"
|
|
|
- class="el-icon-edit-outline elIcon"
|
|
|
- title="编辑"
|
|
|
- ></i>
|
|
|
- <i
|
|
|
- v-if="activeName === '2'"
|
|
|
- @click="delOne(scope.row)"
|
|
|
- class="el-icon-delete elIcon"
|
|
|
- title="删除"
|
|
|
- ></i>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </tableList>
|
|
|
+ " @click="shareRow(scope.row)" class="el-icon-share elIcon" title="分享"></i>
|
|
|
+ <i @click="editRow(scope.row)" class="el-icon-edit-outline elIcon" title="编辑"></i>
|
|
|
+ <i v-if="((roleCode === '0' || roleCode === '1') && activeName === '1') || activeName === '2'"
|
|
|
+ @click="delOne(scope.row)" class="el-icon-delete elIcon" title="删除"></i>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </tableList>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <router-view v-show="$route.path.includes('vehicleConfigurationDetail')"></router-view>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -243,17 +165,34 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
computed: { ...mapState(["roleCode"]) },
|
|
|
+
|
|
|
+ watch: {
|
|
|
+ $route(to, from) {
|
|
|
+ if (to.name === "vehicleConfigurationList") {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.doSearch(true);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
methods: {
|
|
|
pageControl(data) {
|
|
|
this.activeName = data.name;
|
|
|
- this.doSearch();
|
|
|
+ this.doSearch(false);
|
|
|
},
|
|
|
- doSearch() {
|
|
|
+ // isBack为解决从详情回退时列表在当前页刷新
|
|
|
+ doSearch(isBack = false) {
|
|
|
let pageMap = {
|
|
|
...this.searchParams,
|
|
|
share: this.activeName === "1" ? "1" : "0",
|
|
|
+ resetPageNum: !isBack ? false : (this.pagination.currentPage || 1),
|
|
|
};
|
|
|
+
|
|
|
+ if (!isBack) this.pagination.currentPage = 1;
|
|
|
+
|
|
|
this.refreshList(pageMap);
|
|
|
},
|
|
|
//刷新table
|
|
@@ -276,6 +215,9 @@ export default {
|
|
|
this.$router.push({ path: "/vehicleConfigurationDetail" });
|
|
|
},
|
|
|
editRow(row) {
|
|
|
+ this.$store.commit("getTabname", "vehicleConfigurationDetailTabName", row.configName);
|
|
|
+ localStorage.setItem("vehicleConfigurationDetailTabName", row.configName);
|
|
|
+
|
|
|
this.$router.push({
|
|
|
path: "/vehicleConfigurationDetail",
|
|
|
query: {
|
|
@@ -329,31 +271,30 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
- created() {},
|
|
|
+ created() { },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
.myTable {
|
|
|
.sensorIconA {
|
|
|
- background: url("../../assets/common/image/sensor/001.png") center
|
|
|
- no-repeat;
|
|
|
+ background: url("../../assets/common/image/sensor/001.png") center no-repeat;
|
|
|
}
|
|
|
+
|
|
|
.sensorIconB {
|
|
|
- background: url("../../assets/common/image/sensor/002.png") center
|
|
|
- no-repeat;
|
|
|
+ background: url("../../assets/common/image/sensor/002.png") center no-repeat;
|
|
|
}
|
|
|
+
|
|
|
.sensorIconC {
|
|
|
- background: url("../../assets/common/image/sensor/003.png") center
|
|
|
- no-repeat;
|
|
|
+ background: url("../../assets/common/image/sensor/003.png") center no-repeat;
|
|
|
}
|
|
|
+
|
|
|
.sensorIconD {
|
|
|
- background: url("../../assets/common/image/sensor/004.png") center
|
|
|
- no-repeat;
|
|
|
+ background: url("../../assets/common/image/sensor/004.png") center no-repeat;
|
|
|
}
|
|
|
+
|
|
|
.sensorIconE {
|
|
|
- background: url("../../assets/common/image/sensor/005.png") center
|
|
|
- no-repeat;
|
|
|
+ background: url("../../assets/common/image/sensor/005.png") center no-repeat;
|
|
|
}
|
|
|
|
|
|
.sensorIcon {
|