LIDEXI 4 vuotta sitten
vanhempi
commit
9670b7bde4

+ 3 - 0
public/index.html

@@ -16,6 +16,9 @@
   <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/avue/iconfont.css">
   <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/saber/iconfont.css">
   <link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.8.12/index.css">
+   <script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=cbb265e2a60bbbc04a52eec4eecdeb12&plugin=AMap.PolygonEditor,AMap.Driving"></script>
+    <script src="https://webapi.amap.com/ui/1.1/main.js?v=1.0.11"></script>
+    <script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
   <script src="<%= BASE_URL %>cdn/xlsx/FileSaver.min.js"></script>
   <script src="<%= BASE_URL %>cdn/xlsx/xlsx.full.min.js"></script>
   <link rel="icon" href="<%= BASE_URL %>favicon.png">

+ 50 - 0
src/api/ldt/mall.js

@@ -0,0 +1,50 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/cyzh-ldt/mall/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/api/cyzh-ldt/mall/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/cyzh-ldt/mall/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/cyzh-ldt/mall/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/cyzh-ldt/mall/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 50 - 0
src/api/ldt/mallarea.js

@@ -0,0 +1,50 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/cyzh-ldt/mallarea/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/api/cyzh-ldt/mallarea/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/cyzh-ldt/mallarea/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/cyzh-ldt/mallarea/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/cyzh-ldt/mallarea/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 50 - 0
src/api/ldt/mallshoplabel.js

@@ -0,0 +1,50 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/cyzh-ldt/mallshoplabel/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/api/cyzh-ldt/mallshoplabel/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/cyzh-ldt/mallshoplabel/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/cyzh-ldt/mallshoplabel/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/cyzh-ldt/mallshoplabel/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 50 - 0
src/api/ldt/shop.js

@@ -0,0 +1,50 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/cyzh-ldt/shop/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/api/cyzh-ldt/shop/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/cyzh-ldt/shop/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/cyzh-ldt/shop/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/cyzh-ldt/shop/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 202 - 0
src/components/map/editPolygonMap.vue

@@ -0,0 +1,202 @@
+<template>
+  <div style="position: relative;">
+    <div style="display: flex;">
+      <input id="tipinput" class="el-input__inner" placeholder="搜索地址" v-model="address" style="margin-right: 100px;">
+      <button class="el-button" @click="startEdit" style="margin-bottom: 5px">编辑区域</button>
+      <button class="el-button" @click="closeEdit" style="margin-bottom: 5px">编辑完成</button>
+      <button class="el-button" @click="getPath" style="margin-bottom: 5px">保存</button>
+    </div>
+    <div id="container"  style="height: 500px;display: block;position: relative;">
+      <div id="panel" style="position: absolute;top: 0;bottom:0;right: 0;width: 300px;overflow: auto;z-index: 9;"></div>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    data() {
+      return {
+        location:{
+          latitude: "39.994257",
+          longitude: "116.471354",
+        },
+        map:null,
+        polyEditor:null,
+        marker:null,
+        polygonPath:[],
+        address:'',
+      }
+    },
+    props:['editForm', 'longitude', 'latitude', 'region'],
+    mounted() {
+      let data = this.editForm
+      let longitude = this.longitude;
+      let latitude = this.latitude;
+      if (data) {
+        if (longitude !== "" && latitude !== "") {
+          this.location.longitude = longitude;
+          this.location.latitude = latitude;
+        }
+        if(data.boundaryPath!==""&&data.boundaryPath!==null&&data.boundaryPath!==undefined){
+          this.polygonPath = JSON.parse(data.boundaryPath)
+        }
+      }
+      this.initMap()
+      this.setMark(this.location)
+      this.initPolygon()
+      this.initSearch()
+    },
+    methods:{
+      initMap(){
+        var _this = this
+        this.map = new AMap.Map('container', {
+          resizeEnable: true, //是否监控地图容器尺寸变化
+          center: [this.location.longitude, this.location.latitude],
+          zoom: 16,
+        });
+        this.map.on('click', function(e) {
+          _this.location['longitude'] = e.lnglat.getLng()
+          _this.location['latitude'] = e.lnglat.getLat()
+          _this.setMark(_this.location)
+        });
+      },
+      setMark(data){
+        var _this = this
+        if(this.marker){
+          this.map.remove(this.marker);
+        }
+        AMap.plugin('AMap.Geocoder', function() {
+          var geocoder = new AMap.Geocoder({})
+          var lnglat = [data.longitude, data.latitude]
+          geocoder.getAddress(lnglat, function(status, result) {
+            if (status === 'complete' && result.info === 'OK') {
+                // result为对应的地理位置详细信息
+                let address = result.regeocode.formattedAddress
+                _this.marker = new AMap.Marker({
+                  position: new AMap.LngLat(data.longitude, data.latitude), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+                });
+                _this.marker.setLabel({
+                    direction:'center top',
+                    offset: new AMap.Pixel(10, 0),  //设置文本标注偏移量
+                    content: address, //设置文本标注内容
+                });
+                _this.address = address
+                _this.map.add(_this.marker);
+            }
+          })
+        })
+
+      },
+      initSearch(){
+          var _this = this
+          //输入提示
+          var autoOptions = {
+              input: "tipinput"
+          };
+          AMap.plugin(['AMap.PlaceSearch','AMap.AutoComplete'], function(){
+              var auto = new AMap.AutoComplete(autoOptions);
+              var placeSearch = new AMap.PlaceSearch({
+                  pageSize: 5, // 单页显示结果条数
+                  pageIndex: 1, // 页码
+                  map: _this.map, // 展现结果的地图实例
+                  panel: "panel", // 结果列表将在此容器中进行展示。
+                  autoFitView: true // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
+              });  //构造地点查询类
+              auto.on("select", select);//注册监听,当选中某条记录时会触发
+              function select(e) {
+                  placeSearch.setCity(e.poi.adcode);
+                  placeSearch.search(e.poi.name);  //关键字查询查询
+              }
+          });
+      },
+      initPolygon(){
+        var _this = this;
+        this.polyEditor = new AMap.PolygonEditor(this.map);
+        this.setPolygon(this.polygonPath)
+        this.polyEditor.on('add', function (data) {
+          var polygon = data.target;
+          _this.polyEditor.addAdsorbPolygons(polygon);
+          // polygon.on('click', (res) => {
+          //   console.log(res)
+          //   _this.polyEditor.setTarget(polygon);
+          //   _this.polyEditor.open();
+          // })
+        })
+      },
+      setPolygon(data){
+        if(data.length<1)return
+        var _this = this
+            let polygon = new AMap.Polygon({
+              path: data,
+              fillColor: '#ccebc5',
+              strokeOpacity: 1,
+              fillOpacity: 0.5,
+              strokeColor: '#2b8cbe',
+              strokeWeight: 1,
+              strokeStyle: 'dashed',
+              strokeDasharray: [5, 5],
+            });
+            polygon.on('mouseover', () => {
+              polygon.setOptions({
+                fillOpacity: 0.7,
+                fillColor: '#7bccc4'
+              })
+            })
+            polygon.on('mouseout', () => {
+              polygon.setOptions({
+                fillOpacity: 0.5,
+                fillColor: '#ccebc5'
+              })
+            })
+            polygon.on('click', () => {
+              this.polyEditor.open();
+            })
+            this.map.add(polygon);
+            this.map.setFitView();
+            _this.polyEditor.setTarget(polygon)
+      },
+      createPolygon() {
+        this.polyEditor.close();
+        this.polyEditor.setTarget();
+        this.polyEditor.open();
+      },
+      startEdit(){
+        this.polyEditor.open();
+      },
+      closeEdit(){
+        this.polyEditor.close();
+      },
+      getPath(){
+        let target = this.polyEditor.getTarget()
+        let path = ""
+        if(target){
+          path = target._opts.path
+        }
+        if(path!==""&&path!==null&&path!==undefined){
+          path = JSON.stringify(path)
+        }
+        this.region = this.address;
+        this.latitude = this.location['latitude']
+        this.longitude = this.location['longitude']
+        if(this.editForm != "{}"){
+           this.editForm.boundaryPath = path
+           this.$emit('update:editForm', this.editForm)
+        }
+
+        this.$emit('update:region', this.region);
+        // debugger
+        this.$emit('update:latitude', this.latitude);
+        this.$emit('update:longitude', this.longitude);
+
+        this.$emit('update:visible', false)
+      }
+    }
+  }
+</script>
+
+<style>
+  .amap-sug-result{
+    z-index: 999999999;
+    background-color: #fff;
+    color: #000;
+  }
+</style>

+ 444 - 0
src/views/ldt/mall.vue

@@ -0,0 +1,444 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList"
+      :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
+      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
+      @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.mall_delete" @click="handleDelete">删
+          除
+        </el-button>
+      </template>
+      <template slot="mapSelectForm" slot-scope="scope">
+        <div>
+          <!--          <input class="el-input&#45;&#45;small el-input__inner" placeholder="选择地址" @click="mapVisible = true">-->
+          <el-button @click="mapVisible = true"> 选择地址</el-button>
+          <el-dialog :append-to-body="true" :close-on-click-modal="false" :modal-append-to-body="false" :visible.sync="mapVisible"
+            title="编辑地址" width="80%">
+            <editPolygonMap v-if="mapVisible" :editForm.sync="scope.row" :region.sync="scope.row.address"
+              :latitude.sync="scope.row.latitude" :longitude.sync="scope.row.longitude" :visible.sync="mapVisible"></editPolygonMap>
+          </el-dialog>
+        </div>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {
+    getList,
+    getDetail,
+    add,
+    update,
+    remove
+  } from "@/api/ldt/mall";
+  import {
+    mapGetters
+  } from "vuex";
+
+  import editPolygonMap from "../../components/map/editPolygonMap.vue"
+  import {
+    getList as getRegList
+  } from "@/api/base/region"
+
+  export default {
+    components: {
+      editPolygonMap
+    },
+    data() {
+
+      return {
+        mapVisible: false,
+        form: {},
+        query: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: {
+          height: 'auto',
+          calcHeight: 30,
+          tip: false,
+          searchShow: true,
+          searchMenuSpan: 6,
+          border: true,
+          index: true,
+          viewBtn: true,
+          selection: true,
+          dialogClickModal: false,
+          column: [{
+              label: "主键",
+              prop: "id",
+              hide: true,
+              display: false,
+              rules: [{
+                required: true,
+                message: "请输入主键",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "商场名称",
+              prop: "name",
+              width: 200,
+              overHidden: true,
+              rules: [{
+                required: true,
+                message: "请输入商城名称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: '',
+              prop: 'mapSelect',
+              viewDisplay: false,
+              formslot: true,
+              hide: true,
+            },
+            {
+              label: "经度",
+              prop: "longitude",
+              disabled: true,
+              width: 120,
+              hide: true,
+              rules: [{
+                required: false,
+                message: "请输入经度",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "纬度",
+              prop: "latitude",
+              disabled: true,
+              width: 120,
+              hide: true,
+              rules: [{
+                required: false,
+                message: "请输入纬度",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "所属省",
+              prop: "provinceCode",
+              disabled: true,
+              type: "select",
+              width: 150,
+              hide: true,
+              dicUrl: "/api/blade-system/region/lazy-tree?parentCode=000000",
+              cascaderItem: ["cityCode"],
+              props: {
+                label: "title",
+                value: "id"
+              },
+              disable: true,
+              rules: [{
+                required: true,
+                message: "请选择所属省份",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "所属市",
+              prop: "cityCode",
+              type: "select",
+              hide: true,
+              width: 150,
+              cascaderItem: ["areaCode"],
+              dicUrl: `/api/blade-system/region/lazy-tree?parentCode={{key}}`,
+              disabled: true,
+              props: {
+                label: "title",
+                value: "id"
+              },
+              rules: [{
+                required: false,
+                message: "请选择所属市",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "所属区",
+              prop: "areaCode",
+              type: "select",
+              disabled: true,
+              hide: true,
+              width: 150,
+              dicUrl: `/api/blade-system/region/lazy-tree?parentCode={{key}}`,
+              props: {
+                label: "title",
+                value: "id"
+              },
+              rules: [{
+                required: false,
+                message: "请选择所属区",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "所在省",
+              prop: "province",
+              width: 100,
+              display: false,
+              rules: [{
+                required: true,
+                message: "请输入省",
+                trigger: "blur"
+              }]
+            },
+
+            {
+              label: "所在市",
+              prop: "city",
+              width: 100,
+              display: false,
+              rules: [{
+                required: true,
+                message: "请输入市",
+                trigger: "blur"
+              }]
+            },
+
+            {
+              label: "所在区",
+              prop: "area",
+              width: 100,
+              display: false,
+
+              rules: [{
+                required: true,
+                message: "请输入地区",
+                trigger: "blur"
+              }]
+            },
+
+            {
+              label: "详细地址",
+              prop: "address",
+              width: 350,
+              overHidden: true,
+              disabled: true,
+              rules: [{
+                required: true,
+                message: "请输入详细地址",
+                trigger: "blur"
+              }]
+            },
+
+            {
+              label: "负责人手机号码",
+              prop: "personTel",
+              labelWidth: 130,
+              width: 110,
+              rules: [{
+                required: true,
+                message: "请输入负责人手机号码",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "负责人姓名",
+              prop: "personName",
+              labelWidth: 100,
+              width:100,
+              rules: [{
+                required: true,
+                message: "请输入负责人姓名",
+                trigger: "blur"
+              }]
+            },
+
+
+
+
+          ]
+        },
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permission.mall_add, false),
+          viewBtn: this.vaildData(this.permission.mall_view, false),
+          delBtn: this.vaildData(this.permission.mall_delete, false),
+          editBtn: this.vaildData(this.permission.mall_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    watch: {
+      'form.address': {
+        handler: function(value) {
+          if (!value) {
+            return
+          } else {
+            var _this = this
+            AMap.plugin('AMap.Geocoder', function() {
+              var geocoder = new AMap.Geocoder({})
+              let lnglat = [_this.form.longitude, _this.form.latitude]
+              geocoder.getAddress(lnglat, function(status, result) {
+                if (status === 'complete' && result.regeocode && result.regeocode.addressComponent.township) {
+                  let parentCode = result.regeocode.addressComponent.adcode
+                  let name = result.regeocode.addressComponent.township
+                  getRegList(1, 10, {
+                    "name": name,
+                    "regionLevel": "4",
+                    "parentCode": parentCode
+                  }).then((res) => {
+                    let data = res.data.data.records[0]
+                    // let obj = {}
+                     _this.form.provinceCode = data.provinceCode
+                     _this.form.province = data.$provinceCode
+                     _this.form.cityCode = data.cityCode
+                     _this.form.city = data.$cityCode
+                     _this.form.areaCode = data.districtCode
+                     _this.form.area = data.$areaCode
+                     // _this.form.streetCode = data.code
+                    // _this.form = obj
+                  })
+                }
+              })
+            })
+          }
+        },
+      },
+      'form.mapSelect': {
+        handler: function(value) {
+          if (!value) {
+            return
+          } else {
+            this.form.longitude = this.form.mapSelect.longitude;
+            this.form.latitude = this.form.mapSelect.latitude;
+            this.form.address = this.form.mapSelect.formattedAddress;
+          }
+        },
+      }
+    },
+    methods: {
+      rowSave(row, done, loading) {
+        add(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        update(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          console.log(error);
+        });
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage) {
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      }
+    }
+  };
+</script>
+
+<style>
+</style>

+ 232 - 0
src/views/ldt/mallarea.vue

@@ -0,0 +1,232 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :table-loading="loading"
+               :data="data"
+               :page.sync="page"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               v-model="form"
+               ref="crud"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @row-del="rowDel"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button type="danger"
+                   size="small"
+                   icon="el-icon-delete"
+                   plain
+                   v-if="permission.mallarea_delete"
+                   @click="handleDelete">删 除
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {getList, getDetail, add, update, remove} from "@/api/ldt/mallarea";
+  import {mapGetters} from "vuex";
+
+  export default {
+    data() {
+      return {
+        form: {},
+        query: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: {
+          height:'auto',
+          calcHeight: 30,
+          tip: false,
+          searchShow: true,
+          searchMenuSpan: 6,
+          border: true,
+          index: true,
+          viewBtn: true,
+          selection: true,
+          dialogClickModal: false,
+          column: [
+
+            {
+              label: "区域名称",
+              prop: "name",
+              rules: [{
+                required: true,
+                message: "请输入商场区域名称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "所属商场",
+              prop: "mallId",
+              type: "select",
+              // remote: true,
+              // dicFlag: false,
+              dicUrl: "/api/cyzh-ldt/mall/list?name={{key}}",
+              props:{
+                label: "name",
+                value: "id"
+              },
+              dicFormatter:(res) => {
+                return res.data.records;
+              },
+
+              rules: [{
+                required: true,
+                message: "请输入商场id",
+                trigger: "blur"
+              }]
+            },
+
+          ]
+        },
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permission.mallarea_add, false),
+          viewBtn: this.vaildData(this.permission.mallarea_view, false),
+          delBtn: this.vaildData(this.permission.mallarea_delete, false),
+          editBtn: this.vaildData(this.permission.mallarea_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      rowSave(row, done, loading) {
+        add(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        update(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          console.log(error);
+        });
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage){
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      }
+    }
+  };
+</script>
+
+<style>
+</style>

+ 239 - 0
src/views/ldt/mallshoplabel.vue

@@ -0,0 +1,239 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :table-loading="loading"
+               :data="data"
+               :page.sync="page"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               v-model="form"
+               ref="crud"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @row-del="rowDel"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button type="danger"
+                   size="small"
+                   icon="el-icon-delete"
+                   plain
+                   v-if="permission.mallshoplabel_delete"
+                   @click="handleDelete">删 除
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {getList, getDetail, add, update, remove} from "@/api/ldt/mallshoplabel";
+  import {mapGetters} from "vuex";
+
+  export default {
+    data() {
+      return {
+        form: {},
+        query: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: {
+          height:'auto',
+          calcHeight: 30,
+          tip: false,
+          searchShow: true,
+          searchMenuSpan: 6,
+          border: true,
+          index: true,
+          viewBtn: true,
+          selection: true,
+          dialogClickModal: false,
+          column: [
+           
+            {
+              label: "标签名称",
+              prop: "name",
+              rules: [{
+                required: true,
+                message: "请输入标签名称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "标签说明",
+              prop: "statement",
+              rules: [{
+                required: true,
+                message: "请输入标签说明",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "所属商场",
+              prop: "mallId",
+              type: "select",
+
+              dicUrl: "/api/cyzh-ldt/mall/list?name={{key}}",
+              props:{
+                label: "name",
+                value: "id"
+              },
+              dicFormatter:(res) => {
+                return res.data.records;
+              },
+              rules: [{
+                required: true,
+                message: "请输入所属商场id",
+                trigger: "blur"
+              }]
+            },
+           
+          ]
+        },
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permission.mallshoplabel_add, false),
+          viewBtn: this.vaildData(this.permission.mallshoplabel_view, false),
+          delBtn: this.vaildData(this.permission.mallshoplabel_delete, false),
+          editBtn: this.vaildData(this.permission.mallshoplabel_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      rowSave(row, done, loading) {
+        add(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        update(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          console.log(error);
+        });
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage){
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      }
+    }
+  };
+</script>
+
+<style>
+</style>

+ 667 - 0
src/views/ldt/shop.vue

@@ -0,0 +1,667 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList"
+      :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
+      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
+      @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.shop_delete" @click="handleDelete">删
+          除
+        </el-button>
+      </template>
+
+      <template slot="mapSelectForm" slot-scope="scope">
+        <div>
+          <!--          <input class="el-input&#45;&#45;small el-input__inner" placeholder="选择地址" @click="mapVisible = true">-->
+          <el-button @click="selectMap"> 选择地址</el-button>
+          <el-dialog :append-to-body="true" :close-on-click-modal="false" :modal-append-to-body="false" :visible.sync="mapVisible"
+            title="编辑地址" width="80%">
+            <editPolygonMap ref="editPolygonMap" v-if="mapVisible" :editForm.sync="form" :region.sync="form.address"
+              :latitude.sync="form.latitude" :longitude.sync="form.longitude" :visible.sync="mapVisible"></editPolygonMap>
+          </el-dialog>
+        </div>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {
+    getList,
+    getDetail,
+    add,
+    update,
+    remove
+  } from "@/api/ldt/shop";
+  import {
+    getDetail as getMall
+  } from "@/api/ldt/mall";
+  import editPolygonMap from "../../components/map/editPolygonMap.vue"
+  import {
+    mapGetters
+  } from "vuex";
+
+  export default {
+    components: {
+      editPolygonMap
+    },
+    data() {
+      return {
+        mapVisible: false,
+        form: {},
+        query: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: {
+
+          height: 'auto',
+          calcHeight: 30,
+          tip: false,
+          searchShow: true,
+          searchMenuSpan: 6,
+          border: true,
+          index: true,
+          viewBtn: true,
+          selection: true,
+          dialogClickModal: false,
+          dialogWidth: "60%",
+          column: [{
+              label: "商户名称",
+              prop: "name",
+              display: false,
+              rules: [{
+                required: true,
+                message: "请输入商户名",
+                trigger: "blur"
+              }]
+            },
+
+            {
+              label: "所属商场",
+              prop: "mallId",
+              type: "select",
+              dicUrl: "/api/cyzh-ldt/mall/list",
+              props: {
+                label: "name",
+                value: "id"
+              },
+              display: false,
+              cascaderItem: ["mallAreaId"],
+              dicFormatter: (res) => {
+                return res.data.records;
+              },
+              rules: [{
+                required: true,
+                message: "请输入商场id",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "所属区域",
+              prop: "mallAreaId",
+              type: "select",
+              display: false,
+              dicUrl: "/api/cyzh-ldt/mallarea/list?mallId={{key}}",
+              props: {
+                label: "name",
+                value: "id"
+              },
+              dicFormatter: (res) => {
+                return res.data.records;
+              },
+
+              rules: [{
+                required: false,
+                message: "请输入商场区域id",
+                trigger: "blur"
+              }]
+            },
+
+            {
+              label: "经度",
+              prop: "longitude",
+               disabled: true,
+               display: false,
+              rules: [{
+                required: true,
+                message: "请输入经度",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "纬度",
+              prop: "latitude",
+              disabled: true,
+              display: false,
+              rules: [{
+                required: true,
+                message: "请输入纬度",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "具体地址",
+              prop: "address",
+               disabled: true,
+               display: false,
+              row: true,
+              span: 24,
+              rules: [{
+                required: true,
+                message: "请输入具体地址",
+                trigger: "blur"
+              }]
+            },
+
+            {
+              label: "评分",
+              prop: "score",
+              type: "number",
+              display: false,
+              rules: [{
+                required: true,
+                message: "请输入评分",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "宣传图",
+              prop: "cover",
+              type: "upload",
+              display: false,
+              action: "/api/blade-resource/oss/endpoint/put-file",
+              listType: "picture-img",
+              rules: [{
+                required: true,
+                message: "请输入封面",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "销量",
+              prop: "sales",
+              type: "number",
+              display: false,
+              rules: [{
+                required: true,
+                message: "请输入销量",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "标语",
+              prop: "slogan",
+              display: false,
+              rules: [{
+                required: true,
+                message: "请输入标语,逗号分割",
+                trigger: "blur"
+              }]
+            },
+          ],
+          group: [{
+              icon: 'el-icon-info',
+              label: '商家基本信息',
+              collapse: true,
+              prop: 'group1',
+              column: [{
+                  label: "商户名称",
+                  prop: "name",
+                  rules: [{
+                    required: true,
+                    message: "请输入商户名",
+                    trigger: "blur"
+                  }]
+                },
+
+                {
+                  label: "所属商场",
+                  prop: "mallId",
+                  type: "select",
+                  dicUrl: "/api/cyzh-ldt/mall/list",
+                  props: {
+                    label: "name",
+                    value: "id"
+                  },
+                  cascaderItem: ["mallAreaId"],
+                  dicFormatter: (res) => {
+                    return res.data.records;
+                  },
+                  rules: [{
+                    required: false,
+                    message: "请输入商场id",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "所属区域",
+                  prop: "mallAreaId",
+                  type: "select",
+                  dicUrl: "/api/cyzh-ldt/mallarea/list?mallId={{key}}",
+                  props: {
+                    label: "name",
+                    value: "id"
+                  },
+                  dicFormatter: (res) => {
+                    return res.data.records;
+                  },
+
+                  rules: [{
+                    required: false,
+                    message: "请输入商场区域id",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: '',
+                  prop: 'mapSelect',
+                  viewDisplay: false,
+                  row: true,
+                  formslot: true,
+                  hide: true,
+                },
+                {
+                  label: "经度",
+                  prop: "longitude",
+                   disabled: true,
+                  rules: [{
+                    required: false,
+                    message: "请输入经度",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "纬度",
+                  prop: "latitude",
+                  disabled: true,
+                  rules: [{
+                    required: false,
+                    message: "请输入纬度",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "具体地址",
+                  prop: "address",
+                   disabled: true,
+                  row: true,
+                  span: 24,
+                  rules: [{
+                    required: false,
+                    message: "请输入具体地址",
+                    trigger: "blur"
+                  }]
+                },
+
+                {
+                  label: "评分",
+                  prop: "score",
+                  type: "number",
+                  rules: [{
+                    required: false,
+                    message: "请输入评分",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "宣传图",
+                  prop: "cover",
+                  type: "upload",
+                  action: "/api/blade-resource/oss/endpoint/put-file",
+                 propsHttp: {
+                   res: 'data',
+                   url: 'link',
+                 },
+                  listType: "picture-img",
+                  rules: [{
+                    required: false,
+                    message: "请输入封面",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "销量",
+                  prop: "sales",
+                  type: "number",
+                  rules: [{
+                    required: false,
+                    message: "请输入销量",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "标语",
+                  prop: "slogan",
+                  rules: [{
+                    required: false,
+                    message: "请输入标语,逗号分割",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "标签(种类)",
+                  prop: "labelIds",
+                  type: "select",
+                  multiple: true,
+                  dicUrl: "/api/cyzh-ldt/mallshoplabel/list",
+                  props:{
+                    label: "name",
+                    value: "id"
+                  },
+                  dicFormatter:(res)=>{
+                    return res.data.records;
+                  },
+                  // display: false,
+                  rules: [{
+                    required: true,
+                    message: "请输入标语,逗号分割",
+                    trigger: "blur"
+                  }]
+                },
+              ]
+            },
+            {
+              icon: 'el-icon-info',
+              label: '业务人信息',
+              collapse: true,
+              prop: 'group2',
+              column: [{
+                  label: "姓名",
+                  prop: "personName",
+                  width: 100,
+                  rules: [{
+                    required: false,
+                    message: "请输入业务联系人",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "联系号码",
+                  prop: "personTel",
+                  rules: [{
+                    required: false,
+                    message: "请输入联系人手机号码",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "身份证号码",
+                  prop: "personIdCard",
+                  span: 24,
+                  labelWidth: 100,
+                  rules: [{
+                    required: false,
+                    message: "请输入业务人身份证信息",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "身份证正面图片",
+                  prop: "idCardFront",
+                  propsHttp: {
+                    res: 'data',
+                    url: 'link',
+                  },
+                  type: "upload",
+                  action: "/api/blade-resource/oss/endpoint/put-file",
+                  listType: "picture-img",
+                  rules: [{
+                    required: false,
+                    message: "请输入身份证正面图片地址",
+                    trigger: "blur"
+                  }]
+                },
+                {
+                  label: "身份证反面图片",
+                  prop: "idCardContrary",
+                  propsHttp: {
+                    res: 'data',
+                    url: 'link',
+                  },
+                  type: "upload",
+                  action: "/api/blade-resource/oss/endpoint/put-file",
+                  listType: "picture-img",
+                  rules: [{
+                    required: false,
+                    message: "请输入身份证反面图片地址",
+                    trigger: "blur"
+                  }]
+                },
+              ]
+            },
+            {
+              icon: 'el-icon-info',
+              label: '公司信息',
+              collapse: true,
+              prop: 'group3',
+              column: [{
+              label: "单位全称",
+              row: true,
+              prop: "fullName",
+              rules: [{
+                required: false,
+                message: "请输入单位全称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "公司网址",
+              prop: "webUrl",
+              rules: [{
+                required: false,
+                message: "请输入公司网址",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "法人姓名",
+              prop: "legalPersonName",
+              rules: [{
+                required: false,
+                message: "请输入法人姓名",
+                trigger: "blur"
+              }]
+            },
+
+            {
+              label: "营业执照",
+              prop: "businessLicense",
+              propsHttp: {
+                res: 'data',
+                url: 'link',
+              },
+              type: "upload",
+              action: "/api/blade-resource/oss/endpoint/put-file",
+              listType: "picture-img",
+              rules: [{
+                required: false,
+                message: "请输入营业执照",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "店铺实况图片",
+              prop: "shopPic",
+              propsHttp: {
+                res: 'data',
+                url: 'link',
+              },
+              type: "upload",
+              action: "/api/blade-resource/oss/endpoint/put-file",
+              listType: "picture-img",
+              rules: [{
+                required: false,
+                message: "请输入店铺实况图片",
+                trigger: "blur"
+              }]
+            },]
+            }
+          ],
+
+        },
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permission.shop_add, false),
+          viewBtn: this.vaildData(this.permission.shop_view, false),
+          delBtn: this.vaildData(this.permission.shop_delete, false),
+          editBtn: this.vaildData(this.permission.shop_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      selectMap() {
+        var _that = this;
+        if (_that.form.mallId == undefined || _that.form.mallId == null || _that.form.mallId == "") {
+          _that.$message.warning("请先选择所属商场")
+        } else {
+
+          getMall(this.form.mallId).then(res => {
+            let mall = res.data.data;
+            _that.form.latitude = mall.latitude;
+            _that.form.longitude = mall.longitude;
+            _that.form.address = mall.address;
+            _that.mapVisible = true;
+            _that.$nextTick(() => {
+              _that.$refs.editPolygonMap.initMap();
+
+            })
+          })
+        }
+
+
+      },
+      rowSave(row, done, loading) {
+        row.labelIds = row.labelIds.toString()
+        add(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        row.labelIds = row.labelIds.toString()
+        update(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          console.log(error);
+        });
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+            this.form.labelIds = this.from.labelIds.split(",")
+          });
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage) {
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      }
+    }
+  };
+</script>
+
+<style>
+</style>

+ 1 - 1
vue.config.js

@@ -26,7 +26,7 @@ module.exports = {
     proxy: {
       '/api': {
         //本地服务接口地址
-        target: 'http://localhost:9613',
+        target: 'http://localhost:2539',
         //远程演示服务地址,可用于直接启动项目
         //target: 'https://saber.bladex.vip/api',
         ws: true,