|
|
@ -23,7 +23,7 @@ |
|
|
|
visible = !visible; |
|
|
|
} |
|
|
|
"> |
|
|
|
<template v-for="index in 4"> |
|
|
|
<template v-for="(item, index) in dataSource" :key="item.deviceInfoCode"> |
|
|
|
<div |
|
|
|
style=" |
|
|
|
flex: 1; |
|
|
@ -33,8 +33,8 @@ |
|
|
|
border: 1px solid #ab8757; |
|
|
|
font-weight: 500; |
|
|
|
" |
|
|
|
:style="{ 'background-color': ['#e43e1e', '#f59a23', '#bbcf10', '#62d7a7'][index - 1] }"> |
|
|
|
{{ ['A号门', 'B号门', 'C号门', 'D号门'][index - 1] }} |
|
|
|
:style="{ 'background-color': ['#e43e1e', '#f59a23', '#bbcf10', '#62d7a7'][0] }"> |
|
|
|
{{ ['A号门', 'B号门', 'C号门', 'D号门'][0] }} |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</div> |
|
|
@ -54,14 +54,14 @@ |
|
|
|
:pagination="false" |
|
|
|
:customRow="customRow"> |
|
|
|
<template #bodyCell="{ record, column }"> |
|
|
|
<template v-if="column.dataIndex === 'state'"> |
|
|
|
<template v-if="column.dataIndex === 'EGstRu'"> |
|
|
|
<a-tag |
|
|
|
style="background-color: rgba(0, 0, 0, 0.5); width: 50px" |
|
|
|
:style="{ |
|
|
|
border: '1px solid' + ['#39d7bb', '#f3614d', '#ffa403'][record.status - 1], |
|
|
|
color: ['#39d7bb', '#f3614d', '#ffa403'][record.status - 1], |
|
|
|
border: '1px solid' + ['#39d7bb', '#f3614d', '#ffa403'][record.EGstRu], |
|
|
|
color: ['#39d7bb', '#f3614d', '#ffa403'][record.EGstRu], |
|
|
|
}" |
|
|
|
>{{ record.state }}</a-tag |
|
|
|
>{{ record.EGstRu }}</a-tag |
|
|
|
> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -98,13 +98,28 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, onMounted, onUnmounted } from 'vue'; |
|
|
|
import electricDoorTables from './tables.vue'; |
|
|
|
|
|
|
|
import { electricDoorApi } from '/@/api/electricDoor'; |
|
|
|
import { http } from '/nerv-lib/util'; |
|
|
|
import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons-vue'; |
|
|
|
|
|
|
|
// 全局变量 |
|
|
|
import { items } from '/@/store/item'; |
|
|
|
// 全局变量 |
|
|
|
const state = items(); |
|
|
|
const getDoorList = () => { |
|
|
|
console.log('数据'); |
|
|
|
http |
|
|
|
.get(electricDoorApi.getDeviceState, { |
|
|
|
projectId: state.projectId, |
|
|
|
siteId: state.siteId, |
|
|
|
floor: 1, |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
if (res.msg === 'success') { |
|
|
|
console.log(res, '数据'); |
|
|
|
dataSource.value = res.data; |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
const intervalId = setInterval(getDoorList, 3000); |
|
|
|
const intervalId = setInterval(getDoorList, 10000); |
|
|
|
//页面 创建 |
|
|
|
onMounted(() => { |
|
|
|
//调用电梯接口 定时获取电梯接口 获取当前门状态 |
|
|
@ -139,47 +154,21 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '执行时间', |
|
|
|
dataIndex: 'age', |
|
|
|
key: 'age', |
|
|
|
dataIndex: 'time', |
|
|
|
key: 'time', |
|
|
|
width: 100, |
|
|
|
customRender: ({ value }) => { |
|
|
|
return value.substring(11, 19); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '状态', |
|
|
|
dataIndex: 'state', |
|
|
|
key: 'state', |
|
|
|
dataIndex: 'EGstRu', |
|
|
|
key: 'EGstRu', |
|
|
|
width: 160, |
|
|
|
}, |
|
|
|
]; |
|
|
|
const dataSource = [ |
|
|
|
{ |
|
|
|
key: '1', |
|
|
|
name: 'A号门', |
|
|
|
age: '23:50:20', |
|
|
|
state: '开启', |
|
|
|
status: 1, |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: '2', |
|
|
|
name: 'B号门', |
|
|
|
age: '23:50:20', |
|
|
|
state: '关闭', |
|
|
|
status: 2, |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: '3', |
|
|
|
name: 'C号门', |
|
|
|
age: '23:50:20', |
|
|
|
state: '维护中', |
|
|
|
status: 3, |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: '4', |
|
|
|
name: 'D号门', |
|
|
|
age: '23:50:20', |
|
|
|
state: '维护中', |
|
|
|
status: 3, |
|
|
|
}, |
|
|
|
]; |
|
|
|
const dataSource = ref([]); |
|
|
|
const visible = ref(false); |
|
|
|
//详情属性 |
|
|
|
const detailed = ref(false); |
|
|
|