diff --git a/.env.development b/.env.development index af7909a..4a94903 100644 --- a/.env.development +++ b/.env.development @@ -1 +1,2 @@ VITE_APP_URL = 'http://192.168.3.116:8001' +VITE_APP_URL_WEBSOCKET = 'http://192.168.3.116:8000/api/websocket' diff --git a/.env.production b/.env.production index faabcd6..27e4db4 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,4 @@ VITE_APP_URL = 'http://192.168.3.116:8001/' +VITE_APP_URL_WEBSOCKET = 'http://192.168.3.116:8000/api/websocket' diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 08908ed..8139ac9 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -1,5 +1,5 @@ // Generated by 'unplugin-auto-import' export {} declare global { - + const ElMessage: typeof import('element-plus/es')['ElMessage'] } diff --git a/src/api/index.d.ts b/src/api/index.d.ts index 993eea9..c4a7d96 100644 --- a/src/api/index.d.ts +++ b/src/api/index.d.ts @@ -20,7 +20,7 @@ export interface TRoleList { id?: number name: string createTime?: string - roleMenu: TRoleMenu[] + roleMenu?: TRoleMenu[] } @@ -81,9 +81,10 @@ export interface TDeviceConfigModify { export namespace TRoleModify { export interface Ireq { - id: number + id?: number name: string roleMenu: TRoleMenu[] + menus?: TRoleMenu[] } } @@ -257,9 +258,6 @@ export namespace TDevice { } - - - export namespace TOrg { export interface IAdd { name: string; @@ -267,7 +265,7 @@ export namespace TOrg { parentId: string; } export interface IListReq extends Ipaging { - name?: number; + name?: string; } export interface Idel { id: number; diff --git a/src/api/index.ts b/src/api/index.ts index eaa6206..42eb660 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -3,7 +3,7 @@ import { TLogin, TAccount, IpagingRes, TDevice, TOrg, TRoleList, TStatisticsDevi export const fetchLogin = (p: TLogin.Ireq): Promise => { return request({ - url: '/v1/web/login', + url: '/v1/api/login', method: 'post', data: p }); @@ -12,7 +12,7 @@ export const fetchLogin = (p: TLogin.Ireq): Promise => { // 批量导入账号样例 export const exportDemoAccount = (): Promise => { return request({ - url: '/v1/web/upload/exportDemo/account', + url: '/v1/api/upload/exportDemo/account', method: 'get', responseType: 'blob' }); @@ -47,7 +47,7 @@ export const fetchRoleData = () => { // 添加用户 export const accountAdd = (p: TAccount.IAdd): Promise => { return request({ - url: '/v1/web/account/add', + url: '/v1/api/account/add', method: 'post', data: p }); @@ -55,7 +55,7 @@ export const accountAdd = (p: TAccount.IAdd): Promise => { // 删除用户 export const accountDeletet = (p: TAccount.Idel): Promise => { return request({ - url: '/v1/web/account/delete', + url: '/v1/api/account/delete', method: 'post', data: p }); @@ -63,7 +63,7 @@ export const accountDeletet = (p: TAccount.Idel): Promise => { // 修改用户 export const accountModify = (p: TAccount.IAdd): Promise => { return request({ - url: '/v1/web/account/modify', + url: '/v1/api/account/modify', method: 'post', data: p }); @@ -71,7 +71,7 @@ export const accountModify = (p: TAccount.IAdd): Promise => { // 获取用户列表 export const accountList = (p: TAccount.IListReq): Promise> => { return request({ - url: '/v1/web/account/list', + url: '/v1/api/account/list', method: 'get', params: p }); @@ -79,7 +79,7 @@ export const accountList = (p: TAccount.IListReq): Promise => { return request({ - url: '/v1/web/account/password/reset', + url: '/v1/api/account/password/reset', method: 'post', data: p }); @@ -89,7 +89,7 @@ export const passwordReset = (p: TAccount.IResetPwd): Promise => { // 获取设备列表 export const deviceList = (p: TDevice.IListReq): Promise> => { return request({ - url: '/v1/web/device/list', + url: '/v1/api/device/list', method: 'get', params: p }); @@ -98,7 +98,7 @@ export const deviceList = (p: TDevice.IListReq): Promise => { return request({ - url: '/v1/web/device/set/monitor', + url: '/v1/api/device/set/monitor', method: 'post', data: p }); @@ -107,7 +107,7 @@ export const setMonitor = (p: TDevice.ISetMonitor): Promise => { // 设置模式 export const setMode = (p: TDevice.ISetMonitor): Promise => { return request({ - url: '/v1/web/device/set/mode', + url: '/v1/api/device/set/mode', method: 'post', data: p }); @@ -116,7 +116,7 @@ export const setMode = (p: TDevice.ISetMonitor): Promise => { // 获取定位 export const deviceGetLocation = (p: TDevice.ISetMonitor): Promise => { return request({ - url: '/v1/web/device/getLocate', + url: '/v1/api/device/getLocate', method: 'post', data: p }); @@ -125,7 +125,7 @@ export const deviceGetLocation = (p: TDevice.ISetMonitor): Promise => { // 设备控制 export const deviceControl = (p: TDevice.ISetMonitor): Promise => { return request({ - url: '/v1/web/device/control', + url: '/v1/api/device/control', method: 'post', data: p }); @@ -134,7 +134,7 @@ export const deviceControl = (p: TDevice.ISetMonitor): Promise => { // 设备使用记录 export const deviceUseRecord = (p: TDevice.IRecordReq): Promise> => { return request({ - url: '/v1/web/device/use/record', + url: '/v1/api/device/use/record', method: 'get', params: p }); @@ -143,7 +143,7 @@ export const deviceUseRecord = (p: TDevice.IRecordReq): Promise> => { return request({ - url: '/v1/web/warning/record', + url: '/v1/api/warning/record', method: 'get', params: p }); @@ -152,7 +152,7 @@ export const warningRecord = (p: TDevice.IRecordReq): Promise => { return request({ - url: '/v1/web/org/add', + url: '/v1/api/org/add', method: 'post', data: p }); @@ -160,7 +160,7 @@ export const orgAdd = (p: TOrg.IAdd): Promise => { // 修改机构 export const orgModify = (p: TOrg.IAdd): Promise => { return request({ - url: '/v1/web/org/modify', + url: '/v1/api/org/modify', method: 'post', data: p }); @@ -168,7 +168,7 @@ export const orgModify = (p: TOrg.IAdd): Promise => { // 机构列表 export const orgList = (p?: TOrg.IListReq): Promise> => { return request({ - url: '/v1/web/org/list', + url: '/v1/api/org/page', method: 'get', params: p }); @@ -177,7 +177,7 @@ export const orgList = (p?: TOrg.IListReq): Promise => { return request({ - url: '/v1/web/org/delete', + url: '/v1/api/org/delete', method: 'post', data: p }); @@ -186,7 +186,7 @@ export const orgDelete = (p?: TOrg.Idel): Promise => { // 获取角色列表 export const roleList = (): Promise => { return request({ - url: '/v1/web/role/list', + url: '/v1/api/role/list', method: 'get', }); }; @@ -194,7 +194,16 @@ export const roleList = (): Promise => { // 修改角色信息 export const roleModify = (p: TRoleModify.Ireq): Promise => { return request({ - url: '/v1/web/role/modify', + url: '/v1/api/role/modify', + method: 'post', + data: p + }); +}; + +// 添加角色信息 +export const roleAdd = (p: TRoleModify.Ireq): Promise => { + return request({ + url: '/v1/api/role/add', method: 'post', data: p }); @@ -203,7 +212,7 @@ export const roleModify = (p: TRoleModify.Ireq): Promise => { // 设备在线统计 export const statisticsDevice = (): Promise => { return request({ - url: '/v1/web/statistics/device', + url: '/v1/api/statistics/device', method: 'get', }); }; @@ -211,7 +220,7 @@ export const statisticsDevice = (): Promise => { // 内容数据 export const statisticsContent = (p: statisticsContentReq): Promise => { return request({ - url: '/v1/web/statistics/content', + url: '/v1/api/statistics/content', method: 'post', data: p }); @@ -220,7 +229,7 @@ export const statisticsContent = (p: statisticsContentReq): Promise => { return request({ - url: '/v1/web/statistics/count', + url: '/v1/api/statistics/count', method: 'get', }); }; @@ -228,7 +237,7 @@ export const statisticsCount = (): Promise => { // 告警统计 export const statisticsWarningapi = (): Promise => { return request({ - url: '/v1/web/statistics/warning', + url: '/v1/api/statistics/warning', method: 'get', }); }; @@ -236,7 +245,7 @@ export const statisticsWarningapi = (): Promise => { // 预警记录 export const warnRecord = (p: TWarnRecord.IListReq): Promise> => { return request({ - url: '/v1/web/warning/record', + url: '/v1/api/warning/record', method: 'get', params: p }); @@ -245,7 +254,7 @@ export const warnRecord = (p: TWarnRecord.IListReq): Promise => { return request({ - url: '/v1/web/warning/detail', + url: '/v1/api/warning/detail', method: 'get', params: p }); @@ -254,7 +263,7 @@ export const warningDetail = (p: TWarningDetail.TParams): Promise => { return request({ - url: '/v1/web/warning/confirm', + url: '/v1/api/warning/confirm', method: 'post', data: p }); @@ -263,7 +272,7 @@ export const warningConfirm = (p: TWarningConfirm): Promise => { // 获取专项配置 export const deviceConfig = (p: TDeviceConfig.Treq): Promise => { return request({ - url: '/v1/web/device/deviceConfig', + url: '/v1/api/device/deviceConfig', method: 'get', params: p }); @@ -272,7 +281,7 @@ export const deviceConfig = (p: TDeviceConfig.Treq): Promise // 修改专项配置 export const deviceConfigModify = (p: TDeviceConfigModify): Promise => { return request({ - url: '/v1/web/device/deviceConfig/modify', + url: '/v1/api/device/deviceConfig/modify', method: 'post', data: p }); @@ -281,7 +290,7 @@ export const deviceConfigModify = (p: TDeviceConfigModify): Promise => { // 获取最新健康数据 export const healthLatestData = (p: THealthLatestData.TReq): Promise => { return request({ - url: '/v1/web/health/latestData', + url: '/v1/api/health/latestData', method: 'get', params: p }); @@ -290,7 +299,7 @@ export const healthLatestData = (p: THealthLatestData.TReq): Promise => { return request({ - url: '/v1/web/device/locate/record', + url: '/v1/api/device/locate/record', method: 'get', params: p }); @@ -299,7 +308,7 @@ export const locateRecord = (p: TLocateRecord.TReq): Promise => { return request({ - url: '/v1/web/device/set/useStatus', + url: '/v1/api/device/set/useStatus', method: 'post', data: p }); @@ -308,7 +317,7 @@ export const setUseStatus = (p: TSetUseStatus.TReq): Promise => { // 设置禁用状态 export const setStatus = (p: TSetUseStatus.TReq): Promise => { return request({ - url: '/v1/web/device/set/status', + url: '/v1/api/device/set/status', method: 'post', data: p }); @@ -317,7 +326,7 @@ export const setStatus = (p: TSetUseStatus.TReq): Promise => { // 获取菜单列表 export const roleMenuList = (): Promise => { return request({ - url: '/v1/web/role/menu/list', + url: '/v1/api/role/menu/list', method: 'get', }); }; diff --git a/src/assets/audio/warning1.mp3 b/src/assets/audio/warning1.mp3 new file mode 100644 index 0000000..098ae51 Binary files /dev/null and b/src/assets/audio/warning1.mp3 differ diff --git a/src/components/alarm.vue b/src/components/alarm.vue index 7aa484f..4c5957c 100644 --- a/src/components/alarm.vue +++ b/src/components/alarm.vue @@ -18,9 +18,9 @@
- + @@ -43,14 +43,16 @@ defineProps({ }, }); -defineEmits(["close", "confirm"]); +const emit = defineEmits(["close", "confirm"]); const handleAudioEnd = () => { - if (audioPlayer.value) { - audioPlayer.value.play().catch((error) => { - console.error("自动播放被阻止:", error); - }); - } + emit("close"); + + // if (audioPlayer.value) { + // audioPlayer.value.play().catch((error) => { + // console.error("自动播放被阻止:", error); + // }); + // } }; onMounted(() => { diff --git a/src/components/batch-imp.vue b/src/components/batch-imp.vue index f36fc7b..ac8727d 100644 --- a/src/components/batch-imp.vue +++ b/src/components/batch-imp.vue @@ -34,7 +34,7 @@ interface Tdata { } const comm = useCommonStore(); -const ACTION = import.meta.env.VITE_APP_URL + "/v1/web/upload/account"; +const ACTION = import.meta.env.VITE_APP_URL + "/v1/api/upload/account"; const HEADERS = { "Access-Token": comm.user.token, }; diff --git a/src/components/table-search.vue b/src/components/table-search.vue index 84d75a6..e859541 100644 --- a/src/components/table-search.vue +++ b/src/components/table-search.vue @@ -24,6 +24,7 @@ style="width: 220px" v-else-if="item.type === 'daterange'" v-model="query[item.prop]" + value-format="YYYY-MM-DD" type="daterange" range-separator="-" start-placeholder="开始日期" diff --git a/src/components/upload-img.vue b/src/components/upload-img.vue index 991474c..53684ac 100644 --- a/src/components/upload-img.vue +++ b/src/components/upload-img.vue @@ -1,17 +1,20 @@ diff --git a/src/layout/index copy 2.vue b/src/layout/index copy 2.vue new file mode 100644 index 0000000..e62b55a --- /dev/null +++ b/src/layout/index copy 2.vue @@ -0,0 +1,19 @@ + + diff --git a/src/layout/index copy.vue b/src/layout/index copy.vue new file mode 100644 index 0000000..3da49f4 --- /dev/null +++ b/src/layout/index copy.vue @@ -0,0 +1,120 @@ + + + + diff --git a/src/layout/index.vue b/src/layout/index.vue index 2dba5cc..e5d4aa6 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -13,15 +13,30 @@ + + diff --git a/src/store/common.ts b/src/store/common.ts index c28a14e..22760a2 100644 --- a/src/store/common.ts +++ b/src/store/common.ts @@ -1,11 +1,13 @@ import { defineStore } from 'pinia'; -import { TLogin } from "@/api/index.d"; +import { TLogin, TRoleList } from "@/api/index.d"; +import { roleList } from '@/api'; export const useCommonStore = defineStore('common', { state: () => { return { time: new Date(), - user: {} + user: {}, + roleList: [] }; }, getters: {}, @@ -13,6 +15,11 @@ export const useCommonStore = defineStore('common', { setTime() { this.time = new Date(); }, + getRoleList() { + roleList().then(res => { + this.roleList = res + }) + }, setUser(data: TLogin.IRes) { this.user = data }, diff --git a/src/utils/webSocket.js b/src/utils/webSocket.js new file mode 100644 index 0000000..f881ffa --- /dev/null +++ b/src/utils/webSocket.js @@ -0,0 +1,158 @@ +import { ref, onMounted, onUnmounted } from 'vue'; + +class WebSocketService { + constructor() { + this.url = import.meta.env.VITE_APP_URL_WEBSOCKET; + this.socket = null; + this.isAlive = false; // 用于判断心跳是否正常 + this.reconnectAttempts = 0; // 重连尝试次数 + this.MAX_RECONNECT_ATTEMPTS = 5; // 最大重连次数 + this.HEARTBEAT_INTERVAL = 5000; // 心跳间隔时间 (30秒) + // this.HEARTBEAT_INTERVAL = 30000; // 心跳间隔时间 (30秒) + this.heartbeatTimer = null; + this.reconnectTimer = null; + + this.connect(); + } + + connect() { + this.socket = new WebSocket(this.url); + + this.socket.onopen = () => { + console.log('WebSocket已连接'); + this.webScoketLogin(); + this.reconnectAttempts = 0; // 成功连接后重置重试次数 + this.startHeartbeat(); // 开始心跳检测 + }; + + this.socket.onmessage = (event) => { + // 处理接收到的消息 + console.log('Message received:', event.data); + }; + + this.socket.onclose = () => { + console.log('WebSocket连接已关闭'); + this.stopHeartbeat(); + this.attemptReconnect(); + }; + + this.socket.onerror = (error) => { + console.log('WebSocket连接错误', error); + }; + } + + webScoketLogin() { + this.sendMessage({ + username: "admin", + password: "111111", + type: 0, + cmd: "webLogin", + }) + } + + startHeartbeat() { + if (!this.heartbeatTimer) { + this.heartbeatTimer = setInterval(() => { + if (this.socket.readyState === WebSocket.OPEN) { + this.isAlive = false; + this.sendPing(); + } + }, this.HEARTBEAT_INTERVAL); + } + } + + stopHeartbeat() { + if (this.heartbeatTimer) { + clearInterval(this.heartbeatTimer); + this.heartbeatTimer = null; + } + } + + sendPing() { + console.log('发送心跳', JSON.stringify({ cmd: 'heartbeat' })); + + this.socket.send(JSON.stringify({ cmd: 'heartbeat' })); + setTimeout(() => { + if (!this.isAlive) { + console.warn('WebSocket heartbeat failed, attempting to reconnect...'); + this.socket.close(); + } + }, this.HEARTBEAT_INTERVAL / 2); // 如果没有pong响应,则关闭并重连 + } + + receivePong() { + this.isAlive = true; + } + + attemptReconnect() { + if (this.reconnectAttempts < this.MAX_RECONNECT_ATTEMPTS) { + this.reconnectAttempts++; + console.log(`Attempting to reconnect (${this.reconnectAttempts})...`); + this.reconnectTimer = setTimeout(() => { + this.connect(); + }, 1000 * this.reconnectAttempts); // 指数退避算法 + } else { + console.error('Max reconnect attempts reached'); + } + } + + sendMessage(message) { + if (this.socket && this.socket.readyState === WebSocket.OPEN) { + this.socket.send(JSON.stringify(message)); + } + } + + close() { + this.stopHeartbeat(); + if (this.reconnectTimer) { + clearTimeout(this.reconnectTimer); + this.reconnectTimer = null; + } + if (this.socket) { + this.socket.close(); + this.socket = null; + } + } +} + +export default function useWebSocket() { + const ws = new WebSocketService(); + + const message = ref(null); + const isConnected = ref(false); + + const onMessage = (callback) => { + ws.socket.onmessage = (event) => { + const data = JSON.parse(event.data); + if (data.cmd == "webLogin" && !data.code == 200) return ws.webScoketLogin() + + callback(data); + if (event.data.includes('heartbeat')) { + ws.receivePong(); + } + }; + }; + + const onClose = () => { + ws.socket.onclose() + }; + + const onOpen = (callback) => { + ws.socket.onopen = () => { + isConnected.value = true; + callback(); + }; + }; + + // onMounted(() => { + // onOpen(() => console.log('Connected')); + // onClose(() => console.log('Disconnected')); + // onMessage((data) => console.log('Received:', data)); + // }); + + // onUnmounted(() => { + // ws.close(); + // }); + + return { isConnected, message, sendMessage: ws.sendMessage.bind(ws), onMessage, onClose }; +} \ No newline at end of file diff --git a/src/views/alarmCenter/index.vue b/src/views/alarmCenter/index.vue index 95dfd87..3aa895e 100644 --- a/src/views/alarmCenter/index.vue +++ b/src/views/alarmCenter/index.vue @@ -44,23 +44,33 @@ enum warnTypeEnum { } const router = useRouter(); // 查询相关 -const query = reactive({ - name: "", -}); +const query = reactive({}); const searchOpt = ref([ - { type: "select", label: "来源手铐:", prop: "name1", opts: [{ label: "866503071660886", value: "866503071660886" }] }, - { type: "select", label: "事件类型:", prop: "name2", opts: [{ label: "866503071660886", value: "866503071660886" }] }, - { type: "select", label: "事件级别:", prop: "name3", opts: [{ label: "866503071660886", value: "866503071660886" }] }, + { type: "input", label: "手铐IMEI号:", prop: "deviceId" }, + { + type: "select", + label: "告警类型:", + prop: "warnType", + opts: [ + { label: "SOS告警", value: 0 }, + { label: "围栏告警", value: 1 }, + { label: "破坏告警", value: 2 }, + { label: "低电告警", value: 3 }, + { label: "心率告警", value: 4 }, + { label: "血氧告警", value: 5 }, + { label: "体温告警", value: 6 }, + ], + }, { type: "select", label: "处理状态:", prop: "status", opts: [ - { label: "未处理", value: "0" }, - { label: "已处理", value: "1" }, + { label: "待处理", value: 0 }, + { label: "已处理", value: 1 }, ], }, - { type: "daterange", label: "创建时间:", prop: "name5" }, + { type: "daterange", label: "创建时间:", prop: "time" }, ]); const handleSearch = () => { changePage(1); @@ -86,7 +96,10 @@ const tableData = ref([]); const getData = async () => { try { - const res = await warnRecord(paging); + console.log(query, "queryqueryquery"); + let p = { ...paging, ...query, startDate: query.time?.[0], endDate: query.time?.[1] }; + delete p.time; + const res = await warnRecord(p); tableData.value = res.records; paging.total = res.total; } catch (error) {} @@ -97,10 +110,10 @@ const changePage = (val: number) => { paging.page = val; getData(); }; -const toIncidentDispose = (deviceId: string) => { +const toIncidentDispose = (id: string) => { router.push({ path: "/incidentDispose", - query: { deviceId }, + query: { id }, }); }; diff --git a/src/views/incidentDispose/index.vue b/src/views/incidentDispose/index.vue index 72f6a28..d4d3476 100644 --- a/src/views/incidentDispose/index.vue +++ b/src/views/incidentDispose/index.vue @@ -47,26 +47,26 @@ - + - + - + - + -
- 保存 +
+ 保存
@@ -77,7 +77,7 @@ diff --git a/src/views/statisticalCenter/monitoringTop.vue b/src/views/statisticalCenter/monitoringTop.vue index 5e93cf4..273b386 100644 --- a/src/views/statisticalCenter/monitoringTop.vue +++ b/src/views/statisticalCenter/monitoringTop.vue @@ -27,7 +27,6 @@ const { list } = defineProps({ default: () => [], }, }); -console.log(list, "list1111"); diff --git a/src/views/synthesizeManage/deviceInfo/index.vue b/src/views/synthesizeManage/deviceInfo/index.vue index 87d92f2..03a3597 100644 --- a/src/views/synthesizeManage/deviceInfo/index.vue +++ b/src/views/synthesizeManage/deviceInfo/index.vue @@ -143,10 +143,10 @@ const changeWarningPage = (val: number) => { paging1.page = val; getWarningData(); }; -const toIncidentDispose = (deviceId: string) => { +const toIncidentDispose = (id: string) => { router.push({ path: "/incidentDispose", - query: { deviceId }, + query: { id }, }); }; diff --git a/src/views/synthesizeManage/deviceManage/index.vue b/src/views/synthesizeManage/deviceManage/index.vue index 9cfcfb7..824db35 100644 --- a/src/views/synthesizeManage/deviceManage/index.vue +++ b/src/views/synthesizeManage/deviceManage/index.vue @@ -88,12 +88,39 @@ const editOp = [ ]; // 查询相关 -const query = reactive({ - name: "", -}); +const query = reactive({}); const searchOpt = ref([ - { type: "input", label: "手铐SN:", prop: "name" }, - { type: "input", label: "警察账号:", prop: "name1" }, + { type: "input", label: "手铐SN:", prop: "deviceId" }, + { type: "input", label: "警察名称:", prop: "name" }, + { + type: "select", + label: "当前模式:", + prop: "mode", + opts: [ + { label: "常规", value: "0" }, + { label: "审讯", value: "1" }, + { label: "户外押送", value: "2" }, + ], + }, + { + type: "select", + label: "设备状态:", + prop: "status", + opts: [ + { label: "离线", value: "0" }, + { label: "在线", value: "1" }, + { label: "充电中", value: "2" }, + ], + }, + { + type: "select", + label: "使用状态:", + prop: "useStatus", + opts: [ + { label: "未使用", value: "0" }, + { label: "使用中", value: "1" }, + ], + }, ]); const handleSearch = () => { changePage(1); @@ -103,19 +130,18 @@ const handleSearch = () => { let columns = ref([ { type: "selection" }, { type: "index", label: "序号", width: 55, align: "center" }, - { prop: "deviceId", label: "手铐IMEI" }, - { prop: "name", label: "绑定警察名称" }, - { prop: "username", label: "绑定警察账户" }, - { prop: "battery", label: "电量" }, - { prop: "deviceVersion", label: "版本号" }, - { prop: "status", label: "设备状态" }, - { prop: "mode", label: "当前模式" }, - { prop: "useStatus", label: "使用状态" }, - { prop: "deviceSwitch", label: "启用开关" }, - { prop: "orgName", label: "关联辖区编号" }, - { prop: "createTime", label: "最新通信时间" }, - { prop: "createTime", label: "创建时间" }, - + { prop: "deviceId", label: "手铐IMEI", width: 120 }, + { prop: "adminName", label: "绑定警察名称", width: 180 }, + { prop: "adminUsername", label: "绑定警察账户", width: 120 }, + { prop: "battery", label: "电量", width: 100 }, + { prop: "deviceVersion", label: "版本号", width: 100 }, + { prop: "status", label: "设备状态", width: 100 }, + { prop: "mode", label: "当前模式", width: 100 }, + { prop: "useStatus", label: "使用状态", width: 100 }, + { prop: "deviceSwitch", label: "启用开关", width: 100 }, + { prop: "orgName", label: "关联辖区编号", width: 120 }, + { prop: "createTime", label: "最新通信时间", width: 180 }, + { prop: "createTime", label: "创建时间", width: 180 }, { prop: "operator", label: "操作", width: 400 }, ]); const paging = reactive({ @@ -130,7 +156,7 @@ const controlForm = reactive({ const tableData = ref([]); const getData = async () => { - const res = await deviceList(paging); + const res = await deviceList({ ...paging, ...query }); tableData.value = res.records; paging.total = res.total; }; diff --git a/src/views/synthesizeManage/userManage/index.vue b/src/views/synthesizeManage/userManage/index.vue index db4b68a..b7cfe63 100644 --- a/src/views/synthesizeManage/userManage/index.vue +++ b/src/views/synthesizeManage/userManage/index.vue @@ -11,14 +11,14 @@ -