@ebiz/designer-components 0.1.124 → 0.1.126
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/README.md +29 -29
- package/dist/designer-components.css +1 -1
- package/dist/index.mjs +35548 -33511
- package/dist/{pdf-C9oIcL2N.js → pdf-KomaE0u5.js} +891 -891
- package/package.json +1 -1
- package/src/App.vue +26 -26
- package/src/apiService/SIMPLE_DATA_SERVICE.md +284 -284
- package/src/apiService/mockDataService.js +115 -115
- package/src/apiService/simpleDataService.js +312 -312
- package/src/assets/base.css +86 -86
- package/src/assets/logo.svg +1 -1
- package/src/components/Button.vue +149 -149
- package/src/components/DataContainer.vue +40 -40
- package/src/components/EbizApproval.vue +366 -366
- package/src/components/EbizApprovalDetail.vue +169 -169
- package/src/components/EbizApprovalForm.vue +534 -534
- package/src/components/EbizApprovalV2.vue +713 -713
- package/src/components/EbizAutoForm.vue +596 -596
- package/src/components/EbizAvatar.vue +115 -115
- package/src/components/EbizCheckbox.vue +93 -93
- package/src/components/EbizCheckboxGroup.vue +69 -69
- package/src/components/EbizDepartmentSelector.vue +148 -148
- package/src/components/EbizDescriptions.vue +340 -340
- package/src/components/EbizDescriptionsItem.vue +47 -47
- package/src/components/EbizDetailBlock.vue +81 -81
- package/src/components/EbizDetailItem.vue +559 -559
- package/src/components/EbizDetailView.md +438 -438
- package/src/components/EbizDetailView.vue +355 -355
- package/src/components/EbizDialog.vue +260 -260
- package/src/components/EbizDictionarySelect.vue +229 -229
- package/src/components/EbizDiv.vue +40 -40
- package/src/components/EbizDivider.vue +96 -96
- package/src/components/EbizDormDashboard.vue +314 -314
- package/src/components/EbizDropdown.vue +135 -135
- package/src/components/EbizDropdownItem.vue +85 -85
- package/src/components/EbizEmployeeInfo.vue +144 -144
- package/src/components/EbizEmployeeSelector.vue +1160 -1160
- package/src/components/EbizFileList.vue +502 -502
- package/src/components/EbizMap.vue +541 -541
- package/src/components/EbizMeetingRoomSelector.vue +1149 -1149
- package/src/components/EbizMobileMeetingRoomSelector.vue +727 -727
- package/src/components/EbizOkrTree.vue +99 -99
- package/src/components/EbizPageHeader.vue +98 -98
- package/src/components/EbizPagination.vue +162 -162
- package/src/components/EbizParkingDashboard.vue +152 -152
- package/src/components/EbizPdfViewer.vue +540 -540
- package/src/components/EbizPopconfirm.vue +47 -47
- package/src/components/EbizQrCode.vue +167 -167
- package/src/components/EbizRadio.vue +86 -86
- package/src/components/EbizRadioGroup.vue +83 -83
- package/src/components/EbizRemoteSelect.vue +232 -232
- package/src/components/EbizRichTextEditor.vue +338 -338
- package/src/components/EbizRouteBreadcrumb.vue +46 -46
- package/src/components/EbizSApprovalProcess.vue +1456 -1426
- package/src/components/EbizSelect.vue +85 -85
- package/src/components/EbizSpace.vue +100 -100
- package/src/components/EbizStatistic.vue +149 -149
- package/src/components/EbizStatsCard.vue +113 -113
- package/src/components/EbizSwiper.vue +113 -113
- package/src/components/EbizSwiperItem.vue +13 -13
- package/src/components/EbizSwitch.vue +85 -85
- package/src/components/EbizTabHeader.vue +132 -132
- package/src/components/EbizTabPanel.vue +22 -22
- package/src/components/EbizTable.vue +469 -469
- package/src/components/EbizTableColumn.vue +116 -116
- package/src/components/EbizTableSort.vue +179 -179
- package/src/components/EbizTabs.vue +142 -142
- package/src/components/EbizTdesignButtonDialog.vue +332 -332
- package/src/components/EbizTdesignLoading.vue +107 -107
- package/src/components/EbizTimePicker.vue +143 -143
- package/src/components/EbizTitle.vue +91 -91
- package/src/components/EbizTree.vue +141 -141
- package/src/components/EbizTreeMergeTable.vue +1494 -1494
- package/src/components/EbizTreeSelector.vue +469 -469
- package/src/components/EbizVideo.vue +553 -553
- package/src/components/EbizVxeTable.vue +290 -290
- package/src/components/Form.vue +28 -28
- package/src/components/Home.vue +7 -7
- package/src/components/LaunchInterview.vue +526 -526
- package/src/components/MyComponent.vue +39 -39
- package/src/components/Table.vue +45 -45
- package/src/components/TdesignAlert.vue +115 -115
- package/src/components/TdesignButton.vue +135 -135
- package/src/components/TdesignCalendar/index.vue +145 -145
- package/src/components/TdesignCard.vue +195 -195
- package/src/components/TdesignCol.vue +101 -101
- package/src/components/TdesignCollapse.vue +142 -142
- package/src/components/TdesignCollapsePanel.vue +79 -79
- package/src/components/TdesignDatePicker.vue +124 -124
- package/src/components/TdesignDescriptions.vue +74 -74
- package/src/components/TdesignDescriptionsItem.vue +50 -50
- package/src/components/TdesignDialog.vue +225 -225
- package/src/components/TdesignForm.vue +138 -138
- package/src/components/TdesignFormItem.vue +105 -105
- package/src/components/TdesignGrid.vue +55 -55
- package/src/components/TdesignIcon.vue +67 -67
- package/src/components/TdesignImage.vue +162 -162
- package/src/components/TdesignImageViewer.vue +200 -200
- package/src/components/TdesignInput.vue +242 -242
- package/src/components/TdesignSelect.vue +446 -446
- package/src/components/TdesignTag.vue +117 -117
- package/src/components/TdesignTextarea.vue +142 -142
- package/src/components/TdesignTimeline.vue +58 -58
- package/src/components/TdesignTimelineItem.vue +71 -71
- package/src/components/TdesignUpload.vue +414 -414
- package/src/components/TdesignWatermark.vue +107 -107
- package/src/components/ebiz-form/components/cascader.vue +61 -61
- package/src/components/ebiz-form/components/checkbox.vue +37 -37
- package/src/components/ebiz-form/components/city.vue +137 -137
- package/src/components/ebiz-form/components/date-panel.vue +52 -52
- package/src/components/ebiz-form/components/date-range-panel.vue +52 -52
- package/src/components/ebiz-form/components/date-range.vue +56 -56
- package/src/components/ebiz-form/components/date.vue +52 -52
- package/src/components/ebiz-form/components/editor-multi-language.vue +47 -47
- package/src/components/ebiz-form/components/editor.vue +78 -78
- package/src/components/ebiz-form/components/file-multi-language.vue +52 -52
- package/src/components/ebiz-form/components/file.vue +149 -149
- package/src/components/ebiz-form/components/images-multi-language.vue +52 -52
- package/src/components/ebiz-form/components/images.vue +129 -129
- package/src/components/ebiz-form/components/img-multi-language.vue +51 -51
- package/src/components/ebiz-form/components/img.vue +129 -129
- package/src/components/ebiz-form/components/number.vue +50 -50
- package/src/components/ebiz-form/components/radio.vue +28 -28
- package/src/components/ebiz-form/components/select.vue +119 -119
- package/src/components/ebiz-form/components/switch.vue +23 -23
- package/src/components/ebiz-form/components/text-multi-language.vue +47 -47
- package/src/components/ebiz-form/components/text.vue +52 -52
- package/src/components/ebiz-form/components/textarea-multi-language.vue +48 -48
- package/src/components/ebiz-form/components/textarea.vue +29 -29
- package/src/components/ebiz-form/components/video-multi-language.vue +51 -51
- package/src/components/ebiz-form/components/video.vue +97 -97
- package/src/components/ebiz-form/index.vue +157 -157
- package/src/components/examples/PopconfirmExample.vue +149 -149
- package/src/components/icons/IconCommunity.vue +7 -7
- package/src/components/icons/IconDocumentation.vue +7 -7
- package/src/components/icons/IconEcosystem.vue +7 -7
- package/src/components/icons/IconSupport.vue +7 -7
- package/src/components/icons/IconTooling.vue +19 -19
- package/src/components/mItems/UserInfo.vue +349 -349
- package/src/components/senior/EbizApprovalList/ApprovalList.vue +127 -127
- package/src/components/senior/EbizSData/index.vue +280 -280
- package/src/components/senior/EbizSDialog/index.vue +776 -776
- package/src/components/senior/EbizSForm/README.md +157 -157
- package/src/components/senior/EbizSForm/index.vue +667 -667
- package/src/components/senior/EbizSForm/item.vue +1011 -1011
- package/src/components/senior/EbizSForm/mItems/DateTimePicker.vue +51 -51
- package/src/components/senior/EbizSForm/mItems/Picker.vue +63 -63
- package/src/index.js +327 -327
- package/src/main.js +55 -55
- package/src/router/index.js +436 -436
- package/src/utils/formatCode.js +24 -24
- package/src/utils/generateImportStatement.js +52 -52
- package/src/utils/hasJsx.js +25 -25
- package/src/utils/index.js +166 -166
- package/src/utils/mergeOptions.js +29 -29
- package/src/utils/parseRequiredBlocks.js +18 -18
- package/src/utils/vue-sfc-validator.js +155 -155
- package/src/views/Button.vue +23 -23
- package/src/views/CheckboxDemo.vue +104 -104
- package/src/views/DataContainer.vue +19 -19
- package/src/views/DialogDemo.vue +125 -125
- package/src/views/EbizApprovalDemo.vue +87 -87
- package/src/views/EbizApprovalFormDemo.vue +207 -207
- package/src/views/EbizAutoFormDemo.vue +129 -129
- package/src/views/EbizAvatar.vue +223 -223
- package/src/views/EbizDepartmentSelectorDemo.vue +169 -169
- package/src/views/EbizDetailBlockDemo.vue +30 -30
- package/src/views/EbizDetailViewDemo.vue +412 -412
- package/src/views/EbizDormDashboardDemo.vue +87 -87
- package/src/views/EbizEmployeeInfo.vue +249 -249
- package/src/views/EbizEmployeeSelector.vue +85 -85
- package/src/views/EbizFileListDemo.vue +339 -339
- package/src/views/EbizMap.vue +201 -201
- package/src/views/EbizMeetingRoomSelectorDemo.vue +293 -293
- package/src/views/EbizMobileMeetingRoomSelectorDemo.vue +566 -566
- package/src/views/EbizParkingDashboardDemo.vue +28 -28
- package/src/views/EbizRadioDemo.vue +151 -151
- package/src/views/EbizSDataDemo.vue +136 -136
- package/src/views/EbizSDialogDemo.vue +303 -303
- package/src/views/EbizSForm/index.vue +352 -352
- package/src/views/EbizSFormDemo.vue +420 -420
- package/src/views/EbizSpace.vue +185 -185
- package/src/views/EbizSwiper.vue +157 -157
- package/src/views/EbizTdesignButtonDialogExample.vue +437 -437
- package/src/views/Form.vue +19 -19
- package/src/views/GridDemo.vue +238 -238
- package/src/views/Home.vue +156 -156
- package/src/views/LaunchInterviewDemo.vue +111 -111
- package/src/views/Mindmap.vue +17 -17
- package/src/views/MyComponent.vue +19 -19
- package/src/views/OkrTree.vue +19 -19
- package/src/views/PageHeaderDemo.vue +104 -104
- package/src/views/PaginationDemo.vue +96 -96
- package/src/views/PdfViewerDemo.vue +433 -433
- package/src/views/PermissionBoxDemo.vue +85 -85
- package/src/views/PopconfirmDemo.vue +80 -80
- package/src/views/RemoteSelect.vue +350 -350
- package/src/views/StatisticDemo.vue +190 -190
- package/src/views/SwitchDemo.vue +79 -79
- package/src/views/Table.vue +19 -19
- package/src/views/TableDemo.vue +334 -334
- package/src/views/TableSortDemo.vue +143 -143
- package/src/views/TableView.vue +68 -68
- package/src/views/TabsDemo.vue +282 -282
- package/src/views/TagDemo.vue +101 -101
- package/src/views/TdesignAlert.vue +98 -98
- package/src/views/TdesignButton.vue +190 -190
- package/src/views/TdesignCalendar.vue +94 -94
- package/src/views/TdesignCard.vue +296 -296
- package/src/views/TdesignCollapse.vue +293 -293
- package/src/views/TdesignDatePicker.vue +187 -187
- package/src/views/TdesignDescriptions.vue +101 -101
- package/src/views/TdesignForm.vue +248 -248
- package/src/views/TdesignIcon.vue +203 -203
- package/src/views/TdesignImage.vue +215 -215
- package/src/views/TdesignImageViewer.vue +198 -198
- package/src/views/TdesignInput.vue +252 -252
- package/src/views/TdesignSelect.vue +473 -473
- package/src/views/TdesignSwiper.vue +157 -157
- package/src/views/TextareaDemo.vue +93 -93
- package/src/views/TimePickerDemo.vue +146 -146
- package/src/views/TimelineDemo.vue +160 -160
- package/src/views/Title.vue +19 -19
- package/src/views/TreeDemo.vue +254 -254
- package/src/views/TreeMergeTableDemo.vue +239 -239
- package/src/views/TreeSelectorDemo.vue +245 -245
- package/src/views/UploadDemo.vue +128 -128
- package/src/views/VideoDemo.vue +245 -245
- package/src/views/VxeTableDemo.vue +279 -279
- package/src/views/WatermarkDemo.vue +85 -85
|
@@ -1,413 +1,413 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="demo-container">
|
|
3
|
-
<h1>详情视图演示</h1>
|
|
4
|
-
|
|
5
|
-
<div class="demo-section">
|
|
6
|
-
<h2>基础用法 - 字段配置</h2>
|
|
7
|
-
<EbizDetailView :dataId="10" :apiConfig="{
|
|
8
|
-
apiId: '2532',
|
|
9
|
-
key: 'release_note_detail'
|
|
10
|
-
}" :fields="basicFields" :columns="3" layout="horizontal" :gap="20" :labelWidth="100" labelColor="#333333">
|
|
11
|
-
|
|
12
|
-
<template #detail-item-name="{ data }">
|
|
13
|
-
<EbizDetailItem label="姓名" type="text" :value="data.visitors" :required="true" />
|
|
14
|
-
</template>
|
|
15
|
-
<template #detail-item-status="{ data }">
|
|
16
|
-
<EbizDetailItem label="状态" type="status" :value="data.status" />
|
|
17
|
-
</template>
|
|
18
|
-
</EbizDetailView>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<div class="demo-section">
|
|
23
|
-
<h2>TDesign栅格布局 - span功能和响应式</h2>
|
|
24
|
-
<div class="demo-description">
|
|
25
|
-
<p><strong>功能升级:</strong>现已使用 <a href="https://tdesign.tencent.com/vue-next/components/grid" target="_blank">TDesign栅格系统</a>,提供更强大的响应式支持!</p>
|
|
26
|
-
<p><strong>核心优势:</strong></p>
|
|
27
|
-
<ul>
|
|
28
|
-
<li>基于24栅格系统,更灵活的布局控制</li>
|
|
29
|
-
<li>内置响应式断点(xs/sm/md/lg/xl/xxl)</li>
|
|
30
|
-
<li>更好的浏览器兼容性(基于flexbox)</li>
|
|
31
|
-
<li>自动处理移动端适配,无需手动CSS</li>
|
|
32
|
-
</ul>
|
|
33
|
-
<p><strong>配置示例:</strong></p>
|
|
34
|
-
<pre><code>// 字段配置
|
|
35
|
-
{
|
|
36
|
-
key: 'description',
|
|
37
|
-
label: '个人描述',
|
|
38
|
-
type: 'html',
|
|
39
|
-
span: 4 // 跨越4列
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// 响应式配置
|
|
43
|
-
responsive: {
|
|
44
|
-
xs: 1, // <576px 单列
|
|
45
|
-
sm: 1, // ≥576px 单列
|
|
46
|
-
md: 2, // ≥768px 双列
|
|
47
|
-
lg: 2, // ≥992px 双列
|
|
48
|
-
xl: 3, // ≥1200px 三列
|
|
49
|
-
xxl: 4 // ≥1400px 四列
|
|
50
|
-
}</code></pre>
|
|
51
|
-
</div>
|
|
52
|
-
<EbizDetailView
|
|
53
|
-
:data="staticData"
|
|
54
|
-
:fields="spanFields"
|
|
55
|
-
:columns="4"
|
|
56
|
-
layout="horizontal"
|
|
57
|
-
:labelWidth="80"
|
|
58
|
-
labelColor="#666666"
|
|
59
|
-
/>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<div class="demo-section">
|
|
63
|
-
<h2>响应式测试</h2>
|
|
64
|
-
<div class="demo-description">
|
|
65
|
-
<p><strong>测试说明:</strong>调整浏览器窗口大小,观察布局自动适配效果。</p>
|
|
66
|
-
<p><strong>断点说明:</strong></p>
|
|
67
|
-
<ul>
|
|
68
|
-
<li>xs: <576px - 显示1列</li>
|
|
69
|
-
<li>sm: ≥576px - 显示2列</li>
|
|
70
|
-
<li>md: ≥768px - 显示2列</li>
|
|
71
|
-
<li>lg: ≥992px - 显示3列</li>
|
|
72
|
-
<li>xl: ≥1200px - 显示4列</li>
|
|
73
|
-
<li>xxl: ≥1400px - 显示4列</li>
|
|
74
|
-
</ul>
|
|
75
|
-
</div>
|
|
76
|
-
<EbizDetailView
|
|
77
|
-
:data="staticData"
|
|
78
|
-
:fields="basicFields"
|
|
79
|
-
layout="horizontal"
|
|
80
|
-
:gap="24"
|
|
81
|
-
:labelWidth="100"
|
|
82
|
-
labelColor="#333"
|
|
83
|
-
:responsive="{
|
|
84
|
-
xs: 1,
|
|
85
|
-
sm: 2,
|
|
86
|
-
md: 2,
|
|
87
|
-
lg: 3,
|
|
88
|
-
xl: 4,
|
|
89
|
-
xxl: 4
|
|
90
|
-
}"
|
|
91
|
-
/>
|
|
92
|
-
</div>
|
|
93
|
-
|
|
94
|
-
<div class="demo-section">
|
|
95
|
-
<h2>自定义字段 - 使用slot</h2>
|
|
96
|
-
<EbizDetailView :dataId="10" :apiConfig="{
|
|
97
|
-
apiId: '2532',
|
|
98
|
-
key: 'release_note_detail'
|
|
99
|
-
}" :columns="3" layout="horizontal" :gap="16" :labelWidth="50" labelColor="#666666">
|
|
100
|
-
<template #default="{data}">
|
|
101
|
-
<EbizDetailItem label="姓名" type="text" :value="data.visitors" />
|
|
102
|
-
<EbizDetailItem label="邮箱" type="text" :value="staticData.email" />
|
|
103
|
-
<EbizDetailItem label="部门" type="text" :value="staticData.department" />
|
|
104
|
-
<EbizDetailItem label="状态" type="status" :value="staticData.status" />
|
|
105
|
-
<EbizDetailItem label="负责人" type="user" :value="staticData.manager" @user-click="handleUserClick" />
|
|
106
|
-
<EbizDetailItem label="标签" type="tags" :value="staticData.tags" />
|
|
107
|
-
<EbizDetailItem label="入职日期" type="date" :value="data.release_time" />
|
|
108
|
-
<EbizDetailItem label="薪资" type="currency" :value="staticData.salary" />
|
|
109
|
-
<EbizDetailItem label="附件" type="file" :value="staticData.files" @download-file="handleDownloadFile" />
|
|
110
|
-
<EbizDetailItem label="个人主页" type="link" :value="staticData.website" @link-click="handleLinkClick" />
|
|
111
|
-
</template>
|
|
112
|
-
</EbizDetailView>
|
|
113
|
-
</div>
|
|
114
|
-
|
|
115
|
-
<div class="demo-section">
|
|
116
|
-
<h2>增强的Slot支持 - 使用wrapItem函数</h2>
|
|
117
|
-
<div class="demo-description">
|
|
118
|
-
<p><strong>新增功能:</strong></p>
|
|
119
|
-
<ul>
|
|
120
|
-
<li><strong>内置栅格:</strong>EbizDetailItem 内部已集成 TDesign 栅格布局</li>
|
|
121
|
-
<li><strong>简化使用:</strong>直接在 EbizDetailItem 上设置 span 等属性</li>
|
|
122
|
-
<li><strong>响应式支持:</strong>支持 xs/sm/md/lg/xl/xxl 断点配置</li>
|
|
123
|
-
<li><strong>更好封装:</strong>组件更独立,无需外层包装</li>
|
|
124
|
-
</ul>
|
|
125
|
-
<p><strong>使用示例:</strong></p>
|
|
126
|
-
<pre><code><EbizDetailItem
|
|
127
|
-
label="标题"
|
|
128
|
-
:value="content"
|
|
129
|
-
:span="2" // 默认跨2列
|
|
130
|
-
:xs="4" // 超小屏跨4列
|
|
131
|
-
:md="3" /> // 中等屏跨3列</code></pre>
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<EbizDetailView :data="staticData" :columns="4" layout="horizontal" :gap="20" :labelWidth="80">
|
|
135
|
-
<template #default="{data}">
|
|
136
|
-
<!-- 现在直接使用EbizDetailItem,无需外层包装 -->
|
|
137
|
-
<EbizDetailItem
|
|
138
|
-
label="姓名"
|
|
139
|
-
type="text"
|
|
140
|
-
:value="data.name"
|
|
141
|
-
:required="true"
|
|
142
|
-
:span="4" />
|
|
143
|
-
|
|
144
|
-
<EbizDetailItem
|
|
145
|
-
label="邮箱"
|
|
146
|
-
type="text"
|
|
147
|
-
:value="data.email"
|
|
148
|
-
:span="6" />
|
|
149
|
-
|
|
150
|
-
<EbizDetailItem
|
|
151
|
-
label="个人网站"
|
|
152
|
-
type="link"
|
|
153
|
-
:value="data.website"
|
|
154
|
-
:span="4"
|
|
155
|
-
@link-click="handleLinkClick" />
|
|
156
|
-
|
|
157
|
-
<!-- 响应式配置示例 -->
|
|
158
|
-
<EbizDetailItem
|
|
159
|
-
label="技能标签"
|
|
160
|
-
type="tags"
|
|
161
|
-
:value="data.tags"
|
|
162
|
-
:span="4"
|
|
163
|
-
:lg="12" />
|
|
164
|
-
|
|
165
|
-
<EbizDetailItem
|
|
166
|
-
label="状态"
|
|
167
|
-
type="status"
|
|
168
|
-
:value="data.status"
|
|
169
|
-
:span="4" />
|
|
170
|
-
|
|
171
|
-
<!-- 跨列的详细描述 -->
|
|
172
|
-
<EbizDetailItem
|
|
173
|
-
label="详细描述"
|
|
174
|
-
layout="vertical"
|
|
175
|
-
type="html"
|
|
176
|
-
:value="data.description"
|
|
177
|
-
:span="12"
|
|
178
|
-
:xs="12" />
|
|
179
|
-
</template>
|
|
180
|
-
</EbizDetailView>
|
|
181
|
-
</div>
|
|
182
|
-
|
|
183
|
-
<div class="demo-section">
|
|
184
|
-
<h2>事件演示</h2>
|
|
185
|
-
<div class="event-log">
|
|
186
|
-
<h3>事件日志:</h3>
|
|
187
|
-
<ul>
|
|
188
|
-
<li v-for="(log, index) in eventLogs" :key="index">
|
|
189
|
-
{{ log }}
|
|
190
|
-
</li>
|
|
191
|
-
</ul>
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
</div>
|
|
195
|
-
</template>
|
|
196
|
-
|
|
197
|
-
<script setup>
|
|
198
|
-
import { ref } from 'vue'
|
|
199
|
-
import EbizDetailView from '../components/EbizDetailView.vue'
|
|
200
|
-
import EbizDetailItem from '../components/EbizDetailItem.vue'
|
|
201
|
-
|
|
202
|
-
// 静态数据
|
|
203
|
-
const staticData = ref({
|
|
204
|
-
name: '张三',
|
|
205
|
-
email: 'zhangsan@example.com',
|
|
206
|
-
department: '技术部',
|
|
207
|
-
status: {
|
|
208
|
-
text: '在职',
|
|
209
|
-
status: 'success'
|
|
210
|
-
},
|
|
211
|
-
manager: {
|
|
212
|
-
id: 1,
|
|
213
|
-
name: '李四',
|
|
214
|
-
department: '技术部',
|
|
215
|
-
avatar: 'https://avatars.githubusercontent.com/u/1?v=4'
|
|
216
|
-
},
|
|
217
|
-
tags: ['前端开发', 'Vue.js', 'React'],
|
|
218
|
-
joinDate: '2022-01-15',
|
|
219
|
-
salary: 15000,
|
|
220
|
-
files: [
|
|
221
|
-
{
|
|
222
|
-
id: 1,
|
|
223
|
-
name: '简历.pdf',
|
|
224
|
-
url: 'https://example.com/resume.pdf',
|
|
225
|
-
size: 1024000
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
id: 2,
|
|
229
|
-
name: '头像.jpg',
|
|
230
|
-
url: 'https://avatars.githubusercontent.com/u/1?v=4',
|
|
231
|
-
size: 256000
|
|
232
|
-
}
|
|
233
|
-
],
|
|
234
|
-
website: {
|
|
235
|
-
text: '个人博客',
|
|
236
|
-
url: 'https://blog.example.com'
|
|
237
|
-
},
|
|
238
|
-
description: '<p>这是一个<strong>优秀</strong>的前端开发工程师,具有丰富的项目经验。</p><ul><li>精通Vue.js</li><li>熟悉React</li><li>了解Node.js</li></ul>',
|
|
239
|
-
experience: '拥有5年前端开发经验,参与过多个大型项目的开发和维护。',
|
|
240
|
-
skillScore: 95
|
|
241
|
-
})
|
|
242
|
-
|
|
243
|
-
// API数据
|
|
244
|
-
const apiData = ref({})
|
|
245
|
-
|
|
246
|
-
// 事件日志
|
|
247
|
-
const eventLogs = ref([])
|
|
248
|
-
|
|
249
|
-
// 基础字段配置
|
|
250
|
-
const basicFields = ref([
|
|
251
|
-
{ key: 'name', label: '姓名', type: 'text', required: true },
|
|
252
|
-
{ key: 'email', label: '邮箱', type: 'text' },
|
|
253
|
-
{ key: 'department', label: '部门', type: 'text' },
|
|
254
|
-
{ key: 'status', label: '状态', type: 'status' },
|
|
255
|
-
{ key: 'manager', label: '负责人', type: 'user' },
|
|
256
|
-
{ key: 'tags', label: '标签', type: 'tags' }
|
|
257
|
-
])
|
|
258
|
-
|
|
259
|
-
// 列跨度演示字段配置
|
|
260
|
-
const spanFields = ref([
|
|
261
|
-
{ key: 'name', label: '姓名', type: 'text', span: 1 },
|
|
262
|
-
{ key: 'email', label: '邮箱', type: 'text', span: 1 },
|
|
263
|
-
{ key: 'department', label: '部门', type: 'text', span: 1 },
|
|
264
|
-
{ key: 'status', label: '状态', type: 'status', span: 1 },
|
|
265
|
-
{ key: 'description', label: '个人描述', type: 'html', span: 4 },
|
|
266
|
-
{ key: 'manager', label: '负责人', type: 'user', span: 2 },
|
|
267
|
-
{ key: 'tags', label: '技能标签', type: 'tags', span: 2 },
|
|
268
|
-
{ key: 'experience', label: '工作经验', type: 'text', span: 3 },
|
|
269
|
-
{ key: 'skillScore', label: '技能分数', type: 'number', span: 1 }
|
|
270
|
-
])
|
|
271
|
-
|
|
272
|
-
// 事件处理函数
|
|
273
|
-
const handleUserClick = (user) => {
|
|
274
|
-
eventLogs.value.unshift(`用户点击: ${user.name} (${user.department})`)
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
const handleDownloadFile = (file) => {
|
|
278
|
-
eventLogs.value.unshift(`文件下载: ${file.name}`)
|
|
279
|
-
// 实际下载逻辑
|
|
280
|
-
window.open(file.url, '_blank')
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
const handleLinkClick = (link) => {
|
|
284
|
-
eventLogs.value.unshift(`链接点击: ${link.text} -> ${link.url}`)
|
|
285
|
-
window.open(link.url, '_blank')
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
const handleDataLoaded = (data) => {
|
|
289
|
-
apiData.value = data
|
|
290
|
-
eventLogs.value.unshift(`API数据加载成功: ${JSON.stringify(data)}`)
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
const handleError = (error) => {
|
|
294
|
-
eventLogs.value.unshift(`API加载错误: ${error.message}`)
|
|
295
|
-
}
|
|
296
|
-
</script>
|
|
297
|
-
|
|
298
|
-
<style scoped>
|
|
299
|
-
.demo-container {
|
|
300
|
-
padding: 20px;
|
|
301
|
-
max-width: 1200px;
|
|
302
|
-
margin: 0 auto;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
h1 {
|
|
306
|
-
color: #333;
|
|
307
|
-
margin-bottom: 30px;
|
|
308
|
-
text-align: center;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.demo-section {
|
|
312
|
-
margin-bottom: 40px;
|
|
313
|
-
padding: 20px;
|
|
314
|
-
border: 1px solid #e8e8e8;
|
|
315
|
-
border-radius: 8px;
|
|
316
|
-
background: #fafafa;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
.demo-section h2 {
|
|
320
|
-
color: #666;
|
|
321
|
-
margin-bottom: 20px;
|
|
322
|
-
font-size: 18px;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
.event-log {
|
|
326
|
-
margin-top: 20px;
|
|
327
|
-
padding: 15px;
|
|
328
|
-
background: #f5f5f5;
|
|
329
|
-
border-radius: 6px;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.event-log h3 {
|
|
333
|
-
margin-bottom: 10px;
|
|
334
|
-
color: #333;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
.event-log ul {
|
|
338
|
-
list-style: none;
|
|
339
|
-
padding: 0;
|
|
340
|
-
margin: 0;
|
|
341
|
-
max-height: 200px;
|
|
342
|
-
overflow-y: auto;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
.event-log li {
|
|
346
|
-
padding: 5px 0;
|
|
347
|
-
border-bottom: 1px solid #e0e0e0;
|
|
348
|
-
font-size: 14px;
|
|
349
|
-
color: #666;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.event-log li:last-child {
|
|
353
|
-
border-bottom: none;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
.demo-description {
|
|
357
|
-
margin-bottom: 20px;
|
|
358
|
-
padding: 15px;
|
|
359
|
-
background: #f8f9fa;
|
|
360
|
-
border-radius: 6px;
|
|
361
|
-
border-left: 4px solid #0052d9;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.demo-description p {
|
|
365
|
-
margin: 8px 0;
|
|
366
|
-
font-size: 14px;
|
|
367
|
-
line-height: 1.5;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.demo-description code {
|
|
371
|
-
padding: 2px 6px;
|
|
372
|
-
background: #e9ecef;
|
|
373
|
-
border-radius: 3px;
|
|
374
|
-
font-size: 12px;
|
|
375
|
-
color: #d63384;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
.demo-description pre {
|
|
379
|
-
margin: 10px 0;
|
|
380
|
-
padding: 12px;
|
|
381
|
-
background: #2d3748;
|
|
382
|
-
color: #e2e8f0;
|
|
383
|
-
border-radius: 4px;
|
|
384
|
-
overflow-x: auto;
|
|
385
|
-
font-size: 12px;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
.demo-description pre code {
|
|
389
|
-
background: none;
|
|
390
|
-
color: inherit;
|
|
391
|
-
padding: 0;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
.demo-description ul {
|
|
395
|
-
margin: 10px 0;
|
|
396
|
-
padding-left: 20px;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.demo-description li {
|
|
400
|
-
margin: 4px 0;
|
|
401
|
-
font-size: 14px;
|
|
402
|
-
line-height: 1.5;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.demo-description a {
|
|
406
|
-
color: #0052d9;
|
|
407
|
-
text-decoration: none;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
.demo-description a:hover {
|
|
411
|
-
text-decoration: underline;
|
|
412
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div class="demo-container">
|
|
3
|
+
<h1>详情视图演示</h1>
|
|
4
|
+
|
|
5
|
+
<div class="demo-section">
|
|
6
|
+
<h2>基础用法 - 字段配置</h2>
|
|
7
|
+
<EbizDetailView :dataId="10" :apiConfig="{
|
|
8
|
+
apiId: '2532',
|
|
9
|
+
key: 'release_note_detail'
|
|
10
|
+
}" :fields="basicFields" :columns="3" layout="horizontal" :gap="20" :labelWidth="100" labelColor="#333333">
|
|
11
|
+
|
|
12
|
+
<template #detail-item-name="{ data }">
|
|
13
|
+
<EbizDetailItem label="姓名" type="text" :value="data.visitors" :required="true" />
|
|
14
|
+
</template>
|
|
15
|
+
<template #detail-item-status="{ data }">
|
|
16
|
+
<EbizDetailItem label="状态" type="status" :value="data.status" />
|
|
17
|
+
</template>
|
|
18
|
+
</EbizDetailView>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<div class="demo-section">
|
|
23
|
+
<h2>TDesign栅格布局 - span功能和响应式</h2>
|
|
24
|
+
<div class="demo-description">
|
|
25
|
+
<p><strong>功能升级:</strong>现已使用 <a href="https://tdesign.tencent.com/vue-next/components/grid" target="_blank">TDesign栅格系统</a>,提供更强大的响应式支持!</p>
|
|
26
|
+
<p><strong>核心优势:</strong></p>
|
|
27
|
+
<ul>
|
|
28
|
+
<li>基于24栅格系统,更灵活的布局控制</li>
|
|
29
|
+
<li>内置响应式断点(xs/sm/md/lg/xl/xxl)</li>
|
|
30
|
+
<li>更好的浏览器兼容性(基于flexbox)</li>
|
|
31
|
+
<li>自动处理移动端适配,无需手动CSS</li>
|
|
32
|
+
</ul>
|
|
33
|
+
<p><strong>配置示例:</strong></p>
|
|
34
|
+
<pre><code>// 字段配置
|
|
35
|
+
{
|
|
36
|
+
key: 'description',
|
|
37
|
+
label: '个人描述',
|
|
38
|
+
type: 'html',
|
|
39
|
+
span: 4 // 跨越4列
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// 响应式配置
|
|
43
|
+
responsive: {
|
|
44
|
+
xs: 1, // <576px 单列
|
|
45
|
+
sm: 1, // ≥576px 单列
|
|
46
|
+
md: 2, // ≥768px 双列
|
|
47
|
+
lg: 2, // ≥992px 双列
|
|
48
|
+
xl: 3, // ≥1200px 三列
|
|
49
|
+
xxl: 4 // ≥1400px 四列
|
|
50
|
+
}</code></pre>
|
|
51
|
+
</div>
|
|
52
|
+
<EbizDetailView
|
|
53
|
+
:data="staticData"
|
|
54
|
+
:fields="spanFields"
|
|
55
|
+
:columns="4"
|
|
56
|
+
layout="horizontal"
|
|
57
|
+
:labelWidth="80"
|
|
58
|
+
labelColor="#666666"
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div class="demo-section">
|
|
63
|
+
<h2>响应式测试</h2>
|
|
64
|
+
<div class="demo-description">
|
|
65
|
+
<p><strong>测试说明:</strong>调整浏览器窗口大小,观察布局自动适配效果。</p>
|
|
66
|
+
<p><strong>断点说明:</strong></p>
|
|
67
|
+
<ul>
|
|
68
|
+
<li>xs: <576px - 显示1列</li>
|
|
69
|
+
<li>sm: ≥576px - 显示2列</li>
|
|
70
|
+
<li>md: ≥768px - 显示2列</li>
|
|
71
|
+
<li>lg: ≥992px - 显示3列</li>
|
|
72
|
+
<li>xl: ≥1200px - 显示4列</li>
|
|
73
|
+
<li>xxl: ≥1400px - 显示4列</li>
|
|
74
|
+
</ul>
|
|
75
|
+
</div>
|
|
76
|
+
<EbizDetailView
|
|
77
|
+
:data="staticData"
|
|
78
|
+
:fields="basicFields"
|
|
79
|
+
layout="horizontal"
|
|
80
|
+
:gap="24"
|
|
81
|
+
:labelWidth="100"
|
|
82
|
+
labelColor="#333"
|
|
83
|
+
:responsive="{
|
|
84
|
+
xs: 1,
|
|
85
|
+
sm: 2,
|
|
86
|
+
md: 2,
|
|
87
|
+
lg: 3,
|
|
88
|
+
xl: 4,
|
|
89
|
+
xxl: 4
|
|
90
|
+
}"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div class="demo-section">
|
|
95
|
+
<h2>自定义字段 - 使用slot</h2>
|
|
96
|
+
<EbizDetailView :dataId="10" :apiConfig="{
|
|
97
|
+
apiId: '2532',
|
|
98
|
+
key: 'release_note_detail'
|
|
99
|
+
}" :columns="3" layout="horizontal" :gap="16" :labelWidth="50" labelColor="#666666">
|
|
100
|
+
<template #default="{data}">
|
|
101
|
+
<EbizDetailItem label="姓名" type="text" :value="data.visitors" />
|
|
102
|
+
<EbizDetailItem label="邮箱" type="text" :value="staticData.email" />
|
|
103
|
+
<EbizDetailItem label="部门" type="text" :value="staticData.department" />
|
|
104
|
+
<EbizDetailItem label="状态" type="status" :value="staticData.status" />
|
|
105
|
+
<EbizDetailItem label="负责人" type="user" :value="staticData.manager" @user-click="handleUserClick" />
|
|
106
|
+
<EbizDetailItem label="标签" type="tags" :value="staticData.tags" />
|
|
107
|
+
<EbizDetailItem label="入职日期" type="date" :value="data.release_time" />
|
|
108
|
+
<EbizDetailItem label="薪资" type="currency" :value="staticData.salary" />
|
|
109
|
+
<EbizDetailItem label="附件" type="file" :value="staticData.files" @download-file="handleDownloadFile" />
|
|
110
|
+
<EbizDetailItem label="个人主页" type="link" :value="staticData.website" @link-click="handleLinkClick" />
|
|
111
|
+
</template>
|
|
112
|
+
</EbizDetailView>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div class="demo-section">
|
|
116
|
+
<h2>增强的Slot支持 - 使用wrapItem函数</h2>
|
|
117
|
+
<div class="demo-description">
|
|
118
|
+
<p><strong>新增功能:</strong></p>
|
|
119
|
+
<ul>
|
|
120
|
+
<li><strong>内置栅格:</strong>EbizDetailItem 内部已集成 TDesign 栅格布局</li>
|
|
121
|
+
<li><strong>简化使用:</strong>直接在 EbizDetailItem 上设置 span 等属性</li>
|
|
122
|
+
<li><strong>响应式支持:</strong>支持 xs/sm/md/lg/xl/xxl 断点配置</li>
|
|
123
|
+
<li><strong>更好封装:</strong>组件更独立,无需外层包装</li>
|
|
124
|
+
</ul>
|
|
125
|
+
<p><strong>使用示例:</strong></p>
|
|
126
|
+
<pre><code><EbizDetailItem
|
|
127
|
+
label="标题"
|
|
128
|
+
:value="content"
|
|
129
|
+
:span="2" // 默认跨2列
|
|
130
|
+
:xs="4" // 超小屏跨4列
|
|
131
|
+
:md="3" /> // 中等屏跨3列</code></pre>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<EbizDetailView :data="staticData" :columns="4" layout="horizontal" :gap="20" :labelWidth="80">
|
|
135
|
+
<template #default="{data}">
|
|
136
|
+
<!-- 现在直接使用EbizDetailItem,无需外层包装 -->
|
|
137
|
+
<EbizDetailItem
|
|
138
|
+
label="姓名"
|
|
139
|
+
type="text"
|
|
140
|
+
:value="data.name"
|
|
141
|
+
:required="true"
|
|
142
|
+
:span="4" />
|
|
143
|
+
|
|
144
|
+
<EbizDetailItem
|
|
145
|
+
label="邮箱"
|
|
146
|
+
type="text"
|
|
147
|
+
:value="data.email"
|
|
148
|
+
:span="6" />
|
|
149
|
+
|
|
150
|
+
<EbizDetailItem
|
|
151
|
+
label="个人网站"
|
|
152
|
+
type="link"
|
|
153
|
+
:value="data.website"
|
|
154
|
+
:span="4"
|
|
155
|
+
@link-click="handleLinkClick" />
|
|
156
|
+
|
|
157
|
+
<!-- 响应式配置示例 -->
|
|
158
|
+
<EbizDetailItem
|
|
159
|
+
label="技能标签"
|
|
160
|
+
type="tags"
|
|
161
|
+
:value="data.tags"
|
|
162
|
+
:span="4"
|
|
163
|
+
:lg="12" />
|
|
164
|
+
|
|
165
|
+
<EbizDetailItem
|
|
166
|
+
label="状态"
|
|
167
|
+
type="status"
|
|
168
|
+
:value="data.status"
|
|
169
|
+
:span="4" />
|
|
170
|
+
|
|
171
|
+
<!-- 跨列的详细描述 -->
|
|
172
|
+
<EbizDetailItem
|
|
173
|
+
label="详细描述"
|
|
174
|
+
layout="vertical"
|
|
175
|
+
type="html"
|
|
176
|
+
:value="data.description"
|
|
177
|
+
:span="12"
|
|
178
|
+
:xs="12" />
|
|
179
|
+
</template>
|
|
180
|
+
</EbizDetailView>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div class="demo-section">
|
|
184
|
+
<h2>事件演示</h2>
|
|
185
|
+
<div class="event-log">
|
|
186
|
+
<h3>事件日志:</h3>
|
|
187
|
+
<ul>
|
|
188
|
+
<li v-for="(log, index) in eventLogs" :key="index">
|
|
189
|
+
{{ log }}
|
|
190
|
+
</li>
|
|
191
|
+
</ul>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
</template>
|
|
196
|
+
|
|
197
|
+
<script setup>
|
|
198
|
+
import { ref } from 'vue'
|
|
199
|
+
import EbizDetailView from '../components/EbizDetailView.vue'
|
|
200
|
+
import EbizDetailItem from '../components/EbizDetailItem.vue'
|
|
201
|
+
|
|
202
|
+
// 静态数据
|
|
203
|
+
const staticData = ref({
|
|
204
|
+
name: '张三',
|
|
205
|
+
email: 'zhangsan@example.com',
|
|
206
|
+
department: '技术部',
|
|
207
|
+
status: {
|
|
208
|
+
text: '在职',
|
|
209
|
+
status: 'success'
|
|
210
|
+
},
|
|
211
|
+
manager: {
|
|
212
|
+
id: 1,
|
|
213
|
+
name: '李四',
|
|
214
|
+
department: '技术部',
|
|
215
|
+
avatar: 'https://avatars.githubusercontent.com/u/1?v=4'
|
|
216
|
+
},
|
|
217
|
+
tags: ['前端开发', 'Vue.js', 'React'],
|
|
218
|
+
joinDate: '2022-01-15',
|
|
219
|
+
salary: 15000,
|
|
220
|
+
files: [
|
|
221
|
+
{
|
|
222
|
+
id: 1,
|
|
223
|
+
name: '简历.pdf',
|
|
224
|
+
url: 'https://example.com/resume.pdf',
|
|
225
|
+
size: 1024000
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: 2,
|
|
229
|
+
name: '头像.jpg',
|
|
230
|
+
url: 'https://avatars.githubusercontent.com/u/1?v=4',
|
|
231
|
+
size: 256000
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
website: {
|
|
235
|
+
text: '个人博客',
|
|
236
|
+
url: 'https://blog.example.com'
|
|
237
|
+
},
|
|
238
|
+
description: '<p>这是一个<strong>优秀</strong>的前端开发工程师,具有丰富的项目经验。</p><ul><li>精通Vue.js</li><li>熟悉React</li><li>了解Node.js</li></ul>',
|
|
239
|
+
experience: '拥有5年前端开发经验,参与过多个大型项目的开发和维护。',
|
|
240
|
+
skillScore: 95
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
// API数据
|
|
244
|
+
const apiData = ref({})
|
|
245
|
+
|
|
246
|
+
// 事件日志
|
|
247
|
+
const eventLogs = ref([])
|
|
248
|
+
|
|
249
|
+
// 基础字段配置
|
|
250
|
+
const basicFields = ref([
|
|
251
|
+
{ key: 'name', label: '姓名', type: 'text', required: true },
|
|
252
|
+
{ key: 'email', label: '邮箱', type: 'text' },
|
|
253
|
+
{ key: 'department', label: '部门', type: 'text' },
|
|
254
|
+
{ key: 'status', label: '状态', type: 'status' },
|
|
255
|
+
{ key: 'manager', label: '负责人', type: 'user' },
|
|
256
|
+
{ key: 'tags', label: '标签', type: 'tags' }
|
|
257
|
+
])
|
|
258
|
+
|
|
259
|
+
// 列跨度演示字段配置
|
|
260
|
+
const spanFields = ref([
|
|
261
|
+
{ key: 'name', label: '姓名', type: 'text', span: 1 },
|
|
262
|
+
{ key: 'email', label: '邮箱', type: 'text', span: 1 },
|
|
263
|
+
{ key: 'department', label: '部门', type: 'text', span: 1 },
|
|
264
|
+
{ key: 'status', label: '状态', type: 'status', span: 1 },
|
|
265
|
+
{ key: 'description', label: '个人描述', type: 'html', span: 4 },
|
|
266
|
+
{ key: 'manager', label: '负责人', type: 'user', span: 2 },
|
|
267
|
+
{ key: 'tags', label: '技能标签', type: 'tags', span: 2 },
|
|
268
|
+
{ key: 'experience', label: '工作经验', type: 'text', span: 3 },
|
|
269
|
+
{ key: 'skillScore', label: '技能分数', type: 'number', span: 1 }
|
|
270
|
+
])
|
|
271
|
+
|
|
272
|
+
// 事件处理函数
|
|
273
|
+
const handleUserClick = (user) => {
|
|
274
|
+
eventLogs.value.unshift(`用户点击: ${user.name} (${user.department})`)
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const handleDownloadFile = (file) => {
|
|
278
|
+
eventLogs.value.unshift(`文件下载: ${file.name}`)
|
|
279
|
+
// 实际下载逻辑
|
|
280
|
+
window.open(file.url, '_blank')
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const handleLinkClick = (link) => {
|
|
284
|
+
eventLogs.value.unshift(`链接点击: ${link.text} -> ${link.url}`)
|
|
285
|
+
window.open(link.url, '_blank')
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const handleDataLoaded = (data) => {
|
|
289
|
+
apiData.value = data
|
|
290
|
+
eventLogs.value.unshift(`API数据加载成功: ${JSON.stringify(data)}`)
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const handleError = (error) => {
|
|
294
|
+
eventLogs.value.unshift(`API加载错误: ${error.message}`)
|
|
295
|
+
}
|
|
296
|
+
</script>
|
|
297
|
+
|
|
298
|
+
<style scoped>
|
|
299
|
+
.demo-container {
|
|
300
|
+
padding: 20px;
|
|
301
|
+
max-width: 1200px;
|
|
302
|
+
margin: 0 auto;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
h1 {
|
|
306
|
+
color: #333;
|
|
307
|
+
margin-bottom: 30px;
|
|
308
|
+
text-align: center;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.demo-section {
|
|
312
|
+
margin-bottom: 40px;
|
|
313
|
+
padding: 20px;
|
|
314
|
+
border: 1px solid #e8e8e8;
|
|
315
|
+
border-radius: 8px;
|
|
316
|
+
background: #fafafa;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.demo-section h2 {
|
|
320
|
+
color: #666;
|
|
321
|
+
margin-bottom: 20px;
|
|
322
|
+
font-size: 18px;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.event-log {
|
|
326
|
+
margin-top: 20px;
|
|
327
|
+
padding: 15px;
|
|
328
|
+
background: #f5f5f5;
|
|
329
|
+
border-radius: 6px;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.event-log h3 {
|
|
333
|
+
margin-bottom: 10px;
|
|
334
|
+
color: #333;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.event-log ul {
|
|
338
|
+
list-style: none;
|
|
339
|
+
padding: 0;
|
|
340
|
+
margin: 0;
|
|
341
|
+
max-height: 200px;
|
|
342
|
+
overflow-y: auto;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.event-log li {
|
|
346
|
+
padding: 5px 0;
|
|
347
|
+
border-bottom: 1px solid #e0e0e0;
|
|
348
|
+
font-size: 14px;
|
|
349
|
+
color: #666;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.event-log li:last-child {
|
|
353
|
+
border-bottom: none;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.demo-description {
|
|
357
|
+
margin-bottom: 20px;
|
|
358
|
+
padding: 15px;
|
|
359
|
+
background: #f8f9fa;
|
|
360
|
+
border-radius: 6px;
|
|
361
|
+
border-left: 4px solid #0052d9;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.demo-description p {
|
|
365
|
+
margin: 8px 0;
|
|
366
|
+
font-size: 14px;
|
|
367
|
+
line-height: 1.5;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.demo-description code {
|
|
371
|
+
padding: 2px 6px;
|
|
372
|
+
background: #e9ecef;
|
|
373
|
+
border-radius: 3px;
|
|
374
|
+
font-size: 12px;
|
|
375
|
+
color: #d63384;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.demo-description pre {
|
|
379
|
+
margin: 10px 0;
|
|
380
|
+
padding: 12px;
|
|
381
|
+
background: #2d3748;
|
|
382
|
+
color: #e2e8f0;
|
|
383
|
+
border-radius: 4px;
|
|
384
|
+
overflow-x: auto;
|
|
385
|
+
font-size: 12px;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.demo-description pre code {
|
|
389
|
+
background: none;
|
|
390
|
+
color: inherit;
|
|
391
|
+
padding: 0;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.demo-description ul {
|
|
395
|
+
margin: 10px 0;
|
|
396
|
+
padding-left: 20px;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.demo-description li {
|
|
400
|
+
margin: 4px 0;
|
|
401
|
+
font-size: 14px;
|
|
402
|
+
line-height: 1.5;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.demo-description a {
|
|
406
|
+
color: #0052d9;
|
|
407
|
+
text-decoration: none;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.demo-description a:hover {
|
|
411
|
+
text-decoration: underline;
|
|
412
|
+
}
|
|
413
413
|
</style>
|