bi-element-ui 1.5.2 → 1.6.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.
package/src/App.vue CHANGED
@@ -42,6 +42,10 @@
42
42
  <i class="el-icon-edit-outline"></i>
43
43
  <span>图文编辑</span>
44
44
  </el-menu-item>
45
+ <el-menu-item index="/fireworks">
46
+ <i class="el-icon-magic-stick"></i>
47
+ <span>烟花</span>
48
+ </el-menu-item>
45
49
  </el-menu>
46
50
  </el-aside>
47
51
  <el-main>
@@ -44,6 +44,11 @@ const routes = [
44
44
  path: '/textEditor',
45
45
  name: 'textEditor',
46
46
  component: () => import(/* webpackChunkName: "about" */ '../views/textEditor.vue')
47
+ },
48
+ {
49
+ path: '/fireworks',
50
+ name: 'Fireworks',
51
+ component: () => import(/* webpackChunkName: "fireworks" */ '../views/Fireworks.vue')
47
52
  }
48
53
  ]
49
54
 
@@ -15,6 +15,7 @@ console.log(process.env.VUE_APP_BASE_API)
15
15
  service.interceptors.request.use(
16
16
  (config) => {
17
17
  // do something before request is sent
18
+ config.headers['Content-Type'] = 'application/json'
18
19
  config.headers['AuthKey'] = 'authtpe84dzfl3iq62'
19
20
  config.headers['Login-Env'] = getUa()
20
21
  config.headers['Login-Device'] = JSON.stringify(browserType())
@@ -0,0 +1,253 @@
1
+ <template>
2
+ <div class="page-content">
3
+ <!-- 生日蛋糕SVG动画 -->
4
+ <div class="birthday-cake-container">
5
+ <object
6
+ data="./img/birthday-cake.svg"
7
+ type="image/svg+xml"
8
+ width="200"
9
+ height="240"
10
+ ></object>
11
+ </div>
12
+
13
+ <div class="action-buttons">
14
+ <el-button
15
+ :disabled="isLaunching"
16
+ @click="handleSingleLaunch"
17
+ >
18
+ ✨ 放个小烟花
19
+ </el-button>
20
+ <el-button
21
+ :disabled="isLaunching"
22
+ @click="handleImageLaunch(bp)"
23
+ >
24
+ 🎉 打开幸运红包
25
+ </el-button>
26
+ <el-button
27
+ :disabled="isLaunching"
28
+ @click="handleImageLaunch(yd)"
29
+ >
30
+ 🎉 打开红包雨
31
+ </el-button>
32
+ <el-button
33
+ :disabled="isLaunching"
34
+ @click="handleImageLaunch(xc)"
35
+ >
36
+ 🎉 打开小丑红包
37
+ </el-button>
38
+ <el-button
39
+ :disabled="isLaunching"
40
+ type="primary"
41
+ @click="handleBirthdayFireworks"
42
+ >
43
+ 🎂 生日庆祝模式
44
+ </el-button>
45
+ <el-button
46
+ :disabled="isLaunching"
47
+ type="warning"
48
+ @click="handleCakeFireworks"
49
+ >
50
+ 🍰 蛋糕烟花秀
51
+ </el-button>
52
+ <el-button
53
+ :disabled="isLaunching"
54
+ @click="handleMultipleLaunch('')"
55
+ >
56
+ 🎆 璀璨烟火秀
57
+ </el-button>
58
+ <el-button
59
+ :disabled="isLaunching"
60
+ @click="handleImageLaunch(sd)"
61
+ >
62
+ ❄️ 飘点小雪花
63
+ </el-button>
64
+ <el-button
65
+ :disabled="isLaunching"
66
+ @click="handleMultipleLaunch(sd)"
67
+ >
68
+ ❄️ 浪漫暴风雪
69
+ </el-button>
70
+ </div>
71
+
72
+ <el-descriptions
73
+ title="礼花组件说明"
74
+ direction="vertical"
75
+ :column="1"
76
+ border
77
+ style="margin-top: 50px"
78
+ >
79
+ <el-descriptions-item label="显示时机">
80
+ 礼花效果组件全局注册了,在节假日的时候,会自动显示,你可以通过配置文件来控制显示时机
81
+ </el-descriptions-item>
82
+ <el-descriptions-item label="礼花样式">
83
+ 默认显示几何图形,可以配置图片,图片需要提前在 packages/Fireworks/imgs 文件夹中预先定义。蛋糕模式会在canvas中央显示大蛋糕背景,使用彩色几何图形作为烟花粒子。
84
+ </el-descriptions-item>
85
+ <el-descriptions-item label="节日配置">
86
+ 可以根据项目需要配置节日和对应的礼花样式
87
+ </el-descriptions-item>
88
+ <el-descriptions-item label="快捷键">
89
+ command + shift + p 或者 ctrl + shift + p
90
+ </el-descriptions-item>
91
+ <el-descriptions-item label="蛋糕模式">
92
+ 点击"🍰 蛋糕烟花秀"按钮可体验特殊的蛋糕模式:大蛋糕固定显示在屏幕中央,彩色几何图形作为烟花粒子绽放。
93
+ </el-descriptions-item>
94
+ </el-descriptions>
95
+
96
+ <!-- 烟花组件 -->
97
+ <BiFireworks />
98
+ </div>
99
+ </template>
100
+
101
+ <script>
102
+ import bp from './img/hb.png'
103
+ import sd from './img/sd.png'
104
+ import yd from './img/yd.png'
105
+ import xc from './img/xc.png'
106
+
107
+ export default {
108
+ name: 'FireworksView',
109
+ data() {
110
+ return {
111
+ bp,
112
+ sd,
113
+ xc,
114
+ yd,
115
+ timerRef: null,
116
+ isLaunching: false
117
+ }
118
+ },
119
+ beforeDestroy() {
120
+ if (this.timerRef) {
121
+ clearInterval(this.timerRef)
122
+ this.timerRef = null
123
+ }
124
+ },
125
+ methods: {
126
+ triggerFireworks(count, src) {
127
+ // 清除之前的定时器
128
+ if (this.timerRef) {
129
+ clearInterval(this.timerRef)
130
+ this.timerRef = null
131
+ }
132
+
133
+ this.isLaunching = true // 开始发射时设置状态
134
+
135
+ let fired = 0
136
+ this.timerRef = setInterval(() => {
137
+ this.$root.$emit('triggerFireworks', src)
138
+ fired++
139
+
140
+ // 达到指定次数后清除定时器
141
+ if (fired >= count) {
142
+ clearInterval(this.timerRef)
143
+ this.timerRef = null
144
+ this.isLaunching = false // 发射完成后解除禁用
145
+ }
146
+ }, 1000)
147
+ },
148
+
149
+ // 简化后的处理函数
150
+ handleSingleLaunch() {
151
+ this.$root.$emit('triggerFireworks')
152
+ },
153
+
154
+ handleMultipleLaunch(src) {
155
+ this.triggerFireworks(10, src)
156
+ },
157
+
158
+ handleImageLaunch(src) {
159
+ this.$root.$emit('triggerFireworks', src)
160
+ },
161
+
162
+ handleBirthdayFireworks() {
163
+ // 生日庆祝模式:多阶段烟花表演
164
+ this.isLaunching = true
165
+
166
+ // 第一阶段:蛋糕烟花
167
+ this.$root.$emit('triggerFireworks', 'cake-mode')
168
+
169
+ // 第二阶段:红包雨
170
+ setTimeout(() => {
171
+ this.$root.$emit('triggerFireworks', this.bp)
172
+ }, 800)
173
+
174
+ // 第三阶段:更多蛋糕
175
+ setTimeout(() => {
176
+ this.$root.$emit('triggerFireworks', 'cake-mode')
177
+ }, 1600)
178
+
179
+ // 第四阶段:混合烟花
180
+ setTimeout(() => {
181
+ this.$root.$emit('triggerFireworks', this.yd)
182
+ }, 2400)
183
+
184
+ // 第五阶段:大结局
185
+ setTimeout(() => {
186
+ this.$root.$emit('triggerFireworks')
187
+ this.$root.$emit('triggerFireworks', this.xc)
188
+ }, 3200)
189
+
190
+ // 重置状态
191
+ setTimeout(() => {
192
+ this.isLaunching = false
193
+ }, 4000)
194
+ },
195
+
196
+ handleCakeFireworks() {
197
+ // 蛋糕烟花秀:专门展示蛋糕模式效果
198
+ this.isLaunching = true
199
+
200
+ // 连续发射多轮蛋糕烟花,展示大蛋糕背景效果
201
+ this.$root.$emit('triggerFireworks', 'cake-mode')
202
+
203
+ // setTimeout(() => {
204
+ // this.$root.$emit('triggerFireworks', 'cake-mode')
205
+ // }, 1000)
206
+
207
+ // setTimeout(() => {
208
+ // this.$root.$emit('triggerFireworks', 'cake-mode')
209
+ // }, 2000)
210
+
211
+ // 重置状态
212
+ setTimeout(() => {
213
+ this.isLaunching = false
214
+ }, 3000)
215
+ }
216
+ }
217
+ }
218
+ </script>
219
+
220
+ <style lang="scss" scoped>
221
+ .page-content {
222
+ padding: 20px;
223
+ text-align: center;
224
+ }
225
+
226
+ .birthday-cake-container {
227
+ margin: 20px auto;
228
+ display: flex;
229
+ justify-content: center;
230
+ align-items: center;
231
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
232
+ border-radius: 15px;
233
+ padding: 20px;
234
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
235
+ max-width: 240px;
236
+ margin-bottom: 30px;
237
+
238
+ object {
239
+ border-radius: 10px;
240
+ background: rgba(255, 255, 255, 0.1);
241
+ backdrop-filter: blur(10px);
242
+ }
243
+ }
244
+
245
+ .action-buttons {
246
+ margin-bottom: 20px;
247
+ }
248
+
249
+ .action-buttons .el-button {
250
+ margin-right: 10px;
251
+ margin-bottom: 10px;
252
+ }
253
+ </style>
@@ -4,7 +4,9 @@
4
4
 
5
5
  <BiNavbarTool
6
6
  :token="token"
7
+ user-id="67"
7
8
  :avatar="avatar"
9
+ :task-center="true"
8
10
  />
9
11
  </header>
10
12
 
@@ -19,7 +21,7 @@
19
21
  export default {
20
22
  data() {
21
23
  return {
22
- token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxNTc1NzE4NTMyMiIsImxvZ2luX2VudiI6IiIsImlhdCI6MTc0MDQ1MDA2OCwiZXhwIjoxNzQxMDU0ODY4LCJuYmYiOjE3NDA0NTAwNjgsInN1YiI6InRva2Vu6K6k6K-BIiwianRpIjoiMjcyOTQzZGVkYzdmNWM0ODg2MzZlMzY3YjY5MWY2ZGUifQ.Pyi47Jyt_kb4gZL0pquvU5k1_mJGtkTtYWk04C3Jq-Y',
24
+ token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxNTc1NzE4NTMyMiIsImxvZ2luX2VudiI6IiIsImlhdCI6MTc0NzgwNjEyMCwiZXhwIjoxNzQ4NDEwOTIwLCJuYmYiOjE3NDc4MDYxMjAsInN1YiI6InRva2Vu6K6k6K-BIiwianRpIjoiMDA2NDE3YmVlNDQyZjU2ZTQ5YzBiNDcyM2RkMDRkOTIifQ.fzpMThSA7SoscLOk_wiymMO3NYLFgjYR_zPuS5Ar_98',
23
25
  avatar: 'https://static-legacy.dingtalk.com/media/lADPBbCc1SE7SD7NAuzNAug_744_748.jpg?imageView2/1/w/80/h/80'
24
26
  }
25
27
  },
Binary file
@@ -0,0 +1,40 @@
1
+ <svg width="30" height="30" xmlns="http://www.w3.org/2000/svg">
2
+ <defs>
3
+ <radialGradient id="miniCakeGradient" cx="50%" cy="50%" r="50%">
4
+ <stop offset="0%" style="stop-color:#FFB6C1;stop-opacity:1" />
5
+ <stop offset="100%" style="stop-color:#FF69B4;stop-opacity:1" />
6
+ </radialGradient>
7
+ <radialGradient id="miniFlameGradient" cx="50%" cy="80%" r="60%">
8
+ <stop offset="0%" style="stop-color:#FFF8DC;stop-opacity:1" />
9
+ <stop offset="30%" style="stop-color:#FFD700;stop-opacity:1" />
10
+ <stop offset="80%" style="stop-color:#FF8C00;stop-opacity:1" />
11
+ <stop offset="100%" style="stop-color:#FF4500;stop-opacity:0.9" />
12
+ </radialGradient>
13
+ </defs>
14
+
15
+ <!-- 蛋糕底部 -->
16
+ <ellipse cx="15" cy="25" rx="12" ry="3" fill="#90EE90"/>
17
+ <rect x="3" y="22" width="24" height="6" fill="#98FB98"/>
18
+
19
+ <!-- 蛋糕顶部 -->
20
+ <ellipse cx="15" cy="18" rx="8" ry="2" fill="url(#miniCakeGradient)"/>
21
+ <rect x="7" y="16" width="16" height="4" fill="url(#miniCakeGradient)"/>
22
+
23
+ <!-- 蜡烛 -->
24
+ <rect x="14" y="12" width="2" height="6" fill="#FFE4B5" stroke="#D2691E" stroke-width="0.3"/>
25
+
26
+ <!-- 火焰 -->
27
+ <ellipse cx="15" cy="9.5" rx="1.2" ry="2.5" fill="url(#miniFlameGradient)">
28
+ <animate attributeName="ry" values="2.5;3;2;2.5" dur="0.8s" repeatCount="indefinite"/>
29
+ <animate attributeName="opacity" values="0.9;1;0.8;0.9" dur="0.8s" repeatCount="indefinite"/>
30
+ </ellipse>
31
+
32
+ <!-- 火焰内核 -->
33
+ <ellipse cx="15" cy="10" rx="0.5" ry="1" fill="#FFD700" opacity="0.8">
34
+ <animate attributeName="opacity" values="0.8;0.4;0.8" dur="0.8s" repeatCount="indefinite"/>
35
+ </ellipse>
36
+
37
+ <!-- 装饰点 -->
38
+ <circle cx="12" cy="18" r="1" fill="#DC143C"/>
39
+ <circle cx="18" cy="18" r="1" fill="#DC143C"/>
40
+ </svg>
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- .example-table-box[data-v-49a6bb0c]{margin:25px 50px}.example-table-box p[data-v-49a6bb0c]{text-align:left;font-weight:700}.box[data-v-b56128ba]{background:#ccc;height:200px;padding:10px 50px}header[data-v-b56128ba]{height:50px;background:#fff}.example-table-box[data-v-10718cef]{margin:25px 50px;position:relative}.example-table-box p[data-v-10718cef]{text-align:left;font-weight:700}