@ebiz/designer-components 0.0.18-kzy.2 → 0.0.18-kzy.4
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 +2 -2
- package/dist/index.mjs +46510 -41918
- package/package.json +1 -1
- package/src/apiService/simpleDataService.js +9 -4
- package/src/components/Button.vue +1 -1
- package/src/components/EbizDetailBlock.vue +82 -0
- package/src/components/EbizDialog.vue +249 -0
- package/src/components/EbizPageHeader.vue +96 -0
- package/src/components/EbizRemoteSelect.vue +22 -11
- package/src/components/EbizRouteBreadcrumb.vue +3 -1
- package/src/components/EbizTable.vue +113 -133
- package/src/components/EbizTableColumn.vue +117 -0
- package/src/components/EbizTableSort.vue +181 -0
- package/src/components/EbizTimePicker.vue +144 -0
- package/src/components/EbizTree.vue +153 -0
- package/src/components/EbizTreeSelector.vue +423 -0
- package/src/components/TddesignButton.vue +153 -0
- package/src/components/TdesignUpload.vue +2 -3
- package/src/components/TinyGridEditorSelect.vue +238 -0
- package/src/index.js +22 -1
- package/src/router/index.js +64 -5
- package/src/views/Button.vue +7 -3
- package/src/views/EbizDetailBlockDemo.vue +31 -0
- package/src/views/Home.vue +33 -2
- package/src/views/PageHeaderDemo.vue +105 -0
- package/src/views/TableSortDemo.vue +144 -0
- package/src/views/TableView.vue +69 -0
- package/src/views/TimePickerDemo.vue +147 -0
- package/src/views/TreeDemo.vue +255 -0
- package/src/views/TreeSelectorDemo.vue +246 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="demo-container">
|
3
|
+
<h2>页面头部组件演示</h2>
|
4
|
+
|
5
|
+
<div class="section">
|
6
|
+
<h3>基础用法</h3>
|
7
|
+
<div class="example">
|
8
|
+
<EbizPageHeader />
|
9
|
+
</div>
|
10
|
+
<div class="code">
|
11
|
+
<pre><code><EbizPageHeader /></code></pre>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="section">
|
16
|
+
<h3>功能说明</h3>
|
17
|
+
<div class="description">
|
18
|
+
<p>此组件会自动根据当前路由信息生成面包屑导航。确保路由配置中包含以下meta信息:</p>
|
19
|
+
<pre><code>
|
20
|
+
// 路由配置示例
|
21
|
+
{
|
22
|
+
path: '/hr',
|
23
|
+
component: HR,
|
24
|
+
meta: {
|
25
|
+
title: '人事管理', // 面包屑显示的标题
|
26
|
+
icon: 'user' // 面包屑的图标名称,使用TDesign图标
|
27
|
+
},
|
28
|
+
children: [
|
29
|
+
{
|
30
|
+
path: 'employee',
|
31
|
+
component: Employee,
|
32
|
+
meta: {
|
33
|
+
title: '员工管理',
|
34
|
+
icon: 'user-talk'
|
35
|
+
}
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
</code></pre>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div class="section">
|
44
|
+
<h3>帮助文档跳转</h3>
|
45
|
+
<p>点击帮助文档按钮会自动跳转到 /help 路径,并带上当前路由作为查询参数。</p>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</template>
|
49
|
+
|
50
|
+
<script setup>
|
51
|
+
import { EbizPageHeader } from '../index.js'
|
52
|
+
</script>
|
53
|
+
|
54
|
+
<style scoped>
|
55
|
+
.demo-container {
|
56
|
+
padding: 20px;
|
57
|
+
max-width: 1200px;
|
58
|
+
margin: 0 auto;
|
59
|
+
}
|
60
|
+
|
61
|
+
h2 {
|
62
|
+
margin-bottom: 24px;
|
63
|
+
font-weight: 500;
|
64
|
+
color: #1a1a1a;
|
65
|
+
}
|
66
|
+
|
67
|
+
.section {
|
68
|
+
margin-bottom: 32px;
|
69
|
+
border: 1px solid #e9e9e9;
|
70
|
+
border-radius: 4px;
|
71
|
+
overflow: hidden;
|
72
|
+
}
|
73
|
+
|
74
|
+
h3 {
|
75
|
+
padding: 16px;
|
76
|
+
margin: 0;
|
77
|
+
font-weight: 500;
|
78
|
+
background-color: #f7f7f7;
|
79
|
+
border-bottom: 1px solid #e9e9e9;
|
80
|
+
}
|
81
|
+
|
82
|
+
.example {
|
83
|
+
padding: 24px;
|
84
|
+
border-bottom: 1px dashed #e9e9e9;
|
85
|
+
}
|
86
|
+
|
87
|
+
.code {
|
88
|
+
padding: 16px;
|
89
|
+
background-color: #f7f7f7;
|
90
|
+
}
|
91
|
+
|
92
|
+
pre {
|
93
|
+
margin: 0;
|
94
|
+
overflow-x: auto;
|
95
|
+
}
|
96
|
+
|
97
|
+
code {
|
98
|
+
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
|
99
|
+
font-size: 14px;
|
100
|
+
}
|
101
|
+
|
102
|
+
.description {
|
103
|
+
padding: 16px;
|
104
|
+
}
|
105
|
+
</style>
|
@@ -0,0 +1,144 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="container">
|
3
|
+
<h1>表格排序组件演示</h1>
|
4
|
+
|
5
|
+
<div class="demo-section">
|
6
|
+
<h2>基础用法</h2>
|
7
|
+
<div class="demo-item">
|
8
|
+
<EbizTableSort icon="filter-sort" :field-options="fieldOptions" @sort="handleSort"
|
9
|
+
@reset="handleReset" />
|
10
|
+
</div>
|
11
|
+
<div class="result" v-if="sortResult.length > 0">
|
12
|
+
<h3>排序结果:</h3>
|
13
|
+
<pre>{{ JSON.stringify(sortResult, null, 2) }}</pre>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="demo-section">
|
18
|
+
<h2>自定义按钮</h2>
|
19
|
+
<div class="demo-item">
|
20
|
+
<EbizTableSort icon="filter" button-text="自定义排序" :field-options="fieldOptions" @sort="handleSort2" />
|
21
|
+
</div>
|
22
|
+
<div class="result" v-if="sortResult2.length > 0">
|
23
|
+
<h3>排序结果:</h3>
|
24
|
+
<pre>{{ JSON.stringify(sortResult2, null, 2) }}</pre>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="demo-section">
|
29
|
+
<h2>预设排序条件</h2>
|
30
|
+
<div class="demo-item">
|
31
|
+
<EbizTableSort :field-options="fieldOptions" :default-sort="defaultSort" @sort="handleSort3" />
|
32
|
+
</div>
|
33
|
+
<div class="result" v-if="sortResult3.length > 0">
|
34
|
+
<h3>排序结果:</h3>
|
35
|
+
<pre>{{ JSON.stringify(sortResult3, null, 2) }}</pre>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="demo-section">
|
40
|
+
<h2>多条件排序</h2>
|
41
|
+
<div class="demo-item">
|
42
|
+
<EbizTableSort :field-options="fieldOptions" :max-sort-items="3" @sort="handleSort4" />
|
43
|
+
</div>
|
44
|
+
<div class="result" v-if="sortResult4.length > 0">
|
45
|
+
<h3>排序结果:</h3>
|
46
|
+
<pre>{{ JSON.stringify(sortResult4, null, 2) }}</pre>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
</template>
|
51
|
+
|
52
|
+
<script setup>
|
53
|
+
import { ref } from 'vue';
|
54
|
+
import { EbizTableSort } from '../index.js';
|
55
|
+
|
56
|
+
// 字段选项
|
57
|
+
const fieldOptions = [
|
58
|
+
{ value: 'name', label: '姓名' },
|
59
|
+
{ value: 'age', label: '年龄' },
|
60
|
+
{ value: 'address', label: '地址' },
|
61
|
+
{ value: 'createTime', label: '创建时间' },
|
62
|
+
{ value: 'status', label: '状态' }
|
63
|
+
];
|
64
|
+
|
65
|
+
// 默认排序条件
|
66
|
+
const defaultSort = [
|
67
|
+
{ field: 'age', order: 'desc' }
|
68
|
+
];
|
69
|
+
|
70
|
+
// 排序结果
|
71
|
+
const sortResult = ref([]);
|
72
|
+
const sortResult2 = ref([]);
|
73
|
+
const sortResult3 = ref([]);
|
74
|
+
const sortResult4 = ref([]);
|
75
|
+
|
76
|
+
// 处理排序
|
77
|
+
const handleSort = (sort) => {
|
78
|
+
sortResult.value = sort;
|
79
|
+
console.log('排序条件:', sort);
|
80
|
+
};
|
81
|
+
|
82
|
+
const handleSort2 = (sort) => {
|
83
|
+
sortResult2.value = sort;
|
84
|
+
console.log('排序条件2:', sort);
|
85
|
+
};
|
86
|
+
|
87
|
+
const handleSort3 = (sort) => {
|
88
|
+
sortResult3.value = sort;
|
89
|
+
console.log('排序条件3:', sort);
|
90
|
+
};
|
91
|
+
|
92
|
+
const handleSort4 = (sort) => {
|
93
|
+
sortResult4.value = sort;
|
94
|
+
console.log('排序条件4:', sort);
|
95
|
+
};
|
96
|
+
|
97
|
+
// 处理重置
|
98
|
+
const handleReset = () => {
|
99
|
+
sortResult.value = [];
|
100
|
+
console.log('重置排序');
|
101
|
+
};
|
102
|
+
</script>
|
103
|
+
|
104
|
+
<style lang="less" scoped>
|
105
|
+
.container {
|
106
|
+
padding: 20px;
|
107
|
+
|
108
|
+
h1 {
|
109
|
+
margin-bottom: 20px;
|
110
|
+
}
|
111
|
+
|
112
|
+
.demo-section {
|
113
|
+
margin-bottom: 30px;
|
114
|
+
padding: 20px;
|
115
|
+
border: 1px solid #eee;
|
116
|
+
border-radius: 6px;
|
117
|
+
|
118
|
+
h2 {
|
119
|
+
margin-bottom: 16px;
|
120
|
+
font-size: 18px;
|
121
|
+
}
|
122
|
+
|
123
|
+
.demo-item {
|
124
|
+
margin-bottom: 16px;
|
125
|
+
}
|
126
|
+
|
127
|
+
.result {
|
128
|
+
margin-top: 20px;
|
129
|
+
padding: 16px;
|
130
|
+
background-color: #f9f9f9;
|
131
|
+
border-radius: 4px;
|
132
|
+
|
133
|
+
h3 {
|
134
|
+
margin-bottom: 8px;
|
135
|
+
font-size: 16px;
|
136
|
+
}
|
137
|
+
|
138
|
+
pre {
|
139
|
+
font-family: monospace;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
</style>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="table-demo-container">
|
3
|
+
<h2>基础表格</h2>
|
4
|
+
<ebiz-table :data="tableData" :bordered="true" :hover="true">
|
5
|
+
<ebiz-table-column col-key="id" title="ID" width="80" />
|
6
|
+
<ebiz-table-column col-key="name" title="姓名" width="120" />
|
7
|
+
<ebiz-table-column col-key="age" title="年龄" width="80" :sorter="true" align="center" />
|
8
|
+
<ebiz-table-column col-key="address" title="地址" :ellipsis="true" />
|
9
|
+
</ebiz-table>
|
10
|
+
|
11
|
+
<h2>列类型演示</h2>
|
12
|
+
<ebiz-table :data="tableData" :bordered="true" :stripe="true" row-key="id">
|
13
|
+
<ebiz-table-column type="multiple" width="60" />
|
14
|
+
<ebiz-table-column type="index" title="序号" width="80" />
|
15
|
+
<ebiz-table-column col-key="name" title="姓名" width="120" />
|
16
|
+
<ebiz-table-column col-key="age" title="年龄" width="80" />
|
17
|
+
<ebiz-table-column col-key="address" title="地址" :ellipsis="true" />
|
18
|
+
</ebiz-table>
|
19
|
+
|
20
|
+
<h2>插槽用法</h2>
|
21
|
+
<ebiz-table :data="tableData" :bordered="true">
|
22
|
+
<ebiz-table-column col-key="id" title="ID" width="80" />
|
23
|
+
<ebiz-table-column col-key="name" title="姓名" width="120">
|
24
|
+
<template #default="{ row }">
|
25
|
+
<strong style="color: #0052d9">{{ row.name }}</strong>
|
26
|
+
</template>
|
27
|
+
</ebiz-table-column>
|
28
|
+
<ebiz-table-column col-key="age" title="年龄" width="80" />
|
29
|
+
<ebiz-table-column col-key="operation" title="操作" width="160">
|
30
|
+
<template #default="{ row }">
|
31
|
+
<button @click="handleEdit(row)" style="margin-right: 8px">编辑</button>
|
32
|
+
<button @click="handleDelete(row)">删除</button>
|
33
|
+
</template>
|
34
|
+
</ebiz-table-column>
|
35
|
+
</ebiz-table>
|
36
|
+
</div>
|
37
|
+
</template>
|
38
|
+
|
39
|
+
<script setup>
|
40
|
+
import { ref } from 'vue';
|
41
|
+
import { EbizTable, EbizTableColumn } from '../index.js';
|
42
|
+
|
43
|
+
const tableData = ref([
|
44
|
+
{ id: 1, name: '张三', age: 28, address: '北京市朝阳区' },
|
45
|
+
{ id: 2, name: '李四', age: 35, address: '上海市浦东新区' },
|
46
|
+
{ id: 3, name: '王五', age: 42, address: '广州市天河区' },
|
47
|
+
{ id: 4, name: '赵六', age: 31, address: '深圳市南山区科技园' },
|
48
|
+
{ id: 5, name: '钱七', age: 27, address: '杭州市西湖区' }
|
49
|
+
]);
|
50
|
+
|
51
|
+
const handleEdit = (row) => {
|
52
|
+
alert(`编辑: ${row.name}`);
|
53
|
+
};
|
54
|
+
|
55
|
+
const handleDelete = (row) => {
|
56
|
+
alert(`删除: ${row.name}`);
|
57
|
+
};
|
58
|
+
</script>
|
59
|
+
|
60
|
+
<style scoped>
|
61
|
+
.table-demo-container {
|
62
|
+
padding: 20px;
|
63
|
+
}
|
64
|
+
|
65
|
+
.table-demo-container h2 {
|
66
|
+
margin: 30px 0 15px;
|
67
|
+
font-size: 18px;
|
68
|
+
}
|
69
|
+
</style>
|
@@ -0,0 +1,147 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="time-picker-demo">
|
3
|
+
<h2>时间选择器 EbizTimePicker</h2>
|
4
|
+
|
5
|
+
<h3>基本用法</h3>
|
6
|
+
<div class="demo-section">
|
7
|
+
<EbizTimePicker v-model="value1" placeholder="请选择时间" />
|
8
|
+
<div class="demo-value">选中值: {{ value1 }}</div>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<h3>时间格式</h3>
|
12
|
+
<div class="demo-section">
|
13
|
+
<EbizTimePicker v-model="value2" format="HH:mm" placeholder="时分格式 HH:mm" />
|
14
|
+
<div class="demo-value">选中值: {{ value2 }}</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<h3>禁用状态</h3>
|
18
|
+
<div class="demo-section">
|
19
|
+
<EbizTimePicker v-model="value3" disabled placeholder="禁用状态" />
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<h3>时间范围选择</h3>
|
23
|
+
<div class="demo-section">
|
24
|
+
<EbizTimePicker v-model="value4" range placeholder="请选择时间范围" />
|
25
|
+
<div class="demo-value">选中值: {{ value4 }}</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<h3>步长设置</h3>
|
29
|
+
<div class="demo-section">
|
30
|
+
<EbizTimePicker v-model="value5" :steps="[2, 10, 15]" placeholder="步长:时(2) 分(10) 秒(15)" />
|
31
|
+
<div class="demo-value">选中值: {{ value5 }}</div>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<h3>禁用时间</h3>
|
35
|
+
<div class="demo-section">
|
36
|
+
<EbizTimePicker v-model="value6" :disable-time="disableTime" placeholder="上午禁用" />
|
37
|
+
<div class="demo-value">选中值: {{ value6 }}</div>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<h3>不同尺寸</h3>
|
41
|
+
<div class="demo-section">
|
42
|
+
<div class="size-row">
|
43
|
+
<EbizTimePicker v-model="value7" size="small" placeholder="小尺寸" />
|
44
|
+
<EbizTimePicker v-model="value7" size="medium" placeholder="中尺寸(默认)" />
|
45
|
+
<EbizTimePicker v-model="value7" size="large" placeholder="大尺寸" />
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<h3>提示信息</h3>
|
50
|
+
<div class="demo-section">
|
51
|
+
<EbizTimePicker v-model="value8" tips="这是一个提示文本" placeholder="带提示信息" />
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<h3>前置/后置插槽</h3>
|
55
|
+
<div class="demo-section">
|
56
|
+
<EbizTimePicker v-model="value9" placeholder="带前置内容">
|
57
|
+
<template #prepend>
|
58
|
+
<span class="prepend-content">时间:</span>
|
59
|
+
</template>
|
60
|
+
</EbizTimePicker>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
</template>
|
64
|
+
|
65
|
+
<script setup>
|
66
|
+
import { ref } from 'vue';
|
67
|
+
import { EbizTimePicker } from '../index.js';
|
68
|
+
|
69
|
+
// 基本用法
|
70
|
+
const value1 = ref('');
|
71
|
+
|
72
|
+
// 时间格式
|
73
|
+
const value2 = ref('');
|
74
|
+
|
75
|
+
// 禁用状态
|
76
|
+
const value3 = ref('12:30:00');
|
77
|
+
|
78
|
+
// 时间范围选择
|
79
|
+
const value4 = ref(['09:00:00', '18:00:00']);
|
80
|
+
|
81
|
+
// 步长设置
|
82
|
+
const value5 = ref('');
|
83
|
+
|
84
|
+
// 禁用时间
|
85
|
+
const value6 = ref('');
|
86
|
+
const disableTime = (h) => {
|
87
|
+
// 禁用上午时间段 (0-12点)
|
88
|
+
return h < 12;
|
89
|
+
};
|
90
|
+
|
91
|
+
// 不同尺寸
|
92
|
+
const value7 = ref('');
|
93
|
+
|
94
|
+
// 提示信息
|
95
|
+
const value8 = ref('');
|
96
|
+
|
97
|
+
// 前置/后置插槽
|
98
|
+
const value9 = ref('');
|
99
|
+
</script>
|
100
|
+
|
101
|
+
<style scoped>
|
102
|
+
.time-picker-demo {
|
103
|
+
padding: 20px;
|
104
|
+
max-width: 800px;
|
105
|
+
margin: 0 auto;
|
106
|
+
}
|
107
|
+
|
108
|
+
h2 {
|
109
|
+
margin-bottom: 30px;
|
110
|
+
font-weight: 500;
|
111
|
+
border-bottom: 1px solid #eee;
|
112
|
+
padding-bottom: 10px;
|
113
|
+
}
|
114
|
+
|
115
|
+
h3 {
|
116
|
+
margin-top: 30px;
|
117
|
+
margin-bottom: 15px;
|
118
|
+
font-weight: 400;
|
119
|
+
font-size: 18px;
|
120
|
+
color: #333;
|
121
|
+
}
|
122
|
+
|
123
|
+
.demo-section {
|
124
|
+
margin-bottom: 30px;
|
125
|
+
padding: 20px;
|
126
|
+
background-color: #f9f9f9;
|
127
|
+
border-radius: 4px;
|
128
|
+
}
|
129
|
+
|
130
|
+
.demo-value {
|
131
|
+
margin-top: 10px;
|
132
|
+
color: #606060;
|
133
|
+
font-size: 14px;
|
134
|
+
padding: 5px 0;
|
135
|
+
}
|
136
|
+
|
137
|
+
.size-row {
|
138
|
+
display: flex;
|
139
|
+
gap: 20px;
|
140
|
+
align-items: center;
|
141
|
+
}
|
142
|
+
|
143
|
+
.prepend-content {
|
144
|
+
padding: 0 10px;
|
145
|
+
color: #0052D9;
|
146
|
+
}
|
147
|
+
</style>
|