main
parent
33e4edea02
commit
47e6f6ac94
|
@ -34,12 +34,12 @@
|
|||
<el-option v-for="(item, index) of typeOptions" :key="index" :label="item.name" :value="item.key" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通讯模板:" prop="template_name" >
|
||||
<el-form-item label="驱动模板:" prop="template_name" >
|
||||
<el-select
|
||||
v-model="addForm.template_name"
|
||||
value-key="name"
|
||||
clearable
|
||||
placeholder="请选择通讯模板"
|
||||
placeholder="请选择驱动模板"
|
||||
:disabled="type == '1'"
|
||||
>
|
||||
<el-option v-for="(item, index) of templateOptions" :key="index" :label="item.name" :value="item.name" />
|
||||
|
@ -48,7 +48,7 @@
|
|||
<el-form-item label="驱动描述:" prop="driver_description">
|
||||
<el-input
|
||||
v-model="addForm.driver_description"
|
||||
placeholder="请输入模板描述(不超过50个字符)"
|
||||
placeholder="请输入驱动描述(不超过50个字符)"
|
||||
clearable
|
||||
maxlength="50"
|
||||
></el-input>
|
||||
|
@ -94,7 +94,7 @@ export default {
|
|||
{ required: true, message: "请选择通讯模板", trigger: "blur" },
|
||||
],
|
||||
driver_description: [{ required: false, message: "请输入驱动描述", trigger: "blur" }],
|
||||
driver_type: [{ required: true, message: "请选择通讯驱动", trigger: "change" }]
|
||||
driver_type: [{ required: true, message: "请选择驱动类型", trigger: "change" }]
|
||||
},
|
||||
});
|
||||
const visible = computed(() => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" :title="type === 'I' ? '新增模板' : '编辑模板'" width="45%" :before-close="closeDialog">
|
||||
<el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef" size="large">
|
||||
<el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef" size="large" label-position="top">
|
||||
<el-form-item label="模板名称:" prop="template_name">
|
||||
<el-input v-model="addForm.template_name" placeholder="请输入模板名称(不超过20个字符)" maxlength="20" clearable
|
||||
:disabled="type !== 'I'" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="点位管理" width="40%" :before-close="closeDialog">
|
||||
<el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef" size="large">
|
||||
<el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef" size="large" label-position="top">
|
||||
<el-form-item label="点位名称:" prop="point_name">
|
||||
<el-input v-model="addForm.point_name" placeholder="请输入点位名称" clearable :disabled="type !== 'I'" />
|
||||
</el-form-item>
|
||||
|
@ -14,8 +14,8 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="点位类型:" prop="point_type">
|
||||
<el-select v-model="addForm.point_type" size="mini" placeholder="请选择点位类型">
|
||||
<el-option v-for="item in datatypeArr" :disabled="item.disabled || item.disabled1" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
<el-option v-for="item in datatypeArr" :disabled="item.disabled || item.disabled1" :key="item.value"
|
||||
:label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位描述:" prop="point_description">
|
||||
|
@ -23,7 +23,8 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="读写权限:" prop="point_permissions">
|
||||
<el-select v-model="addForm.point_permissions" size="mini" placeholder="请选择读写权限">
|
||||
<el-option v-for="item in perOptions" :disabled="item.disabled" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-option v-for="item in perOptions" :disabled="item.disabled" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="缩放系数:" prop="multiplier">
|
||||
|
@ -51,7 +52,10 @@ export default {
|
|||
setup(props, ctx) {
|
||||
const checkAddress = (rule, value, callback) => {
|
||||
let num = Number(value);
|
||||
if (value && (num >= 0 && num <= 65535)) {
|
||||
if (num === 0) {
|
||||
callback();
|
||||
}
|
||||
else if (value && (num > 0 && num <= 65535)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("点位地址:0-65535"));
|
||||
|
@ -170,7 +174,7 @@ export default {
|
|||
onMounted(() => {
|
||||
state.addForm = props.pointData;
|
||||
getPointData();
|
||||
changeRegister();
|
||||
props.type === 'U'? changeSelectData() : changeRegister();
|
||||
});
|
||||
|
||||
const getPointData = () => {
|
||||
|
@ -186,47 +190,65 @@ export default {
|
|||
}
|
||||
|
||||
const changeRegister = () => {
|
||||
if(state.addForm.register === 1) {
|
||||
changeSelectData();
|
||||
changeValue();
|
||||
}
|
||||
|
||||
const changeSelectData = () => {
|
||||
if (state.addForm.register === 1) {
|
||||
state.datatypeArr.forEach(ele => { // 只能选择bool
|
||||
ele.disabled1 = ele.value!== 1
|
||||
ele.disabled1 = ele.value !== 1
|
||||
})
|
||||
state.perOptions.forEach(ele => {// 可读可写
|
||||
ele.disabled = false;
|
||||
})
|
||||
state.addForm.point_type = 1;
|
||||
state.addForm.point_permissions = 1;
|
||||
}
|
||||
if(state.addForm.register === 2) {
|
||||
if (state.addForm.register === 2) {
|
||||
state.datatypeArr.forEach(ele => {// 只能选择bool
|
||||
ele.disabled1 = ele.value!== 1
|
||||
ele.disabled1 = ele.value !== 1
|
||||
})
|
||||
state.perOptions.forEach(ele => {// 只能可读
|
||||
ele.disabled = ele.value === 2;
|
||||
})
|
||||
state.addForm.point_type = 1;
|
||||
state.addForm.point_permissions = 1;
|
||||
}
|
||||
if(state.addForm.register === 3) {
|
||||
if (state.addForm.register === 3) {
|
||||
state.datatypeArr.forEach(ele => {// 不支持bool
|
||||
ele.disabled1 = ele.value === 1
|
||||
})
|
||||
state.perOptions.forEach(ele => {// 只能可读
|
||||
ele.disabled = ele.value === 2;
|
||||
})
|
||||
state.addForm.point_type = 3;
|
||||
state.addForm.point_permissions = 1;
|
||||
}
|
||||
if(state.addForm.register === 4) {
|
||||
if (state.addForm.register === 4) {
|
||||
state.datatypeArr.forEach(ele => {// 不支持bool
|
||||
ele.disabled1 = ele.value === 1
|
||||
})
|
||||
state.perOptions.forEach(ele => {// 可读可写
|
||||
ele.disabled = false;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const changeValue = () => {
|
||||
if (state.addForm.register === 1) {
|
||||
state.addForm.point_type = 1;
|
||||
state.addForm.point_permissions = 1;
|
||||
}
|
||||
if (state.addForm.register === 2) {
|
||||
state.addForm.point_type = 1;
|
||||
state.addForm.point_permissions = 1;
|
||||
}
|
||||
if (state.addForm.register === 3) {
|
||||
state.addForm.point_type = 3;
|
||||
state.addForm.point_permissions = 1;
|
||||
}
|
||||
if (state.addForm.register === 4) {
|
||||
state.addForm.point_type = 3;
|
||||
state.addForm.point_permissions = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const closeDialog = () => {
|
||||
ctx.emit("dialogClose");
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="设备管理" width="40%" :before-close="closeDialog">
|
||||
<el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef" size="large">
|
||||
<el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef" size="large" label-position="top">
|
||||
<el-form-item label="设备名称:" prop="device_name">
|
||||
<el-input v-model="addForm.device_name" placeholder="请输入设备名称(不超过20个字符)" maxlength="10" clearable
|
||||
:disabled="type !== 'I'" />
|
||||
|
@ -55,7 +55,7 @@ export default {
|
|||
{ min: 3, max: 20, message: "长度在3到20个字符", trigger: "blur" },
|
||||
{ required: true, validator: validName, trigger: "blur" },],
|
||||
device_description: [
|
||||
{ required: true, message: "请输入设备描述", trigger: "blur" }
|
||||
{ required: false, message: "请输入设备描述", trigger: "blur" }
|
||||
],
|
||||
slave_id: [
|
||||
{ required: true, message: "请输入设备ID", trigger: "blur" },
|
||||
|
|
|
@ -6,47 +6,38 @@
|
|||
<span class="name">{{ name }}</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
:width="350"
|
||||
trigger="click"
|
||||
popper-class="popper-user-box"
|
||||
>
|
||||
<el-popover placement="bottom" :width="350" trigger="click" popper-class="popper-user-box">
|
||||
<template #reference>
|
||||
<div class="author">
|
||||
<el-icon><User /></el-icon>
|
||||
<el-icon>
|
||||
<User />
|
||||
</el-icon>
|
||||
{{ (userInfo && userInfo.nickName) || "" }}
|
||||
<el-icon><CaretBottom /></el-icon>
|
||||
<el-icon>
|
||||
<CaretBottom />
|
||||
</el-icon>
|
||||
</div>
|
||||
</template>
|
||||
<div class="nickname">
|
||||
<p>登录名:{{ (userInfo && userInfo.nickName) || "" }}</p>
|
||||
<p>昵称:{{ (userInfo && userInfo.nickName) || "" }}</p>
|
||||
<el-tag effect="dark" class="reStart" @click="reStart"
|
||||
>重启设备</el-tag
|
||||
>
|
||||
<el-tag effect="dark" class="editPass" @click="editPass"
|
||||
>修改密码</el-tag
|
||||
>
|
||||
<el-tag effect="dark" class="logout" @click="logout"
|
||||
>退出登录</el-tag
|
||||
>
|
||||
<div class="btn-class">
|
||||
<el-button type="primary" size="large" @click="reStart">重启设备</el-button>
|
||||
<el-button type="primary" size="large" @click="editPass">修改密码</el-button>
|
||||
<el-button type="primary" size="large" @click="logout">退出登录</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-popover>
|
||||
</div>
|
||||
</div>
|
||||
<EditPass
|
||||
:dialogVisible="dialogVisible"
|
||||
@dialogClose="dialogClose"
|
||||
@dialogSuccess="dialogSuccess"
|
||||
></EditPass>
|
||||
<EditPass :dialogVisible="dialogVisible" @dialogClose="dialogClose" @dialogSuccess="dialogSuccess"></EditPass>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, toRefs } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { pathMap,localRemove } from "@/utils";
|
||||
import { pathMap, localRemove } from "@/utils";
|
||||
import EditPass from "@/components/EditPass.vue";
|
||||
import { useStore } from "vuex";
|
||||
import myApi from "@/api/myApi.js";
|
||||
|
@ -125,28 +116,34 @@ export default {
|
|||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.name {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-icon-back {
|
||||
border: 1px solid #e9e9e9;
|
||||
padding: 4px;
|
||||
border-radius: 50px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.right > div > .icon {
|
||||
|
||||
.right>div>.icon {
|
||||
font-size: 18px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.author {
|
||||
margin-left: 10px;
|
||||
cursor: pointer;
|
||||
|
@ -154,31 +151,37 @@ export default {
|
|||
</style>
|
||||
<style>
|
||||
.popper-user-box {
|
||||
background: url("https://s.yezgea02.com/lingling-h5/static/account-banner-bg.png")
|
||||
50% 50% no-repeat !important;
|
||||
background: url("https://s.yezgea02.com/lingling-h5/static/account-banner-bg.png") 50% 50% no-repeat !important;
|
||||
background-size: cover !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
.popper-user-box .nickname {
|
||||
position: relative;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.popper-user-box .nickname .logout {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editPass {
|
||||
position: absolute;
|
||||
right: 75px;
|
||||
top: 0px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.reStart {
|
||||
position: absolute;
|
||||
right: 150px;
|
||||
top: 0px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.btn-class {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -181,7 +181,7 @@ export default {
|
|||
point_permissions: 1,
|
||||
multiplier: 1,
|
||||
point_unit: '',
|
||||
register: 3
|
||||
register: 4
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,23 +3,25 @@
|
|||
<div class="all-content">
|
||||
<fieldset class="left box2">
|
||||
<legend class="box-ht">通讯列表</legend>
|
||||
<div v-for="(item, i) in driverData" :class="i === indexi ? 'active' : ''" class="qd-one" :key="i" @click="changeQd(i, item)">
|
||||
<div v-for="(item, i) in driverData" :class="i === indexi ? 'active' : ''" class="qd-one" :key="i"
|
||||
@click="changeQd(i, item)">
|
||||
<img src="../assets/qd.png" alt="">
|
||||
{{ item.driver_name }}
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="right">
|
||||
<div class="des">
|
||||
<span class="box-title">通讯信息</span>
|
||||
<span class="box-title">驱动信息</span>
|
||||
<span class="box-info">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:180px;border-bottom: 1px solid #006b3b;">
|
||||
通讯名称: {{ curDriver.driver_name }}
|
||||
驱动名称: {{ curDriver.driver_name }}
|
||||
</td>
|
||||
|
||||
<td style="width:120px;border-bottom: 1px solid #006b3b;">通讯失败计数: {{ curDriver.health && curDriver.health.failure_count }}</td>
|
||||
<td style="width:220px;border-bottom: 1px solid #006b3b;">
|
||||
<td style="width:180px;border-bottom: 1px solid #006b3b;">通讯失败计数: {{ curDriver.health &&
|
||||
curDriver.health.failure_count }}</td>
|
||||
<td style="width:340px;border-bottom: 1px solid #006b3b;">
|
||||
通讯最后一次成功时间: {{ curDriver.health && curDriver.health.last_success_time }}
|
||||
</td>
|
||||
<td style="border-bottom: 1px solid #006b3b;">
|
||||
|
@ -29,17 +31,17 @@
|
|||
通讯总计数: {{ curDriver.health && curDriver.health.total_count }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<tr>
|
||||
|
||||
<td >
|
||||
通讯描述: {{ curDriver.driver_description }}
|
||||
驱动描述: {{ curDriver.driver_description }}
|
||||
</td>
|
||||
|
||||
<td >
|
||||
<td>
|
||||
通讯成功计数: {{ curDriver.health && curDriver.health.success_count }}
|
||||
</td>
|
||||
<td>
|
||||
通讯最后一次失败时间: {{ curDriver.health && curDriver.health.last_failure_ctime }}
|
||||
通讯最后一次失败时间: {{ curDriver.health && curDriver.health.last_failure_ctime || '-'}}
|
||||
</td>
|
||||
<td colspan="2">通讯最后一次失败原因: {{ curDriver.health && curDriver.health.last_failure_cause }}</td>
|
||||
</tr>
|
||||
|
@ -50,15 +52,8 @@
|
|||
<div class="right-set">
|
||||
<fieldset class="height100 box2">
|
||||
<legend class="box-ht">设备列表</legend>
|
||||
<el-tree
|
||||
:data="deviceData"
|
||||
:props="defaultProps"
|
||||
:highlight-current="true"
|
||||
accordion
|
||||
node-key="device_name"
|
||||
ref="taskTree"
|
||||
:current-node-key="device_name"
|
||||
@node-click="handleNodeClick">
|
||||
<el-tree :data="deviceData" :props="defaultProps" :highlight-current="true" accordion node-key="device_name"
|
||||
ref="taskTree" :current-node-key="device_name" @node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
@ -67,31 +62,38 @@
|
|||
<span class="box-title">设备信息</span>
|
||||
<div class="box-info1">
|
||||
<div>
|
||||
<el-tag>设备名称: {{ curDevice.device_name }}</el-tag>
|
||||
<el-tag>设备描述: {{ curDevice.device_description }} </el-tag>
|
||||
<el-tag size="medium" type="">设备名称: {{ curDevice.device_name }}</el-tag>
|
||||
<el-tag size="medium" type="">设备描述: {{ curDevice.device_description }} </el-tag>
|
||||
</div>
|
||||
<el-button type="danger" @click="doDevice">{{!curDevice.device_disable? '禁用' : '启用'}}</el-button>
|
||||
<el-button type="danger" @click="doDevice">{{ !curDevice.device_disable ? '禁用' : '启用' }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="tableData" height="400" border
|
||||
:header-cell-style="{ background: '#F6F7FC' }" size="large">
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="point_name" label="名称" width="150" align="center" show-overflow-tooltip />
|
||||
<el-table :data="tableData" height="400" border :header-cell-style="{ background: '#F6F7FC' }" size="large">
|
||||
<el-table-column type="index" label="序号" width="80" align="center" />
|
||||
<el-table-column prop="point_name" label="名称" width="100" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_description" label="描述" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_quality" label="质量" width="100" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_value" label="点位值" width="130" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_quality" label="质量" width="80" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.point_quality ==1 ? 'good' : 'bad' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="point_value" label="点位值" width="80" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_unit" label="单位" width="100" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_type" label="类型" width="100" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_type" label="类型" width="80" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ pointTypeOptions[scope.row.point_type] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="point_timestamp" label="时间戳" width="200" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200" show-overflow-tooltip>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="300" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button type="success" size="large" @click="openHis(scope.row)">
|
||||
历史
|
||||
</el-button>
|
||||
<el-button type="warning" size="large" @click="openDe(scope.row)" >
|
||||
<el-button type="warning" size="large" @click="openDe(scope.row)">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button type="primary" size="large" @click="openWrite(scope.row)" >
|
||||
<el-button type="primary" size="large" @click="openWrite(scope.row)">
|
||||
写值
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -102,29 +104,14 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<De
|
||||
:formData="formData"
|
||||
:dialogVisible="dialogVisible"
|
||||
v-if="dialogVisible"
|
||||
@dialogClose="dialogClose"
|
||||
@dialogSuccess="dialogSuccess"
|
||||
>
|
||||
<De :formData="formData" :dialogVisible="dialogVisible" v-if="dialogVisible" @dialogClose="dialogClose"
|
||||
@dialogSuccess="dialogSuccess">
|
||||
</De>
|
||||
<His
|
||||
:formData="formData"
|
||||
:dialogVisible="dialogVisible1"
|
||||
v-if="dialogVisible1"
|
||||
@dialogClose="dialogClose"
|
||||
@dialogSuccess="dialogSuccess"
|
||||
>
|
||||
<His :formData="formData" :dialogVisible="dialogVisible1" v-if="dialogVisible1" @dialogClose="dialogClose"
|
||||
@dialogSuccess="dialogSuccess">
|
||||
</His>
|
||||
<Write
|
||||
:formData="formData"
|
||||
:dialogVisible="dialogVisible2"
|
||||
v-if="dialogVisible2"
|
||||
@dialogClose="dialogClose"
|
||||
@dialogSuccess="dialogSuccess"
|
||||
>
|
||||
<Write :formData="formData" :dialogVisible="dialogVisible2" v-if="dialogVisible2" @dialogClose="dialogClose"
|
||||
@dialogSuccess="dialogSuccess">
|
||||
</Write>
|
||||
</el-card>
|
||||
</template>
|
||||
|
@ -150,7 +137,7 @@ export default {
|
|||
indexi: 0,
|
||||
|
||||
driverData: [],
|
||||
deviceData: [ ],
|
||||
deviceData: [],
|
||||
currentNodekey: 11,
|
||||
tableData: [],
|
||||
defaultProps: {
|
||||
|
@ -165,14 +152,25 @@ export default {
|
|||
dialogVisible: false,
|
||||
dialogVisible1: false,
|
||||
dialogVisible2: false,
|
||||
txStatus: [] //通讯状态
|
||||
txStatus: [], //通讯状态
|
||||
pointTypeOptions: {}
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getDriverData();
|
||||
getTxStatus();
|
||||
getPointType();
|
||||
});
|
||||
|
||||
const getPointType = async () => {
|
||||
const parm = {};
|
||||
const res = await infoApi.getPointType(parm);
|
||||
|
||||
if (res.code == 0) {
|
||||
state.pointTypeOptions = res.data;
|
||||
}
|
||||
}
|
||||
|
||||
const getDriverData = async () => {
|
||||
const res = await infoApi.getDriverData();
|
||||
if (res.code == 0) {
|
||||
|
@ -214,7 +212,7 @@ export default {
|
|||
handleNodeClick(state.deviceData[0]);
|
||||
state.curDevice = state.deviceData[0]
|
||||
nextTick(() => {
|
||||
console.log(123 , state.deviceData[0].device_name)
|
||||
console.log(123, state.deviceData[0].device_name)
|
||||
taskTree.value.setCurrentKey(state.deviceData[0].device_name);
|
||||
})
|
||||
}
|
||||
|
@ -235,7 +233,7 @@ export default {
|
|||
}
|
||||
|
||||
const res = await infoApi.getPointData(param);
|
||||
if(res.code == 0) {
|
||||
if (res.code == 0) {
|
||||
state.tableData = res.data;
|
||||
|
||||
}
|
||||
|
@ -246,7 +244,7 @@ export default {
|
|||
driver_name: state.curDevice.driver_name,
|
||||
device_name: state.curDevice.device_name
|
||||
}
|
||||
const res = !state.curDevice.device_disable? await infoApi.stopDevice(param): await infoApi.startDevice(param);
|
||||
const res = !state.curDevice.device_disable ? await infoApi.stopDevice(param) : await infoApi.startDevice(param);
|
||||
if (res.code == 0) {
|
||||
ElMessage.success(res.message || '请求成功');
|
||||
getDeviceData(state.curDriver.driver_name);
|
||||
|
@ -255,7 +253,7 @@ export default {
|
|||
const dialogClose = () => {
|
||||
state.dialogVisible = false;
|
||||
state.dialogVisible1 = false;
|
||||
state.dialogVisible2= false;
|
||||
state.dialogVisible2 = false;
|
||||
// 更新点位表
|
||||
getPointData(state.curDevice);
|
||||
};
|
||||
|
@ -263,7 +261,7 @@ export default {
|
|||
const dialogSuccess = () => {
|
||||
state.dialogVisible = false;
|
||||
state.dialogVisible1 = false;
|
||||
state.dialogVisible2= false;
|
||||
state.dialogVisible2 = false;
|
||||
};
|
||||
const openDe = (item) => {
|
||||
state.formData = JSON.parse(JSON.stringify(item));
|
||||
|
@ -306,13 +304,15 @@ export default {
|
|||
width: 15%;
|
||||
border: 1px solid #006b3b;
|
||||
font-size: 16px;
|
||||
height:100%;
|
||||
height: 100%;
|
||||
|
||||
.qd-one {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 45px;
|
||||
|
||||
img {
|
||||
width: 24px;
|
||||
}
|
||||
|
@ -323,21 +323,26 @@ export default {
|
|||
width: 84%;
|
||||
border: 1px solid #006b3b;
|
||||
justify-content: space-around;
|
||||
.box-title {
|
||||
height:100% !important;
|
||||
width: 70px;
|
||||
|
||||
.box-title {
|
||||
width: 80px;
|
||||
padding: 10px 5px;
|
||||
background: #00AAA3;
|
||||
color:#fff;
|
||||
color: #fff;
|
||||
margin:0 5px;
|
||||
|
||||
// border-right: 1px solid #006b3b;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.right-con {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.right-set {
|
||||
width: 20%;
|
||||
padding: 5px;
|
||||
|
@ -351,6 +356,7 @@ export default {
|
|||
// }
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
background: #00AAA3;
|
||||
color: #fff;
|
||||
|
@ -367,6 +373,7 @@ export default {
|
|||
padding: 20px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.right-table {
|
||||
width: 88%;
|
||||
// .el-tree-node {
|
||||
|
@ -375,43 +382,53 @@ export default {
|
|||
// }
|
||||
}
|
||||
}
|
||||
|
||||
.box-info {
|
||||
width:100%;
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
|
||||
table {
|
||||
width:100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
td {
|
||||
padding:5px;
|
||||
padding: 5px;
|
||||
border-right: 1px solid #006b3b;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
}
|
||||
.des, .des1 {
|
||||
}
|
||||
|
||||
.des,
|
||||
.des1 {
|
||||
border-bottom: 1px solid #006b3b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width:100%;
|
||||
height: 80px;
|
||||
}
|
||||
.des1 {
|
||||
width: 100%;
|
||||
// height: 80px;
|
||||
}
|
||||
|
||||
.des1 {
|
||||
height: 50px;
|
||||
}
|
||||
.box-info1 {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.box-info1 {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-tag {
|
||||
.el-tag {
|
||||
margin-right: 10px;
|
||||
width:200px;
|
||||
width: 200px;
|
||||
justify-content: left;
|
||||
}
|
||||
padding: 20px 10px;
|
||||
// background:#00AAA3;
|
||||
// color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<el-card class="content-div">
|
||||
<div class="all-content">
|
||||
<div class="top-div">
|
||||
<el-button type="primary" size="large" @click="addData">新增</el-button>
|
||||
<el-button type="primary" size="large" v-show="tableData && tableData.length>0" @click="addData">新增</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData" style="width: 100%" border stripe
|
||||
:header-cell-style="{ background: '#F6F7FC' }" size="large">
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<span>{{ qudongOptions[scope.row.driver_type] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="template_name" label="通讯模板" width="200" align="center">
|
||||
<el-table-column prop="template_name" label="驱动模板" width="200" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="driver_status" label="驱动状态" width="200" align="center">
|
||||
<template #default="scope">
|
||||
|
@ -215,7 +215,7 @@ export default {
|
|||
})
|
||||
.then(async () => {
|
||||
let param = {
|
||||
name: item.name
|
||||
driver_name: item.driver_name
|
||||
}
|
||||
const res = await infoApi.delTx(param);
|
||||
if (res.code == 0) {
|
||||
|
|
Loading…
Reference in New Issue