@ebiz/designer-components 0.0.18-beta.1 → 0.0.18-beta.3
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/designer-components.css +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.mjs +118984 -0
- package/package.json +1 -1
- package/src/components/EbizAvatar.vue +116 -0
- package/src/components/EbizEmployeeInfo.vue +139 -0
- package/src/components/EbizStatistic.vue +150 -0
- package/src/components/EbizTabPanel.vue +23 -0
- package/src/components/EbizTabs.vue +143 -0
- package/src/components/EbizTitle.vue +37 -36
- package/src/components/TdesignAlert.vue +116 -0
- package/src/components/TdesignTimeline.vue +58 -0
- package/src/components/TdesignTimelineItem.vue +72 -0
- package/src/components/TdesignWatermark.vue +108 -0
- package/src/index.js +31 -0
- package/src/router/index.js +42 -0
- package/src/views/EbizAvatar.vue +224 -0
- package/src/views/EbizEmployeeInfo.vue +250 -0
- package/src/views/Home.vue +8 -1
- package/src/views/StatisticDemo.vue +191 -0
- package/src/views/TabsDemo.vue +283 -0
- package/src/views/TdesignAlert.vue +99 -0
- package/src/views/TimelineDemo.vue +161 -0
- package/src/views/WatermarkDemo.vue +86 -0
@@ -0,0 +1,250 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="container">
|
3
|
+
<h1>EbizEmployeeInfo 员工信息组件示例</h1>
|
4
|
+
|
5
|
+
<div class="section">
|
6
|
+
<h2>基础用法</h2>
|
7
|
+
<div class="example-block">
|
8
|
+
<ebiz-employee-info
|
9
|
+
:info="basicEmployee"
|
10
|
+
/>
|
11
|
+
</div>
|
12
|
+
<div class="code-block">
|
13
|
+
<pre><code><ebiz-employee-info
|
14
|
+
:info="{
|
15
|
+
avatar: 'https://tdesign.tencent.com/vue-next/assets/avatar-1.jpg',
|
16
|
+
name: '张三',
|
17
|
+
id: 'EMP10086',
|
18
|
+
department: '研发部'
|
19
|
+
}"
|
20
|
+
/></code></pre>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="section">
|
25
|
+
<h2>不同头像尺寸</h2>
|
26
|
+
<div class="example-block">
|
27
|
+
<div class="avatar-size-container">
|
28
|
+
<div v-for="size in avatarSizes" :key="size" class="avatar-size-item">
|
29
|
+
<ebiz-employee-info
|
30
|
+
:info="basicEmployee"
|
31
|
+
:avatar-size="size"
|
32
|
+
/>
|
33
|
+
<div class="size-label">size: {{ size }}</div>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
<div class="code-block">
|
38
|
+
<pre><code><ebiz-employee-info
|
39
|
+
:info="employeeInfo"
|
40
|
+
avatar-size="large"
|
41
|
+
/></code></pre>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div class="section">
|
46
|
+
<h2>方形头像</h2>
|
47
|
+
<div class="example-block">
|
48
|
+
<ebiz-employee-info
|
49
|
+
:info="basicEmployee"
|
50
|
+
avatar-shape="round"
|
51
|
+
/>
|
52
|
+
</div>
|
53
|
+
<div class="code-block">
|
54
|
+
<pre><code><ebiz-employee-info
|
55
|
+
:info="employeeInfo"
|
56
|
+
avatar-shape="round"
|
57
|
+
/></code></pre>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<div class="section">
|
62
|
+
<h2>无头像处理</h2>
|
63
|
+
<div class="example-block">
|
64
|
+
<ebiz-employee-info
|
65
|
+
:info="noAvatarEmployee"
|
66
|
+
/>
|
67
|
+
</div>
|
68
|
+
<div class="code-block">
|
69
|
+
<pre><code><ebiz-employee-info
|
70
|
+
:info="{
|
71
|
+
name: '李四',
|
72
|
+
id: 'EMP10087',
|
73
|
+
department: '市场部'
|
74
|
+
}"
|
75
|
+
/></code></pre>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div class="section">
|
80
|
+
<h2>自定义样式</h2>
|
81
|
+
<div class="example-block">
|
82
|
+
<ebiz-employee-info
|
83
|
+
:info="basicEmployee"
|
84
|
+
width="350px"
|
85
|
+
class="custom-employee-info"
|
86
|
+
/>
|
87
|
+
</div>
|
88
|
+
<div class="code-block">
|
89
|
+
<pre><code><ebiz-employee-info
|
90
|
+
:info="employeeInfo"
|
91
|
+
width="350px"
|
92
|
+
class="custom-employee-info"
|
93
|
+
/>
|
94
|
+
|
95
|
+
<style>
|
96
|
+
.custom-employee-info {
|
97
|
+
background-color: #f0f8ff;
|
98
|
+
border: 1px solid #d1e9ff;
|
99
|
+
}
|
100
|
+
</style></code></pre>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<div class="section">
|
105
|
+
<h2>多个员工信息</h2>
|
106
|
+
<div class="example-block">
|
107
|
+
<div class="employee-list">
|
108
|
+
<ebiz-employee-info
|
109
|
+
v-for="(employee, index) in employeeList"
|
110
|
+
:key="index"
|
111
|
+
:info="employee"
|
112
|
+
class="employee-list-item"
|
113
|
+
/>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<div class="code-block">
|
117
|
+
<pre><code><div class="employee-list">
|
118
|
+
<ebiz-employee-info
|
119
|
+
v-for="(employee, index) in employeeList"
|
120
|
+
:key="index"
|
121
|
+
:info="employee"
|
122
|
+
class="employee-list-item"
|
123
|
+
/>
|
124
|
+
</div></code></pre>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
</template>
|
129
|
+
|
130
|
+
<script>
|
131
|
+
import { EbizEmployeeInfo } from '../index.js'
|
132
|
+
|
133
|
+
export default {
|
134
|
+
name: 'EbizEmployeeInfoDemo',
|
135
|
+
components: {
|
136
|
+
EbizEmployeeInfo
|
137
|
+
},
|
138
|
+
data() {
|
139
|
+
return {
|
140
|
+
basicEmployee: {
|
141
|
+
avatar: 'https://tdesign.tencent.com/vue-next/assets/avatar-1.jpg',
|
142
|
+
name: '张三',
|
143
|
+
id: 'EMP10086',
|
144
|
+
department: '研发部'
|
145
|
+
},
|
146
|
+
noAvatarEmployee: {
|
147
|
+
name: '李四',
|
148
|
+
id: 'EMP10087',
|
149
|
+
department: '市场部'
|
150
|
+
},
|
151
|
+
avatarSizes: ['small', 'medium', 'large'],
|
152
|
+
employeeList: [
|
153
|
+
{
|
154
|
+
avatar: 'https://tdesign.tencent.com/vue-next/assets/avatar-1.jpg',
|
155
|
+
name: '张三',
|
156
|
+
id: 'EMP10086',
|
157
|
+
department: '研发部'
|
158
|
+
},
|
159
|
+
{
|
160
|
+
avatar: 'https://tdesign.tencent.com/vue-next/assets/avatar-2.jpg',
|
161
|
+
name: '李四',
|
162
|
+
id: 'EMP10087',
|
163
|
+
department: '市场部'
|
164
|
+
},
|
165
|
+
{
|
166
|
+
avatar: 'https://tdesign.tencent.com/vue-next/assets/avatar-3.jpg',
|
167
|
+
name: '王五',
|
168
|
+
id: 'EMP10088',
|
169
|
+
department: '产品部'
|
170
|
+
},
|
171
|
+
{
|
172
|
+
name: '赵六',
|
173
|
+
id: 'EMP10089',
|
174
|
+
department: '设计部'
|
175
|
+
}
|
176
|
+
]
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
</script>
|
181
|
+
|
182
|
+
<style lang="less" scoped>
|
183
|
+
.container {
|
184
|
+
padding: 20px;
|
185
|
+
|
186
|
+
h1 {
|
187
|
+
margin-bottom: 20px;
|
188
|
+
}
|
189
|
+
|
190
|
+
.section {
|
191
|
+
margin-bottom: 30px;
|
192
|
+
|
193
|
+
h2 {
|
194
|
+
margin-bottom: 15px;
|
195
|
+
}
|
196
|
+
|
197
|
+
.example-block {
|
198
|
+
margin-bottom: 15px;
|
199
|
+
padding: 20px;
|
200
|
+
border: 1px solid #eee;
|
201
|
+
border-radius: 4px;
|
202
|
+
}
|
203
|
+
|
204
|
+
.code-block {
|
205
|
+
background-color: #f5f5f5;
|
206
|
+
padding: 15px;
|
207
|
+
border-radius: 4px;
|
208
|
+
|
209
|
+
pre {
|
210
|
+
margin: 0;
|
211
|
+
white-space: pre-wrap;
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}
|
215
|
+
|
216
|
+
.avatar-size-container {
|
217
|
+
display: flex;
|
218
|
+
flex-direction: column;
|
219
|
+
gap: 20px;
|
220
|
+
}
|
221
|
+
|
222
|
+
.avatar-size-item {
|
223
|
+
position: relative;
|
224
|
+
|
225
|
+
.size-label {
|
226
|
+
position: absolute;
|
227
|
+
right: 20px;
|
228
|
+
top: 50%;
|
229
|
+
transform: translateY(-50%);
|
230
|
+
font-size: 14px;
|
231
|
+
color: #666;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
.employee-list {
|
236
|
+
display: flex;
|
237
|
+
flex-direction: column;
|
238
|
+
gap: 15px;
|
239
|
+
}
|
240
|
+
|
241
|
+
.employee-list-item {
|
242
|
+
border: 1px solid #eaeaea;
|
243
|
+
}
|
244
|
+
|
245
|
+
.custom-employee-info {
|
246
|
+
background-color: #f0f8ff;
|
247
|
+
border: 1px solid #d1e9ff;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
</style>
|
package/src/views/Home.vue
CHANGED
@@ -45,7 +45,14 @@ export default {
|
|
45
45
|
{ path: '/switch', title: 'Ebiz开关组件示例' },
|
46
46
|
{ path: '/textarea', title: 'Ebiz多行文本框组件示例' },
|
47
47
|
{ path: '/upload', title: 'TDesign上传组件示例' },
|
48
|
-
{ path: '/grid', title: 'TDesign栅格组件示例' }
|
48
|
+
{ path: '/grid', title: 'TDesign栅格组件示例' },
|
49
|
+
{ path: '/tabs', title: 'Ebiz选项卡组件示例' },
|
50
|
+
{ path: '/statistic', title: 'Ebiz统计数值组件示例' },
|
51
|
+
{ path: '/timeline', title: 'Ebiz时间轴组件示例' },
|
52
|
+
{ path: '/watermark', title: 'TDesign水印组件示例' },
|
53
|
+
{ path: '/ebiz-avatar', title: 'Ebiz头像组件示例' },
|
54
|
+
{ path: '/ebiz-employee-info', title: 'Ebiz员工信息组件示例' },
|
55
|
+
{ path: '/tdesign-alert', title: 'TDesign提示组件示例' }
|
49
56
|
]
|
50
57
|
|
51
58
|
return {
|
@@ -0,0 +1,191 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="statistic-demo-container">
|
3
|
+
<h1>统计数值组件示例</h1>
|
4
|
+
|
5
|
+
<section>
|
6
|
+
<h2>基础用法</h2>
|
7
|
+
<div class="demo-row">
|
8
|
+
<ebiz-statistic
|
9
|
+
title="Total Assets"
|
10
|
+
:value="82.76"
|
11
|
+
:decimalPlaces="2"
|
12
|
+
unit="%"
|
13
|
+
/>
|
14
|
+
</div>
|
15
|
+
</section>
|
16
|
+
|
17
|
+
<section>
|
18
|
+
<h2>趋势不同的组件</h2>
|
19
|
+
<div class="demo-row">
|
20
|
+
<ebiz-statistic
|
21
|
+
title="上升趋势"
|
22
|
+
:value="82.76"
|
23
|
+
:decimalPlaces="2"
|
24
|
+
unit="%"
|
25
|
+
trend="increase"
|
26
|
+
trendPlacement="left"
|
27
|
+
class="demo-item"
|
28
|
+
/>
|
29
|
+
|
30
|
+
<ebiz-statistic
|
31
|
+
title="下降趋势"
|
32
|
+
:value="82.76"
|
33
|
+
:decimalPlaces="2"
|
34
|
+
unit="%"
|
35
|
+
trend="decrease"
|
36
|
+
trendPlacement="right"
|
37
|
+
class="demo-item"
|
38
|
+
/>
|
39
|
+
</div>
|
40
|
+
</section>
|
41
|
+
|
42
|
+
<section>
|
43
|
+
<h2>颜色</h2>
|
44
|
+
<div class="demo-row">
|
45
|
+
<ebiz-statistic
|
46
|
+
title="默认颜色"
|
47
|
+
:value="82.76"
|
48
|
+
:decimalPlaces="2"
|
49
|
+
unit="%"
|
50
|
+
class="demo-item"
|
51
|
+
/>
|
52
|
+
|
53
|
+
<ebiz-statistic
|
54
|
+
title="自定义颜色"
|
55
|
+
:value="82.76"
|
56
|
+
:decimalPlaces="2"
|
57
|
+
unit="%"
|
58
|
+
color="red"
|
59
|
+
class="demo-item"
|
60
|
+
/>
|
61
|
+
|
62
|
+
<ebiz-statistic
|
63
|
+
title="自定义颜色"
|
64
|
+
:value="82.76"
|
65
|
+
:decimalPlaces="2"
|
66
|
+
unit="%"
|
67
|
+
color="green"
|
68
|
+
class="demo-item"
|
69
|
+
/>
|
70
|
+
</div>
|
71
|
+
</section>
|
72
|
+
|
73
|
+
<section>
|
74
|
+
<h2>前缀后缀</h2>
|
75
|
+
<div class="demo-row">
|
76
|
+
<ebiz-statistic
|
77
|
+
title="带前缀"
|
78
|
+
:value="56.32"
|
79
|
+
:decimalPlaces="2"
|
80
|
+
unit="%"
|
81
|
+
prefix="$"
|
82
|
+
class="demo-item"
|
83
|
+
/>
|
84
|
+
|
85
|
+
<ebiz-statistic
|
86
|
+
title="带后缀"
|
87
|
+
:value="176059"
|
88
|
+
suffix="元"
|
89
|
+
class="demo-item"
|
90
|
+
/>
|
91
|
+
</div>
|
92
|
+
</section>
|
93
|
+
|
94
|
+
<section>
|
95
|
+
<h2>数值动画</h2>
|
96
|
+
<div class="demo-row">
|
97
|
+
<ebiz-statistic
|
98
|
+
ref="animationStatistic"
|
99
|
+
title="动画效果"
|
100
|
+
:value="82.76"
|
101
|
+
:decimalPlaces="2"
|
102
|
+
unit="%"
|
103
|
+
:animation="{ duration: 2000 }"
|
104
|
+
class="demo-item"
|
105
|
+
/>
|
106
|
+
|
107
|
+
<button @click="startAnimation" class="demo-button">开始动画</button>
|
108
|
+
</div>
|
109
|
+
</section>
|
110
|
+
|
111
|
+
<section>
|
112
|
+
<h2>加载中</h2>
|
113
|
+
<div class="demo-row">
|
114
|
+
<ebiz-statistic
|
115
|
+
title="加载中状态"
|
116
|
+
:value="82.76"
|
117
|
+
:decimalPlaces="2"
|
118
|
+
unit="%"
|
119
|
+
:loading="true"
|
120
|
+
class="demo-item"
|
121
|
+
/>
|
122
|
+
</div>
|
123
|
+
</section>
|
124
|
+
</div>
|
125
|
+
</template>
|
126
|
+
|
127
|
+
<script setup>
|
128
|
+
import { ref } from 'vue';
|
129
|
+
import { EbizStatistic } from '../index.js';
|
130
|
+
|
131
|
+
const animationStatistic = ref(null);
|
132
|
+
|
133
|
+
const startAnimation = () => {
|
134
|
+
if (animationStatistic.value) {
|
135
|
+
animationStatistic.value.start();
|
136
|
+
}
|
137
|
+
};
|
138
|
+
</script>
|
139
|
+
|
140
|
+
<style scoped>
|
141
|
+
.statistic-demo-container {
|
142
|
+
max-width: 1200px;
|
143
|
+
margin: 0 auto;
|
144
|
+
padding: 20px;
|
145
|
+
}
|
146
|
+
|
147
|
+
section {
|
148
|
+
margin-bottom: 40px;
|
149
|
+
}
|
150
|
+
|
151
|
+
h1 {
|
152
|
+
font-size: 24px;
|
153
|
+
margin-bottom: 24px;
|
154
|
+
}
|
155
|
+
|
156
|
+
h2 {
|
157
|
+
font-size: 20px;
|
158
|
+
margin-bottom: 16px;
|
159
|
+
border-bottom: 1px solid #eee;
|
160
|
+
padding-bottom: 8px;
|
161
|
+
}
|
162
|
+
|
163
|
+
.demo-row {
|
164
|
+
display: flex;
|
165
|
+
flex-wrap: wrap;
|
166
|
+
margin: 0 -12px;
|
167
|
+
}
|
168
|
+
|
169
|
+
.demo-item {
|
170
|
+
flex: 0 0 calc(33.33% - 24px);
|
171
|
+
margin: 0 12px 24px;
|
172
|
+
background-color: #f5f5f5;
|
173
|
+
padding: 16px;
|
174
|
+
border-radius: 4px;
|
175
|
+
min-width: 200px;
|
176
|
+
}
|
177
|
+
|
178
|
+
.demo-button {
|
179
|
+
margin-top: 20px;
|
180
|
+
padding: 8px 16px;
|
181
|
+
background-color: #0052d9;
|
182
|
+
color: white;
|
183
|
+
border: none;
|
184
|
+
border-radius: 4px;
|
185
|
+
cursor: pointer;
|
186
|
+
}
|
187
|
+
|
188
|
+
.demo-button:hover {
|
189
|
+
background-color: #003cab;
|
190
|
+
}
|
191
|
+
</style>
|