更新
This commit is contained in:
@@ -4,6 +4,7 @@ VITE_SERVER_PORT = 8888
|
||||
VITE_BASE_API = /api
|
||||
VITE_FILE_API = /api
|
||||
# VITE_BASE_PATH = http://192.168.1.9:8888
|
||||
# VITE_BASE_PATH = http://192.168.110.98:8888
|
||||
VITE_BASE_PATH = https://www.xingoil.com/api
|
||||
VITE_POSITION = open
|
||||
VITE_EDITOR = code
|
||||
|
||||
9
src/api/equipment/alarmRecord.js
Normal file
9
src/api/equipment/alarmRecord.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import service from '@/utils/request'
|
||||
|
||||
export const getDeviceWarnList = (data) => {
|
||||
return service({
|
||||
url: '/device/getDeviceWarnList',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -15,3 +15,11 @@ export const deviceOperation = (data) => {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getDeviceDetailsInfoByRemote = (data) => {
|
||||
return service({
|
||||
url: '/device/getDeviceDetailsInfoByRemote',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"/src/view/dashboard/components/table.vue": "Table",
|
||||
"/src/view/dashboard/components/wiki.vue": "Wiki",
|
||||
"/src/view/dashboard/index.vue": "Dashboard",
|
||||
"/src/view/equipment/alarmRecord/index.vue": "Index",
|
||||
"/src/view/equipment/gateway/index.vue": "Index",
|
||||
"/src/view/equipment/list/index.vue": "Index",
|
||||
"/src/view/equipment/particulars/index.vue": "Index",
|
||||
|
||||
@@ -108,7 +108,7 @@ export const useAppStore = defineStore('app', () => {
|
||||
layout_side_width: 256,
|
||||
layout_side_collapsed_width: 80,
|
||||
layout_side_item_height: 48,
|
||||
show_watermark: true,
|
||||
show_watermark: false,
|
||||
side_mode: 'normal',
|
||||
// 页面过渡动画配置
|
||||
transition_type: 'slide'
|
||||
|
||||
@@ -135,3 +135,39 @@ html.dark {
|
||||
--el-fill-color-light: rgb(15, 23, 42);
|
||||
--el-fill-color: rgb(15, 23, 42);
|
||||
}
|
||||
|
||||
html.dark.login-light-mode {
|
||||
--el-bg-color: #ffffff !important;
|
||||
--el-bg-color-overlay: #ffffff !important;
|
||||
--el-text-color-primary: #303133 !important;
|
||||
--el-text-color-regular: #606266 !important;
|
||||
--el-text-color-secondary: #909399 !important;
|
||||
--el-text-color-placeholder: #a8abb2 !important;
|
||||
--el-border-color: #dcdfe6 !important;
|
||||
--el-border-color-light: #e4e7ed !important;
|
||||
--el-border-color-lighter: #ebeef5 !important;
|
||||
--el-fill-color: #f5f7fa !important;
|
||||
--el-fill-color-light: #f5f7fa !important;
|
||||
--el-fill-color-lighter: #fafafa !important;
|
||||
--el-fill-color-blank: #ffffff !important;
|
||||
--el-input-bg-color: #ffffff !important;
|
||||
--el-input-border-color: #dcdfe6 !important;
|
||||
--el-input-hover-border-color: #c0c4cc !important;
|
||||
--el-input-focus-border-color: #409eff !important;
|
||||
--el-input-text-color: #303133 !important;
|
||||
--el-input-placeholder-text-color: #a8abb2 !important;
|
||||
--el-button-bg-color: #ffffff !important;
|
||||
--el-button-border-color: #dcdfe6 !important;
|
||||
--el-button-text-color: #606266 !important;
|
||||
--el-button-hover-bg-color: #ecf5ff !important;
|
||||
--el-button-hover-border-color: #c6e2ff !important;
|
||||
--el-button-hover-text-color: #409eff !important;
|
||||
--el-button-active-bg-color: #3a8ee6 !important;
|
||||
--el-button-active-border-color: #3a8ee6 !important;
|
||||
--el-button-active-text-color: #ffffff !important;
|
||||
--el-button-disabled-bg-color: #f5f7fa !important;
|
||||
--el-button-disabled-border-color: #e4e7ed !important;
|
||||
--el-button-disabled-text-color: #a0cff4 !important;
|
||||
--el-form-label-font-size: 14px !important;
|
||||
--el-form-border-color-hover: #409eff !important;
|
||||
}
|
||||
|
||||
121
src/view/equipment/alarmRecord/index.vue
Normal file
121
src/view/equipment/alarmRecord/index.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <warning-bar title="注:右上角头像下拉可切换角色" /> -->
|
||||
<div class="gva-search-box">
|
||||
<el-form ref="searchForm" :inline="true" :model="searchInfo">
|
||||
<el-form-item label="用户名">
|
||||
<el-input v-model="searchInfo.username" placeholder="设备ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="昵称">
|
||||
<el-input v-model="searchInfo.nickname" placeholder="设备状态" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="search" @click="onSubmit"> 查询 </el-button>
|
||||
<el-button icon="refresh" @click="onReset"> 重置 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="gva-table-box">
|
||||
<div class="gva-btn-list">
|
||||
<el-button type="primary" icon="plus" @click="addUser">新增用户</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData">
|
||||
<el-table-column align="left" label="网关ID" prop="gatewayId" width="200" />
|
||||
<el-table-column align="left" label="设备号" prop="imei" width="200" />
|
||||
<el-table-column align="left" label="网关mac" prop="gatewayMac" width="200" />
|
||||
<el-table-column align="left" label="网关地址" prop="gatewayAddress" />
|
||||
<el-table-column align="left" label="经纬度" width="250">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.gatewayLong }}</span>
|
||||
<el-divider direction="vertical" />
|
||||
<span>{{ scope.row.gatewayLat }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="gva-pagination">
|
||||
<el-pagination
|
||||
:current-page="page"
|
||||
:page-size="pageSize"
|
||||
:page-sizes="[10, 30, 50, 100]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="handleCurrentChange"
|
||||
@size-change="handleSizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import * as serve from '@/api/equipment/alarmRecord'
|
||||
|
||||
import { nextTick, ref, watch, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
// import { id } from 'element-plus/es/locale'
|
||||
import { useAppStore } from '@/pinia'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
const searchInfo = ref({
|
||||
username: '',
|
||||
nickname: '',
|
||||
phone: '',
|
||||
email: ''
|
||||
})
|
||||
|
||||
const page = ref(1)
|
||||
const total = ref(0)
|
||||
const pageSize = ref(10)
|
||||
const tableData = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
})
|
||||
|
||||
// 分页
|
||||
const handleSizeChange = (val) => {
|
||||
pageSize.value = val
|
||||
getTableData()
|
||||
}
|
||||
const handleCurrentChange = (val) => {
|
||||
page.value = val
|
||||
getTableData()
|
||||
}
|
||||
// 查询
|
||||
const getTableData = async () => {
|
||||
const table = await serve.getDeviceWarnList({
|
||||
page: page.value,
|
||||
pageSize: pageSize.value,
|
||||
...searchInfo.value
|
||||
})
|
||||
if (table.code === 0) {
|
||||
tableData.value = table.data.list
|
||||
total.value = table.data.total
|
||||
page.value = table.data.page
|
||||
pageSize.value = table.data.pageSize
|
||||
}
|
||||
}
|
||||
|
||||
const onSubmit = () => {
|
||||
page.value = 1
|
||||
getTableData()
|
||||
}
|
||||
|
||||
const onReset = () => {
|
||||
searchInfo.value = {
|
||||
username: '',
|
||||
nickname: '',
|
||||
phone: '',
|
||||
email: ''
|
||||
}
|
||||
getTableData()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.header-img-box {
|
||||
@apply w-52 h-52 border border-solid border-gray-300 rounded-xl flex justify-center items-center cursor-pointer;
|
||||
}
|
||||
</style>
|
||||
@@ -31,11 +31,11 @@
|
||||
{{ row.cbId || '未设置' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="项目ID" prop="projectId">
|
||||
<!-- <el-table-column align="left" label="项目ID" prop="projectId">
|
||||
<template #default="{ row }">
|
||||
{{ row.projectId || '未设置' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column align="left" label="网关ID" prop="gatewayId">
|
||||
<template #default="{ row }">
|
||||
{{ row.gatewayId || '未设置' }}
|
||||
@@ -48,6 +48,13 @@
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="锁定状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="['success', 'info', 'danger'][row.lockStatus]">{{
|
||||
['正常', '远程合闸禁止', '锁定'][row.lockStatus]
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="网络">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.netStatus == 1 ? 'primary' : 'info'">{{ row.netStatus == 1 ? '在线' : '离线' }}</el-tag>
|
||||
@@ -55,20 +62,44 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="设备类型名称" prop="cbTypeName" />
|
||||
<el-table-column align="left" label="网关mac" prop="gatewayMac" />
|
||||
|
||||
<el-table-column align="left" label="协议" prop="protocol" />
|
||||
<el-table-column align="left" label="品牌" prop="brand" />
|
||||
|
||||
<el-table-column align="left" label="安装时间" prop="createTime">
|
||||
<template #default="{ row }">
|
||||
{{ row.createTime || '未设置' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<el-table-column label="操作" fixed="right" width="240">
|
||||
<template #default="{ row }">
|
||||
<el-link v-if="row.deviceStatus == 1" underline="never" type="primary" @click="changeStatus(row)"
|
||||
>分闸</el-link
|
||||
>
|
||||
<el-link v-else underline="never" type="primary" @click="changeStatus(row)">合闸</el-link>
|
||||
<!-- <el-button type="primary" link icon="delete" @click="deleteUserFunc(row)">删除</el-button> -->
|
||||
<!-- <el-button type="primary" link icon="edit" @click="openEdit(row)">编辑</el-button> -->
|
||||
<span class="action-buttons">
|
||||
<el-button v-if="row.deviceStatus == 1" type="primary" link icon="SortUp" @click="changeStatus(row)">
|
||||
分闸
|
||||
</el-button>
|
||||
<el-button v-else type="primary" link icon="SortDown" @click="changeStatus(row)">合闸</el-button>
|
||||
<el-button v-if="[1].includes(row.lockStatus)" type="primary" link icon="Unlock" @click="unlock(row)">
|
||||
解锁
|
||||
</el-button>
|
||||
<el-dropdown>
|
||||
<span class="el-dropdown-link">
|
||||
更多
|
||||
<el-icon class="el-icon--right">
|
||||
<arrow-down />
|
||||
</el-icon>
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item>
|
||||
<el-button type="primary" link icon="Odometer" @click="updateParticulars(row)">
|
||||
实时数据
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -109,7 +140,35 @@
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
})
|
||||
|
||||
// 解锁
|
||||
const unlock = async (row) => {
|
||||
ElMessageBox.confirm('确认解锁吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const res = await serve.deviceOperation({
|
||||
id: row.ID,
|
||||
gatewayId: row.gatewayId,
|
||||
para: '0xAD'
|
||||
})
|
||||
if (res.code === 0) {
|
||||
ElMessage.success('操作成功')
|
||||
getTableData()
|
||||
}
|
||||
})
|
||||
}
|
||||
// 更新
|
||||
const updateParticulars = async (row) => {
|
||||
const res = await serve.getDeviceDetailsInfoByRemote({
|
||||
deviceId: row.ID
|
||||
})
|
||||
if (res.code === 0) {
|
||||
ElMessage.success('更新成功')
|
||||
} else {
|
||||
// ElMessage.error(res.msg || '更新失败')
|
||||
}
|
||||
}
|
||||
// 合分闸
|
||||
const changeStatus = (row) => {
|
||||
ElMessageBox.confirm(row.deviceStatus == 1 ? '确认分闸吗?' : '确认合闸吗?', '提示', {
|
||||
@@ -166,8 +225,20 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.header-img-box {
|
||||
@apply w-52 h-52 border border-solid border-gray-300 rounded-xl flex justify-center items-center cursor-pointer;
|
||||
}
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
.el-dropdown-link {
|
||||
cursor: pointer;
|
||||
color: var(--el-color-primary);
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -21,9 +21,10 @@
|
||||
<!-- <el-button type="primary" icon="plus" @click="addUser">新增用户</el-button> -->
|
||||
</div>
|
||||
<el-table :data="tableData" row-key="ID">
|
||||
<el-table-column align="left" label="设备ID" prop="deviceId"> </el-table-column>
|
||||
<el-table-column align="left" label="运行时长" prop="runtime">
|
||||
<template #default="{ row }">
|
||||
{{ row.runtime || '' }}
|
||||
<span>{{ row.runtime || '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="信号质量" prop="signalQuality">
|
||||
@@ -31,7 +32,12 @@
|
||||
{{ row.signalQuality || '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="漏电流值" prop="leakageCurrent">
|
||||
<el-table-column align="left" label="电压(V)" prop="leakageCurrent">
|
||||
<template #default="{ row }">
|
||||
{{ row.leakageCurrent || '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="漏电流值(mA)" prop="leakageCurrent">
|
||||
<template #default="{ row }">
|
||||
{{ row.leakageCurrent || '' }}
|
||||
</template>
|
||||
@@ -41,36 +47,31 @@
|
||||
{{ row.cumulativeElectricity || '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="电流值" prop="current">
|
||||
<el-table-column align="left" label="电流值(A)" prop="current">
|
||||
<template #default="{ row }">
|
||||
{{ row.current || '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="功率因数" prop="powerFactor">
|
||||
<template #default="{ row }">
|
||||
{{ row.powerFactor || '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="内部温度" prop="internalTemperature">
|
||||
<el-table-column align="left" label="内部温度(℃)" prop="internalTemperature">
|
||||
<template #default="{ row }">
|
||||
{{ row.internalTemperature || '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="N相下端温度" prop="nLowerTemperature">
|
||||
<el-table-column align="left" label="N相下端温度(℃)" prop="nLowerTemperature">
|
||||
<template #default="{ row }">
|
||||
{{ row.nLowerTemperature || '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="功率因数" prop="powerFactor">
|
||||
<el-table-column align="left" label="功率因数(%)" prop="powerFactor">
|
||||
<template #default="{ row }">
|
||||
{{ row.powerFactor || '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template #default="scope">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button type="primary" link icon="delete" @click="deleteUserFunc(scope.row)">删除</el-button> -->
|
||||
<!-- <el-button type="primary" link icon="edit" @click="openEdit(scope.row)">编辑</el-button> -->
|
||||
<!-- <el-button type="primary" link icon="Tickets" @click="openDetails(row)">查看</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div id="userLayout" class="w-full h-full relative">
|
||||
<div id="userLayout" class="w-full h-full relative login-light-mode">
|
||||
<div
|
||||
class="rounded-lg flex items-center justify-evenly w-full h-full md:w-screen md:h-screen md:bg-[#194bfb] bg-white"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user