<template>
  <div>
    <el-dialog :visible.sync="showBian"
      :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false" custom-class='XDD_css'
      style="padding: 0;" width="65%" center>
      <div
        style="background-color: #FAFAFA;border:1px solid #EAEAEA;height: 42px;width: 100%;margin-bottom: 20px;padding: 0 20px;line-height: 42px;">
        详情
      </div>
      <div style="padding: 0 20px 20px  20px;">
        <div style="margin-top: 20px;" v-if="restype == '商铺'">
          <el-form label-width="140px" :model="ruleForm" :rules="rules" ref="ruleForm" :validate-on-rule-change="false" :show-message="false">
            <el-form-item label="商铺名称" prop="shopName">
              <el-input v-model="ruleForm.shopName"  style="margin-top:5px;" :disabled="edit" maxlength="50"></el-input>
            </el-form-item>
            <el-form-item label="场地编号" prop="venueNumber">
              <el-input v-model="ruleForm.venueNumber" disabled placeholder="将根据类型自动为资源编号"
                style="margin-top:5px;"></el-input>
            </el-form-item>
            <el-form-item label="门牌号" prop="houseNumber">
              <el-input v-model="ruleForm.houseNumber"  style="margin-top:5px;" :disabled="edit" maxlength="20"></el-input>
            </el-form-item>

            <el-form-item label="建筑形式" prop="architecturalForm">
              <el-select v-model="ruleForm.architecturalForm"  style="margin-top:5px;width: 100%;" :disabled="edit">
                <el-option label="框剪结构" value="框剪结构"></el-option>
                <el-option label="区域二" value="区域二"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="所属绿道段" prop="belongingGreenwaySection">
              <el-select v-model="ruleForm.belongingGreenwaySection"
                style="margin-top:5px;width: 100%;" @change="lvdaoSel" :disabled="edit">
                <el-option :label="item.name" :value="item.code" v-for="(item,index) in lvdaoList" :key="index"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="所属公园/步道" prop="belongingParkTrail">
              <el-select v-model="ruleForm.belongingParkTrail"  style="margin-top:5px;width: 100%;" :disabled="edit">
                <el-option :label="item.name" :value="item.code" v-for="(item,index) in biangongyuanList"  :key="index"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="建筑面积" prop="floorSpace">
              <el-input v-model.number="ruleForm.floorSpace"  style="margin-top:5px;" :disabled="edit">
                <template slot="append">M<sup>2</sup></template>
              </el-input>
            </el-form-item>
            <el-form-item label="实际使用面积" prop="actualUsableArea">
              <el-input v-model.number="ruleForm.actualUsableArea"  style="margin-top:5px;" :disabled="edit">
                <template slot="append">M<sup>2</sup></template>
              </el-input>
            </el-form-item>
            <el-form-item label="所属区域" prop="belongingRegion">
              <el-select v-model="ruleForm.belongingRegion"  style="margin-top:5px;width: 100%;" :disabled="edit">
                <el-option label="成华区" value="成华区"></el-option>
                <el-option label="武侯区" value="武侯区"></el-option>
                <el-option label="锦江区" value="锦江区"></el-option>
                <el-option label="青羊区" value="青羊区"></el-option>
                <el-option label="金牛区" value="金牛区"></el-option>
                <el-option label="双流区" value="双流区"></el-option>
                <el-option label="郫都区" value="郫都区"></el-option>
                <el-option label="龙泉驿区" value="龙泉驿区"></el-option>
                <el-option label="温江区" value="温江区"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="归属部门" prop="belongingDepartment">
              <el-input v-model="ruleForm.belongingDepartment"  style="margin-top:5px;" :disabled="edit" maxlength="50">
              </el-input>
            </el-form-item>
            <el-form-item label="负责人" prop="head">
              <el-input v-model="ruleForm.head"  style="margin-top:5px;" :disabled="edit" maxlength="20">
              </el-input>
            </el-form-item>
            <el-form-item label="详细位置" prop="detailedLocation">
              <el-input v-model="ruleForm.detailedLocation"  style="margin-top:5px;" :disabled="edit" maxlength="100">
              </el-input>
            </el-form-item>
            <el-form-item label="商铺业态" prop="commercialForm">
              <el-select v-model="ruleForm.commercialForm" :disabled="edit"  style="margin-top:5px;width: 100%;">
                <el-option label="商超" value="商超"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="地图标点" prop="mapPunctuation">
              <div style="width: 100%;height: 100px;border: 1px solid #3F9B6A;" v-if="showBian">

                <MapXian :message="parentMessage"  :edit='edit' :sendMap='getChildDate'></MapXian>
              </div>
            </el-form-item>
            <el-form-item label="建筑图纸" prop="architecturalDrawings">
              <upimg v-model="ruleForm.architecturalDrawings" :limit="5" :fileSize="1" v-if="edit==false"></upimg>
              <img :src="ruleForm.architecturalDrawings" alt="" style="width:140px;height:140px;" v-else>

            </el-form-item>
            <el-form-item label="商铺描述" prop="shopDescription">
                                   <el-input type="textarea" v-model="ruleForm.shopDescription"  style="margin-top:5px;" :disabled="edit" ></el-input>
            </el-form-item>
            <el-form-item label="展示主图" prop="displayMainImage">
              <upimg v-model="ruleForm.displayMainImage" :limit="1" :fileSize="1" v-if="edit==false"></upimg>
              <img :src="ruleForm.displayMainImage" alt="" style="width:140px;height:140px;" v-else>
            </el-form-item>
            <el-form-item label="其他图片/视频" prop="displayMainVidio">
              <upvidio v-model="ruleForm.displayMainVidio" :limit="3" v-if="edit==false"></upvidio>
              <img :src="ruleForm.displayMainVidio" alt="" style="width:140px;height:140px;" v-else>
            </el-form-item>

          </el-form>
        </div>

        <div style="margin-top: 20px;" v-if="restype == '场地'">
          <el-form label-width="140px" :model="ruleForm" :rules="rulestwo" ref="ruleForm" :show-message="false"
            :validate-on-rule-change="false">
            <el-form-item label="场地名称" prop="venueName">
              <el-input v-model="ruleForm.venueName"  style="margin-top:5px;" :disabled="edit" maxlength="50"></el-input>
            </el-form-item>
            <el-form-item label="场地类型" prop="venueType">
              <el-select v-model="ruleForm.venueType"  style="margin-top:5px;width: 100%;" :disabled="edit">
                <el-option label="草地" value="草地"></el-option>

              </el-select>
            </el-form-item>
            <el-form-item label="实际使用面积" prop="actualArea">
              <el-input v-model.number="ruleForm.actualArea"  style="margin-top:5px;" :disabled="edit">
                <template slot="append">M<sup>2</sup></template>
              </el-input>
            </el-form-item>
            <el-form-item label="所属区域" prop="district">
              <el-select v-model="ruleForm.district"  style="margin-top:5px;width: 100%;" :disabled="edit">
                <el-option label="成华区" value="成华区"></el-option>
                <el-option label="武侯区" value="武侯区"></el-option>
                <el-option label="锦江区" value="锦江区"></el-option>
                <el-option label="青羊区" value="青羊区"></el-option>
                <el-option label="金牛区" value="金牛区"></el-option>
                <el-option label="双流区" value="双流区"></el-option>
                <el-option label="郫都区" value="郫都区"></el-option>
                <el-option label="龙泉驿区" value="龙泉驿区"></el-option>
                <el-option label="温江区" value="温江区"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="归属部门" prop="department">
              <el-input v-model="ruleForm.department"  style="margin-top:5px;" :disabled="edit" maxlength="50">
              </el-input>
            </el-form-item>
            <el-form-item label="负责人" prop="responsiblePerson">
              <el-input v-model="ruleForm.responsiblePerson"  style="margin-top:5px;" :disabled="edit" maxlength="20">
              </el-input>
            </el-form-item>
            <el-form-item label="详细位置" prop="detailedLocation">
              <el-input v-model="ruleForm.detailedLocation"  style="margin-top:5px;" :disabled="edit" maxlength="100">
              </el-input>
            </el-form-item>
            <el-form-item label="地图标点" prop="mapMarker">
            <div style="width: 100%;height: 100px;border: 1px solid #3F9B6A;" v-if="showBian">

              <MapXian :message="parentMessage"  :edit='edit' :sendMap='getChildDate'></MapXian>
            </div>
            </el-form-item>
            <el-form-item label="场地描述" prop="description">
              <el-input type="textarea" v-model="ruleForm.description" style="margin-top:5px;" :disabled="edit" maxlength="200"
                ></el-input>
            </el-form-item>
            <el-form-item label="规划图纸" prop="planningDrawing">
              <upimg v-model="ruleForm.planningDrawing" :limit="1" :fileSize="1" v-if="edit==false"></upimg>
              <img :src="ruleForm.planningDrawing" alt="" style="width:140px;height:140px;" v-else>
            </el-form-item>
            <el-form-item label="展示主图" prop="displayImage">

              <upimg v-model="ruleForm.displayImage" :limit="1" :fileSize="1" v-if="edit==false"></upimg>
              <img :src="ruleForm.displayImage" alt="" style="width:140px;height:140px;" v-else>
            </el-form-item>
            <el-form-item label="其他图片/视频" prop="otherMedia">

              <upvidio v-model="ruleForm.otherMedia" :limit="1" v-if="edit==false"></upvidio>
              <img :src="ruleForm.otherMedia" alt="" style="width:140px;height:140px;" v-else>
            </el-form-item>

          </el-form>
        </div>

        <div style="margin-top: 20px;" v-if="restype == '广告位'">
          <el-form :model="ruleForm" :rules="leixing?rulesthree:rulesSt" ref="ruleForm" label-width="100px"
            class="demo-ruleForm" :validate-on-rule-change="false" :show-message="false">
            <el-form-item label="广告位类型">
              <el-select v-model="advue.type"  style="margin-top:5px;width: 100%;" disabled
                @change="changeType">
                <el-option label="线上广告位" value="线上广告位"></el-option>
                <el-option label="实体广告位" value="实体广告位"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="广告位名称" prop="advertisingName">
              <el-input v-model="ruleForm.advertisingName"  style="margin-top:5px;" :disabled="edit" maxlength="50"></el-input>
            </el-form-item>
            <el-form-item label="广告位编号" prop="advertisingSpaceNumber">
              <el-input v-model="ruleForm.advertisingSpaceNumber" disabled placeholder="将根据类型自动为资源编号"
                style="margin-top:5px;"></el-input>
            </el-form-item>
            <el-form-item label="所属端" prop="affiliation" v-if='leixing'>
              <el-select v-model="ruleForm.affiliation"  style="margin-top:5px;width: 100%;" :disabled="edit">
                <el-option label="游客小程序" value="游客小程序"></el-option>
                <el-option label="商家客户端" value="商家客户端"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="详细位置" prop="detailedLocation" v-if='leixing == false'>
              <el-input v-model="ruleForm.detailedLocation"  style="margin-top:5px;" :disabled="edit" maxlength="50"></el-input>
            </el-form-item>
            <el-form-item label="轮播顺序" prop="rotationOrder" v-if='leixing'>
              <el-select v-model="ruleForm.rotationOrder"  style="margin-top:5px;width: 100%;" :disabled="edit">
                <el-option label="1" value="1"></el-option>
                <el-option label="2" value="2"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="地图标点" prop="mapPunctuation" v-if='leixing == false'>
             <div style="width: 100%;height: 100px;border: 1px solid #3F9B6A;" v-if="showBian">
               <MapXian :message="parentMessage"  :edit='edit' :sendMap='getChildDate'></MapXian>
             </div>
            </el-form-item>
            <el-form-item label="广告尺寸" prop="dimensions" v-if='leixing'>
              <el-input v-model="ruleForm.dimensions" disabled placeholder="宽:300px 长:400px"
                style="margin-top:5px;" ></el-input>

            </el-form-item>
            <el-form-item label="可上传大小" prop="size" v-if='leixing'>
              <el-input v-model="ruleForm.size" disabled placeholder="100kb" style="margin-top:5px;"></el-input>
            </el-form-item>
            <el-form-item label="上传格式" prop="uploadFormat" v-if='leixing'>
              <el-input v-model="ruleForm.uploadFormat" disabled placeholder="JPG、PNG、MP4"
                style="margin-top:5px;"></el-input>
            </el-form-item>
            <el-form-item label="设备类型" prop="deviceType" v-if='leixing == false'>
              <div style="display: flex;justify-content: space-between;">
                <el-select v-model="ruleForm.deviceType"  style="margin-top:5px;width: 92%;" :disabled="edit">
                  <el-option label="灯箱广告牌" value="灯箱广告牌"></el-option>
                  <el-option label="2" value="2"></el-option>
                </el-select>
              </div>
            </el-form-item>

            <el-form-item label="设备大小" prop="equipmentSize" v-if='leixing == false'>
              <div style="display: flex;">
                <div>
                  <span style="font-size: 12px;">长：</span>
                  <el-select v-model="ruleForm.equipmentSizeH"
                  :disabled="edit"
                    style="margin-top:5px;width: 90px;margin: 0 5px 0 0;">
                    <el-option label="10" value="10"></el-option>
                    <el-option label="20" value="20"></el-option>
                  </el-select>
                  <span style="font-size: 12px;margin-right:5px;">mm</span>
                </div>
                <div>
                  <span style="font-size: 12px;">宽：</span>
                  <el-select v-model="ruleForm.equipmentSizeK"
                  :disabled="edit"
                    style="margin-top:5px;width: 90px;margin: 0 5px 0 0;">
                    <el-option label="10" value="10"></el-option>
                    <el-option label="20" value="20"></el-option>
                  </el-select>
                  <span style="font-size: 12px;margin-right:5px;">mm</span>
                </div>
                <div>
                  <span style="font-size: 12px;">高：</span>
                  <el-select v-model="ruleForm.equipmentSizeG"
                  :disabled="edit"
                    style="margin-top:5px;width: 90px;margin: 0 5px 0 0;">
                    <el-option label="10" value="10"></el-option>
                    <el-option label="20" value="20"></el-option>
                  </el-select>
                  <span style="font-size: 12px;margin-right:5px;">mm</span>
                </div>
              </div>
            </el-form-item>
            <el-form-item label="广告尺寸" v-if='leixing == false'>
              <div style="display: flex;">
                <div>
                  <span style="font-size: 12px;">长：</span>
                  <el-select v-model="ruleForm.dimensionsH"
                  :disabled="edit"
                    style="margin-top:5px;width: 90px;margin: 0 5px 0 0;">
                    <el-option label="10" value="10"></el-option>
                    <el-option label="20" value="20"></el-option>
                  </el-select>
                  <span style="font-size: 12px;margin-right:5px;">mm</span>
                </div>
                <div>
                  <span style="font-size: 12px;">宽：</span>
                  <el-select v-model="ruleForm.dimensionsK"
                   :disabled="edit"
                    style="margin-top:5px;width: 90px;margin: 0 5px 0 0;">
                    <el-option label="10" value="10"></el-option>
                    <el-option label="20" value="20"></el-option>
                  </el-select>
                  <span style="font-size: 12px;margin-right:5px;">mm</span>
                </div>
              </div>
            </el-form-item>

            <el-form-item label="广告材质" prop="advertisingMaterial" v-if='leixing == false'>
              <div style="display: flex;justify-content: space-between;">
                <el-select v-model="ruleForm.advertisingMaterial"  style="margin-top:5px;width: 92%"  :disabled="edit">
                  <el-option label="亚克力" value="亚克力"></el-option>
                  <el-option label="2" value="2"></el-option>
                </el-select>
              </div>
            </el-form-item>
            <el-form-item label="位置示意图" prop="locationDiagram">
              <upimg v-model="ruleForm.locationDiagram" :limit="1" :fileSize="1" v-if="edit==false"></upimg>
              <img :src="ruleForm.locationDiagram" alt="" style="width:140px;height:140px;" v-else>
            </el-form-item>
          </el-form>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeFn()" class="buttonHover"
          style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取 消</el-button>
          <el-button @click="bianji()" style="background-color: #3F9B6A;color:#fff;" v-if="edit">编 辑</el-button>
        <el-button @click="addCheck('ruleForm')" style="background-color: #3F9B6A;color:#fff;" v-else>确 定</el-button>
      </span>
    </el-dialog>

  </div>

</template>

<script>
  import MapMark from "@/components/MapContainer/MapMark"
  import MapXian from "@/components/MapContainer/MapXian"
  import upimg from "@/components/ImageUpload/index"
  import upvidio from "@/components/fujianUpload/index"
  import axios from 'axios'
  import {
    getToken,
    removeToken
  } from '@/utils/auth'
  import {
    editList,
    lvdaoduan,
    gongyuan,
    changedit
  } from '../../api/information'
  import {
    addList as ggwadd,
    editList as ggwedit
  } from '../../api/map1'
  export default {
    props: {
      showBian: {
        type: Boolean,
        default: false
      },
      restype:{
        type: String,
        default: '商铺'
      },
      listData:{
        type: Object,
        default: () => ({})
      },
    },
    data() {
      return {
        advue: {
          type: '线上广告位'
        },
        leixing: true, //广告位类型
        ruleForm:{},
        rules: {
          shopName: [{
            required: true,
            message: '请输入商铺名称',
            trigger: []
          }, ],
          houseNumber: [{
            required: true,
            message: '请输入门牌号',
            trigger: []
          }, ],
          architecturalForm: [{
            required: true,
            message: '请选择建筑形式',
            trigger: []
          }],
          actualUsableArea: [{
            required: true,
            message: '请输入实际使用面积',
            trigger: []
          }, ],
          belongingRegion: [{
            required: true,
            message: '请选择所属区域',
            trigger: []
          }],
          head: [{
            required: true,
            message: '请输入负责人',
            trigger: []
          }, ],
          detailedLocation: [{
            required: true,
            message: '请输入详细位置',
            trigger: []
          }, ],
          displayMainImage: [{
            required: true,
            message: '请上传主图',
            trigger: []
          }, ],
          belongingGreenwaySection: [{
            required: true,
            message: '请选择所属绿道段',
            trigger: []
          }]
        },
        rulestwo: {
          shopName: [{
            required: true,
            message: '请输入场地名称',
            trigger: []
          }, ],
          changlei: [{
            required: true,
            message: '请选择场地类型',
            trigger: []
          }, ],
          actualUsableArea: [{
            required: true,
            message: '请输入实际使用面积',
            trigger: []
          }, ],
          belongingRegion: [{
            required: true,
            message: '请选择所属区域',
            trigger: []
          }],
          detailedLocation: [{
            required: true,
            message: '请输入详细位置',
            trigger: []
          }, ]
        },
        rulesLei: {
          leixin: [{
            required: true,
            message: '请选择资源类型',
            trigger: []
          }, ],
        },
        rulesthree: {
          advertisingName: [{
            required: true,
            message: '请输入名称',
            trigger: []
          }],
          advertisingType: [{
            required: true,
            message: '请选择类型',
            trigger: []
          }],
          affiliation: [{
            required: true,
            message: '请选择所属端',
            trigger: []
          }],
          rotationOrder: [{
            required: true,
            message: '请选择轮播顺序',
            trigger: []
          }],

        },
        rulesSt: {
          advertisingName: [{
            required: true,
            message: '请输入名称',
            trigger: []
          }],
          advertisingType: [{
            required: true,
            message: '请选择类型',
            trigger: []
          }],
          position: [{
            required: true,
            message: '请输入详细位置',
            trigger: []
          }],
          dimensionsH: [{
            required: true,
            message: '请选择广告尺寸',
            trigger: []
          }],
          dimensionsK: [{
            required: true,
            message: '请选择广告尺寸',
            trigger: []
          }],
          advertisingMaterial: [{
            required: true,
            message: '请选择材质',
            trigger: []
          }],
        },
        lvdaoList: [],
        gongyuanList: [],
        //地图标点的经纬度
        mapData: {},
        parentMessage: {},
        edit: true,
        showMap: false,
        biangongyuanList:[]
      }
    },
    components: {
      MapMark,
      upimg,
      upvidio,
      MapXian
    },
  watch: {
    // 监听listData prop的变化
    restype :{
      immediate: true, // 立即执行handler函数
      handler(newVal) {
        if(newVal == '广告位'){

        }

        // advue
        // type
      }
    },

    listData: {
      immediate: true, // 立即执行handler函数
      handler(newVal) {
        this.edit = true
        this.ruleForm = { ...newVal }; // 使用展开运算符创建新对象，以触发响应式更新
        if(this.ruleForm.advertisingType){
             this.changeType(this.ruleForm.advertisingType)
        }
        if(this.ruleForm.mapPunctuation){
            this.parentMessage = JSON.parse(this.ruleForm.mapPunctuation)
        }else{
           this.parentMessage = JSON.parse(this.ruleForm.mapMarker)
        }


      }
    }
  },
    mounted() {
      this.getAll()
    },

    computed: {

    },
    methods: {
      //查询全数据
     async getAll() {
       const lvdao = await lvdaoduan()
          const gongyaun =  await gongyuan()
            this.lvdaoList = lvdao.data
          this.biangongyuanList = gongyaun.data
      },
   async gongyuan1(value){
       const gongyaun =  await gongyuan()
         this.biangongyuanList = gongyaun.data.filter(item => item.superior == value);
   },
      closeFn() {
        this.$emit('bianClose', false);
        this.edit = true
      },
      //获取当前时间
       updateCurrentTime() {
            const now = new Date();
            const year = now.getFullYear();
            const month = (now.getMonth() + 1).toString().padStart(2, '0');
            const day = now.getDate().toString().padStart(2, '0');
            const hours = now.getHours().toString().padStart(2, '0');
            const minutes = now.getMinutes().toString().padStart(2, '0');
            const seconds = now.getSeconds().toString().padStart(2, '0');

           return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
          },
      // 确定
      addCheck(formName){
               this.$refs[formName].validate((valid) => {
            if (valid) {
              if(this.restype =='商铺'){
                this.ruleForm.updateDate = this.updateCurrentTime()
                this.ruleForm.mapPunctuation = JSON.stringify(this.mapData)
                editList(this.ruleForm).then(res=>{
                  this.$emit('bianClose', false);
                })
              }else if(this.restype =='广告位'){
                this.ruleForm.updateDate = this.updateCurrentTime()
                if(this.advue.type =='实体广告位'){
                  this.ruleForm.equipmentSize = `长：${this.ruleForm.equipmentSizeH} 宽：${this.ruleForm.equipmentSizeK} 高：${this.ruleForm.equipmentSizeG}`
                  this.ruleForm.dimensions =`长：${this.ruleForm.dimensionsH} 宽：${this.ruleForm.dimensionsK}`
                }
                this.ruleForm.mapPunctuation = JSON.stringify(this.mapData)
                ggwedit(this.ruleForm).then(res=>{
                  this.$emit('bianClose', false);
                })

              }else{
  this.ruleForm.updateDate = ''
  this.ruleForm.createDate = ''
                this.ruleForm.mapMarker = JSON.stringify(this.mapData)
                changedit(this.ruleForm).then(res=>{
                  this.$emit('bianClose', false);
                })
              }
                console.log(this.ruleForm)
            } else {
            this.$message({
              message: '请填写完整信息',
              type: 'error'
            })
              return false;
            }
          })

      },
      lvdaoSel(vaule) {
        this.ruleForm.belongingParkTrail = ''
        this.gongyuan1(vaule)
      },
      chengleixing(va) {
        console.log(va)
        if (va = '商铺') {
          this.ruleForm = {
            shopName: '',
            venueNumber: '',
            houseNumber: '',
            architecturalForm: '',
            actualUsableArea: '',
            belongingRegion: '',
            belongingDepartment: '',
            head: '',
            commercialForm:'',
            detailedLocation: '',
            mapPunctuation: '',
            shopDescription: '',
            displayMainImage: '',
            architecturalDrawings: '',
            displayMainVidio: '',
            belongingGreenwaySection: '',
            belongingParkTrail: '',
            floorSpace: '',
          }
        } else if (va = '场地') {
          this.ruleForm = {
            shopName: '',
            venueNumber: '',
            houseNumber: '',
            architecturalForm: '',
            actualUsableArea: '',
            belongingRegion: '',
            belongingDepartment: '',
            head: '',
            detailedLocation: '',
            mapPunctuation: '',
            shopDescription: '',
            displayMainImage: '',
            architecturalDrawings: '',
            displayMainVidio: '',
            belongingGreenwaySection: '',
            belongingParkTrail: '',
            floorSpace: '',
          }
        } else {
          this.ruleForm = {
            advertisingName: '', //广告位名称
            advertisingType: '', //广告位类型
            rotationOrder: '', // 轮播顺序
            createUser: '', // 创建人
            affiliation: '', //所属端
            detailedLocation: '', //详细位置
            dimensions: '', //广告尺寸
            size: '', //广告大小
            uploadFormat: '', //上传类型
            advertisingSpaceStrategy: '', //策略
            advertisingSpaceNumber: '', //广告位编号
            locationDiagram: '', //位置示意图
            mapPunctuation: '', //地图标点
            deviceType: '', //设备类型
            equipmentSize: '', //设备尺寸
            advertisingMaterial: '', //广告材质
            createDate: '', //创建时间
            equipmentSizeH: "",
            equipmentSizeK: '',
            equipmentSizeG: '',
            dimensionsH: '',
            dimensionsK: '',
            rentalStatus: '0',
            publishStatus: '0'
          }
        }
      },
      //获取地图点击的经纬度
      getChildDate(mapData) {
        this.mapData = mapData
      },
      changeType(val) {

        this.advue.type = val

        if(val =='线上广告位'){
          this.leixing = true
        }else{
          this.leixing = false
        }

      },
      destroyMap() {
        this.$refs.mapComponent.destroyMap();
      },
      bianji(){
        this.edit = false
      }
    }
  }
</script>

<style>
</style>
