Browse Source

Merge branch 'master' of http://47.92.161.104:10080/shuzhan/smart-bus-portal

yanliming 4 years ago
parent
commit
72e64e48b1

+ 1 - 1
.env.test

@@ -18,7 +18,7 @@ VUE_APP_COMPANY_HEALTH_XY_URL=http://wisdomhousewechat.sudaonline.net/prevention
 VUE_APP_PUNCHLOCATION_URL=http://yktwechat.xiaoxinda.com/#/health/codeScene
 VUE_APP_PUNCHLOCATION_URL=http://yktwechat.xiaoxinda.com/#/health/codeScene
 
 
 #车辆购票二维码
 #车辆购票二维码
-VUE_APP_BUY_TICKET_URL=http://xpgj.xiaoxinda.com/jp-car/#/pages/buytickets/index
+VUE_APP_BUY_TICKET_URL=http://xpgj.xiaoxinda.com/jp-car-test/#/pages/buytickets/index
 
 
 #绑定微信
 #绑定微信
 VUE_APP_SCAN_CODE_LOGIN=7001
 VUE_APP_SCAN_CODE_LOGIN=7001

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

@@ -35,6 +35,18 @@ var routers = [
             title: '移动端广告栏位管理'
             title: '移动端广告栏位管理'
         }
         }
     },
     },
+    {
+        path: '/base/regionInfo/list',
+        name: 'baseRegionInfoList',
+        // 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/base/regionInfo-list.vue'),
+        meta: {
+            roles: ["admin"],
+            title: '区域管理'
+        }
+    },
 ]
 ]
 
 
 export default routers;
 export default routers;

+ 291 - 0
src/views/base/regionInfo-detail.vue

@@ -0,0 +1,291 @@
+
+<style scoped>
+.user-panel {
+  margin: 10px auto;
+}
+</style>
+<template>
+  <el-dialog
+    :visible.sync="showDialog"
+    :title="title"
+    :modal-append-to-body="false"
+    style="text-align: left"
+    @close="closeDialog"
+    :close-on-click-modal="false"
+  >
+    <div class="user-panel" v-loading="loading">
+      <el-form
+        ref="form"
+        :model="formModel"
+        :rules="ruleValidate"
+        :label-width="'100px'"
+      >
+        <el-form-item label="地区名称" prop="name">
+          <el-input
+            v-model="formModel.name"
+            placeholder="请输入地区名称"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="全称" prop="fullName">
+          <el-input
+            v-model="formModel.fullName"
+            placeholder="请输入全称"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="上级" prop="parentId">
+          <el-select-tree
+            :props="props"
+            :options="regionData"
+            v-model="formModel.parentId"
+            size="mediumn"
+            width="300px"
+          ></el-select-tree>
+        </el-form-item>
+        <el-form-item label="经纬度" prop="location">
+          <el-input
+            v-model="formModel.location"
+            placeholder="请输入经纬度"
+            style="width: 300px"
+          ></el-input>
+          <i class="el-icon-map-location my-font" @click="handleLocation()"></i>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input
+            v-model="formModel.remark"
+            placeholder="请输入备注"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="排序" prop="sortNo">
+          <el-input-number
+            v-model="formModel.sortNo"
+            placeholder="请输入排序"
+            style="width: 200px"
+            :min="0"
+          ></el-input-number>
+        </el-form-item>
+      </el-form>
+      <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="formModel.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>
+    <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>
+</template>
+<script>
+import Constant from "@/constant";
+import regionInfoApi from "@/api/base/regionInfo";
+import SelectTree from "@/components/SelectTree";
+
+import AMap from "vue-amap";
+let amapManager = new AMap.AMapManager();
+
+export default {
+  props: ["businessKey", "title"],
+  data() {
+    return {
+      formModel: {},
+      ruleValidate: {
+        name: [
+          { required: true, message: "地区名称不能为空", trigger: "blur" },
+        ],
+        fullName: [
+          { required: true, message: "全称不能为空", trigger: "blur" },
+        ],
+      },
+      showDialog: true,
+      loading: false,
+      submitting: false,
+      regionData: [],
+      props: {
+        // 配置项(必选)
+        value: "id",
+        label: "name",
+        children: "children",
+      },
+      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.formModel.location = pt.lng + "," + pt.lat;
+          this.formModel.longitude = pt.lng;
+          this.formModel.latitude = pt.lat;
+        },
+      },
+    };
+  },
+  created() {
+    regionInfoApi.list().then((response) => {
+      var jsonData = response.data;
+      this.regionData = 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 (id == null || id.length == 0) {
+              return regionInfoApi.add(self.formModel);
+            } else {
+              return regionInfoApi.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);
+            }
+          });
+        }
+      });
+    },
+    handleLocation() {
+      this.showMapDialog = true;
+      if (this.formModel.longitude != null && this.formModel.latitude != null) {
+        var arr = [this.formModel.longitude, this.formModel.latitude];
+        this.pointPosition = arr;
+      }
+    },
+
+    handleRegeo() {
+      if (this.formModel.longitude != null && this.formModel.latitude != null) {
+        var arr = [this.formModel.longitude, this.formModel.latitude];
+        this.pointPosition = arr;
+      }
+    },
+    handleSelectPoint() {
+      this.formModel.location =
+        this.pointPosition[0] + "," + this.pointPosition[1];
+      this.formModel.longitude = this.pointPosition[0];
+      this.formModel.latitude = this.pointPosition[1];
+      this.showMapDialog = false;
+    },
+  },
+  mounted: function () {
+    var self = this;
+
+    (function () {
+      if (self.businessKey.length == 0) {
+        return regionInfoApi.create();
+      } else {
+        return regionInfoApi.edit(self.businessKey);
+      }
+    })()
+      .then((response) => {
+        var jsonData = response.data;
+        self.loading = false;
+
+        if (jsonData.result) {
+          self.formModel = jsonData.data;
+          if (self.formModel.sortNo == null) {
+            self.formModel.sortNo = 0;
+          }
+          if (
+            self.formModel.longitude != null &&
+            self.formModel.latitude != null
+          ) {
+            self.formModel.location =
+              self.formModel.longitude + "," + self.formModel.latitude;
+          }
+        } else {
+          self.$message.error(jsonData.message + "");
+        }
+      })
+      .catch((error) => {
+        self.$message.error(error + "");
+      });
+  },
+  components: {
+    "el-select-tree": SelectTree,
+  },
+};
+</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>

+ 323 - 0
src/views/base/regionInfo-list.vue

@@ -0,0 +1,323 @@
+<template>
+  <div>
+    <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="/regionInfo">区域管理</a>
+      </el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-divider></el-divider>
+    <!--
+      要resetFields起作用,必须配置:model和prop
+    -->
+    <el-form
+      ref="queryForm"
+      :model="queryModel"
+      inline
+      class="demo-form-inline"
+    >
+      <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-circle-plus"
+        :disabled="multipleSelection.length == 0"
+        @click="handleBatchDelete"
+        >删除选中项</el-button
+      >
+    </el-row>
+    <el-table
+      :data="tableData"
+      style="min-height: 400px"
+      v-loading="loading"
+      stripe
+      @sort-change="sortChange"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55"></el-table-column>
+      <el-table-column
+        type="index"
+        label="序号"
+        :index="indexMethod"
+        width="50"
+      ></el-table-column>
+      <el-table-column
+        prop="name"
+        label="地区名称"
+        width="180"
+      ></el-table-column>
+      <el-table-column
+        prop="fullName"
+        label="全称"
+        width="180"
+      ></el-table-column>
+      <el-table-column
+        prop="parentName"
+        label="上级"
+        width="180"
+      ></el-table-column>
+      <el-table-column
+        prop="longitude"
+        label="经度"
+        width="180"
+      ></el-table-column>
+      <el-table-column
+        prop="latitude"
+        label="纬度"
+        width="180"
+      ></el-table-column>
+      <el-table-column prop="sortNo" label="排序" width="80"></el-table-column>
+      <el-table-column label="操作">
+        <template slot-scope="{ row }">
+          <el-link type="primary" @click="handleEdit(row)">编辑</el-link>
+-
+          <el-link type="danger" @click="handleDelete(row)">删除</el-link>
+        </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>
+    <regionInfo-detail
+      v-if="showModal"
+      :businessKey="businessKey"
+      :title="modalTitle"
+      @close="onDetailModalClose"
+    ></regionInfo-detail>
+  </div>
+</template>
+<script>
+import Constant from "@/constant";
+import RegionInfoDetail from "./regionInfo-detail";
+import regionInfoApi from "@/api/base/regionInfo";
+import NProgress from "nprogress"; // progress bar
+import "nprogress/nprogress.css"; // progress bar style
+
+export default {
+  data() {
+    var self = this;
+
+    return {
+      queryModel: {
+        id: "",
+        name: "",
+      },
+      loading: false,
+      tableData: [],
+      pageIndex: 1,
+      pageSize: 10,
+      totalPages: 0,
+      totalElements: 0,
+      field: "",
+      direction: "",
+      pageSizeList: [10, 20, 30],
+      multipleSelection: [],
+      showModal: false,
+      modalTitle: "",
+      businessKey: "",
+    };
+  },
+  methods: {
+    indexMethod(index) {
+      return (this.pageIndex - 1) * this.pageSize + (index + 1);
+    },
+    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);
+
+      formData.append("id", self.queryModel.id);
+      formData.append("name", self.queryModel.name);
+
+      if (this.field != null) {
+        formData.append("field", this.field);
+      }
+
+      if (this.direction != null) {
+        formData.append("direction", this.direction);
+      }
+
+      regionInfoApi
+        .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;
+        })
+        .catch((error) => {
+          self.loading = false;
+          // self.$message.error(error + "");
+        });
+    },
+    pageSizeChange(pageSize) {
+      this.pageSize = pageSize;
+
+      this.$nextTick(() => {
+        this.changePage(this.pageIndex);
+      });
+    },
+    sortChange(data) {
+      this.field = data.column.field;
+      this.direction = data.order;
+
+      this.changePage(this.pageIndex);
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+    handleReset(name) {
+      this.$refs[name].resetFields();
+    },
+    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(() => {
+          regionInfoApi.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(() => {
+        regionInfoApi.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;
+
+      if (refreshed) {
+        this.changePage(this.pageIndex);
+      }
+    },
+    handlePoint(record) {
+      this.modalTitle = "定位";
+      this.businessKey = record.id;
+      this.showMapModal = true;
+    },
+  },
+  mounted: function () {
+    this.changePage(1);
+  },
+  components: {
+    "regionInfo-detail": RegionInfoDetail,
+  },
+};
+</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>

+ 194 - 122
src/views/bus/routeInfo-detail.vue

@@ -5,24 +5,24 @@
 }
 }
 </style>
 </style>
 <template>
 <template>
-<div>
-  <el-dialog
-    :visible.sync="showDialog"
-    :title="title"
-    :modal-append-to-body="false"
-    style="text-align: left"
-    width="1200px"
-    @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"
-      >
+  <div>
+    <el-dialog
+      :visible.sync="showDialog"
+      :title="title"
+      :modal-append-to-body="false"
+      style="text-align: left"
+      width="1200px"
+      @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-form-item label="所属公司" prop="companyId">
             <el-select-tree
             <el-select-tree
               :props="props"
               :props="props"
@@ -33,48 +33,58 @@
             ></el-select-tree>
             ></el-select-tree>
           </el-form-item>
           </el-form-item>
           <el-form-item label="地区" prop="regionId">
           <el-form-item label="地区" prop="regionId">
-              <el-select-tree
-                :props="props"
-                :options="regionData"
-                v-model="formModel.regionId"
-                size="mediumn"
-                width="400px"
-              ></el-select-tree>
-            </el-form-item>
+            <el-select-tree
+              :props="props"
+              :options="regionData"
+              v-model="formModel.regionId"
+              size="mediumn"
+              width="400px"
+            ></el-select-tree>
+          </el-form-item>
 
 
           <el-form-item label="路线名称" prop="name">
           <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>
+            <el-input
+              v-model="formModel.name"
+              placeholder="请输入路线名称"
+              style="width: 400px"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="开始时间" prop="startTime">
+            <el-time-picker
+              v-model="formModel.startTime"
+              class="date-box"
+              format="HH:mm"
+              value-format="HH:mm"
+              style="width: 400px"
+              :picker-options="{
+                selectableRange: `00:00:00 -${
+                  formModel.endTime ? formModel.endTime + ':00' : '23:59:00'
+                }`,
+              }"
+            ></el-time-picker>
+          </el-form-item>
+          <el-form-item label="结束时间" prop="endTime">
+            <el-time-picker
+              v-model="formModel.endTime"
+              class="date-box"
+              format="HH:mm"
+              value-format="HH:mm"
+              style="width: 400px"
+              :picker-options="{
+                selectableRange: `${
+                  formModel.startTime ? formModel.startTime + ':00' : '00:00:00'
+                }-23:59:00`,
+              }"
+            ></el-time-picker>
+          </el-form-item>
+          <el-form-item label="间隔时间(分钟)" prop="interval">
+            <el-input-number
+              v-model="formModel.interval"
+              placeholder="请输入间隔时间"
+              style="width: 400px"
+              :min="0"
+            ></el-input-number>
+          </el-form-item>
           <h3>车辆站点信息</h3>
           <h3>车辆站点信息</h3>
           <el-divider></el-divider>
           <el-divider></el-divider>
           <el-row class="button-group">
           <el-row class="button-group">
@@ -88,73 +98,122 @@
             >
             >
           </el-row>
           </el-row>
           <el-table :data="formModel.stationList">
           <el-table :data="formModel.stationList">
-            <el-table-column type="index" label="序号" width="55"></el-table-column>
-            <el-table-column prop="name" label="站点名称">
+            <el-table-column
+              type="index"
+              label="序号"
+              width="55"
+            ></el-table-column>
+            <el-table-column prop="name" label="站点名称" width="300px">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-form-item
                 <el-form-item
                   :prop="'stationList.' + scope.$index + '.name'"
                   :prop="'stationList.' + scope.$index + '.name'"
                   :rules="ruleValidate['name']"
                   :rules="ruleValidate['name']"
                 >
                 >
-                  <el-input placeholder="站点名称" style="width:200px" v-model="scope.row.name"></el-input>
+                  <el-input
+                    placeholder="站点名称"
+                    v-model="scope.row.name"
+                    style="width: 250px"
+                  ></el-input>
                 </el-form-item>
                 </el-form-item>
               </template>
               </template>
             </el-table-column>
             </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>
+            <el-table-column prop="classify" label="站点类型" width="130px">
+              <template slot-scope="{ row }">
+                <el-form-item>
+                  <el-select
+                    v-model="row.classify"
+                    placeholder="请选择"
+                    style="width: 120px"
+                  >
+                    <el-option
+                      v-for="result in stationClassify"
+                      :key="result.id"
+                      :label="result.name"
+                      :value="result.value"
+                    ></el-option>
+                  </el-select>
+                </el-form-item>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column prop="location" label="站点定位">
             <el-table-column prop="location" label="站点定位">
-              <template slot-scope="{row}">
+              <template slot-scope="{ row }">
                 <el-form-item>
                 <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-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 prop="name" label="半径(米)" width="120px">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'stationList.' + scope.$index + '.radius'"
+                  :rules="ruleValidate['radius']"
+                >
+                  <el-input
+                    placeholder="半径"
+                    v-model="scope.row.radius"
+                  ></el-input>
                 </el-form-item>
                 </el-form-item>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column label="操作" width="200">
             <el-table-column label="操作" width="200">
-              <template slot-scope="{row}">
+              <template slot-scope="{ row }">
                 <el-form-item>
                 <el-form-item>
-                  <i class="el-icon-delete my-font" @click="handleDelete(row)"></i>
+                  <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-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>
+                  <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>
                 </el-form-item>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <div slot="empty">
             <div slot="empty">
-              <el-button icon="el-icon-circle-plus-outline" :plain="true" @click="handleAdd()">新增</el-button>
+              <el-button
+                icon="el-icon-circle-plus-outline"
+                :plain="true"
+                @click="handleAdd()"
+                >新增</el-button
+              >
             </div>
             </div>
           </el-table>
           </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>
+        </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>
-    </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
+      </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"
       :visible.sync="showMapDialog"
       title="地图选点"
       title="地图选点"
       :modal-append-to-body="true"
       :modal-append-to-body="true"
       :append-to-body="true"
       :append-to-body="true"
-      style="text-align:left;"
+      style="text-align: left"
       :close-on-click-modal="false"
       :close-on-click-modal="false"
     >
     >
       <el-amap
       <el-amap
@@ -166,17 +225,25 @@
         :events="events"
         :events="events"
         class="amap-demo"
         class="amap-demo"
       >
       >
-        <el-amap-marker vid="amapDemo" :position="pointPosition"></el-amap-marker>
+        <el-amap-marker
+          vid="amapDemo"
+          :position="pointPosition"
+        ></el-amap-marker>
       </el-amap>
       </el-amap>
       <span slot="footer" class="dialog-footer">
       <span slot="footer" class="dialog-footer">
-        <div style="position:absolute;left:20px;bottom:20px;">
-          <el-input placeholder="当前经纬度" v-model="selectedRow.location" 
-          style="width:400px;">
+        <div style="position: absolute; left: 20px; bottom: 20px">
+          <el-input
+            placeholder="当前经纬度"
+            v-model="selectedRow.location"
+            style="width: 400px"
+          >
             <template slot="prepend">经纬度</template>
             <template slot="prepend">经纬度</template>
-            <el-button slot="append" icon="el-icon-search" @click="handleRegeo">定位</el-button>
+            <el-button slot="append" icon="el-icon-search" @click="handleRegeo"
+              >定位</el-button
+            >
           </el-input>
           </el-input>
         </div>
         </div>
-        <el-button @click="showMapDialog=false;">取 消</el-button>
+        <el-button @click="showMapDialog = false">取 消</el-button>
         <el-button type="primary" @click="handleSelectPoint()">确 定</el-button>
         <el-button type="primary" @click="handleSelectPoint()">确 定</el-button>
       </span>
       </span>
     </el-dialog>
     </el-dialog>
@@ -255,15 +322,13 @@ export default {
         companyId: "",
         companyId: "",
         goodsId: "",
         goodsId: "",
         stationList: [],
         stationList: [],
-        removeStationList: []
+        removeStationList: [],
       },
       },
       ruleValidate: {
       ruleValidate: {
         companyId: [
         companyId: [
           { required: true, message: "所属单位不能为空", trigger: "blur" },
           { required: true, message: "所属单位不能为空", trigger: "blur" },
         ],
         ],
-        name: [
-          { required: true, message: "车牌号不能为空", trigger: "blur" },
-        ],
+        name: [{ required: true, message: "车牌号不能为空", trigger: "blur" }],
         startTime: [
         startTime: [
           { required: true, message: "开始时间不能为空", trigger: "blur" },
           { required: true, message: "开始时间不能为空", trigger: "blur" },
         ],
         ],
@@ -273,6 +338,10 @@ export default {
         regionId: [
         regionId: [
           { required: true, message: "地区不能为空", trigger: "blur" },
           { required: true, message: "地区不能为空", trigger: "blur" },
         ],
         ],
+        interval: [
+          { required: true, message: "间隔时间不能为空", trigger: "blur" },
+        ],
+        radius: [{ required: true, message: "半径不能为空", trigger: "blur" }],
       },
       },
       showDialog: true,
       showDialog: true,
       loading: false,
       loading: false,
@@ -296,13 +365,13 @@ export default {
       amapManager,
       amapManager,
       zoom: 12,
       zoom: 12,
       events: {
       events: {
-        click: e => {
+        click: (e) => {
           var pt = e.lnglat; //点击选择新地址为中心点
           var pt = e.lnglat; //点击选择新地址为中心点
           console.log(pt);
           console.log(pt);
 
 
           this.pointPosition = [pt.lng, pt.lat];
           this.pointPosition = [pt.lng, pt.lat];
           this.selectedRow.location = pt.lng + "," + pt.lat;
           this.selectedRow.location = pt.lng + "," + pt.lat;
-        }
+        },
       },
       },
       props: {
       props: {
         // 配置项(必选)
         // 配置项(必选)
@@ -313,7 +382,7 @@ export default {
       uploadUrlXls: Constant.serverUrl + "/bus/stationInfo/importXls",
       uploadUrlXls: Constant.serverUrl + "/bus/stationInfo/importXls",
       uploadXlsData: {
       uploadXlsData: {
         subFolder: "station",
         subFolder: "station",
-        routeId:this.businessKey,
+        routeId: this.businessKey,
       },
       },
       sceneData: [],
       sceneData: [],
       regionData: [],
       regionData: [],
@@ -328,7 +397,7 @@ export default {
     var formData = new FormData();
     var formData = new FormData();
     formData.append("catalogName", "站点类型");
     formData.append("catalogName", "站点类型");
 
 
-    dataDictionaryApi.findByCatalogName(formData).then(response => {
+    dataDictionaryApi.findByCatalogName(formData).then((response) => {
       var jsonData = response.data;
       var jsonData = response.data;
       this.stationClassify = jsonData.data;
       this.stationClassify = jsonData.data;
     });
     });
@@ -339,7 +408,7 @@ export default {
         self.companyResult = jsonData.data;
         self.companyResult = jsonData.data;
       }
       }
     });
     });
-    
+
     regionInfoApi.list().then((response) => {
     regionInfoApi.list().then((response) => {
       var jsonData = response.data;
       var jsonData = response.data;
       this.regionData = jsonData.data;
       this.regionData = jsonData.data;
@@ -427,25 +496,25 @@ export default {
         routeId: this.businessKey,
         routeId: this.businessKey,
         classify: "",
         classify: "",
         location: "",
         location: "",
-        delFlag: 0
+        delFlag: 0,
       });
       });
     },
     },
     handleInsert(row) {
     handleInsert(row) {
       var stationList = this.formModel.stationList;
       var stationList = this.formModel.stationList;
       var index = stationList.indexOf(row);
       var index = stationList.indexOf(row);
 
 
-      if(index>=0){
-        stationList.splice(index+1,0,{
+      if (index >= 0) {
+        stationList.splice(index + 1, 0, {
           sortNo: index + 2,
           sortNo: index + 2,
           name: "",
           name: "",
           routeId: this.businessKey,
           routeId: this.businessKey,
           classify: "",
           classify: "",
           location: "",
           location: "",
-          delFlag: 0
+          delFlag: 0,
         });
         });
       }
       }
     },
     },
-    handleRegeo(){
+    handleRegeo() {
       var row = this.selectedRow;
       var row = this.selectedRow;
 
 
       if (row.location != null && row.location.length > 0) {
       if (row.location != null && row.location.length > 0) {
@@ -469,18 +538,18 @@ export default {
       var stationList = this.formModel.stationList;
       var stationList = this.formModel.stationList;
       var index = stationList.indexOf(row);
       var index = stationList.indexOf(row);
 
 
-      if(index>0){
+      if (index > 0) {
         stationList.splice(index, 1);
         stationList.splice(index, 1);
-        stationList.splice(index-1,0,row);
+        stationList.splice(index - 1, 0, row);
       }
       }
     },
     },
     handleDown(row) {
     handleDown(row) {
       var stationList = this.formModel.stationList;
       var stationList = this.formModel.stationList;
       var index = stationList.indexOf(row);
       var index = stationList.indexOf(row);
 
 
-      if(index<stationList.length-1){
+      if (index < stationList.length - 1) {
         stationList.splice(index, 1);
         stationList.splice(index, 1);
-        stationList.splice(index+1,0,row);
+        stationList.splice(index + 1, 0, row);
       }
       }
     },
     },
     beforeUpload(file, fileList) {
     beforeUpload(file, fileList) {
@@ -538,7 +607,7 @@ export default {
         } 个文件`
         } 个文件`
       );
       );
     },
     },
-    refurbishList(){
+    refurbishList() {
       var self = this;
       var self = this;
       (function () {
       (function () {
         if (self.businessKey.length == 0) {
         if (self.businessKey.length == 0) {
@@ -560,7 +629,7 @@ export default {
         .catch((error) => {
         .catch((error) => {
           self.$message.error(error + "");
           self.$message.error(error + "");
         });
         });
-    }
+    },
   },
   },
   components: {
   components: {
     "el-select-tree": SelectTree,
     "el-select-tree": SelectTree,
@@ -580,6 +649,9 @@ export default {
 
 
         if (jsonData.result) {
         if (jsonData.result) {
           self.formModel = jsonData.data;
           self.formModel = jsonData.data;
+          if (self.formModel.interval == null) {
+            self.formModel.interval = 40;
+          }
         } else {
         } else {
           self.$message.error(jsonData.message + "");
           self.$message.error(jsonData.message + "");
         }
         }

+ 7 - 2
src/views/bus/routeInfo-list.vue

@@ -102,12 +102,17 @@
       <el-table-column
       <el-table-column
         prop="startTime"
         prop="startTime"
         label="开始时间"
         label="开始时间"
-        width="200"
+        width="100"
       ></el-table-column>
       ></el-table-column>
       <el-table-column
       <el-table-column
         prop="endTime"
         prop="endTime"
         label="结束时间"
         label="结束时间"
-        width="200"
+        width="100"
+      ></el-table-column>
+      <el-table-column
+        prop="interval"
+        label="间隔时间(分钟)"
+        width="120"
       ></el-table-column>
       ></el-table-column>
       <el-table-column label="操作">
       <el-table-column label="操作">
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">