From 2b49a591749dcac8a3a090fa31809a3dbacea5fd Mon Sep 17 00:00:00 2001 From: liuzhu Date: Fri, 27 Feb 2026 11:38:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/app/equipmentName.ts | 23 ----------------------- src/hooks/app/index.ts | 5 ----- src/hooks/app/peopleName.ts | 22 ---------------------- src/hooks/app/point.ts | 22 ---------------------- src/hooks/app/productName.ts | 22 ---------------------- src/hooks/app/ruleName.ts | 22 ---------------------- src/hooks/app/space.ts | 22 ---------------------- src/hooks/app/useBranch.ts | 22 ---------------------- src/router/route.ts | 2 +- 9 files changed, 1 insertion(+), 161 deletions(-) delete mode 100644 src/hooks/app/equipmentName.ts delete mode 100644 src/hooks/app/peopleName.ts delete mode 100644 src/hooks/app/point.ts delete mode 100644 src/hooks/app/productName.ts delete mode 100644 src/hooks/app/ruleName.ts delete mode 100644 src/hooks/app/space.ts delete mode 100644 src/hooks/app/useBranch.ts diff --git a/src/hooks/app/equipmentName.ts b/src/hooks/app/equipmentName.ts deleted file mode 100644 index f44cbdb..0000000 --- a/src/hooks/app/equipmentName.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ref } from 'vue' -import type { EquipmentQuery } from '@/apis/equipment/equipment' -import { getEquipmentNameList } from '@/apis/equipment/equipment' -import type { LabelValueState } from '@/types/global' - -/** 设备名称列表 */ -export function equipmentName(query: EquipmentQuery, options?: { onSuccess?: () => void }) { - const loading = ref(false) - const equipmentNameList = ref([]) - - const getEquipmentName = async () => { - try { - loading.value = true - const res = await getEquipmentNameList(query) - equipmentNameList.value = res.data - // eslint-disable-next-line ts/no-unused-expressions - options?.onSuccess && options.onSuccess() - } finally { - loading.value = false - } - } - return { equipmentNameList, getEquipmentName, loading } -} diff --git a/src/hooks/app/index.ts b/src/hooks/app/index.ts index de5c814..a007542 100644 --- a/src/hooks/app/index.ts +++ b/src/hooks/app/index.ts @@ -1,9 +1,4 @@ export * from './useMenu' export * from './useDept' -export * from './useBranch' export * from './useRole' export * from './useDict' -export * from './space' -export * from './point' -export * from './equipmentName' -export * from './productName' diff --git a/src/hooks/app/peopleName.ts b/src/hooks/app/peopleName.ts deleted file mode 100644 index ec31c4a..0000000 --- a/src/hooks/app/peopleName.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ref } from 'vue' -import type { LabelValueState } from '@/types/global' -import { type PeopleQuery, getPeopleNameList } from '@/apis/sysPeople/people' - -/** 设备名称列表 */ -export function peopleName(query: PeopleQuery, options?: { onSuccess?: () => void }) { - const loading = ref(false) - const peopleNameList = ref([]) - - const getPeopleName = async () => { - try { - loading.value = true - const res = await getPeopleNameList(query) - peopleNameList.value = res.data - // eslint-disable-next-line ts/no-unused-expressions - options?.onSuccess && options.onSuccess() - } finally { - loading.value = false - } - } - return { peopleNameList, getPeopleName, loading } -} diff --git a/src/hooks/app/point.ts b/src/hooks/app/point.ts deleted file mode 100644 index 915bfc8..0000000 --- a/src/hooks/app/point.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ref } from 'vue' -import type { TreeNodeData } from '@arco-design/web-vue' -import { listPointTree } from '@/apis' - -/** 部门模块 */ -export function point(options?: { onSuccess?: () => void }) { - const loading = ref(false) - const pointList = ref([]) - - const getPointList = async (name?: string) => { - try { - loading.value = true - const res = await listPointTree({ description: name }) - pointList.value = res.data - // eslint-disable-next-line ts/no-unused-expressions - options?.onSuccess && options.onSuccess() - } finally { - loading.value = false - } - } - return { pointList, getPointList, loading } -} diff --git a/src/hooks/app/productName.ts b/src/hooks/app/productName.ts deleted file mode 100644 index 6acbd42..0000000 --- a/src/hooks/app/productName.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ref } from 'vue' -import { getProductNameList } from '@/apis/equipment/product' -import type { LabelValueState } from '@/types/global' - -/** 设备名称列表 */ -export function productName(options?: { onSuccess?: () => void }) { - const loading = ref(false) - const productNameList = ref([]) - - const getProductName = async () => { - try { - loading.value = true - const res = await getProductNameList() - productNameList.value = res.data - // eslint-disable-next-line ts/no-unused-expressions - options?.onSuccess && options.onSuccess() - } finally { - loading.value = false - } - } - return { productNameList, getProductName, loading } -} diff --git a/src/hooks/app/ruleName.ts b/src/hooks/app/ruleName.ts deleted file mode 100644 index 0c31521..0000000 --- a/src/hooks/app/ruleName.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ref } from 'vue' -import type { LabelValueState } from '@/types/global' -import { getRuleNameList } from '@/apis/rule/rule' - -/** 设备名称列表 */ -export function ruleName(options?: { onSuccess?: () => void }) { - const loading = ref(false) - const ruleNameList = ref([]) - - const getRuleName = async () => { - try { - loading.value = true - const res = await getRuleNameList() - ruleNameList.value = res.data - // eslint-disable-next-line ts/no-unused-expressions - options?.onSuccess && options.onSuccess() - } finally { - loading.value = false - } - } - return { ruleNameList, getRuleName, loading } -} diff --git a/src/hooks/app/space.ts b/src/hooks/app/space.ts deleted file mode 100644 index 5780608..0000000 --- a/src/hooks/app/space.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ref } from 'vue' -import type { TreeNodeData } from '@arco-design/web-vue' -import { listSpaceTree } from '@/apis' - -/** 部门模块 */ -export function space(options?: { onSuccess?: () => void }) { - const loading = ref(false) - const spaceList = ref([]) - - const getSpaceList = async (name?: string) => { - try { - loading.value = true - const res = await listSpaceTree({ description: name }) - spaceList.value = res.data - // eslint-disable-next-line ts/no-unused-expressions - options?.onSuccess && options.onSuccess() - } finally { - loading.value = false - } - } - return { spaceList, getSpaceList, loading } -} diff --git a/src/hooks/app/useBranch.ts b/src/hooks/app/useBranch.ts deleted file mode 100644 index 56d969c..0000000 --- a/src/hooks/app/useBranch.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ref } from 'vue' -import type { TreeNodeData } from '@arco-design/web-vue' -import { listBranchTree } from '@/apis' - -/** 部门模块 */ -export function useBranch(options?: { onSuccess?: () => void }) { - const loading = ref(false) - const branchList = ref([]) - - const getBranchList = async (name?: string) => { - try { - loading.value = true - const res = await listBranchTree({ description: name }) - branchList.value = res.data - // eslint-disable-next-line ts/no-unused-expressions - options?.onSuccess && options.onSuccess() - } finally { - loading.value = false - } - } - return { branchList, getBranchList, loading } -} diff --git a/src/router/route.ts b/src/router/route.ts index 9dfb0cd..f5dbe4a 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -28,7 +28,7 @@ export const systemRoutes: RouteRecordRaw[] = [ path: '/dashboard/analysis', name: 'Analysis', component: () => import('@/views/dashboard/analysis/index.vue'), - meta: { title: '分析页', icon: 'insert-chart', hidden: false, affix: true }, + meta: { title: '首页', icon: 'insert-chart', hidden: false, affix: true }, }, ], },