上饶市警务平台后台管理前端
zhongrj
2023-02-20 f02caef2e782b578b2a29b84b59b15e2f43648f2
src/views/security/security.vue
@@ -19,7 +19,8 @@
        </el-button>
      </template>
      <template slot="activityAreaForm">
        <map-box ref="OpenLayersMap" @toData="toData" :routeRange="form.activityArea"></map-box>
<!--        <map-box ref="OpenLayersMap" @toData="toData" :routeRange="form.activityArea"></map-box>-->
        <dc-map ref="dcMap" @toData="toData" :range="form.activityArea"></dc-map>
      </template>
    </avue-crud>
@@ -55,9 +56,11 @@
import securityManageCar from "@/views/securityManageCar/securityManageCar"
import MapBox from "@/components/map/mapBox";
import SearchMap from "@/components/map/searchMap";
import DcMap from "@/components/map/dcMap";
export default {
  components: {
    DcMap,
    SearchMap,
    MapBox,
    securityManage,
@@ -106,10 +109,12 @@
              message: "请输入活动名称",
              trigger: "blur"
            }],
            overHidden:true,
          },
          {
            label: "负责单位",
            prop: "company",
            hide:true,
          },
          {
            label: "负责人",
@@ -138,9 +143,7 @@
            click: () => {
              this.placeBox = !this.placeBox
            },
            // addDisplay: false,
            // editDisplay: false,
            // viewDisplay: false,
            overHidden:true,
          },
          {
            label: "经度",
@@ -179,15 +182,16 @@
            label: "所属辖区",
            prop: "deptId",
            type: "tree",
            dicUrl: "api/blade-system/dept/lazy-list",
            dicUrl: "api/blade-system/dept/getPoliceStationTree",
            props: {
              label: 'deptName',
              label: 'name',
              value: 'id',
              children: 'children'
            },
            search: true,
            searchSpan: 4,
            span: 24,
            defaultExpandAll:"true",
            width: 110,
            rules: [{
              required: true,
@@ -259,12 +263,18 @@
            label: "人数",
            prop: "number",
            width: 60,
            rules: [{
              required: true,
              message: "请输入人数",
              trigger: "blur"
            }],
          },
          {
            label: "活动内容",
            prop: "content",
            type: "textarea",
            span: 24
            span: 24,
            hide:true,
          },
        ]
      },
@@ -339,10 +349,7 @@
        loading()
        return
      }
      if (row.activityArea.startsWith("LINESTRING")){
      }else {
      if (!row.activityArea.startsWith("'LINESTRING")){
        row.activityArea = "'LINESTRING("+row.activityArea+")'"
      }
      row.position = row.longitude + " " + row.latitude
@@ -405,6 +412,7 @@
          this.form['longitude'] = data.position.split(" ")[0]
          this.form['latitude'] = data.position.split(" ")[1]
          this.point = "POINT("+this.form.longitude +" "+this.form.latitude+")"
          this.$refs.dcMap.showPolygon(this.form.activityArea)
        })
      }
      done()
@@ -472,11 +480,18 @@
      this.chosePoint.address = data
    },
    confirmLonLat(){
      this.form.longitude =  this.chosePoint.longitude
      this.form.latitude =  this.chosePoint.latitude
      this.form.place = this.chosePoint.address
      this.point = "POINT("+this.form.longitude +" "+this.form.latitude+")"
      this.placeBox = false
      if(this.chosePoint.longitude){
        this.form.longitude =  this.chosePoint.longitude
        this.form.latitude =  this.chosePoint.latitude
        this.form.place = this.chosePoint.address
        this.point = "POINT("+this.form.longitude +" "+this.form.latitude+")"
        this.placeBox = false
      }else {
        this.$alert('该点没有位置信息,请重新选点!', '提示', {
          confirmButtonText: '确定',
        });
      }
    }
  }
}