This commit is contained in:
yangsy
2025-08-14 03:22:59 +08:00
parent eab84c1e83
commit a7f9e1c272
13 changed files with 69 additions and 82 deletions

View File

@@ -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;
} }

View File

@@ -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[];
} }

View File

@@ -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

View File

@@ -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');

View File

@@ -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 };
}) });

View File

@@ -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 };
}) });

View File

@@ -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,