feat: Implement independent mode for widgets (#221)

This commit is contained in:
Fine0830
2023-02-06 13:38:19 +08:00
committed by GitHub
parent ca38366a60
commit 224053c0f4
16 changed files with 403 additions and 16 deletions

View File

@@ -40,6 +40,7 @@ interface DashboardState {
currentDashboard: Nullable<DashboardItem>;
editMode: boolean;
currentTabIndex: number;
showLinkConfig: boolean;
}
export const dashboardStore = defineStore({
@@ -58,6 +59,7 @@ export const dashboardStore = defineStore({
currentDashboard: null,
editMode: false,
currentTabIndex: 0,
showLinkConfig: false,
}),
actions: {
setLayout(data: LayoutConfig[]) {
@@ -66,6 +68,9 @@ export const dashboardStore = defineStore({
setMode(mode: boolean) {
this.editMode = mode;
},
setWidgetLink(show: boolean) {
this.showLinkConfig = show;
},
resetDashboards(list: DashboardItem[]) {
this.dashboards = list;
sessionStorage.setItem("dashboards", JSON.stringify(list));

View File

@@ -211,12 +211,12 @@ export const selectorStore = defineStore({
return res.data;
},
async getProcess(instanceId: string, isRelation?: boolean) {
if (!instanceId) {
async getProcess(processId: string, isRelation?: boolean) {
if (!processId) {
return;
}
const res: AxiosResponse = await graphql.query("queryProcess").params({
instanceId,
processId,
});
if (!res.data.errors) {
if (isRelation) {