baiqiu-cms-decoration-dg 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,14 @@ export default {
41
41
  type: String
42
42
  }
43
43
  },
44
+ watch: {
45
+ cmsList: {
46
+ handler(val) {
47
+ console.log(val)
48
+ },
49
+ immediate: true
50
+ }
51
+ },
44
52
  data() {
45
53
  return {
46
54
  chooseSort: '', //选中的元素标识
@@ -54,6 +62,13 @@ export default {
54
62
  }
55
63
  }
56
64
  },
65
+ computed: {
66
+ judgeSlot() {
67
+ return function(index) {
68
+ return this.cmsList[index].attributeJson.componentList.some(ele=> {return ele.type == 106})
69
+ }
70
+ }
71
+ },
57
72
  mounted() {
58
73
  this.$nextTick(()=>{
59
74
  var commom = require('../../utils/common')
@@ -62,19 +77,6 @@ export default {
62
77
  });
63
78
  },
64
79
  methods: {
65
- dragChange(e) {
66
- // 拖拽添加元素
67
- if (e.added) {
68
- this.chooseSort = e.added.element.sort
69
- this.$emit('updateLayOut', { layoutType: e.added.element.layoutType, sort: this.chooseSort})
70
- this.ratio = this.$refs.cms.offsetWidth / (this.mode == 'pc' ? 1920 : 750)
71
- this.$emit('dragChange', e.added)
72
- }
73
-
74
- if(e.moved) {
75
- this.$emit('saveVersionId')
76
- }
77
- },
78
80
  chooseLayout(layoutType, sort) {
79
81
  this.chooseSort = sort
80
82
  this.$emit('updateLayOut', { layoutType, sort})
@@ -27,12 +27,11 @@
27
27
  :recordId="item.originalId"
28
28
  :envUrl="envUrl"
29
29
  :path="path"
30
- >
30
+ >
31
31
  <template v-if="item.layoutType === 3" slot="customComponent" slot-scope="scope">
32
32
  <slot name="customComponent" :attributeJson="scope.attributeJson"></slot>
33
33
  </template>
34
- <template slot="latticeDG" slot-scope="scope">
35
- 222222222
34
+ <template v-if="judgeSlot(index)" slot="latticeDG" slot-scope="scope">
36
35
  <slot name="latticeDG" :attributeJson="scope.attributeJson"></slot>
37
36
  </template>
38
37
  </component>
@@ -7,10 +7,9 @@
7
7
  style="width: 100%; height: 100%"
8
8
  >
9
9
  <template v-for="(item, index) in layOutData.componentList">
10
- <div v-if="item.type == 106">
11
- 11111111111
10
+ <template v-if="item.type == 106">
12
11
  <slot name="latticeDG" :attributeJson="item.attributeJson"></slot>
13
- </div>
12
+ </template>
14
13
  <template v-else>
15
14
  <component
16
15
  ref="singleComponent"