修改测试bug

This commit is contained in:
GGJ
2024-12-09 16:30:40 +08:00
parent 2ed728ee71
commit 22d85dfca1
30 changed files with 499 additions and 221 deletions

View File

@@ -3,7 +3,7 @@
<div class="default-main device-manage" :style="{ height: pageHeight.height }" v-loading="loading">
<DeviceTree @node-click="nodeClick" @init="nodeClick" @deviceTypeChange="deviceTypeChange"></DeviceTree>
<div class="device-manage-right" v-if="deviceData">
<el-descriptions title="设备基本信息" class="mb10" :column="3" border>
<el-descriptions title="基础信息" class="mb10" :column="3" border>
<template #extra>
<!-- <el-button
type="primary"
@@ -13,6 +13,10 @@
>
模版数据分组
</el-button> -->
<el-button icon="el-icon-Refresh" @click="handleRestartDevice" type="primary"
:loading="deviceRestartLoading">
装置重启
</el-button>
</template>
<el-descriptions-item label="名称">
{{ deviceData.name }}
@@ -44,13 +48,8 @@
</el-descriptions-item>
</el-descriptions>
<el-tabs v-model="dataSet" type="border-card" class="device-manage-box-card" @tab-click="handleClick">
<el-tab-pane
lazy
:label="item.name"
:name="item.id"
v-for="(item, index) in deviceData.dataSetList"
:key="index"
></el-tab-pane>
<el-tab-pane lazy :label="item.name" :name="item.id" v-for="(item, index) in deviceData.dataSetList"
:key="index"></el-tab-pane>
<div :style="{ height: tableHeight }" v-loading="tableLoading">
<vxe-table v-bind="defaultAttribute" :data="tableData" height="auto" style="width: 100%">
<vxe-column type="seq" title="序号" width="80"></vxe-column>
@@ -73,6 +72,7 @@
defineOptions({
name: 'govern/device/manage'
})
import MangePopup from './popup.vue'
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
import { mainHeight } from '@/utils/layout'
@@ -81,10 +81,18 @@ import { getDeviceData } from '@/api/cs-device-boot/EquipmentDelivery'
import { getTargetById } from '@/api/cs-device-boot/csDataArray'
import { getGroup } from '@/api/cs-device-boot/csGroup'
import { ref } from 'vue'
import { ElMessage } from 'element-plus'
import { useAdminInfo } from '@/stores/adminInfo'
import { passwordConfirm } from '@/api/user-boot/user'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
reStartDevice,
} from '@/api/cs-device-boot/fileService'
import { defaultAttribute } from '@/components/table/defaultAttribute'
const pageHeight = mainHeight(20)
const loading = ref(true)
const nDid = ref<string>('')
const tableLoading = ref(false)
const getGroupLoading = ref(false)
const deviceData = ref<any>(null)
@@ -97,9 +105,10 @@ const mangePopup = ref()
const activeName = ref(0)
//治理设备和便携式设备切换判断
const deviceType = ref('0')
const deviceTypeChange=(val: any, obj: any)=>{
const deviceTypeChange = (val: any, obj: any) => {
deviceType.value = val
nodeClick(obj)
}
// 树节点点击
const nodeClick = (e: anyObj) => {
@@ -108,8 +117,9 @@ const nodeClick = (e: anyObj) => {
return
}
if (e.level == 2) {
nDid.value = e.ndid
loading.value = true
getDeviceData(e.id, 'rt','').then((res: any) => {
getDeviceData(e.id, 'rt', '').then((res: any) => {
deviceData.value = res.data
loading.value = false
if (!res.data.dataSetList) {
@@ -186,18 +196,60 @@ const openGroup = () => {
})
})
}
//装置重启
const deviceRestartLoading = ref<boolean>(false)
const handleRestartDevice = () => {
deviceRestartLoading.value = true
ElMessageBox.prompt('二次校验密码确认', '装置重启', {
confirmButtonText: '确认',
cancelButtonText: '取消',
customClass: 'customInput',
inputType: 'text'
})
.then(({ value }) => {
if (!value) {
ElMessage.warning('请输入密码')
deviceRestartLoading.value = false
} else {
passwordConfirm(value)
.then((resp: any) => {
if (resp.code == 'A0000') {
reStartDevice({ nDid: nDid.value }).then((res: any) => {
deviceRestartLoading.value = false
ElMessage({ message: res.message, type: 'success', duration: 3000 })
}).catch(e => {
deviceRestartLoading.value = false
})
}
})
.catch(e => {
deviceRestartLoading.value = false
})
}
})
.catch(() => {
deviceRestartLoading.value = false
})
}
</script>
<style lang="scss">
.device-manage {
display: flex;
&-left {
width: 280px;
}
&-right {
overflow: hidden;
flex: 1;
padding: 10px 10px 10px 0;
.el-descriptions__header {
height: 36px;
margin-bottom: 7px;
@@ -206,4 +258,10 @@ const openGroup = () => {
}
}
}
.customInput {
.el-input__inner {
-webkit-text-security: disc !important;
}
}
</style>