@fbkworks/screen 0.0.0-stage → 0.3.0
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/LICENSE +21 -0
- package/dist/ScreenBarChart.d.ts +9 -0
- package/dist/ScreenBarChart.vue.mjs +73 -0
- package/dist/ScreenBarChart.vue.mjs.map +1 -0
- package/dist/ScreenBarChart2.vue.mjs +5 -0
- package/dist/ScreenBarChart2.vue.mjs.map +1 -0
- package/dist/ScreenGaugeChart.d.ts +11 -0
- package/dist/ScreenGaugeChart.vue.mjs +103 -0
- package/dist/ScreenGaugeChart.vue.mjs.map +1 -0
- package/dist/ScreenGaugeChart2.vue.mjs +5 -0
- package/dist/ScreenGaugeChart2.vue.mjs.map +1 -0
- package/dist/ScreenGrid.d.ts +22 -0
- package/dist/ScreenGrid.vue.mjs +30 -0
- package/dist/ScreenGrid.vue.mjs.map +1 -0
- package/dist/ScreenGrid2.vue.mjs +5 -0
- package/dist/ScreenGrid2.vue.mjs.map +1 -0
- package/dist/ScreenHeader.d.ts +22 -0
- package/dist/ScreenHeader.vue.mjs +83 -0
- package/dist/ScreenHeader.vue.mjs.map +1 -0
- package/dist/ScreenHeader2.vue.mjs +5 -0
- package/dist/ScreenHeader2.vue.mjs.map +1 -0
- package/dist/ScreenLineChart.d.ts +10 -0
- package/dist/ScreenLineChart.vue.mjs +93 -0
- package/dist/ScreenLineChart.vue.mjs.map +1 -0
- package/dist/ScreenLineChart2.vue.mjs +5 -0
- package/dist/ScreenLineChart2.vue.mjs.map +1 -0
- package/dist/ScreenNumber.d.ts +9 -0
- package/dist/ScreenNumber.vue.mjs +81 -0
- package/dist/ScreenNumber.vue.mjs.map +1 -0
- package/dist/ScreenNumber2.vue.mjs +5 -0
- package/dist/ScreenNumber2.vue.mjs.map +1 -0
- package/dist/ScreenPage.d.ts +32 -0
- package/dist/ScreenPage.vue.mjs +78 -0
- package/dist/ScreenPage.vue.mjs.map +1 -0
- package/dist/ScreenPage2.vue.mjs +5 -0
- package/dist/ScreenPage2.vue.mjs.map +1 -0
- package/dist/ScreenPanel.d.ts +24 -0
- package/dist/ScreenPanel.vue.mjs +55 -0
- package/dist/ScreenPanel.vue.mjs.map +1 -0
- package/dist/ScreenPanel2.vue.mjs +5 -0
- package/dist/ScreenPanel2.vue.mjs.map +1 -0
- package/dist/ScreenPieChart.d.ts +11 -0
- package/dist/ScreenPieChart.vue.mjs +96 -0
- package/dist/ScreenPieChart.vue.mjs.map +1 -0
- package/dist/ScreenPieChart2.vue.mjs +5 -0
- package/dist/ScreenPieChart2.vue.mjs.map +1 -0
- package/dist/ScreenScrollList.d.ts +8 -0
- package/dist/ScreenScrollList.vue.mjs +98 -0
- package/dist/ScreenScrollList.vue.mjs.map +1 -0
- package/dist/ScreenScrollList2.vue.mjs +5 -0
- package/dist/ScreenScrollList2.vue.mjs.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.mjs +23 -0
- package/dist/index.mjs.map +1 -0
- package/dist/style.css +1195 -0
- package/dist/styles/index.css +3 -0
- package/dist/types.d.ts +141 -0
- package/package.json +62 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 54356
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScreenBarChartProps } from './types.js';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ScreenBarChartProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ScreenBarChartProps> & Readonly<{}>, {
|
|
3
|
+
stacked: boolean;
|
|
4
|
+
height: string | number;
|
|
5
|
+
title: string;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
empty: boolean;
|
|
8
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, computed, openBlock, createElementBlock, mergeProps, unref, toDisplayString, createCommentVNode, createVNode } from "vue";
|
|
2
|
+
import { CHART_SPLIT_LINE, CHART_AXIS_LABEL, CHART_AXIS_LINE, seriesColor, stackedBarRadius, barRadius, FbkChart } from "@fbkworks/chart-core";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "fbk-screen-chart__title"
|
|
6
|
+
};
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
...{ name: "FbkScreenBarChart", inheritAttrs: false },
|
|
9
|
+
__name: "ScreenBarChart",
|
|
10
|
+
props: {
|
|
11
|
+
categories: {},
|
|
12
|
+
series: {},
|
|
13
|
+
stacked: { type: Boolean, default: false },
|
|
14
|
+
title: { default: void 0 },
|
|
15
|
+
height: { default: void 0 },
|
|
16
|
+
loading: { type: Boolean, default: false },
|
|
17
|
+
empty: { type: Boolean, default: false }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const attrs = useAttrs();
|
|
22
|
+
const option = computed(() => ({
|
|
23
|
+
grid: { left: 8, right: 16, top: props.series.length > 1 ? 44 : 20, bottom: 8, containLabel: true },
|
|
24
|
+
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
|
|
25
|
+
legend: props.series.length > 1 ? { top: 0, right: 0, itemGap: 20, icon: "roundRect", textStyle: { fontSize: 14 } } : void 0,
|
|
26
|
+
xAxis: {
|
|
27
|
+
type: "category",
|
|
28
|
+
data: props.categories,
|
|
29
|
+
axisLine: { lineStyle: { color: CHART_AXIS_LINE } },
|
|
30
|
+
axisLabel: { color: CHART_AXIS_LABEL, fontSize: 14 },
|
|
31
|
+
axisTick: { show: false }
|
|
32
|
+
},
|
|
33
|
+
yAxis: {
|
|
34
|
+
type: "value",
|
|
35
|
+
axisLine: { show: false },
|
|
36
|
+
axisLabel: { color: CHART_AXIS_LABEL, fontSize: 14 },
|
|
37
|
+
splitLine: { lineStyle: { color: CHART_SPLIT_LINE, type: "dashed" } }
|
|
38
|
+
},
|
|
39
|
+
series: props.series.map((s, i) => {
|
|
40
|
+
const color = seriesColor(i, s.color);
|
|
41
|
+
return {
|
|
42
|
+
name: s.name,
|
|
43
|
+
type: "bar",
|
|
44
|
+
data: s.data,
|
|
45
|
+
stack: props.stacked ? "total" : void 0,
|
|
46
|
+
barMaxWidth: 28,
|
|
47
|
+
itemStyle: {
|
|
48
|
+
color,
|
|
49
|
+
borderRadius: props.stacked ? stackedBarRadius(i, props.series.length, false) : barRadius(false),
|
|
50
|
+
shadowColor: color,
|
|
51
|
+
shadowBlur: 8
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
})
|
|
55
|
+
}));
|
|
56
|
+
return (_ctx, _cache) => {
|
|
57
|
+
return openBlock(), createElementBlock("div", mergeProps({ class: "fbk-screen-chart" }, unref(attrs)), [
|
|
58
|
+
__props.title ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
|
|
59
|
+
createVNode(unref(FbkChart), {
|
|
60
|
+
option: option.value,
|
|
61
|
+
height: __props.height,
|
|
62
|
+
loading: __props.loading,
|
|
63
|
+
"is-empty": __props.empty || !__props.categories.length,
|
|
64
|
+
"empty-text": "暂无数据"
|
|
65
|
+
}, null, 8, ["option", "height", "loading", "is-empty"])
|
|
66
|
+
], 16);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
_sfc_main as default
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=ScreenBarChart.vue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenBarChart.vue.mjs","sources":["../src/ScreenBarChart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport {\n FbkChart,\n CHART_AXIS_LABEL,\n CHART_AXIS_LINE,\n CHART_SPLIT_LINE,\n barRadius,\n seriesColor,\n stackedBarRadius,\n} from '@fbkworks/chart-core'\nimport type { ScreenBarChartProps } from './types'\n\n/**\n * 大屏柱状图。\n * 与 dashboard 版本的区别:柱更宽、带发光、轴文字更大。\n */\ndefineOptions({ name: 'FbkScreenBarChart', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ScreenBarChartProps>(), {\n title: undefined,\n height: undefined,\n loading: false,\n empty: false,\n stacked: false,\n})\n\n/* inheritAttrs: false 时必须手动转发 attrs,否则调用方的 class/style 会丢失 */\nconst attrs = useAttrs()\n\nconst option = computed(() => ({\n grid: { left: 8, right: 16, top: props.series.length > 1 ? 44 : 20, bottom: 8, containLabel: true },\n tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },\n legend:\n props.series.length > 1\n ? { top: 0, right: 0, itemGap: 20, icon: 'roundRect', textStyle: { fontSize: 14 } }\n : undefined,\n xAxis: {\n type: 'category',\n data: props.categories,\n axisLine: { lineStyle: { color: CHART_AXIS_LINE } },\n axisLabel: { color: CHART_AXIS_LABEL, fontSize: 14 },\n axisTick: { show: false },\n },\n yAxis: {\n type: 'value',\n axisLine: { show: false },\n axisLabel: { color: CHART_AXIS_LABEL, fontSize: 14 },\n splitLine: { lineStyle: { color: CHART_SPLIT_LINE, type: 'dashed' } },\n },\n series: props.series.map((s, i) => {\n const color = seriesColor(i, s.color)\n return {\n name: s.name,\n type: 'bar',\n data: s.data,\n stack: props.stacked ? 'total' : undefined,\n barMaxWidth: 28,\n itemStyle: {\n color,\n borderRadius: props.stacked\n ? stackedBarRadius(i, props.series.length, false)\n : barRadius(false),\n shadowColor: color,\n shadowBlur: 8,\n },\n }\n }),\n}))\n</script>\n\n<template>\n <div class=\"fbk-screen-chart\" v-bind=\"attrs\">\n <div v-if=\"title\" class=\"fbk-screen-chart__title\">{{ title }}</div>\n <FbkChart\n :option=\"option\"\n :height=\"height\"\n :loading=\"loading\"\n :is-empty=\"empty || !categories.length\"\n empty-text=\"暂无数据\"\n />\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_unref","_toDisplayString","_createVNode"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,UAAM,QAAQ;AASd,UAAM,QAAQ,SAAA;AAEd,UAAM,SAAS,SAAS,OAAO;AAAA,MAC7B,MAAM,EAAE,MAAM,GAAG,OAAO,IAAI,KAAK,MAAM,OAAO,SAAS,IAAI,KAAK,IAAI,QAAQ,GAAG,cAAc,KAAA;AAAA,MAC7F,SAAS,EAAE,SAAS,QAAQ,aAAa,EAAE,MAAM,WAAS;AAAA,MAC1D,QACE,MAAM,OAAO,SAAS,IAClB,EAAE,KAAK,GAAG,OAA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AAAA,UAChC,cAAW;AAAA,QAAA;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenBarChart2.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScreenGaugeChartProps } from './types.js';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ScreenGaugeChartProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ScreenGaugeChartProps> & Readonly<{}>, {
|
|
3
|
+
max: number;
|
|
4
|
+
unit: string;
|
|
5
|
+
label: string;
|
|
6
|
+
height: string | number;
|
|
7
|
+
title: string;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
empty: boolean;
|
|
10
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, computed, openBlock, createElementBlock, mergeProps, unref, toDisplayString, createCommentVNode, createVNode } from "vue";
|
|
2
|
+
import { CHART_AXIS_LABEL, CHART_SPLIT_LINE, seriesColor, FbkChart } from "@fbkworks/chart-core";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "fbk-screen-chart__title"
|
|
6
|
+
};
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
...{ name: "FbkScreenGaugeChart", inheritAttrs: false },
|
|
9
|
+
__name: "ScreenGaugeChart",
|
|
10
|
+
props: {
|
|
11
|
+
value: {},
|
|
12
|
+
max: { default: 100 },
|
|
13
|
+
unit: { default: "%" },
|
|
14
|
+
label: { default: void 0 },
|
|
15
|
+
title: { default: void 0 },
|
|
16
|
+
height: { default: void 0 },
|
|
17
|
+
loading: { type: Boolean, default: false },
|
|
18
|
+
empty: { type: Boolean, default: false }
|
|
19
|
+
},
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const attrs = useAttrs();
|
|
23
|
+
const option = computed(() => ({
|
|
24
|
+
series: [
|
|
25
|
+
{
|
|
26
|
+
type: "gauge",
|
|
27
|
+
min: 0,
|
|
28
|
+
max: props.max,
|
|
29
|
+
radius: "88%",
|
|
30
|
+
center: ["50%", "58%"],
|
|
31
|
+
progress: {
|
|
32
|
+
show: true,
|
|
33
|
+
width: 10,
|
|
34
|
+
itemStyle: {
|
|
35
|
+
color: seriesColor(0),
|
|
36
|
+
shadowColor: seriesColor(0),
|
|
37
|
+
shadowBlur: 10
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
axisLine: {
|
|
41
|
+
lineStyle: {
|
|
42
|
+
width: 10,
|
|
43
|
+
color: [[1, CHART_SPLIT_LINE]]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
axisTick: { show: false },
|
|
47
|
+
splitLine: { show: false },
|
|
48
|
+
axisLabel: {
|
|
49
|
+
color: CHART_AXIS_LABEL,
|
|
50
|
+
fontSize: 11,
|
|
51
|
+
// 往内收,避免与 detail/title 抢位置
|
|
52
|
+
distance: 6
|
|
53
|
+
},
|
|
54
|
+
pointer: {
|
|
55
|
+
width: 4,
|
|
56
|
+
length: "62%",
|
|
57
|
+
itemStyle: { color: seriesColor(0) }
|
|
58
|
+
},
|
|
59
|
+
anchor: {
|
|
60
|
+
show: true,
|
|
61
|
+
size: 10,
|
|
62
|
+
itemStyle: { color: seriesColor(0) }
|
|
63
|
+
},
|
|
64
|
+
/* 标题与数值的纵向位置必须错开:
|
|
65
|
+
detail 在中心偏上,title 在它下方。
|
|
66
|
+
早期 detail=44% / title=78%,两者与刻度标签(distance 14)
|
|
67
|
+
挤在一起,实测「转化率」与刻度重叠。 */
|
|
68
|
+
title: {
|
|
69
|
+
show: Boolean(props.label),
|
|
70
|
+
offsetCenter: [0, "72%"],
|
|
71
|
+
color: CHART_AXIS_LABEL,
|
|
72
|
+
fontSize: 13
|
|
73
|
+
},
|
|
74
|
+
detail: {
|
|
75
|
+
valueAnimation: true,
|
|
76
|
+
offsetCenter: [0, "38%"],
|
|
77
|
+
fontSize: 24,
|
|
78
|
+
fontWeight: 600,
|
|
79
|
+
color: "var(--fbk-color-text)",
|
|
80
|
+
formatter: `{value}${props.unit}`
|
|
81
|
+
},
|
|
82
|
+
data: [{ value: props.value, name: props.label ?? "" }]
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}));
|
|
86
|
+
return (_ctx, _cache) => {
|
|
87
|
+
return openBlock(), createElementBlock("div", mergeProps({ class: "fbk-screen-chart" }, unref(attrs)), [
|
|
88
|
+
__props.title ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
|
|
89
|
+
createVNode(unref(FbkChart), {
|
|
90
|
+
option: option.value,
|
|
91
|
+
height: __props.height,
|
|
92
|
+
loading: __props.loading,
|
|
93
|
+
"is-empty": __props.empty,
|
|
94
|
+
"empty-text": "暂无数据"
|
|
95
|
+
}, null, 8, ["option", "height", "loading", "is-empty"])
|
|
96
|
+
], 16);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
export {
|
|
101
|
+
_sfc_main as default
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=ScreenGaugeChart.vue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenGaugeChart.vue.mjs","sources":["../src/ScreenGaugeChart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport {\n FbkChart,\n CHART_AXIS_LABEL,\n CHART_SPLIT_LINE,\n seriesColor,\n} from '@fbkworks/chart-core'\nimport type { ScreenGaugeChartProps } from './types'\n\n/**\n * 仪表盘。大屏常见的\"完成率 / 健康度\"类指标。\n *\n * 用 ECharts gauge 而不是自己画 SVG:\n * 刻度、指针、弧线的数学计算容易出错,交给图表库更稳。\n */\ndefineOptions({ name: 'FbkScreenGaugeChart', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ScreenGaugeChartProps>(), {\n title: undefined,\n height: undefined,\n loading: false,\n empty: false,\n max: 100,\n unit: '%',\n label: undefined,\n})\n\n/* inheritAttrs: false 时必须手动转发 attrs,否则调用方的 class/style 会丢失 */\nconst attrs = useAttrs()\n\nconst option = computed(() => ({\n series: [\n {\n type: 'gauge',\n min: 0,\n max: props.max,\n radius: '88%',\n center: ['50%', '58%'],\n progress: {\n show: true,\n width: 10,\n itemStyle: {\n color: seriesColor(0),\n shadowColor: seriesColor(0),\n shadowBlur: 10,\n },\n },\n axisLine: {\n lineStyle: {\n width: 10,\n color: [[1, CHART_SPLIT_LINE]],\n },\n },\n axisTick: { show: false },\n splitLine: { show: false },\n axisLabel: {\n color: CHART_AXIS_LABEL,\n fontSize: 11,\n // 往内收,避免与 detail/title 抢位置\n distance: 6,\n },\n pointer: {\n width: 4,\n length: '62%',\n itemStyle: { color: seriesColor(0) },\n },\n anchor: {\n show: true,\n size: 10,\n itemStyle: { color: seriesColor(0) },\n },\n /* 标题与数值的纵向位置必须错开:\n detail 在中心偏上,title 在它下方。\n 早期 detail=44% / title=78%,两者与刻度标签(distance 14)\n 挤在一起,实测「转化率」与刻度重叠。 */\n title: {\n show: Boolean(props.label),\n offsetCenter: [0, '72%'],\n color: CHART_AXIS_LABEL,\n fontSize: 13,\n },\n detail: {\n valueAnimation: true,\n offsetCenter: [0, '38%'],\n fontSize: 24,\n fontWeight: 600,\n color: 'var(--fbk-color-text)',\n formatter: `{value}${props.unit}`,\n },\n data: [{ value: props.value, name: props.label ?? '' }],\n },\n ],\n}))\n</script>\n\n<template>\n <div class=\"fbk-screen-chart\" v-bind=\"attrs\">\n <div v-if=\"title\" class=\"fbk-screen-chart__title\">{{ title }}</div>\n <FbkChart\n :option=\"option\"\n :height=\"height\"\n :loading=\"loading\"\n :is-empty=\"empty\"\n empty-text=\"暂无数据\"\n />\n </div>\n</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,YACvB,UAAU;AAAA,YACV,YAAY;AAAA,YACZ,OAAO;AAAA,YACP,WAAW,UAAU,MAAM,IAAI;AAAA,UAAA;AAAA,UAEjC,MAAM,CAAC,EAAE,OAAO,MAAM,OAAO,MAAM,MAAM,SAAS,GAAA,CAAI;AAAA,QAAA;AAAA,MACxD;AAAA,IACF,EACA;;AAIA,aAAAA,UAAA,GAAAC,mBASM,OATNC,WASM,EATD,OAAM,mBAAA,GAA2BC,MAAA,KAAA,CAAK,GAAA;AAAA,QAC9B,QAAA,sBAAXF,mBAAmE,OAAnE,YAAmEG,gBAAd,QAAA,KAAK,GAAA,CAAA;QAC1DC,YAMEF,MAAA,QAAA,GAAA;AAAA,UALC,QAAQ,OAAA;AAAA,UACR,QAAQ,QAAA;AAAA,UACR,SAAS,QAAA;AAAA,UACT,YAAU,QAAA;AAAA,UACX,cAAW;AAAA,QAAA;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenGaugeChart2.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ScreenGridProps } from './types.js';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: any;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<ScreenGridProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ScreenGridProps> & Readonly<{}>, {
|
|
12
|
+
columns: number;
|
|
13
|
+
gap: "sm" | "md" | "lg";
|
|
14
|
+
rows: string;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent, computed, useAttrs, openBlock, createElementBlock, mergeProps, unref, renderSlot } from "vue";
|
|
2
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
|
+
...{ name: "FbkScreenGrid", inheritAttrs: false },
|
|
4
|
+
__name: "ScreenGrid",
|
|
5
|
+
props: {
|
|
6
|
+
columns: { default: 24 },
|
|
7
|
+
gap: { default: "md" },
|
|
8
|
+
rows: { default: void 0 }
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const style = computed(() => ({
|
|
13
|
+
gridTemplateColumns: `repeat(${props.columns}, minmax(0, 1fr))`,
|
|
14
|
+
...props.rows ? { gridTemplateRows: props.rows } : {}
|
|
15
|
+
}));
|
|
16
|
+
const attrs = useAttrs();
|
|
17
|
+
return (_ctx, _cache) => {
|
|
18
|
+
return openBlock(), createElementBlock("div", mergeProps(unref(attrs), {
|
|
19
|
+
class: ["fbk-screen-grid", `fbk-screen-grid--gap-${__props.gap}`],
|
|
20
|
+
style: style.value
|
|
21
|
+
}), [
|
|
22
|
+
renderSlot(_ctx.$slots, "default")
|
|
23
|
+
], 16);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
_sfc_main as default
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=ScreenGrid.vue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenGrid.vue.mjs","sources":["../src/ScreenGrid.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport type { ScreenGridProps } from './types'\n\n/**\n * 大屏栅格。默认 24 列 —— 大屏需要比 12 列更细的切分。\n *\n * 用 inline style 写 `grid-template-columns` 而不是 CSS 类:\n * 列数是运行时 props,穷举类名不现实。\n */\ndefineOptions({ name: 'FbkScreenGrid', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ScreenGridProps>(), {\n columns: 24,\n gap: 'md',\n rows: undefined,\n})\n\nconst style = computed(() => ({\n gridTemplateColumns: `repeat(${props.columns}, minmax(0, 1fr))`,\n ...(props.rows ? { gridTemplateRows: props.rows } : {}),\n}))\n\n/* inheritAttrs: false 时 class / style 不会自动落到根元素 ——\n 必须手动转发,否则调用方写的 class=\"screen-main\" 完全失效。\n 实测症状:给 Grid 加 class 后高度设置不生效,面板收缩成标题高度。 */\nconst attrs = useAttrs()\n</script>\n\n<template>\n <div v-bind=\"attrs\" class=\"fbk-screen-grid\" :class=\"`fbk-screen-grid--gap-${gap}`\" :style=\"style\">\n <slot />\n </div>\n</template>\n"],"names":["_createElementBlock","_mergeProps","_unref","_renderSlot"],"mappings":";;;;;;;;;;AAYA,UAAM,QAAQ;AAMd,UAAM,QAAQ,SAAS,OAAO;AAAA,MAC5B,qBAAqB,UAAU,MAAM,OAAO;AAAA,MAC5C,GAAI,MAAM,OAAO,EAAE,kBAAkB,MAAM,KAAA,IAAS,CAAA;AAAA,IAAC,EACrD;AAKF,UAAM,QAAQ,SAAA;;0BAIZA,mBAEM,OAFNC,WAEMC,MAAA,KAAA,GAFY;AAAA,QAAE,OAAK,CAAC,mBAAiB,wBAAiC,QAAA,GAAG,EAAA;AAAA,QAAK,OAAO,MAAA;AAAA,MAAA;QACzFC,WAAQ,KAAA,QAAA,SAAA;AAAA,MAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenGrid2.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ScreenHeaderProps } from './types.js';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
left?(_: {}): any;
|
|
6
|
+
right?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
refs: {};
|
|
9
|
+
rootEl: any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<ScreenHeaderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ScreenHeaderProps> & Readonly<{}>, {
|
|
13
|
+
fullscreen: boolean;
|
|
14
|
+
clock: boolean;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, ref, onMounted, onBeforeUnmount, openBlock, createElementBlock, mergeProps, unref, createElementVNode, renderSlot, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
+
const _hoisted_1 = { class: "fbk-screen-header__side fbk-screen-header__side--left" };
|
|
3
|
+
const _hoisted_2 = { class: "fbk-screen-header__center" };
|
|
4
|
+
const _hoisted_3 = { class: "fbk-screen-header__title" };
|
|
5
|
+
const _hoisted_4 = { class: "fbk-screen-header__side fbk-screen-header__side--right" };
|
|
6
|
+
const _hoisted_5 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "fbk-screen-header__clock"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_6 = ["aria-label"];
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
...{ name: "FbkScreenHeader", inheritAttrs: false },
|
|
13
|
+
__name: "ScreenHeader",
|
|
14
|
+
props: {
|
|
15
|
+
title: {},
|
|
16
|
+
clock: { type: Boolean, default: true },
|
|
17
|
+
fullscreen: { type: Boolean, default: true }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const attrs = useAttrs();
|
|
22
|
+
const now = ref(/* @__PURE__ */ new Date());
|
|
23
|
+
let timer = null;
|
|
24
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
25
|
+
function format(d) {
|
|
26
|
+
const date = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
27
|
+
const time = `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
|
|
28
|
+
return `${date} ${time}`;
|
|
29
|
+
}
|
|
30
|
+
onMounted(() => {
|
|
31
|
+
if (!props.clock) return;
|
|
32
|
+
timer = setInterval(() => now.value = /* @__PURE__ */ new Date(), 1e3);
|
|
33
|
+
});
|
|
34
|
+
onBeforeUnmount(() => {
|
|
35
|
+
if (timer) clearInterval(timer);
|
|
36
|
+
timer = null;
|
|
37
|
+
});
|
|
38
|
+
const isFullscreen = ref(false);
|
|
39
|
+
async function toggleFullscreen() {
|
|
40
|
+
if (typeof document === "undefined") return;
|
|
41
|
+
try {
|
|
42
|
+
if (!document.fullscreenElement) {
|
|
43
|
+
await document.documentElement.requestFullscreen();
|
|
44
|
+
isFullscreen.value = true;
|
|
45
|
+
} else {
|
|
46
|
+
await document.exitFullscreen();
|
|
47
|
+
isFullscreen.value = false;
|
|
48
|
+
}
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return (_ctx, _cache) => {
|
|
53
|
+
return openBlock(), createElementBlock("header", mergeProps({ class: "fbk-screen-header" }, unref(attrs)), [
|
|
54
|
+
createElementVNode("div", _hoisted_1, [
|
|
55
|
+
renderSlot(_ctx.$slots, "left")
|
|
56
|
+
]),
|
|
57
|
+
createElementVNode("div", _hoisted_2, [
|
|
58
|
+
createElementVNode("h1", _hoisted_3, toDisplayString(__props.title), 1),
|
|
59
|
+
_cache[0] || (_cache[0] = createElementVNode("div", {
|
|
60
|
+
class: "fbk-screen-header__decoration",
|
|
61
|
+
"aria-hidden": "true"
|
|
62
|
+
}, null, -1))
|
|
63
|
+
]),
|
|
64
|
+
createElementVNode("div", _hoisted_4, [
|
|
65
|
+
renderSlot(_ctx.$slots, "right", {}, () => [
|
|
66
|
+
__props.clock ? (openBlock(), createElementBlock("time", _hoisted_5, toDisplayString(format(now.value)), 1)) : createCommentVNode("", true),
|
|
67
|
+
__props.fullscreen ? (openBlock(), createElementBlock("button", {
|
|
68
|
+
key: 1,
|
|
69
|
+
type: "button",
|
|
70
|
+
class: "fbk-screen-header__fullscreen",
|
|
71
|
+
"aria-label": isFullscreen.value ? "退出全屏" : "进入全屏",
|
|
72
|
+
onClick: toggleFullscreen
|
|
73
|
+
}, toDisplayString(isFullscreen.value ? "退出全屏" : "全屏"), 9, _hoisted_6)) : createCommentVNode("", true)
|
|
74
|
+
])
|
|
75
|
+
])
|
|
76
|
+
], 16);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
_sfc_main as default
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=ScreenHeader.vue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenHeader.vue.mjs","sources":["../src/ScreenHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref, useAttrs } from 'vue'\nimport type { ScreenHeaderProps } from './types'\n\n/**\n * 大屏顶部标题栏。\n *\n * 设计要点:\n * · 标题字距 0.08em + text-shadow 发光 —— 科技感的主要来源\n * · 底部装饰线用渐变(透明→青→透明),而不是实线\n * · 时间与全屏按钮绝对定位在两端,标题始终居中\n */\ndefineOptions({ name: 'FbkScreenHeader', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ScreenHeaderProps>(), {\n clock: true,\n fullscreen: true,\n})\n\n/* inheritAttrs: false 时必须手动转发 attrs,否则调用方的 class/style 会丢失 */\nconst attrs = useAttrs()\n\nconst now = ref(new Date())\nlet timer: ReturnType<typeof setInterval> | null = null\n\nconst pad = (n: number) => String(n).padStart(2, '0')\n\nfunction format(d: Date) {\n const date = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`\n const time = `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`\n return `${date} ${time}`\n}\n\nonMounted(() => {\n if (!props.clock) return\n // 每秒更新。用 setInterval 而不是 rAF:时钟不需要 60fps\n timer = setInterval(() => (now.value = new Date()), 1000)\n})\n\nonBeforeUnmount(() => {\n if (timer) clearInterval(timer)\n timer = null\n})\n\nconst isFullscreen = ref(false)\n\nasync function toggleFullscreen() {\n if (typeof document === 'undefined') return\n try {\n if (!document.fullscreenElement) {\n await document.documentElement.requestFullscreen()\n isFullscreen.value = true\n } else {\n await document.exitFullscreen()\n isFullscreen.value = false\n }\n } catch {\n /* 某些环境(iframe 无 allowfullscreen)会拒绝,静默忽略 */\n }\n}\n</script>\n\n<template>\n <header class=\"fbk-screen-header\" v-bind=\"attrs\">\n <div class=\"fbk-screen-header__side fbk-screen-header__side--left\">\n <slot name=\"left\" />\n </div>\n\n <div class=\"fbk-screen-header__center\">\n <h1 class=\"fbk-screen-header__title\">{{ title }}</h1>\n <div class=\"fbk-screen-header__decoration\" aria-hidden=\"true\" />\n </div>\n\n <div class=\"fbk-screen-header__side fbk-screen-header__side--right\">\n <slot name=\"right\">\n <time v-if=\"clock\" class=\"fbk-screen-header__clock\">{{ format(now) }}</time>\n <button\n v-if=\"fullscreen\"\n type=\"button\"\n class=\"fbk-screen-header__fullscreen\"\n :aria-label=\"isFullscreen ? '退出全屏' : '进入全屏'\"\n @click=\"toggleFullscreen\"\n >\n {{ isFullscreen ? '退出全屏' : '全屏' }}\n </button>\n </slot>\n </div>\n </header>\n</template>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_unref","_createElementVNode","_renderSlot","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;;;;AAcA,UAAM,QAAQ;AAMd,UAAM,QAAQ,SAAA;AAEd,UAAM,MAAM,IAAI,oBAAI,MAAM;AAC1B,QAAI,QAA+C;AAEnD,UAAM,MAAM,CAAC,MAAc,OAAO,CAAC,EAAE,SAAS,GAAG,GAAG;AAEpD,aAAS,OAAO,GAAS;AACvB,YAAM,OAAO,GAAG,EAAE,YAAA,CAAa,IAAI,IAAI,EAAE,SAAA,IAAa,CAAC,CAAC,IAAI,IAAI,EAAE,QAAA,CAAS,CAAC;AAC5E,YAAM,OAAO,GAAG,IAAI,EAAE,SAAA,CAAU,CAAC,IAAI,IAAI,EAAE,WAAA,CAAY,CAAC,IAAI,IAAI,EAAE,WAAA,CAAY,CAAC;AAC/E,aAAO,GAAG,IAAI,IAAI,IAAI;AAAA,IACxB;AAEA,cAAU,MAAM;AACd,UAAI,CAAC,MAAM,MAAO;AAElB,cAAQ,YAAY,MAAO,IAAI,QAAQ,oBAAI,KAAA,GAAS,GAAI;AAAA,IAC1D,CAAC;AAED,oBAAgB,MAAM;AACpB,UAAI,qBAAqB,KAAK;AAC9B,cAAQ;AAAA,IACV,CAAC;AAED,UAAM,eAAe,IAAI,KAAK;AAE9B,mBAAe,mBAAmB;AAChC,UAAI,OAAO,aAAa,YAAa;AACrC,UAAI;AACF,YAAI,CAAC,SAAS,mBAAmB;AAC/B,gBAAM,SAAS,gBAAgB,kBAAA;AAC/B,uBAAa,QAAQ;AAAA,QACvB,OAAO;AACL,gBAAM,SAAS,eAAA;AACf,uBAAa,QAAQ;AAAA,QACvB;AAAA,MACF,QAAQ;AAAA,MAER;AAAA,IACF;;AAIE,aAAAA,UAAA,GAAAC,mBAwBS,UAxBTC,WAwBS,EAxBD,OAAM,oBAAA,GAA4BC,MAAA,KAAA,CAAK,GAAA;AAAA,QAC7CC,mBAEM,OAFN,YAEM;AAAA,UADJC,WAAoB,KAAA,QAAA,MAAA;AAAA,QAAA;QAGtBD,mBAGM,OAHN,YAGM;AAAA,UAFJA,mBAAqD,MAArD,YAAqDE,gBAAb,QAAA,KAAK,GAAA,CAAA;AAAA,oCAC7CF,mBAAgE,OAAA;AAAA,YAA3D,OAAM;AAAA,YAAgC,eAAY;AAAA,UAAA;;QAGzDA,mBAaM,OAbN,YAaM;AAAA,UAZJC,WAWO,0BAXP,MAWO;AAAA,YAVO,QAAA,SAAZL,UAAA,GAAAC,mBAA4E,QAA5E,YAA4EK,gBAArB,OAAO,IAAA,KAAG,CAAA,GAAA,CAAA;YAEzD,QAAA,2BADRL,mBAQS,UAAA;AAAA;cANP,MAAK;AAAA,cACL,OAAM;AAAA,cACL,cAAY,aAAA,QAAY,SAAA;AAAA,cACxB,SAAO;AAAA,YAAA,mBAEL,aAAA,QAAY,SAAA,IAAA,GAAA,GAAA,UAAA;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenHeader2.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ScreenLineChartProps } from './types.js';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ScreenLineChartProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ScreenLineChartProps> & Readonly<{}>, {
|
|
3
|
+
smooth: boolean;
|
|
4
|
+
area: boolean;
|
|
5
|
+
height: string | number;
|
|
6
|
+
title: string;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
empty: boolean;
|
|
9
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, computed, openBlock, createElementBlock, mergeProps, unref, toDisplayString, createCommentVNode, createVNode } from "vue";
|
|
2
|
+
import { CHART_SPLIT_LINE, CHART_AXIS_LABEL, CHART_AXIS_LINE, seriesColor, FbkChart } from "@fbkworks/chart-core";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "fbk-screen-chart__title"
|
|
6
|
+
};
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
...{ name: "FbkScreenLineChart", inheritAttrs: false },
|
|
9
|
+
__name: "ScreenLineChart",
|
|
10
|
+
props: {
|
|
11
|
+
categories: {},
|
|
12
|
+
series: {},
|
|
13
|
+
smooth: { type: Boolean, default: true },
|
|
14
|
+
area: { type: Boolean, default: true },
|
|
15
|
+
title: { default: void 0 },
|
|
16
|
+
height: { default: void 0 },
|
|
17
|
+
loading: { type: Boolean, default: false },
|
|
18
|
+
empty: { type: Boolean, default: false }
|
|
19
|
+
},
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const attrs = useAttrs();
|
|
23
|
+
const option = computed(() => ({
|
|
24
|
+
grid: { left: 8, right: 16, top: props.series.length > 1 ? 44 : 20, bottom: 8, containLabel: true },
|
|
25
|
+
tooltip: { trigger: "axis" },
|
|
26
|
+
legend: props.series.length > 1 ? { top: 0, right: 0, itemGap: 20, icon: "roundRect", textStyle: { fontSize: 14 } } : void 0,
|
|
27
|
+
xAxis: {
|
|
28
|
+
type: "category",
|
|
29
|
+
data: props.categories,
|
|
30
|
+
boundaryGap: false,
|
|
31
|
+
axisLine: { lineStyle: { color: CHART_AXIS_LINE, width: 1 } },
|
|
32
|
+
axisLabel: { color: CHART_AXIS_LABEL, fontSize: 14 },
|
|
33
|
+
axisTick: { show: false }
|
|
34
|
+
},
|
|
35
|
+
yAxis: {
|
|
36
|
+
type: "value",
|
|
37
|
+
min: 0,
|
|
38
|
+
axisLine: { show: false },
|
|
39
|
+
axisLabel: { color: CHART_AXIS_LABEL, fontSize: 14 },
|
|
40
|
+
splitLine: { lineStyle: { color: CHART_SPLIT_LINE, type: "dashed" } }
|
|
41
|
+
},
|
|
42
|
+
series: props.series.map((s, i) => {
|
|
43
|
+
const color = seriesColor(i, s.color);
|
|
44
|
+
return {
|
|
45
|
+
name: s.name,
|
|
46
|
+
type: "line",
|
|
47
|
+
data: s.data,
|
|
48
|
+
smooth: props.smooth,
|
|
49
|
+
symbol: "circle",
|
|
50
|
+
symbolSize: 7,
|
|
51
|
+
showSymbol: true,
|
|
52
|
+
itemStyle: { color },
|
|
53
|
+
lineStyle: {
|
|
54
|
+
width: 3,
|
|
55
|
+
// 发光:大屏的视觉语言,浅色主题下不会用到这个组件
|
|
56
|
+
shadowColor: color,
|
|
57
|
+
shadowBlur: 10
|
|
58
|
+
},
|
|
59
|
+
areaStyle: props.area ? {
|
|
60
|
+
opacity: 0.18,
|
|
61
|
+
color: {
|
|
62
|
+
type: "linear",
|
|
63
|
+
x: 0,
|
|
64
|
+
y: 0,
|
|
65
|
+
x2: 0,
|
|
66
|
+
y2: 1,
|
|
67
|
+
colorStops: [
|
|
68
|
+
{ offset: 0, color },
|
|
69
|
+
{ offset: 1, color: "transparent" }
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
} : void 0
|
|
73
|
+
};
|
|
74
|
+
})
|
|
75
|
+
}));
|
|
76
|
+
return (_ctx, _cache) => {
|
|
77
|
+
return openBlock(), createElementBlock("div", mergeProps({ class: "fbk-screen-chart" }, unref(attrs)), [
|
|
78
|
+
__props.title ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
|
|
79
|
+
createVNode(unref(FbkChart), {
|
|
80
|
+
option: option.value,
|
|
81
|
+
height: __props.height,
|
|
82
|
+
loading: __props.loading,
|
|
83
|
+
"is-empty": __props.empty || !__props.categories.length,
|
|
84
|
+
"empty-text": "暂无数据"
|
|
85
|
+
}, null, 8, ["option", "height", "loading", "is-empty"])
|
|
86
|
+
], 16);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
_sfc_main as default
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=ScreenLineChart.vue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenLineChart.vue.mjs","sources":["../src/ScreenLineChart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport {\n FbkChart,\n CHART_AXIS_LABEL,\n CHART_AXIS_LINE,\n CHART_SPLIT_LINE,\n seriesColor,\n} from '@fbkworks/chart-core'\nimport type { ScreenLineChartProps } from './types'\n\n/**\n * 大屏折线图。\n *\n * 与 dashboard 的 TrendChart 的区别(不是简单复用):\n * · 线更粗(3px vs 2px)、发光更强 —— 远距离观看需要更重的笔触\n * · 坐标轴文字更大(14px vs 12px)\n * · 默认显示所有数据点符号(大屏不 hover,看不到 tooltip)\n */\ndefineOptions({ name: 'FbkScreenLineChart', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ScreenLineChartProps>(), {\n title: undefined,\n height: undefined,\n loading: false,\n empty: false,\n smooth: true,\n area: true,\n})\n\n/* inheritAttrs: false 时必须手动转发 attrs,否则调用方的 class/style 会丢失 */\nconst attrs = useAttrs()\n\nconst option = computed(() => ({\n grid: { left: 8, right: 16, top: props.series.length > 1 ? 44 : 20, bottom: 8, containLabel: true },\n tooltip: { trigger: 'axis' },\n legend:\n props.series.length > 1\n ? { top: 0, right: 0, itemGap: 20, icon: 'roundRect', textStyle: { fontSize: 14 } }\n : undefined,\n xAxis: {\n type: 'category',\n data: props.categories,\n boundaryGap: false,\n axisLine: { lineStyle: { color: CHART_AXIS_LINE, width: 1 } },\n axisLabel: { color: CHART_AXIS_LABEL, fontSize: 14 },\n axisTick: { show: false },\n },\n yAxis: {\n type: 'value',\n min: 0,\n axisLine: { show: false },\n axisLabel: { color: CHART_AXIS_LABEL, fontSize: 14 },\n splitLine: { lineStyle: { color: CHART_SPLIT_LINE, type: 'dashed' } },\n },\n series: props.series.map((s, i) => {\n const color = seriesColor(i, s.color)\n return {\n name: s.name,\n type: 'line',\n data: s.data,\n smooth: props.smooth,\n symbol: 'circle',\n symbolSize: 7,\n showSymbol: true,\n itemStyle: { color },\n lineStyle: {\n width: 3,\n // 发光:大屏的视觉语言,浅色主题下不会用到这个组件\n shadowColor: color,\n shadowBlur: 10,\n },\n areaStyle: props.area\n ? {\n opacity: 0.18,\n color: {\n type: 'linear',\n x: 0,\n y: 0,\n x2: 0,\n y2: 1,\n colorStops: [\n { offset: 0, color },\n { offset: 1, color: 'transparent' },\n ],\n },\n }\n : undefined,\n }\n }),\n}))\n</script>\n\n<template>\n <div class=\"fbk-screen-chart\" v-bind=\"attrs\">\n <div v-if=\"title\" class=\"fbk-screen-chart__title\">{{ title }}</div>\n <FbkChart\n :option=\"option\"\n :height=\"height\"\n :loading=\"loading\"\n :is-empty=\"empty || !categories.length\"\n empty-text=\"暂无数据\"\n />\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_unref","_toDisplayString","_createVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,UAAM,QAAQ;AAUd,UAAM,QAAQ,SAAA;AAEd,UAAM,SAAS,SAAS,OAAO;AAAA,MAC7B,MAAM,EAAE,MAAM,GAAG,OAAO,IAAI,KAAK,MAAM,OAAO,SAAS,IAAI,KAAK,IAAI,QAAQ,GAAG,cAAc,KAAA;AAAA,MAC7F,SAAS,EAAE,SAAS,OAAA;AAAA,MACpB,QACE,MAAM,OAAO,SAAS,IAClB,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,IAAI,MAAM,aAAa,WAAW,EAAE,UAAU,GAAA,MAC3E;AAAA,MACN,OAAO;AAAA,QACL,MAAM;AAAA,QACN,MAAM,MAAM;AAAA,QACZ,aAAa;AAAA,QACb,UAAU,EAAE,WAAW,EAAE,OAAO,iBAA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AA,GAAA;AAAA,UALC,QAAQ,OAAA;AAAA,UACR,QAAQ,QAAA;AAAA,UACR,SAAS,QAAA;AAAA,UACT,YAAU,QAAA,SAAK,CAAK,QAAA,WAAW;AAAA,UAChC,cAAW;AAAA,QAAA;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenLineChart2.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScreenNumberProps } from './types.js';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ScreenNumberProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ScreenNumberProps> & Readonly<{}>, {
|
|
3
|
+
precision: number;
|
|
4
|
+
prefix: string;
|
|
5
|
+
suffix: string;
|
|
6
|
+
duration: number;
|
|
7
|
+
size: "sm" | "md" | "lg";
|
|
8
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|