@liujitcn/kratos-admin-bi 0.0.0-stage → 0.1.6
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,325 @@
|
|
|
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, reactive, ref } from "vue";
|
|
4
|
+
import { useRouter } from "vue-router";
|
|
5
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
6
|
+
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
7
|
+
import { useAuthStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
8
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
9
|
+
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
10
|
+
import { defBiCardService } from "../../api/bi/admin/v1/bi_card";
|
|
11
|
+
import { defBiDashboardService } from "../../api/bi/admin/v1/bi_dashboard";
|
|
12
|
+
import BiDashboardMenuDialog from "../../components/BiDashboardMenuDialog.vue";
|
|
13
|
+
import { parseDashboardLayout } from "../../bi-dashboard-schema";
|
|
14
|
+
const { defineOptions, } = {};
|
|
15
|
+
defineOptions({ name: "BiDashboardManage", inheritAttrs: false });
|
|
16
|
+
const router = useRouter(), authStore = useAuthStore(), table = ref(), dialog = ref(), creating = ref(false), form = reactive({ name: "", code: "", description: "" });
|
|
17
|
+
const editing = ref();
|
|
18
|
+
const menuOpen = ref(false), menuDashboard = ref();
|
|
19
|
+
const savingFavorite = ref(false);
|
|
20
|
+
const menuPath = computed(() => authStore.flatMenuListGet.find(item => item.component === "system/base/menu/index")?.path);
|
|
21
|
+
const fields = computed(() => [
|
|
22
|
+
{ prop: "name", label: t("bi.query.save_name"), component: "input", props: { maxlength: 128 } },
|
|
23
|
+
{ prop: "code", label: t("bi.dashboard.code"), component: "input", props: { maxlength: 128, disabled: Boolean(editing.value) } },
|
|
24
|
+
{ prop: "description", label: t("bi.dashboard.description"), component: "input", props: { type: "textarea", maxlength: 500 } }
|
|
25
|
+
]);
|
|
26
|
+
const rules = {
|
|
27
|
+
name: [{ required: true, message: t("bi.card.validation.name"), trigger: "blur" }],
|
|
28
|
+
code: [{ required: true, message: t("bi.dashboard.code_required"), trigger: "blur" }]
|
|
29
|
+
};
|
|
30
|
+
const headerActions = computed(() => [
|
|
31
|
+
{
|
|
32
|
+
label: t("bi.dashboard.create"),
|
|
33
|
+
type: "primary",
|
|
34
|
+
icon: CirclePlus,
|
|
35
|
+
onClick: () => {
|
|
36
|
+
reset();
|
|
37
|
+
form.code = `bi_${Date.now().toString(36)}`;
|
|
38
|
+
creating.value = true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]);
|
|
42
|
+
const columns = computed(() => [
|
|
43
|
+
{ prop: "name", label: t("bi.query.save_name"), minWidth: 180, search: { el: "input" } },
|
|
44
|
+
{ prop: "code", label: t("bi.dashboard.code"), minWidth: 150 },
|
|
45
|
+
{
|
|
46
|
+
prop: "favorite",
|
|
47
|
+
label: t("bi.dashboard.favorite"),
|
|
48
|
+
width: 100,
|
|
49
|
+
cellType: "status",
|
|
50
|
+
statusProps: {
|
|
51
|
+
activeValue: true,
|
|
52
|
+
inactiveValue: false,
|
|
53
|
+
activeText: t("bi.dashboard.favorited"),
|
|
54
|
+
inactiveText: t("bi.dashboard.not_favorited"),
|
|
55
|
+
disabled: scope => savingFavorite.value || !scope.row.published_version,
|
|
56
|
+
beforeChange: scope => setFavorite(scope.row, !scope.row.favorite)
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
prop: "status",
|
|
61
|
+
label: t("common.field.status"),
|
|
62
|
+
width: 100,
|
|
63
|
+
cellType: "status",
|
|
64
|
+
statusProps: {
|
|
65
|
+
activeValue: 2,
|
|
66
|
+
inactiveValue: 1,
|
|
67
|
+
activeText: t("bi.dashboard.status_published"),
|
|
68
|
+
inactiveText: t("bi.dashboard.status_draft"),
|
|
69
|
+
disabled: true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{ prop: "draft_version", label: t("bi.dashboard.version"), width: 90 },
|
|
73
|
+
{ prop: "published_version", label: t("bi.dashboard.published_version"), width: 110 },
|
|
74
|
+
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 175 },
|
|
75
|
+
{
|
|
76
|
+
prop: "operation",
|
|
77
|
+
label: t("common.field.operation"),
|
|
78
|
+
cellType: "actions",
|
|
79
|
+
fixed: "right",
|
|
80
|
+
actions: [
|
|
81
|
+
{
|
|
82
|
+
label: t("bi.dashboard.preview"),
|
|
83
|
+
icon: View,
|
|
84
|
+
link: true,
|
|
85
|
+
type: "primary",
|
|
86
|
+
disabled: scope => !scope.row.published_version,
|
|
87
|
+
onClick: scope => {
|
|
88
|
+
void router.push(`/bi/dashboard/${scope.row.id}`);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: t("bi.dashboard.edit"),
|
|
93
|
+
icon: Grid,
|
|
94
|
+
link: true,
|
|
95
|
+
hidden: scope => !scope.row.can_edit,
|
|
96
|
+
onClick: scope => {
|
|
97
|
+
void router.push({ path: "/bi/designer", query: { id: String(scope.row.id) } });
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: t("common.action.edit"),
|
|
102
|
+
icon: EditPen,
|
|
103
|
+
link: true,
|
|
104
|
+
hidden: scope => !scope.row.can_edit,
|
|
105
|
+
onClick: scope => edit(scope.row)
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
label: t("bi.dashboard.publish"),
|
|
109
|
+
icon: Promotion,
|
|
110
|
+
link: true,
|
|
111
|
+
hidden: scope => !scope.row.can_edit,
|
|
112
|
+
disabled: scope => scope.row.draft_version === scope.row.published_version,
|
|
113
|
+
onClick: scope => publish(scope.row)
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: t("bi.dashboard.configure_menu"),
|
|
117
|
+
icon: Setting,
|
|
118
|
+
link: true,
|
|
119
|
+
hidden: scope => !menuPath.value || !scope.row.can_edit,
|
|
120
|
+
disabled: scope => !scope.row.published_version,
|
|
121
|
+
onClick: scope => configureMenu(scope.row)
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
label: t("common.action.delete"),
|
|
125
|
+
icon: Delete,
|
|
126
|
+
link: true,
|
|
127
|
+
type: "danger",
|
|
128
|
+
hidden: scope => !scope.row.can_edit,
|
|
129
|
+
onClick: scope => remove(scope.row)
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
]);
|
|
134
|
+
/** 分页请求统一转换表格条件,并同步工作台的仪表盘收藏状态。 */
|
|
135
|
+
async function requestDashboardTable(params) {
|
|
136
|
+
const [data, config] = await Promise.all([
|
|
137
|
+
defBiDashboardService.PageBiDashboard(buildPageRequest(params)),
|
|
138
|
+
defBiCardService.GetBiWorkbench({})
|
|
139
|
+
]);
|
|
140
|
+
return {
|
|
141
|
+
data: {
|
|
142
|
+
list: (data.dashboards || []).map(item => ({ ...item, favorite: config.dashboard_ids.includes(item.id) })),
|
|
143
|
+
total: data.total
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/** 保存收藏开关,成功后再切换,保留最新排序和独立卡片收藏。 */
|
|
148
|
+
async function setFavorite(item, favorite) {
|
|
149
|
+
if (savingFavorite.value || !item.published_version)
|
|
150
|
+
return false;
|
|
151
|
+
savingFavorite.value = true;
|
|
152
|
+
try {
|
|
153
|
+
const latest = await defBiCardService.GetBiWorkbench({});
|
|
154
|
+
if (latest.dashboard_ids.includes(item.id) === favorite)
|
|
155
|
+
return true;
|
|
156
|
+
const ids = favorite ? [...latest.dashboard_ids, item.id] : latest.dashboard_ids.filter(id => id !== item.id);
|
|
157
|
+
await defBiCardService.SaveBiWorkbench({ dashboard_ids: ids, favorite_ids: latest.favorite_ids });
|
|
158
|
+
ElMessage.success(t("bi.workbench.saved"));
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
catch (cause) {
|
|
162
|
+
ElMessage.error(cause instanceof Error ? cause.message : t("bi.query.error"));
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
savingFavorite.value = false;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/** 在管理列表编辑名称与说明,设计器只处理卡片布局。 */
|
|
170
|
+
function edit(item) {
|
|
171
|
+
reset();
|
|
172
|
+
editing.value = item;
|
|
173
|
+
Object.assign(form, { name: item.name, code: item.code, description: item.description });
|
|
174
|
+
creating.value = true;
|
|
175
|
+
}
|
|
176
|
+
/** 保存仪表盘信息,新建时再进入卡片组装器。 */
|
|
177
|
+
async function submit() {
|
|
178
|
+
if (!(await dialog.value?.validate()))
|
|
179
|
+
return;
|
|
180
|
+
try {
|
|
181
|
+
if (editing.value) {
|
|
182
|
+
await defBiDashboardService.SaveBiDashboard({
|
|
183
|
+
dashboard: {
|
|
184
|
+
...editing.value,
|
|
185
|
+
name: form.name,
|
|
186
|
+
description: form.description,
|
|
187
|
+
schema_json: JSON.stringify({ ...parseDashboardLayout(editing.value.schema_json), name: form.name })
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
creating.value = false;
|
|
191
|
+
table.value?.getTableList();
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
const item = await defBiDashboardService.SaveBiDashboard({
|
|
195
|
+
dashboard: {
|
|
196
|
+
id: 0,
|
|
197
|
+
tenant_id: 0,
|
|
198
|
+
project_id: 0,
|
|
199
|
+
owner_id: 0,
|
|
200
|
+
code: form.code,
|
|
201
|
+
name: form.name,
|
|
202
|
+
description: form.description,
|
|
203
|
+
status: 1,
|
|
204
|
+
draft_version: 0,
|
|
205
|
+
published_version: 0,
|
|
206
|
+
schema_json: JSON.stringify({ schemaVersion: 3, name: form.name, cards: [] }),
|
|
207
|
+
updated_at: "",
|
|
208
|
+
can_edit: true
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
creating.value = false;
|
|
212
|
+
table.value?.getTableList();
|
|
213
|
+
void router.push({ path: "/bi/designer", query: { id: String(item.id) } });
|
|
214
|
+
}
|
|
215
|
+
catch (cause) {
|
|
216
|
+
ElMessage.error(cause instanceof Error ? cause.message : t("bi.query.error"));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/** 发布现有草稿,服务端负责快照和版本冲突校验。 */
|
|
220
|
+
async function publish(item) {
|
|
221
|
+
try {
|
|
222
|
+
await defBiDashboardService.PublishBiDashboard({ id: item.id, version: item.draft_version });
|
|
223
|
+
ElMessage.success(t("bi.dashboard.publish_success"));
|
|
224
|
+
table.value?.getTableList();
|
|
225
|
+
}
|
|
226
|
+
catch (cause) {
|
|
227
|
+
ElMessage.error(cause instanceof Error ? cause.message : t("bi.query.error"));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/** 在当前页面配置仪表盘菜单,不跳转或改动通用菜单管理表单。 */
|
|
231
|
+
function configureMenu(item) {
|
|
232
|
+
menuDashboard.value = item;
|
|
233
|
+
menuOpen.value = true;
|
|
234
|
+
}
|
|
235
|
+
/** 删除前按名称确认,失败时保留表格内容。 */
|
|
236
|
+
async function remove(item) {
|
|
237
|
+
try {
|
|
238
|
+
await ElMessageBox.confirm(`${t("bi.query.save_name")}:${item.name}`, t("common.action.delete"), { type: "warning" });
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
await defBiDashboardService.DeleteBiDashboard({ id: item.id });
|
|
245
|
+
table.value?.getTableList();
|
|
246
|
+
}
|
|
247
|
+
catch (cause) {
|
|
248
|
+
ElMessage.error(cause instanceof Error ? cause.message : t("bi.query.error"));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
/** 关闭时清空表单与校验。 */
|
|
252
|
+
function reset() {
|
|
253
|
+
editing.value = undefined;
|
|
254
|
+
Object.assign(form, { name: "", code: "", description: "" });
|
|
255
|
+
dialog.value?.clearValidate();
|
|
256
|
+
}
|
|
257
|
+
const __VLS_ctx = {};
|
|
258
|
+
let __VLS_components;
|
|
259
|
+
let __VLS_intrinsics;
|
|
260
|
+
let __VLS_directives;
|
|
261
|
+
void __VLS_ctx, __VLS_components, __VLS_intrinsics, __VLS_directives;
|
|
262
|
+
// @ts-ignore
|
|
263
|
+
__VLS_withDotValue(editing, {});
|
|
264
|
+
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
|
265
|
+
...{ class: "table-box" },
|
|
266
|
+
});
|
|
267
|
+
/** @type {__VLS_StyleScopedClasses['table-box']} */ ;
|
|
268
|
+
let __VLS_0;
|
|
269
|
+
/** @ts-ignore @type { | typeof __VLS_components.ProTable} */
|
|
270
|
+
ProTable;
|
|
271
|
+
// @ts-ignore
|
|
272
|
+
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({
|
|
273
|
+
// @ts-ignore
|
|
274
|
+
ref: "table", rowKey: "id", columns: (__VLS_unwrap(columns, {})), headerActions: (__VLS_unwrap(headerActions, {})), requestApi: (requestDashboardTable),
|
|
275
|
+
}));
|
|
276
|
+
const __VLS_2 = __VLS_1({
|
|
277
|
+
ref: "table",
|
|
278
|
+
rowKey: "id",
|
|
279
|
+
columns: (__VLS_unwrap(columns, {})),
|
|
280
|
+
headerActions: (__VLS_unwrap(headerActions, {})),
|
|
281
|
+
requestApi: (requestDashboardTable),
|
|
282
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
283
|
+
const __VLS_5 = FormDialog;
|
|
284
|
+
// @ts-ignore
|
|
285
|
+
const __VLS_6 = __VLS_asFunctionalComponent1(__VLS_5, new __VLS_5({
|
|
286
|
+
// @ts-ignore
|
|
287
|
+
...{ 'onConfirm': {} }, ...{ 'onClosed': {} }, ref: "dialog", modelValue: (__VLS_unwrap(creating, {})), title: (editing.value ? __VLS_unwrap(t, {})('common.action.edit') : __VLS_unwrap(t, {})('bi.dashboard.create')), model: (__VLS_unwrap(form, {})), fields: (__VLS_unwrap(fields, {})), rules: (__VLS_unwrap(rules, {})),
|
|
288
|
+
}));
|
|
289
|
+
const __VLS_7 = __VLS_6({
|
|
290
|
+
...{ 'onConfirm': {} },
|
|
291
|
+
...{ 'onClosed': {} },
|
|
292
|
+
ref: "dialog",
|
|
293
|
+
modelValue: (__VLS_unwrap(creating, {})),
|
|
294
|
+
title: (editing.value ? __VLS_unwrap(t, {})('common.action.edit') : __VLS_unwrap(t, {})('bi.dashboard.create')),
|
|
295
|
+
model: (__VLS_unwrap(form, {})),
|
|
296
|
+
fields: (__VLS_unwrap(fields, {})),
|
|
297
|
+
rules: (__VLS_unwrap(rules, {})),
|
|
298
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_6));
|
|
299
|
+
let __VLS_10;
|
|
300
|
+
const __VLS_11 = {
|
|
301
|
+
/** @type {typeof __VLS_10.confirm} */
|
|
302
|
+
onConfirm: (submit),
|
|
303
|
+
};
|
|
304
|
+
void __VLS_11;
|
|
305
|
+
const __VLS_12 = {
|
|
306
|
+
/** @type {typeof __VLS_10.closed} */
|
|
307
|
+
onClosed: (reset),
|
|
308
|
+
};
|
|
309
|
+
void __VLS_12;
|
|
310
|
+
var __VLS_8;
|
|
311
|
+
var __VLS_9;
|
|
312
|
+
const __VLS_13 = BiDashboardMenuDialog;
|
|
313
|
+
// @ts-ignore
|
|
314
|
+
const __VLS_14 = __VLS_asFunctionalComponent1(__VLS_13, new __VLS_13({
|
|
315
|
+
// @ts-ignore
|
|
316
|
+
modelValue: (__VLS_unwrap(menuOpen, {})), dashboard: (__VLS_unwrap(menuDashboard, {})),
|
|
317
|
+
}));
|
|
318
|
+
const __VLS_15 = __VLS_14({
|
|
319
|
+
modelValue: (__VLS_unwrap(menuOpen, {})),
|
|
320
|
+
dashboard: (__VLS_unwrap(menuDashboard, {})),
|
|
321
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_14));
|
|
322
|
+
// @ts-ignore
|
|
323
|
+
[columns, headerActions, creating, editing, t, t, form, fields, rules, menuOpen, menuDashboard,];
|
|
324
|
+
const __VLS_export = (await import('vue')).defineComponent({});
|
|
325
|
+
export default {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|