ct-component-plus 0.0.41 → 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 -62
- package/packages/components/table/src/table.vue +287 -279
- 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 -95
- 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 -724
- 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
package/packages/echarts/base.js
CHANGED
|
@@ -1,96 +1,100 @@
|
|
|
1
|
-
//存放基础通用配置
|
|
2
|
-
|
|
3
|
-
export const baseOption = {
|
|
4
|
-
tooltip: {
|
|
5
|
-
trigger: "axis",
|
|
6
|
-
// 设置边框样式
|
|
7
|
-
borderColor: '#fff',
|
|
8
|
-
borderWidth: 1,
|
|
9
|
-
borderRadius: 4,
|
|
10
|
-
// 设置阴影效果
|
|
11
|
-
shadowColor: 'rgba(102, 114, 144, 0.16)',
|
|
12
|
-
shadowBlur: 14,
|
|
13
|
-
shadowOffsetX: 0,
|
|
14
|
-
shadowOffsetY: 4,
|
|
15
|
-
padding: [14, 16, 18, 16],
|
|
16
|
-
formatter: (param) => {
|
|
17
|
-
let dom = `<div style="color: #141617;font-size:14px;font-weight:600;line-height: 18px;margin-bottom:18px;">${param[0].name}</div>`;
|
|
18
|
-
param.forEach((p, index) => {
|
|
19
|
-
dom += `<div style="color:#141617;font-size:14px;line-height: 18px;display:flex;align-items:center;margin-bottom:${index + 1 == param.length ? '' : '12px'};">
|
|
20
|
-
<span style="margin-right:32px;display:inline-flex;align-items:center">
|
|
21
|
-
<span style="display:inline-block;margin-right:8px;border-radius:6px;width:6px;height:6px;background-color:${p.color};"></span>
|
|
22
|
-
${p.seriesName}
|
|
23
|
-
</span>
|
|
24
|
-
<span>${p.value}</span>
|
|
25
|
-
</div>`
|
|
26
|
-
})
|
|
27
|
-
return dom
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
legend: {
|
|
31
|
-
show: true,
|
|
32
|
-
bottom: 0,
|
|
33
|
-
itemWidth: 14,
|
|
34
|
-
itemHeight: 14,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
1
|
+
//存放基础通用配置
|
|
2
|
+
|
|
3
|
+
export const baseOption = {
|
|
4
|
+
tooltip: {
|
|
5
|
+
trigger: "axis",
|
|
6
|
+
// 设置边框样式
|
|
7
|
+
borderColor: '#fff',
|
|
8
|
+
borderWidth: 1,
|
|
9
|
+
borderRadius: 4,
|
|
10
|
+
// 设置阴影效果
|
|
11
|
+
shadowColor: 'rgba(102, 114, 144, 0.16)',
|
|
12
|
+
shadowBlur: 14,
|
|
13
|
+
shadowOffsetX: 0,
|
|
14
|
+
shadowOffsetY: 4,
|
|
15
|
+
padding: [14, 16, 18, 16],
|
|
16
|
+
formatter: (param) => {
|
|
17
|
+
let dom = `<div style="color: #141617;font-size:14px;font-weight:600;line-height: 18px;margin-bottom:18px;">${param[0].name}</div>`;
|
|
18
|
+
param.forEach((p, index) => {
|
|
19
|
+
dom += `<div style="color:#141617;font-size:14px;line-height: 18px;display:flex;align-items:center;margin-bottom:${index + 1 == param.length ? '' : '12px'};">
|
|
20
|
+
<span style="margin-right:32px;display:inline-flex;align-items:center">
|
|
21
|
+
<span style="display:inline-block;margin-right:8px;border-radius:6px;width:6px;height:6px;background-color:${p.color};"></span>
|
|
22
|
+
${p.seriesName}
|
|
23
|
+
</span>
|
|
24
|
+
<span>${p.value}</span>
|
|
25
|
+
</div>`
|
|
26
|
+
})
|
|
27
|
+
return dom
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
legend: {
|
|
31
|
+
show: true,
|
|
32
|
+
bottom: 0,
|
|
33
|
+
itemWidth: 14,
|
|
34
|
+
itemHeight: 14,
|
|
35
|
+
itemStyle: {
|
|
36
|
+
borderWidth: 0,
|
|
37
|
+
},
|
|
38
|
+
inactiveBorderWidth: 0,
|
|
39
|
+
itemGap: 32,
|
|
40
|
+
borderRadius: 2,
|
|
41
|
+
icon: "roundRect",
|
|
42
|
+
textStyle: {
|
|
43
|
+
fontWeight: 400,
|
|
44
|
+
fontSize: 14
|
|
45
|
+
},
|
|
46
|
+
data: [],
|
|
47
|
+
},
|
|
48
|
+
grid: {
|
|
49
|
+
left: 0,
|
|
50
|
+
right: 0,
|
|
51
|
+
bottom: 40,
|
|
52
|
+
top: 30,
|
|
53
|
+
containLabel: true,
|
|
54
|
+
},
|
|
55
|
+
xAxis: {
|
|
56
|
+
type: "category",
|
|
57
|
+
boundaryGap: true,
|
|
58
|
+
axisLabel: {
|
|
59
|
+
margin: 11,
|
|
60
|
+
color: "#8F99A3",
|
|
61
|
+
fontSize: 14,
|
|
62
|
+
},
|
|
63
|
+
axisTick: {
|
|
64
|
+
show: false,
|
|
65
|
+
},
|
|
66
|
+
axisLine: {
|
|
67
|
+
show: true,
|
|
68
|
+
lineStyle: {
|
|
69
|
+
color: "#A4AFBB",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
axisPointer: {
|
|
73
|
+
snap: true,
|
|
74
|
+
},
|
|
75
|
+
data: [],
|
|
76
|
+
},
|
|
77
|
+
yAxis: {
|
|
78
|
+
type: "value",
|
|
79
|
+
inverse: false,
|
|
80
|
+
axisLine: {
|
|
81
|
+
show: false,
|
|
82
|
+
lineStyle: {
|
|
83
|
+
color: "#C0CCD7",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
splitLine: {
|
|
87
|
+
show: true,
|
|
88
|
+
lineStyle: {
|
|
89
|
+
type: "dashed",
|
|
90
|
+
color: "#DDE2EB",
|
|
91
|
+
dashOffset: 10,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
axisLabel: {
|
|
95
|
+
margin: 8,
|
|
96
|
+
color: "#8F99A3",
|
|
97
|
+
fontSize: 13,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
96
100
|
}
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import { baseOption } from "../base";
|
|
2
|
-
export const baseLineOption = {
|
|
3
|
-
color: [
|
|
4
|
-
'rgba(77, 100, 255, 1)',
|
|
5
|
-
"rgba(255, 173, 44, 1)",
|
|
6
|
-
"rgba(30, 183, 173, 1)",
|
|
7
|
-
"rgba(255, 146, 24, 1)",
|
|
8
|
-
"rgba(66, 166, 255, 1)",
|
|
9
|
-
"rgba(136, 206, 119, 1)",
|
|
10
|
-
],
|
|
11
|
-
axisPointer: {
|
|
12
|
-
lineStyle: {
|
|
13
|
-
color: "#D8DEE8",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
...baseOption,
|
|
17
|
-
series: [],
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const seriesItem = {
|
|
21
|
-
name: "",
|
|
22
|
-
type: "line",
|
|
23
|
-
symbol: "circle",
|
|
24
|
-
// showSymbol: false,
|
|
25
|
-
symbolSize: 6,
|
|
26
|
-
lineStyle: {
|
|
27
|
-
width: 3,
|
|
28
|
-
},
|
|
29
|
-
itemStyle: {
|
|
30
|
-
borderColor: "#fff",
|
|
31
|
-
borderWidth: 2,
|
|
32
|
-
shadowColor: "rgba(72, 80, 119, 0.12)",
|
|
33
|
-
shadowBlur: 4,
|
|
34
|
-
shadowOffsetX: 0,
|
|
35
|
-
shadowOffsetY: 2,
|
|
36
|
-
},
|
|
37
|
-
emphasis: {
|
|
38
|
-
scale: 1.33,
|
|
39
|
-
itemStyle: {
|
|
40
|
-
borderColor: "#fff",
|
|
41
|
-
borderWidth: 2.25,
|
|
42
|
-
shadowColor: "rgba(72,80,119,0.22)",
|
|
43
|
-
shadowBlur: 8,
|
|
44
|
-
shadowOffsetX: 0,
|
|
45
|
-
shadowOffsetY: 2,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
data: [],
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export const areaSeriesItem = {
|
|
52
|
-
name: "",
|
|
53
|
-
type: "line",
|
|
54
|
-
symbol: "circle",
|
|
55
|
-
showSymbol: true,
|
|
56
|
-
symbolSize: 6,
|
|
57
|
-
lineStyle: {
|
|
58
|
-
width: 3,
|
|
59
|
-
},
|
|
60
|
-
label: {
|
|
61
|
-
show: false
|
|
62
|
-
},
|
|
63
|
-
areaStyle: {
|
|
64
|
-
color: {
|
|
65
|
-
type: "linear",
|
|
66
|
-
x: 0,
|
|
67
|
-
y: 0,
|
|
68
|
-
x2: 0,
|
|
69
|
-
y2: 1,
|
|
70
|
-
colorStops: [
|
|
71
|
-
{
|
|
72
|
-
offset: 0,
|
|
73
|
-
color: "rgba(77, 100, 255, 0.22)", // 0% 处的颜色
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
offset: 1,
|
|
77
|
-
color: "rgba(77, 100, 255, 0)", // 100% 处的颜色
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
global: false, // 缺省为 false
|
|
81
|
-
},
|
|
82
|
-
origin: "start",
|
|
83
|
-
},
|
|
84
|
-
itemStyle: {
|
|
85
|
-
borderColor: "#fff",
|
|
86
|
-
borderWidth: 2,
|
|
87
|
-
shadowColor: "rgba(72, 80, 119, 0.22)",
|
|
88
|
-
shadowBlur: 4,
|
|
89
|
-
shadowOffsetX: 0,
|
|
90
|
-
shadowOffsetY: 2,
|
|
91
|
-
},
|
|
92
|
-
emphasis: {
|
|
93
|
-
scale: 1.33,
|
|
94
|
-
label: {
|
|
95
|
-
show: false
|
|
96
|
-
},
|
|
97
|
-
itemStyle: {
|
|
98
|
-
borderColor: "#fff",
|
|
99
|
-
borderWidth: 2.25,
|
|
100
|
-
shadowColor: "rgba(72,80,119,0.22)",
|
|
101
|
-
shadowBlur: 8,
|
|
102
|
-
shadowOffsetX: 0,
|
|
103
|
-
shadowOffsetY: 2,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
data: [],
|
|
1
|
+
import { baseOption } from "../base";
|
|
2
|
+
export const baseLineOption = {
|
|
3
|
+
color: [
|
|
4
|
+
'rgba(77, 100, 255, 1)',
|
|
5
|
+
"rgba(255, 173, 44, 1)",
|
|
6
|
+
"rgba(30, 183, 173, 1)",
|
|
7
|
+
"rgba(255, 146, 24, 1)",
|
|
8
|
+
"rgba(66, 166, 255, 1)",
|
|
9
|
+
"rgba(136, 206, 119, 1)",
|
|
10
|
+
],
|
|
11
|
+
axisPointer: {
|
|
12
|
+
lineStyle: {
|
|
13
|
+
color: "#D8DEE8",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
...baseOption,
|
|
17
|
+
series: [],
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const seriesItem = {
|
|
21
|
+
name: "",
|
|
22
|
+
type: "line",
|
|
23
|
+
symbol: "circle",
|
|
24
|
+
// showSymbol: false,
|
|
25
|
+
symbolSize: 6,
|
|
26
|
+
lineStyle: {
|
|
27
|
+
width: 3,
|
|
28
|
+
},
|
|
29
|
+
itemStyle: {
|
|
30
|
+
borderColor: "#fff",
|
|
31
|
+
borderWidth: 2,
|
|
32
|
+
shadowColor: "rgba(72, 80, 119, 0.12)",
|
|
33
|
+
shadowBlur: 4,
|
|
34
|
+
shadowOffsetX: 0,
|
|
35
|
+
shadowOffsetY: 2,
|
|
36
|
+
},
|
|
37
|
+
emphasis: {
|
|
38
|
+
scale: 1.33,
|
|
39
|
+
itemStyle: {
|
|
40
|
+
borderColor: "#fff",
|
|
41
|
+
borderWidth: 2.25,
|
|
42
|
+
shadowColor: "rgba(72,80,119,0.22)",
|
|
43
|
+
shadowBlur: 8,
|
|
44
|
+
shadowOffsetX: 0,
|
|
45
|
+
shadowOffsetY: 2,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
data: [],
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const areaSeriesItem = {
|
|
52
|
+
name: "",
|
|
53
|
+
type: "line",
|
|
54
|
+
symbol: "circle",
|
|
55
|
+
showSymbol: true,
|
|
56
|
+
symbolSize: 6,
|
|
57
|
+
lineStyle: {
|
|
58
|
+
width: 3,
|
|
59
|
+
},
|
|
60
|
+
label: {
|
|
61
|
+
show: false
|
|
62
|
+
},
|
|
63
|
+
areaStyle: {
|
|
64
|
+
color: {
|
|
65
|
+
type: "linear",
|
|
66
|
+
x: 0,
|
|
67
|
+
y: 0,
|
|
68
|
+
x2: 0,
|
|
69
|
+
y2: 1,
|
|
70
|
+
colorStops: [
|
|
71
|
+
{
|
|
72
|
+
offset: 0,
|
|
73
|
+
color: "rgba(77, 100, 255, 0.22)", // 0% 处的颜色
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
offset: 1,
|
|
77
|
+
color: "rgba(77, 100, 255, 0)", // 100% 处的颜色
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
global: false, // 缺省为 false
|
|
81
|
+
},
|
|
82
|
+
origin: "start",
|
|
83
|
+
},
|
|
84
|
+
itemStyle: {
|
|
85
|
+
borderColor: "#fff",
|
|
86
|
+
borderWidth: 2,
|
|
87
|
+
shadowColor: "rgba(72, 80, 119, 0.22)",
|
|
88
|
+
shadowBlur: 4,
|
|
89
|
+
shadowOffsetX: 0,
|
|
90
|
+
shadowOffsetY: 2,
|
|
91
|
+
},
|
|
92
|
+
emphasis: {
|
|
93
|
+
scale: 1.33,
|
|
94
|
+
label: {
|
|
95
|
+
show: false
|
|
96
|
+
},
|
|
97
|
+
itemStyle: {
|
|
98
|
+
borderColor: "#fff",
|
|
99
|
+
borderWidth: 2.25,
|
|
100
|
+
shadowColor: "rgba(72,80,119,0.22)",
|
|
101
|
+
shadowBlur: 8,
|
|
102
|
+
shadowOffsetX: 0,
|
|
103
|
+
shadowOffsetY: 2,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
data: [],
|
|
107
107
|
}
|
package/packages/hooks/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './use-namespace'
|
|
3
|
-
export * from './use-buried'
|
|
4
|
-
export * from './use-search-component'
|
|
5
|
-
export * from './use-checked-all'
|
|
1
|
+
|
|
2
|
+
export * from './use-namespace'
|
|
3
|
+
export * from './use-buried'
|
|
4
|
+
export * from './use-search-component'
|
|
5
|
+
export * from './use-checked-all'
|
|
6
6
|
export * from "./use-echarts"
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
export const buriedParamsKey = 'changeBuriedParams'
|
|
3
|
-
import { isFunction, isObject } from '../../utils';
|
|
4
|
-
import { watch } from 'vue';
|
|
5
|
-
export const useBuriedParams = (props, emitApp, options) => {
|
|
6
|
-
const emitKey = buriedParamsKey;
|
|
7
|
-
const { label, param } = (props || {});
|
|
8
|
-
|
|
9
|
-
const get = (content) => {
|
|
10
|
-
const params = {
|
|
11
|
-
label,
|
|
12
|
-
value: param,
|
|
13
|
-
content
|
|
14
|
-
}
|
|
15
|
-
if (options && isFunction(options.getContent)) {
|
|
16
|
-
params.content = options.getContent(params.content)
|
|
17
|
-
}
|
|
18
|
-
return params
|
|
19
|
-
}
|
|
20
|
-
const emit = (content) => {
|
|
21
|
-
if (isFunction(emitApp)) {
|
|
22
|
-
const params = get(content);
|
|
23
|
-
if (params.label) {
|
|
24
|
-
emitApp(emitKey, params)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const _emitBuriedParams = () => {
|
|
30
|
-
// 发送埋点数据
|
|
31
|
-
props.buried && emit(props.modelValue);
|
|
32
|
-
};
|
|
33
|
-
watch(
|
|
34
|
-
() => props.modelValue,
|
|
35
|
-
(newValue) => {
|
|
36
|
-
_emitBuriedParams();
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
immediate: true,
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
return {
|
|
43
|
-
get,
|
|
44
|
-
emit,
|
|
45
|
-
emitKey,
|
|
46
|
-
}
|
|
1
|
+
|
|
2
|
+
export const buriedParamsKey = 'changeBuriedParams'
|
|
3
|
+
import { isFunction, isObject } from '../../utils';
|
|
4
|
+
import { watch } from 'vue';
|
|
5
|
+
export const useBuriedParams = (props, emitApp, options) => {
|
|
6
|
+
const emitKey = buriedParamsKey;
|
|
7
|
+
const { label, param } = (props || {});
|
|
8
|
+
|
|
9
|
+
const get = (content) => {
|
|
10
|
+
const params = {
|
|
11
|
+
label,
|
|
12
|
+
value: param,
|
|
13
|
+
content
|
|
14
|
+
}
|
|
15
|
+
if (options && isFunction(options.getContent)) {
|
|
16
|
+
params.content = options.getContent(params.content)
|
|
17
|
+
}
|
|
18
|
+
return params
|
|
19
|
+
}
|
|
20
|
+
const emit = (content) => {
|
|
21
|
+
if (isFunction(emitApp)) {
|
|
22
|
+
const params = get(content);
|
|
23
|
+
if (params.label) {
|
|
24
|
+
emitApp(emitKey, params)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const _emitBuriedParams = () => {
|
|
30
|
+
// 发送埋点数据
|
|
31
|
+
props.buried && emit(props.modelValue);
|
|
32
|
+
};
|
|
33
|
+
watch(
|
|
34
|
+
() => props.modelValue,
|
|
35
|
+
(newValue) => {
|
|
36
|
+
_emitBuriedParams();
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
immediate: true,
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
return {
|
|
43
|
+
get,
|
|
44
|
+
emit,
|
|
45
|
+
emitKey,
|
|
46
|
+
}
|
|
47
47
|
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { computed } from "vue"
|
|
2
|
-
import { isArray, isObject } from '../../utils';
|
|
3
|
-
|
|
4
|
-
export const useCheckedAll = (list, selects, options = {}) => {
|
|
5
|
-
const { key = 'value', onCheckedAll } = (isObject(options) ? options : {})
|
|
6
|
-
const listKeys = computed(() => {
|
|
7
|
-
if (isArray(list.value)) return list.value.map(item => item[key])
|
|
8
|
-
return []
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
const checkedAll = computed({
|
|
12
|
-
get() {
|
|
13
|
-
if (isArray(list.value) && isArray(selects.value) && list.value.length && selects.value.length) {
|
|
14
|
-
if (list.value.length > selects.value.length) {
|
|
15
|
-
return false;
|
|
16
|
-
} else {
|
|
17
|
-
return listKeys.value.every(item => selects.value.includes(item))
|
|
18
|
-
return selects.value.every(item => listKeys.value.includes(item))
|
|
19
|
-
}
|
|
20
|
-
} else {
|
|
21
|
-
return false
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
set(newValue) {
|
|
25
|
-
if (!newValue) {
|
|
26
|
-
// 去掉全选
|
|
27
|
-
selects.value = selects.value.filter(item => !listKeys.value.includes(item))
|
|
28
|
-
if (typeof onCheckedAll === 'function') onCheckedAll(false)
|
|
29
|
-
} else {
|
|
30
|
-
// 全选
|
|
31
|
-
selects.value = selects.value.concat(listKeys.value.filter(item => !selects.value.includes(item)))
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
return {
|
|
36
|
-
checkedAll
|
|
37
|
-
}
|
|
1
|
+
import { computed } from "vue"
|
|
2
|
+
import { isArray, isObject } from '../../utils';
|
|
3
|
+
|
|
4
|
+
export const useCheckedAll = (list, selects, options = {}) => {
|
|
5
|
+
const { key = 'value', onCheckedAll } = (isObject(options) ? options : {})
|
|
6
|
+
const listKeys = computed(() => {
|
|
7
|
+
if (isArray(list.value)) return list.value.map(item => item[key])
|
|
8
|
+
return []
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const checkedAll = computed({
|
|
12
|
+
get() {
|
|
13
|
+
if (isArray(list.value) && isArray(selects.value) && list.value.length && selects.value.length) {
|
|
14
|
+
if (list.value.length > selects.value.length) {
|
|
15
|
+
return false;
|
|
16
|
+
} else {
|
|
17
|
+
return listKeys.value.every(item => selects.value.includes(item))
|
|
18
|
+
return selects.value.every(item => listKeys.value.includes(item))
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
return false
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
set(newValue) {
|
|
25
|
+
if (!newValue) {
|
|
26
|
+
// 去掉全选
|
|
27
|
+
selects.value = selects.value.filter(item => !listKeys.value.includes(item))
|
|
28
|
+
if (typeof onCheckedAll === 'function') onCheckedAll(false)
|
|
29
|
+
} else {
|
|
30
|
+
// 全选
|
|
31
|
+
selects.value = selects.value.concat(listKeys.value.filter(item => !selects.value.includes(item)))
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
return {
|
|
36
|
+
checkedAll
|
|
37
|
+
}
|
|
38
38
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./use-line";
|
|
1
|
+
export * from "./use-line";
|
|
2
2
|
export * from "./use-bar";
|