Forráskód Böngészése

路线站点管理

yanliming 4 éve
szülő
commit
2b4b65d333

+ 56 - 0
src/api/bus/routeInfo.js

@@ -0,0 +1,56 @@
+import request from '@/utils/request'
+import constant from '@/constant'
+
+
+function pageList(formData) {
+  return request.post(constant.serverUrl + "/bus/routeInfo/pageList", formData);
+}
+
+function create() {
+  return request.get(constant.serverUrl + "/bus/routeInfo/create");
+}
+
+function edit(id) {
+  return request.get(constant.serverUrl + "/bus/routeInfo/edit/" + id);
+}
+
+function add(formModel) {
+  return request.post(constant.serverUrl + "/bus/routeInfo/add", formModel, {
+    headers: {
+      "Content-Type": "application/json"
+    }
+  });
+}
+
+function update(formModel) {
+  return request.post(constant.serverUrl + "/bus/routeInfo/update", formModel, {
+    headers: {
+      "Content-Type": "application/json"
+    }
+  });
+}
+
+function remove(id) {
+  return request.post(constant.serverUrl + "/bus/routeInfo/delete/" + id);
+}
+
+function batchRemove(idList) {
+  return request.post(constant.serverUrl + "/bus/routeInfo/batchDelete", idList, {
+    headers: {
+      "Content-Type": "application/json"
+    }
+  });
+}
+
+function updateMapPath(formModel) {
+  return request.post(constant.serverUrl + "/bus/routeInfo/updateMapPath", formModel,{
+    headers: {
+      "Content-Type": "application/json"
+    }
+  });
+}
+
+
+export default {
+  create, edit, add, update, remove, batchRemove, pageList,updateMapPath
+}

+ 12 - 0
src/routers/modules/bus.js

@@ -35,6 +35,18 @@ var routers = [
                         title: '车辆管理'
                 }
         },
+        {
+                path: '/bus/routeInfo/list',
+                name: 'BusRouteInfoList',
+                // route level code-splitting
+                // this generates a separate chunk (about.[hash].js) for this route
+                // which is lazy-loaded when the route is visited.
+                component: () => import('@/views/bus/routeInfo-list.vue'),
+                meta: {
+                        roles: ["admin"],
+                        title: '线路管理'
+                }
+        },
 ]
 
 export default routers;

+ 3 - 8
src/views/bus/driverInfo-list.vue

@@ -153,13 +153,6 @@
       :title="modalTitle"
       @close="onDetailModalClose"
     ></driverInfo-detail>
-    <el-select-tree
-      size="mini"
-      :props="props"
-      :options="companyResult"
-      v-model="queryModel.companyId"
-      height="200"
-    ></el-select-tree>
     <el-dialog
       title="导入"
       :visible.sync="batchImportVisible"
@@ -297,7 +290,9 @@ export default {
       formData.append("pageIndex", self.pageIndex);
       formData.append("pageSize", self.pageSize);
 
-      formData.append("companyId", self.queryModel.companyId);
+      if(self.queryModel.companyId!=null){
+          formData.append("companyId", self.queryModel.companyId);
+      }
       formData.append("name", self.queryModel.name);
       formData.append("idCard", self.queryModel.idCard);
       formData.append("phone", self.queryModel.phone);

+ 0 - 0
src/views/bus/routeInfo-cost.vue


+ 449 - 0
src/views/bus/routeInfo-detail.vue

@@ -0,0 +1,449 @@
+
+<style scoped>
+.user-panel {
+  margin: 10px auto;
+}
+</style>
+<template>
+<div>
+  <el-dialog
+    :visible.sync="showDialog"
+    :title="title"
+    :modal-append-to-body="false"
+    style="text-align: left"
+    width="75%"
+    @close="closeDialog"
+    :close-on-click-modal="false"
+  >
+    <div class="user-panel" v-loading="loading">
+      <el-form
+        ref="form"
+        :model="formModel"
+        :rules="ruleValidate"
+        :label-width="'130px'"
+        :inline="true"
+      >
+          <el-form-item label="所属公司" prop="companyId">
+            <el-select-tree
+              :props="props"
+              :options="companyResult"
+              v-model="formModel.companyId"
+              size="mediumn"
+              width="400px"
+            ></el-select-tree>
+          </el-form-item>
+
+          <el-form-item label="路线名称" prop="name">
+              <el-input
+                v-model="formModel.name"
+                placeholder="请输入路线名称"
+                style="width:400px"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="开始时间" prop="startTime">
+                <el-time-select
+                v-model="formModel.startTime"
+                placeholder="开始时间"
+                value-format="HH:mm"
+                style="width:400px"
+                :picker-options="{
+                    start: '00:00',
+                    step: '00:30',
+                    end: '23:30'
+                }"
+                >
+            </el-time-select>
+            </el-form-item>
+           <el-form-item label="结束时间" prop="endTime">
+                <el-time-select
+                v-model="formModel.endTime"
+                placeholder="结束时间"
+                style="width:400px"
+                :picker-options="{
+                    start: '00:00',
+                    step: '00:30',
+                    end: '23:30'
+                }">
+                </el-time-select>
+            </el-form-item>
+          <h5>车辆站点信息</h5>
+          <el-table :data="formModel.stationList">
+            <el-table-column type="index" label="序号" width="55"></el-table-column>
+            <el-table-column prop="name" label="站点名称">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'stationList.' + scope.$index + '.name'"
+                  :rules="ruleValidate['name']"
+                >
+                  <el-input placeholder="站点名称" style="width:200px" v-model="scope.row.name"></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="classify" label="站点类型">
+              <template slot-scope="{row}">
+                  <el-form-item>
+                    <el-select v-model="row.classify" placeholder="请选择" style="width:150px;">
+                        <el-option
+                        v-for="result in stationClassify"
+                        :key="result.id"
+                        :label="result.name"
+                        :value="result.value"
+                        ></el-option>
+                    </el-select>
+                  </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="location" label="站点定位">
+              <template slot-scope="{row}">
+                <el-form-item>
+                  <el-input placeholder="经纬度" style="width:200px" v-model="row.location"></el-input>
+                  <i class="el-icon-map-location my-font" @click="handleLocation(row)"></i>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="200">
+              <template slot-scope="{row}">
+                <el-form-item>
+                  <i class="el-icon-delete my-font" @click="handleDelete(row)"></i>
+                  <i class="el-icon-top my-font" @click="handleUp(row)"></i>
+                  <i class="el-icon-bottom my-font" @click="handleDown(row)"></i>
+                  <i class="el-icon-document-add my-font" @click="handleInsert(row)"></i>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <div slot="empty">
+              <el-button icon="el-icon-circle-plus-outline" :plain="true" @click="handleAdd()">新增</el-button>
+            </div>
+          </el-table>
+
+
+      </el-form>
+        <div class="el-table__empty-block" v-if="formModel.stationList.length!=0">
+          <el-button icon="el-icon-circle-plus-outline" @click="handleAdd()">新增</el-button>
+        </div>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="closeDialog">取 消</el-button>
+      <el-button type="primary" @click="handleSubmit" :loading="submitting"
+        >确 定</el-button
+      >
+    </span>
+  </el-dialog>
+      <el-dialog
+      :visible.sync="showMapDialog"
+      title="地图选点"
+      :modal-append-to-body="true"
+      :append-to-body="true"
+      style="text-align:left;"
+      :close-on-click-modal="false"
+    >
+      <el-amap
+        ref="stationMap"
+        vid="stationMap"
+        :amap-manager="amapManager"
+        :center="pointPosition"
+        :zoom="zoom"
+        :events="events"
+        class="amap-demo"
+      >
+        <el-amap-marker vid="amapDemo" :position="pointPosition"></el-amap-marker>
+      </el-amap>
+      <span slot="footer" class="dialog-footer">
+        <div style="position:absolute;left:20px;bottom:20px;">
+          <el-input placeholder="当前经纬度" v-model="selectedRow.location" 
+          style="width:400px;">
+            <template slot="prepend">经纬度</template>
+            <el-button slot="append" icon="el-icon-search" @click="handleRegeo">定位</el-button>
+          </el-input>
+        </div>
+        <el-button @click="showMapDialog=false;">取 消</el-button>
+        <el-button type="primary" @click="handleSelectPoint()">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import Constant from "@/constant";
+import routeInfoApi from "@/api/bus/routeInfo";
+import SelectTree from "@/components/SelectTree";
+import companyInfoApi from "@/api/bus/companyInfo";
+import dataDictionaryApi from "@/api/sys/dataDictionary";
+
+import { getToken } from "@/utils/auth"; // get token from cookie
+
+import AMap from "vue-amap";
+let amapManager = new AMap.AMapManager();
+
+export default {
+  props: ["businessKey", "title"],
+  data() {
+    return {
+      formModel: {
+        enableChangeParent: false,
+        id: "",
+        name: "",
+        companyId: "",
+        goodsId: "",
+        stationList: [],
+        removeStationList: []
+      },
+      ruleValidate: {
+        companyId: [
+          { required: true, message: "所属单位不能为空", trigger: "blur" },
+        ],
+        name: [
+          { required: true, message: "车牌号不能为空", trigger: "blur" },
+        ],
+        startTime: [
+          { required: true, message: "开始时间不能为空", trigger: "blur" },
+        ],
+        endTime: [
+          { required: true, message: "结束时间不能为空", trigger: "blur" },
+        ],
+      },
+      showDialog: true,
+      loading: false,
+      submitting: false,
+      stationClassify: [],
+      //上传地址
+      uploadUrl: Constant.serverUrl + "/uploadPicture",
+      uploadData: {
+        subFolder: "vehicleInfo",
+      },
+      fileUrl: "",
+      headers: {
+        Authorization: getToken(),
+      },
+      companyResult: [],
+      typeData: [],
+      treeData: [],
+      selectedRow: {},
+      pointPosition: [112.240222, 30.337053],
+      showMapDialog: false,
+      amapManager,
+      zoom: 12,
+      events: {
+        click: e => {
+          var pt = e.lnglat; //点击选择新地址为中心点
+          console.log(pt);
+
+          this.pointPosition = [pt.lng, pt.lat];
+          this.selectedRow.location = pt.lng + "," + pt.lat;
+        }
+      },
+      props: {
+        // 配置项(必选)
+        value: "id",
+        label: "name",
+        children: "children",
+      },
+      sceneData: [],
+      regionData: [],
+    };
+  },
+  created() {
+    var self = this;
+
+    var formData = new FormData();
+    formData.append("catalogName", "站点类型");
+
+    dataDictionaryApi.findByCatalogName(formData).then(response => {
+      var jsonData = response.data;
+      this.stationClassify = jsonData.data;
+    });
+
+    companyInfoApi.treeList().then(function (response) {
+      var jsonData = response.data;
+      if (jsonData.result) {
+        self.companyResult = jsonData.data;
+      }
+    });
+  },
+  methods: {
+    closeDialog() {
+      this.$emit("close", false);
+    },
+    handleSubmit() {
+      var self = this;
+
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          (function () {
+            var id = self.formModel.id;
+
+            if (self.formModel.parentId == null) {
+              self.formModel.parentId = "";
+            }
+
+            if (self.formModel.relationCompanyId == null) {
+              self.formModel.relationCompanyId = "";
+            }
+
+            if (id == null || id.length == 0) {
+              return routeInfoApi.add(self.formModel);
+            } else {
+              return routeInfoApi.update(self.formModel);
+            }
+          })().then(function (response) {
+            var jsonData = response.data;
+
+            if (jsonData.result) {
+              self.$message({
+                message: "保存成功!",
+                type: "success",
+              });
+
+              self.$emit("close", true);
+            } else {
+              self.$message({
+                message: jsonData.message + "",
+                type: "warning",
+              });
+
+              self.$emit("close", false);
+            }
+          });
+        }
+      });
+    },
+    handleAvatarSuccess(res, file) {
+      var self = this;
+      self.formModel.picture = res.data;
+      self.fileUrl =
+        res.data + "?x-oss-process=image/resize,m_lfit,h_400,w_400";
+    },
+    beforeAvatarUpload(file) {
+      const isJPG = file.type === "image/jpeg";
+      const isLt2M = file.size / 1024 / 1024 < 2;
+
+      if (!isJPG) {
+        this.$message.error("上传头像图片只能是 JPG 格式!");
+      }
+      if (!isLt2M) {
+        this.$message.error("上传头像图片大小不能超过 2MB!");
+      }
+      return isJPG && isLt2M;
+    },
+    handleLocation(row) {
+      this.selectedRow = row;
+      this.showMapDialog = true;
+
+      if (row.location != null && row.location.length > 0) {
+        var arr = row.location.split(",");
+
+        this.pointPosition = arr;
+      }
+    },
+    handleAdd() {
+      this.formModel.stationList.push({
+        sortNo: this.formModel.stationList.length + 1,
+        name: "",
+        routeId: this.businessKey,
+        classify: "",
+        location: "",
+        delFlag: 0
+      });
+    },
+    handleInsert(row) {
+      var stationList = this.formModel.stationList;
+      var index = stationList.indexOf(row);
+
+      if(index>=0){
+        stationList.splice(index+1,0,{
+          sortNo: index + 2,
+          name: "",
+          routeId: this.businessKey,
+          classify: "",
+          location: "",
+          delFlag: 0
+        });
+      }
+    },
+    handleRegeo(){
+      var row = this.selectedRow;
+
+      if (row.location != null && row.location.length > 0) {
+        var arr = row.location.split(",");
+        this.pointPosition = arr;
+      }
+    },
+    handleSelectPoint() {
+      this.selectedRow.location =
+        this.pointPosition[0] + "," + this.pointPosition[1];
+      this.showMapDialog = false;
+    },
+    handleDelete(row) {
+      var stationList = this.formModel.stationList;
+
+      stationList.splice(stationList.indexOf(row), 1);
+
+      this.formModel.removeStationList.push(row);
+    },
+    handleUp(row) {
+      var stationList = this.formModel.stationList;
+      var index = stationList.indexOf(row);
+
+      if(index>0){
+        stationList.splice(index, 1);
+        stationList.splice(index-1,0,row);
+      }
+    },
+    handleDown(row) {
+      var stationList = this.formModel.stationList;
+      var index = stationList.indexOf(row);
+
+      if(index<stationList.length-1){
+        stationList.splice(index, 1);
+        stationList.splice(index+1,0,row);
+      }
+    },
+  },
+  components: {
+    "el-select-tree": SelectTree,
+  },
+  mounted: function () {
+    var self = this;
+    (function () {
+      if (self.businessKey.length == 0) {
+        return routeInfoApi.create();
+      } else {
+        return routeInfoApi.edit(self.businessKey);
+      }
+    })()
+      .then((response) => {
+        var jsonData = response.data;
+        self.loading = false;
+
+        if (jsonData.result) {
+          self.formModel = jsonData.data;
+          let picture = self.formModel.picture;
+          if (picture != null) {
+            self.fileUrl =
+              picture + "?x-oss-process=image/resize,m_lfit,h_400,w_400";
+          }
+        } else {
+          self.$message.error(jsonData.message + "");
+        }
+      })
+      .catch((error) => {
+        self.$message.error(error + "");
+      });
+  },
+};
+</script>
+<style scoped>
+.user-panel {
+  margin: 10px auto;
+}
+
+.amap-demo {
+  width: 100%;
+  height: 400px;
+}
+
+.my-font {
+  font-size: 20px;
+  cursor: pointer;
+  margin-right: 10px;
+}
+</style>

+ 608 - 0
src/views/bus/routeInfo-list.vue

@@ -0,0 +1,608 @@
+<template>
+  <div style="padding-left: 5px">
+    <el-breadcrumb separator=">">
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
+      <el-breadcrumb-item>
+        <a href="#">基础信息管理</a>
+      </el-breadcrumb-item>
+      <el-breadcrumb-item>
+        <a href="/routeInfo">线路管理</a>
+      </el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-divider></el-divider>
+    <el-form
+      ref="queryForm"
+      :model="queryModel"
+      inline
+      class="demo-form-inline"
+    >
+      <el-form-item label="所属公司" prop="companyId">
+        <el-select-tree
+          size="mini"
+          :props="props"
+          :options="companyResult"
+          v-model="queryModel.companyId"
+          height="200"
+        ></el-select-tree
+        >
+      </el-form-item>
+      <el-form-item label="路线名称" prop="name">
+        <el-input type="text" size="mini" v-model="queryModel.name"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          size="mini"
+          icon="ios-search"
+          @click="changePage(1)"
+          :loading="loading"
+          >查询</el-button
+        >&nbsp;
+        <el-button
+          type="info"
+          size="mini"
+          style="margin-left: 8px"
+          @click="handleReset('queryForm')"
+          >重置</el-button
+        >&nbsp;
+      </el-form-item>
+    </el-form>
+    <el-divider></el-divider>
+    <el-row class="button-group">
+      <el-button
+        type="primary"
+        size="small"
+        plain
+        icon="el-icon-circle-plus"
+        @click="handleAdd"
+        >新增</el-button
+      >
+      <el-button
+        type="primary"
+        size="small"
+        plain
+        icon="el-icon-remove"
+        :disabled="multipleSelection.length == 0"
+        @click="handleBatchDelete"
+        >删除选中项</el-button
+      >
+      <el-button
+        type="primary"
+        size="small"
+        plain
+        icon="el-icon-upload2"
+        @click="batchImportVisible = true"
+        >导入</el-button
+      >
+    </el-row>
+    <el-table
+      ref="formTable"
+      :data="tableData"
+      v-loading="loading"
+      stripe
+      :height="tableHeight"
+      @sort-change="sortChange"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55"></el-table-column>
+    <el-table-column
+        prop="companyName"
+        label="所属单位"
+        width="130"
+      ></el-table-column>
+      <el-table-column
+        prop="name"
+        label="路线名称"
+        width="150"
+      ></el-table-column>
+      <el-table-column
+        prop="startTime"
+        label="开始时间"
+        width="200"
+      ></el-table-column>
+      <el-table-column
+        prop="endTime"
+        label="结束时间"
+        width="200"
+      ></el-table-column>
+      <el-table-column label="操作" >
+        <template slot-scope="{ row }">
+            <el-button size="mini" type="warning" @click="handleEdit(row)">编辑</el-button>
+            <el-button size="mini" type="success" @click="handleEditPath(row)">路线绘制</el-button>
+            <el-button size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      :current-page.sync="pageIndex"
+      :total="totalElements"
+      :page-sizes="pageSizeList"
+      @current-change="changePage"
+      @size-change="pageSizeChange"
+      layout="total, sizes, prev, pager, next, jumper"
+    ></el-pagination>
+    <routeInfo-detail
+      v-if="showModal"
+      :businessKey="businessKey"
+      :title="modalTitle"
+      @close="onDetailModalClose"
+    ></routeInfo-detail>
+      <el-dialog
+            width="80%"
+            :visible.sync="showMapDialog"
+            title="路线绘制"
+            :modal-append-to-body="true"
+            :append-to-body="true"
+            style="text-align:left;"
+            :close-on-click-modal="false"
+            v-loading="mapLoading"
+    >
+        <el-amap
+                ref="roadlineMap"
+                vid="roadlineMap"
+                :plugin="plugin"
+                :center="centerPoint"
+                :zoom="15"
+                style="width:100%;height:400px;"
+        >
+            <!--站点-->
+            <el-amap-marker :zIndex="1"
+                            v-for="station in stationList"
+                            :key="station.id"
+                            :position="station.position"
+                            :title="station.title"></el-amap-marker>
+            <!--路线-->
+            <el-amap-polyline :path="mapPath"
+                              :zIndex="2"
+                              :isOutline="true"
+                              :outlineColor="'#ffeeff'"
+                              :borderWeight="3"
+                              :strokeColor="'#3366FF'"
+                              :strokeOpacity="1"
+                              :strokeWeight="6"
+                              :strokeStyle="'solid'"
+                              :strokeDasharray="[10, 5]"
+                              :lineJoin="'round'"
+                              :lineCap="'round'"
+                              :editable="true"
+            ></el-amap-polyline>
+        </el-amap>
+        <span slot="footer" class="dialog-footer">
+        <el-button @click="handleConnectStation()">站点连线</el-button>
+        <el-button @click="handleMapPathConfirm()">确定</el-button>
+        <el-button @click="showMapDialog=false;">关闭</el-button>
+    </span>
+    </el-dialog>
+    <el-dialog
+      title="导入"
+      :visible.sync="batchImportVisible"
+      :modal-append-to-body="false"
+      style="text-align: left"
+      :close-on-click-modal="false"
+    >
+      <el-form label-width="150px">
+        <el-form-item label="模板下载">
+          <el-link
+            href="http://rccs.oss-cn-hangzhou.aliyuncs.com/smart-bus/excel/routeInfo.xls"
+            type="primary"
+            target="_blank"
+            >点击下载模板</el-link
+          >
+        </el-form-item>
+        <el-form-item label="上传文件">
+          <el-upload
+            class="upload-demo"
+            accept=".xls"
+            :action="uploadUrlXls"
+            :data="uploadXlsData"
+            :headers="headers"
+            :on-preview="handleBatchImportPreview"
+            name="uploadFile"
+            :multiple="true"
+            :limit="1"
+            :on-remove="handleBatchImportRemove"
+            :before-remove="beforeBatchImportRemove"
+            :before-upload="beforeUpload"
+            :on-exceed="handleBatchImportExceed"
+            :on-success="handleBatchImportSuccess"
+            :file-list="batchImportFileList"
+          >
+            <el-button size="small" type="primary" :loading="xlsLoading"
+              >点击上传</el-button
+            >
+            <div slot="tip" class="el-upload__tip">
+              只能上传xls文件,且不超过500kb
+            </div>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="batchImportVisible = false"
+          >关 闭</el-button
+        >
+      </div>
+    </el-dialog>
+    <!--批量导入E-->
+  </div>
+</template>
+<script>
+import Constant from "@/constant";
+import routeInfoDetail from "./routeInfo-detail";
+import routeInfoApi from "@/api/bus/routeInfo";
+import SelectTree from "@/components/SelectTree";
+import companyInfoApi from "@/api/bus/companyInfo";
+
+import { getToken } from "@/utils/auth"; // get token from cookie
+import "nprogress/nprogress.css"; // progress bar style
+
+export default {
+  name: "BusDriverInfoList",
+  data() {
+    var self = this;
+    return {
+      activeName: "list",
+      queryModel: {
+        name: "",
+        companyId: "",
+      },
+      loading: false,
+      tableData: [],
+      treeData: [],
+      pageIndex: 1,
+      pageSize: 10,
+      totalPages: 0,
+      totalElements: 0,
+      field: "",
+      direction: "",
+      pageSizeList: [10, 20, 30],
+      multipleSelection: [],
+      showModal: false,
+      modalTitle: "",
+      businessKey: "",
+      tableHeight: 300,
+      showDeviceModal: false,
+      companyId: "",
+      qrCode: "",
+      companyResult: [],
+      props: {
+        // 配置项(必选)
+        value: "id",
+        label: "name",
+        children: "children",
+      },
+      batchImportVisible: false,
+      batchImportFileList: [],
+      showMapDialog: false,
+      uploadUrlXls: Constant.serverUrl + "/bus/routeInfo/importXls",
+      uploadXlsData: {
+        subFolder: "driver",
+      },
+      headers: {
+        Authorization: getToken(),
+      },
+      xlsLoading: false,
+      sceneData: [],
+      typeData:[],
+      selectRoute: null,
+      centerPoint: [112.276585, 30.306401],
+      stationList: [
+          {id: 1, position: [112.276585, 30.306401], content: ''},
+          {id: 2, position: [112.275276, 30.306827], content: ''}
+      ],
+      mapPath: [[112.276585, 30.306401], [112.275276, 30.306827]],
+    };
+  },
+  created() {
+    var self = this;
+
+    companyInfoApi.treeList().then(function (response) {
+      var jsonData = response.data;
+      if (jsonData.result) {
+        self.companyResult = jsonData.data;
+      }
+    });
+
+    this.changePage(1);
+  },
+  methods: {
+    changePage(pageIndex) {
+        var self = this;
+
+        self.loading = true;
+
+        self.pageIndex = pageIndex;
+        var formData = new FormData();
+
+        formData.append("pageIndex", self.pageIndex);
+        formData.append("pageSize", self.pageSize);
+
+        if(self.queryModel.companyId!=null){
+            formData.append("companyId", self.queryModel.companyId);
+        }
+        
+        formData.append("name", self.queryModel.name);
+
+
+
+      routeInfoApi
+        .pageList(formData)
+        .then(function (response) {
+          self.loading = false;
+
+          var jsonData = response.data.data;
+
+          self.tableData = jsonData.data;
+          self.totalPages = jsonData.totalPages;
+          self.totalElements = jsonData.recordsTotal;
+          //45为分页栏的高度
+          //页面高度-列表上面的高度-分页栏高度
+          self.tableHeight =
+            window.innerHeight - self.$refs.formTable.$el.offsetTop - 100;
+        })
+        .catch((error) => {
+          self.loading = false;
+          // self.$message.error(error + "");
+        });
+    },
+    pageSizeChange(pageSize) {
+      this.pageSize = pageSize;
+    },
+    sortChange(data) {
+      this.field = data.column.field;
+      this.direction = data.order == "ascending" ? "asc" : "desc";
+
+      this.changePage(this.pageIndex);
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+    handleReset(name) {
+      this.$refs[name].resetFields();
+      this.queryModel.companyId = "";
+    },
+    handleAdd() {
+      this.modalTitle = "新增";
+      this.businessKey = "";
+      this.showModal = true;
+    },
+    handleEdit(record) {
+      this.modalTitle = "编辑";
+      this.businessKey = record.id;
+      this.showModal = true;
+    },
+    handleDelete(record) {
+      var self = this;
+
+      self
+        .$confirm("是否确认删除?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+        .then(() => {
+          routeInfoApi.remove(record.id).then(function (response) {
+            var jsonData = response.data;
+
+            if (jsonData.result) {
+              // var index = self.tableData.indexOf(record);
+              // self.tableData.splice(index, 1);
+              self.changePage(self.pageIndex);
+
+              self.$message({
+                type: "success",
+                message: "删除成功!",
+              });
+            }
+          });
+        });
+    },
+    handleBatchDelete() {
+      var self = this;
+
+      var idList = this.multipleSelection.map((record) => {
+        return record.id;
+      });
+
+      this.$confirm("是否确认删除选中项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        routeInfoApi.batchRemove(idList).then(function (response) {
+          var jsonData = response.data;
+
+          if (jsonData.result) {
+            self.changePage(self.pageIndex);
+
+            self.$message({
+              type: "success",
+              message: "删除成功!",
+            });
+          }
+        });
+      });
+    },
+    onDetailModalClose(refreshed) {
+      //保存成功后回调
+      this.showModal = false;
+      this.showDeviceModal = false;
+
+      if (refreshed) {
+        this.changePage(this.pageIndex);
+      }
+    },
+
+    beforeUpload(file, fileList) {
+      //导入前判断
+    },
+    //批量导入-上传成功
+    handleBatchImportSuccess(response, file, fileList) {
+      var self = this;
+      self.xlsLoading = false;
+      if (response.result) {
+        self.$message.success(response.message);
+        this.batchImportFileList = [];
+        this.changePage(1);
+        this.uploadCompanyId = "";
+        this.uploadXlsData.companyId = "";
+        this.batchImportVisible = false;
+      } else {
+        //this.$message.error(response.message);
+        this.batchImportFileList = [];
+        this.changePage(1);
+        this.uploadCompanyId = "";
+        this.uploadXlsData.companyId = "";
+
+        if (response.data != null) {
+          //下载有错误信息提示的报表
+          //window.open(response.data);
+          self.$message({
+            showClose: true,
+            dangerouslyUseHTMLString: true,
+            message:
+              response.message +
+              `,<a href="${response.data}" target="_blank">点击下载未导入的数据报表</a>&nbsp;`,
+            duration: 30000,
+          });
+        }
+      }
+    },
+    //批量导入-预览
+    handleBatchImportPreview(file) {
+      console.log(file.url);
+    },
+    //批量导入-移除
+    handleBatchImportRemove(file, fileList) {
+      console.log(file, fileList);
+    },
+    //批量导入-移除前操作
+    beforeBatchImportRemove(file, fileList) {
+      console.log(file, fileList);
+    },
+    //批量导入-文件超出个数限制时的钩子
+    handleBatchImportExceed(files, fileList) {
+      this.$message.warning(
+        `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
+          files.length + fileList.length
+        } 个文件`
+      );
+    },
+    handleMapPathConfirm() {
+        this.mapLoading = true;
+
+        var pathList = this.mapPath.map((item) => {
+            return item.lng + "," + item.lat;
+        });
+
+        routeInfoApi.updateMapPath({
+            id: this.selectRoute.id,
+            pathList: pathList
+        }).then(response => {
+            this.mapLoading = false;
+
+            var jsonData = response.data;
+
+            if (jsonData.result) {
+                this.showMapDialog = false;
+                this.$message.success("保存成功!");
+            } else {
+                this.$message.warning("系统错误!" + jsonData.message);
+            }
+        });
+    },
+    handleConnectStation() {
+        this.$confirm("是否确认根据站点重新绘制路线?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+        })
+            .then(() => {
+                this.mapPath = [];
+                this.stationList.forEach((item) => {
+                    this.mapPath.push(item.position);
+                });
+            });
+    },
+    handleEditPath(row) {
+        //读取当前路线的站点
+        this.loading = true;
+
+        routeInfoApi.edit(row.id).then(response => {
+            this.loading = false;
+
+            var jsonData = response.data;
+            var model = jsonData.data;
+
+            var _stationList = model.stationList;
+
+            if (model.pathList != null) {
+                this.mapPath = model.pathList.map((item) => {
+                    return item.split(",");
+                });
+
+                this.centerPoint = this.mapPath[0];
+            } else {
+                this.mapPath = [];
+            }
+
+            if (_stationList.length <= 1) {
+                this.$message.warning("请先至少设置2个站点!");
+            } else {
+                this.selectRoute = row;
+                this.showMapDialog = true;
+
+                this.stationList = [];
+
+                var initMapPath = this.mapPath.length == 0;
+
+                _stationList.forEach((item) => {
+                    if (item.location != null && item.location.length > 0) {
+                        var station = {
+                            id: item.id,
+                            title: item.name,
+                            position: item.location.split(",")
+                        }
+
+                        this.stationList.push(station);
+
+                        if (initMapPath) {
+                            this.mapPath.push(station.position);
+                        }
+                    }
+                });
+
+                if(this.mapPath.length>0){
+                    this.centerPoint = this.mapPath[0];
+                }
+            }
+        });
+    },
+
+  },
+  mounted: function () {},
+  components: {
+    "routeInfo-detail": routeInfoDetail,
+    "el-select-tree": SelectTree,
+  },
+};
+</script>
+<style lang="scss" scoped>
+.el-breadcrumb {
+  margin: 10px;
+  line-height: 20px;
+}
+
+.el-divider {
+  margin: 5px 0;
+}
+
+.demo-form-inline {
+  margin-left: 10px;
+  text-align: left;
+}
+
+.button-group {
+  margin-left: 10px;
+  text-align: left;
+}
+</style>