@ebiz/designer-components 0.0.18 → 0.0.19
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/package.json +3 -2
- package/src/apiService/mockDataService.js +116 -0
- package/src/apiService/simpleDataService.js +186 -80
- package/src/components/Button.vue +72 -22
- package/src/components/EbizAvatar.vue +116 -0
- package/src/components/EbizCheckbox.vue +94 -0
- package/src/components/EbizCheckboxGroup.vue +70 -0
- package/src/components/EbizDetailBlock.vue +82 -0
- package/src/components/EbizDialog.vue +244 -56
- package/src/components/EbizEmployeeInfo.vue +139 -0
- package/src/components/EbizFileUpload.vue +202 -0
- package/src/components/EbizPageHeader.vue +96 -0
- package/src/components/EbizPagination.vue +163 -0
- package/src/components/EbizRadio.vue +87 -0
- package/src/components/EbizRadioGroup.vue +84 -0
- package/src/components/EbizRemoteSelect.vue +118 -40
- package/src/components/EbizSpace.vue +101 -0
- package/src/components/EbizStatistic.vue +150 -0
- package/src/components/EbizSwiper.vue +114 -0
- package/src/components/EbizSwiperItem.vue +14 -0
- package/src/components/EbizSwitch.vue +86 -0
- package/src/components/EbizTabHeader.vue +145 -0
- package/src/components/EbizTabPanel.vue +23 -0
- package/src/components/EbizTable.vue +466 -0
- package/src/components/EbizTableColumn.vue +117 -0
- package/src/components/EbizTableSort.vue +181 -0
- package/src/components/EbizTabs.vue +133 -91
- package/src/components/EbizTimePicker.vue +144 -0
- package/src/components/EbizTitle.vue +3 -10
- package/src/components/EbizTree.vue +153 -0
- package/src/components/EbizTreeSelector.vue +423 -0
- package/src/components/Home.vue +8 -0
- package/src/components/TdesignAlert.vue +116 -0
- package/src/components/TdesignButton.vue +130 -0
- package/src/components/TdesignCalendar/index.vue +146 -0
- package/src/components/TdesignCard.vue +196 -0
- package/src/components/TdesignCol.vue +102 -0
- package/src/components/TdesignCollapse.vue +143 -0
- package/src/components/TdesignCollapsePanel.vue +80 -0
- package/src/components/TdesignDatePicker.vue +125 -0
- package/src/components/TdesignDialog.vue +226 -0
- package/src/components/TdesignForm.vue +134 -0
- package/src/components/TdesignFormItem.vue +106 -0
- package/src/components/TdesignGrid.vue +56 -0
- package/src/components/TdesignIcon.vue +68 -0
- package/src/components/TdesignImage.vue +163 -0
- package/src/components/TdesignImageViewer.vue +201 -0
- package/src/components/TdesignInput.vue +243 -0
- package/src/components/TdesignSelect.vue +445 -0
- package/src/components/TdesignTag.vue +118 -0
- package/src/components/TdesignTextarea.vue +143 -0
- package/src/components/TdesignTimeline.vue +58 -0
- package/src/components/TdesignTimelineItem.vue +72 -0
- package/src/components/TdesignUpload.vue +757 -0
- package/src/components/TdesignWatermark.vue +108 -0
- package/src/index.js +130 -0
- package/src/main.js +20 -4
- package/src/router/index.js +244 -5
- package/src/views/Button.vue +7 -3
- package/src/views/CheckboxDemo.vue +105 -0
- package/src/views/DialogDemo.vue +126 -0
- package/src/views/EbizAvatar.vue +224 -0
- package/src/views/EbizDetailBlockDemo.vue +31 -0
- package/src/views/EbizEmployeeInfo.vue +250 -0
- package/src/views/EbizRadioDemo.vue +152 -0
- package/src/views/EbizSpace.vue +186 -0
- package/src/views/EbizSwiper.vue +158 -0
- package/src/views/GridDemo.vue +239 -0
- package/src/views/Home.vue +63 -2
- package/src/views/PageHeaderDemo.vue +105 -0
- package/src/views/PaginationDemo.vue +97 -0
- package/src/views/RemoteSelect.vue +336 -5
- package/src/views/StatisticDemo.vue +191 -0
- package/src/views/SwitchDemo.vue +80 -0
- package/src/views/TableDemo.vue +335 -0
- package/src/views/TableSortDemo.vue +144 -0
- package/src/views/TableView.vue +69 -0
- package/src/views/TabsDemo.vue +283 -0
- package/src/views/TagDemo.vue +102 -0
- package/src/views/TdesignAlert.vue +99 -0
- package/src/views/TdesignButton.vue +191 -0
- package/src/views/TdesignCalendar.vue +95 -0
- package/src/views/TdesignCard.vue +297 -0
- package/src/views/TdesignCollapse.vue +294 -0
- package/src/views/TdesignDatePicker.vue +188 -0
- package/src/views/TdesignForm.vue +249 -0
- package/src/views/TdesignIcon.vue +204 -0
- package/src/views/TdesignImage.vue +216 -0
- package/src/views/TdesignImageViewer.vue +199 -0
- package/src/views/TdesignInput.vue +253 -0
- package/src/views/TdesignSelect.vue +474 -0
- package/src/views/TdesignSwiper.vue +158 -0
- package/src/views/TextareaDemo.vue +94 -0
- package/src/views/TimePickerDemo.vue +147 -0
- package/src/views/TimelineDemo.vue +161 -0
- package/src/views/TreeDemo.vue +255 -0
- package/src/views/TreeSelectorDemo.vue +246 -0
- package/src/views/UploadDemo.vue +122 -0
- package/src/views/WatermarkDemo.vue +86 -0
@@ -0,0 +1,116 @@
|
|
1
|
+
<template>
|
2
|
+
<t-alert
|
3
|
+
:theme="theme"
|
4
|
+
:title="title"
|
5
|
+
:message="message"
|
6
|
+
:icon="icon"
|
7
|
+
:close="close"
|
8
|
+
:maxLine="maxLine"
|
9
|
+
:operation="operation"
|
10
|
+
:description="description"
|
11
|
+
:close-btn="closeBtn"
|
12
|
+
:default-open="defaultOpen"
|
13
|
+
@close="handleClose"
|
14
|
+
>
|
15
|
+
<!-- 标题插槽 -->
|
16
|
+
<template v-if="$slots.title" #title>
|
17
|
+
<slot name="title"></slot>
|
18
|
+
</template>
|
19
|
+
|
20
|
+
<!-- 内容插槽 -->
|
21
|
+
<template v-if="$slots.default">
|
22
|
+
<slot></slot>
|
23
|
+
</template>
|
24
|
+
|
25
|
+
<!-- 操作区插槽 -->
|
26
|
+
<template v-if="$slots.operation" #operation>
|
27
|
+
<slot name="operation"></slot>
|
28
|
+
</template>
|
29
|
+
|
30
|
+
<!-- 关闭按钮插槽 -->
|
31
|
+
<template v-if="$slots['close-btn']" #close-btn>
|
32
|
+
<slot name="close-btn"></slot>
|
33
|
+
</template>
|
34
|
+
|
35
|
+
<!-- 图标插槽 -->
|
36
|
+
<template v-if="$slots.icon" #icon>
|
37
|
+
<slot name="icon"></slot>
|
38
|
+
</template>
|
39
|
+
</t-alert>
|
40
|
+
</template>
|
41
|
+
|
42
|
+
<script>
|
43
|
+
export default {
|
44
|
+
name: "EbizAlert"
|
45
|
+
}
|
46
|
+
</script>
|
47
|
+
|
48
|
+
<script setup>
|
49
|
+
import { defineProps, defineEmits } from 'vue';
|
50
|
+
import { Alert as TAlert } from 'tdesign-vue-next';
|
51
|
+
|
52
|
+
const props = defineProps({
|
53
|
+
// 主题
|
54
|
+
theme: {
|
55
|
+
type: String,
|
56
|
+
default: 'info',
|
57
|
+
validator: (val) => ['success', 'info', 'warning', 'error'].includes(val)
|
58
|
+
},
|
59
|
+
// 标题
|
60
|
+
title: {
|
61
|
+
type: String,
|
62
|
+
default: ''
|
63
|
+
},
|
64
|
+
// 内容
|
65
|
+
message: {
|
66
|
+
type: String,
|
67
|
+
default: ''
|
68
|
+
},
|
69
|
+
// 图标
|
70
|
+
icon: {
|
71
|
+
type: [Boolean, Function],
|
72
|
+
default: true
|
73
|
+
},
|
74
|
+
// 关闭按钮
|
75
|
+
close: {
|
76
|
+
type: Boolean,
|
77
|
+
default: false
|
78
|
+
},
|
79
|
+
// 内容显示最大行数
|
80
|
+
maxLine: {
|
81
|
+
type: Number,
|
82
|
+
default: 0
|
83
|
+
},
|
84
|
+
// 操作区内容
|
85
|
+
operation: {
|
86
|
+
type: [String, Function],
|
87
|
+
default: ''
|
88
|
+
},
|
89
|
+
// 描述内容
|
90
|
+
description: {
|
91
|
+
type: String,
|
92
|
+
default: ''
|
93
|
+
},
|
94
|
+
// 关闭按钮内容
|
95
|
+
closeBtn: {
|
96
|
+
type: [String, Function, Boolean],
|
97
|
+
default: undefined
|
98
|
+
},
|
99
|
+
// 默认是否显示打开
|
100
|
+
defaultOpen: {
|
101
|
+
type: Boolean,
|
102
|
+
default: true
|
103
|
+
}
|
104
|
+
});
|
105
|
+
|
106
|
+
const emit = defineEmits(['close']);
|
107
|
+
|
108
|
+
// 关闭事件
|
109
|
+
const handleClose = (e) => {
|
110
|
+
emit('close', e);
|
111
|
+
};
|
112
|
+
</script>
|
113
|
+
|
114
|
+
<style lang="less" scoped>
|
115
|
+
/* 自定义样式 */
|
116
|
+
</style>
|
@@ -0,0 +1,130 @@
|
|
1
|
+
<template>
|
2
|
+
<t-button
|
3
|
+
:block="block"
|
4
|
+
:content="content"
|
5
|
+
:disabled="disabled"
|
6
|
+
:ghost="ghost"
|
7
|
+
:href="href"
|
8
|
+
:loading="loading"
|
9
|
+
:shape="shape"
|
10
|
+
:size="size"
|
11
|
+
:tag="tag"
|
12
|
+
:theme="theme"
|
13
|
+
:type="type"
|
14
|
+
:variant="variant"
|
15
|
+
@click="handleClick"
|
16
|
+
>
|
17
|
+
<!-- 图标插槽 -->
|
18
|
+
<template v-if="$slots.icon" #icon>
|
19
|
+
<slot name="icon"></slot>
|
20
|
+
</template>
|
21
|
+
|
22
|
+
<!-- 后缀插槽 -->
|
23
|
+
<template v-if="$slots.suffix" #suffix>
|
24
|
+
<slot name="suffix"></slot>
|
25
|
+
</template>
|
26
|
+
|
27
|
+
<!-- 加载中插槽 -->
|
28
|
+
<template v-if="$slots.loading" #loading>
|
29
|
+
<slot name="loading"></slot>
|
30
|
+
</template>
|
31
|
+
|
32
|
+
<!-- 内容插槽 -->
|
33
|
+
<template v-if="$slots.content" #content>
|
34
|
+
<slot name="content"></slot>
|
35
|
+
</template>
|
36
|
+
|
37
|
+
<!-- 默认插槽 -->
|
38
|
+
<slot>{{ content }}</slot>
|
39
|
+
</t-button>
|
40
|
+
</template>
|
41
|
+
|
42
|
+
<script>
|
43
|
+
export default {
|
44
|
+
name: "EbizTdesignButton"
|
45
|
+
}
|
46
|
+
</script>
|
47
|
+
|
48
|
+
<script setup>
|
49
|
+
import { defineProps, defineEmits } from 'vue';
|
50
|
+
import { Button as TButton } from 'tdesign-vue-next';
|
51
|
+
|
52
|
+
defineProps({
|
53
|
+
// 是否为块级元素
|
54
|
+
block: {
|
55
|
+
type: Boolean,
|
56
|
+
default: false
|
57
|
+
},
|
58
|
+
// 按钮内容
|
59
|
+
content: {
|
60
|
+
type: String,
|
61
|
+
default: ''
|
62
|
+
},
|
63
|
+
// 禁用状态
|
64
|
+
disabled: {
|
65
|
+
type: Boolean,
|
66
|
+
default: false
|
67
|
+
},
|
68
|
+
// 是否为幽灵按钮
|
69
|
+
ghost: {
|
70
|
+
type: Boolean,
|
71
|
+
default: false
|
72
|
+
},
|
73
|
+
// 跳转链接
|
74
|
+
href: {
|
75
|
+
type: String,
|
76
|
+
default: ''
|
77
|
+
},
|
78
|
+
// 是否显示为加载状态
|
79
|
+
loading: {
|
80
|
+
type: Boolean,
|
81
|
+
default: false
|
82
|
+
},
|
83
|
+
// 按钮形状
|
84
|
+
shape: {
|
85
|
+
type: String,
|
86
|
+
default: 'rectangle',
|
87
|
+
validator: (val) => ['rectangle', 'square', 'round', 'circle'].includes(val)
|
88
|
+
},
|
89
|
+
// 组件尺寸
|
90
|
+
size: {
|
91
|
+
type: String,
|
92
|
+
default: 'medium',
|
93
|
+
validator: (val) => ['extra-small', 'small', 'medium', 'large'].includes(val)
|
94
|
+
},
|
95
|
+
// 渲染按钮的HTML标签
|
96
|
+
tag: {
|
97
|
+
type: String,
|
98
|
+
default: 'button',
|
99
|
+
validator: (val) => ['button', 'a', 'div'].includes(val)
|
100
|
+
},
|
101
|
+
// 组件风格
|
102
|
+
theme: {
|
103
|
+
type: String,
|
104
|
+
default: 'default',
|
105
|
+
validator: (val) => ['default', 'primary', 'danger', 'warning', 'success'].includes(val)
|
106
|
+
},
|
107
|
+
// 按钮类型
|
108
|
+
type: {
|
109
|
+
type: String,
|
110
|
+
default: 'button',
|
111
|
+
validator: (val) => ['submit', 'reset', 'button'].includes(val)
|
112
|
+
},
|
113
|
+
// 按钮形式
|
114
|
+
variant: {
|
115
|
+
type: String,
|
116
|
+
default: 'base',
|
117
|
+
validator: (val) => ['base', 'outline', 'dashed', 'text'].includes(val)
|
118
|
+
}
|
119
|
+
});
|
120
|
+
|
121
|
+
const emit = defineEmits(['click']);
|
122
|
+
|
123
|
+
const handleClick = (e) => {
|
124
|
+
emit('click', e);
|
125
|
+
};
|
126
|
+
</script>
|
127
|
+
|
128
|
+
<style lang="less" scoped>
|
129
|
+
/* 自定义样式 */
|
130
|
+
</style>
|
@@ -0,0 +1,146 @@
|
|
1
|
+
<template>
|
2
|
+
<t-calendar
|
3
|
+
:cell-click="cellClick"
|
4
|
+
:controller="controller"
|
5
|
+
:cell-append="cellAppend"
|
6
|
+
:cell-data="cellData"
|
7
|
+
:firstDayOfWeek="firstDayOfWeek"
|
8
|
+
:format="format"
|
9
|
+
:head-mode="headMode"
|
10
|
+
:is-full-screen="isFullScreen"
|
11
|
+
:multiple="multiple"
|
12
|
+
:month="month"
|
13
|
+
:mode="mode"
|
14
|
+
:month-change="monthChange"
|
15
|
+
:render-cell="renderCell"
|
16
|
+
:theme="theme"
|
17
|
+
:value="modelValue"
|
18
|
+
:year="year"
|
19
|
+
@cell-click="handleCellClick"
|
20
|
+
@cell-double-click="handleCellDoubleClick"
|
21
|
+
@cell-right-click="handleCellRightClick"
|
22
|
+
@month-change="handleMonthChange"
|
23
|
+
>
|
24
|
+
<template v-if="$slots.head" #head>
|
25
|
+
<slot name="head"></slot>
|
26
|
+
</template>
|
27
|
+
<template v-if="$slots.cellAppend" #cellAppend="slotProps">
|
28
|
+
<slot name="cellAppend" v-bind="slotProps"></slot>
|
29
|
+
</template>
|
30
|
+
<template v-if="$slots.cell" #cell="slotProps">
|
31
|
+
<slot name="cell" v-bind="slotProps"></slot>
|
32
|
+
</template>
|
33
|
+
<template v-if="$slots.month" #month>
|
34
|
+
<slot name="month"></slot>
|
35
|
+
</template>
|
36
|
+
<template v-if="$slots.year" #year>
|
37
|
+
<slot name="year"></slot>
|
38
|
+
</template>
|
39
|
+
<template v-if="$slots.control" #control>
|
40
|
+
<slot name="control"></slot>
|
41
|
+
</template>
|
42
|
+
</t-calendar>
|
43
|
+
</template>
|
44
|
+
|
45
|
+
<script>
|
46
|
+
import { Calendar as TCalendar } from 'tdesign-vue-next'
|
47
|
+
|
48
|
+
export default {
|
49
|
+
name: 'TdesignCalendar',
|
50
|
+
components: {
|
51
|
+
't-calendar': TCalendar
|
52
|
+
},
|
53
|
+
props: {
|
54
|
+
cellAppend: {
|
55
|
+
type: Function,
|
56
|
+
default: null
|
57
|
+
},
|
58
|
+
cellClick: {
|
59
|
+
type: Function,
|
60
|
+
default: null
|
61
|
+
},
|
62
|
+
cellData: {
|
63
|
+
type: Function,
|
64
|
+
default: null
|
65
|
+
},
|
66
|
+
controller: {
|
67
|
+
type: Object,
|
68
|
+
default: () => ({ visible: true })
|
69
|
+
},
|
70
|
+
firstDayOfWeek: {
|
71
|
+
type: Number,
|
72
|
+
default: 1,
|
73
|
+
validator: (val) => [1, 2, 3, 4, 5, 6, 7].includes(val)
|
74
|
+
},
|
75
|
+
format: {
|
76
|
+
type: String,
|
77
|
+
default: undefined
|
78
|
+
},
|
79
|
+
headMode: {
|
80
|
+
type: String,
|
81
|
+
default: 'month-only',
|
82
|
+
validator: (val) => ['month-only', 'year-month'].includes(val)
|
83
|
+
},
|
84
|
+
isFullScreen: {
|
85
|
+
type: Boolean,
|
86
|
+
default: true
|
87
|
+
},
|
88
|
+
mode: {
|
89
|
+
type: String,
|
90
|
+
default: 'month',
|
91
|
+
validator: (val) => ['month', 'year'].includes(val)
|
92
|
+
},
|
93
|
+
month: {
|
94
|
+
type: Number,
|
95
|
+
default: undefined
|
96
|
+
},
|
97
|
+
monthChange: {
|
98
|
+
type: Function,
|
99
|
+
default: null
|
100
|
+
},
|
101
|
+
multiple: {
|
102
|
+
type: Boolean,
|
103
|
+
default: false
|
104
|
+
},
|
105
|
+
renderCell: {
|
106
|
+
type: Function,
|
107
|
+
default: null
|
108
|
+
},
|
109
|
+
theme: {
|
110
|
+
type: String,
|
111
|
+
default: 'full',
|
112
|
+
validator: (val) => ['full', 'card'].includes(val)
|
113
|
+
},
|
114
|
+
modelValue: {
|
115
|
+
type: [String, Number, Array, Date],
|
116
|
+
default: null
|
117
|
+
},
|
118
|
+
year: {
|
119
|
+
type: Number,
|
120
|
+
default: undefined
|
121
|
+
}
|
122
|
+
},
|
123
|
+
emits: ['cell-click', 'cell-double-click', 'cell-right-click', 'month-change', 'update:modelValue'],
|
124
|
+
methods: {
|
125
|
+
handleCellClick(options) {
|
126
|
+
this.$emit('cell-click', options)
|
127
|
+
if (options && options.date) {
|
128
|
+
this.$emit('update:modelValue', options.date)
|
129
|
+
}
|
130
|
+
},
|
131
|
+
handleCellDoubleClick(options) {
|
132
|
+
this.$emit('cell-double-click', options)
|
133
|
+
},
|
134
|
+
handleCellRightClick(options) {
|
135
|
+
this.$emit('cell-right-click', options)
|
136
|
+
},
|
137
|
+
handleMonthChange(options) {
|
138
|
+
this.$emit('month-change', options)
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}
|
142
|
+
</script>
|
143
|
+
|
144
|
+
<style scoped>
|
145
|
+
/* 可以在这里添加自定义样式 */
|
146
|
+
</style>
|
@@ -0,0 +1,196 @@
|
|
1
|
+
<template>
|
2
|
+
<td-card
|
3
|
+
:actions="actions"
|
4
|
+
:avatar="avatar"
|
5
|
+
:bordered="bordered"
|
6
|
+
:cover="cover"
|
7
|
+
:description="description"
|
8
|
+
:footer="footer"
|
9
|
+
:header="header"
|
10
|
+
:headerBordered="headerBordered"
|
11
|
+
:hoverShadow="hoverShadow"
|
12
|
+
:loading="loading"
|
13
|
+
:loadingProps="loadingProps"
|
14
|
+
:shadow="shadow"
|
15
|
+
:size="size"
|
16
|
+
:status="status"
|
17
|
+
:subtitle="subtitle"
|
18
|
+
:theme="theme"
|
19
|
+
:title="title"
|
20
|
+
@click="handleClick"
|
21
|
+
>
|
22
|
+
<!-- 操作区域插槽 -->
|
23
|
+
<template v-if="$slots.actions" #actions>
|
24
|
+
<slot name="actions"></slot>
|
25
|
+
</template>
|
26
|
+
|
27
|
+
<!-- 头像插槽 -->
|
28
|
+
<template v-if="$slots.avatar" #avatar>
|
29
|
+
<slot name="avatar"></slot>
|
30
|
+
</template>
|
31
|
+
|
32
|
+
<!-- 内容插槽 -->
|
33
|
+
<template v-if="$slots.content" #content>
|
34
|
+
<slot name="content"></slot>
|
35
|
+
</template>
|
36
|
+
|
37
|
+
<!-- 封面图插槽 -->
|
38
|
+
<template v-if="$slots.cover" #cover>
|
39
|
+
<slot name="cover"></slot>
|
40
|
+
</template>
|
41
|
+
|
42
|
+
<!-- 默认内容插槽 -->
|
43
|
+
<template v-if="$slots.default" #default>
|
44
|
+
<slot name="default"></slot>
|
45
|
+
</template>
|
46
|
+
|
47
|
+
<!-- 描述文案插槽 -->
|
48
|
+
<template v-if="$slots.description" #description>
|
49
|
+
<slot name="description"></slot>
|
50
|
+
</template>
|
51
|
+
|
52
|
+
<!-- 底部内容插槽 -->
|
53
|
+
<template v-if="$slots.footer" #footer>
|
54
|
+
<slot name="footer"></slot>
|
55
|
+
</template>
|
56
|
+
|
57
|
+
<!-- 顶部内容插槽 -->
|
58
|
+
<template v-if="$slots.header" #header>
|
59
|
+
<slot name="header"></slot>
|
60
|
+
</template>
|
61
|
+
|
62
|
+
<!-- 加载状态插槽 -->
|
63
|
+
<template v-if="$slots.loading" #loading>
|
64
|
+
<slot name="loading"></slot>
|
65
|
+
</template>
|
66
|
+
|
67
|
+
<!-- 副标题插槽 -->
|
68
|
+
<template v-if="$slots.subtitle" #subtitle>
|
69
|
+
<slot name="subtitle"></slot>
|
70
|
+
</template>
|
71
|
+
|
72
|
+
<!-- 标题插槽 -->
|
73
|
+
<template v-if="$slots.title" #title>
|
74
|
+
<slot name="title"></slot>
|
75
|
+
</template>
|
76
|
+
|
77
|
+
<!-- 默认插槽 -->
|
78
|
+
<slot></slot>
|
79
|
+
</td-card>
|
80
|
+
</template>
|
81
|
+
|
82
|
+
<script>
|
83
|
+
export default {
|
84
|
+
name: "EbizTdesignCard"
|
85
|
+
}
|
86
|
+
</script>
|
87
|
+
|
88
|
+
<script setup>
|
89
|
+
import { defineProps, defineEmits } from 'vue';
|
90
|
+
import { Card as TdCard } from 'tdesign-vue-next';
|
91
|
+
|
92
|
+
defineProps({
|
93
|
+
// 卡片操作区
|
94
|
+
actions: {
|
95
|
+
type: [String, Object, Function],
|
96
|
+
default: ''
|
97
|
+
},
|
98
|
+
// 卡片中的用户头像,仅在海报风格的卡片中有效
|
99
|
+
avatar: {
|
100
|
+
type: [String, Object, Function],
|
101
|
+
default: ''
|
102
|
+
},
|
103
|
+
// 是否有边框
|
104
|
+
bordered: {
|
105
|
+
type: Boolean,
|
106
|
+
default: true
|
107
|
+
},
|
108
|
+
// 卡片内容
|
109
|
+
content: {
|
110
|
+
type: [String, Object, Function],
|
111
|
+
default: ''
|
112
|
+
},
|
113
|
+
// 卡片封面图
|
114
|
+
cover: {
|
115
|
+
type: [String, Object, Function],
|
116
|
+
default: ''
|
117
|
+
},
|
118
|
+
// 卡片描述文案
|
119
|
+
description: {
|
120
|
+
type: [String, Object, Function],
|
121
|
+
default: ''
|
122
|
+
},
|
123
|
+
// 卡片底部内容,可完全自定义
|
124
|
+
footer: {
|
125
|
+
type: [String, Object, Function],
|
126
|
+
default: ''
|
127
|
+
},
|
128
|
+
// 卡片顶部内容,优先级高于其他所有元素
|
129
|
+
header: {
|
130
|
+
type: [String, Object, Function],
|
131
|
+
default: ''
|
132
|
+
},
|
133
|
+
// 头部是否带分割线,仅在有header时有效
|
134
|
+
headerBordered: {
|
135
|
+
type: Boolean,
|
136
|
+
default: false
|
137
|
+
},
|
138
|
+
// hover时是否有阴影
|
139
|
+
hoverShadow: {
|
140
|
+
type: Boolean,
|
141
|
+
default: false
|
142
|
+
},
|
143
|
+
// 加载状态
|
144
|
+
loading: {
|
145
|
+
type: [Boolean, Object, Function],
|
146
|
+
default: false
|
147
|
+
},
|
148
|
+
// 透传加载组件(Loading)全部属性
|
149
|
+
loadingProps: {
|
150
|
+
type: Object,
|
151
|
+
default: () => ({})
|
152
|
+
},
|
153
|
+
// 是否显示卡片阴影
|
154
|
+
shadow: {
|
155
|
+
type: Boolean,
|
156
|
+
default: false
|
157
|
+
},
|
158
|
+
// 尺寸
|
159
|
+
size: {
|
160
|
+
type: String,
|
161
|
+
default: 'medium',
|
162
|
+
validator: (val) => ['medium', 'small'].includes(val)
|
163
|
+
},
|
164
|
+
// 卡片状态内容,仅在操作区域不在顶部时有效(即 theme=poster2)
|
165
|
+
status: {
|
166
|
+
type: String,
|
167
|
+
default: ''
|
168
|
+
},
|
169
|
+
// 卡片副标题
|
170
|
+
subtitle: {
|
171
|
+
type: [String, Object, Function],
|
172
|
+
default: ''
|
173
|
+
},
|
174
|
+
// 卡片风格
|
175
|
+
theme: {
|
176
|
+
type: String,
|
177
|
+
default: 'normal',
|
178
|
+
validator: (val) => ['normal', 'poster1', 'poster2'].includes(val)
|
179
|
+
},
|
180
|
+
// 卡片标题
|
181
|
+
title: {
|
182
|
+
type: [String, Object, Function],
|
183
|
+
default: ''
|
184
|
+
}
|
185
|
+
});
|
186
|
+
|
187
|
+
const emit = defineEmits(['click']);
|
188
|
+
|
189
|
+
const handleClick = (e) => {
|
190
|
+
emit('click', e);
|
191
|
+
};
|
192
|
+
</script>
|
193
|
+
|
194
|
+
<style lang="less" scoped>
|
195
|
+
/* 自定义样式 */
|
196
|
+
</style>
|
@@ -0,0 +1,102 @@
|
|
1
|
+
<template>
|
2
|
+
<t-col
|
3
|
+
:span="span"
|
4
|
+
:order="order"
|
5
|
+
:offset="offset"
|
6
|
+
:push="push"
|
7
|
+
:pull="pull"
|
8
|
+
:flex="flex"
|
9
|
+
:xs="xs"
|
10
|
+
:sm="sm"
|
11
|
+
:md="md"
|
12
|
+
:lg="lg"
|
13
|
+
:xl="xl"
|
14
|
+
:xxl="xxl"
|
15
|
+
:tag="tag"
|
16
|
+
>
|
17
|
+
<slot></slot>
|
18
|
+
</t-col>
|
19
|
+
</template>
|
20
|
+
|
21
|
+
<script>
|
22
|
+
export default {
|
23
|
+
name: "EbizCol"
|
24
|
+
}
|
25
|
+
</script>
|
26
|
+
|
27
|
+
<script setup>
|
28
|
+
import { defineProps } from 'vue';
|
29
|
+
import { Col as TCol } from 'tdesign-vue-next';
|
30
|
+
|
31
|
+
defineProps({
|
32
|
+
// 栅格占位格数,0-24之间的数值
|
33
|
+
span: {
|
34
|
+
type: [String, Number],
|
35
|
+
default: undefined
|
36
|
+
},
|
37
|
+
// 栅格顺序,用于在flex布局下调整顺序
|
38
|
+
order: {
|
39
|
+
type: [String, Number],
|
40
|
+
default: undefined
|
41
|
+
},
|
42
|
+
// 栅格左侧的间隔格数,间隔内不可以有栅格
|
43
|
+
offset: {
|
44
|
+
type: [String, Number],
|
45
|
+
default: undefined
|
46
|
+
},
|
47
|
+
// 栅格向右移动格数
|
48
|
+
push: {
|
49
|
+
type: [String, Number],
|
50
|
+
default: undefined
|
51
|
+
},
|
52
|
+
// 栅格向左移动格数
|
53
|
+
pull: {
|
54
|
+
type: [String, Number],
|
55
|
+
default: undefined
|
56
|
+
},
|
57
|
+
// flex 布局属性
|
58
|
+
flex: {
|
59
|
+
type: [String, Number],
|
60
|
+
default: undefined
|
61
|
+
},
|
62
|
+
// <768px 响应式栅格,可为栅格数或一个包含栅格参数的对象
|
63
|
+
xs: {
|
64
|
+
type: [String, Number, Object],
|
65
|
+
default: undefined
|
66
|
+
},
|
67
|
+
// ≥768px 响应式栅格,可为栅格数或一个包含栅格参数的对象
|
68
|
+
sm: {
|
69
|
+
type: [String, Number, Object],
|
70
|
+
default: undefined
|
71
|
+
},
|
72
|
+
// ≥992px 响应式栅格,可为栅格数或一个包含栅格参数的对象
|
73
|
+
md: {
|
74
|
+
type: [String, Number, Object],
|
75
|
+
default: undefined
|
76
|
+
},
|
77
|
+
// ≥1200px 响应式栅格,可为栅格数或一个包含栅格参数的对象
|
78
|
+
lg: {
|
79
|
+
type: [String, Number, Object],
|
80
|
+
default: undefined
|
81
|
+
},
|
82
|
+
// ≥1400px 响应式栅格,可为栅格数或一个包含栅格参数的对象
|
83
|
+
xl: {
|
84
|
+
type: [String, Number, Object],
|
85
|
+
default: undefined
|
86
|
+
},
|
87
|
+
// ≥1880px 响应式栅格,可为栅格数或一个包含栅格参数的对象
|
88
|
+
xxl: {
|
89
|
+
type: [String, Number, Object],
|
90
|
+
default: undefined
|
91
|
+
},
|
92
|
+
// 自定义元素标签
|
93
|
+
tag: {
|
94
|
+
type: String,
|
95
|
+
default: 'div'
|
96
|
+
}
|
97
|
+
});
|
98
|
+
</script>
|
99
|
+
|
100
|
+
<style lang="less" scoped>
|
101
|
+
/* 自定义样式 */
|
102
|
+
</style>
|