baiqiu-cms-decoration-dg 0.0.1

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.
Files changed (101) hide show
  1. package/.babelrc +17 -0
  2. package/.editorconfig +9 -0
  3. package/.prettierrc +8 -0
  4. package/README.md +18 -0
  5. package/dist/baiqiu-cms-decoration.min.js +26 -0
  6. package/dist/baiqiu-cms-decoration.min.js.map +1 -0
  7. package/dist/font/iconfont.eot +0 -0
  8. package/dist/font/iconfont.svg +89 -0
  9. package/dist/font/iconfont.ttf +0 -0
  10. package/dist/font/iconfont.woff +0 -0
  11. package/dist/iconfont.svg +1 -0
  12. package/index.html +11 -0
  13. package/package.json +48 -0
  14. package/src/App.vue +198 -0
  15. package/src/api/com-service.js +26 -0
  16. package/src/assets/iconfont/demo.css +539 -0
  17. package/src/assets/iconfont/iconfont.css +158 -0
  18. package/src/assets/iconfont/iconfont.eot +0 -0
  19. package/src/assets/iconfont/iconfont.json +254 -0
  20. package/src/assets/iconfont/iconfont.svg +89 -0
  21. package/src/assets/iconfont/iconfont.ttf +0 -0
  22. package/src/assets/iconfont/iconfont.woff +0 -0
  23. package/src/assets/iconfont/iconfont.woff2 +0 -0
  24. package/src/assets/img/pc-cms-v2/creation.png +0 -0
  25. package/src/assets/img/pc-cms-v2/icon.png +0 -0
  26. package/src/assets/img/pc-cms-v2/mobileNav.png +0 -0
  27. package/src/assets/img/pc-cms-v2/next1.png +0 -0
  28. package/src/assets/img/pc-cms-v2/next2.png +0 -0
  29. package/src/assets/img/pc-cms-v2/prev1.png +0 -0
  30. package/src/assets/img/pc-cms-v2/prev2.png +0 -0
  31. package/src/assets/img/pc-cms-v2/text.png +0 -0
  32. package/src/components/cms/animate.scss +19 -0
  33. package/src/components/cms/buttonItem/buttonItem.js +139 -0
  34. package/src/components/cms/buttonItem/buttonItem.scss +95 -0
  35. package/src/components/cms/buttonItem/buttonItem.vue +47 -0
  36. package/src/components/cms/buttonItem/index.js +2 -0
  37. package/src/components/cms/cms.js +102 -0
  38. package/src/components/cms/cms.scss +46 -0
  39. package/src/components/cms/cms.vue +48 -0
  40. package/src/components/cms/customLayout/customLayout.js +46 -0
  41. package/src/components/cms/customLayout/customLayout.scss +8 -0
  42. package/src/components/cms/customLayout/customLayout.vue +15 -0
  43. package/src/components/cms/customLayout/index.js +2 -0
  44. package/src/components/cms/hotspot/hotspot.js +199 -0
  45. package/src/components/cms/hotspot/hotspot.scss +20 -0
  46. package/src/components/cms/hotspot/hotspot.vue +35 -0
  47. package/src/components/cms/hotspot/index.js +2 -0
  48. package/src/components/cms/imgNav/imgNav.js +177 -0
  49. package/src/components/cms/imgNav/imgNav.scss +110 -0
  50. package/src/components/cms/imgNav/imgNav.vue +123 -0
  51. package/src/components/cms/imgNav/index.js +2 -0
  52. package/src/components/cms/index.js +2 -0
  53. package/src/components/cms/mixin.js +244 -0
  54. package/src/components/cms/multipleLayout/index.js +2 -0
  55. package/src/components/cms/multipleLayout/multipleLayout.js +54 -0
  56. package/src/components/cms/multipleLayout/multipleLayout.scss +21 -0
  57. package/src/components/cms/multipleLayout/multipleLayout.vue +25 -0
  58. package/src/components/cms/productItem/index.js +2 -0
  59. package/src/components/cms/productItem/productItem.js +293 -0
  60. package/src/components/cms/productItem/productItem.scss +180 -0
  61. package/src/components/cms/productItem/productItem.vue +117 -0
  62. package/src/components/cms/singleLayout/index.js +2 -0
  63. package/src/components/cms/singleLayout/singleLayout.js +72 -0
  64. package/src/components/cms/singleLayout/singleLayout.scss +21 -0
  65. package/src/components/cms/singleLayout/singleLayout.vue +39 -0
  66. package/src/components/cms/slideLayout/index.js +2 -0
  67. package/src/components/cms/slideLayout/slideLayout.js +248 -0
  68. package/src/components/cms/slideLayout/slideLayout.scss +18 -0
  69. package/src/components/cms/slideLayout/slideLayout.vue +44 -0
  70. package/src/components/cms/swiperItem/index.js +2 -0
  71. package/src/components/cms/swiperItem/swiperItem.js +228 -0
  72. package/src/components/cms/swiperItem/swiperItem.scss +204 -0
  73. package/src/components/cms/swiperItem/swiperItem.vue +123 -0
  74. package/src/components/cms/tabLayout/index.js +2 -0
  75. package/src/components/cms/tabLayout/navItem/index.js +2 -0
  76. package/src/components/cms/tabLayout/navItem/navItem.js +47 -0
  77. package/src/components/cms/tabLayout/navItem/navItem.scss +23 -0
  78. package/src/components/cms/tabLayout/navItem/navItem.vue +13 -0
  79. package/src/components/cms/tabLayout/tabLayout.js +158 -0
  80. package/src/components/cms/tabLayout/tabLayout.scss +26 -0
  81. package/src/components/cms/tabLayout/tabLayout.vue +43 -0
  82. package/src/components/cms/textItem/index.js +2 -0
  83. package/src/components/cms/textItem/textItem.js +72 -0
  84. package/src/components/cms/textItem/textItem.scss +41 -0
  85. package/src/components/cms/textItem/textItem.vue +26 -0
  86. package/src/components/cms/utils.js +101 -0
  87. package/src/components/cms/videoItem/index.js +2 -0
  88. package/src/components/cms/videoItem/videoItem.js +96 -0
  89. package/src/components/cms/videoItem/videoItem.scss +27 -0
  90. package/src/components/cms/videoItem/videoItem.vue +56 -0
  91. package/src/components/cms/videoPlayer/index.js +2 -0
  92. package/src/components/cms/videoPlayer/videoPlayer.js +69 -0
  93. package/src/components/cms/videoPlayer/videoPlayer.scss +37 -0
  94. package/src/components/cms/videoPlayer/videoPlayer.vue +34 -0
  95. package/src/index.js +26 -0
  96. package/src/index.scss +213 -0
  97. package/src/main.js +7 -0
  98. package/src/utils/common.js +23 -0
  99. package/src/utils/http-client.js +111 -0
  100. package/src/utils/utils.js +63 -0
  101. package/webpack.config.js +113 -0
@@ -0,0 +1,177 @@
1
+ import Swiper from 'swiper/js/swiper.js'
2
+ import 'swiper/css/swiper.css'
3
+ import hotspot from "../hotspot";
4
+ import { cmsMixin } from "../mixin";
5
+ import { dataSaveDecorationPageComponentEventFn } from '../../../utils/utils';
6
+ import * as utils from '../utils.js'
7
+
8
+ export default {
9
+ name: "imgNav",
10
+ mixins: [cmsMixin],
11
+ components: {
12
+ hotspot
13
+ },
14
+ props: {
15
+ },
16
+ data() {
17
+ return {
18
+ swiper: '',
19
+ imageList:[],
20
+ popList:[],
21
+ positionList:[],
22
+ positionTotal: [],
23
+ hasInitSwiper: false
24
+ }
25
+ },
26
+ computed: {
27
+ indicatorType() {
28
+ return this.attributeJson.indicatorType
29
+ },
30
+ // 图片组件样式
31
+ picStyle() {
32
+ let { attributeJson, ratio, animationInObj } = this
33
+ return {
34
+ animationDuration: `${animationInObj.duration}s`,
35
+ padding: `0 ${attributeJson.paddingSpacing * ratio}px`,
36
+ width: `${Math.ceil(attributeJson.baseStyle.w * ratio)}px`,
37
+ }
38
+ },
39
+ // 单个图片样式
40
+ picItemStyle() {
41
+ let { attributeJson, ratio } = this
42
+ let { oneLineCount } = attributeJson
43
+ return {
44
+ width: Math.ceil((attributeJson.baseStyle.w * ratio - attributeJson.paddingSpacing * 2 * ratio) / oneLineCount) + 'px',
45
+ height: Math.ceil(attributeJson.baseStyle.h * ratio) + 'px',
46
+ padding: '0 ' + attributeJson.itemSpacing * ratio + 'px',
47
+ }
48
+ },
49
+ list() {
50
+ return this.attributeJson.list
51
+ },
52
+ isSwiper() {
53
+ return (this.styleType == 3 && this.indicatorType == 2 && this.mode == 'pc') || (this.styleType == 2 && this.indicatorType == 2 && this.mode == 'mobile')
54
+ },
55
+ // 是否配置了有效图片
56
+ hasConfig() {
57
+ return this.attributeJson.list.some(item => {return item.picList.length!=0})
58
+ },
59
+ // 是否有轮播导航
60
+ hasSwiperButton() {
61
+ return (this.styleType == 3 && this.indicatorType == 2 && this.mode == 'pc')
62
+ },
63
+ // 是否有底部scroll
64
+ hasScrollBar() {
65
+ return (this.styleType == 2 && this.indicatorType == 2 && this.mode == 'mobile')
66
+ }
67
+ },
68
+ watch: {
69
+ isSwiper: {
70
+ handler(val) {
71
+ if (val) {
72
+ this.initSwiper()
73
+ }
74
+ },
75
+ immediate: true,
76
+ }
77
+ },
78
+ mounted() {
79
+ this.$nextTick(()=>{
80
+ let positionList = []
81
+ let positionTotal = []
82
+ this.list.forEach(item=>{
83
+ if(item.popList.length != 0) {
84
+ positionList.push(item.popList.length)
85
+ } else {
86
+ positionList.push(1)
87
+ }
88
+ })
89
+
90
+ positionList.forEach((item, index)=>{
91
+ let preList = positionList.slice(0, index)
92
+ let preTotal = preList.reduce((pre, cur)=>{
93
+ return pre + cur
94
+ }, 0)
95
+ positionTotal.push(preTotal)
96
+ })
97
+ this.positionList = positionList
98
+ this.positionTotal = positionTotal
99
+ })
100
+ },
101
+ methods: {
102
+ // 初始化轮播图
103
+ initSwiper() {
104
+ if(!this.hasConfig || !this.isSwiper) return
105
+ this.$nextTick(() => {
106
+ if (this.swiper) {
107
+ this.swiper.destroy(true, true)
108
+ this.swiper = null
109
+ }
110
+
111
+ let { attributeJson } = this
112
+
113
+ this.options = {
114
+ effect: 'slide',
115
+ autoplay: false,
116
+ slidesPerView: this.attributeJson.oneLineCount,
117
+ spaceBetween: attributeJson.itemSpacing
118
+ }
119
+
120
+ if(this.hasSwiperButton) {
121
+ this.options.navigation = {
122
+ nextEl: `.swiper-button-next-${this.sortId}`,
123
+ prevEl: `.swiper-button-prev-${this.sortId}`,
124
+ }
125
+ }
126
+
127
+ if(this.hasScrollBar) {
128
+ this.options.scrollbar = {
129
+ el: `.swiper-scrollbar-${this.sortId}`,
130
+ draggable: true
131
+ }
132
+ this.options.freeMode = true
133
+ }
134
+
135
+ this.swiper = new Swiper(`.swiper-container-${this.sortId}`, this.options)
136
+ console.log('\x1B[32m%s\x1B[0m', '初始化轮播图', this.swiper)
137
+ })
138
+ },
139
+ // 上报数据
140
+ reportData(h) {
141
+ let ref = this.$refs[`img${this.attributeJson.sort}`]
142
+ if(!ref || ref.style.display == 'none') return
143
+ if(this.isSwiper && !this.hasInitSwiper && this.enterClass) {
144
+ this.hasInitSwiper = true
145
+ this.initSwiper()
146
+ }
147
+ let el = ref.getBoundingClientRect()
148
+ this.list.forEach((item,i) => {
149
+ if(!item.isReport) {
150
+ if(item.popList.length!=0) {
151
+ this.$refs[`hotspot${this.sortId}${i}`][0].reportData(h, this.positionTotal[i])
152
+ return
153
+ }
154
+ if(el.top <= h) {
155
+ item.isReport = true
156
+ dataSaveDecorationPageComponentEventFn(
157
+ {
158
+ uniqueId: this.recordId + '_'+ this.sortId, // 组件_id
159
+ uniqueName: this.attributeJson.uniqueName, // 组件_名称
160
+ componentType: 2,
161
+ popData: {},
162
+ materialId: this.recordId+ '_'+ this.sortId + '_' + item.sort, //素材id
163
+ materialName: item.uniqueName, //素材名称
164
+ refererPagePath: this.refererPagePath,
165
+ brand: this.brand,
166
+ path: this.path,
167
+ position: this.positionTotal[i] + 1,
168
+ event: 'bannerShow'
169
+ },
170
+ this.envUrl
171
+ )
172
+ }
173
+ }
174
+ })
175
+ }
176
+ },
177
+ };
@@ -0,0 +1,110 @@
1
+ .image-list {
2
+ position: absolute;
3
+ border: none;
4
+ overflow: hidden;
5
+
6
+ .entrance-con {
7
+ position: relative;
8
+ width: 100%;
9
+ height: 100%;
10
+ }
11
+
12
+ .swiper-container {
13
+ height: 100%!important;
14
+ .swiper-slide {
15
+ transform: translate3d(0, 0, 0);
16
+ position: relative;
17
+ overflow: hidden;
18
+
19
+ .slide-con {
20
+ position: relative;
21
+ img {
22
+ object-fit: contain;
23
+ width: 100%;
24
+ height: 100%;
25
+ }
26
+ }
27
+ }
28
+
29
+ .swiper-button-prev {
30
+ background-image: none;
31
+ left: 20px;
32
+ &::after {
33
+ display: none;
34
+ }
35
+ .cms2iconfont {
36
+ font-size: 28px;
37
+ }
38
+ }
39
+
40
+ .swiper-button-next {
41
+ background-image: none;
42
+ right: 20px;
43
+ &::after {
44
+ display: none;
45
+ }
46
+
47
+ .cms2iconfont {
48
+ font-size: 28px;
49
+ }
50
+ }
51
+
52
+ .swiper-scrollbar {
53
+ height: 3px;
54
+ width: 70%;
55
+ left: 50%;
56
+ transform: translateX(-50%);
57
+ ::v-deep .swiper-scrollbar-drag {
58
+ background-color: #1890FF;
59
+ }
60
+ }
61
+ }
62
+
63
+ .image-warp {
64
+ width: 100%;
65
+ height: 100%;
66
+ overflow: hidden;
67
+ position: relative;
68
+ display: flex;
69
+
70
+ &.image-type3 {
71
+ overflow-x: scroll;
72
+ }
73
+ .image-item {
74
+ width: 100%;
75
+ height: 100%;
76
+ display: flex;
77
+ justify-content: center;
78
+ align-items: center;
79
+ font-size: 0;
80
+ transition: transform 0.5s;
81
+ flex-shrink: 0;
82
+ position: relative;
83
+ overflow: hidden;
84
+ img {
85
+ width: auto;
86
+ height: auto;
87
+ width: 100%;
88
+ height: 100%;
89
+ }
90
+
91
+ .contain {
92
+ object-fit: contain;
93
+ }
94
+
95
+ &:first-child {
96
+ padding-left: 0 !important;
97
+ }
98
+
99
+ &:last-child {
100
+ padding-right: 0 !important;
101
+ }
102
+ }
103
+
104
+ .hot-spot {
105
+ position: absolute;
106
+ width: 100%;
107
+ height: 100%;
108
+ }
109
+ }
110
+ }
@@ -0,0 +1,123 @@
1
+ <template>
2
+ <div
3
+ :style="{
4
+ width: Math.ceil(attributeJson.baseStyle.w * ratio) + 'px',
5
+ height: Math.round(attributeJson.baseStyle.h * ratio) + 'px',
6
+ left: Math.round(attributeJson.baseStyle.l * ratio) + 'px',
7
+ top: Math.round(attributeJson.baseStyle.t * ratio) + 'px'
8
+ }"
9
+ class="image-list"
10
+ :key="attributeJson.sort">
11
+
12
+ <div v-if="hasConfig">
13
+ <div :class="['entrance-con',`entrance-con${sortId}`]">
14
+ <div :class="['image-warp', `image-warp-${sortId}`, animationInObj.type ? enterClass : '']"
15
+ v-show="entranceShow"
16
+ :ref="`img${attributeJson.sort}`"
17
+ :style="{animationDuration: `${animationInObj.duration}s`}">
18
+ <!-- 轮播样式 -->
19
+ <div v-hoverAnimate
20
+ v-if="isSwiper"
21
+ :style="[picStyle, (animationHoverObj.type === 3 && hoverStyleShow? hoverStyle : '')]"
22
+ >
23
+ <div :class="[`swiper-container swiper-container-${sortId}`]">
24
+ <div class="swiper-wrapper" :style="{height: `${(baseStyle.h - (hasScrollBar ?30 : 0)) * ratio}px!important`}">
25
+ <div class="swiper-slide" v-for="(carousel, index) in attributeJson.list"
26
+ :key="carousel.id"
27
+ :style="{width: `${baseStyle.w/4 * ratio}px`}">
28
+ <div class="slide-con" :style="{
29
+ height: `${(baseStyle.h - (hasScrollBar ?30 : 0)) * ratio}px`}">
30
+ <!-- 图片 -->
31
+ <img :src="carousel.picList[0].resourcePath" :alt="carousel.picList[0].resourceName.split('.')[0]">
32
+
33
+ <template v-if="carousel.picList.length!=0 && carousel.popList.length!=0">
34
+ <hotspot
35
+ :ref="`hotspot${sortId}${index}`"
36
+ :componentType="2"
37
+ v-on="$listeners"
38
+ v-bind="$attrs"
39
+ :item="carousel"
40
+ :ratio="ratio"
41
+ :path="path"
42
+ :envUrl="envUrl"
43
+ :sortId="sortId"
44
+ :recordId="recordId"
45
+ :laySort="sort"
46
+ :brand="brand"
47
+ :uniqueName="attributeJson.uniqueName"
48
+ :language="language"></hotspot>
49
+ </template>
50
+ </div>
51
+ </div>
52
+
53
+ </div>
54
+
55
+ <div v-if="hasSwiperButton" :class="`swiper-button-prev swiper-button-prev-${sortId}`">
56
+ <slot name="swiper-button-prev">
57
+ <div v-if="indicatorType == 2 || indicatorType == 3"><span class="cms2iconfont iconleft"></span></div>
58
+ </slot>
59
+ </div>
60
+ <div v-if="hasSwiperButton" :class="`swiper-button-next swiper-button-next-${sortId}`">
61
+ <slot name="swiper-button-next">
62
+ <div v-if="indicatorType == 2 || indicatorType == 3"><span class="cms2iconfont iconright"></span></div>
63
+ </slot>
64
+ </div>
65
+
66
+ <!-- 滑动条 -->
67
+ <div v-if="hasScrollBar" :class="`swiper-scrollbar swiper-scrollbar-${sortId}`"></div>
68
+ </div>
69
+
70
+ <!-- 边框 -->
71
+ <div class="hover-con" v-if="animationHoverObj.type === 2" :style="[hoverStyle, {opacity: (hoverStyleShow? 1 : 0)}]"></div>
72
+ </div>
73
+
74
+ <!-- 非轮播样式 -->
75
+ <div v-else :class="['image-warp', styleType==3 && mode!='pc'?'image-type3':'']" :style="[picStyle, (animationHoverObj.type === 3 && hoverStyleShow) ? hoverStyle : '']">
76
+ <div
77
+ v-hoverAnimate
78
+ v-for="(item, index) in attributeJson.list"
79
+ :key="index"
80
+ :style="[picItemStyle]"
81
+ class="image-item">
82
+
83
+ <img :class="{'contain': styleType!=1}" :src="item.picList[0].resourcePath" :alt="item.picList[0].resourceName.split('.')[0]"/>
84
+ <!-- 边框 -->
85
+ <div class="hover-con" v-if="animationHoverObj.type === 2" :style="[hoverStyle, {opacity: (hoverStyleShow? 1 : 0)}]"></div>
86
+ <!-- 换图 -->
87
+ <img class="hover-image" :src="hoverImage" alt="" v-if="animationHoverObj.type === 5 && hoverImage && hoverStyleShow" />
88
+
89
+
90
+ <div v-if="item.picList.length!=0 && item.popList.length!=0">
91
+ <hotspot
92
+ :ref="`hotspot${sortId}${index}`"
93
+ v-on="$listeners"
94
+ v-bind="$attrs"
95
+ :item="item"
96
+ :ratio="ratio"
97
+ :path="path"
98
+ :brand="brand"
99
+ :envUrl="envUrl"
100
+ :sortId="sortId"
101
+ :recordId="recordId"
102
+ :componentType="2"
103
+ :uniqueName="attributeJson.uniqueName"
104
+ :language="language"></hotspot>
105
+ </div>
106
+ </div>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ </div>
111
+
112
+ </div>
113
+ </template>
114
+
115
+ <script>
116
+ import imgNavJs from "./imgNav.js";
117
+ export default imgNavJs;
118
+ </script>
119
+
120
+ <style lang="scss" scoped>
121
+ @import "imgNav";
122
+ @import "../animate.scss";
123
+ </style>
@@ -0,0 +1,2 @@
1
+ import imgNav from './imgNav.vue'
2
+ export default imgNav
@@ -0,0 +1,2 @@
1
+ import cms from './cms.vue'
2
+ export default cms
@@ -0,0 +1,244 @@
1
+ import '../../assets/iconfont/iconfont.css'
2
+ import 'swiper/css/swiper.css'
3
+ import 'animate.css'
4
+ import '../../index.scss'
5
+ import 'video.js/dist/video-js.css'
6
+
7
+ export const cmsMixin = {
8
+ inheritAttrs: false,
9
+ props: {
10
+ attributeJson: {
11
+ type: Object,
12
+ default: function() {}
13
+ },
14
+ item: {
15
+ type: Object,
16
+ default: () => {}
17
+ },
18
+ ratio: {
19
+ type: Number,
20
+ default: 1
21
+ },
22
+ envUrl: {
23
+ type: String,
24
+ default: ''
25
+ },
26
+ fontRatio: {
27
+ type: Number,
28
+ default: 1
29
+ },
30
+ mode: {
31
+ type: String,
32
+ default: 'pc'
33
+ },
34
+ language: {
35
+ type: String,
36
+ default: 'zh-CN'
37
+ },
38
+ // 组件sort
39
+ sortId: {
40
+ type: Number,
41
+ default: 0
42
+ },
43
+ // 最外层布局sort
44
+ sort: {
45
+ type: [String, Number],
46
+ default: 0
47
+ },
48
+ // 最外层布局recordId
49
+ recordId: {
50
+ type: [String, Number],
51
+ default: 0
52
+ },
53
+ refererPagePath: {
54
+ type: String
55
+ },
56
+ brand: {
57
+ type: String
58
+ },
59
+ path: {
60
+ type: String
61
+ }
62
+ },
63
+ data() {
64
+ return {
65
+ hoverStyle: {}, // 悬停动画样式
66
+ hoverStyleShow: false,
67
+ hoverImage: '',
68
+ fillStyle: {}, // 填充样式
69
+ hoverDirection: '',
70
+ entranceShow: true,
71
+ enterClass: '',
72
+ entranceAnimate: {
73
+ fade: 'animate__animated animate__fadeIn',
74
+ scale: 'animate__animated animate__zoomIn'
75
+ }
76
+ }
77
+ },
78
+ computed: {
79
+ animationInObj: function() {
80
+ return this.attributeJson.animationInObj
81
+ },
82
+ animationHoverObj: function() {
83
+ return this.attributeJson.animationHoverObj
84
+ },
85
+ animateInType: function() {
86
+ return this.attributeJson.animationInObj.type
87
+ },
88
+ animateSort: function() {
89
+ return this.attributeJson.animationInObj.sort
90
+ },
91
+ baseStyle() {
92
+ return this.attributeJson.baseStyle
93
+ },
94
+ styleType() {
95
+ return this.attributeJson.styleType
96
+ }
97
+ },
98
+ watch: {
99
+ animationHoverObj: {
100
+ handler(val) {
101
+ this.disposeHoverAnimate(val)
102
+ },
103
+ immediate: true,
104
+ deep: true
105
+ },
106
+ // 入场动画类别
107
+ animateSort: {
108
+ handler(val) {
109
+ let type = this.animateInType
110
+ if (type && type != 'slide') {
111
+ this.entranceShow = false
112
+ this.enterClass = ''
113
+ this.enterClass = this.entranceAnimate[type]
114
+ }
115
+
116
+ if (type == 'slide' && this.animationInObj.direction) {
117
+ this.entranceShow = false
118
+ this.enterClass = ''
119
+ this.enterClass = `animate__animated animate__${this.animationInObj.direction}`
120
+ }
121
+ },
122
+ immediate: true
123
+ },
124
+ // recordId: {
125
+ // handler(val) {
126
+ // console.log('recordId',val);
127
+ // },
128
+ // immediate: true,
129
+ // deep: true
130
+ // }
131
+ },
132
+ methods: {
133
+ // 处理悬停动画数据
134
+ disposeHoverAnimate(val) {
135
+ let hoverStyle = {}
136
+ // 显示边框
137
+ if (val.type === 2) {
138
+ let borderStyle = val.borderStyle
139
+ if (borderStyle.type == 1) {
140
+ // 边框颜色相同
141
+ hoverStyle = {
142
+ border: borderStyle.borderColor ? `2px solid ${borderStyle.borderColor}` : 'none'
143
+ }
144
+ }
145
+
146
+ if (borderStyle.type == 2) {
147
+ let { borderTop, borderRight, borderBottom, borderLeft } = borderStyle
148
+ hoverStyle = {
149
+ borderTop: borderTop ? `2px solid ${borderTop}` : 'none',
150
+ borderRight: borderRight ? `2px solid ${borderRight}` : 'none',
151
+ borderBottom: borderBottom ? `2px solid ${borderBottom}` : 'none',
152
+ borderLeft: borderLeft ? `2px solid ${borderLeft}` : 'none'
153
+ }
154
+ }
155
+ }
156
+
157
+ // 焦点放大镜
158
+ if (val.type === 3) {
159
+ hoverStyle = {
160
+ transform: 'scale(1.2)',
161
+ transformOrigin: 'center center'
162
+ }
163
+ }
164
+
165
+ // 填充
166
+ if (val.type === 4) {
167
+ this.hoverDirection = val.bgStyle.direction
168
+ }
169
+
170
+ // 换图
171
+ if (val.type === 5) {
172
+ let { hoverImgList } = val
173
+ this.hoverImage = hoverImgList[0] ? hoverImgList[0].resourcePath : ''
174
+ }
175
+
176
+ this.hoverStyle = hoverStyle
177
+ },
178
+ onDrag: function(x, y) {
179
+ let ratio = this.ratio
180
+ this.attributeJson.baseStyle.l = x / ratio
181
+ this.attributeJson.baseStyle.t = y / ratio
182
+ this.$set(this.attributeJson, 'baseStyle', this.attributeJson.baseStyle)
183
+ },
184
+ onResize: function(x, y, width, height) {
185
+ let ratio = this.ratio
186
+ let baseStyle = this.attributeJson.baseStyle
187
+ baseStyle = {
188
+ w: width / ratio,
189
+ h: height / ratio,
190
+ l: x / ratio,
191
+ t: y / ratio,
192
+ isLocked: baseStyle.isLocked
193
+ }
194
+ this.$set(this.attributeJson, 'baseStyle', baseStyle)
195
+ },
196
+ getRefLineParams(params) {
197
+ this.$emit('getRefLineParams', params)
198
+ }
199
+ },
200
+ directives: {
201
+ // 入场指令
202
+ // entrance: {
203
+ // inserted: function(el, binding, vnode) {
204
+ // if (!vnode.context.animateInType && !binding.value) return
205
+ // binding.addClass = () => {
206
+ // const { top } = el.getBoundingClientRect()
207
+ // const h = document.documentElement.clientHeight || document.body.clientHeight
208
+ // if (top < h - 50) {
209
+ // vnode.context.entranceShow = true
210
+
211
+ // if (binding.addClass) {
212
+ // window.removeEventListener('scroll', binding.addClass)
213
+ // }
214
+ // }
215
+ // }
216
+ // window.addEventListener('scroll', binding.addClass, true)
217
+ // binding.addClass()
218
+ // },
219
+ // unbind: function(el, binding, vnode) {
220
+ // if (binding.addClass) {
221
+ // window.removeEventListener('scroll', binding.addClass)
222
+ // }
223
+ // }
224
+ // },
225
+ // 悬停指令
226
+ hoverAnimate: {
227
+ inserted: function(el, binding, vnode) {
228
+ el.onmouseover = function(e) {
229
+ vnode.context.hoverStyleShow = true
230
+ if (binding.value) {
231
+ vnode.context[binding.value.key] = binding.value.value
232
+ }
233
+ }
234
+
235
+ el.onmouseleave = function(e) {
236
+ vnode.context.hoverStyleShow = false
237
+ if (binding.value) {
238
+ vnode.context[binding.value.key] = -1
239
+ }
240
+ }
241
+ }
242
+ }
243
+ }
244
+ }
@@ -0,0 +1,2 @@
1
+ import multipleLayout from './multipleLayout.vue'
2
+ export default multipleLayout