ct-component-plus 0.0.42 → 0.0.43
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 +36 -36
- package/packages/components/button/index.js +8 -8
- package/packages/components/button/src/button.vue +171 -171
- package/packages/components/cascader/index.js +7 -7
- package/packages/components/cascader/src/cascader.vue +247 -247
- package/packages/components/cascader/src/ct-cascader.vue +260 -260
- package/packages/components/cascader/src/index.js +50 -50
- package/packages/components/checkbox/index.js +7 -7
- package/packages/components/checkbox/src/checkbox.vue +51 -51
- package/packages/components/checkbox/src/index.js +12 -12
- package/packages/components/date-picker/index.js +8 -8
- package/packages/components/date-picker/src/clear-icon.vue +2 -2
- package/packages/components/date-picker/src/date-icon.vue +2 -2
- package/packages/components/date-picker/src/date-picker.vue +77 -77
- package/packages/components/date-picker/src/index.js +33 -33
- package/packages/components/dialog/index.js +8 -8
- package/packages/components/dialog/src/dialog.vue +103 -103
- package/packages/components/empty/index.js +8 -8
- package/packages/components/empty/src/empty.vue +97 -97
- package/packages/components/index.js +81 -81
- package/packages/components/input/index.js +7 -7
- package/packages/components/input/src/index.js +13 -13
- package/packages/components/input/src/input.vue +106 -106
- package/packages/components/input-range/index.js +7 -7
- package/packages/components/input-range/src/index.js +29 -29
- package/packages/components/input-range/src/input-range.vue +233 -233
- package/packages/components/loading/index.js +7 -7
- package/packages/components/loading/src/CtLoading.vue +74 -74
- package/packages/components/loading/src/beating.vue +71 -71
- package/packages/components/loading/src/progress.vue +120 -120
- package/packages/components/loading/src/spinner.vue +38 -38
- package/packages/components/menu/index.js +7 -7
- package/packages/components/menu/src/item.vue +46 -46
- package/packages/components/menu/src/link.vue +28 -28
- package/packages/components/menu/src/logo.vue +25 -25
- package/packages/components/menu/src/menu-item.vue +103 -103
- package/packages/components/menu/src/menu.vue +191 -191
- package/packages/components/menu/src/utils/index.js +4 -4
- package/packages/components/message/icon/ErrorIcon.vue +25 -25
- package/packages/components/message/icon/InfoIcon.vue +25 -25
- package/packages/components/message/icon/SuccessIcon.vue +25 -25
- package/packages/components/message/icon/WarningIcon.vue +25 -25
- package/packages/components/message/index.js +8 -8
- package/packages/components/message/src/method.js +54 -54
- package/packages/components/message-box/index.js +7 -7
- package/packages/components/message-box/src/message-box.vue +107 -107
- package/packages/components/page/index.js +7 -7
- package/packages/components/page/src/modules/DownloadButton.vue +21 -21
- package/packages/components/page/src/modules/TableTitle.vue +151 -151
- package/packages/components/page/src/page.vue +382 -382
- package/packages/components/pagination/index.js +7 -7
- package/packages/components/pagination/src/pagination.vue +36 -36
- package/packages/components/radio/index.js +7 -7
- package/packages/components/radio/src/index.js +12 -12
- package/packages/components/radio/src/radio.vue +47 -47
- package/packages/components/search-box/index.js +24 -24
- package/packages/components/search-box/src/index.js +29 -29
- package/packages/components/search-box/src/search-box.vue +250 -251
- package/packages/components/search-box/src/slot.vue +4 -4
- package/packages/components/select/index.js +7 -7
- package/packages/components/select/src/arrow-down.vue +2 -2
- package/packages/components/select/src/clear-icon.vue +2 -2
- package/packages/components/select/src/empty.vue +13 -13
- package/packages/components/select/src/index.js +51 -51
- package/packages/components/select/src/select.vue +380 -380
- package/packages/components/table/index.js +7 -7
- package/packages/components/table/src/TableSort.vue +179 -179
- package/packages/components/table/src/index.js +70 -66
- package/packages/components/table/src/table.vue +287 -287
- package/packages/components/tabs/index.js +7 -7
- package/packages/components/tabs/src/tabs.vue +225 -225
- package/packages/components/year-select/index.js +7 -7
- package/packages/components/year-select/src/index.js +44 -44
- package/packages/components/year-select/src/year-select.vue +273 -273
- package/packages/echarts/bar/index.js +63 -63
- package/packages/echarts/base.js +99 -99
- package/packages/echarts/line/index.js +106 -106
- package/packages/hooks/index.js +5 -5
- package/packages/hooks/use-buried/index.js +46 -46
- package/packages/hooks/use-checked-all/index.js +37 -37
- package/packages/hooks/use-echarts/index.js +1 -1
- package/packages/hooks/use-echarts/use-bar/index.js +72 -72
- package/packages/hooks/use-echarts/use-line/index.js +88 -88
- package/packages/hooks/use-namespace/index.js +65 -65
- package/packages/hooks/use-search-component/index.js +28 -28
- package/packages/style/element.less +725 -725
- package/packages/style/index.js +2 -2
- package/packages/style/init.less +114 -114
- package/packages/utils/index.js +1 -1
- package/packages/utils/operate.js +77 -77
- package/packages/utils/types.js +35 -35
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="[ns.b()]">
|
|
3
|
-
<div :class="[ns.e('container')]">
|
|
4
|
-
<div :class="[ns.e('left')]">
|
|
5
|
-
<slot name="table-title">
|
|
6
|
-
<ct-icon
|
|
7
|
-
:class="[ns.e('total-icon')]"
|
|
8
|
-
name="content-search_line"></ct-icon>
|
|
9
|
-
<span>查询结果:</span>
|
|
10
|
-
<span>共{{ total }}条记录</span>
|
|
11
|
-
<span>,每页显示{{ pageSize }}条</span>
|
|
12
|
-
<slot name="table-desc"></slot>
|
|
13
|
-
</slot>
|
|
14
|
-
</div>
|
|
15
|
-
<div :class="[ns.e('right')]">
|
|
16
|
-
<slot name="table-handle">
|
|
17
|
-
<slot name="table-handle-before"></slot>
|
|
18
|
-
<div :class="[ns.e('handle')]">
|
|
19
|
-
<div
|
|
20
|
-
:class="[ns.e('handle-item'), ns.is(item, true)]"
|
|
21
|
-
v-for="(item, index) in handleList"
|
|
22
|
-
:key="index"
|
|
23
|
-
v-show="handleItemShow(item)">
|
|
24
|
-
<component
|
|
25
|
-
v-if="handleItemShow(item)"
|
|
26
|
-
:is="getHandleComponent(item)"
|
|
27
|
-
v-bind="handleOptionsBind(item)"
|
|
28
|
-
v-model:sortObj="modelSort"
|
|
29
|
-
@download="download" />
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
<slot name="table-handle-after"></slot>
|
|
33
|
-
</slot>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script setup>
|
|
40
|
-
import { reactive, onMounted, ref, computed } from "vue";
|
|
41
|
-
import { useNamespace } from "../../../../hooks";
|
|
42
|
-
import DownloadButton from "./DownloadButton.vue";
|
|
43
|
-
import TableSort from "../../../table/src/TableSort.vue";
|
|
44
|
-
const props = defineProps({
|
|
45
|
-
total: Number,
|
|
46
|
-
pageSize: Number,
|
|
47
|
-
handleList: {
|
|
48
|
-
type: Array,
|
|
49
|
-
default: () => {
|
|
50
|
-
return ["sort", "download"];
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
sortList: {
|
|
54
|
-
type: Array,
|
|
55
|
-
default: () => {
|
|
56
|
-
return [];
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
sortObj: {
|
|
60
|
-
type: Object,
|
|
61
|
-
default: () => {
|
|
62
|
-
return {};
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
const emit = defineEmits(["update:sortObj", "changeSort", "download"]);
|
|
67
|
-
const ns = useNamespace("page-table-title");
|
|
68
|
-
const modelSort = computed({
|
|
69
|
-
get() {
|
|
70
|
-
return props.sortObj;
|
|
71
|
-
},
|
|
72
|
-
set(val) {
|
|
73
|
-
emit("update:sortObj", val);
|
|
74
|
-
if (val.prop && val.order) {
|
|
75
|
-
emit("changeSort", val);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
const getHandleComponent = (type) => {
|
|
80
|
-
const componentMap = {
|
|
81
|
-
sort: TableSort,
|
|
82
|
-
download: DownloadButton,
|
|
83
|
-
};
|
|
84
|
-
return componentMap[type] || "div";
|
|
85
|
-
};
|
|
86
|
-
const handleOptionsBind = (item) => {
|
|
87
|
-
if (item === "sort") {
|
|
88
|
-
return { sortList: props.sortList };
|
|
89
|
-
}
|
|
90
|
-
return {};
|
|
91
|
-
};
|
|
92
|
-
const download = () => {
|
|
93
|
-
emit("download");
|
|
94
|
-
};
|
|
95
|
-
const handleItemShow = (item) => {
|
|
96
|
-
if (item === "sort") {
|
|
97
|
-
return props.sortList.length > 0;
|
|
98
|
-
}
|
|
99
|
-
return true;
|
|
100
|
-
};
|
|
101
|
-
onMounted(() => {});
|
|
102
|
-
</script>
|
|
103
|
-
<style lang="less" scoped>
|
|
104
|
-
.ct-page-table-title {
|
|
105
|
-
&__container {
|
|
106
|
-
display: flex;
|
|
107
|
-
align-items: center;
|
|
108
|
-
justify-content: space-between;
|
|
109
|
-
height: 56px;
|
|
110
|
-
background-color: #fff;
|
|
111
|
-
}
|
|
112
|
-
&__left {
|
|
113
|
-
display: flex;
|
|
114
|
-
align-items: center;
|
|
115
|
-
justify-content: flex-start;
|
|
116
|
-
}
|
|
117
|
-
&__total-icon {
|
|
118
|
-
margin-right: 8px;
|
|
119
|
-
}
|
|
120
|
-
&__right {
|
|
121
|
-
display: flex;
|
|
122
|
-
align-items: center;
|
|
123
|
-
justify-content: flex-end;
|
|
124
|
-
}
|
|
125
|
-
&__handle {
|
|
126
|
-
display: flex;
|
|
127
|
-
align-items: center;
|
|
128
|
-
justify-content: flex-end;
|
|
129
|
-
&-item {
|
|
130
|
-
&:not(:last-child) {
|
|
131
|
-
margin-right: 12px;
|
|
132
|
-
}
|
|
133
|
-
display: inline-flex;
|
|
134
|
-
align-items: center;
|
|
135
|
-
height: 28px;
|
|
136
|
-
padding: 0 9px;
|
|
137
|
-
color: var(--ct-color-primary);
|
|
138
|
-
border: 1px solid var(--ct-color-primary);
|
|
139
|
-
border-radius: 3px;
|
|
140
|
-
background-color: #fff;
|
|
141
|
-
cursor: pointer;
|
|
142
|
-
&:hover {
|
|
143
|
-
background-color: var(--ct-color-primary-bg);
|
|
144
|
-
}
|
|
145
|
-
:deep(.ct-icon) {
|
|
146
|
-
margin-right: 4px;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="[ns.b()]">
|
|
3
|
+
<div :class="[ns.e('container')]">
|
|
4
|
+
<div :class="[ns.e('left')]">
|
|
5
|
+
<slot name="table-title">
|
|
6
|
+
<ct-icon
|
|
7
|
+
:class="[ns.e('total-icon')]"
|
|
8
|
+
name="content-search_line"></ct-icon>
|
|
9
|
+
<span>查询结果:</span>
|
|
10
|
+
<span>共{{ total }}条记录</span>
|
|
11
|
+
<span>,每页显示{{ pageSize }}条</span>
|
|
12
|
+
<slot name="table-desc"></slot>
|
|
13
|
+
</slot>
|
|
14
|
+
</div>
|
|
15
|
+
<div :class="[ns.e('right')]">
|
|
16
|
+
<slot name="table-handle">
|
|
17
|
+
<slot name="table-handle-before"></slot>
|
|
18
|
+
<div :class="[ns.e('handle')]">
|
|
19
|
+
<div
|
|
20
|
+
:class="[ns.e('handle-item'), ns.is(item, true)]"
|
|
21
|
+
v-for="(item, index) in handleList"
|
|
22
|
+
:key="index"
|
|
23
|
+
v-show="handleItemShow(item)">
|
|
24
|
+
<component
|
|
25
|
+
v-if="handleItemShow(item)"
|
|
26
|
+
:is="getHandleComponent(item)"
|
|
27
|
+
v-bind="handleOptionsBind(item)"
|
|
28
|
+
v-model:sortObj="modelSort"
|
|
29
|
+
@download="download" />
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<slot name="table-handle-after"></slot>
|
|
33
|
+
</slot>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script setup>
|
|
40
|
+
import { reactive, onMounted, ref, computed } from "vue";
|
|
41
|
+
import { useNamespace } from "../../../../hooks";
|
|
42
|
+
import DownloadButton from "./DownloadButton.vue";
|
|
43
|
+
import TableSort from "../../../table/src/TableSort.vue";
|
|
44
|
+
const props = defineProps({
|
|
45
|
+
total: Number,
|
|
46
|
+
pageSize: Number,
|
|
47
|
+
handleList: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default: () => {
|
|
50
|
+
return ["sort", "download"];
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
sortList: {
|
|
54
|
+
type: Array,
|
|
55
|
+
default: () => {
|
|
56
|
+
return [];
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
sortObj: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: () => {
|
|
62
|
+
return {};
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
const emit = defineEmits(["update:sortObj", "changeSort", "download"]);
|
|
67
|
+
const ns = useNamespace("page-table-title");
|
|
68
|
+
const modelSort = computed({
|
|
69
|
+
get() {
|
|
70
|
+
return props.sortObj;
|
|
71
|
+
},
|
|
72
|
+
set(val) {
|
|
73
|
+
emit("update:sortObj", val);
|
|
74
|
+
if (val.prop && val.order) {
|
|
75
|
+
emit("changeSort", val);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
const getHandleComponent = (type) => {
|
|
80
|
+
const componentMap = {
|
|
81
|
+
sort: TableSort,
|
|
82
|
+
download: DownloadButton,
|
|
83
|
+
};
|
|
84
|
+
return componentMap[type] || "div";
|
|
85
|
+
};
|
|
86
|
+
const handleOptionsBind = (item) => {
|
|
87
|
+
if (item === "sort") {
|
|
88
|
+
return { sortList: props.sortList };
|
|
89
|
+
}
|
|
90
|
+
return {};
|
|
91
|
+
};
|
|
92
|
+
const download = () => {
|
|
93
|
+
emit("download");
|
|
94
|
+
};
|
|
95
|
+
const handleItemShow = (item) => {
|
|
96
|
+
if (item === "sort") {
|
|
97
|
+
return props.sortList.length > 0;
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
};
|
|
101
|
+
onMounted(() => {});
|
|
102
|
+
</script>
|
|
103
|
+
<style lang="less" scoped>
|
|
104
|
+
.ct-page-table-title {
|
|
105
|
+
&__container {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: space-between;
|
|
109
|
+
height: 56px;
|
|
110
|
+
background-color: #fff;
|
|
111
|
+
}
|
|
112
|
+
&__left {
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: flex-start;
|
|
116
|
+
}
|
|
117
|
+
&__total-icon {
|
|
118
|
+
margin-right: 8px;
|
|
119
|
+
}
|
|
120
|
+
&__right {
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
justify-content: flex-end;
|
|
124
|
+
}
|
|
125
|
+
&__handle {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: flex-end;
|
|
129
|
+
&-item {
|
|
130
|
+
&:not(:last-child) {
|
|
131
|
+
margin-right: 12px;
|
|
132
|
+
}
|
|
133
|
+
display: inline-flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
height: 28px;
|
|
136
|
+
padding: 0 9px;
|
|
137
|
+
color: var(--ct-color-primary);
|
|
138
|
+
border: 1px solid var(--ct-color-primary);
|
|
139
|
+
border-radius: 3px;
|
|
140
|
+
background-color: #fff;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
&:hover {
|
|
143
|
+
background-color: var(--ct-color-primary-bg);
|
|
144
|
+
}
|
|
145
|
+
:deep(.ct-icon) {
|
|
146
|
+
margin-right: 4px;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
</style>
|