officialblock 1.0.7 → 1.0.8
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.
- package/dist/index-Ch_ldWmA.js +1 -0
- package/dist/index-DXm2cqxo.mjs +485 -0
- package/dist/official-block.cjs.js +74 -74
- package/dist/official-block.es.js +13576 -10831
- package/dist/official-block.umd.js +78 -78
- package/dist/style.css +1 -1
- package/dist/swiper-JiLDDxAF.js +1 -0
- package/dist/swiper-acbnDJoL.mjs +2035 -0
- package/dist/utils-DD-vVZej.mjs +316 -0
- package/dist/utils-DOLLD0-F.js +1 -0
- package/package.json +2 -1
- package/src/components/ArticleList/article.vue +3 -3
- package/src/components/ArticleList/contact.vue +9 -9
- package/src/components/ArticleList/index.ts +1 -1
- package/src/components/ArticleList/index.vue +22 -80
- package/src/components/ArticleList/setting.vue +61 -71
- package/src/components/ArticleList/type.ts +12 -18
- package/src/components/BannerImage/index.ts +11 -0
- package/src/components/BannerImage/index.vue +153 -0
- package/src/components/BannerImage/setting.vue +55 -0
- package/src/components/BannerImage/type.ts +10 -0
- package/src/components/BannerPage/index.ts +11 -0
- package/src/components/BannerPage/index.vue +283 -0
- package/src/components/BannerPage/setting.vue +55 -0
- package/src/components/BannerPage/type.ts +10 -0
- package/src/components/BtnList/index.ts +11 -0
- package/src/components/BtnList/index.vue +588 -0
- package/src/components/BtnList/setting.vue +255 -0
- package/src/components/BtnList/type.ts +10 -0
- package/src/components/Button/index.vue +45 -33
- package/src/components/CustomSpace/index.ts +11 -0
- package/src/components/CustomSpace/index.vue +82 -0
- package/src/components/CustomSpace/setting.vue +89 -0
- package/src/components/CustomSpace/type.ts +10 -0
- package/src/components/GalleryList/index.ts +12 -0
- package/src/components/GalleryList/index.vue +311 -0
- package/src/components/GalleryList/setting.vue +268 -0
- package/src/components/GalleryList/type.ts +10 -0
- package/src/components/HeroSlide/index.ts +1 -1
- package/src/components/HeroSlide/index.vue +85 -133
- package/src/components/HeroSlide/setting.vue +435 -0
- package/src/components/HeroSlide/type.ts +5 -14
- package/src/components/LinkLIst/index.ts +11 -0
- package/src/components/LinkLIst/index.vue +317 -0
- package/src/components/LinkLIst/setting.vue +264 -0
- package/src/components/LinkLIst/type.ts +10 -0
- package/src/components/Media/index.vue +18 -18
- package/src/components/Operate/index.vue +17 -7
- package/src/components/Profile/index.vue +999 -0
- package/src/components/Profile/modal.vue +56 -0
- package/src/components/Profile/setting.vue +330 -0
- package/src/components/QuickLinks/index.vue +166 -0
- package/src/components/QuoteText/index.ts +11 -0
- package/src/components/QuoteText/index.vue +133 -0
- package/src/components/QuoteText/setting.vue +81 -0
- package/src/components/QuoteText/type.ts +10 -0
- package/src/components/ScrollKeyInfo/index.vue +0 -0
- package/src/components/Swiper/index.vue +538 -0
- package/src/components/index.ts +23 -5
- package/src/index.ts +56 -12
- package/src/main.ts +6 -3
- package/src/router/index.ts +6 -0
- package/src/style.css +17 -0
- package/src/styles/component-isolation.scss +256 -0
- package/src/styles/editor.scss +1 -1
- package/src/styles/layers.scss +256 -0
- package/src/styles/main.scss +21687 -0
- package/src/styles/mixins/style-isolation.scss +262 -0
- package/src/styles/smart-reset.scss +287 -0
- package/src/styles/test.scss +1 -1
- package/src/types/button.ts +10 -0
- package/src/views/StyleIsolationTest.vue +292 -0
- package/src/views/components/ArticleListDemo.vue +49 -10
|
@@ -56,21 +56,21 @@
|
|
|
56
56
|
|
|
57
57
|
<template v-if="item.type === 'Article'">
|
|
58
58
|
<p class="item-title">标题</p>
|
|
59
|
-
<a-input v-model="item.
|
|
59
|
+
<a-input v-model="item.title" placeholder="请输入标题" allow-clear />
|
|
60
60
|
|
|
61
61
|
<p class="item-title">内容</p>
|
|
62
|
-
<RichTextEditor v-model="item.
|
|
62
|
+
<RichTextEditor v-model="item.content"></RichTextEditor>
|
|
63
63
|
|
|
64
64
|
<p class="item-title">按钮</p>
|
|
65
65
|
<draggable
|
|
66
|
-
v-model="item.
|
|
66
|
+
v-model="item.buttonList"
|
|
67
67
|
:component-data="{
|
|
68
68
|
tag: 'div',
|
|
69
69
|
type: 'transition-group',
|
|
70
70
|
name: !drag ? 'flip-list' : null
|
|
71
71
|
}"
|
|
72
72
|
v-bind="buttonDragOptions"
|
|
73
|
-
:disabled="!shouldShowDragHandle(item.
|
|
73
|
+
:disabled="!shouldShowDragHandle(item.buttonList)"
|
|
74
74
|
@start="drag = true"
|
|
75
75
|
@end="drag = false"
|
|
76
76
|
item-key="id"
|
|
@@ -78,17 +78,17 @@
|
|
|
78
78
|
<template #item="{ element: button }">
|
|
79
79
|
<div
|
|
80
80
|
class="item-button draggable-item"
|
|
81
|
-
:class="{ 'sortable-disabled': !shouldShowDragHandle(item.
|
|
81
|
+
:class="{ 'sortable-disabled': !shouldShowDragHandle(item.buttonList) }"
|
|
82
82
|
:key="button.id"
|
|
83
83
|
>
|
|
84
84
|
<div class="btn-group">
|
|
85
85
|
<div
|
|
86
|
-
v-if="shouldShowDragHandle(item.
|
|
86
|
+
v-if="shouldShowDragHandle(item.buttonList)"
|
|
87
87
|
class="drag-handle"
|
|
88
88
|
>
|
|
89
89
|
<icon-drag-arrow class="drag-icon" />
|
|
90
90
|
</div>
|
|
91
|
-
<icon-delete class="btn-delete" @click="handleDeleteButton(item.
|
|
91
|
+
<icon-delete class="btn-delete" @click="handleDeleteButton(item.buttonList, button.id)" />
|
|
92
92
|
</div>
|
|
93
93
|
<a-button type="primary">{{ button.text }}</a-button>
|
|
94
94
|
<div class="item-action flex items-center">
|
|
@@ -99,21 +99,21 @@
|
|
|
99
99
|
</div>
|
|
100
100
|
</template>
|
|
101
101
|
</draggable>
|
|
102
|
-
<div class="item-add-btn flex items-center" @click="handleAddButton(item.
|
|
102
|
+
<div class="item-add-btn flex items-center" @click="handleAddButton(item.buttonList)">
|
|
103
103
|
<icon-plus />
|
|
104
104
|
<span class="btn-text">添加按钮</span>
|
|
105
105
|
</div>
|
|
106
106
|
|
|
107
107
|
<p class="item-title">链接</p>
|
|
108
108
|
<draggable
|
|
109
|
-
v-model="item.
|
|
109
|
+
v-model="item.linkList"
|
|
110
110
|
:component-data="{
|
|
111
111
|
tag: 'div',
|
|
112
112
|
type: 'transition-group',
|
|
113
113
|
name: !drag ? 'flip-list' : null
|
|
114
114
|
}"
|
|
115
115
|
v-bind="linkDragOptions"
|
|
116
|
-
:disabled="!shouldShowDragHandle(item.
|
|
116
|
+
:disabled="!shouldShowDragHandle(item.linkList)"
|
|
117
117
|
@start="drag = true"
|
|
118
118
|
@end="drag = false"
|
|
119
119
|
item-key="id"
|
|
@@ -121,17 +121,17 @@
|
|
|
121
121
|
<template #item="{ element: link }">
|
|
122
122
|
<div
|
|
123
123
|
class="item-button draggable-item"
|
|
124
|
-
:class="{ 'sortable-disabled': !shouldShowDragHandle(item.
|
|
124
|
+
:class="{ 'sortable-disabled': !shouldShowDragHandle(item.linkList) }"
|
|
125
125
|
:key="link.id"
|
|
126
126
|
>
|
|
127
127
|
<div class="btn-group">
|
|
128
128
|
<div
|
|
129
|
-
v-if="shouldShowDragHandle(item.
|
|
129
|
+
v-if="shouldShowDragHandle(item.linkList)"
|
|
130
130
|
class="drag-handle"
|
|
131
131
|
>
|
|
132
132
|
<icon-drag-arrow class="drag-icon" />
|
|
133
133
|
</div>
|
|
134
|
-
<icon-delete class="btn-delete" @click="handleDeleteLink(item.
|
|
134
|
+
<icon-delete class="btn-delete" @click="handleDeleteLink(item.linkList, link.id)" />
|
|
135
135
|
</div>
|
|
136
136
|
|
|
137
137
|
<a-link href="link">{{ link.text }}</a-link>
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
</div>
|
|
144
144
|
</template>
|
|
145
145
|
</draggable>
|
|
146
|
-
<div class="item-add-btn flex items-center" @click="handleAddLink(item.
|
|
146
|
+
<div class="item-add-btn flex items-center" @click="handleAddLink(item.linkList)">
|
|
147
147
|
<icon-plus />
|
|
148
148
|
<span class="btn-text">添加链接</span>
|
|
149
149
|
</div>
|
|
@@ -151,21 +151,21 @@
|
|
|
151
151
|
|
|
152
152
|
<template v-if="item.type === 'Contact'">
|
|
153
153
|
<p class="item-title">标题</p>
|
|
154
|
-
<a-input v-model="item.
|
|
154
|
+
<a-input v-model="item.title" placeholder="请输入标题" allow-clear />
|
|
155
155
|
|
|
156
156
|
<p class="item-title">内容</p>
|
|
157
|
-
<RichTextEditor v-model="item.
|
|
157
|
+
<RichTextEditor v-model="item.content"></RichTextEditor>
|
|
158
158
|
|
|
159
159
|
<p class="item-title">分类</p>
|
|
160
160
|
<draggable
|
|
161
|
-
v-model="item.
|
|
161
|
+
v-model="item.categories"
|
|
162
162
|
:component-data="{
|
|
163
163
|
tag: 'div',
|
|
164
164
|
type: 'transition-group',
|
|
165
165
|
name: !drag ? 'flip-list' : null
|
|
166
166
|
}"
|
|
167
167
|
v-bind="categoryDragOptions"
|
|
168
|
-
:disabled="!shouldShowDragHandle(item.
|
|
168
|
+
:disabled="!shouldShowDragHandle(item.categories)"
|
|
169
169
|
@start="drag = true"
|
|
170
170
|
@end="drag = false"
|
|
171
171
|
item-key="id"
|
|
@@ -173,19 +173,19 @@
|
|
|
173
173
|
<template #item="{ element: category }">
|
|
174
174
|
<div
|
|
175
175
|
class="item-button draggable-item"
|
|
176
|
-
:class="{ 'sortable-disabled': !shouldShowDragHandle(item.
|
|
176
|
+
:class="{ 'sortable-disabled': !shouldShowDragHandle(item.categories) }"
|
|
177
177
|
:key="category.id"
|
|
178
178
|
>
|
|
179
179
|
<div class="btn-group">
|
|
180
180
|
<div
|
|
181
|
-
v-if="shouldShowDragHandle(item.
|
|
181
|
+
v-if="shouldShowDragHandle(item.categories)"
|
|
182
182
|
class="drag-handle"
|
|
183
183
|
>
|
|
184
184
|
<icon-drag-arrow class="drag-icon" />
|
|
185
185
|
</div>
|
|
186
|
-
<icon-delete class="btn-delete" @click="handleDeleteCategory(item.
|
|
186
|
+
<icon-delete class="btn-delete" @click="handleDeleteCategory(item.categories, category.id)" />
|
|
187
187
|
</div>
|
|
188
|
-
<icon-delete class="btn-delete" @click="handleDeleteCategory(item.
|
|
188
|
+
<icon-delete class="btn-delete" @click="handleDeleteCategory(item.categories, category.id)" />
|
|
189
189
|
<a-link href="link">{{ category.text }}</a-link>
|
|
190
190
|
<div class="item-action flex items-center">
|
|
191
191
|
<a-input v-model="category.text" placeholder="分类名称" allow-clear />
|
|
@@ -193,21 +193,21 @@
|
|
|
193
193
|
</div>
|
|
194
194
|
</template>
|
|
195
195
|
</draggable>
|
|
196
|
-
<div class="item-add-btn flex items-center" @click="handleAddCategory(item.
|
|
196
|
+
<div class="item-add-btn flex items-center" @click="handleAddCategory(item.categories)">
|
|
197
197
|
<icon-plus />
|
|
198
198
|
<span class="btn-text">添加分类</span>
|
|
199
199
|
</div>
|
|
200
200
|
|
|
201
201
|
<p class="item-title">链接</p>
|
|
202
202
|
<draggable
|
|
203
|
-
v-model="item.
|
|
203
|
+
v-model="item.linkList"
|
|
204
204
|
:component-data="{
|
|
205
205
|
tag: 'div',
|
|
206
206
|
type: 'transition-group',
|
|
207
207
|
name: !drag ? 'flip-list' : null
|
|
208
208
|
}"
|
|
209
209
|
v-bind="linkDragOptions"
|
|
210
|
-
:disabled="!shouldShowDragHandle(item.
|
|
210
|
+
:disabled="!shouldShowDragHandle(item.linkList)"
|
|
211
211
|
@start="drag = true"
|
|
212
212
|
@end="drag = false"
|
|
213
213
|
item-key="id"
|
|
@@ -215,17 +215,17 @@
|
|
|
215
215
|
<template #item="{ element: link }">
|
|
216
216
|
<div
|
|
217
217
|
class="item-button draggable-item"
|
|
218
|
-
:class="{ 'sortable-disabled': !shouldShowDragHandle(item.
|
|
218
|
+
:class="{ 'sortable-disabled': !shouldShowDragHandle(item.linkList) }"
|
|
219
219
|
:key="link.id"
|
|
220
220
|
>
|
|
221
221
|
<div class="btn-group">
|
|
222
222
|
<div
|
|
223
|
-
v-if="shouldShowDragHandle(item.
|
|
223
|
+
v-if="shouldShowDragHandle(item.linkList)"
|
|
224
224
|
class="drag-handle"
|
|
225
225
|
>
|
|
226
226
|
<icon-drag-arrow class="drag-icon" />
|
|
227
227
|
</div>
|
|
228
|
-
<icon-delete class="btn-delete" @click="handleDeleteLink(item.
|
|
228
|
+
<icon-delete class="btn-delete" @click="handleDeleteLink(item.linkList, link.id)" />
|
|
229
229
|
</div>
|
|
230
230
|
<a-link href="link">{{ link.text }}</a-link>
|
|
231
231
|
<div class="item-action flex items-center">
|
|
@@ -236,35 +236,35 @@
|
|
|
236
236
|
</div>
|
|
237
237
|
</template>
|
|
238
238
|
</draggable>
|
|
239
|
-
<div class="item-add-btn flex items-center" @click="handleAddLink(item.
|
|
239
|
+
<div class="item-add-btn flex items-center" @click="handleAddLink(item.linkList)">
|
|
240
240
|
<icon-plus />
|
|
241
241
|
<span class="btn-text">添加链接</span>
|
|
242
242
|
</div>
|
|
243
243
|
</template>
|
|
244
244
|
|
|
245
245
|
<template v-if="item.type === 'Image'">
|
|
246
|
-
<img class="item-img" :src="item.
|
|
246
|
+
<img class="item-img" :src="item.imgSrc" />
|
|
247
247
|
<div class="item-uplaod flex items-center">
|
|
248
|
-
<a-input v-model="item.
|
|
248
|
+
<a-input v-model="item.imgSrc" placeholder="请输入标题" allow-clear />
|
|
249
249
|
<a-upload class="fit-content" :show-file-list="false" action="/" />
|
|
250
250
|
</div>
|
|
251
|
-
<a-input class="mt-
|
|
252
|
-
<a-input class="mt-
|
|
253
|
-
<a-checkbox class="pt-
|
|
251
|
+
<a-input class="mt-2" v-model="item.caption" placeholder="图片描述" allow-clear />
|
|
252
|
+
<a-input class="mt-2" v-model="item.alt" placeholder="图片alt" allow-clear />
|
|
253
|
+
<a-checkbox class="pt-2" :model-value="item.isRound">圆角</a-checkbox>
|
|
254
254
|
</template>
|
|
255
255
|
|
|
256
256
|
<template v-if="item.type === 'ImageList'">
|
|
257
257
|
<p class="item-title">图片组</p>
|
|
258
258
|
<div class="item-img-list">
|
|
259
259
|
<draggable
|
|
260
|
-
v-model="item.
|
|
260
|
+
v-model="item.imageList"
|
|
261
261
|
:component-data="{
|
|
262
262
|
tag: 'div',
|
|
263
263
|
type: 'transition-group',
|
|
264
264
|
name: !drag ? 'flip-list' : null
|
|
265
265
|
}"
|
|
266
266
|
v-bind="imageDragOptions"
|
|
267
|
-
:disabled="!shouldShowDragHandle(item.
|
|
267
|
+
:disabled="!shouldShowDragHandle(item.imageList)"
|
|
268
268
|
@start="drag = true"
|
|
269
269
|
@end="drag = false"
|
|
270
270
|
item-key="id"
|
|
@@ -272,21 +272,21 @@
|
|
|
272
272
|
<template #item="{ element: img }">
|
|
273
273
|
<div
|
|
274
274
|
class="img-list-item flex draggable-item"
|
|
275
|
-
:class="{ 'sortable-disabled': !shouldShowDragHandle(item.
|
|
275
|
+
:class="{ 'sortable-disabled': !shouldShowDragHandle(item.imageList) }"
|
|
276
276
|
:key="img.id"
|
|
277
277
|
>
|
|
278
278
|
<div class="btn-group">
|
|
279
279
|
<div
|
|
280
|
-
v-if="shouldShowDragHandle(item.
|
|
280
|
+
v-if="shouldShowDragHandle(item.imageList)"
|
|
281
281
|
class="drag-handle"
|
|
282
282
|
>
|
|
283
283
|
<icon-drag-arrow class="drag-icon" />
|
|
284
284
|
</div>
|
|
285
|
-
<icon-delete class="btn-delete" @click="handleDeleteImage(item.
|
|
285
|
+
<icon-delete class="btn-delete" @click="handleDeleteImage(item.imageList, img.id)" />
|
|
286
286
|
</div>
|
|
287
287
|
|
|
288
288
|
<div class="item-img-box" v-if="img.src">
|
|
289
|
-
<!-- <icon-close-circle-fill class="item-img-dlete" @click="handleDeleteImage(item.
|
|
289
|
+
<!-- <icon-close-circle-fill class="item-img-dlete" @click="handleDeleteImage(item.imageList, img.id)" /> -->
|
|
290
290
|
<img class="item-img small-img" :src="img.src" />
|
|
291
291
|
</div>
|
|
292
292
|
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
</template>
|
|
299
299
|
</draggable>
|
|
300
300
|
</div>
|
|
301
|
-
<div class="item-add-btn flex items-center" @click="handleAddImage(item.
|
|
301
|
+
<div class="item-add-btn flex items-center" @click="handleAddImage(item.imageList)">
|
|
302
302
|
<icon-plus />
|
|
303
303
|
<span class="btn-text">添加图片</span>
|
|
304
304
|
</div>
|
|
@@ -306,14 +306,14 @@
|
|
|
306
306
|
|
|
307
307
|
<template v-if="item.type === 'Video'">
|
|
308
308
|
<p class="item-title">视频</p>
|
|
309
|
-
<video class="item-img" :src="item.
|
|
309
|
+
<video class="item-img" :src="item.videoSrc" controls></video>
|
|
310
310
|
<div class="item-uplaod flex items-center">
|
|
311
|
-
<a-input v-model="item.
|
|
311
|
+
<a-input v-model="item.videoSrc" placeholder="请输入视频链接" allow-clear />
|
|
312
312
|
<a-upload class="fit-content" :show-file-list="false" action="/" />
|
|
313
313
|
</div>
|
|
314
|
-
<img class="item-img" :src="item.
|
|
314
|
+
<img class="item-img" :src="item.imgSrc" />
|
|
315
315
|
<div class="item-uplaod flex items-center">
|
|
316
|
-
<a-input v-model="item.
|
|
316
|
+
<a-input v-model="item.imgSrc" placeholder="视频封面" allow-clear />
|
|
317
317
|
<a-upload class="fit-content" :show-file-list="false" action="/" />
|
|
318
318
|
</div>
|
|
319
319
|
</template>
|
|
@@ -337,7 +337,7 @@ const drag = ref(false)
|
|
|
337
337
|
// 不同类型的拖拽配置选项
|
|
338
338
|
const dragOptions = computed(() => ({
|
|
339
339
|
animation: 200,
|
|
340
|
-
group: 'item',
|
|
340
|
+
group: 'item',
|
|
341
341
|
disabled: false,
|
|
342
342
|
ghostClass: 'ghost'
|
|
343
343
|
}))
|
|
@@ -399,51 +399,41 @@ const handleAdd = (type: string) => {
|
|
|
399
399
|
detail.data.push({
|
|
400
400
|
id: randomString(),
|
|
401
401
|
type: 'Article',
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
linkList: []
|
|
407
|
-
}
|
|
402
|
+
title: '',
|
|
403
|
+
content: '',
|
|
404
|
+
buttonList: [],
|
|
405
|
+
linkList: []
|
|
408
406
|
})
|
|
409
407
|
} else if (type === 'Contact') {
|
|
410
408
|
detail.data.push({
|
|
411
409
|
id: randomString(),
|
|
412
410
|
type: 'Contact',
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
linkList: []
|
|
418
|
-
}
|
|
411
|
+
title: '',
|
|
412
|
+
content: '',
|
|
413
|
+
categories: [],
|
|
414
|
+
linkList: []
|
|
419
415
|
})
|
|
420
416
|
} else if (type === 'Image') {
|
|
421
417
|
detail.data.push({
|
|
422
418
|
id: randomString(),
|
|
423
419
|
type: 'Image',
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
isRound: false
|
|
429
|
-
}
|
|
420
|
+
imgSrc: '',
|
|
421
|
+
caption: '',
|
|
422
|
+
alt: '',
|
|
423
|
+
isRound: false
|
|
430
424
|
})
|
|
431
425
|
} else if (type === 'ImageList') {
|
|
432
426
|
detail.data.push({
|
|
433
427
|
id: randomString(),
|
|
434
428
|
type: 'ImageList',
|
|
435
|
-
|
|
436
|
-
imageList: []
|
|
437
|
-
}
|
|
429
|
+
imageList: []
|
|
438
430
|
})
|
|
439
431
|
} else if (type === 'Video') {
|
|
440
432
|
detail.data.push({
|
|
441
433
|
id: randomString(),
|
|
442
434
|
type: 'Video',
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
imgSrc: ''
|
|
446
|
-
}
|
|
435
|
+
videoSrc: '',
|
|
436
|
+
imgSrc: ''
|
|
447
437
|
})
|
|
448
438
|
}
|
|
449
439
|
}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface ComponentProps {
|
|
4
|
-
/** 控制组件尺寸 */
|
|
5
|
-
size?: 'small' | 'medium' | 'large'
|
|
6
|
-
/** 是否禁用状态 */
|
|
7
|
-
disabled?: boolean
|
|
1
|
+
export interface ArticleListProps {
|
|
8
2
|
/** 双向绑定的值 */
|
|
9
|
-
modelValue:
|
|
3
|
+
modelValue: any
|
|
10
4
|
}
|
|
11
5
|
|
|
12
|
-
export interface
|
|
13
|
-
(e: 'update:modelValue', value:
|
|
14
|
-
(e: '
|
|
15
|
-
(e: '
|
|
6
|
+
export interface ArticleListEmits {
|
|
7
|
+
(e: 'update:modelValue', value: any): void
|
|
8
|
+
(e: 'handleDelete', value: string | number): void
|
|
9
|
+
(e: 'handleCopy', value: any): void
|
|
16
10
|
}
|
|
17
11
|
|
|
18
|
-
export type ComponentSlots = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
12
|
+
// export type ComponentSlots = {
|
|
13
|
+
// /** 默认插槽内容 */
|
|
14
|
+
// default?: (props: { value: string | number }) => VNode[]
|
|
15
|
+
// /** 头部内容 */
|
|
16
|
+
// header?: (props: { title: string }) => VNode[]
|
|
17
|
+
// }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { App, Plugin } from 'vue'
|
|
2
|
+
import BannerImage from './index.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
install: (app: App) => {
|
|
6
|
+
app.component('BannerImage', BannerImage)
|
|
7
|
+
},
|
|
8
|
+
} satisfies Plugin
|
|
9
|
+
|
|
10
|
+
export { default as BannerImage } from './index.vue'
|
|
11
|
+
export type { BannerImageProps, BannerImageEmits } from './type'
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="banner-image" @mouseenter="isHover = true" @mouseleave="isHover = false">
|
|
3
|
+
<div class="banner-image__image"
|
|
4
|
+
:style="{backgroundImage: 'url(' + modelValue?.data?.imgSrc + ')', 'background-position': 'center'}"
|
|
5
|
+
>
|
|
6
|
+
<div class="banner-image__title is-zh">
|
|
7
|
+
{{ modelValue?.data?.title }}
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<Operate v-if="!modelValue?.readOnly" v-model:show="isHover" @handle-edit="showSetting = true" @handle-delete="handleDelete" @handle-copy="handleCopy"></Operate>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<Setting v-model:show="showSetting" :data="modelValue"></Setting>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { ref } from 'vue'
|
|
19
|
+
import { randomString } from '@/utils/common'
|
|
20
|
+
import Operate from '@/components/Operate/index.vue'
|
|
21
|
+
import Setting from './setting.vue'
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
// 定义组件名称
|
|
25
|
+
defineOptions({
|
|
26
|
+
name: 'BannerImage'
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => {}
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
// 是否预览
|
|
36
|
+
isPreview: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const emit = defineEmits(['update:modelValue', 'handleDelete', 'handleCopy'])
|
|
43
|
+
|
|
44
|
+
const handleInit = () => {
|
|
45
|
+
if (props.modelValue && props.modelValue.data) return // 有数据不用初始化
|
|
46
|
+
const data = {
|
|
47
|
+
id: props.modelValue?.id || randomString(),
|
|
48
|
+
type: 'BannerImage',
|
|
49
|
+
readOnly: props.modelValue?.readOnly || false,
|
|
50
|
+
data: {
|
|
51
|
+
title: 'About YWIES',
|
|
52
|
+
imgSrc: 'https://osswebsite-test.cedim.cn/ywies-tx/static-images/about-ywies/01_About_YWIES_1_Header.jpg'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
emit('update:modelValue', data)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const isHover = ref<boolean>(false);
|
|
59
|
+
const showSetting = ref<boolean>(false);
|
|
60
|
+
|
|
61
|
+
const handleDelete = () => {
|
|
62
|
+
emit('handleDelete', props.modelValue.id)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const handleCopy = () => {
|
|
66
|
+
emit('handleCopy', props.modelValue)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
handleInit()
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<style lang="scss" scoped>
|
|
73
|
+
.banner-image {
|
|
74
|
+
position: relative;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.banner-image__image {
|
|
78
|
+
height: 340px;
|
|
79
|
+
background-size: cover;
|
|
80
|
+
background-repeat: no-repeat;
|
|
81
|
+
background-image: linear-gradient(184.08deg,rgba(0,0,0,.427) 21.79%,transparent 96.67%),var(--bg-image);
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
align-items: center;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media (max-width: 1279.98px) {
|
|
88
|
+
.banner-image__image {
|
|
89
|
+
height: clamp(200px,(100vw - 576px)/5 + 200px,340px);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@media (max-width: 575.98px) {
|
|
94
|
+
.banner-image__image {
|
|
95
|
+
height: 200px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.banner-image.has-quick-links {
|
|
100
|
+
padding-bottom: 38px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.banner-image__title {
|
|
104
|
+
font-size: 60px;
|
|
105
|
+
line-height: 1.166;
|
|
106
|
+
font-weight: 500;
|
|
107
|
+
color: #fff;
|
|
108
|
+
text-shadow: 0 0 10px rgba(130,130,140,.12);
|
|
109
|
+
padding-top: 166px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@media (max-width: 1279.98px) {
|
|
113
|
+
.banner-image__title {
|
|
114
|
+
padding-top: clamp(106px,(100vw - 576px)/11.73 + 106px,166px);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@media (max-width: 1023.98px) {
|
|
119
|
+
.banner-image__title {
|
|
120
|
+
font-size: 36px;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@media (max-width: 575.98px) {
|
|
125
|
+
.banner-image__title {
|
|
126
|
+
font-size: 40px;
|
|
127
|
+
font-weight: 500;
|
|
128
|
+
line-height: 1.2;
|
|
129
|
+
letter-spacing: .02em;
|
|
130
|
+
padding-top: 106px;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (max-width: 575.98px) and (max-width: 1023.98px) {
|
|
135
|
+
.banner-image__title {
|
|
136
|
+
font-size: 32px;
|
|
137
|
+
font-weight: 500;
|
|
138
|
+
line-height: 1.2;
|
|
139
|
+
letter-spacing: .02em;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@media (max-width: 575.98px) and (max-width: 767.98px) {
|
|
144
|
+
.banner-image__title {
|
|
145
|
+
font-size: 24px;
|
|
146
|
+
line-height: 1.09;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.banner-image__title.is-zh {
|
|
151
|
+
font-weight: 700;
|
|
152
|
+
}
|
|
153
|
+
</style>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a-drawer :width="500" :visible="show" :footer="false" @cancel="handleCancel" unmountOnClose>
|
|
3
|
+
<template #title>
|
|
4
|
+
{{data.type}}组件编辑
|
|
5
|
+
</template>
|
|
6
|
+
<div class="setting-content">
|
|
7
|
+
<p class="item-title">标题</p>
|
|
8
|
+
<a-input v-model="data.data.title" placeholder="请输入标题" allow-clear />
|
|
9
|
+
|
|
10
|
+
<p class="item-title">图片</p>
|
|
11
|
+
<img class="item-img" :src="data?.data?.imgSrc" />
|
|
12
|
+
<div class="item-uplaod flex items-center">
|
|
13
|
+
<a-input v-model="data.data.imgSrc" placeholder="请输入图片链接" allow-clear />
|
|
14
|
+
<a-upload class="fit-content" :show-file-list="false" action="/" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</a-drawer>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts" setup>
|
|
21
|
+
defineProps({
|
|
22
|
+
show: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
data: {
|
|
28
|
+
type: Object,
|
|
29
|
+
default: () => {}
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const emit = defineEmits(['update:show']);
|
|
34
|
+
|
|
35
|
+
const handleCancel = () => {
|
|
36
|
+
emit('update:show', false);
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style lang="scss" scoped>
|
|
41
|
+
.setting-content {
|
|
42
|
+
position: relative;
|
|
43
|
+
|
|
44
|
+
.item-title {
|
|
45
|
+
padding: 12px 0 8px 0;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.item-img {
|
|
51
|
+
margin-top: 12px;
|
|
52
|
+
height: 160px;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { App, Plugin } from 'vue'
|
|
2
|
+
import BannerPage from './index.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
install: (app: App) => {
|
|
6
|
+
app.component('BannerPage', BannerPage)
|
|
7
|
+
},
|
|
8
|
+
} satisfies Plugin
|
|
9
|
+
|
|
10
|
+
export { default as BannerPage } from './index.vue'
|
|
11
|
+
export type { BannerPageProps, BannerPageEmits } from './type'
|