baiqiu-cms-decoration-dg 0.0.14 → 0.0.16

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 (109) hide show
  1. package/baiqiu-cms-decoration-dg.common.js +83282 -0
  2. package/baiqiu-cms-decoration-dg.common.js.map +1 -0
  3. package/baiqiu-cms-decoration-dg.css +7 -0
  4. package/baiqiu-cms-decoration-dg.umd.js +83292 -0
  5. package/baiqiu-cms-decoration-dg.umd.js.map +1 -0
  6. package/baiqiu-cms-decoration-dg.umd.min.js +31 -0
  7. package/baiqiu-cms-decoration-dg.umd.min.js.map +1 -0
  8. package/demo.html +10 -0
  9. package/package.json +11 -48
  10. package/.babelrc +0 -17
  11. package/.editorconfig +0 -9
  12. package/.prettierrc +0 -8
  13. package/README.md +0 -18
  14. package/dist/baiqiu-cms-decoration.min.js +0 -19
  15. package/dist/baiqiu-cms-decoration.min.js.map +0 -1
  16. package/dist/iconfont.svg +0 -1
  17. package/index.html +0 -11
  18. package/src/App.vue +0 -1007
  19. package/src/api/com-service.js +0 -26
  20. package/src/assets/iconfont/demo.css +0 -539
  21. package/src/assets/iconfont/iconfont.css +0 -158
  22. package/src/assets/iconfont/iconfont.eot +0 -0
  23. package/src/assets/iconfont/iconfont.json +0 -254
  24. package/src/assets/iconfont/iconfont.svg +0 -89
  25. package/src/assets/iconfont/iconfont.ttf +0 -0
  26. package/src/assets/iconfont/iconfont.woff +0 -0
  27. package/src/assets/iconfont/iconfont.woff2 +0 -0
  28. package/src/assets/img/pc-cms-v2/creation.png +0 -0
  29. package/src/assets/img/pc-cms-v2/icon.png +0 -0
  30. package/src/assets/img/pc-cms-v2/mobileNav.png +0 -0
  31. package/src/assets/img/pc-cms-v2/next1.png +0 -0
  32. package/src/assets/img/pc-cms-v2/next2.png +0 -0
  33. package/src/assets/img/pc-cms-v2/prev1.png +0 -0
  34. package/src/assets/img/pc-cms-v2/prev2.png +0 -0
  35. package/src/assets/img/pc-cms-v2/text.png +0 -0
  36. package/src/components/cms/animate.scss +0 -19
  37. package/src/components/cms/buttonItem/buttonItem.js +0 -139
  38. package/src/components/cms/buttonItem/buttonItem.scss +0 -95
  39. package/src/components/cms/buttonItem/buttonItem.vue +0 -47
  40. package/src/components/cms/buttonItem/index.js +0 -2
  41. package/src/components/cms/cms.js +0 -104
  42. package/src/components/cms/cms.scss +0 -46
  43. package/src/components/cms/cms.vue +0 -51
  44. package/src/components/cms/customLayout/customLayout.js +0 -46
  45. package/src/components/cms/customLayout/customLayout.scss +0 -8
  46. package/src/components/cms/customLayout/customLayout.vue +0 -15
  47. package/src/components/cms/customLayout/index.js +0 -2
  48. package/src/components/cms/hotspot/hotspot.js +0 -200
  49. package/src/components/cms/hotspot/hotspot.scss +0 -20
  50. package/src/components/cms/hotspot/hotspot.vue +0 -35
  51. package/src/components/cms/hotspot/index.js +0 -2
  52. package/src/components/cms/imgNav/imgNav.js +0 -177
  53. package/src/components/cms/imgNav/imgNav.scss +0 -113
  54. package/src/components/cms/imgNav/imgNav.vue +0 -123
  55. package/src/components/cms/imgNav/index.js +0 -2
  56. package/src/components/cms/index.js +0 -2
  57. package/src/components/cms/mixin.js +0 -244
  58. package/src/components/cms/multipleLayout/index.js +0 -2
  59. package/src/components/cms/multipleLayout/multipleLayout.js +0 -54
  60. package/src/components/cms/multipleLayout/multipleLayout.scss +0 -21
  61. package/src/components/cms/multipleLayout/multipleLayout.vue +0 -25
  62. package/src/components/cms/productItem/index.js +0 -2
  63. package/src/components/cms/productItem/productItem.js +0 -293
  64. package/src/components/cms/productItem/productItem.scss +0 -180
  65. package/src/components/cms/productItem/productItem.vue +0 -117
  66. package/src/components/cms/singleLayout/index.js +0 -2
  67. package/src/components/cms/singleLayout/singleLayout.js +0 -63
  68. package/src/components/cms/singleLayout/singleLayout.scss +0 -21
  69. package/src/components/cms/singleLayout/singleLayout.vue +0 -42
  70. package/src/components/cms/slideLayout/index.js +0 -2
  71. package/src/components/cms/slideLayout/slideLayout.js +0 -248
  72. package/src/components/cms/slideLayout/slideLayout.scss +0 -18
  73. package/src/components/cms/slideLayout/slideLayout.vue +0 -44
  74. package/src/components/cms/swiperItem/index.js +0 -2
  75. package/src/components/cms/swiperItem/swiperItem.js +0 -228
  76. package/src/components/cms/swiperItem/swiperItem.scss +0 -204
  77. package/src/components/cms/swiperItem/swiperItem.vue +0 -123
  78. package/src/components/cms/tabLayout/index.js +0 -2
  79. package/src/components/cms/tabLayout/navItem/index.js +0 -2
  80. package/src/components/cms/tabLayout/navItem/navItem.js +0 -47
  81. package/src/components/cms/tabLayout/navItem/navItem.scss +0 -23
  82. package/src/components/cms/tabLayout/navItem/navItem.vue +0 -13
  83. package/src/components/cms/tabLayout/tabLayout.js +0 -158
  84. package/src/components/cms/tabLayout/tabLayout.scss +0 -26
  85. package/src/components/cms/tabLayout/tabLayout.vue +0 -43
  86. package/src/components/cms/textItem/index.js +0 -2
  87. package/src/components/cms/textItem/textItem.js +0 -72
  88. package/src/components/cms/textItem/textItem.scss +0 -41
  89. package/src/components/cms/textItem/textItem.vue +0 -26
  90. package/src/components/cms/utils.js +0 -101
  91. package/src/components/cms/videoItem/index.js +0 -2
  92. package/src/components/cms/videoItem/videoItem.js +0 -96
  93. package/src/components/cms/videoItem/videoItem.scss +0 -27
  94. package/src/components/cms/videoItem/videoItem.vue +0 -56
  95. package/src/components/cms/videoPlayer/index.js +0 -2
  96. package/src/components/cms/videoPlayer/videoPlayer.js +0 -68
  97. package/src/components/cms/videoPlayer/videoPlayer.scss +0 -37
  98. package/src/components/cms/videoPlayer/videoPlayer.vue +0 -34
  99. package/src/index.js +0 -26
  100. package/src/index.scss +0 -221
  101. package/src/main.js +0 -7
  102. package/src/utils/common.js +0 -23
  103. package/src/utils/http-client.js +0 -111
  104. package/src/utils/utils.js +0 -63
  105. package/webpack.config.js +0 -113
  106. /package/{dist/font/iconfont.ttf → fonts/iconfont.529b3ed0.ttf} +0 -0
  107. /package/{dist/font/iconfont.eot → fonts/iconfont.580c918e.eot} +0 -0
  108. /package/{dist/font/iconfont.woff → fonts/iconfont.ea5b1aa2.woff} +0 -0
  109. /package/{dist/font/iconfont.svg → img/iconfont.654cc65b.svg} +0 -0
@@ -1,177 +0,0 @@
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
- };
@@ -1,113 +0,0 @@
1
- .image-list {
2
- position: absolute;
3
- border: none;
4
-
5
- .image-include {
6
- overflow: hidden;
7
- }
8
-
9
- .entrance-con {
10
- position: relative;
11
- width: 100%;
12
- height: 100%;
13
- }
14
-
15
- .swiper-container {
16
- height: 100%!important;
17
- .swiper-slide {
18
- transform: translate3d(0, 0, 0);
19
- position: relative;
20
- overflow: hidden;
21
-
22
- .slide-con {
23
- position: relative;
24
- img {
25
- object-fit: contain;
26
- width: 100%;
27
- height: 100%;
28
- }
29
- }
30
- }
31
-
32
- .swiper-button-prev {
33
- background-image: none;
34
- left: 20px;
35
- &::after {
36
- display: none;
37
- }
38
- .cms2iconfont {
39
- font-size: 28px;
40
- }
41
- }
42
-
43
- .swiper-button-next {
44
- background-image: none;
45
- right: 20px;
46
- &::after {
47
- display: none;
48
- }
49
-
50
- .cms2iconfont {
51
- font-size: 28px;
52
- }
53
- }
54
-
55
- .swiper-scrollbar {
56
- height: 3px;
57
- width: 70%;
58
- left: 50%;
59
- transform: translateX(-50%);
60
- ::v-deep .swiper-scrollbar-drag {
61
- background-color: #1890FF;
62
- }
63
- }
64
- }
65
-
66
- .image-warp {
67
- width: 100%;
68
- height: 100%;
69
- overflow: hidden;
70
- position: relative;
71
- display: flex;
72
-
73
- &.image-type3 {
74
- overflow-x: scroll;
75
- }
76
- .image-item {
77
- width: 100%;
78
- height: 100%;
79
- display: flex;
80
- justify-content: center;
81
- align-items: center;
82
- font-size: 0;
83
- transition: transform 0.5s;
84
- flex-shrink: 0;
85
- position: relative;
86
- overflow: hidden;
87
- img {
88
- width: auto;
89
- height: auto;
90
- width: 100%;
91
- height: 100%;
92
- }
93
-
94
- .contain {
95
- object-fit: contain;
96
- }
97
-
98
- &:first-child {
99
- padding-left: 0 !important;
100
- }
101
-
102
- &:last-child {
103
- padding-right: 0 !important;
104
- }
105
- }
106
-
107
- .hot-spot {
108
- position: absolute;
109
- width: 100%;
110
- height: 100%;
111
- }
112
- }
113
- }
@@ -1,123 +0,0 @@
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" class="image-include" :style="{ height: Math.round(attributeJson.baseStyle.h * ratio) + 'px'}">
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>
@@ -1,2 +0,0 @@
1
- import imgNav from './imgNav.vue'
2
- export default imgNav
@@ -1,2 +0,0 @@
1
- import cms from './cms.vue'
2
- export default cms
@@ -1,244 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- import multipleLayout from './multipleLayout.vue'
2
- export default multipleLayout