3f535f30
杨鑫
'初始'
|
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
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
465
466
467
468
469
470
471
472
473
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
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
|
</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) {
|
3f535f30
杨鑫
'初始'
|
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
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
|
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 {
|
3f535f30
杨鑫
'初始'
|
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
|
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: '',
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>
|