@ebiz/designer-components 0.0.18-beta.1 → 0.0.18-beta.10

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/index.js CHANGED
@@ -1,52 +1,65 @@
1
- import MyComponent from "./components/MyComponent.vue";
2
- import MyTable from "./components/Table.vue";
3
- import EbizFormContainer from "./components/Form.vue";
4
- import EbizButton from "./components/Button.vue";
5
- import EbizTdesignButton from "./components/TdesignButton.vue";
6
- import EbizTdesignIcon from "./components/TdesignIcon.vue";
7
- import EbizTdesignInput from "./components/TdesignInput.vue";
8
- import EbizTdesignSelect from "./components/TdesignSelect.vue";
9
- import EbizTdesignForm from "./components/TdesignForm.vue";
10
- import EbizTdesignFormItem from "./components/TdesignFormItem.vue";
11
- import EbizTdesignDatePicker from "./components/TdesignDatePicker.vue";
12
- import EbizTdesignCard from "./components/TdesignCard.vue";
13
- import EbizTdesignImage from "./components/TdesignImage.vue";
14
- import EbizTdesignImageViewer from "./components/TdesignImageViewer.vue";
15
- import EbizDataContainer from "./components/DataContainer.vue";
16
- import EbizTitle from "./components/EbizTitle.vue";
17
- import EbizDivider from "./components/EbizDivider.vue";
18
- import EbizStatsCard from "./components/EbizStatsCard.vue";
19
- import EbizOkrTree from "./components/EbizOkrTree.vue";
20
- import EbizRemoteSelect from "./components/EbizRemoteSelect.vue";
21
- import EbizMindmap from "./components/EbizMindmap/index.vue";
22
- import EbizRouteBreadcrumb from "./components/EbizRouteBreadcrumb.vue";
23
- import EbizFileUpload from "./components/EbizFileUpload.vue";
24
- import EbizTabHeader from "./components/EbizTabHeader.vue";
25
- import TdesignCalendar from "./components/TdesignCalendar/index.vue";
26
- import TdesignCollapse from "./components/TdesignCollapse.vue";
27
- import TdesignCollapsePanel from "./components/TdesignCollapsePanel.vue";
28
- import EbizTag from "./components/TdesignTag.vue";
29
- import EbizSwiper from "./components/EbizSwiper.vue";
30
- import EbizSwiperItem from "./components/EbizSwiperItem.vue";
31
- import EbizSpace from "./components/EbizSpace.vue";
32
- import EbizPagination from "./components/EbizPagination.vue";
33
- import EbizCheckbox from "./components/EbizCheckbox.vue";
34
- import EbizCheckboxGroup from "./components/EbizCheckboxGroup.vue";
35
- import EbizRadio from "./components/EbizRadio.vue";
36
- import EbizRadioGroup from "./components/EbizRadioGroup.vue";
37
- import EbizSwitch from "./components/EbizSwitch.vue";
38
- import EbizTextarea from "./components/TdesignTextarea.vue";
39
- import EbizUpload from "./components/TdesignUpload.vue";
40
- import EbizGrid from "./components/TdesignGrid.vue";
41
- import EbizCol from "./components/TdesignCol.vue";
1
+ import MyComponent from './components/MyComponent.vue'
2
+ import MyTable from './components/Table.vue'
3
+ import EbizFormContainer from './components/Form.vue'
4
+ import EbizButton from './components/Button.vue'
5
+ import EbizTdesignButton from './components/TdesignButton.vue'
6
+ import EbizTdesignIcon from './components/TdesignIcon.vue'
7
+ import EbizTdesignInput from './components/TdesignInput.vue'
8
+ import EbizTdesignSelect from './components/TdesignSelect.vue'
9
+ import EbizTdesignForm from './components/TdesignForm.vue'
10
+ import EbizTdesignFormItem from './components/TdesignFormItem.vue'
11
+ import EbizTdesignDatePicker from './components/TdesignDatePicker.vue'
12
+ import EbizTdesignCard from './components/TdesignCard.vue'
13
+ import EbizTdesignImage from './components/TdesignImage.vue'
14
+ import EbizTdesignImageViewer from './components/TdesignImageViewer.vue'
15
+ import EbizDataContainer from './components/DataContainer.vue'
16
+ import EbizTitle from './components/EbizTitle.vue'
17
+ import EbizDivider from './components/EbizDivider.vue'
18
+ import EbizStatsCard from './components/EbizStatsCard.vue'
19
+ import EbizOkrTree from './components/EbizOkrTree.vue'
20
+ import EbizRemoteSelect from './components/EbizRemoteSelect.vue'
21
+ import EbizMindmap from './components/EbizMindmap/index.vue'
22
+ import EbizRouteBreadcrumb from './components/EbizRouteBreadcrumb.vue'
23
+ import EbizFileUpload from './components/EbizFileUpload.vue'
24
+ import EbizTabHeader from './components/EbizTabHeader.vue'
25
+ import TdesignCalendar from './components/TdesignCalendar/index.vue'
26
+ import TdesignCollapse from './components/TdesignCollapse.vue'
27
+ import TdesignCollapsePanel from './components/TdesignCollapsePanel.vue'
28
+ import EbizTag from './components/TdesignTag.vue'
29
+ import EbizSwiper from './components/EbizSwiper.vue'
30
+ import EbizSwiperItem from './components/EbizSwiperItem.vue'
31
+ import EbizSpace from './components/EbizSpace.vue'
32
+ import EbizPagination from './components/EbizPagination.vue'
33
+ import EbizCheckbox from './components/EbizCheckbox.vue'
34
+ import EbizCheckboxGroup from './components/EbizCheckboxGroup.vue'
35
+ import EbizRadio from './components/EbizRadio.vue'
36
+ import EbizRadioGroup from './components/EbizRadioGroup.vue'
37
+ import EbizSwitch from './components/EbizSwitch.vue'
38
+ import EbizTextarea from './components/TdesignTextarea.vue'
39
+ import EbizUpload from './components/TdesignUpload.vue'
40
+ import EbizGrid from './components/TdesignGrid.vue'
41
+ import EbizCol from './components/TdesignCol.vue'
42
+ import EbizTabs from './components/EbizTabs.vue'
43
+ import EbizTabPanel from './components/EbizTabPanel.vue'
44
+ import EbizStatistic from './components/EbizStatistic.vue'
45
+ import EbizWatermark from './components/TdesignWatermark.vue'
46
+ import EbizAvatar from './components/EbizAvatar.vue'
47
+ import EbizEmployeeInfo from './components/EbizEmployeeInfo.vue'
48
+ import EbizAlert from './components/TdesignAlert.vue'
49
+ import EbizDialog from './components/TdesignDialog.vue'
50
+ import { MessagePlugin as EbizMessage } from 'tdesign-vue-next'
42
51
 
43
52
  // 导入简洁数据服务
44
- import dataService from "./apiService/simpleDataService";
53
+ import dataService from './apiService/simpleDataService'
45
54
 
46
- import "tdesign-vue-next/es/style/index.css";
55
+ import 'tdesign-vue-next/es/style/index.css'
47
56
 
48
57
  // 导入图表样式
49
- import "./assets/styles/charts/main.less";
58
+ import './assets/styles/charts/main.less'
59
+
60
+ // 时间轴组件
61
+ import EbizTimeline from './components/TdesignTimeline.vue'
62
+ import { TimelineItem as EbizTimelineItem } from 'tdesign-vue-next'
50
63
 
51
64
  // 导出组件
52
65
  export {
@@ -110,4 +123,25 @@ export {
110
123
  EbizGrid,
111
124
  // 栅格列组件
112
125
  EbizCol,
113
- };
126
+ // 选项卡组件
127
+ EbizTabs,
128
+ // 选项卡面板组件
129
+ EbizTabPanel,
130
+ // 统计数值组件
131
+ EbizStatistic,
132
+ // 消息插件
133
+ EbizMessage,
134
+ // 时间轴组件
135
+ EbizTimeline,
136
+ EbizTimelineItem,
137
+ // 水印组件
138
+ EbizWatermark,
139
+ // 头像组件
140
+ EbizAvatar,
141
+ // 员工信息组件
142
+ EbizEmployeeInfo,
143
+ // 提示组件
144
+ EbizAlert,
145
+ // 对话框组件
146
+ EbizDialog
147
+ }
package/src/main.js CHANGED
@@ -23,8 +23,8 @@ import {
23
23
  dataService
24
24
  } from './index.js'
25
25
 
26
- import "tdesign-vue-next/es/style/index.css"
27
- import "./assets/styles/charts/main.less"
26
+ import 'tdesign-vue-next/es/style/index.css'
27
+ import './assets/styles/charts/main.less'
28
28
 
29
29
  const app = createApp(App)
30
30
 
@@ -186,6 +186,54 @@ const routes = [
186
186
  name: 'Grid',
187
187
  component: () => import('../views/GridDemo.vue'),
188
188
  meta: { title: 'TDesign栅格组件示例' }
189
+ },
190
+ {
191
+ path: '/tabs',
192
+ name: 'Tabs',
193
+ component: () => import('../views/TabsDemo.vue'),
194
+ meta: { title: 'Ebiz选项卡组件示例' }
195
+ },
196
+ {
197
+ path: '/statistic',
198
+ name: 'Statistic',
199
+ component: () => import('../views/StatisticDemo.vue'),
200
+ meta: { title: 'Ebiz统计数值组件示例' }
201
+ },
202
+ {
203
+ path: '/timeline',
204
+ name: 'Timeline',
205
+ component: () => import('../views/TimelineDemo.vue'),
206
+ meta: { title: 'Ebiz时间轴组件示例' }
207
+ },
208
+ {
209
+ path: '/watermark',
210
+ name: 'Watermark',
211
+ component: () => import('../views/WatermarkDemo.vue'),
212
+ meta: { title: 'TDesign水印组件示例' }
213
+ },
214
+ {
215
+ path: '/ebiz-avatar',
216
+ name: 'EbizAvatar',
217
+ component: () => import('../views/EbizAvatar.vue'),
218
+ meta: { title: 'Ebiz头像组件示例' }
219
+ },
220
+ {
221
+ path: '/ebiz-employee-info',
222
+ name: 'EbizEmployeeInfo',
223
+ component: () => import('../views/EbizEmployeeInfo.vue'),
224
+ meta: { title: 'Ebiz员工信息组件示例' }
225
+ },
226
+ {
227
+ path: '/tdesign-alert',
228
+ name: 'TdesignAlert',
229
+ component: () => import('../views/TdesignAlert.vue'),
230
+ meta: { title: 'TDesign提示组件示例' }
231
+ },
232
+ {
233
+ path: '/tdesign-dialog',
234
+ name: 'TdesignDialog',
235
+ component: () => import('../views/DialogDemo.vue'),
236
+ meta: { title: 'TDesign对话框组件示例' }
189
237
  }
190
238
  ]
191
239
 
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <div class="dialog-demo">
3
+ <h1>TDesign Dialog 组件示例</h1>
4
+
5
+ <h2>基础对话框</h2>
6
+ <div class="demo-section">
7
+ <EbizButton theme="primary" @click="showBasicDialog = true">打开基础对话框</EbizButton>
8
+ <EbizDialog v-model:visible="showBasicDialog" header="基础对话框" :body="'这是一个基础对话框,用于展示简单的信息或进行简单的操作。'"
9
+ :confirm-btn="{ content: '确认', theme: 'primary' }" cancel-btn="取消" />
10
+ </div>
11
+
12
+ <h2>不同模式的对话框</h2>
13
+ <div class="demo-section">
14
+ <EbizButton @click="showModalDialog = true" style="margin-right: 16px;">模态对话框</EbizButton>
15
+ <EbizButton @click="showModelessDialog = true" style="margin-right: 16px;">非模态对话框</EbizButton>
16
+ <EbizButton @click="showFullscreenDialog = true">全屏对话框</EbizButton>
17
+
18
+ <!-- 模态对话框 -->
19
+ <EbizDialog v-model:visible="showModalDialog" header="模态对话框" mode="modal" :body="'模态对话框会阻止用户与页面的其他部分交互,直到对话框关闭。'"
20
+ :confirm-btn="{ content: '确认', theme: 'primary' }" cancel-btn="取消" />
21
+
22
+ <!-- 非模态对话框 -->
23
+ <EbizDialog v-model:visible="showModelessDialog" header="非模态对话框" mode="modeless"
24
+ :body="'非模态对话框不会阻止用户与页面的其他部分交互,可以同时进行其他操作。'" :confirm-btn="{ content: '确认', theme: 'primary' }"
25
+ cancel-btn="取消" />
26
+
27
+ <!-- 全屏对话框 -->
28
+ <EbizDialog v-model:visible="showFullscreenDialog" header="全屏对话框" mode="full-screen"
29
+ :body="'全屏对话框会占据整个屏幕,通常用于需要用户完全专注于某项任务的场景。'" :confirm-btn="{ content: '确认', theme: 'primary' }"
30
+ cancel-btn="取消" />
31
+ </div>
32
+
33
+ <h2>自定义内容的对话框</h2>
34
+ <div class="demo-section">
35
+ <EbizButton @click="showCustomDialog = true">打开自定义内容对话框</EbizButton>
36
+ <EbizDialog v-model:visible="showCustomDialog" header="自定义内容" :width="500">
37
+ <template #body>
38
+ <div style="padding: 20px;">
39
+ <h3>这是自定义的内容区域</h3>
40
+ <p>可以在这里放置任何你想要展示的内容,包括表单、图表、列表等。</p>
41
+ <div style="margin-top: 20px;">
42
+ <EbizTdesignInput v-model="customInput" placeholder="请输入内容" />
43
+ </div>
44
+ </div>
45
+ </template>
46
+ <template #footer>
47
+ <div style="display: flex; justify-content: flex-end;">
48
+ <EbizButton @click="showCustomDialog = false" style="margin-right: 8px;">取消</EbizButton>
49
+ <EbizButton theme="primary" @click="handleCustomConfirm">确认</EbizButton>
50
+ </div>
51
+ </template>
52
+ </EbizDialog>
53
+ </div>
54
+
55
+ <h2>可拖拽的对话框</h2>
56
+ <div class="demo-section">
57
+ <EbizButton @click="showDraggableDialog = true">打开可拖拽对话框</EbizButton>
58
+ <EbizDialog v-model:visible="showDraggableDialog" header="可拖拽对话框" :draggable="true" :body="'这个对话框可以通过拖拽标题栏进行移动。'"
59
+ :confirm-btn="{ content: '确认', theme: 'primary' }" cancel-btn="取消" />
60
+ </div>
61
+
62
+ <h2>不同位置的对话框</h2>
63
+ <div class="demo-section">
64
+ <EbizButton @click="showTopDialog = true" style="margin-right: 16px;">顶部对话框</EbizButton>
65
+ <EbizButton @click="showCenterDialog = true">居中对话框</EbizButton>
66
+
67
+ <!-- 顶部对话框 -->
68
+ <EbizDialog v-model:visible="showTopDialog" header="顶部对话框" placement="top" :body="'这个对话框位于顶部。'"
69
+ :confirm-btn="{ content: '确认', theme: 'primary' }" cancel-btn="取消" />
70
+
71
+ <!-- 居中对话框 -->
72
+ <EbizDialog v-model:visible="showCenterDialog" header="居中对话框" placement="center" :body="'这个对话框位于页面中央。'"
73
+ :confirm-btn="{ content: '确认', theme: 'primary' }" cancel-btn="取消" />
74
+ </div>
75
+ </div>
76
+ </template>
77
+
78
+ <script setup>
79
+ import { ref } from 'vue';
80
+ import { EbizDialog, EbizButton, EbizTdesignInput } from '../index.js';
81
+
82
+ // 基础对话框
83
+ const showBasicDialog = ref(false);
84
+
85
+ // 不同模式的对话框
86
+ const showModalDialog = ref(false);
87
+ const showModelessDialog = ref(false);
88
+ const showFullscreenDialog = ref(false);
89
+
90
+ // 自定义内容的对话框
91
+ const showCustomDialog = ref(false);
92
+ const customInput = ref('');
93
+
94
+ // 可拖拽的对话框
95
+ const showDraggableDialog = ref(false);
96
+
97
+ // 不同位置的对话框
98
+ const showTopDialog = ref(false);
99
+ const showCenterDialog = ref(false);
100
+
101
+ // 自定义确认处理函数
102
+ const handleCustomConfirm = () => {
103
+ // 在实际应用中,这里可以添加表单验证或数据处理逻辑
104
+ console.log('自定义确认按钮点击,输入内容:', customInput.value);
105
+ showCustomDialog.value = false;
106
+ };
107
+ </script>
108
+
109
+ <style lang="less" scoped>
110
+ .dialog-demo {
111
+ padding: 20px;
112
+
113
+ h1 {
114
+ margin-bottom: 20px;
115
+ }
116
+
117
+ h2 {
118
+ margin-top: 30px;
119
+ margin-bottom: 16px;
120
+ }
121
+
122
+ .demo-section {
123
+ margin-bottom: 24px;
124
+ }
125
+ }
126
+ </style>
@@ -0,0 +1,224 @@
1
+ <template>
2
+ <div class="container">
3
+ <h1>EbizAvatar 头像组件示例</h1>
4
+
5
+ <div class="section">
6
+ <h2>基础用法</h2>
7
+ <div class="example-block">
8
+ <ebiz-avatar content="用户" />
9
+ </div>
10
+ <div class="code-block">
11
+ <pre><code>&lt;ebiz-avatar content="用户" /&gt;</code></pre>
12
+ </div>
13
+ </div>
14
+
15
+ <div class="section">
16
+ <h2>不同形状</h2>
17
+ <div class="example-block avatar-shape-container">
18
+ <div v-for="shape in shapeList" :key="shape" class="avatar-shape-item">
19
+ <ebiz-avatar
20
+ content="用户"
21
+ :shape="shape"
22
+ />
23
+ <div class="avatar-shape-text">shape: {{ shape }}</div>
24
+ </div>
25
+ </div>
26
+ <div class="code-block">
27
+ <pre><code>// 可选值: circle(默认), round
28
+ &lt;ebiz-avatar
29
+ content="用户"
30
+ shape="round"
31
+ /&gt;</code></pre>
32
+ </div>
33
+ </div>
34
+
35
+ <div class="section">
36
+ <h2>不同尺寸</h2>
37
+ <div class="example-block avatar-size-container">
38
+ <div v-for="size in sizeList" :key="size" class="avatar-size-item">
39
+ <ebiz-avatar
40
+ content="用户"
41
+ :size="size"
42
+ />
43
+ <div class="avatar-size-text">size: {{ size }}</div>
44
+ </div>
45
+ </div>
46
+ <div class="code-block">
47
+ <pre><code>// 可选值: small, medium(默认), large
48
+ &lt;ebiz-avatar
49
+ content="用户"
50
+ size="large"
51
+ /&gt;</code></pre>
52
+ </div>
53
+ </div>
54
+
55
+ <div class="section">
56
+ <h2>图片头像</h2>
57
+ <div class="example-block">
58
+ <ebiz-avatar
59
+ image="https://tdesign.tencent.com/vue-next/assets/image1.jpg"
60
+ alt="用户头像"
61
+ />
62
+ </div>
63
+ <div class="code-block">
64
+ <pre><code>&lt;ebiz-avatar
65
+ image="https://tdesign.tencent.com/vue-next/assets/image1.jpg"
66
+ alt="用户头像"
67
+ /&gt;</code></pre>
68
+ </div>
69
+ </div>
70
+
71
+ <div class="section">
72
+ <h2>自定义尺寸</h2>
73
+ <div class="example-block">
74
+ <ebiz-avatar
75
+ content="用户"
76
+ width="100px"
77
+ height="100px"
78
+ />
79
+ </div>
80
+ <div class="code-block">
81
+ <pre><code>&lt;ebiz-avatar
82
+ content="用户"
83
+ width="100px"
84
+ height="100px"
85
+ /&gt;</code></pre>
86
+ </div>
87
+ </div>
88
+
89
+ <div class="section">
90
+ <h2>带徽标的头像</h2>
91
+ <div class="example-block">
92
+ <ebiz-avatar
93
+ content="用户"
94
+ :badge-props="{ count: 5 }"
95
+ />
96
+ </div>
97
+ <div class="code-block">
98
+ <pre><code>&lt;ebiz-avatar
99
+ content="用户"
100
+ :badge-props="{ count: 5 }"
101
+ /&gt;</code></pre>
102
+ </div>
103
+ </div>
104
+
105
+ <div class="section">
106
+ <h2>图标头像</h2>
107
+ <div class="example-block">
108
+ <ebiz-avatar>
109
+ <template #icon>
110
+ <t-icon name="user" />
111
+ </template>
112
+ </ebiz-avatar>
113
+ </div>
114
+ <div class="code-block">
115
+ <pre><code>&lt;ebiz-avatar&gt;
116
+ &lt;template #icon&gt;
117
+ &lt;t-icon name="user" /&gt;
118
+ &lt;/template&gt;
119
+ &lt;/ebiz-avatar&gt;</code></pre>
120
+ </div>
121
+ </div>
122
+
123
+ <div class="section">
124
+ <h2>图片加载失败处理</h2>
125
+ <div class="example-block">
126
+ <ebiz-avatar
127
+ image="https://non-existent-image.jpg"
128
+ content="用户"
129
+ :hide-on-load-error="false"
130
+ @error="handleError"
131
+ />
132
+ </div>
133
+ <div class="code-block">
134
+ <pre><code>&lt;ebiz-avatar
135
+ image="https://non-existent-image.jpg"
136
+ content="用户"
137
+ :hide-on-load-error="false"
138
+ @error="handleError"
139
+ /&gt;</code></pre>
140
+ </div>
141
+ </div>
142
+ </div>
143
+ </template>
144
+
145
+ <script>
146
+ import { EbizAvatar } from '../index.js'
147
+ import { Icon as TIcon } from 'tdesign-vue-next'
148
+
149
+ export default {
150
+ name: 'EbizAvatarDemo',
151
+ components: {
152
+ EbizAvatar,
153
+ TIcon
154
+ },
155
+ data() {
156
+ return {
157
+ shapeList: ['circle', 'round'],
158
+ sizeList: ['small', 'medium', 'large']
159
+ }
160
+ },
161
+ methods: {
162
+ handleError(context) {
163
+ console.log('图片加载失败', context)
164
+ }
165
+ }
166
+ }
167
+ </script>
168
+
169
+ <style lang="less" scoped>
170
+ .container {
171
+ padding: 20px;
172
+
173
+ h1 {
174
+ margin-bottom: 20px;
175
+ }
176
+
177
+ .section {
178
+ margin-bottom: 30px;
179
+
180
+ h2 {
181
+ margin-bottom: 15px;
182
+ }
183
+
184
+ .example-block {
185
+ margin-bottom: 15px;
186
+ padding: 20px;
187
+ border: 1px solid #eee;
188
+ border-radius: 4px;
189
+ }
190
+
191
+ .code-block {
192
+ background-color: #f5f5f5;
193
+ padding: 15px;
194
+ border-radius: 4px;
195
+
196
+ pre {
197
+ margin: 0;
198
+ white-space: pre-wrap;
199
+ }
200
+ }
201
+ }
202
+
203
+ .avatar-shape-container,
204
+ .avatar-size-container {
205
+ display: flex;
206
+ flex-wrap: wrap;
207
+ gap: 20px;
208
+ }
209
+
210
+ .avatar-shape-item,
211
+ .avatar-size-item {
212
+ display: flex;
213
+ flex-direction: column;
214
+ align-items: center;
215
+ }
216
+
217
+ .avatar-shape-text,
218
+ .avatar-size-text {
219
+ margin-top: 10px;
220
+ font-size: 14px;
221
+ color: #666;
222
+ }
223
+ }
224
+ </style>