diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 1d24ed1..386b755 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -18,6 +18,8 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -123,6 +125,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -200,6 +203,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -238,6 +242,7 @@ uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 1d24ed1..386b755 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -18,6 +18,8 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -123,6 +125,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -200,6 +203,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -238,6 +242,7 @@ uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/equipment/config/addElectricQuantity.vue b/src/views/laboratory/equipment/config/addElectricQuantity.vue index bec37cb..eb2b039 100644 --- a/src/views/laboratory/equipment/config/addElectricQuantity.vue +++ b/src/views/laboratory/equipment/config/addElectricQuantity.vue @@ -69,6 +69,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -178,15 +179,25 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + console.log() + + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 solveEditFormValue(row) infoId.value = row.id // 主键 diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 1d24ed1..386b755 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -18,6 +18,8 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -123,6 +125,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -200,6 +203,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -238,6 +242,7 @@ uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/equipment/config/addElectricQuantity.vue b/src/views/laboratory/equipment/config/addElectricQuantity.vue index bec37cb..eb2b039 100644 --- a/src/views/laboratory/equipment/config/addElectricQuantity.vue +++ b/src/views/laboratory/equipment/config/addElectricQuantity.vue @@ -69,6 +69,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -178,15 +179,25 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + console.log() + + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 solveEditFormValue(row) infoId.value = row.id // 主键 diff --git a/src/views/laboratory/equipment/config/addOxygenSmoke.vue b/src/views/laboratory/equipment/config/addOxygenSmoke.vue index 77ddd4d..89d0cc4 100644 --- a/src/views/laboratory/equipment/config/addOxygenSmoke.vue +++ b/src/views/laboratory/equipment/config/addOxygenSmoke.vue @@ -38,6 +38,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -76,14 +77,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 1d24ed1..386b755 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -18,6 +18,8 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -123,6 +125,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -200,6 +203,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -238,6 +242,7 @@ uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/equipment/config/addElectricQuantity.vue b/src/views/laboratory/equipment/config/addElectricQuantity.vue index bec37cb..eb2b039 100644 --- a/src/views/laboratory/equipment/config/addElectricQuantity.vue +++ b/src/views/laboratory/equipment/config/addElectricQuantity.vue @@ -69,6 +69,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -178,15 +179,25 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + console.log() + + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 solveEditFormValue(row) infoId.value = row.id // 主键 diff --git a/src/views/laboratory/equipment/config/addOxygenSmoke.vue b/src/views/laboratory/equipment/config/addOxygenSmoke.vue index 77ddd4d..89d0cc4 100644 --- a/src/views/laboratory/equipment/config/addOxygenSmoke.vue +++ b/src/views/laboratory/equipment/config/addOxygenSmoke.vue @@ -38,6 +38,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -76,14 +77,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue index 6093abc..3dc0ff3 100644 --- a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue +++ b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue @@ -66,6 +66,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -108,14 +109,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 1d24ed1..386b755 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -18,6 +18,8 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -123,6 +125,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -200,6 +203,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -238,6 +242,7 @@ uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/equipment/config/addElectricQuantity.vue b/src/views/laboratory/equipment/config/addElectricQuantity.vue index bec37cb..eb2b039 100644 --- a/src/views/laboratory/equipment/config/addElectricQuantity.vue +++ b/src/views/laboratory/equipment/config/addElectricQuantity.vue @@ -69,6 +69,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -178,15 +179,25 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + console.log() + + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 solveEditFormValue(row) infoId.value = row.id // 主键 diff --git a/src/views/laboratory/equipment/config/addOxygenSmoke.vue b/src/views/laboratory/equipment/config/addOxygenSmoke.vue index 77ddd4d..89d0cc4 100644 --- a/src/views/laboratory/equipment/config/addOxygenSmoke.vue +++ b/src/views/laboratory/equipment/config/addOxygenSmoke.vue @@ -38,6 +38,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -76,14 +77,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue index 6093abc..3dc0ff3 100644 --- a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue +++ b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue @@ -66,6 +66,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -108,14 +109,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/config-interface.ts b/src/views/laboratory/equipment/config/config-interface.ts index cd598c6..5fcb532 100644 --- a/src/views/laboratory/equipment/config/config-interface.ts +++ b/src/views/laboratory/equipment/config/config-interface.ts @@ -1,6 +1,7 @@ export interface IListQuery { deviceName: string // 设备名称 deviceNo: string + labName: string// 所属实验室 limit: number offset: number } diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 1d24ed1..386b755 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -18,6 +18,8 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -123,6 +125,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -200,6 +203,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -238,6 +242,7 @@ uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/equipment/config/addElectricQuantity.vue b/src/views/laboratory/equipment/config/addElectricQuantity.vue index bec37cb..eb2b039 100644 --- a/src/views/laboratory/equipment/config/addElectricQuantity.vue +++ b/src/views/laboratory/equipment/config/addElectricQuantity.vue @@ -69,6 +69,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -178,15 +179,25 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + console.log() + + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 solveEditFormValue(row) infoId.value = row.id // 主键 diff --git a/src/views/laboratory/equipment/config/addOxygenSmoke.vue b/src/views/laboratory/equipment/config/addOxygenSmoke.vue index 77ddd4d..89d0cc4 100644 --- a/src/views/laboratory/equipment/config/addOxygenSmoke.vue +++ b/src/views/laboratory/equipment/config/addOxygenSmoke.vue @@ -38,6 +38,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -76,14 +77,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue index 6093abc..3dc0ff3 100644 --- a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue +++ b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue @@ -66,6 +66,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -108,14 +109,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/config-interface.ts b/src/views/laboratory/equipment/config/config-interface.ts index cd598c6..5fcb532 100644 --- a/src/views/laboratory/equipment/config/config-interface.ts +++ b/src/views/laboratory/equipment/config/config-interface.ts @@ -1,6 +1,7 @@ export interface IListQuery { deviceName: string // 设备名称 deviceNo: string + labName: string// 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/equipment/config/list.vue b/src/views/laboratory/equipment/config/list.vue index 5ea93e2..84b7e69 100644 --- a/src/views/laboratory/equipment/config/list.vue +++ b/src/views/laboratory/equipment/config/list.vue @@ -21,6 +21,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import useTemplateDownload from '@/utils/useTemplateDownload' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -113,6 +115,7 @@ const listQuery: Ref = ref({ deviceName: '', deviceNo: '', + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -167,6 +170,7 @@ listQuery.value = { deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -255,8 +259,9 @@ }) if (menu.value[currentIndex.value].list.length > 0) { const params = { - deviceName: '', // 设备名称 - deviceNo: '', // 设备编号 + deviceName: listQuery.value.deviceName, // 设备名称 + deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -277,15 +282,15 @@ function openDialog(type: string, row: any) { switch (currentMenu.value) { case 'temperatureHumidity': // 温湿度网络传感器 - temperatureHumidityRef.value.initDialog(type, currentMenu.value, row) + temperatureHumidityRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break case 'electricQuantity': // 智能电量仪 - electricQuantityRef.value.initDialog(type, currentMenu.value, row) + electricQuantityRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break case 'ups': // UPS电源 break default: - oxygenSmokeRef.value.initDialog(type, currentMenu.value, row) + oxygenSmokeRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break } } diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 1d24ed1..386b755 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -18,6 +18,8 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -123,6 +125,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -200,6 +203,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -238,6 +242,7 @@ uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/equipment/config/addElectricQuantity.vue b/src/views/laboratory/equipment/config/addElectricQuantity.vue index bec37cb..eb2b039 100644 --- a/src/views/laboratory/equipment/config/addElectricQuantity.vue +++ b/src/views/laboratory/equipment/config/addElectricQuantity.vue @@ -69,6 +69,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -178,15 +179,25 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + console.log() + + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 solveEditFormValue(row) infoId.value = row.id // 主键 diff --git a/src/views/laboratory/equipment/config/addOxygenSmoke.vue b/src/views/laboratory/equipment/config/addOxygenSmoke.vue index 77ddd4d..89d0cc4 100644 --- a/src/views/laboratory/equipment/config/addOxygenSmoke.vue +++ b/src/views/laboratory/equipment/config/addOxygenSmoke.vue @@ -38,6 +38,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -76,14 +77,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue index 6093abc..3dc0ff3 100644 --- a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue +++ b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue @@ -66,6 +66,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -108,14 +109,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/config-interface.ts b/src/views/laboratory/equipment/config/config-interface.ts index cd598c6..5fcb532 100644 --- a/src/views/laboratory/equipment/config/config-interface.ts +++ b/src/views/laboratory/equipment/config/config-interface.ts @@ -1,6 +1,7 @@ export interface IListQuery { deviceName: string // 设备名称 deviceNo: string + labName: string// 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/equipment/config/list.vue b/src/views/laboratory/equipment/config/list.vue index 5ea93e2..84b7e69 100644 --- a/src/views/laboratory/equipment/config/list.vue +++ b/src/views/laboratory/equipment/config/list.vue @@ -21,6 +21,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import useTemplateDownload from '@/utils/useTemplateDownload' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -113,6 +115,7 @@ const listQuery: Ref = ref({ deviceName: '', deviceNo: '', + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -167,6 +170,7 @@ listQuery.value = { deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -255,8 +259,9 @@ }) if (menu.value[currentIndex.value].list.length > 0) { const params = { - deviceName: '', // 设备名称 - deviceNo: '', // 设备编号 + deviceName: listQuery.value.deviceName, // 设备名称 + deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -277,15 +282,15 @@ function openDialog(type: string, row: any) { switch (currentMenu.value) { case 'temperatureHumidity': // 温湿度网络传感器 - temperatureHumidityRef.value.initDialog(type, currentMenu.value, row) + temperatureHumidityRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break case 'electricQuantity': // 智能电量仪 - electricQuantityRef.value.initDialog(type, currentMenu.value, row) + electricQuantityRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break case 'ups': // UPS电源 break default: - oxygenSmokeRef.value.initDialog(type, currentMenu.value, row) + oxygenSmokeRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break } } diff --git a/src/views/laboratory/equipment/list/list-interface.ts b/src/views/laboratory/equipment/list/list-interface.ts index 16764b7..fc7153a 100644 --- a/src/views/laboratory/equipment/list/list-interface.ts +++ b/src/views/laboratory/equipment/list/list-interface.ts @@ -5,6 +5,7 @@ deviceStatus: string // 在线状态(1在线0离线) deviceType?: string // 设备类型 userId: string // 负责人id(西昌组织下人员下拉选择) + labName?: string // 所属实验室 limit: number offset: number } diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 1d24ed1..386b755 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -18,6 +18,8 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -123,6 +125,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -200,6 +203,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -238,6 +242,7 @@ uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/equipment/config/addElectricQuantity.vue b/src/views/laboratory/equipment/config/addElectricQuantity.vue index bec37cb..eb2b039 100644 --- a/src/views/laboratory/equipment/config/addElectricQuantity.vue +++ b/src/views/laboratory/equipment/config/addElectricQuantity.vue @@ -69,6 +69,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -178,15 +179,25 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + console.log() + + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 solveEditFormValue(row) infoId.value = row.id // 主键 diff --git a/src/views/laboratory/equipment/config/addOxygenSmoke.vue b/src/views/laboratory/equipment/config/addOxygenSmoke.vue index 77ddd4d..89d0cc4 100644 --- a/src/views/laboratory/equipment/config/addOxygenSmoke.vue +++ b/src/views/laboratory/equipment/config/addOxygenSmoke.vue @@ -38,6 +38,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -76,14 +77,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue index 6093abc..3dc0ff3 100644 --- a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue +++ b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue @@ -66,6 +66,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -108,14 +109,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/config-interface.ts b/src/views/laboratory/equipment/config/config-interface.ts index cd598c6..5fcb532 100644 --- a/src/views/laboratory/equipment/config/config-interface.ts +++ b/src/views/laboratory/equipment/config/config-interface.ts @@ -1,6 +1,7 @@ export interface IListQuery { deviceName: string // 设备名称 deviceNo: string + labName: string// 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/equipment/config/list.vue b/src/views/laboratory/equipment/config/list.vue index 5ea93e2..84b7e69 100644 --- a/src/views/laboratory/equipment/config/list.vue +++ b/src/views/laboratory/equipment/config/list.vue @@ -21,6 +21,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import useTemplateDownload from '@/utils/useTemplateDownload' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -113,6 +115,7 @@ const listQuery: Ref = ref({ deviceName: '', deviceNo: '', + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -167,6 +170,7 @@ listQuery.value = { deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -255,8 +259,9 @@ }) if (menu.value[currentIndex.value].list.length > 0) { const params = { - deviceName: '', // 设备名称 - deviceNo: '', // 设备编号 + deviceName: listQuery.value.deviceName, // 设备名称 + deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -277,15 +282,15 @@ function openDialog(type: string, row: any) { switch (currentMenu.value) { case 'temperatureHumidity': // 温湿度网络传感器 - temperatureHumidityRef.value.initDialog(type, currentMenu.value, row) + temperatureHumidityRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break case 'electricQuantity': // 智能电量仪 - electricQuantityRef.value.initDialog(type, currentMenu.value, row) + electricQuantityRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break case 'ups': // UPS电源 break default: - oxygenSmokeRef.value.initDialog(type, currentMenu.value, row) + oxygenSmokeRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break } } diff --git a/src/views/laboratory/equipment/list/list-interface.ts b/src/views/laboratory/equipment/list/list-interface.ts index 16764b7..fc7153a 100644 --- a/src/views/laboratory/equipment/list/list-interface.ts +++ b/src/views/laboratory/equipment/list/list-interface.ts @@ -5,6 +5,7 @@ deviceStatus: string // 在线状态(1在线0离线) deviceType?: string // 设备类型 userId: string // 负责人id(西昌组织下人员下拉选择) + labName?: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/equipment/list/list.vue b/src/views/laboratory/equipment/list/list.vue index ebfd26a..a15545a 100644 --- a/src/views/laboratory/equipment/list/list.vue +++ b/src/views/laboratory/equipment/list/list.vue @@ -13,6 +13,8 @@ import { usePrintList } from '@/utils/usePrintList' import useTemplateDownload from '@/utils/useTemplateDownload' import { batchImport, deleteDevice, exportDeviceList, getDeviceList } from '@/api/laboratory/equipment/list' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 @@ -22,6 +24,7 @@ deviceNo: '', // 设备编号 deviceStatus: '', // 在线状态(1在线0离线) userId: '', // 负责人id(西昌组织下人员下拉选择) + labName: user.lab, // 所属实验室 ids: [], limit: 20, offset: 1, @@ -107,6 +110,7 @@ deviceNo: '', // 设备编号 deviceStatus: '', // 在线状态(1在线0离线) userId: '', // 负责人id(西昌组织下人员下拉选择) + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -219,6 +223,7 @@ deviceNo: listQuery.value.deviceNo, // 设备编号 deviceStatus: listQuery.value.deviceStatus, // 在线状态(1在线0离线) userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -300,7 +305,7 @@ diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 1d24ed1..386b755 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -18,6 +18,8 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -123,6 +125,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -200,6 +203,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -238,6 +242,7 @@ uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/equipment/config/addElectricQuantity.vue b/src/views/laboratory/equipment/config/addElectricQuantity.vue index bec37cb..eb2b039 100644 --- a/src/views/laboratory/equipment/config/addElectricQuantity.vue +++ b/src/views/laboratory/equipment/config/addElectricQuantity.vue @@ -69,6 +69,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -178,15 +179,25 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + console.log() + + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 solveEditFormValue(row) infoId.value = row.id // 主键 diff --git a/src/views/laboratory/equipment/config/addOxygenSmoke.vue b/src/views/laboratory/equipment/config/addOxygenSmoke.vue index 77ddd4d..89d0cc4 100644 --- a/src/views/laboratory/equipment/config/addOxygenSmoke.vue +++ b/src/views/laboratory/equipment/config/addOxygenSmoke.vue @@ -38,6 +38,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -76,14 +77,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue index 6093abc..3dc0ff3 100644 --- a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue +++ b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue @@ -66,6 +66,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -108,14 +109,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/config-interface.ts b/src/views/laboratory/equipment/config/config-interface.ts index cd598c6..5fcb532 100644 --- a/src/views/laboratory/equipment/config/config-interface.ts +++ b/src/views/laboratory/equipment/config/config-interface.ts @@ -1,6 +1,7 @@ export interface IListQuery { deviceName: string // 设备名称 deviceNo: string + labName: string// 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/equipment/config/list.vue b/src/views/laboratory/equipment/config/list.vue index 5ea93e2..84b7e69 100644 --- a/src/views/laboratory/equipment/config/list.vue +++ b/src/views/laboratory/equipment/config/list.vue @@ -21,6 +21,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import useTemplateDownload from '@/utils/useTemplateDownload' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -113,6 +115,7 @@ const listQuery: Ref = ref({ deviceName: '', deviceNo: '', + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -167,6 +170,7 @@ listQuery.value = { deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -255,8 +259,9 @@ }) if (menu.value[currentIndex.value].list.length > 0) { const params = { - deviceName: '', // 设备名称 - deviceNo: '', // 设备编号 + deviceName: listQuery.value.deviceName, // 设备名称 + deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -277,15 +282,15 @@ function openDialog(type: string, row: any) { switch (currentMenu.value) { case 'temperatureHumidity': // 温湿度网络传感器 - temperatureHumidityRef.value.initDialog(type, currentMenu.value, row) + temperatureHumidityRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break case 'electricQuantity': // 智能电量仪 - electricQuantityRef.value.initDialog(type, currentMenu.value, row) + electricQuantityRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break case 'ups': // UPS电源 break default: - oxygenSmokeRef.value.initDialog(type, currentMenu.value, row) + oxygenSmokeRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break } } diff --git a/src/views/laboratory/equipment/list/list-interface.ts b/src/views/laboratory/equipment/list/list-interface.ts index 16764b7..fc7153a 100644 --- a/src/views/laboratory/equipment/list/list-interface.ts +++ b/src/views/laboratory/equipment/list/list-interface.ts @@ -5,6 +5,7 @@ deviceStatus: string // 在线状态(1在线0离线) deviceType?: string // 设备类型 userId: string // 负责人id(西昌组织下人员下拉选择) + labName?: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/equipment/list/list.vue b/src/views/laboratory/equipment/list/list.vue index ebfd26a..a15545a 100644 --- a/src/views/laboratory/equipment/list/list.vue +++ b/src/views/laboratory/equipment/list/list.vue @@ -13,6 +13,8 @@ import { usePrintList } from '@/utils/usePrintList' import useTemplateDownload from '@/utils/useTemplateDownload' import { batchImport, deleteDevice, exportDeviceList, getDeviceList } from '@/api/laboratory/equipment/list' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 @@ -22,6 +24,7 @@ deviceNo: '', // 设备编号 deviceStatus: '', // 在线状态(1在线0离线) userId: '', // 负责人id(西昌组织下人员下拉选择) + labName: user.lab, // 所属实验室 ids: [], limit: 20, offset: 1, @@ -107,6 +110,7 @@ deviceNo: '', // 设备编号 deviceStatus: '', // 在线状态(1在线0离线) userId: '', // 负责人id(西昌组织下人员下拉选择) + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -219,6 +223,7 @@ deviceNo: listQuery.value.deviceNo, // 设备编号 deviceStatus: listQuery.value.deviceStatus, // 在线状态(1在线0离线) userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -300,7 +305,7 @@ diff --git a/src/views/laboratory/overview/components/message.vue b/src/views/laboratory/overview/components/message.vue index b4bcbcd..70fb538 100644 --- a/src/views/laboratory/overview/components/message.vue +++ b/src/views/laboratory/overview/components/message.vue @@ -2,8 +2,9 @@ @@ -53,24 +65,36 @@ {{ item }} --> -
+
温度:ㅤ {{ props.temperature }} {{ props.temperature !== '-' ? '℃' : '' }}
-
+
湿度:ㅤ {{ props.humidity }}{{ props.humidity !== '-' ? '%' : '' }}
-
+
电压:ㅤ {{ props.voltage }}{{ props.voltage !== '-' ? 'V' : '' }}
- -
+ +
烟雾:ㅤ {{ props.smoke }}
-
- 氧气:ㅤ {{ props.oxygen }} +
+ 氧气:ㅤ {{ props.oxygen }}{{ props.oxygen !== '-' ? 'ppm' : '' }} +
+ +
+ VOC:ㅤ {{ props.voc }}{{ props.voc !== '-' ? 'g/l' : '' }} +
+ +
+ 风扇氧气:ㅤ {{ props.fanOxygen }} +
+ +
+ 挂墙氧气:ㅤ {{ props.wallOxygen }}
diff --git a/src/api/laboratory/overView.ts b/src/api/laboratory/overView.ts index 0b6603b..0777a66 100644 --- a/src/api/laboratory/overView.ts +++ b/src/api/laboratory/overView.ts @@ -4,18 +4,18 @@ import request from '../requestLab' const prefix = 'overview' -// 列表查询 -export function getOverviewAlarmDetail() { +// 查询各个参数 +export function getOverviewAlarmDetail(labName: string) { return request({ - url: `${prefix}/alarmCount`, + url: `${prefix}/alarmCount?labName=${labName}`, method: 'get', }) } // 查询各个实验室数据 -export function getLocationDetail() { +export function getLocationDetail(labName: string) { return request({ - url: `${prefix}/workshop/environment`, + url: `${prefix}/workshop/environment?labName=${labName}`, method: 'get', }) } diff --git a/src/api/system/login.ts b/src/api/system/login.ts index e8c6dd1..58b3be9 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -1,5 +1,6 @@ import request from '../index' import request1 from '../request' +import requestLab from '../requestLab' const prefix = 'sys/' // 登录 // export function doLogin(data: { sid: string; username: string; password: string; kaptcha: string }) { @@ -48,3 +49,9 @@ export function getKaptcha() { return request.get(`${prefix}kaptcha/base64`) } + +// 获取当前用户实验室(西昌、海口) +export function getUerDeptLab() { + return requestLab.get('/system/dept/lab') +} + diff --git a/src/assets/images/hk.png b/src/assets/images/hk.png new file mode 100644 index 0000000..626a288 --- /dev/null +++ b/src/assets/images/hk.png Binary files differ diff --git "a/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" new file mode 100644 index 0000000..70de673 --- /dev/null +++ "b/src/assets/images/login-image-new/\346\265\267\345\217\243\345\256\236\351\252\214\345\256\244\350\277\220\350\241\214\346\200\273\350\247\210\345\217\202\346\225\260.jpg" Binary files differ diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2d58abe..982ccdb 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { reject } from 'lodash-es' import useRouteStore from './route' import useMenuStore from './menu' -import { doLogin, getConfig, getInfo, getUserMenus } from '@/api/system/login' +import { doLogin, getConfig, getInfo, getUerDeptLab, getUserMenus } from '@/api/system/login' import { changePwd } from '@/api/system/user' import type { Menu } from '@/global' import { getPrivateKey, privateStr, setPrivateKey } from '@/utils/auth' @@ -29,6 +29,7 @@ menus: [] as Menu.menu[], // 菜单权限 btns: [] as Menu.menu[], // 按钮权限 isLogout: 0, // 是否被退出登录 + lab: localStorage.lab || '', // 所属实验室 }), getters: { isLogin: (state) => { @@ -77,6 +78,18 @@ }) }) }, + // 获取当前用户属于西昌还是海口 + fetchUserDeptLab() { + return new Promise((resolve) => { + getUerDeptLab().then((res) => { + this.lab = res.data // 返回空字符串表示顶级 + localStorage.setItem('lab', this.lab) + resolve() + }) + }).catch((error) => { + reject(error) + }) + }, // 登录 login(data: { username: string @@ -90,6 +103,7 @@ this.username = res.data.username this.token = res.data.token this.isLogout = 0 + this.fetchUserDeptLab() // 获取当前用户实验室 resolve() }).catch((error) => { reject(error) diff --git a/src/views/laboratory/alarm/current/list-interface.ts b/src/views/laboratory/alarm/current/list-interface.ts index 8f387ef..3e6855f 100644 --- a/src/views/laboratory/alarm/current/list-interface.ts +++ b/src/views/laboratory/alarm/current/list-interface.ts @@ -3,6 +3,7 @@ alarmStartTime: string // 报警开始时间 alarmStatus: string // 报警状态 deviceName: string // 设备名称 + labName: string // 所属实验室 deviceNo: string // 设备编号 limit: number offset: number diff --git a/src/views/laboratory/alarm/current/list.vue b/src/views/laboratory/alarm/current/list.vue index fce8225..446d073 100644 --- a/src/views/laboratory/alarm/current/list.vue +++ b/src/views/laboratory/alarm/current/list.vue @@ -7,14 +7,17 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 const listQuery: Ref = ref({ alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 5除了已消警以外的数据 deviceName: '', // 设备名称 + labName: user.lab, // 所属实验室 deviceNo: '', // 设备编号 limit: 20, offset: 1, @@ -69,7 +72,8 @@ listQuery.value = { alarmEndTime: '', // 报警结束时间 alarmStartTime: '', // 报警开始时间 - alarmStatus: '', // 报警状态 + alarmStatus: '5', // 报警状态 + labName: user.lab, // 所属实验室 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 limit: 20, @@ -163,6 +167,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/alarm/record/list.vue b/src/views/laboratory/alarm/record/list.vue index d612b84..910b088 100644 --- a/src/views/laboratory/alarm/record/list.vue +++ b/src/views/laboratory/alarm/record/list.vue @@ -7,6 +7,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import { exportCurrentList, getCurrentList } from '@/api/laboratory/alarm/current' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const alarmStatusMap = [ // 报警状态 @@ -34,6 +36,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -91,6 +94,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -127,6 +131,7 @@ alarmStatus: listQuery.value.alarmStatus, // 报警状态 deviceName: listQuery.value.deviceName, // 设备名称 deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -134,7 +139,7 @@ exportCurrentList(params).then((res: any) => { const blob = new Blob([res.data]) loading.close() - exportFile(blob, '当前告警.xlsx') + exportFile(blob, '报警记录.xlsx') }) } else { diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index a79724d..fde23c3 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -97,6 +97,7 @@ uploadEndTime: string // 上传结束时间 uploadStartTime: string // 上传开始时间 userId: string // 负责人id(西昌组织下人员下拉选择) + labName: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 1d24ed1..386b755 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -18,6 +18,8 @@ import type { deptType, dictType } from '@/global' import { getUserList } from '@/api/system/user' import { exportDataList, getDataList } from '@/api/laboratory/data' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -123,6 +125,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -200,6 +203,7 @@ deviceNo: '', // 设备编号 uploadEndTime: '', // 上传结束时间 uploadStartTime: '', // 上传开始时间 + labName: user.lab, // 所属实验室 userId: '', // 负责人id(西昌组织下人员下拉选择) limit: 20, offset: 1, @@ -238,6 +242,7 @@ uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, diff --git a/src/views/laboratory/equipment/config/addElectricQuantity.vue b/src/views/laboratory/equipment/config/addElectricQuantity.vue index bec37cb..eb2b039 100644 --- a/src/views/laboratory/equipment/config/addElectricQuantity.vue +++ b/src/views/laboratory/equipment/config/addElectricQuantity.vue @@ -69,6 +69,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -178,15 +179,25 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + console.log() + + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 solveEditFormValue(row) infoId.value = row.id // 主键 diff --git a/src/views/laboratory/equipment/config/addOxygenSmoke.vue b/src/views/laboratory/equipment/config/addOxygenSmoke.vue index 77ddd4d..89d0cc4 100644 --- a/src/views/laboratory/equipment/config/addOxygenSmoke.vue +++ b/src/views/laboratory/equipment/config/addOxygenSmoke.vue @@ -38,6 +38,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -76,14 +77,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue index 6093abc..3dc0ff3 100644 --- a/src/views/laboratory/equipment/config/addTemperatureHumidity.vue +++ b/src/views/laboratory/equipment/config/addTemperatureHumidity.vue @@ -66,6 +66,7 @@ const pageType = ref('') // 页面类型 add新增、edit编辑 const infoId = ref('') // id,主键 const loading = ref(false) +const selectedDevice = ref([]) as any // 已经选择的设备,设备编号需要过滤掉 // ----------------------------------------方法------------------------------------------------- // 清空表单 const clear = () => { @@ -108,14 +109,22 @@ } getDeviceList(listQuery.value).then((response) => { deviceList.value = response.data.rows + // 过滤掉已经配置过的设备 + selectedDevice.value.forEach((e: { deviceNo: string }) => { + const index = deviceList.value.findIndex((item: { deviceNo: string }) => item.deviceNo === e.deviceNo) + if (index !== -1) { + deviceList.value.splice(index, 1) + } + }) }) } // ------------------------------------------------------------------------------------------------- // 弹窗初始化 -const initDialog = (pageTypeParam = 'detail', type: string, row: any) => { +const initDialog = (pageTypeParam = 'detail', type: string, row: any, list: any) => { dialogVisible.value = true // 打开弹窗 pageType.value = pageTypeParam // 页面类型 deviceType.value = type // 设备类型 + selectedDevice.value = list if (pageTypeParam === 'edit' || pageTypeParam === 'detail') { // 编辑时初始化数据 form.value.deviceId = row.deviceId // 设备表id form.value.deviceNo = row.deviceNo // 地点编号 diff --git a/src/views/laboratory/equipment/config/config-interface.ts b/src/views/laboratory/equipment/config/config-interface.ts index cd598c6..5fcb532 100644 --- a/src/views/laboratory/equipment/config/config-interface.ts +++ b/src/views/laboratory/equipment/config/config-interface.ts @@ -1,6 +1,7 @@ export interface IListQuery { deviceName: string // 设备名称 deviceNo: string + labName: string// 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/equipment/config/list.vue b/src/views/laboratory/equipment/config/list.vue index 5ea93e2..84b7e69 100644 --- a/src/views/laboratory/equipment/config/list.vue +++ b/src/views/laboratory/equipment/config/list.vue @@ -21,6 +21,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import useTemplateDownload from '@/utils/useTemplateDownload' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) const listMap = { @@ -113,6 +115,7 @@ const listQuery: Ref = ref({ deviceName: '', deviceNo: '', + labName: user.lab, // 所属实验室 limit: 20, offset: 1, }) @@ -167,6 +170,7 @@ listQuery.value = { deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -255,8 +259,9 @@ }) if (menu.value[currentIndex.value].list.length > 0) { const params = { - deviceName: '', // 设备名称 - deviceNo: '', // 设备编号 + deviceName: listQuery.value.deviceName, // 设备名称 + deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -277,15 +282,15 @@ function openDialog(type: string, row: any) { switch (currentMenu.value) { case 'temperatureHumidity': // 温湿度网络传感器 - temperatureHumidityRef.value.initDialog(type, currentMenu.value, row) + temperatureHumidityRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break case 'electricQuantity': // 智能电量仪 - electricQuantityRef.value.initDialog(type, currentMenu.value, row) + electricQuantityRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break case 'ups': // UPS电源 break default: - oxygenSmokeRef.value.initDialog(type, currentMenu.value, row) + oxygenSmokeRef.value.initDialog(type, currentMenu.value, row, menu.value[currentIndex.value].list) break } } diff --git a/src/views/laboratory/equipment/list/list-interface.ts b/src/views/laboratory/equipment/list/list-interface.ts index 16764b7..fc7153a 100644 --- a/src/views/laboratory/equipment/list/list-interface.ts +++ b/src/views/laboratory/equipment/list/list-interface.ts @@ -5,6 +5,7 @@ deviceStatus: string // 在线状态(1在线0离线) deviceType?: string // 设备类型 userId: string // 负责人id(西昌组织下人员下拉选择) + labName?: string // 所属实验室 limit: number offset: number } diff --git a/src/views/laboratory/equipment/list/list.vue b/src/views/laboratory/equipment/list/list.vue index ebfd26a..a15545a 100644 --- a/src/views/laboratory/equipment/list/list.vue +++ b/src/views/laboratory/equipment/list/list.vue @@ -13,6 +13,8 @@ import { usePrintList } from '@/utils/usePrintList' import useTemplateDownload from '@/utils/useTemplateDownload' import { batchImport, deleteDevice, exportDeviceList, getDeviceList } from '@/api/laboratory/equipment/list' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 const $router = useRouter() const loadingTable = ref(false) // 查询条件 @@ -22,6 +24,7 @@ deviceNo: '', // 设备编号 deviceStatus: '', // 在线状态(1在线0离线) userId: '', // 负责人id(西昌组织下人员下拉选择) + labName: user.lab, // 所属实验室 ids: [], limit: 20, offset: 1, @@ -107,6 +110,7 @@ deviceNo: '', // 设备编号 deviceStatus: '', // 在线状态(1在线0离线) userId: '', // 负责人id(西昌组织下人员下拉选择) + labName: user.lab, // 所属实验室 limit: 20, offset: 1, } @@ -219,6 +223,7 @@ deviceNo: listQuery.value.deviceNo, // 设备编号 deviceStatus: listQuery.value.deviceStatus, // 在线状态(1在线0离线) userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + labName: listQuery.value.labName, // 所属实验室 offset: 1, limit: 20, ids: checkoutList.value, @@ -300,7 +305,7 @@ diff --git a/src/views/laboratory/overview/components/message.vue b/src/views/laboratory/overview/components/message.vue index b4bcbcd..70fb538 100644 --- a/src/views/laboratory/overview/components/message.vue +++ b/src/views/laboratory/overview/components/message.vue @@ -2,8 +2,9 @@ @@ -53,24 +65,36 @@ {{ item }}
--> -
+
温度:ㅤ {{ props.temperature }} {{ props.temperature !== '-' ? '℃' : '' }}
-
+
湿度:ㅤ {{ props.humidity }}{{ props.humidity !== '-' ? '%' : '' }}
-
+
电压:ㅤ {{ props.voltage }}{{ props.voltage !== '-' ? 'V' : '' }}
- -
+ +
烟雾:ㅤ {{ props.smoke }}
-
- 氧气:ㅤ {{ props.oxygen }} +
+ 氧气:ㅤ {{ props.oxygen }}{{ props.oxygen !== '-' ? 'ppm' : '' }} +
+ +
+ VOC:ㅤ {{ props.voc }}{{ props.voc !== '-' ? 'g/l' : '' }} +
+ +
+ 风扇氧气:ㅤ {{ props.fanOxygen }} +
+ +
+ 挂墙氧气:ㅤ {{ props.wallOxygen }}
diff --git a/src/views/laboratory/overview/index.vue b/src/views/laboratory/overview/index.vue index cd200bd..de6cfcb 100644 --- a/src/views/laboratory/overview/index.vue +++ b/src/views/laboratory/overview/index.vue @@ -8,6 +8,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' import { getLocationDetail } from '@/api/laboratory/overView' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 // ---------------------------------------表格--------------------------------------------- const radioMenus = ref([ // 标签内容 { name: '未确认报警', value: 'unconfirmed' }, @@ -21,6 +23,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 10, offset: 1, }) @@ -41,6 +44,7 @@ { text: '报警状态', value: 'alarmStatusName', align: 'center', width: '90' }, ]) const total = ref(0) // 数据总条数 +const selectLab = ref('海口实验室') // 顶级角色选择的所属实验室 // 数据查询 function fetchData(isNowPage = false) { @@ -99,7 +103,8 @@ }) } -// --------------------------------------图---------------------------------------------------------- +// --------------------------------------西昌实验室图---------------------------------------------------------- +// ===========================西昌=================================== const temperatureHumidityRoomIn = ref({ // 温湿度计量工作间(内) temperature: '-', // 温度 humidity: '-', // 湿度 @@ -169,9 +174,101 @@ voltage: '-', // 电压 }) +// =============================海口==================================== +const spareRoomHK = ref({ // 备品备件库 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const electromagnetism2RoomHK = ref({ // 电磁学工作间2 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const qualityArbitrationRoomHK = ref({ // 质量检定工作间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const pressure1RoomHK = ref({ // 压力检定工作间1 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const pressure2RoomHK = ref({ // 压力检定工作间2 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const electromagneticShieldingRoomHK = ref({ // 电磁屏蔽间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const microwaveSignal1RoomHK = ref({ // 微波信号检定工作间1 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const timeFrequency2RoomHK = ref({ // 时间频率检定工作间2 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const electromagnetism1RoomHK = ref({ // 电磁学工作间1 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const FileRoomHK = ref({ // 档案间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const safetyValveRoomHK = ref({ // 安全阀校验 + fanOxygen: '', // 风扇氧气 + wallOxygen: '', // 挂墙氧气 + temperature: '-', // 温度 + humidity: '-', // 湿度 + VOC: '-', // VOC +}) + +const receiveDispatchRoomHK = ref({ // 仪器收发间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + oxygenDensity: '-', // 氧气 +}) + +const UPSRoomHK = ref({ // Ups电源间 + temperature: '-', // 温度 + humidity: '-', // 湿度 +}) + +const humidityRoomHK = ref({ // 湿度检定工作间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const temperatureRoomHK = ref({ // 温度检定工作间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + // 获取图里的资源 const fetchLocationDetail = () => { - getLocationDetail().then((res) => { + getLocationDetail(user.lab).then((res) => { // 时间频率 const timeFrequencyRoomIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '西昌时间频率计量工作间') if (timeFrequencyRoomIndex !== -1) { @@ -297,10 +394,26 @@ diff --git a/src/views/laboratory/overview/index.vue b/src/views/laboratory/overview/index.vue index cd200bd..de6cfcb 100644 --- a/src/views/laboratory/overview/index.vue +++ b/src/views/laboratory/overview/index.vue @@ -8,6 +8,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { getCurrentList, operateAlarm } from '@/api/laboratory/alarm/current' import { getLocationDetail } from '@/api/laboratory/overView' +import useUserStore from '@/store/modules/user' +const user = useUserStore() // 用户信息 // ---------------------------------------表格--------------------------------------------- const radioMenus = ref([ // 标签内容 { name: '未确认报警', value: 'unconfirmed' }, @@ -21,6 +23,7 @@ alarmStatus: '', // 报警状态 deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 limit: 10, offset: 1, }) @@ -41,6 +44,7 @@ { text: '报警状态', value: 'alarmStatusName', align: 'center', width: '90' }, ]) const total = ref(0) // 数据总条数 +const selectLab = ref('海口实验室') // 顶级角色选择的所属实验室 // 数据查询 function fetchData(isNowPage = false) { @@ -99,7 +103,8 @@ }) } -// --------------------------------------图---------------------------------------------------------- +// --------------------------------------西昌实验室图---------------------------------------------------------- +// ===========================西昌=================================== const temperatureHumidityRoomIn = ref({ // 温湿度计量工作间(内) temperature: '-', // 温度 humidity: '-', // 湿度 @@ -169,9 +174,101 @@ voltage: '-', // 电压 }) +// =============================海口==================================== +const spareRoomHK = ref({ // 备品备件库 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const electromagnetism2RoomHK = ref({ // 电磁学工作间2 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const qualityArbitrationRoomHK = ref({ // 质量检定工作间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const pressure1RoomHK = ref({ // 压力检定工作间1 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const pressure2RoomHK = ref({ // 压力检定工作间2 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const electromagneticShieldingRoomHK = ref({ // 电磁屏蔽间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const microwaveSignal1RoomHK = ref({ // 微波信号检定工作间1 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const timeFrequency2RoomHK = ref({ // 时间频率检定工作间2 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const electromagnetism1RoomHK = ref({ // 电磁学工作间1 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const FileRoomHK = ref({ // 档案间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const safetyValveRoomHK = ref({ // 安全阀校验 + fanOxygen: '', // 风扇氧气 + wallOxygen: '', // 挂墙氧气 + temperature: '-', // 温度 + humidity: '-', // 湿度 + VOC: '-', // VOC +}) + +const receiveDispatchRoomHK = ref({ // 仪器收发间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + oxygenDensity: '-', // 氧气 +}) + +const UPSRoomHK = ref({ // Ups电源间 + temperature: '-', // 温度 + humidity: '-', // 湿度 +}) + +const humidityRoomHK = ref({ // 湿度检定工作间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + +const temperatureRoomHK = ref({ // 温度检定工作间 + temperature: '-', // 温度 + humidity: '-', // 湿度 + voltage: '-', // 电压 +}) + // 获取图里的资源 const fetchLocationDetail = () => { - getLocationDetail().then((res) => { + getLocationDetail(user.lab).then((res) => { // 时间频率 const timeFrequencyRoomIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '西昌时间频率计量工作间') if (timeFrequencyRoomIndex !== -1) { @@ -297,10 +394,26 @@