Blame view

admin-web-master/src/components/add/addmap.vue 20.8 KB
4373acf5   wesley88   1
1
  <template>
4dac8c0b   wesley88   1
2
    <div >
542e27d5   wesley88   1
3
      <el-form v-if="ontype =='线上广告位' && iShsow" :model="formInline" :rules="rules" ref="formInline" label-width="130px"
4373acf5   wesley88   1
4
        class="demo-ruleForm">
a182f238   wesley88   1
5
        <el-form-item label="广告位类型" prop="advertisingType">
9b392fc6   wesley88   1
6
          <el-select @change="changeadvertisingType" v-model="formInline.advertisingType" placeholder="请选择" style="width: 100%;">
a182f238   wesley88   1
7
8
9
10
11
12
13
            <el-option v-for="(item, index) in typelist" :key="index" :label="item.name" :value="item.vaule"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="广告位名称" prop="advertisingName">
          <el-input v-model="formInline.advertisingName" placeholder="请输入" maxlength="30"></el-input>
        </el-form-item>
        <el-form-item label="所属端" prop="affiliation" >
bfccec71   杨鑫   拉去
14
          <el-select v-model="formInline.affiliation" placeholder="请选择" style="width: 100%;"  @change="affiliationChange">
04473319   wesley88   1
15
16
17
18
            <!-- <el-option label="游客小程序" value="游客小程序"></el-option>
            <el-option label="商家客户端" value="商家客户端"></el-option> -->
            <el-option v-for="(item,index) in owningEndList"
            :key="index" :label="item.label" :value="item.value"></el-option>
a182f238   wesley88   1
19
20
          </el-select>
        </el-form-item>
726bc80b   杨鑫   最新
21
        <!-- <el-form-item label="轮播顺序" prop="rotationOrder" >
a182f238   wesley88   1
22
          <el-select v-model="formInline.rotationOrder" placeholder="请选择" style="width: 100%;">
04473319   wesley88   1
23
24
            <el-option v-for="(item,index) in rotationSequenceList"
            :key="index" :label="item.label" :value="item.value"></el-option>
a182f238   wesley88   1
25
          </el-select>
726bc80b   杨鑫   最新
26
27
28
        </el-form-item> -->
        <el-form-item label="轮播顺序" prop="carouselId" >
          <el-select v-model="formInline.carouselId" placeholder="请选择" style="width: 100%;" @change="handleSelectChange">
233bb387   杨鑫   Merge branch 'mas...
29
            <el-option v-for="(item,index) in tableData" :key="index" :label="'第'+(index+1)+'张'+`${item.type==1?'在线商城端':'商家端小程序'}`" :value="item.id"></el-option>
d6ddfcc4   wesley88   1
30
31
          </el-select>
        </el-form-item>
a182f238   wesley88   1
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
        <el-form-item label="广告尺寸" prop="dimensions" >
          <el-input v-model="formInline.dimensions" placeholder="宽:300px 长:400px" maxlength="20"></el-input>
        </el-form-item>
        <el-form-item label="可上传大小" prop="size" >
          <el-input v-model="formInline.size"  placeholder="100kb" maxlength="20"></el-input>
        </el-form-item>
        <el-form-item label="播放时长(秒)" prop="playDuration" >
          <el-input v-model.number="formInline.playDuration" maxlength="20"  placeholder="请输入" @input="validateNumber('playDuration', $event)"></el-input>
        </el-form-item>
        <el-form-item label="推送地址" prop="pushAddress" >
          <el-input v-model="formInline.pushAddress"  placeholder="请输入" maxlength="50"></el-input>
        </el-form-item>
        <el-form-item label="位置示意图" prop="locationDiagram">
          <upimg :cmpOption="{disabled:false,isSetCover:false}" filePath="gg" inputtype="locationDiagram" :value="formInline.locationDiagram"
            @changimg="e=>changimg(e,'locationDiagram')"></upimg>
        </el-form-item>
cbf52ab1   杨鑫   Merge branch 'mas...
48
  
1dbc0b2d   wesley88   1
49
        <el-form-item label="介绍" prop="memo">
0e7a57c2   杨鑫   '最新'
50
          <wangEditor v-model="formInline.memo" ref="editor" :height="200"></wangEditor>
1dbc0b2d   wesley88   1
51
52
          <!-- <el-input maxlength="200" show-word-limit rows="4" v-model="formInline.memo" placeholder="请输入"
            type="textarea" /> -->
a182f238   wesley88   1
53
        </el-form-item>
4373acf5   wesley88   1
54
55
        <el-row :gutter="20">
          <el-col :span="12">
a182f238   wesley88   1
56
57
58
59
60
            <el-form-item>
              <div style="margin-top: 20px">
                <el-button @click="add()" style="background-color: #3F9B6A;color: #fff;">确定</el-button>
                <el-button @click="close()" class="buttonHover"
                  style="color: #606266;border: 1px solid #DBDBDB;background-color: #fff;">取消</el-button>
4373acf5   wesley88   1
61
62
63
64
              </div>
            </el-form-item>
          </el-col>
        </el-row>
a182f238   wesley88   1
65
      </el-form>
542e27d5   wesley88   1
66
      <el-form v-if="ontype =='实体广告位' && iShsow" :model="formInline" :rules="rulesSt" ref="formInline" label-width="130px"
a182f238   wesley88   1
67
68
        class="demo-ruleForm">
        <el-form-item label="广告位类型" prop="advertisingType">
9b392fc6   wesley88   1
69
          <el-select @change="changeadvertisingType" v-model="formInline.advertisingType" placeholder="请选择" style="width: 100%;">
a182f238   wesley88   1
70
71
72
73
74
75
            <el-option v-for="(item, index) in typelist" :key="index" :label="item.name" :value="item.vaule"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="广告位名称" prop="advertisingName">
          <el-input v-model="formInline.advertisingName" placeholder="请输入" maxlength="30"></el-input>
        </el-form-item>
542e27d5   wesley88   1
76
77
78
79
80
81
82
83
84
85
86
87
88
        <el-form-item label="所属绿道段" prop="belongingGreenwaySection">
          <el-select v-model="formInline.belongingGreenwaySection" placeholder="请选择"
            style="margin-top:5px;width: 100%;" @change="lvdaoSel">
            <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="formInline.belongingParkTrail" placeholder="请选择" style="width: 100%;">
            <el-option :label="item.name" :value="item.code" v-for="(item,index) in gongyuanList"
              :key="index"></el-option>
          </el-select>
        </el-form-item>
a182f238   wesley88   1
89
        <el-form-item label="详细位置" prop="detailedLocation">
c3f8e431   wesley88   1
90
          <el-input v-model="formInline.detailedLocation"  :disabled="true"  placeholder="请地图标点选择位置" maxlength="100"></el-input>
a182f238   wesley88   1
91
92
93
94
95
96
97
98
99
100
        </el-form-item>
        <el-form-item label="地图标点" prop="mapPunctuation" >
          <!-- <div style="width: 100%;height: 300px;">
            <map-mark :sendChildDate="getChildDate"></map-mark>
          </div> -->
          <div style="width: 100%;height: 300px;">
            <newmap :isonloed="info.id?true:false" :lat="lat" :lng="lng" @updatecenter="updatecenter"></newmap>
          </div>
        </el-form-item>
        <el-form-item label="设备类型" prop="deviceType" >
0e7a57c2   杨鑫   '最新'
101
102
  		  <el-input v-model="formInline.deviceType" placeholder="请输入"  maxlength="50"></el-input>
          <!-- <el-select v-model="formInline.deviceType" placeholder="请选择" style="width: 100%;">
4dac8c0b   wesley88   1
103
            <el-option label="灯箱广告牌" value="灯箱广告牌"></el-option>
0e7a57c2   杨鑫   '最新'
104
          </el-select> -->
a182f238   wesley88   1
105
106
107
108
109
110
111
112
        </el-form-item>
        <el-form-item label="设备大小" prop="equipmentSize" >
          <el-input v-model="formInline.equipmentSize" placeholder="宽:300mm 长:400mm 高: 400mm"  maxlength="30"></el-input>
        </el-form-item>
        <el-form-item label="广告尺寸" prop="dimensions">
          <el-input v-model="formInline.dimensions" placeholder="宽:300px 长:400px"  maxlength="20"></el-input>
        </el-form-item>
        <el-form-item label="广告材质" prop="advertisingMaterial">
9b392fc6   wesley88   1
113
114
          <el-input v-model="formInline.advertisingMaterial" placeholder="请输入"  maxlength="50"></el-input>
          <!-- <div style="display: flex;justify-content: space-between;">
a182f238   wesley88   1
115
116
117
118
            <el-select v-model="formInline.advertisingMaterial" placeholder="请选择" style="width: 100%">
              <el-option label="亚克力" value="亚克力"></el-option>
              <el-option label="玻璃" value="玻璃"></el-option>
            </el-select>
9b392fc6   wesley88   1
119
          </div> -->
a182f238   wesley88   1
120
121
122
123
124
        </el-form-item>
        <el-form-item label="位置示意图" prop="locationDiagram">
          <upimg :cmpOption="{disabled:false,isSetCover:false}" filePath="gg" inputtype="locationDiagram" :value="formInline.locationDiagram"
            @changimg="e=>changimg(e,'locationDiagram')"></upimg>
        </el-form-item>
bfa2ad53   杨鑫   最新
125
  	  
4373acf5   wesley88   1
126
127
128
129
130
131
132
133
134
135
136
137
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item>
              <div style="margin-top: 20px">
                <el-button @click="add()" style="background-color: #3F9B6A;color: #fff;">确定</el-button>
                <el-button @click="close()" class="buttonHover"
                  style="color: #606266;border: 1px solid #DBDBDB;background-color: #fff;">取消</el-button>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
a182f238   wesley88   1
138
  
4373acf5   wesley88   1
139
140
141
142
    </div>
  </template>
  
  <script>
a182f238   wesley88   1
143
    import newmap from "@/components/newmap/index";
4373acf5   wesley88   1
144
145
146
147
148
149
150
151
    import MapMark from "@/components/MapContainer/MapMark";
    import upimg from "@/components/ImageUpload/index"
    import {
      uploadUrl
    } from '@/utils/request'
    import {
      miniioupload
    } from '../../api/commodityLease.js'
726bc80b   杨鑫   最新
152
   import { addList ,editList} from '@/api/map1.js';
1dbc0b2d   wesley88   1
153
   import wangEditor from "@/components/editor/index"
542e27d5   wesley88   1
154
155
156
157
158
   import {
      lvdaoduan,
  	parkTrails,
    gongyuan
    } from '@/api/information.js';
bfa2ad53   杨鑫   最新
159
160
161
    import {
      bannerGet,
    } from '@/api/banner';
4373acf5   wesley88   1
162
163
164
    export default {
      components: {
        upimg,
a182f238   wesley88   1
165
        MapMark,
1dbc0b2d   wesley88   1
166
167
        newmap,
        wangEditor
4373acf5   wesley88   1
168
169
170
      },
      data() {
        return {
a182f238   wesley88   1
171
172
173
174
175
176
          lat: 30.67,
          lng: 104.06,
          ontype: '线上广告位',
          typelist: [{
              name: '线上广告位',
              vaule: '线上广告位'
4373acf5   wesley88   1
177
178
            },
            {
a182f238   wesley88   1
179
180
              name: '实体广告位',
              vaule: '实体广告位'
4373acf5   wesley88   1
181
182
183
184
185
186
            },
          ],
          //地图标点的经纬度
          mapData: {},
          uploadFileUrl: uploadUrl, // 请求地址
          formInline: {
a182f238   wesley88   1
187
188
189
190
            advertisingName: '', // 广告位名称
            advertisingType: '线上广告位', // 广告位类型
            affiliation: '', // 所属端
            detailedLocation: '', // 详细位置
4373acf5   wesley88   1
191
            rotationOrder: '', // 轮播顺序
a182f238   wesley88   1
192
193
194
195
196
197
198
199
200
201
202
            dimensions: '', // 广告尺寸
            size: '', // 广告大小
            uploadFormat: '', // 上传格式
            advertisingSpaceStrategy: '', // 广告位策略
            advertisingSpaceNumber: '', // 广告位编号
            locationDiagram: '', // 位置示意图
            mapPunctuation: '', // 地图标点
            deviceType: '', // 设备类型
            equipmentSize: '', // 设备尺寸
            advertisingMaterial: '', // 广告材质
            createDate: '', // 创建时间
4373acf5   wesley88   1
203
            createUser: '', // 创建人
a182f238   wesley88   1
204
205
206
207
208
209
210
211
212
213
            // updateDate: '', // 修改时间
            // updateUser: '', // 修改人
            rentalStatus: '', // 租赁状态
            publishStatus: '', // 发布状态
            leaseExpirationDate: '', // 租赁到期时间
            contractNumber: '', // 合同编号
            advertisingNumber: null, // 广告位数量
            playDuration: null, // 播放时长
            pushAddress: '', // 推送地址
            memo: '', // 备注信息
542e27d5   wesley88   1
214
215
216
            onlineType: '' ,// 线上类型
            belongingGreenwaySection: '', // 所属绿道段
            belongingParkTrail: '', // 所属公园/步道
d0fdf3d7   杨鑫   最新
217
  		  carouselId:'',//选择租赁广告位置
4373acf5   wesley88   1
218
219
          },
          rules: {
a182f238   wesley88   1
220
            advertisingType: [{
4373acf5   wesley88   1
221
              required: true,
a182f238   wesley88   1
222
223
              message: '请选择广告类型',
              trigger: ['change']
4373acf5   wesley88   1
224
            }],
a182f238   wesley88   1
225
            advertisingName: [{
4373acf5   wesley88   1
226
              required: true,
a182f238   wesley88   1
227
228
              message: '请输入广告位名称',
              trigger: ['change']
4373acf5   wesley88   1
229
230
231
232
            }],
            affiliation: [{
              required: true,
              message: '请选择所属端',
a182f238   wesley88   1
233
              trigger: ['change']
4373acf5   wesley88   1
234
            }],
726bc80b   杨鑫   最新
235
236
237
238
239
            // rotationOrder: [{
            //   required: true,
            //   message: '请选择轮播顺序',
            //   trigger: ['change']
            // }],
d6ddfcc4   wesley88   1
240
241
242
243
244
            carouselId: [{
              required: true,
              message: '请选择轮播图',
              trigger: ['change']
            }],
a182f238   wesley88   1
245
246
247
248
            locationDiagram: [{
              required: true,
              message: '请上传位置示意图',
              trigger: ['change']
4373acf5   wesley88   1
249
            }],
bfa2ad53   杨鑫   最新
250
  		  
4373acf5   wesley88   1
251
252
          },
          rulesSt: {
542e27d5   wesley88   1
253
254
255
256
257
            belongingGreenwaySection: [{
              required: true,
              message: '请填写所属绿道段',
              trigger: 'blur'
            }, ],
a182f238   wesley88   1
258
            advertisingType: [{
4373acf5   wesley88   1
259
              required: true,
a182f238   wesley88   1
260
261
              message: '请选择广告类型',
              trigger: ['change']
4373acf5   wesley88   1
262
            }],
a182f238   wesley88   1
263
            advertisingName: [{
4373acf5   wesley88   1
264
              required: true,
a182f238   wesley88   1
265
266
              message: '请输入广告位名称',
              trigger: ['change']
4373acf5   wesley88   1
267
            }],
a182f238   wesley88   1
268
            detailedLocation: [{
4373acf5   wesley88   1
269
              required: true,
c3f8e431   wesley88   1
270
              message: '请地图标点选择位置',
a182f238   wesley88   1
271
              trigger: ['change']
4373acf5   wesley88   1
272
            }],
a182f238   wesley88   1
273
            mapPunctuation: [{
4373acf5   wesley88   1
274
              required: true,
a182f238   wesley88   1
275
276
              message: '请选择地图标点',
              trigger: ['change']
4373acf5   wesley88   1
277
            }],
a182f238   wesley88   1
278
            dimensions: [{
4373acf5   wesley88   1
279
280
              required: true,
              message: '请选择广告尺寸',
a182f238   wesley88   1
281
              trigger: ['change']
4373acf5   wesley88   1
282
283
284
            }],
            advertisingMaterial: [{
              required: true,
9b392fc6   wesley88   1
285
              message: '请输入广告材质',
a182f238   wesley88   1
286
287
288
289
290
291
              trigger: ['change']
            }],
            locationDiagram: [{
              required: true,
              message: '请上传位置示意图',
              trigger: ['change']
4373acf5   wesley88   1
292
293
294
295
296
297
298
            }],
          },
          uploadFiles: [],
          filesLength: 1,
          gongyuanList: [],
          fileData: [],
          parentMessage: {},
4dac8c0b   wesley88   1
299
          edit: true,
542e27d5   wesley88   1
300
301
          iShsow:true,
          lvdaoList: [],
d6ddfcc4   wesley88   1
302
          tableData:[]
4373acf5   wesley88   1
303
304
        };
      },
04473319   wesley88   1
305
306
307
308
309
310
311
312
      computed: {
        owningEndList() {
          return this.$store.state.cent.owningEndList;
        },
        rotationSequenceList() {
          return this.$store.state.cent.rotationSequenceList;
        },
      },
4373acf5   wesley88   1
313
      props: {
a182f238   wesley88   1
314
315
316
317
        type: {
          type: String,
          default: 'one'
        },
4373acf5   wesley88   1
318
319
320
321
322
323
324
325
326
327
        info: {
          type: Object,
          default: {}
        },
        leixing: {
          type: Boolean,
          default: true
        }
      },
      async created() {
d6ddfcc4   wesley88   1
328
329
        const res = await bannerGet({pageNumber: 1,pageSize: 20})
        this.tableData = res.data.content
4373acf5   wesley88   1
330
331
        if (this.info && this.info.id) {
          this.formInline = this.info
a182f238   wesley88   1
332
333
334
          if (this.formInline.mapPunctuation) {
            this.lat = Number(this.formInline.mapPunctuation.split(',')[0])
            this.lng = Number(this.formInline.mapPunctuation.split(',')[1])
d0fdf3d7   杨鑫   最新
335
  		  
4373acf5   wesley88   1
336
          }
d0fdf3d7   杨鑫   最新
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
  		if(this.info.affiliation){
  			console.log('this.info.affiliation',this.info.affiliation)
  			console.log('this.info.carouselId',this.info.carouselId)
  			let arList = []
  			let res= await bannerGet({pageNumber: 1,pageSize: 20})
  			arList = res.data.content
  				if(this.info.affiliation == '在线商城'){
  					 this.tableData =  arList.filter(item => item.type === 1);
  					 this.$forceUpdate()
  				}else{
  					  this.tableData = arList.filter(item => item.type === 2);
  					  this.$forceUpdate()
  				}
  				console.log('111111111111111111',this.tableData)
  				 this.tableData.map((item,index)=>{
  					 if(item.id == this.info.carouselId){
  						 this.handleSelectChange(index)
  						 this.formInline.carouselId = this.info.carouselId
  						 this.$forceUpdate()
  					 }
  				 })
  				
  				console.log('222222222222222',this.tableData)
  		}
4373acf5   wesley88   1
361
          this.ontype = this.formInline.advertisingType
a182f238   wesley88   1
362
363
364
365
          if (this.ontype == '线上广告位') {
            this.typelist = [{
              name: '线上广告位',
              vaule: '线上广告位'
4373acf5   wesley88   1
366
367
            }]
          } else {
a182f238   wesley88   1
368
369
370
            this.typelist = [{
              name: '实体广告位',
              vaule: '实体广告位'
4373acf5   wesley88   1
371
372
373
            }]
          }
        } else {
a182f238   wesley88   1
374
375
376
          if (this.leixing) {
            this.ontype = '线上广告位'
            this.formInline.advertisingType = '线上广告位'
4373acf5   wesley88   1
377
378
379
380
381
          } else {
            this.ontype = '实体广告位'
            this.formInline.advertisingType = '实体广告位'
          }
        }
542e27d5   wesley88   1
382
383
384
        const lvdao = await lvdaoduan()
  	const gongyua  = await parkTrails() 
  	  this.lvdaoList = lvdao.data.concat(gongyua.data)
bfa2ad53   杨鑫   最新
385
386
387
388
  	  let obj = {
  		  pageNumber: 1,
  		  pageSize: 10
  	  }
cbf52ab1   杨鑫   Merge branch 'mas...
389
  
4373acf5   wesley88   1
390
391
      },
      methods: {
726bc80b   杨鑫   最新
392
393
394
395
396
397
398
  		handleSelectChange(value){
  			console.log(value)
  			 const selectedIndex = this.tableData.findIndex(item => item.id === value);
  			      if (selectedIndex!== -1) {
  			        this.formInline.rotationOrder = '第' + (selectedIndex + 1) + '张';
  			      }
  		},
bfccec71   杨鑫   拉去
399
  		async affiliationChange(value){
d0fdf3d7   杨鑫   最新
400
  			this.formInline.carouselId = ''
bfccec71   杨鑫   拉去
401
402
403
404
405
406
407
408
  				let arList = []
  			let res= await bannerGet({pageNumber: 1,pageSize: 20})
  			arList = res.data.content
  				if(value == '在线商城'){
  					 this.tableData =  arList.filter(item => item.type === 1);
  					 this.$forceUpdate()
  				}else{
  					  this.tableData = arList.filter(item => item.type === 2);
d0fdf3d7   杨鑫   最新
409
  					  this.$forceUpdate()
bfccec71   杨鑫   拉去
410
411
412
  				}
  				
  		},
a182f238   wesley88   1
413
414
415
416
        validateNumber(field, value) {
        // 使用正则表达式确保输入的是数字,并且可以包含最多两位小数
          const regex = /^\d+(\.\d{1,2})?$/;
          if (!regex.test(value)) {
9b392fc6   wesley88   1
417
            this.formInline[field] = value.replace(/[^\d.]/g, '').replace(/(\.\d{2}).*$/, '$1');
a182f238   wesley88   1
418
419
420
421
422
423
424
425
426
          }
        },
        updatecenter(e) {
          console.error('-----------', e)
          this.formInline.detailedLocation = e.address
          this.lat = e.lat
          this.lng = e.lng
        },
        changimg(e, type) {
d64cd58f   wesley88   上传验收小程序
427
428
          this.formInline[type] = e
        },
a182f238   wesley88   1
429
        changeadvertisingType(e) {
4373acf5   wesley88   1
430
          console.error(e)
4dac8c0b   wesley88   1
431
          this.iShsow = false
4373acf5   wesley88   1
432
          this.ontype = e
4dac8c0b   wesley88   1
433
434
435
436
437
          // 延迟一秒执行
          setTimeout(() => {
            this.iShsow = true
            this.$forceUpdate();
          }, 10)
4373acf5   wesley88   1
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
        },
        //获取当前时间
        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}`;
        },
        //获取地图点击的经纬度
        getChildDate(mapData) {
          this.mapData = mapData
  
        },
        lvdaoSel(vaule) {
          this.formInline.belongingParkTrail = ''
          this.gongyuan(vaule)
        },
        async gongyuan(value) {
          const gongyaun = await gongyuan()
          this.gongyuanList = gongyaun.data.filter(item => item.superior == value);
        },
        add() {
a182f238   wesley88   1
465
466
467
          if(this.lat) {
            this.formInline.mapPunctuation = this.lat + ',' + this.lng
          }
4373acf5   wesley88   1
468
469
470
471
472
          if (this.formInline.id) {
            this.$refs.formInline.validate((valid) => {
              console.log(valid)
              if (valid) {
                this.formInline.updateDate = this.updateCurrentTime()
a182f238   wesley88   1
473
                this.formInline.updateUser = localStorage.getItem('roleName')
4373acf5   wesley88   1
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
                editList(this.formInline).then(res => {
                  if (res.code == 200) {
                    this.$message({
                      message: '修改成功',
                      type: 'success'
                    })
                    this.$emit('removeonaction', '1')
                  } else {
                    this.$message({
                      message: res.msg,
                      type: 'error'
                    })
                  }
  
                })
              } else {
                this.$message({
                  message: '请填写完整信息',
                  type: 'error'
                })
                return false;
              }
  
  
            })
          } else {
            this.$refs.formInline.validate((valid) => {
              console.log(valid)
              if (valid) {
                this.formInline.createDate = this.updateCurrentTime()
a182f238   wesley88   1
504
505
506
                this.formInline.createUser = localStorage.getItem('roleName')
                if (this.ontype =='线上广告位') {
               
4373acf5   wesley88   1
507
                } else {
a182f238   wesley88   1
508
509
                 
                
4373acf5   wesley88   1
510
                }
a182f238   wesley88   1
511
                this.formInline.publishStatus = 0
4373acf5   wesley88   1
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
                addList(this.formInline).then(res => {
                  if (res.code == 200) {
                    this.$message({
                      message: '添加成功',
                      type: 'success'
                    })
                    this.$emit('removeonaction', '1')
                  } else {
                    this.$message({
                      message: res.msg,
                      type: 'error'
                    })
                  }
  
                })
              } else {
                this.$message({
                  message: '请填写完整信息',
                  type: 'error'
                })
                return false;
              }
            })
  
          }
        },
        close() {
          this.$emit('removeonaction', '1')
        },
        hefuRemove() {
          this.hefuData = []
        },
        hefuSuccess(response, file, fileList) {
          this.fileData = []
          console.error(response)
          let fd = new FormData()
          fd.append('file', response.raw)
          fd.append('filePath', 'hetong')
          miniioupload(fd).then(res => {
            console.error(res)
            const fileMsg = {
              name: response.name,
              url: res.data,
            }
            this.fileData.push(fileMsg)
          })
        },
  
  
      },
    };
  </script>
  <style lang="scss">
    .el-upload {
      display: block;
      /* text-align: left; */
    }
  
    .video-uploader {
      .el-upload {
        text-align: left;
      }
    }
  
    .el-dialog__header {
      background-color: #F2F3F5;
      text-align: left;
    }
  
    .el-dialog__title {
      line-height: 30px;
      font-size: 15px;
      color: #303133;
    }
  </style>