format
This commit is contained in:
@@ -2,4 +2,4 @@ export interface NdmCameraDiagInfo {
|
|||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
logTime: string;
|
logTime: string;
|
||||||
info: string;
|
info: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ export interface NdmDecoderDiagInfo {
|
|||||||
内存使用率: string;
|
内存使用率: string;
|
||||||
CPU使用率: string;
|
CPU使用率: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ export interface NdmNvrDiagInfo {
|
|||||||
内存使用率: string;
|
内存使用率: string;
|
||||||
CPU使用率: string;
|
CPU使用率: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,4 +18,4 @@ export interface NdmSecurityBoxDiagInfo {
|
|||||||
内存使用率: string;
|
内存使用率: string;
|
||||||
CPU使用率: string;
|
CPU使用率: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ export interface NdmServerDiagInfo {
|
|||||||
磁盘使用率: string;
|
磁盘使用率: string;
|
||||||
系统运行时间: string;
|
系统运行时间: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
export interface SuperModel {
|
export interface SuperModel {
|
||||||
id: string
|
id: string;
|
||||||
createdBy: string
|
createdBy: string;
|
||||||
createdTime: string
|
createdTime: string;
|
||||||
echoMap?: any
|
echoMap?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BaseModel extends SuperModel {
|
export interface BaseModel extends SuperModel {
|
||||||
updatedBy: string
|
updatedBy: string;
|
||||||
updatedTime: string
|
updatedTime: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TreeModel extends BaseModel {
|
export interface TreeModel extends BaseModel {
|
||||||
parentId: string
|
parentId: string;
|
||||||
sortValue: number
|
sortValue: number;
|
||||||
treeGrade: number
|
treeGrade: number;
|
||||||
treePath: string
|
treePath: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
export interface BasicPageParams {
|
export interface BasicPageParams {
|
||||||
page: number
|
page: number;
|
||||||
pageSize: number
|
pageSize: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BasicFetchResult<T> {
|
export interface BasicFetchResult<T> {
|
||||||
items: T[]
|
items: T[];
|
||||||
total: number
|
total: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RemoteData {
|
export interface RemoteData {
|
||||||
key: string | number
|
key: string | number;
|
||||||
data?: any
|
data?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PageParams<T> {
|
export interface PageParams<T> {
|
||||||
model: T
|
model: T;
|
||||||
size: number
|
size: number;
|
||||||
current: number
|
current: number;
|
||||||
sort?: string
|
sort?: string;
|
||||||
order?: string
|
order?: string;
|
||||||
extra?: any
|
extra?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PageResult<T> {
|
export interface PageResult<T> {
|
||||||
records: T[]
|
records: T[];
|
||||||
// offset: number
|
// offset: number
|
||||||
pages: string
|
pages: string;
|
||||||
current: string
|
current: string;
|
||||||
total: string
|
total: string;
|
||||||
size: string
|
size: string;
|
||||||
orders: any[]
|
orders: any[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
export type ReduceForUpdateVO =
|
export type ReduceForUpdateVO = 'createdTime' | 'createdBy' | 'updatedTime' | 'updatedBy' | 'echoMap';
|
||||||
| 'createdTime'
|
export type ReduceForSaveVO = ReduceForUpdateVO | 'id';
|
||||||
| 'createdBy'
|
export type ReduceForPageQuery = ReduceForUpdateVO;
|
||||||
| 'updatedTime'
|
|
||||||
| 'updatedBy'
|
|
||||||
| 'echoMap'
|
|
||||||
export type ReduceForSaveVO = ReduceForUpdateVO | 'id'
|
|
||||||
export type ReduceForPageQuery = ReduceForUpdateVO
|
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ export * from './ndm-media-server';
|
|||||||
export * from './ndm-nvr';
|
export * from './ndm-nvr';
|
||||||
export * from './ndm-security-box';
|
export * from './ndm-security-box';
|
||||||
export * from './ndm-switch';
|
export * from './ndm-switch';
|
||||||
export * from './ndm-video-server';
|
export * from './ndm-video-server';
|
||||||
|
|||||||
28
src/main.ts
28
src/main.ts
@@ -1,16 +1,16 @@
|
|||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue';
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia';
|
||||||
import persist from 'pinia-plugin-persistedstate'
|
import persist from 'pinia-plugin-persistedstate';
|
||||||
import { VueQueryPlugin, QueryClient } from '@tanstack/vue-query'
|
import { VueQueryPlugin, QueryClient } from '@tanstack/vue-query';
|
||||||
|
|
||||||
import App from './App.vue'
|
import App from './App.vue';
|
||||||
import router from './router'
|
import router from './router';
|
||||||
|
|
||||||
import '@/styles/reset.scss'
|
import '@/styles/reset.scss';
|
||||||
|
|
||||||
import { getAppEnvConfig } from '@/utils/env'
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App);
|
||||||
|
|
||||||
const queryClient = new QueryClient({
|
const queryClient = new QueryClient({
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
@@ -21,10 +21,10 @@ const queryClient = new QueryClient({
|
|||||||
refetchOnWindowFocus: true,
|
refetchOnWindowFocus: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
app.use(createPinia().use(persist))
|
app.use(createPinia().use(persist));
|
||||||
app.use(router)
|
app.use(router);
|
||||||
app.use(VueQueryPlugin, { queryClient })
|
app.use(VueQueryPlugin, { queryClient });
|
||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app');
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import type { Station } from '@/apis/domains'
|
import type { Station } from '@/apis/domains';
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia';
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
export const useStationStore = defineStore('ndmstation', () => {
|
export const useStationStore = defineStore('ndm-station-store', () => {
|
||||||
const stationList = ref<Station[]>([])
|
const stationList = ref<Station[]>([]);
|
||||||
|
|
||||||
const onlineStationList = computed(() => stationList.value.filter((station) => station.online))
|
const onlineStationList = computed(() => stationList.value.filter((station) => station.online));
|
||||||
|
|
||||||
return { stationList, onlineStationList }
|
return { stationList, onlineStationList };
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue';
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia';
|
||||||
import { darkTheme, lightTheme } from 'naive-ui'
|
import { darkTheme, lightTheme } from 'naive-ui';
|
||||||
|
|
||||||
export const useThemeStore = defineStore('ndm-theme', () => {
|
export const useThemeStore = defineStore('ndm-theme-store', () => {
|
||||||
const darkThemeEnabled = ref(false)
|
const darkThemeEnabled = ref(true);
|
||||||
const themeMode = computed(() => {
|
const themeMode = computed(() => {
|
||||||
return darkThemeEnabled.value ? darkTheme : lightTheme
|
return darkThemeEnabled.value ? darkTheme : lightTheme;
|
||||||
})
|
});
|
||||||
|
|
||||||
return { darkThemeEnabled, themeMode }
|
return { darkThemeEnabled, themeMode };
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
export const getAppEnvConfig = () => {
|
export const getAppEnvConfig = () => {
|
||||||
const env = import.meta.env;
|
const env = import.meta.env;
|
||||||
const {
|
const { VITE_REQUEST_INTERVAL, VITE_NDM_APP_KEY, VITE_LAMP_CLIENT_ID, VITE_LAMP_CLIENT_SECRET, VITE_LAMP_USERNAME, VITE_LAMP_PASSWORD, VITE_LAMP_AUTHORIZATION } = env;
|
||||||
VITE_REQUEST_INTERVAL,
|
|
||||||
VITE_NDM_APP_KEY,
|
|
||||||
VITE_LAMP_CLIENT_ID,
|
|
||||||
VITE_LAMP_CLIENT_SECRET,
|
|
||||||
VITE_LAMP_USERNAME,
|
|
||||||
VITE_LAMP_PASSWORD,
|
|
||||||
VITE_LAMP_AUTHORIZATION,
|
|
||||||
} = env;
|
|
||||||
return {
|
return {
|
||||||
requestInterval: Number.parseInt(VITE_REQUEST_INTERVAL as string),
|
requestInterval: Number.parseInt(VITE_REQUEST_INTERVAL as string),
|
||||||
ndmAppKey: VITE_NDM_APP_KEY as string,
|
ndmAppKey: VITE_NDM_APP_KEY as string,
|
||||||
|
|||||||
Reference in New Issue
Block a user