officialblock 1.0.8 → 1.0.9

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 (41) hide show
  1. package/dist/official-block.cjs.js +1 -1
  2. package/dist/official-block.es.js +43 -11
  3. package/dist/official-block.umd.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/package.json +1 -1
  6. package/src/assets/icon-email.svg +3 -0
  7. package/src/components/ArticleList/setting.vue +316 -142
  8. package/src/components/BannerImageWithLink/index.ts +11 -0
  9. package/src/components/BannerImageWithLink/index.vue +323 -0
  10. package/src/components/BannerImageWithLink/setting.vue +344 -0
  11. package/src/components/BannerImageWithLink/type.ts +17 -0
  12. package/src/components/ContactUsList/index.ts +11 -0
  13. package/src/components/ContactUsList/index.vue +369 -0
  14. package/src/components/ContactUsList/setting.vue +497 -0
  15. package/src/components/ContactUsList/type.ts +17 -0
  16. package/src/components/CountDown/index.ts +11 -0
  17. package/src/components/CountDown/index.vue +315 -0
  18. package/src/components/CountDown/setting.vue +302 -0
  19. package/src/components/CountDown/type.ts +17 -0
  20. package/src/components/CustomIframe/index.ts +11 -0
  21. package/src/components/CustomIframe/index.vue +118 -0
  22. package/src/components/CustomIframe/setting.vue +323 -0
  23. package/src/components/CustomIframe/type.ts +17 -0
  24. package/src/components/Operate/index.vue +1 -2
  25. package/src/components/ScrollKeyInfo/index.ts +11 -0
  26. package/src/components/ScrollKeyInfo/index.vue +1345 -0
  27. package/src/components/ScrollKeyInfo/setting.vue +302 -0
  28. package/src/components/ScrollKeyInfo/type.ts +17 -0
  29. package/src/components/TabDefault/components/ComponentSelector/compsData.js +143 -0
  30. package/src/components/TabDefault/components/ComponentSelector/index.vue +188 -0
  31. package/src/components/TabDefault/components/PageContent.vue +207 -0
  32. package/src/components/TabDefault/index.vue +475 -0
  33. package/src/components/TabDefault/setting.vue +581 -0
  34. package/src/components/TabDefault/type.ts +17 -0
  35. package/src/components/TableTwo/index.ts +11 -0
  36. package/src/components/TableTwo/index.vue +232 -0
  37. package/src/components/TableTwo/setting.vue +558 -0
  38. package/src/components/TableTwo/type.ts +17 -0
  39. package/src/components/index.ts +17 -0
  40. package/src/styles/component-isolation.scss +2 -1
  41. package/src/views/components/ArticleListDemo.vue +50 -49
@@ -0,0 +1,118 @@
1
+ <template>
2
+ <div
3
+ style="margin-top: 30px; margin-bottom: 30px"
4
+ class="custom-iframe-container"
5
+ :style="{ backgroundColor: modelValue?.bgColor }"
6
+ @mouseenter="isHover = true"
7
+ @mouseleave="isHover = false"
8
+ >
9
+ <div class="custom-iframe">
10
+ <div class="container-content-middle">
11
+ <iframe
12
+ width="450"
13
+ height="550"
14
+ frameborder="0"
15
+ :src="modelValue?.url"
16
+ allow=""
17
+ style="border: 0"
18
+ ></iframe>
19
+ </div>
20
+ </div>
21
+ <Operate
22
+ v-if="!modelValue?.readOnly"
23
+ v-model:show="isHover"
24
+ @handle-edit="showSetting = true"
25
+ @handle-delete="handleDelete"
26
+ @handle-copy="handleCopy"
27
+ ></Operate>
28
+ <!-- </a-row> -->
29
+ </div>
30
+
31
+ <Setting v-model:show="showSetting" :data="modelValue"></Setting>
32
+ </template>
33
+
34
+ <script lang="ts" setup>
35
+ import { computed, nextTick, ref } from "vue";
36
+ import { randomString } from "@/utils/common";
37
+ import Setting from "./setting.vue";
38
+ import Operate from "@/components/Operate/index.vue";
39
+
40
+ // 定义组件名称
41
+ defineOptions({
42
+ name: "CountDown",
43
+ });
44
+
45
+ const props = defineProps({
46
+ modelValue: {
47
+ type: Object,
48
+ default: () => {},
49
+ },
50
+
51
+ // 是否预览
52
+ isPreview: {
53
+ type: Boolean,
54
+ default: false,
55
+ },
56
+ });
57
+ console.log("!!!!", props.modelValue);
58
+ const emit = defineEmits(["update:modelValue", "handleDelete", "handleCopy"]);
59
+
60
+ const isHover = ref<boolean>(false);
61
+ const showSetting = ref<boolean>(false);
62
+ const timeObj = ref({
63
+ day: 0,
64
+ hour: 0,
65
+ min: 0,
66
+ sec: 0,
67
+ });
68
+ // const timer = null;
69
+ const timer = ref(null);
70
+
71
+ const handleDelete = () => {
72
+ emit("handleDelete", props.modelValue.id);
73
+ };
74
+
75
+ const handleCopy = () => {
76
+ emit("handleCopy", props.modelValue);
77
+ };
78
+
79
+ const handleInit = () => {
80
+ if (props.modelValue && props.modelValue.height) return; // 检查必要属性是否存在
81
+ const data = {
82
+ id: props.modelValue?.id || randomString(),
83
+ type: "CustomIframe",
84
+ readOnly: props.modelValue?.readOnly || false,
85
+ width: "medium",
86
+ height: 550,
87
+ url: "https://www.baidu.com",
88
+ };
89
+ emit("update:modelValue", data);
90
+ };
91
+
92
+ handleInit();
93
+ </script>
94
+
95
+ <style scoped lang="scss">
96
+ .custom-iframe-container {
97
+ position: relative;
98
+ }
99
+ .custom-iframe,
100
+ .custom-iframe iframe {
101
+ width: 100%;
102
+ }
103
+
104
+ .custom-iframe .has-ratio {
105
+ width: 100%;
106
+ padding-bottom: 0;
107
+ padding-bottom: var(--custom-ratio, 0);
108
+ position: relative;
109
+ }
110
+
111
+ .custom-iframe .has-ratio iframe {
112
+ position: absolute;
113
+ top: 0;
114
+ left: 0;
115
+ width: 100%;
116
+ height: 100%;
117
+ }
118
+ </style>
@@ -0,0 +1,323 @@
1
+ <template>
2
+ <a-drawer
3
+ :width="500"
4
+ :visible="show"
5
+ :footer="false"
6
+ @cancel="handleCancel"
7
+ unmountOnClose
8
+ >
9
+ <template #title> {{ data?.type }}组件编辑 </template>
10
+ <div class="seting-box">
11
+ <div class="setting-header flex items-center">
12
+ <span class="header-title">组件宽度</span>
13
+ <a-select v-model="data.width" placeholder="请选择" allow-clear>
14
+ <a-option value="default">默认</a-option>
15
+ <a-option value="small">小</a-option>
16
+ <a-option value="medium">中</a-option>
17
+ <a-option value="large">大</a-option>
18
+ </a-select>
19
+ </div>
20
+ <div class="setting-header flex items-center">
21
+ <span class="header-title">组件高度</span>
22
+ <a-slider
23
+ v-model="data.height"
24
+ :min="320"
25
+ :max="1080"
26
+ :default-value="10"
27
+ show-input
28
+ />
29
+ </div>
30
+ <div class="setting-header flex items-center">
31
+ <span class="header-title">网址</span>
32
+ <a-input
33
+ v-model="data.url"
34
+ :style="{ background: '#ffffff' }"
35
+ placeholder="请输入"
36
+ allow-clear
37
+ />
38
+ </div>
39
+ </div>
40
+ </a-drawer>
41
+ </template>
42
+
43
+ <script lang="ts" setup>
44
+ import { ref, computed } from "vue";
45
+ import RichTextEditor from "@/components/RichTextEditor";
46
+ import { randomString } from "@/utils/common";
47
+
48
+ const props = defineProps({
49
+ show: {
50
+ type: Boolean,
51
+ default: false,
52
+ },
53
+
54
+ data: {
55
+ type: Object,
56
+ default: () => {},
57
+ },
58
+ });
59
+
60
+ const emit = defineEmits(["update:show"]);
61
+
62
+ const handleCancel = () => {
63
+ emit("update:show", false);
64
+ };
65
+ </script>
66
+
67
+ <style lang="scss" scoped>
68
+ .setting-header {
69
+ padding-bottom: 12px;
70
+
71
+ .header-title {
72
+ width: 120px;
73
+ padding-right: 12px;
74
+ text-align: right;
75
+ }
76
+ }
77
+ .setting-header :deep(.arco-select-view-single) {
78
+ background-color: #fff !important;
79
+ }
80
+ .setting-header :deep(.arco-input-wrapper) {
81
+ background-color: #fff !important;
82
+ }
83
+ .item-img {
84
+ height: 100px;
85
+ }
86
+ .seting-box {
87
+ padding: 20px;
88
+ background: #f0f2f5;
89
+ border-radius: 3px;
90
+ .arco-input-wrapper {
91
+ background: #ffffff;
92
+ }
93
+ }
94
+ .setting-content {
95
+ .setting-header {
96
+ padding-bottom: 12px;
97
+
98
+ .header-title {
99
+ width: 120px;
100
+ padding-right: 12px;
101
+ text-align: right;
102
+ }
103
+ }
104
+
105
+ .setting-body {
106
+ margin-top: 12px;
107
+
108
+ .setting-item {
109
+ position: relative;
110
+ padding: 16px 12px;
111
+ background: #f0f2f5;
112
+ border-radius: 8px;
113
+ margin-bottom: 20px;
114
+
115
+ .btn-group {
116
+ position: absolute;
117
+ right: 0;
118
+ top: 0;
119
+ display: flex;
120
+ align-items: center;
121
+ padding: 4px;
122
+
123
+ .btn-delete {
124
+ padding: 4px;
125
+ font-size: 24px;
126
+ cursor: pointer;
127
+ }
128
+ }
129
+
130
+ .item-name {
131
+ font-size: 16px;
132
+ font-weight: 600;
133
+ padding-bottom: 10px;
134
+ border-bottom: 1px solid #fff;
135
+ }
136
+
137
+ .item-title {
138
+ padding: 12px 0 8px 0;
139
+ font-size: 14px;
140
+ font-weight: 600;
141
+ }
142
+
143
+ .arco-input-wrapper {
144
+ background: #fff;
145
+ }
146
+
147
+ .item-button {
148
+ position: relative;
149
+ padding: 12px 8px 4px;
150
+ background: #fff;
151
+ border-radius: 4px;
152
+ margin: 4px 0;
153
+ transition: all 0.3s ease;
154
+
155
+ &.draggable-item {
156
+ cursor: move;
157
+
158
+ &:hover {
159
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
160
+ transform: translateY(-1px);
161
+ }
162
+
163
+ // 当禁用拖拽时,不显示拖拽效果
164
+ &.sortable-disabled {
165
+ cursor: default;
166
+
167
+ &:hover {
168
+ box-shadow: none;
169
+ transform: none;
170
+ }
171
+ }
172
+ }
173
+
174
+ .arco-input-wrapper {
175
+ background: #f2f3f5;
176
+ }
177
+ }
178
+
179
+ // 拖拽相关样式
180
+ .flip-list-move {
181
+ transition: transform 0.5s;
182
+ }
183
+
184
+ .no-move {
185
+ transition: transform 0s;
186
+ }
187
+
188
+ .ghost {
189
+ opacity: 0.5;
190
+ background: #c8ebfb;
191
+ }
192
+
193
+ .list-group {
194
+ min-height: 20px;
195
+ }
196
+
197
+ .list-group-item {
198
+ cursor: move;
199
+ }
200
+
201
+ .list-group-item i {
202
+ cursor: pointer;
203
+ }
204
+
205
+ .item-action {
206
+ padding: 10px 0;
207
+
208
+ .action-text {
209
+ width: 150px;
210
+ margin-right: 8px;
211
+ }
212
+ }
213
+
214
+ .item-add-btn {
215
+ display: inline-block;
216
+ padding: 2px 8px;
217
+ margin-top: 5px;
218
+ font-size: 11px;
219
+ color: #165dff;
220
+ border-radius: 4px;
221
+ font-weight: 600;
222
+ border: 1px solid #165dff;
223
+ cursor: pointer;
224
+ }
225
+
226
+ .item-img {
227
+ margin-top: 12px;
228
+ height: 160px;
229
+ }
230
+
231
+ .fit-content {
232
+ width: fit-content;
233
+ }
234
+
235
+ .item-img-list {
236
+ .img-list-item {
237
+ margin: 4px 0;
238
+ position: relative;
239
+ padding: 8px;
240
+ border-radius: 4px;
241
+ transition: all 0.3s ease;
242
+ background: #fff;
243
+ border-radius: 4px;
244
+
245
+ &.draggable-item {
246
+ cursor: move;
247
+
248
+ &:hover {
249
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
250
+ transform: translateY(-1px);
251
+ }
252
+
253
+ // 当禁用拖拽时,不显示拖拽效果
254
+ &.sortable-disabled {
255
+ cursor: default;
256
+
257
+ &:hover {
258
+ box-shadow: none;
259
+ transform: none;
260
+ }
261
+ }
262
+ }
263
+
264
+ .arco-input-wrapper {
265
+ background: #f2f3f5;
266
+ }
267
+
268
+ .img-drag-handle {
269
+ top: 0 !important;
270
+ }
271
+ }
272
+
273
+ .item-img-box {
274
+ margin-right: 12px;
275
+ position: relative;
276
+ width: 133px;
277
+ height: 100px;
278
+
279
+ .item-img-dlete {
280
+ position: absolute;
281
+ padding: 8px;
282
+ font-size: 32px;
283
+ top: -16px;
284
+ right: -16px;
285
+ color: red;
286
+ cursor: pointer;
287
+ }
288
+ }
289
+
290
+ .small-img {
291
+ margin: 0;
292
+ height: 100px;
293
+ object-fit: cover;
294
+ }
295
+
296
+ .item-right {
297
+ padding-top: 24px;
298
+ }
299
+ }
300
+ }
301
+ }
302
+
303
+ .drag-handle {
304
+ padding: 4px;
305
+ cursor: grab;
306
+ padding: 4px;
307
+ border-radius: 4px;
308
+
309
+ &:hover {
310
+ background-color: #f0f2f5;
311
+ }
312
+
313
+ &:active {
314
+ cursor: grabbing;
315
+ }
316
+
317
+ .drag-icon {
318
+ font-size: 16px;
319
+ color: #86909c;
320
+ }
321
+ }
322
+ }
323
+ </style>
@@ -0,0 +1,17 @@
1
+ export interface CustomIframeProps {
2
+ /** 双向绑定的值 */
3
+ modelValue: any
4
+ }
5
+
6
+ export interface CustomIframeEmits {
7
+ (e: 'update:modelValue', value: any): void
8
+ (e: 'handleDelete', value: string | number): void
9
+ (e: 'handleCopy', value: any): void
10
+ }
11
+
12
+ // export type ComponentSlots = {
13
+ // /** 默认插槽内容 */
14
+ // default?: (props: { value: string | number }) => VNode[]
15
+ // /** 头部内容 */
16
+ // header?: (props: { title: string }) => VNode[]
17
+ // }
@@ -42,12 +42,11 @@ const handleEdit = () => {
42
42
  .operate-page {
43
43
  position: absolute;
44
44
  top: 0;
45
- left: 0;
46
45
  right: 0;
47
46
  padding: 20px;
48
47
  max-height: 100%;
49
48
  z-index: 99;
50
- display: flex;
49
+ display: inline-flex;
51
50
  align-items: center;
52
51
  justify-content: flex-end;
53
52
 
@@ -0,0 +1,11 @@
1
+ import type { App, Plugin } from 'vue'
2
+ import ScrollKeyInfo from './index.vue'
3
+
4
+ export default {
5
+ install: (app: App) => {
6
+ app.component('ScrollKeyInfo', ScrollKeyInfo)
7
+ },
8
+ } satisfies Plugin
9
+
10
+ export { default as ScrollKeyInfo } from './index.vue'
11
+ export type { ScrollKeyInfoProps, ScrollKeyInfoEmits } from './type'