更新
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
<!-- <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 label="设备状态">
|
||||
<el-select v-model="searchInfo.deviceStatus" placeholder="请选择">
|
||||
<el-option label="合闸" :value="1" />
|
||||
<el-option label="分闸" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
@@ -26,32 +26,49 @@
|
||||
<CustomPic style="margin-top: 8px" :pic-src="scope.row.headerImg" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column align="left" label="设备ID" prop="cbId" />
|
||||
<el-table-column align="left" label="项目ID" prop="projectId" />
|
||||
<el-table-column align="left" label="网关ID" prop="gatewayId" />
|
||||
<el-table-column align="left" label="设备ID" prop="cbId">
|
||||
<template #default="{ row }">
|
||||
{{ row.cbId || '未设置' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="项目ID" prop="projectId">
|
||||
<template #default="{ row }">
|
||||
{{ row.projectId || '未设置' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="网关ID" prop="gatewayId">
|
||||
<template #default="{ row }">
|
||||
{{ row.gatewayId || '未设置' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="设备状态">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.deviceStatus == 1 ? 'success' : 'danger'">{{
|
||||
scope.row.deviceStatus == 1 ? '合闸' : '分闸'
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.cbTypeName !== 'T30'" :type="row.deviceStatus == 1 ? 'success' : 'danger'">{{
|
||||
row.deviceStatus == 1 ? '合闸' : '分闸'
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="网络">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.netStatus == 1 ? 'primary' : 'info'">{{
|
||||
scope.row.netStatus == 1 ? '在线' : '离线'
|
||||
}}</el-tag>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.netStatus == 1 ? 'primary' : 'info'">{{ row.netStatus == 1 ? '在线' : '离线' }}</el-tag>
|
||||
</template>
|
||||
</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="createTime" />
|
||||
<el-table-column align="left" label="安装时间" prop="createTime">
|
||||
<template #default="{ row }">
|
||||
{{ row.createTime || '未设置' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-link underline="never" type="primary" @click="changeStatus(scope.row)">合分闸</el-link>
|
||||
<!-- <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> -->
|
||||
<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> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -81,10 +98,7 @@
|
||||
const appStore = useAppStore()
|
||||
|
||||
const searchInfo = ref({
|
||||
username: '',
|
||||
nickname: '',
|
||||
phone: '',
|
||||
email: ''
|
||||
deviceStatus: ''
|
||||
})
|
||||
|
||||
const page = ref(1)
|
||||
@@ -98,7 +112,7 @@
|
||||
|
||||
// 合分闸
|
||||
const changeStatus = (row) => {
|
||||
ElMessageBox.confirm(row.deviceStatus == 1 ? '确认合闸吗?' : '确认分闸吗?', '提示', {
|
||||
ElMessageBox.confirm(row.deviceStatus == 1 ? '确认分闸吗?' : '确认合闸吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@@ -146,10 +160,7 @@
|
||||
|
||||
const onReset = () => {
|
||||
searchInfo.value = {
|
||||
username: '',
|
||||
nickname: '',
|
||||
phone: '',
|
||||
email: ''
|
||||
deviceStatus: ''
|
||||
}
|
||||
getTableData()
|
||||
}
|
||||
|
||||
119
src/view/equipment/particulars/index.vue
Normal file
119
src/view/equipment/particulars/index.vue
Normal file
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <warning-bar title="注:右上角头像下拉可切换角色" /> -->
|
||||
<div class="gva-search-box">
|
||||
<el-form ref="searchForm" :inline="true" :model="searchInfo">
|
||||
<el-form-item label="设备状态">
|
||||
<!-- <el-select v-model="searchInfo.deviceStatus" placeholder="请选择">
|
||||
<el-option label="合闸" :value="1" />
|
||||
<el-option label="分闸" :value="0" />
|
||||
</el-select> -->
|
||||
</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" row-key="ID">
|
||||
<el-table-column align="left" label="运行时长" prop="runtime"> </el-table-column>
|
||||
<el-table-column align="left" label="信号质量" prop="signalQuality"> </el-table-column>
|
||||
<el-table-column align="left" label="漏电流值" prop="leakageCurrent"> </el-table-column>
|
||||
<el-table-column align="left" label="累计用电量" prop="cumulativeElectricity" />
|
||||
<el-table-column align="left" label="电流值" prop="current" />
|
||||
<el-table-column align="left" label="功率因数" prop="powerFactor"> </el-table-column>
|
||||
<el-table-column align="left" label="内部温度" prop="internalTemperature"> </el-table-column>
|
||||
<el-table-column align="left" label="N相下端温度" prop="nLowerTemperature"> </el-table-column>
|
||||
<el-table-column align="left" label="功率因数" prop="powerFactor"> </el-table-column>
|
||||
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- <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> -->
|
||||
</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/particulars'
|
||||
|
||||
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({
|
||||
deviceStatus: ''
|
||||
})
|
||||
|
||||
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.getDeviceDetailsListByPage({
|
||||
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 = {
|
||||
deviceStatus: ''
|
||||
}
|
||||
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>
|
||||
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<div
|
||||
class="bg-gray-50 text-slate-700 dark:text-slate-500 dark:bg-slate-800 w-screen h-screen"
|
||||
>
|
||||
<div class="bg-gray-50 text-slate-700 dark:text-slate-500 dark:bg-slate-800 w-screen h-screen">
|
||||
<el-watermark
|
||||
v-if="config.show_watermark"
|
||||
:font="font"
|
||||
@@ -20,25 +18,13 @@
|
||||
(device === 'mobile' && config.side_mode == 'combination')
|
||||
"
|
||||
/>
|
||||
<gva-aside
|
||||
v-if="config.side_mode === 'combination' && device !== 'mobile'"
|
||||
mode="normal"
|
||||
/>
|
||||
<gva-aside v-if="config.side_mode === 'combination' && device !== 'mobile'" mode="normal" />
|
||||
<div class="flex-1 w-0 h-full">
|
||||
<gva-tabs v-if="config.showTabs" />
|
||||
<div
|
||||
class="overflow-auto px-2"
|
||||
:class="config.showTabs ? 'gva-container2' : 'gva-container pt-1'"
|
||||
>
|
||||
<div class="overflow-auto px-2" :class="config.showTabs ? 'gva-container2' : 'gva-container pt-1'">
|
||||
<router-view v-if="reloadFlag" v-slot="{ Component, route }">
|
||||
<div
|
||||
id="gva-base-load-dom"
|
||||
class="gva-body-h bg-gray-50 dark:bg-slate-800"
|
||||
>
|
||||
<transition
|
||||
mode="out-in"
|
||||
:name="route.meta.transitionType || config.transition_type"
|
||||
>
|
||||
<div id="gva-base-load-dom" class="gva-body-h bg-gray-50 dark:bg-slate-800">
|
||||
<transition mode="out-in" :name="route.meta.transitionType || config.transition_type">
|
||||
<keep-alive :include="routerStore.keepAliveRouters">
|
||||
<component :is="Component" :key="route.fullPath" />
|
||||
</keep-alive>
|
||||
@@ -92,6 +78,11 @@
|
||||
if (userStore.loadingInstance) {
|
||||
userStore.loadingInstance.close()
|
||||
}
|
||||
nextTick(() => {
|
||||
document.getElementsByClassName(
|
||||
'flex flex-col md:flex-row gap-2 items-center text-sm text-slate-700 dark:text-slate-500 justify-center py-2'
|
||||
)[0].style.opacity = 0
|
||||
})
|
||||
})
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
Reference in New Issue
Block a user