diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 67a35fb..ada720c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -77,6 +77,15 @@ }) } +// 获取所有单位列表 +export function getAllDeptList(params?: { deptType?: string; pid?: string }) { + return request1({ + url: '/system/tree', + method: 'get', + params, + }) +} + // 资源类型列表 export function getDeptTypeList() { return request1({ diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 67a35fb..ada720c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -77,6 +77,15 @@ }) } +// 获取所有单位列表 +export function getAllDeptList(params?: { deptType?: string; pid?: string }) { + return request1({ + url: '/system/tree', + method: 'get', + params, + }) +} + // 资源类型列表 export function getDeptTypeList() { return request1({ diff --git a/src/views/laboratory/alarm/event/addEventDialog.vue b/src/views/laboratory/alarm/event/addEventDialog.vue index 5ab2ef0..d8c6edb 100644 --- a/src/views/laboratory/alarm/event/addEventDialog.vue +++ b/src/views/laboratory/alarm/event/addEventDialog.vue @@ -198,11 +198,11 @@ diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 67a35fb..ada720c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -77,6 +77,15 @@ }) } +// 获取所有单位列表 +export function getAllDeptList(params?: { deptType?: string; pid?: string }) { + return request1({ + url: '/system/tree', + method: 'get', + params, + }) +} + // 资源类型列表 export function getDeptTypeList() { return request1({ diff --git a/src/views/laboratory/alarm/event/addEventDialog.vue b/src/views/laboratory/alarm/event/addEventDialog.vue index 5ab2ef0..d8c6edb 100644 --- a/src/views/laboratory/alarm/event/addEventDialog.vue +++ b/src/views/laboratory/alarm/event/addEventDialog.vue @@ -198,11 +198,11 @@ diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 31818ec..b0b1b40 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -19,7 +19,10 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import { toTreeList } from '@/utils/structure' import useUserStore from '@/store/modules/user' +import { getAllDeptList } from '@/api/system/dept' + const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) @@ -184,6 +187,9 @@ getUserList({ offset: 1, limit: 999999 }).then((res: any) => { userList.value = res.data.rows }) + getAllDeptList().then((res) => { + useDeptList.value = toTreeList(res.data.map((item: any) => ({ ...item, label: item.name, value: item.id }))) as any + }) } getDict() // -----------------------------------------切换tab-------------------------------------------------------------- @@ -194,7 +200,8 @@ console.log('当前选中的菜单', val, '当前选中菜单的索引', currentIndex.value) window.sessionStorage.setItem(buttonBoxActive, val) checkoutList.value = [] - clearList() + // clearList() + fetchData() if (normalTableRef.value) { normalTableRef.value!.clearMulti() // 清除多选选中 } @@ -329,8 +336,9 @@ listQuery.value.uploadEndTime = '' } }) - +const $route = useRoute() onMounted(async () => { + listQuery.value.deviceNo = $route.query.deviceNo ? $route.query.deviceNo as string : '' fetchData(false) }) @@ -346,7 +354,7 @@ --> - --> + diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 67a35fb..ada720c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -77,6 +77,15 @@ }) } +// 获取所有单位列表 +export function getAllDeptList(params?: { deptType?: string; pid?: string }) { + return request1({ + url: '/system/tree', + method: 'get', + params, + }) +} + // 资源类型列表 export function getDeptTypeList() { return request1({ diff --git a/src/views/laboratory/alarm/event/addEventDialog.vue b/src/views/laboratory/alarm/event/addEventDialog.vue index 5ab2ef0..d8c6edb 100644 --- a/src/views/laboratory/alarm/event/addEventDialog.vue +++ b/src/views/laboratory/alarm/event/addEventDialog.vue @@ -198,11 +198,11 @@ diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 31818ec..b0b1b40 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -19,7 +19,10 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import { toTreeList } from '@/utils/structure' import useUserStore from '@/store/modules/user' +import { getAllDeptList } from '@/api/system/dept' + const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) @@ -184,6 +187,9 @@ getUserList({ offset: 1, limit: 999999 }).then((res: any) => { userList.value = res.data.rows }) + getAllDeptList().then((res) => { + useDeptList.value = toTreeList(res.data.map((item: any) => ({ ...item, label: item.name, value: item.id }))) as any + }) } getDict() // -----------------------------------------切换tab-------------------------------------------------------------- @@ -194,7 +200,8 @@ console.log('当前选中的菜单', val, '当前选中菜单的索引', currentIndex.value) window.sessionStorage.setItem(buttonBoxActive, val) checkoutList.value = [] - clearList() + // clearList() + fetchData() if (normalTableRef.value) { normalTableRef.value!.clearMulti() // 清除多选选中 } @@ -329,8 +336,9 @@ listQuery.value.uploadEndTime = '' } }) - +const $route = useRoute() onMounted(async () => { + listQuery.value.deviceNo = $route.query.deviceNo ? $route.query.deviceNo as string : '' fetchData(false) }) @@ -346,7 +354,7 @@ --> - --> + diff --git a/src/views/laboratory/equipment/list/detail.vue b/src/views/laboratory/equipment/list/detail.vue index c2baf39..faef6e5 100644 --- a/src/views/laboratory/equipment/list/detail.vue +++ b/src/views/laboratory/equipment/list/detail.vue @@ -8,7 +8,7 @@ import { getUserList } from '@/api/system/user' import useUserStore from '@/store/modules/user' import { getDictByCode } from '@/api/system/dict' -import { getDeptTreeList } from '@/api/system/dept' +import { getAllDeptList, getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import type { deptType, dictType } from '@/global' import { addDeviceList, updateDeviceList } from '@/api/laboratory/equipment/list' @@ -71,6 +71,9 @@ // 转成树结构 useDeptList.value = toTreeList(res.data, '0', true) }) + // getAllDeptList().then((res) => { + // useDeptList.value = toTreeList(res.data.map((item: any) => ({ ...item, label: item.name, value: item.id }))) as any + // }) } // ----------------------------------路由参数-------------------------------------------- if ($route.params && $route.params.type) { @@ -148,7 +151,6 @@ } // -------------------------------------------获取详情信息-------------------------------------------------- - onMounted(async () => { getDict().then(() => { if (pageType.value !== 'add') { @@ -230,6 +232,16 @@ + diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 67a35fb..ada720c 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -77,6 +77,15 @@ }) } +// 获取所有单位列表 +export function getAllDeptList(params?: { deptType?: string; pid?: string }) { + return request1({ + url: '/system/tree', + method: 'get', + params, + }) +} + // 资源类型列表 export function getDeptTypeList() { return request1({ diff --git a/src/views/laboratory/alarm/event/addEventDialog.vue b/src/views/laboratory/alarm/event/addEventDialog.vue index 5ab2ef0..d8c6edb 100644 --- a/src/views/laboratory/alarm/event/addEventDialog.vue +++ b/src/views/laboratory/alarm/event/addEventDialog.vue @@ -198,11 +198,11 @@ diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 31818ec..b0b1b40 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -19,7 +19,10 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import { toTreeList } from '@/utils/structure' import useUserStore from '@/store/modules/user' +import { getAllDeptList } from '@/api/system/dept' + const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) @@ -184,6 +187,9 @@ getUserList({ offset: 1, limit: 999999 }).then((res: any) => { userList.value = res.data.rows }) + getAllDeptList().then((res) => { + useDeptList.value = toTreeList(res.data.map((item: any) => ({ ...item, label: item.name, value: item.id }))) as any + }) } getDict() // -----------------------------------------切换tab-------------------------------------------------------------- @@ -194,7 +200,8 @@ console.log('当前选中的菜单', val, '当前选中菜单的索引', currentIndex.value) window.sessionStorage.setItem(buttonBoxActive, val) checkoutList.value = [] - clearList() + // clearList() + fetchData() if (normalTableRef.value) { normalTableRef.value!.clearMulti() // 清除多选选中 } @@ -329,8 +336,9 @@ listQuery.value.uploadEndTime = '' } }) - +const $route = useRoute() onMounted(async () => { + listQuery.value.deviceNo = $route.query.deviceNo ? $route.query.deviceNo as string : '' fetchData(false) }) @@ -346,7 +354,7 @@ --> - --> + diff --git a/src/views/laboratory/equipment/list/detail.vue b/src/views/laboratory/equipment/list/detail.vue index c2baf39..faef6e5 100644 --- a/src/views/laboratory/equipment/list/detail.vue +++ b/src/views/laboratory/equipment/list/detail.vue @@ -8,7 +8,7 @@ import { getUserList } from '@/api/system/user' import useUserStore from '@/store/modules/user' import { getDictByCode } from '@/api/system/dict' -import { getDeptTreeList } from '@/api/system/dept' +import { getAllDeptList, getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import type { deptType, dictType } from '@/global' import { addDeviceList, updateDeviceList } from '@/api/laboratory/equipment/list' @@ -71,6 +71,9 @@ // 转成树结构 useDeptList.value = toTreeList(res.data, '0', true) }) + // getAllDeptList().then((res) => { + // useDeptList.value = toTreeList(res.data.map((item: any) => ({ ...item, label: item.name, value: item.id }))) as any + // }) } // ----------------------------------路由参数-------------------------------------------- if ($route.params && $route.params.type) { @@ -148,7 +151,6 @@ } // -------------------------------------------获取详情信息-------------------------------------------------- - onMounted(async () => { getDict().then(() => { if (pageType.value !== 'add') { @@ -230,6 +232,16 @@ + diff --git a/src/views/laboratory/equipment/list/list.vue b/src/views/laboratory/equipment/list/list.vue index 5f067db..51fbbce 100644 --- a/src/views/laboratory/equipment/list/list.vue +++ b/src/views/laboratory/equipment/list/list.vue @@ -9,8 +9,10 @@ import { getDictByCode } from '@/api/system/dict' import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' +import { getAllDeptList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { usePrintList } from '@/utils/usePrintList' +import { toTreeList } from '@/utils/structure' import useTemplateDownload from '@/utils/useTemplateDownload' import { batchImport, deleteDevice, exportDeviceList, getDeviceList } from '@/api/laboratory/equipment/list' import useUserStore from '@/store/modules/user' @@ -82,6 +84,9 @@ value: null, }) }) + getAllDeptList().then((res) => { + useDeptList.value = toTreeList(res.data.map((item: any) => ({ ...item, label: item.name, value: item.id }))) as any + }) } getDict() // ------------------------------------------------------------------------------------------------------ @@ -175,6 +180,9 @@ case 'historyData': // 历史数据 $router.push({ path: '/labData', + query: { + deviceNo: row.deviceNo, + }, }) break default: @@ -288,7 +296,7 @@ - --> +