@ebiz/designer-components 0.0.18-tj.1 → 0.0.19-beta.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.
Files changed (70) hide show
  1. package/dist/designer-components.css +1 -1
  2. package/dist/index.mjs +66100 -52710
  3. package/package.json +1 -1
  4. package/src/apiService/mockDataService.js +116 -0
  5. package/src/apiService/simpleDataService.js +186 -80
  6. package/src/components/Button.vue +72 -22
  7. package/src/components/EbizAvatar.vue +116 -0
  8. package/src/components/EbizCheckbox.vue +94 -0
  9. package/src/components/EbizCheckboxGroup.vue +70 -0
  10. package/src/components/EbizDetailBlock.vue +82 -0
  11. package/src/components/EbizDialog.vue +249 -0
  12. package/src/components/EbizEmployeeInfo.vue +139 -0
  13. package/src/components/EbizPageHeader.vue +96 -0
  14. package/src/components/EbizPagination.vue +163 -0
  15. package/src/components/EbizRadio.vue +87 -0
  16. package/src/components/EbizRadioGroup.vue +84 -0
  17. package/src/components/EbizRemoteSelect.vue +107 -41
  18. package/src/components/EbizStatistic.vue +150 -0
  19. package/src/components/EbizSwiper.vue +3 -3
  20. package/src/components/EbizSwitch.vue +86 -0
  21. package/src/components/EbizTabHeader.vue +6 -10
  22. package/src/components/EbizTabPanel.vue +23 -0
  23. package/src/components/EbizTable.vue +466 -0
  24. package/src/components/EbizTableColumn.vue +117 -0
  25. package/src/components/EbizTableSort.vue +181 -0
  26. package/src/components/EbizTabs.vue +143 -0
  27. package/src/components/EbizTimePicker.vue +144 -0
  28. package/src/components/EbizTitle.vue +36 -37
  29. package/src/components/EbizTree.vue +153 -0
  30. package/src/components/EbizTreeSelector.vue +418 -0
  31. package/src/components/TdesignAlert.vue +116 -0
  32. package/src/components/TdesignCalendar/index.vue +6 -3
  33. package/src/components/TdesignCol.vue +102 -0
  34. package/src/components/TdesignDialog.vue +226 -0
  35. package/src/components/TdesignGrid.vue +56 -0
  36. package/src/components/TdesignInput.vue +23 -23
  37. package/src/components/TdesignTextarea.vue +143 -0
  38. package/src/components/TdesignTimeline.vue +58 -0
  39. package/src/components/TdesignTimelineItem.vue +72 -0
  40. package/src/components/TdesignUpload.vue +757 -0
  41. package/src/components/TdesignWatermark.vue +108 -0
  42. package/src/index.js +85 -0
  43. package/src/main.js +2 -2
  44. package/src/router/index.js +160 -5
  45. package/src/views/Button.vue +7 -3
  46. package/src/views/CheckboxDemo.vue +105 -0
  47. package/src/views/DialogDemo.vue +126 -0
  48. package/src/views/EbizAvatar.vue +224 -0
  49. package/src/views/EbizDetailBlockDemo.vue +31 -0
  50. package/src/views/EbizEmployeeInfo.vue +250 -0
  51. package/src/views/EbizRadioDemo.vue +152 -0
  52. package/src/views/GridDemo.vue +239 -0
  53. package/src/views/Home.vue +49 -2
  54. package/src/views/PageHeaderDemo.vue +105 -0
  55. package/src/views/PaginationDemo.vue +97 -0
  56. package/src/views/RemoteSelect.vue +336 -5
  57. package/src/views/StatisticDemo.vue +191 -0
  58. package/src/views/SwitchDemo.vue +80 -0
  59. package/src/views/TableDemo.vue +335 -0
  60. package/src/views/TableSortDemo.vue +144 -0
  61. package/src/views/TableView.vue +69 -0
  62. package/src/views/TabsDemo.vue +283 -0
  63. package/src/views/TdesignAlert.vue +99 -0
  64. package/src/views/TextareaDemo.vue +94 -0
  65. package/src/views/TimePickerDemo.vue +147 -0
  66. package/src/views/TimelineDemo.vue +161 -0
  67. package/src/views/TreeDemo.vue +255 -0
  68. package/src/views/TreeSelectorDemo.vue +246 -0
  69. package/src/views/UploadDemo.vue +122 -0
  70. package/src/views/WatermarkDemo.vue +86 -0
@@ -0,0 +1,108 @@
1
+ <template>
2
+ <t-watermark
3
+ :alpha="alpha"
4
+ :watermark-content="watermarkContent"
5
+ :width="width"
6
+ :height="height"
7
+ :x="x"
8
+ :y="y"
9
+ :rotate="rotate"
10
+ :zIndex="zIndex"
11
+ :isRepeat="isRepeat"
12
+ :movable="movable"
13
+ :gapX="gapX"
14
+ :gapY="gapY"
15
+ :offset="offset"
16
+ :lineSpace="lineSpace"
17
+ >
18
+ <slot></slot>
19
+ </t-watermark>
20
+ </template>
21
+
22
+ <script>
23
+ export default {
24
+ name: "EbizWatermark"
25
+ }
26
+ </script>
27
+
28
+ <script setup>
29
+ import { defineProps } from 'vue';
30
+ import { Watermark as TWatermark } from 'tdesign-vue-next';
31
+
32
+ defineProps({
33
+ // 水印透明度
34
+ alpha: {
35
+ type: Number,
36
+ default: 1
37
+ },
38
+ // 水印内容
39
+ watermarkContent: {
40
+ type: [String, Object],
41
+ default: () => ({ text: '' })
42
+ },
43
+ // 水印宽度
44
+ width: {
45
+ type: Number,
46
+ default: 120
47
+ },
48
+ // 水印高度
49
+ height: {
50
+ type: Number,
51
+ default: 64
52
+ },
53
+ // 水印x轴偏移量
54
+ x: {
55
+ type: Number,
56
+ default: 0
57
+ },
58
+ // 水印y轴偏移量
59
+ y: {
60
+ type: Number,
61
+ default: 0
62
+ },
63
+ // 水印旋转角度
64
+ rotate: {
65
+ type: Number,
66
+ default: -22
67
+ },
68
+ // 水印层级
69
+ zIndex: {
70
+ type: Number,
71
+ default: 9
72
+ },
73
+ // 水印是否重复铺满整个页面
74
+ isRepeat: {
75
+ type: Boolean,
76
+ default: true
77
+ },
78
+ // 水印是否可移动
79
+ movable: {
80
+ type: Boolean,
81
+ default: false
82
+ },
83
+ // 水印之间的水平间距
84
+ gapX: {
85
+ type: Number,
86
+ default: 212
87
+ },
88
+ // 水印之间的垂直间距
89
+ gapY: {
90
+ type: Number,
91
+ default: 222
92
+ },
93
+ // 水印整体的偏移量
94
+ offset: {
95
+ type: Array,
96
+ default: () => [0, 0]
97
+ },
98
+ // 多行水印的行间距
99
+ lineSpace: {
100
+ type: Number,
101
+ default: 16
102
+ }
103
+ });
104
+ </script>
105
+
106
+ <style lang="less" scoped>
107
+ /* 自定义样式 */
108
+ </style>
package/src/index.js CHANGED
@@ -22,6 +22,7 @@ import EbizMindmap from "./components/EbizMindmap/index.vue";
22
22
  import EbizRouteBreadcrumb from "./components/EbizRouteBreadcrumb.vue";
23
23
  import EbizFileUpload from "./components/EbizFileUpload.vue";
24
24
  import EbizTabHeader from "./components/EbizTabHeader.vue";
25
+ import EbizPageHeader from "./components/EbizPageHeader.vue";
25
26
  import TdesignCalendar from "./components/TdesignCalendar/index.vue";
26
27
  import TdesignCollapse from "./components/TdesignCollapse.vue";
27
28
  import TdesignCollapsePanel from "./components/TdesignCollapsePanel.vue";
@@ -29,6 +30,32 @@ import EbizTag from "./components/TdesignTag.vue";
29
30
  import EbizSwiper from "./components/EbizSwiper.vue";
30
31
  import EbizSwiperItem from "./components/EbizSwiperItem.vue";
31
32
  import EbizSpace from "./components/EbizSpace.vue";
33
+ import EbizPagination from "./components/EbizPagination.vue";
34
+ import EbizCheckbox from "./components/EbizCheckbox.vue";
35
+ import EbizCheckboxGroup from "./components/EbizCheckboxGroup.vue";
36
+ import EbizRadio from "./components/EbizRadio.vue";
37
+ import EbizRadioGroup from "./components/EbizRadioGroup.vue";
38
+ import EbizSwitch from "./components/EbizSwitch.vue";
39
+ import EbizTextarea from "./components/TdesignTextarea.vue";
40
+ import EbizUpload from "./components/TdesignUpload.vue";
41
+ import EbizGrid from "./components/TdesignGrid.vue";
42
+ import EbizCol from "./components/TdesignCol.vue";
43
+ import EbizTabs from "./components/EbizTabs.vue";
44
+ import EbizTabPanel from "./components/EbizTabPanel.vue";
45
+ import EbizStatistic from "./components/EbizStatistic.vue";
46
+ import EbizWatermark from "./components/TdesignWatermark.vue";
47
+ import EbizAvatar from "./components/EbizAvatar.vue";
48
+ import EbizEmployeeInfo from "./components/EbizEmployeeInfo.vue";
49
+ import EbizAlert from "./components/TdesignAlert.vue";
50
+ import EbizDialog from "./components/TdesignDialog.vue";
51
+ import EbizTable from "./components/EbizTable.vue";
52
+ import EbizTableColumn from './components/EbizTableColumn.vue';
53
+ import EbizTableSort from './components/EbizTableSort.vue';
54
+ import EbizDetailBlock from './components/EbizDetailBlock.vue';
55
+ import EbizTree from './components/EbizTree.vue';
56
+ import EbizTreeSelector from './components/EbizTreeSelector.vue';
57
+ import EbizTimePicker from './components/EbizTimePicker.vue';
58
+ import { MessagePlugin as EbizMessage } from 'tdesign-vue-next';
32
59
 
33
60
  // 导入简洁数据服务
34
61
  import dataService from "./apiService/simpleDataService";
@@ -38,6 +65,10 @@ import "tdesign-vue-next/es/style/index.css";
38
65
  // 导入图表样式
39
66
  import "./assets/styles/charts/main.less";
40
67
 
68
+ // 时间轴组件
69
+ import EbizTimeline from "./components/TdesignTimeline.vue";
70
+ import {TimelineItem as EbizTimelineItem} from 'tdesign-vue-next';
71
+
41
72
  // 导出组件
42
73
  export {
43
74
  MyComponent,
@@ -62,6 +93,8 @@ export {
62
93
  EbizRemoteSelect,
63
94
  EbizRouteBreadcrumb,
64
95
  EbizTabHeader,
96
+ // 页面头部组件
97
+ EbizPageHeader,
65
98
  // 思维导图
66
99
  EbizMindmap,
67
100
  // 文件上传组件
@@ -79,6 +112,58 @@ export {
79
112
  EbizSwiperItem,
80
113
  // 间距组件
81
114
  EbizSpace,
115
+ // 分页组件
116
+ EbizPagination,
117
+ // 多选框组件
118
+ EbizCheckbox,
119
+ // 多选框组组件
120
+ EbizCheckboxGroup,
82
121
  // 数据服务
83
122
  dataService,
123
+ // 新增 EbizRadio 和 EbizRadioGroup
124
+ EbizRadio,
125
+ EbizRadioGroup,
126
+ // 开关组件
127
+ EbizSwitch,
128
+ // 多行文本框组件
129
+ EbizTextarea,
130
+ // TDesign上传组件
131
+ EbizUpload,
132
+ // 栅格布局组件
133
+ EbizGrid,
134
+ // 栅格列组件
135
+ EbizCol,
136
+ // 选项卡组件
137
+ EbizTabs,
138
+ // 选项卡面板组件
139
+ EbizTabPanel,
140
+ // 统计数值组件
141
+ EbizStatistic,
142
+ // 消息插件
143
+ EbizMessage,
144
+ // 时间轴组件
145
+ EbizTimeline,
146
+ EbizTimelineItem,
147
+ // 水印组件
148
+ EbizWatermark,
149
+ // 头像组件
150
+ EbizAvatar,
151
+ // 员工信息组件
152
+ EbizEmployeeInfo,
153
+ // 提示组件
154
+ EbizAlert,
155
+ // 对话框组件
156
+ EbizDialog,
157
+ // 表格组件
158
+ EbizTable,
159
+ EbizTableColumn,
160
+ // 表格排序组件
161
+ EbizTableSort,
162
+ // 详情块组件
163
+ EbizDetailBlock,
164
+ // 树组件
165
+ EbizTree,
166
+ EbizTreeSelector,
167
+ // 时间选择器组件
168
+ EbizTimePicker
84
169
  };
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
 
@@ -1,10 +1,13 @@
1
1
  import { createRouter, createWebHistory } from 'vue-router'
2
+ import Home from '../views/Home.vue'
3
+ import ButtonView from '../views/Button.vue'
4
+ import TableView from '../views/TableView.vue'
2
5
 
3
6
  const routes = [
4
7
  {
5
8
  path: '/',
6
9
  name: 'Home',
7
- component: () => import('../views/Home.vue'),
10
+ component: Home,
8
11
  meta: { title: '首页' }
9
12
  },
10
13
  {
@@ -15,10 +18,16 @@ const routes = [
15
18
  },
16
19
  {
17
20
  path: '/table',
18
- name: 'Table',
19
- component: () => import('../views/Table.vue'),
21
+ name: 'table',
22
+ component: TableView,
20
23
  meta: { title: '表格组件示例' }
21
24
  },
25
+ {
26
+ path: '/table-column',
27
+ name: 'table-column',
28
+ component: TableView,
29
+ meta: { title: '表格列组件示例' }
30
+ },
22
31
  {
23
32
  path: '/form',
24
33
  name: 'Form',
@@ -27,8 +36,8 @@ const routes = [
27
36
  },
28
37
  {
29
38
  path: '/button',
30
- name: 'Button',
31
- component: () => import('../views/Button.vue'),
39
+ name: 'button',
40
+ component: ButtonView,
32
41
  meta: { title: '按钮组件示例' }
33
42
  },
34
43
  {
@@ -144,6 +153,152 @@ const routes = [
144
153
  name: 'EbizSpace',
145
154
  component: () => import('../views/EbizSpace.vue'),
146
155
  meta: { title: 'Ebiz间距组件示例' }
156
+ },
157
+ {
158
+ path: '/pagination',
159
+ name: 'Pagination',
160
+ component: () => import('../views/PaginationDemo.vue'),
161
+ meta: { title: 'EbizPagination分页组件示例' }
162
+ },
163
+ {
164
+ path: '/checkbox',
165
+ name: 'Checkbox',
166
+ component: () => import('../views/CheckboxDemo.vue'),
167
+ meta: { title: 'Ebiz多选框组件示例' }
168
+ },
169
+ {
170
+ path: '/radio',
171
+ name: 'Radio',
172
+ component: () => import('../views/EbizRadioDemo.vue'),
173
+ meta: { title: 'Ebiz单选框组件示例' }
174
+ },
175
+ {
176
+ path: '/switch',
177
+ name: 'Switch',
178
+ component: () => import('../views/SwitchDemo.vue'),
179
+ meta: { title: 'Ebiz开关组件示例' }
180
+ },
181
+ {
182
+ path: '/textarea',
183
+ name: 'Textarea',
184
+ component: () => import('../views/TextareaDemo.vue'),
185
+ meta: { title: 'Ebiz多行文本框组件示例' }
186
+ },
187
+ {
188
+ path: '/upload',
189
+ name: 'Upload',
190
+ component: () => import('../views/UploadDemo.vue'),
191
+ meta: { title: 'TDesign上传组件示例' }
192
+ },
193
+ {
194
+ path: '/grid',
195
+ name: 'Grid',
196
+ component: () => import('../views/GridDemo.vue'),
197
+ meta: { title: 'TDesign栅格组件示例' }
198
+ },
199
+ {
200
+ path: '/tabs',
201
+ name: 'Tabs',
202
+ component: () => import('../views/TabsDemo.vue'),
203
+ meta: { title: 'Ebiz选项卡组件示例' }
204
+ },
205
+ {
206
+ path: '/statistic',
207
+ name: 'Statistic',
208
+ component: () => import('../views/StatisticDemo.vue'),
209
+ meta: { title: 'Ebiz统计数值组件示例' }
210
+ },
211
+ {
212
+ path: '/timeline',
213
+ name: 'Timeline',
214
+ component: () => import('../views/TimelineDemo.vue'),
215
+ meta: { title: 'Ebiz时间轴组件示例' }
216
+ },
217
+ {
218
+ path: '/watermark',
219
+ name: 'Watermark',
220
+ component: () => import('../views/WatermarkDemo.vue'),
221
+ meta: { title: 'TDesign水印组件示例' }
222
+ },
223
+ {
224
+ path: '/ebiz-avatar',
225
+ name: 'EbizAvatar',
226
+ component: () => import('../views/EbizAvatar.vue'),
227
+ meta: { title: 'Ebiz头像组件示例' }
228
+ },
229
+ {
230
+ path: '/ebiz-employee-info',
231
+ name: 'EbizEmployeeInfo',
232
+ component: () => import('../views/EbizEmployeeInfo.vue'),
233
+ meta: { title: 'Ebiz员工信息组件示例' }
234
+ },
235
+ {
236
+ path: '/tdesign-alert',
237
+ name: 'TdesignAlert',
238
+ component: () => import('../views/TdesignAlert.vue'),
239
+ meta: { title: 'TDesign提示组件示例' }
240
+ },
241
+ {
242
+ path: '/tdesign-dialog',
243
+ name: 'TdesignDialog',
244
+ component: () => import('../views/DialogDemo.vue'),
245
+ meta: { title: 'TDesign对话框组件示例' }
246
+ },
247
+ {
248
+ path: '/page-header',
249
+ name: 'PageHeader',
250
+ component: () => import('../views/PageHeaderDemo.vue'),
251
+ meta: { title: 'Ebiz页面头部组件示例', icon: 'header' }
252
+ },
253
+ {
254
+ path: '/table-demo',
255
+ name: 'TableDemo',
256
+ component: () => import('../views/TableDemo.vue'),
257
+ meta: { title: 'Ebiz表格组件示例' }
258
+ },
259
+ {
260
+ path: '/table-sort',
261
+ name: 'TableSort',
262
+ component: () => import('../views/TableSortDemo.vue'),
263
+ meta: { title: 'Ebiz表格排序组件示例' }
264
+ },
265
+ {
266
+ path: '/ebiz-detail-block',
267
+ name: 'EbizDetailBlock',
268
+ component: () => import('../views/EbizDetailBlockDemo.vue'),
269
+ meta: { title: 'Ebiz详情块组件示例' }
270
+ },
271
+ {
272
+ path: '/tree',
273
+ name: 'Tree',
274
+ component: () => import('../views/TreeDemo.vue'),
275
+ meta: { title: 'Ebiz树组件示例' }
276
+ },
277
+ {
278
+ path: '/tree-demo',
279
+ name: 'TreeDemo',
280
+ component: () => import('../views/TreeDemo.vue'),
281
+ meta: { title: 'Ebiz树组件示例' }
282
+ },
283
+ {
284
+ path: '/tree-selector-demo',
285
+ name: 'TreeSelectorDemo',
286
+ component: () => import('../views/TreeSelectorDemo.vue'),
287
+ meta: {
288
+ title: '树形选择器'
289
+ }
290
+ },
291
+ {
292
+ path: '/tree-selector',
293
+ name: 'TreeSelector',
294
+ component: () => import('../views/TreeSelectorDemo.vue'),
295
+ meta: { title: '树选择器组件示例' }
296
+ },
297
+ {
298
+ path: '/time-picker',
299
+ name: 'TimePicker',
300
+ component: () => import('../views/TimePickerDemo.vue'),
301
+ meta: { title: '时间选择器组件示例' }
147
302
  }
148
303
  ]
149
304
 
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
3
  <ebiz-route-breadcrumb />
4
- <ebiz-button />
4
+ <ebiz-button :text="测试" :apiConfig="{ apiId: 802, apiType: 5 }" @prepare="onPrepare" />
5
5
  </div>
6
6
  </template>
7
7
 
@@ -12,9 +12,13 @@ export default {
12
12
  name: 'ButtonDemo',
13
13
  components: {
14
14
  EbizButton
15
+ },
16
+ methods: {
17
+ onPrepare() {
18
+
19
+ }
15
20
  }
16
21
  }
17
22
  </script>
18
23
 
19
- <style scoped>
20
- </style>
24
+ <style scoped></style>
@@ -0,0 +1,105 @@
1
+ <template>
2
+ <div class="checkbox-demo">
3
+ <h2>多选框组件示例</h2>
4
+
5
+ <h3>基础多选框</h3>
6
+ <div class="demo-section">
7
+ <EbizCheckbox>未选中项</EbizCheckbox>
8
+ <EbizCheckbox v-model="checkbox1">选中项</EbizCheckbox>
9
+ <EbizCheckbox :disabled="true">未选禁用项</EbizCheckbox>
10
+ <EbizCheckbox v-model="checkboxDisabled" :disabled="true">选中禁用项</EbizCheckbox>
11
+ </div>
12
+
13
+ <h3>半选状态</h3>
14
+ <div class="demo-section">
15
+ <EbizCheckbox :indeterminate="true">半选状态</EbizCheckbox>
16
+ </div>
17
+
18
+ <h3>多选框组</h3>
19
+ <div class="demo-section">
20
+ <p>选中值:{{ groupValue }}</p>
21
+ <EbizCheckboxGroup v-model="groupValue" :options="options" @change="onGroupChange" />
22
+ </div>
23
+
24
+ <h3>全选功能</h3>
25
+ <div class="demo-section">
26
+ <p>选中值:{{ allCheckValue }}</p>
27
+ <EbizCheckboxGroup v-model="allCheckValue">
28
+ <EbizCheckbox :check-all="true" @change="onCheckAllChange">全选</EbizCheckbox>
29
+ <EbizCheckbox value="1">选项一</EbizCheckbox>
30
+ <EbizCheckbox value="2">选项二</EbizCheckbox>
31
+ <EbizCheckbox value="3">选项三</EbizCheckbox>
32
+ </EbizCheckboxGroup>
33
+ </div>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ export default {
39
+ name: "CheckboxDemo"
40
+ }
41
+ </script>
42
+
43
+ <script setup>
44
+ import { ref } from 'vue';
45
+ import { EbizCheckbox, EbizCheckboxGroup } from '../index.js';
46
+
47
+ // 单个多选框状态
48
+ const checkbox1 = ref(true);
49
+ const checkboxDisabled = ref(true);
50
+
51
+ // 多选框组的值
52
+ const groupValue = ref(['option1']);
53
+
54
+ // 多选框组的配置选项
55
+ const options = [
56
+ { label: '选项一', value: 'option1' },
57
+ { label: '选项二', value: 'option2' },
58
+ { label: '选项三', value: 'option3', disabled: true }
59
+ ];
60
+
61
+ // 多选框组的值变化事件
62
+ const onGroupChange = (value, context) => {
63
+ console.log('选中值变化:', value);
64
+ console.log('上下文信息:', context);
65
+ };
66
+
67
+ // 全选功能的值
68
+ const allCheckValue = ref(['1']);
69
+
70
+ // 全选状态变化事件
71
+ const onCheckAllChange = (checked) => {
72
+ if (checked) {
73
+ allCheckValue.value = ['1', '2', '3'];
74
+ } else {
75
+ allCheckValue.value = [];
76
+ }
77
+ };
78
+ </script>
79
+
80
+ <style lang="less" scoped>
81
+ .checkbox-demo {
82
+ padding: 20px;
83
+
84
+ h2 {
85
+ margin-bottom: 20px;
86
+ font-size: 24px;
87
+ }
88
+
89
+ h3 {
90
+ margin: 20px 0 10px;
91
+ font-size: 18px;
92
+ }
93
+
94
+ .demo-section {
95
+ padding: 16px;
96
+ margin-bottom: 16px;
97
+ border: 1px solid #eee;
98
+ border-radius: 4px;
99
+
100
+ .t-checkbox {
101
+ margin-right: 16px;
102
+ }
103
+ }
104
+ }
105
+ </style>
@@ -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>