@liujitcn/kratos-admin-bi 0.0.0-stage → 0.1.11
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/README.md +43 -2
- package/dist/package/declarations/index.d.ts +1 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_card.d.ts +18 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_card.js +46 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_dashboard.d.ts +17 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_dashboard.js +30 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_query.d.ts +11 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_query.js +41 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_query_record.d.ts +10 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_query_record.js +14 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_source.d.ts +26 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_source.js +46 -0
- package/dist/package/declarations/src/bi-core.d.ts +17 -0
- package/dist/package/declarations/src/bi-core.js +22 -0
- package/dist/package/declarations/src/bi-dashboard-schema.d.ts +31 -0
- package/dist/package/declarations/src/bi-dashboard-schema.js +39 -0
- package/dist/package/declarations/src/bi-messages.d.ts +247 -0
- package/dist/package/declarations/src/bi-messages.js +247 -0
- package/dist/package/declarations/src/bi-response.d.ts +10 -0
- package/dist/package/declarations/src/bi-response.js +33 -0
- package/dist/package/declarations/src/bi-vue.d.ts +10 -0
- package/dist/package/declarations/src/bi-vue.js +10 -0
- package/dist/package/declarations/src/card-schema.d.ts +30 -0
- package/dist/package/declarations/src/card-schema.js +87 -0
- package/dist/package/declarations/src/components/BiCardChartEditor.vue.d.ts +17 -0
- package/dist/package/declarations/src/components/BiCardChartEditor.vue.js +527 -0
- package/dist/package/declarations/src/components/BiCardFormDialog.vue.d.ts +20 -0
- package/dist/package/declarations/src/components/BiCardFormDialog.vue.js +495 -0
- package/dist/package/declarations/src/components/BiCardLibrary.vue.d.ts +3 -0
- package/dist/package/declarations/src/components/BiCardLibrary.vue.js +807 -0
- package/dist/package/declarations/src/components/BiCardVisualization.vue.d.ts +10 -0
- package/dist/package/declarations/src/components/BiCardVisualization.vue.js +97 -0
- package/dist/package/declarations/src/components/BiChart.vue.d.ts +20 -0
- package/dist/package/declarations/src/components/BiChart.vue.js +112 -0
- package/dist/package/declarations/src/components/BiDashboard.vue.d.ts +9 -0
- package/dist/package/declarations/src/components/BiDashboard.vue.js +81 -0
- package/dist/package/declarations/src/components/BiDashboardMenuDialog.vue.d.ts +12 -0
- package/dist/package/declarations/src/components/BiDashboardMenuDialog.vue.js +252 -0
- package/dist/package/declarations/src/components/BiDataCard.vue.d.ts +36 -0
- package/dist/package/declarations/src/components/BiDataCard.vue.js +372 -0
- package/dist/package/declarations/src/components/BiDesigner.vue.d.ts +17 -0
- package/dist/package/declarations/src/components/BiDesigner.vue.js +666 -0
- package/dist/package/declarations/src/components/BiSourceModelDialog.vue.d.ts +17 -0
- package/dist/package/declarations/src/components/BiSourceModelDialog.vue.js +2118 -0
- package/dist/package/declarations/src/components/BiWorkbenchPreview.vue.d.ts +7 -0
- package/dist/package/declarations/src/components/BiWorkbenchPreview.vue.js +176 -0
- package/dist/package/declarations/src/components/source-model-layout.d.ts +3 -0
- package/dist/package/declarations/src/components/source-model-layout.js +66 -0
- package/dist/package/declarations/src/dataset/index.d.ts +7 -0
- package/dist/package/declarations/src/dataset/index.js +25 -0
- package/dist/package/declarations/src/dataset/labels.d.ts +2 -0
- package/dist/package/declarations/src/dataset/labels.js +21 -0
- package/dist/package/declarations/src/dataset/transform.d.ts +20 -0
- package/dist/package/declarations/src/dataset/transform.js +173 -0
- package/dist/package/declarations/src/engine/chart-types.d.ts +14 -0
- package/dist/package/declarations/src/engine/chart-types.js +37 -0
- package/dist/package/declarations/src/engine/echarts.d.ts +16 -0
- package/dist/package/declarations/src/engine/echarts.js +491 -0
- package/dist/package/declarations/src/engine/types.d.ts +36 -0
- package/dist/package/declarations/src/engine/types.js +20 -0
- package/dist/package/declarations/src/env.d.ts +17 -0
- package/dist/package/declarations/src/env.js +67 -0
- package/dist/package/declarations/src/index.d.ts +1 -0
- package/dist/package/declarations/src/index.js +1 -0
- package/dist/package/declarations/src/locales/en-US.json +254 -0
- package/dist/package/declarations/src/locales/generated.d.ts +1021 -0
- package/dist/package/declarations/src/locales/generated.js +13 -0
- package/dist/package/declarations/src/locales/ja-JP.json +254 -0
- package/dist/package/declarations/src/locales/zh-CN.json +254 -0
- package/dist/package/declarations/src/locales/zh-TW.json +254 -0
- package/dist/package/declarations/src/module.d.ts +2 -0
- package/dist/package/declarations/src/module.js +9 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_card.d.ts +145 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_card.js +6 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_dashboard.d.ts +107 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_dashboard.js +6 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query.d.ts +157 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query.js +6 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query_record.d.ts +83 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query_record.js +15 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_source.d.ts +301 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_source.js +6 -0
- package/dist/package/declarations/src/rpc/common/v1/types.d.ts +60 -0
- package/dist/package/declarations/src/rpc/common/v1/types.js +6 -0
- package/dist/package/declarations/src/schema/layout.d.ts +7 -0
- package/dist/package/declarations/src/schema/layout.js +52 -0
- package/dist/package/declarations/src/schema/types.d.ts +83 -0
- package/dist/package/declarations/src/schema/types.js +1 -0
- package/dist/package/declarations/src/theme/index.d.ts +29 -0
- package/dist/package/declarations/src/theme/index.js +83 -0
- package/dist/package/declarations/src/theme/palettes.d.ts +7 -0
- package/dist/package/declarations/src/theme/palettes.js +28 -0
- package/dist/package/declarations/src/theme/presets.d.ts +73 -0
- package/dist/package/declarations/src/theme/presets.js +235 -0
- package/dist/package/declarations/src/views/card/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/card/index.vue.js +18 -0
- package/dist/package/declarations/src/views/dashboard/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/dashboard/index.vue.js +107 -0
- package/dist/package/declarations/src/views/designer/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/designer/index.vue.js +332 -0
- package/dist/package/declarations/src/views/manage/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/manage/index.vue.js +325 -0
- package/dist/package/declarations/src/views/query/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/query/index.vue.js +876 -0
- package/dist/package/declarations/src/views/source/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/source/index.vue.js +343 -0
- package/dist/package/declarations/src/views/workbench/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/workbench/index.vue.js +362 -0
- package/dist/package/src/api/bi/admin/v1/bi_card.ts +67 -0
- package/dist/package/src/api/bi/admin/v1/bi_dashboard.ts +51 -0
- package/dist/package/src/api/bi/admin/v1/bi_query.ts +55 -0
- package/dist/package/src/api/bi/admin/v1/bi_query_record.ts +25 -0
- package/dist/package/src/api/bi/admin/v1/bi_source.ts +80 -0
- package/dist/package/src/bi-core.ts +43 -0
- package/dist/package/src/bi-dashboard-schema.ts +69 -0
- package/dist/package/src/bi-messages.ts +249 -0
- package/dist/package/src/bi-response.ts +39 -0
- package/dist/package/src/bi-vue.ts +13 -0
- package/dist/package/src/card-schema.ts +111 -0
- package/dist/package/src/components/BiCardChartEditor.vue +139 -0
- package/dist/package/src/components/BiCardFormDialog.vue +289 -0
- package/dist/package/src/components/BiCardLibrary.vue +310 -0
- package/dist/package/src/components/BiCardVisualization.vue +95 -0
- package/dist/package/src/components/BiChart.vue +134 -0
- package/dist/package/src/components/BiDashboard.vue +53 -0
- package/dist/package/src/components/BiDashboardMenuDialog.vue +177 -0
- package/dist/package/src/components/BiDataCard.vue +231 -0
- package/dist/package/src/components/BiDesigner.vue +287 -0
- package/dist/package/src/components/BiSourceModelDialog.vue +846 -0
- package/dist/package/src/components/BiWorkbenchPreview.vue +131 -0
- package/dist/package/src/components/source-model-layout.ts +62 -0
- package/dist/package/src/dataset/index.ts +28 -0
- package/dist/package/src/dataset/labels.ts +19 -0
- package/dist/package/src/dataset/transform.ts +189 -0
- package/dist/package/src/engine/chart-types.ts +44 -0
- package/dist/package/src/engine/echarts.ts +568 -0
- package/dist/package/src/engine/types.ts +60 -0
- package/dist/package/src/env.ts +82 -0
- package/dist/package/src/index.ts +1 -0
- package/dist/package/src/locales/en-US.json +254 -0
- package/dist/package/src/locales/generated.ts +16 -0
- package/dist/package/src/locales/ja-JP.json +254 -0
- package/dist/package/src/locales/zh-CN.json +254 -0
- package/dist/package/src/locales/zh-TW.json +254 -0
- package/dist/package/src/module.ts +12 -0
- package/dist/package/src/rpc/bi/admin/v1/bi_card.ts +169 -0
- package/dist/package/src/rpc/bi/admin/v1/bi_dashboard.ts +126 -0
- package/dist/package/src/rpc/bi/admin/v1/bi_query.ts +187 -0
- package/dist/package/src/rpc/bi/admin/v1/bi_query_record.ts +98 -0
- package/dist/package/src/rpc/bi/admin/v1/bi_source.ts +338 -0
- package/dist/package/src/rpc/common/v1/types.ts +77 -0
- package/dist/package/src/schema/layout.ts +54 -0
- package/dist/package/src/schema/types.ts +103 -0
- package/dist/package/src/styles.scss +1 -0
- package/dist/package/src/theme/index.ts +108 -0
- package/dist/package/src/theme/palettes.ts +34 -0
- package/dist/package/src/theme/presets.ts +278 -0
- package/dist/package/src/views/card/index.vue +5 -0
- package/dist/package/src/views/dashboard/index.vue +58 -0
- package/dist/package/src/views/designer/index.vue +164 -0
- package/dist/package/src/views/manage/index.vue +276 -0
- package/dist/package/src/views/query/index.vue +593 -0
- package/dist/package/src/views/source/index.vue +214 -0
- package/dist/package/src/views/workbench/index.vue +208 -0
- package/package.json +67 -3
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/// <reference types="../../../../../node_modules/.pnpm/@vue+language-core@3.3.13/node_modules/@vue/language-core/types/template-helpers.d.ts" />
|
|
2
|
+
/// <reference types="../../../../../node_modules/.pnpm/@vue+language-core@3.3.13/node_modules/@vue/language-core/types/props-fallback.d.ts" />
|
|
3
|
+
import { computed, onActivated, onBeforeUnmount, onDeactivated, onMounted, ref, watch } from "vue";
|
|
4
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
5
|
+
import BiCardVisualization from "./BiCardVisualization.vue";
|
|
6
|
+
import { cardRefreshDelay } from "../card-schema";
|
|
7
|
+
import { defBiCardService } from "../api/bi/admin/v1/bi_card";
|
|
8
|
+
const { defineProps, defineEmits, withDefaults, } = {};
|
|
9
|
+
const icon = DataAnalysis;
|
|
10
|
+
const sourceIcon = Coin;
|
|
11
|
+
const props = withDefaults(defineProps(), { sourceName: "", refreshKey: 0, rangeDays: 0, showPeriodFilter: false, showCategory: true });
|
|
12
|
+
const emit = defineEmits();
|
|
13
|
+
const effectiveRangeDays = computed(() => (props.showPeriodFilter ? props.rangeDays : 0));
|
|
14
|
+
const periodLabel = computed(() => {
|
|
15
|
+
const range = props.card.query?.time_range;
|
|
16
|
+
return !effectiveRangeDays.value && range ? `${range.start.slice(0, 10)} — ${range.end.slice(0, 10)}` : "";
|
|
17
|
+
});
|
|
18
|
+
const result = ref();
|
|
19
|
+
const loading = ref(false);
|
|
20
|
+
const error = ref("");
|
|
21
|
+
let timer;
|
|
22
|
+
let active = true;
|
|
23
|
+
let requestID = 0;
|
|
24
|
+
const data = computed(() => props.previewResult ?? result.value);
|
|
25
|
+
/** 按当前卡片周期加载数据,关闭或切换卡片后丢弃迟到响应。 */
|
|
26
|
+
async function loadData() {
|
|
27
|
+
clearTimeout(timer);
|
|
28
|
+
if (!active || props.card.id === 0 || props.previewResult)
|
|
29
|
+
return;
|
|
30
|
+
const current = ++requestID;
|
|
31
|
+
loading.value = true;
|
|
32
|
+
error.value = "";
|
|
33
|
+
try {
|
|
34
|
+
const loadedResult = await defBiCardService.GetBiCardData({ id: props.card.id, range_days: effectiveRangeDays.value });
|
|
35
|
+
if (current === requestID)
|
|
36
|
+
result.value = loadedResult;
|
|
37
|
+
}
|
|
38
|
+
catch (cause) {
|
|
39
|
+
if (current === requestID) {
|
|
40
|
+
error.value = cause instanceof Error ? cause.message : t("bi.query.error");
|
|
41
|
+
result.value = undefined;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
if (current === requestID) {
|
|
46
|
+
loading.value = false;
|
|
47
|
+
scheduleRefresh();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** 隐藏标签页时延后自动取数,避免后台持续查询。 */
|
|
52
|
+
function scheduleRefresh() {
|
|
53
|
+
clearTimeout(timer);
|
|
54
|
+
if (active && props.card.refresh_seconds > 0)
|
|
55
|
+
timer = setTimeout(() => {
|
|
56
|
+
if (document.hidden)
|
|
57
|
+
scheduleRefresh();
|
|
58
|
+
else
|
|
59
|
+
void loadData();
|
|
60
|
+
}, cardRefreshDelay(props.card.refresh_seconds));
|
|
61
|
+
}
|
|
62
|
+
/** 标签页重新可见后补一次刷新,避免错过每日刷新时间。 */
|
|
63
|
+
function handleVisibility() {
|
|
64
|
+
if (active && !document.hidden && props.card.refresh_seconds > 0 && !loading.value)
|
|
65
|
+
void loadData();
|
|
66
|
+
}
|
|
67
|
+
/** 停止非活动页面的定时器与响应回填。 */
|
|
68
|
+
function stop() {
|
|
69
|
+
active = false;
|
|
70
|
+
requestID++;
|
|
71
|
+
loading.value = false;
|
|
72
|
+
clearTimeout(timer);
|
|
73
|
+
}
|
|
74
|
+
watch(() => [props.card.id, props.card.updated_at, props.refreshKey, effectiveRangeDays.value], () => {
|
|
75
|
+
result.value = undefined;
|
|
76
|
+
void loadData();
|
|
77
|
+
}, { immediate: true });
|
|
78
|
+
onActivated(() => {
|
|
79
|
+
if (!active) {
|
|
80
|
+
active = true;
|
|
81
|
+
void loadData();
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
onDeactivated(stop);
|
|
85
|
+
onMounted(() => document.addEventListener("visibilitychange", handleVisibility));
|
|
86
|
+
onBeforeUnmount(() => {
|
|
87
|
+
stop();
|
|
88
|
+
document.removeEventListener("visibilitychange", handleVisibility);
|
|
89
|
+
});
|
|
90
|
+
const __VLS_defaults = { sourceName: "", refreshKey: 0, rangeDays: 0, showPeriodFilter: false, showCategory: true };
|
|
91
|
+
void __VLS_defaults;
|
|
92
|
+
const __VLS_ctx = {
|
|
93
|
+
...{},
|
|
94
|
+
...{},
|
|
95
|
+
...{},
|
|
96
|
+
...{},
|
|
97
|
+
};
|
|
98
|
+
let __VLS_components;
|
|
99
|
+
let __VLS_intrinsics;
|
|
100
|
+
let __VLS_directives;
|
|
101
|
+
void __VLS_ctx, __VLS_components, __VLS_intrinsics, __VLS_directives;
|
|
102
|
+
// @ts-ignore
|
|
103
|
+
__VLS_withDotValue(periodLabel, {});
|
|
104
|
+
// @ts-ignore
|
|
105
|
+
__VLS_withDotValue(data, {});
|
|
106
|
+
// @ts-ignore
|
|
107
|
+
__VLS_withDotValue(error, {});
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
__VLS_withDotValue(loading, {});
|
|
110
|
+
void {};
|
|
111
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.article, __VLS_intrinsics.article)({
|
|
112
|
+
...{ class: "bi-data-card" },
|
|
113
|
+
});
|
|
114
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card']} */ ;
|
|
115
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.header, __VLS_intrinsics.header)({
|
|
116
|
+
...{ class: "bi-data-card__header" },
|
|
117
|
+
});
|
|
118
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card__header']} */ ;
|
|
119
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
|
120
|
+
...{ class: "bi-data-card__heading" },
|
|
121
|
+
});
|
|
122
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card__heading']} */ ;
|
|
123
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.h3, __VLS_intrinsics.h3)({
|
|
124
|
+
...{ class: "bi-data-card__title" },
|
|
125
|
+
});
|
|
126
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card__title']} */ ;
|
|
127
|
+
let __VLS_0;
|
|
128
|
+
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
|
129
|
+
elIcon;
|
|
130
|
+
// @ts-ignore
|
|
131
|
+
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({
|
|
132
|
+
// @ts-ignore
|
|
133
|
+
...{ class: "bi-data-card__icon" },
|
|
134
|
+
}));
|
|
135
|
+
const __VLS_2 = __VLS_1({
|
|
136
|
+
...{ class: "bi-data-card__icon" },
|
|
137
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
138
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card__icon']} */ ;
|
|
139
|
+
const { default: __VLS_5 } = __VLS_nonNull(__VLS_3.slots);
|
|
140
|
+
const __VLS_6 = (__VLS_unwrap(icon, {}));
|
|
141
|
+
// @ts-ignore
|
|
142
|
+
const __VLS_7 = __VLS_asFunctionalComponent1(__VLS_6, new __VLS_6({
|
|
143
|
+
// @ts-ignore
|
|
144
|
+
}));
|
|
145
|
+
const __VLS_8 = __VLS_7({}, ...__VLS_functionalComponentArgsRest(__VLS_7));
|
|
146
|
+
// @ts-ignore
|
|
147
|
+
[icon,];
|
|
148
|
+
var __VLS_3;
|
|
149
|
+
(__VLS_ctx.card.name);
|
|
150
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
|
151
|
+
...{ class: "bi-data-card__meta" },
|
|
152
|
+
});
|
|
153
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card__meta']} */ ;
|
|
154
|
+
if (__VLS_ctx.showCategory) {
|
|
155
|
+
let __VLS_11;
|
|
156
|
+
/** @ts-ignore @type { | typeof __VLS_components.elTag | typeof __VLS_components.ElTag | typeof __VLS_components['el-tag'] | typeof __VLS_components.elTag | typeof __VLS_components.ElTag | typeof __VLS_components['el-tag']} */
|
|
157
|
+
elTag;
|
|
158
|
+
// @ts-ignore
|
|
159
|
+
const __VLS_12 = __VLS_asFunctionalComponent1(__VLS_11, new __VLS_11({
|
|
160
|
+
// @ts-ignore
|
|
161
|
+
size: "small", effect: "plain", type: "info",
|
|
162
|
+
}));
|
|
163
|
+
const __VLS_13 = __VLS_12({
|
|
164
|
+
size: "small",
|
|
165
|
+
effect: "plain",
|
|
166
|
+
type: "info",
|
|
167
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_12));
|
|
168
|
+
const { default: __VLS_16 } = __VLS_nonNull(__VLS_14.slots);
|
|
169
|
+
(__VLS_unwrap(t, {})(`bi.card.category.${__VLS_ctx.card.category || "mine"}`));
|
|
170
|
+
// @ts-ignore
|
|
171
|
+
[card, card, showCategory, t,];
|
|
172
|
+
var __VLS_14;
|
|
173
|
+
}
|
|
174
|
+
if (__VLS_ctx.showPeriodFilter) {
|
|
175
|
+
let __VLS_17;
|
|
176
|
+
/** @ts-ignore @type { | typeof __VLS_components.elSelect | typeof __VLS_components.ElSelect | typeof __VLS_components['el-select'] | typeof __VLS_components.elSelect | typeof __VLS_components.ElSelect | typeof __VLS_components['el-select']} */
|
|
177
|
+
elSelect;
|
|
178
|
+
// @ts-ignore
|
|
179
|
+
const __VLS_18 = __VLS_asFunctionalComponent1(__VLS_17, new __VLS_17({
|
|
180
|
+
// @ts-ignore
|
|
181
|
+
...{ 'onUpdate:modelValue': {} }, modelValue: (__VLS_unwrap(effectiveRangeDays, {})), ...{ class: "bi-data-card__period" }, size: "small", 'aria-label': (__VLS_unwrap(t, {})('bi.card.period', { name: __VLS_ctx.card.name })),
|
|
182
|
+
}));
|
|
183
|
+
const __VLS_19 = __VLS_18({
|
|
184
|
+
...{ 'onUpdate:modelValue': {} },
|
|
185
|
+
modelValue: (__VLS_unwrap(effectiveRangeDays, {})),
|
|
186
|
+
...{ class: "bi-data-card__period" },
|
|
187
|
+
size: "small",
|
|
188
|
+
'aria-label': (__VLS_unwrap(t, {})('bi.card.period', { name: __VLS_ctx.card.name })),
|
|
189
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_18));
|
|
190
|
+
let __VLS_22;
|
|
191
|
+
const __VLS_23 = {
|
|
192
|
+
/** @type {typeof __VLS_22.'update:modelValue'} */
|
|
193
|
+
'onUpdate:modelValue': // @ts-ignore
|
|
194
|
+
(...[$event]) => {
|
|
195
|
+
void $event;
|
|
196
|
+
if (!(__VLS_ctx.showPeriodFilter))
|
|
197
|
+
throw 0;
|
|
198
|
+
return (__VLS_unwrap(emit, {})('update:rangeDays', $event));
|
|
199
|
+
// @ts-ignore
|
|
200
|
+
[card, t, showPeriodFilter, effectiveRangeDays, emit,];
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
void __VLS_23;
|
|
204
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card__period']} */ ;
|
|
205
|
+
const { default: __VLS_24 } = __VLS_nonNull(__VLS_20.slots);
|
|
206
|
+
let __VLS_25;
|
|
207
|
+
/** @ts-ignore @type { | typeof __VLS_components.elOption | typeof __VLS_components.ElOption | typeof __VLS_components['el-option']} */
|
|
208
|
+
elOption;
|
|
209
|
+
// @ts-ignore
|
|
210
|
+
const __VLS_26 = __VLS_asFunctionalComponent1(__VLS_25, new __VLS_25({
|
|
211
|
+
// @ts-ignore
|
|
212
|
+
value: (0), label: (__VLS_unwrap(t, {})('bi.card.period.default')),
|
|
213
|
+
}));
|
|
214
|
+
const __VLS_27 = __VLS_26({
|
|
215
|
+
value: (0),
|
|
216
|
+
label: (__VLS_unwrap(t, {})('bi.card.period.default')),
|
|
217
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_26));
|
|
218
|
+
const __VLS_30 = __VLS_tryAsConstant(([7, 30]));
|
|
219
|
+
for (const [days] of __VLS_vFor(__VLS_nonNull(__VLS_30))) {
|
|
220
|
+
let __VLS_31;
|
|
221
|
+
/** @ts-ignore @type { | typeof __VLS_components.elOption | typeof __VLS_components.ElOption | typeof __VLS_components['el-option']} */
|
|
222
|
+
elOption;
|
|
223
|
+
// @ts-ignore
|
|
224
|
+
const __VLS_32 = __VLS_asFunctionalComponent1(__VLS_31, new __VLS_31({
|
|
225
|
+
// @ts-ignore
|
|
226
|
+
key: (days), value: (days), label: (__VLS_unwrap(t, {})('bi.card.period.recent_days', { days })),
|
|
227
|
+
}));
|
|
228
|
+
const __VLS_33 = __VLS_32({
|
|
229
|
+
key: (days),
|
|
230
|
+
value: (days),
|
|
231
|
+
label: (__VLS_unwrap(t, {})('bi.card.period.recent_days', { days })),
|
|
232
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_32));
|
|
233
|
+
// @ts-ignore
|
|
234
|
+
[t, t,];
|
|
235
|
+
}
|
|
236
|
+
// @ts-ignore
|
|
237
|
+
[];
|
|
238
|
+
var __VLS_20;
|
|
239
|
+
var __VLS_21;
|
|
240
|
+
}
|
|
241
|
+
if (periodLabel.value) {
|
|
242
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({});
|
|
243
|
+
(periodLabel.value);
|
|
244
|
+
}
|
|
245
|
+
if (data.value?.truncated) {
|
|
246
|
+
let __VLS_36;
|
|
247
|
+
/** @ts-ignore @type { | typeof __VLS_components.elTag | typeof __VLS_components.ElTag | typeof __VLS_components['el-tag'] | typeof __VLS_components.elTag | typeof __VLS_components.ElTag | typeof __VLS_components['el-tag']} */
|
|
248
|
+
elTag;
|
|
249
|
+
// @ts-ignore
|
|
250
|
+
const __VLS_37 = __VLS_asFunctionalComponent1(__VLS_36, new __VLS_36({
|
|
251
|
+
// @ts-ignore
|
|
252
|
+
size: "small", type: "warning",
|
|
253
|
+
}));
|
|
254
|
+
const __VLS_38 = __VLS_37({
|
|
255
|
+
size: "small",
|
|
256
|
+
type: "warning",
|
|
257
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_37));
|
|
258
|
+
const { default: __VLS_41 } = __VLS_nonNull(__VLS_39.slots);
|
|
259
|
+
(__VLS_unwrap(t, {})("bi.query.truncated"));
|
|
260
|
+
// @ts-ignore
|
|
261
|
+
[t, periodLabel, periodLabel, data,];
|
|
262
|
+
var __VLS_39;
|
|
263
|
+
}
|
|
264
|
+
var __VLS_42 = {};
|
|
265
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
|
266
|
+
...{ class: "bi-data-card__chart" },
|
|
267
|
+
'aria-busy': (loading.value),
|
|
268
|
+
});
|
|
269
|
+
__VLS_asFunctionalDirective(__VLS_directives.vLoading, {})(__VLS_nonNull(null), { ...__VLS_directiveBindingRestFields, value: (loading.value), }, __VLS_nonNull(null), __VLS_nonNull(null));
|
|
270
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card__chart']} */ ;
|
|
271
|
+
if (error.value) {
|
|
272
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
|
273
|
+
...{ class: "bi-data-card__error" },
|
|
274
|
+
role: "alert",
|
|
275
|
+
});
|
|
276
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card__error']} */ ;
|
|
277
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({});
|
|
278
|
+
(error.value);
|
|
279
|
+
let __VLS_44;
|
|
280
|
+
/** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
|
|
281
|
+
elButton;
|
|
282
|
+
// @ts-ignore
|
|
283
|
+
const __VLS_45 = __VLS_asFunctionalComponent1(__VLS_44, new __VLS_44({
|
|
284
|
+
// @ts-ignore
|
|
285
|
+
...{ 'onClick': {} }, link: true, type: "primary",
|
|
286
|
+
}));
|
|
287
|
+
const __VLS_46 = __VLS_45({
|
|
288
|
+
...{ 'onClick': {} },
|
|
289
|
+
link: true,
|
|
290
|
+
type: "primary",
|
|
291
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_45));
|
|
292
|
+
let __VLS_49;
|
|
293
|
+
const __VLS_50 = {
|
|
294
|
+
/** @type {typeof __VLS_49.click} */
|
|
295
|
+
onClick: (loadData),
|
|
296
|
+
};
|
|
297
|
+
void __VLS_50;
|
|
298
|
+
const { default: __VLS_51 } = __VLS_nonNull(__VLS_47.slots);
|
|
299
|
+
(__VLS_unwrap(t, {})("bi.card.retry"));
|
|
300
|
+
// @ts-ignore
|
|
301
|
+
[t, loading, loading, vLoading, error, error,];
|
|
302
|
+
var __VLS_47;
|
|
303
|
+
var __VLS_48;
|
|
304
|
+
}
|
|
305
|
+
else if (data.value) {
|
|
306
|
+
const __VLS_52 = BiCardVisualization;
|
|
307
|
+
// @ts-ignore
|
|
308
|
+
const __VLS_53 = __VLS_asFunctionalComponent1(__VLS_52, new __VLS_52({
|
|
309
|
+
// @ts-ignore
|
|
310
|
+
card: (__VLS_ctx.card), result: (data.value),
|
|
311
|
+
}));
|
|
312
|
+
const __VLS_54 = __VLS_53({
|
|
313
|
+
card: (__VLS_ctx.card),
|
|
314
|
+
result: (data.value),
|
|
315
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_53));
|
|
316
|
+
}
|
|
317
|
+
else if (!loading.value) {
|
|
318
|
+
let __VLS_57;
|
|
319
|
+
/** @ts-ignore @type { | typeof __VLS_components.elEmpty | typeof __VLS_components.ElEmpty | typeof __VLS_components['el-empty']} */
|
|
320
|
+
elEmpty;
|
|
321
|
+
// @ts-ignore
|
|
322
|
+
const __VLS_58 = __VLS_asFunctionalComponent1(__VLS_57, new __VLS_57({
|
|
323
|
+
// @ts-ignore
|
|
324
|
+
imageSize: (48), description: (__VLS_unwrap(t, {})('common.message.no_data')),
|
|
325
|
+
}));
|
|
326
|
+
const __VLS_59 = __VLS_58({
|
|
327
|
+
imageSize: (48),
|
|
328
|
+
description: (__VLS_unwrap(t, {})('common.message.no_data')),
|
|
329
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_58));
|
|
330
|
+
}
|
|
331
|
+
if (__VLS_ctx.sourceName) {
|
|
332
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
|
333
|
+
...{ class: "bi-data-card__source" },
|
|
334
|
+
});
|
|
335
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card__source']} */ ;
|
|
336
|
+
let __VLS_62;
|
|
337
|
+
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
|
338
|
+
elIcon;
|
|
339
|
+
// @ts-ignore
|
|
340
|
+
const __VLS_63 = __VLS_asFunctionalComponent1(__VLS_62, new __VLS_62({
|
|
341
|
+
// @ts-ignore
|
|
342
|
+
}));
|
|
343
|
+
const __VLS_64 = __VLS_63({}, ...__VLS_functionalComponentArgsRest(__VLS_63));
|
|
344
|
+
const { default: __VLS_67 } = __VLS_nonNull(__VLS_65.slots);
|
|
345
|
+
const __VLS_68 = (__VLS_unwrap(sourceIcon, {}));
|
|
346
|
+
// @ts-ignore
|
|
347
|
+
const __VLS_69 = __VLS_asFunctionalComponent1(__VLS_68, new __VLS_68({
|
|
348
|
+
// @ts-ignore
|
|
349
|
+
}));
|
|
350
|
+
const __VLS_70 = __VLS_69({}, ...__VLS_functionalComponentArgsRest(__VLS_69));
|
|
351
|
+
// @ts-ignore
|
|
352
|
+
[card, t, data, data, loading, sourceName, sourceIcon,];
|
|
353
|
+
var __VLS_65;
|
|
354
|
+
(__VLS_ctx.sourceName);
|
|
355
|
+
}
|
|
356
|
+
if (__VLS_ctx.$slots.footer) {
|
|
357
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.footer, __VLS_intrinsics.footer)({
|
|
358
|
+
...{ class: "bi-data-card__footer" },
|
|
359
|
+
});
|
|
360
|
+
/** @type {__VLS_StyleScopedClasses['bi-data-card__footer']} */ ;
|
|
361
|
+
var __VLS_73 = {};
|
|
362
|
+
}
|
|
363
|
+
var __VLS_43 = __VLS_42, __VLS_74 = __VLS_73;
|
|
364
|
+
// @ts-ignore
|
|
365
|
+
[sourceName, $slots,];
|
|
366
|
+
const __VLS_base = (await import('vue')).defineComponent({
|
|
367
|
+
__typeEmits: {},
|
|
368
|
+
__typeProps: {},
|
|
369
|
+
props: {},
|
|
370
|
+
});
|
|
371
|
+
const __VLS_export = {};
|
|
372
|
+
export default {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BiCard } from "../rpc/bi/admin/v1/bi_card";
|
|
2
|
+
import type { DashboardLayout } from "../bi-dashboard-schema";
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
modelValue: DashboardLayout;
|
|
5
|
+
cards: BiCard[];
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: DashboardLayout) => any;
|
|
9
|
+
"edit-card": (value: BiCard) => any;
|
|
10
|
+
"create-card": () => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onUpdate:modelValue"?: ((value: DashboardLayout) => any) | undefined;
|
|
13
|
+
"onEdit-card"?: ((value: BiCard) => any) | undefined;
|
|
14
|
+
"onCreate-card"?: (() => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|