设备详情修改

This commit is contained in:
tx 2025-01-07 15:18:47 +08:00
parent 7a757572a6
commit 32eaeea1f7
3 changed files with 59 additions and 45 deletions

View File

@ -5,8 +5,8 @@ VUE_APP_TITLE = 共享空间
ENV = 'development'
# 共享空间/开发环境
VUE_APP_BASE_API = 'https://testcha.chuangtewl.com/prod-api'
# VUE_APP_BASE_API = 'http://localhost:8089'
# VUE_APP_BASE_API = 'https://testcha.chuangtewl.com/prod-api'
VUE_APP_BASE_API = 'http://192.168.2.43:8089'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -9,7 +9,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="MAC" prop="mac">
<el-form-item label="MAC" prop="mac" v-if="!queryParams.mac">
<el-input
v-model="queryParams.mac"
placeholder="请输入mac"
@ -17,7 +17,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="SN" prop="sn">
<el-form-item label="SN" prop="sn" v-if="!queryParams.mac">
<el-input
v-model="queryParams.sn"
placeholder="请输入sn"
@ -143,6 +143,7 @@ import { listCommandLog, getCommandLog, delCommandLog, addCommandLog, updateComm
export default {
name: "CommandLog",
dicts: ['onenet_call_status'],
props:['mac'],
data() {
return {
//
@ -169,7 +170,7 @@ export default {
pageSize: 10,
url: null,
command: null,
mac: null,
mac: this.mac,
sn: null,
orderNo: null,
result: null

View File

@ -109,9 +109,11 @@
<div class="info-item">
<span class="label">房间名称:</span>
<template v-if="isEditing">
<el-input v-model="editForm.roomName" size="small" class="edit-input" disabled></el-input>
<el-input v-model="editForm.room.roomName" size="small" class="edit-input" disabled></el-input>
</template>
<span v-else class="value">{{ deviceData.monthFee || '--' }}</span>
<router-link v-else :to="'/system/roomDetail/index/' + deviceData.room.roomId" class="link-type">
<span>{{ deviceData.room.roomName || '--' }}</span>
</router-link>
</div>
</el-col>
<el-col :span="8">
@ -120,20 +122,18 @@
<template v-if="isEditing">
<el-input v-model="editForm.storeName" size="small" class="edit-input" disabled></el-input>
</template>
<span v-else class="value">{{ deviceData.storeName || '--' }}</span>
<router-link v-else :to="'/system/storeDetail/index/' + deviceData.storeId" class="link-type">
<span>{{ deviceData.storeName || '--' }}</span>
</router-link>
</div>
<div class="info-item">
<span class="label">绑定设施:</span>
<template v-if="isEditing">
<el-select v-model="editForm.serviceRate" size="small" class="edit-input" disabled>
<el-option v-for="option in facilityOptions" :key="option.dictValue" :label="option.dictLabel"
:value="option.dictValue">
</el-option>
</el-select>
<el-input v-model="editForm.equ.name" size="small" class="edit-input" disabled></el-input>
</template>
<span v-else class="value">
<el-tag size="small" type="primary">{{ facilityTag }}</el-tag>
</span>
<router-link v-else :to="'/system/equipmentDetail/index/' + deviceData.equ.equipmentId" class="link-type">
<span>{{ deviceData.equ.name }}</span>
</router-link>
</div>
</el-col>
<el-col :span="8">
@ -142,7 +142,9 @@
<template v-if="isEditing">
<el-input v-model="editForm.userName" size="small" class="edit-input" disabled></el-input>
</template>
<span v-else class="value">{{ deviceData.userName || '--' }}</span>
<router-link v-else :to="'/user/detail/' + deviceData.userId" class="link-type">
<span>{{ deviceData.userName || '--' }}</span>
</router-link>
</div>
<div class="info-item">
<span class="label">备注:</span>
@ -180,21 +182,21 @@
<span class="label">最后在线时间:</span>
<span class="value">{{ deviceData.lastOnlineTime || '--' }}</span>
</div>
<div class="info-item">
<!-- <div class="info-item">
<span class="label">总用电量:</span>
<span class="value">{{ deviceData.totalElectriQuantity || '--' }} </span>
</div>
</div> -->
</el-col>
<el-col :span="8">
<div class="info-item">
<span class="label">版本号:</span>
<span class="value">{{ deviceData.version || '--' }}</span>
</div>
<div class="info-item">
<!-- <div class="info-item">
<span class="label">电量读数:</span>
<span class="value">{{ deviceData.electricity || '--' }} </span>
<el-link type="primary" :underline="false">重置</el-link>
</div>
</div> -->
</el-col>
</el-row>
</el-card>
@ -202,7 +204,7 @@
<!-- 右侧信息 -->
<el-col class="right-section">
<el-card class="info-card" shadow="always">
<!-- <el-card class="info-card" shadow="always">
<div slot="header" class="card-header">
<span>分成信息</span>
</div>
@ -214,36 +216,36 @@
<span class="label">分成比例:</span>
<span class="value">{{ deviceData.serviceFeeProportion || '--' }} %</span>
</div>
</el-card>
</el-card> -->
<el-card class="info-card" shadow="always">
<div slot="header" class="card-header">
<span>实时信息</span>
</div>
<div class="info-item">
<!-- <div class="info-item">
<span class="label">时长(数据库):</span>
<span class="value">{{ deviceData.remainTime || '--' }} </span>
</div>
<div class="info-item">
<span class="label">电量(数据库):</span>
<span class="value">{{ deviceData.electricity || '--' }} </span>
</div>
</div> -->
<div class="info-item">
<span class="label">电压:</span>
<span class="value">{{ deviceData.voltage || '--' }} V</span>
</div>
<div class="info-item">
<span class="label">电流:</span>
<span class="value">{{ deviceData.realTimePower || '--' }} A</span>
<span class="value">{{ deviceData.electricity || '--' }} A</span>
</div>
<div class="info-item">
<span class="label">功率:</span>
<span class="value">{{ deviceData.realTimePower || '--' }} W</span>
<span class="value">{{ deviceData.realTimePower || '--' }} KW</span>
</div>
<div class="info-item">
<!-- <div class="info-item">
<span class="label">电压系数:</span>
<span class="value">{{ deviceData.placementStatus || '--' }}</span>
</div>
</div> -->
</el-card>
<!-- 操作台 -->
@ -253,16 +255,16 @@
</div>
<div class="operation-buttons">
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(deviceData)">修改</el-button> -->
<el-button v-if="deviceData.status != '3'" size="mini" type="text" icon="el-icon-unlock"
<el-button v-if="deviceData.status != '3'" type="primary" plain icon="el-icon-unlock"
@click="handleUnlocking(deviceData)">打开</el-button>
<el-button size="mini" type="text" icon="el-icon-lock" @click="handleLock(deviceData)">关闭</el-button>
<el-button v-if="deviceData.status != '0'" size="mini" type="text" icon="el-icon-check"
<el-button type="primary" plain icon="el-icon-lock" @click="handleLock(deviceData)">关闭</el-button>
<el-button v-if="deviceData.status != '0'" icon="el-icon-check" type="primary" plain
@click="handleOnline(deviceData)">
{{ deviceData.status === '8' ? '解禁' : '禁用' }}
</el-button>
<el-button size="mini" type="text" icon="el-icon-refresh" @click="reboot(deviceData)">重启</el-button>
<el-button size="mini" type="text" icon="el-icon-refresh" @click="refresh(deviceData)">更新</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(deviceData)">删除</el-button>
<el-button type="primary" plain icon="el-icon-refresh" @click="reboot(deviceData)">重启</el-button>
<el-button type="primary" plain icon="el-icon-refresh" @click="refresh(deviceData)">更新</el-button>
<el-button type="primary" plain icon="el-icon-delete" @click="handleDelete(deviceData)">删除</el-button>
</div>
</el-card>
</el-col>
@ -270,12 +272,16 @@
<!-- 下半部分 -->
<el-tabs v-model="activeTab" class="detail-tabs">
<el-tab-pane label="套餐列表" name="packages">
<!-- 套餐列表搜索表单 -->
<!-- <el-tab-pane label="套餐列表" name="packages">
<Role :userId="deviceData.userId"></Role>
</el-tab-pane> -->
<el-tab-pane label="命令日志" name="logs">
<!-- 套餐列表搜索表单 -->
<Log :mac="deviceData.mac"></Log>
</el-tab-pane>
<el-tab-pane label="订单列表" name="orders">订单列表内容</el-tab-pane>
<el-tab-pane label="命令日志" name="logs">命令日志内容</el-tab-pane>
<!-- <el-tab-pane label="订单列表" name="orders">订单列表内容</el-tab-pane>
<el-tab-pane label="命令日志" name="logs">命令日志内容</el-tab-pane> -->
</el-tabs>
<el-dialog title="绑定设施" :visible.sync="bindFacilityDialogVisible" width="900px" append-to-body>
@ -381,13 +387,12 @@ import { listEquipment } from "@/api/system/equipment"
import QrCode from '@/components/QrCode/index.vue'
import QRCode from 'qrcode'
import Role from '@/views/system/rule/index.vue'
import Log from '@/views/system/commandLog/index.vue'
export default {
name: "DeviceDetail",
components: {
QrCode,
Role
},
QrCode,Role,Log
},
dicts: ['ss_equipment_type', 'ss_equipment_status', 'ss_user_type'],
data() {
return {
@ -442,7 +447,7 @@ export default {
},
//
activeTab: 'packages',
activeTab: 'logs',
searchForm: {
userName: '',
userPhone: '',
@ -713,7 +718,15 @@ export default {
<style lang="scss" scoped>
.device-detail {
padding: 20px;
.link-type {
color: #11A983;
text-decoration: underline;
}
.link-type:hover {
color: #11A98330;
text-decoration: underline;
}
.top-section {
display: flex;
align-items: stretch;
@ -807,7 +820,7 @@ export default {
.el-button {
margin: 0;
padding: 0 10px;
// padding: 0 10px;
flex: 1 1 45%;
}
}