Compare commits

...

22 Commits

@ -11,12 +11,18 @@
<script setup>
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import RPC from '@/utils/rpc'
const locale = zhCn
const route = useRoute()
onMounted(() => {
console.log(import.meta.env.VITE_APP_ENV)
RPC.post('/sys/basic/infoJson').then(res => {
console.log(res);
const arr = res || []
localStorage.setItem('SysBasicTgkTitle', arr?.find(item => item.conf_code === 'SysBasicTgkTitle')?.conf_value || '')
})
})
</script>

@ -17,12 +17,10 @@ declare module 'vue' {
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSlider: typeof import('element-plus/es')['ElSlider']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']

@ -43,6 +43,13 @@ const option = computed(() => {
data: props.lineData.map(item => item.name),
axisLabel: {
color: '#fff'
},
splitLine: {
show: true, // 线
lineStyle: {
color: '#ccc', // 线
type: 'dashed' // 线 'solid' | 'dashed' | 'dotted'
}
}
},
yAxis: {
@ -61,7 +68,7 @@ const option = computed(() => {
bottom: '10%',
},
title: {
text: '有功功率w',
text: '24小时有功功率数据可视化-kW',
textStyle: {
color: '#fff'
}

@ -17,21 +17,42 @@
<!-- 主体区域 -->
<div class="control-content">
<div style="width: 100%;">
<el-button @click="handleDeal" class="handleBtn" type="success">
<el-icon>
<Delete />
</el-icon>
批量处理
</el-button>
<el-button @click="handleDel" class="delBtn" type="danger">
<el-icon>
<Delete />
</el-icon>
批量删除
</el-button>
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
<div class="tabBox">
<div class="tab" :class="{ select: type === '重大预警' }" @click="changeTab('重大预警')"></div>
<div class="tab" :class="{ select: type === '一般预警' }" @click="changeTab('一般预警')"></div>
</div>
<div v-if="type === '一般预警'">
<el-button @click="handleDeal" class="handleBtn" type="success">
<el-icon>
<Delete />
</el-icon>
批量处理
</el-button>
<el-button @click="handleDel" class="delBtn" type="danger">
<el-icon>
<Delete />
</el-icon>
批量删除
</el-button>
</div>
</div>
<el-table :data="tableData" style="width: 100%" height="366" stripe v-loading="loading" @selection-change="handleSelectionChange" row-key="id" ref="multipleTableRef">
<el-table v-show="type === '重大预警'" :data="bigTableData" style="width: 100%" height="366" stripe v-loading="loading">
<el-table-column align="center" prop="id" label="事件ID" width="70" />
<el-table-column align="center" prop="event_type_id" label="事件类型" width="120" />
<el-table-column align="center" prop="device_id" label="设备ID" />
<el-table-column align="center" prop="content" label="事件内容" />
<el-table-column align="center" prop="created" label="创建时间" width="170">
<template #default="{ row }">
{{ row.created ? dayjs(row.created * 1000).format('YYYY-MM-DD HH:mm:ss') : '' }}
</template>
</el-table-column>
<el-table-column align="center" prop="latitude" label="纬度" width="100">
</el-table-column>
<el-table-column align="center" prop="longitude" label="经度" width="100">
</el-table-column>
</el-table>
<el-table v-show="type === '一般预警'" :data="tableData" style="width: 100%" height="366" stripe v-loading="loading" @selection-change="handleSelectionChange" row-key="id" ref="multipleTableRef">
<el-table-column type="selection" :selectable="selectable" width="55" />
<el-table-column align="center" prop="id" label="序号" />
<el-table-column align="center" prop="loop_idx" label="回路地址" />
@ -61,6 +82,9 @@
<div style="color:#fff">
设备号{{ commit_uid }}
</div>
<div style="color:#fff">
设备名称{{ device_name }}
</div>
<div class="bottom_item">
<!-- <div class="time-item">
<span>日出时间{{ sunriseTime }}</span>
@ -97,17 +121,35 @@ const router = useRouter()
const currentTime = ref('')
const systemRuntime = ref('38分钟')
const commit_uid = localStorage.getItem('central_control_comm_uid')
const device_name = localStorage.getItem('central_control_device_name')
const loading = ref(false)
const total = ref(0)
const pageSize = ref(8)
const currentPage = ref(1)
const type = ref('重大预警')
const changeTab = (tab) => {
type.value = tab
if (type.value === '重大预警') {
getBigData()
} else {
getData()
}
}
const handleSizeChange = () => {
currentPage.value = 1
getData()
if (type.value === '重大预警') {
getBigData()
} else {
getData()
}
}
const handleCurrentChange = () => {
getData()
if (type.value === '重大预警') {
getBigData()
} else {
getData()
}
}
const tableData = ref([])
@ -189,11 +231,51 @@ const getData = () => {
loading.value = false
})
}
getData()
// getData()
const bigTableData = ref([])
const getBigData = () => {
loading.value = true
RPC.post('/eventcenter/type/list', { page: 1, limit: -1, and: { is_fault: [true] } }).then(res => {
const faultList = res.rows || []
if (faultList.length > 0) {
const params = {
"limit": pageSize.value,
"page": currentPage.value,
"and": {
"device_id": [
commit_uid
],
event_type_id: faultList.map(item => item.id)
},
"like": {},
}
RPC.post('/eventcenter/list', params).then(res => {
total.value = res.count || 0
bigTableData.value = res.rows || []
}).finally(() => {
loading.value = false
})
} else {
loading.value = false
total.value = 0
bigTableData.value = []
faults.value = []
}
}).catch(() => {
loading.value = false
})
}
getBigData()
const reflesh = () => {
currentPage.value = 1
getData()
if (type.value === '重大预警') {
getBigData()
} else {
getData()
}
}
@ -303,6 +385,25 @@ onUnmounted(() => {
color: #fff;
}
}
.tabBox {
display: flex;
align-items: center;
gap: 10px;
.tab {
color: #fff;
padding: 4px 10px;
border-radius: 4px;
border: 1px solid #fff;
cursor: pointer;
&.select {
color: #0881FE;
border: 1px solid #0881FE;
}
}
}
}

@ -58,7 +58,7 @@
</div>
<div class="item" v-for="(ele, idx) in item.loops">
<div>{{ idx + 1 }}</div>
<div :class="{ red: !ele.turnOn }">{{ ele.turnOn ? '通' : '断' }}</div>
<div :class="{ red: !ele.turnOn, green: ele.turnOn }">{{ ele.turnOn ? '通' : '断' }}</div>
<div>{{ ele.pwm }}</div>
</div>
</div>
@ -256,6 +256,9 @@ const currentTask = ref({})
const currentMiddleIndex = ref(null)
const openSettingDialog = (item, index) => {
if (!isOnline.value) {
return ElMessage.error('设备不在线')
}
currentTaskName.value = item
if (item === '中间任务') {
currentTask.value = middleTask.value[index]
@ -315,6 +318,9 @@ const confirmSetting = () => {
middleTask.value[currentMiddleIndex.value].execTime = dayjs(currentTask.value.execTime).format('YYYY-MM-DD HH:mm:ss')
middleTask.value[currentMiddleIndex.value].timeType = currentTask.value.timeType
middleTask.value[currentMiddleIndex.value].loops = currentTask.value.loops
middleTask.value.forEach(item => {
item.execTime = item.execTime ? dayjs(item.execTime).format('YYYY-MM-DD HH:mm:ss') : ''
})
const middleParams = {
"comm_uid": commit_uid,
"mode": deviceMode.value,
@ -340,11 +346,12 @@ const tasks = computed(() => [startTask.value, stopTask.value, middleTask.value]
const deviceMode = ref(0)
const currentMode = ref(0)
RPC.post('/m9z/getDeviceMode', { comm_uid: commit_uid }).then(res => {
currentMode.value = res
})
const changeMode = () => {
if (!isOnline.value) {
return ElMessage.error('设备不在线')
}
modeActive.value = currentMode.value
modeDialogVisible.value = true
}
@ -366,30 +373,36 @@ const getTask = () => {
startTaskLoading.value = true
stopTaskLoading.value = true
middleTaskLoading.value = true
RPC.post('/m9z/getStartTask2', { comm_uid: commit_uid, mode: deviceMode.value }).then(res => {
RPC.post('/m9z/getStartTask2', { comm_uid: commit_uid, mode: deviceMode.value, cache: !isOnline.value }).then(res => {
startTask.value = res
}).finally(() => {
startTaskLoading.value = false
})
RPC.post('/m9z/getStopTask2', { comm_uid: commit_uid, mode: deviceMode.value }).then(res => {
RPC.post('/m9z/getStopTask2', { comm_uid: commit_uid, mode: deviceMode.value, cache: !isOnline.value }).then(res => {
stopTask.value = res
}).finally(() => {
stopTaskLoading.value = false
})
RPC.post('/m9z/getMiddleTask2', { comm_uid: commit_uid, mode: deviceMode.value }).then(res => {
RPC.post('/m9z/getMiddleTask2', { comm_uid: commit_uid, mode: deviceMode.value, cache: !isOnline.value }).then(res => {
middleTask.value = res.controlTaskList || []
}).finally(() => {
middleTaskLoading.value = false
})
}
getTask()
const addTask = () => {
if (!isOnline.value) {
return ElMessage.error('设备不在线')
}
middleTask.value.push({
"execTime": '2025-06-07 19:00:00',
"turnOn": true,
"pwm": 50
})
middleTask.value.forEach(item => {
item.execTime = item.execTime ? dayjs(item.execTime).format('YYYY-MM-DD HH:mm:ss') : ''
})
const middleParams = {
"comm_uid": commit_uid,
"mode": deviceMode.value,
@ -407,6 +420,9 @@ const addTask = () => {
})
}
const delTask = (index) => {
if (!isOnline.value) {
return ElMessage.error('设备不在线')
}
ElMessageBox.confirm(
'确认删除?',
'',
@ -419,6 +435,9 @@ const delTask = (index) => {
)
.then(() => {
middleTask.value.splice(index, 1)
middleTask.value.forEach(item => {
item.execTime = item.execTime ? dayjs(item.execTime).format('YYYY-MM-DD HH:mm:ss') : ''
})
const middleParams = {
"comm_uid": commit_uid,
"mode": deviceMode.value,
@ -464,11 +483,6 @@ const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四
const sunriseTime = ref('')
const sunsetTime = ref('')
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
})
//
const updateTime = () => {
const now = new Date()
@ -540,8 +554,25 @@ const restartSystem = () => {
}
let timeInterval = null
const isOnline = ref(false)
onMounted(() => {
RPC.post('/lightm/rtu/isOnline', { commUid: commit_uid }).then(res => {
console.log('/lightm/rtu/isOnlin', res)
isOnline.value = res
if (isOnline.value) {
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
})
RPC.post('/m9z/getDeviceMode', { comm_uid: commit_uid }).then(res => {
currentMode.value = res
})
getTask()
} else {
getTask()
// ElMessage.error('线')
}
})
updateTime()
timeInterval = setInterval(updateTime, 1000)
})

@ -11,7 +11,7 @@
<h1>手动控制</h1>
</div>
<div class="system-status">
<!-- <span>系统已运行{{ systemRuntime }}</span> -->
<span>设备时间{{ deviceTime ? dayjs(deviceTime).format('YYYY-MM-DD HH:mm') : '' }}</span>
</div>
</div>
@ -20,7 +20,7 @@
<!-- 左侧电力参数区域 -->
<div class="power-section">
<!-- ABC三相电力参数 -->
<div class="power-params">
<div class="power-params" v-loading="phaseLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<div v-for="phase in powerPhases" :key="phase.name" class="phase-card">
<div class="phase-name"><span>{{ phase.name }}</span></div>
<div class="param-list">
@ -68,7 +68,7 @@
</div>
<!-- 回路控制区域 -->
<div class="circuit-section">
<div class="circuit-section" v-loading="infoLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<!-- 上排回路 -->
<div class="circuit-row">
<div v-for="(circuit, index) in info.loops.slice(0, 5)" :key="circuit.name" class="circuit-item">
@ -99,7 +99,7 @@
</div>
<!-- 调光通道区域 -->
<div class="dimming-section">
<div class="dimming-section" v-loading="infoLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<!-- 上排调光通道 -->
<div class="dimming-row">
<div v-for="(channel, index) in info.loops.slice(0, 5)" :key="channel.name" class="dimming-item">
@ -123,7 +123,7 @@
</div>
<!-- 右侧控制面板 -->
<div class="control-panel">
<div class="control-panel" v-loading="infoLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<!-- 切换模式 -->
<div class="control-group">
<div class="control-title">
@ -175,12 +175,15 @@
设备号{{ commit_uid }}
</div>
<div class="bottom_item">
<!-- <el-button class="restart-button" @click="restartSystem">
<el-button class="restart-button" :loading="timeLoading" @click="setDeviceTime">
同步时间
</el-button>
<el-button class="restart-button" @click="refresh">
<el-icon>
<RefreshRight />
</el-icon>
远程重启
</el-button> -->
刷新
</el-button>
<el-button class="back-button" @click="goBack">
<el-icon>
<HomeFilled />
@ -218,33 +221,39 @@ const commit_uid = localStorage.getItem('central_control_comm_uid')
const router = useRouter()
const currentTime = ref('')
const deviceTime = ref('')
const systemRuntime = ref('38分钟')
const brightnessDialogVisible = ref(false)
const currentBrightness = ref(50)
const selectedChannelName = ref(null)
const timeLoading = ref(false)
const week = ref('')
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
const isUpDateTimeing = ref(false)
const getDeviceTime = () => {
isUpDateTimeing.value = true
RPC.post('/m9z/getDeviceTime', { comm_uid: commit_uid }).then(res => {
deviceTime.value = res.deviceTime
}).finally(() => {
isUpDateTimeing.value = false
})
}
RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
powerPhases.value[0].voltage = res.aVoltage + 'V'
powerPhases.value[0].current = res.aElectricCurrent + 'A'
powerPhases.value[0].power = res.aPower + 'kW'
powerPhases.value[0].factor = res.aPowerFactor
const isOnline = ref(false)
powerPhases.value[1].voltage = res.bVoltage + 'V'
powerPhases.value[1].current = res.bElectricCurrent + 'A'
powerPhases.value[1].power = res.bPower + 'kW'
powerPhases.value[1].factor = res.bPowerFactor
const setDeviceTime = () => {
timeLoading.value = true
RPC.post('/m9z/setDeviceTime', { comm_uid: commit_uid, device_time: dayjs().format('YYYY-MM-DD HH:mm:ss') }).then(res => {
ElMessage.success('同步时间成功')
getDeviceTime()
}).finally(() => {
timeLoading.value = false
})
}
powerPhases.value[2].voltage = res.cVoltage + 'V'
powerPhases.value[2].current = res.cElectricCurrent + 'A'
powerPhases.value[2].power = res.cPower + 'kW'
powerPhases.value[2].factor = res.cPowerFactor
const week = ref('')
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
const phaseLoading = ref(false)
energyParams.value.activeEnergy = res.activeEnergy + 'A'
energyParams.value.powerFactor = res.powerFactor
})
//
const powerPhases = ref([
@ -273,7 +282,7 @@ const powerPhases = ref([
const energyParams = ref({
dcVoltage: '0.0V',
activeEnergy: '0kwh',
activeEnergy: '0kh',
activePower: '0kW',
powerFactor: '0'
})
@ -377,7 +386,9 @@ const info = ref({
})
const isSync = ref(true)
const infoLoading = ref(false)
const getInfo = () => {
infoLoading.value = true
isSync.value = true
RPC.post('/m9z/getDeviceManualInfo', { comm_uid: commit_uid }).then(res => {
info.value = res
@ -386,9 +397,41 @@ const getInfo = () => {
}, 1000);
}).finally(() => {
isInitData.value = false
infoLoading.value = false
})
}
const refresh = () => {
getInfo()
phaseLoading.value = true
RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
powerPhases.value[0].voltage = res.aVoltage ? res.aVoltage + 'V' : '0V'
powerPhases.value[0].current = res.aElectricCurrent ? res.aElectricCurrent + 'A' : '0A'
powerPhases.value[0].power = res.aPower ? res.aPower + 'kW' : '0kW'
powerPhases.value[0].factor = res.aPowerFactor ? res.aPowerFactor : 0
powerPhases.value[1].voltage = res.bVoltage ? res.bVoltage + 'V' : '0V'
powerPhases.value[1].current = res.bElectricCurrent ? res.bElectricCurrent + 'A' : '0A'
powerPhases.value[1].power = res.bPower ? res.bPower + 'kW' : '0kW'
powerPhases.value[1].factor = res.bPowerFactor ? res.bPowerFactor : 0
powerPhases.value[2].voltage = res.cVoltage ? res.cVoltage + 'V' : '0V'
powerPhases.value[2].current = res.cElectricCurrent ? res.cElectricCurrent + 'A' : '0A'
powerPhases.value[2].power = res.cPower ? res.cPower + 'kW' : '0kW'
powerPhases.value[2].factor = res.cPowerFactor ? res.cPowerFactor : 0
energyParams.value.activeEnergy = res.activeEnergy ? res.activeEnergy + 'kW·h' : '0kW·h'
energyParams.value.activePower = res.activePower ? res.activePower + 'kW' : '0kW'
energyParams.value.powerFactor = res.powerFactor ? res.powerFactor : 0
}).finally(() => {
phaseLoading.value = false
})
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
})
}
getInfo()
const oldInfo = ref('')
watch(info, () => {
@ -406,10 +449,6 @@ watch(info, () => {
const sunriseTime = ref('')
const sunsetTime = ref('')
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
})
//
const updateTime = () => {
@ -424,6 +463,9 @@ const updateTime = () => {
week.value = weekDays[now.getDay()]
currentTime.value = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
if (deviceTime.value && !isUpDateTimeing.value) {
deviceTime.value = dayjs(deviceTime.value).valueOf() + 1000
}
}
//
@ -431,7 +473,17 @@ const toggleCircuit = (circuitName) => {
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
const circuit = info.value.loops.find(c => c.name === circuitName)
if (circuit) {
circuit.is_open = !circuit.is_open
ElMessageBox.confirm(
`确认${circuit.is_open ? '关' : '开'}灯?`,
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
circuit.is_open = !circuit.is_open
})
}
}
@ -471,8 +523,18 @@ const openGlobalBrightnessDialog = () => {
//
const openLightSettings = () => {
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
info.value.loops.forEach(circuit => {
circuit.is_open = true
ElMessageBox.confirm(
`确认全开?`,
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
info.value.loops.forEach(circuit => {
circuit.is_open = true
})
})
// dimmingChannels.value.forEach(channel => {
// channel.brightness = 100
@ -482,8 +544,18 @@ const openLightSettings = () => {
//
const turnOffAll = () => {
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
info.value.loops.forEach(circuit => {
circuit.is_open = false
ElMessageBox.confirm(
`确认全关?`,
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
info.value.loops.forEach(circuit => {
circuit.is_open = false
})
})
// dimmingChannels.value.forEach(channel => {
// channel.brightness = 0
@ -515,6 +587,9 @@ const restartSystem = () => {
}
const changeMode = () => {
if (!isOnline.value) {
return ElMessage.error('设备不在线')
}
ElMessageBox.confirm(
`此操作将切换到${info.value.disable ? '自动' : '手动'}模式,是否继续?`,
'提示',
@ -523,14 +598,13 @@ const changeMode = () => {
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
info.value.disable = !info.value.disable
// ElMessage({
// type: 'success',
// message: `${info.value.disable ? '' : ''}`,
// })
})
).then(() => {
info.value.disable = !info.value.disable
// ElMessage({
// type: 'success',
// message: `${info.value.disable ? '' : ''}`,
// })
})
}
let timeInterval = null
@ -538,6 +612,43 @@ let timeInterval = null
onMounted(() => {
updateTime()
timeInterval = setInterval(updateTime, 1000)
RPC.post('/lightm/rtu/isOnline', { commUid: commit_uid }).then(res => {
console.log('/lightm/rtu/isOnlin', res)
isOnline.value = res
if (isOnline.value) {
getInfo()
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
})
phaseLoading.value = true
RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
powerPhases.value[0].voltage = res.aVoltage ? res.aVoltage + 'V' : '0V'
powerPhases.value[0].current = res.aElectricCurrent ? res.aElectricCurrent + 'A' : '0A'
powerPhases.value[0].power = res.aPower ? res.aPower + 'kW' : '0kW'
powerPhases.value[0].factor = res.aPowerFactor ? res.aPowerFactor : 0
powerPhases.value[1].voltage = res.bVoltage ? res.bVoltage + 'V' : '0V'
powerPhases.value[1].current = res.bElectricCurrent ? res.bElectricCurrent + 'A' : '0A'
powerPhases.value[1].power = res.bPower ? res.bPower + 'kW' : '0kW'
powerPhases.value[1].factor = res.bPowerFactor ? res.bPowerFactor : 0
powerPhases.value[2].voltage = res.cVoltage ? res.cVoltage + 'V' : '0V'
powerPhases.value[2].current = res.cElectricCurrent ? res.cElectricCurrent + 'A' : '0A'
powerPhases.value[2].power = res.cPower ? res.cPower + 'kW' : '0kW'
powerPhases.value[2].factor = res.cPowerFactor ? res.cPowerFactor : 0
energyParams.value.activeEnergy = res.activeEnergy ? res.activeEnergy + 'kW·h' : '0kW·h'
energyParams.value.activePower = res.activePower ? res.activePower + 'kW' : '0kW'
energyParams.value.powerFactor = res.powerFactor ? res.powerFactor : 0
}).finally(() => {
phaseLoading.value = false
})
getDeviceTime()
} else {
ElMessage.error('设备不在线')
}
})
})
onUnmounted(() => {
@ -589,7 +700,7 @@ onUnmounted(() => {
}
.system-status {
min-width: 200px;
min-width: 300px;
font-size: 18px;
font-weight: 300;
width: 270px;

@ -10,7 +10,7 @@
<!-- 主标题 -->
<div class="main-title">
<div class="title-decoration left"></div>
<h1>智能中控装置</h1>
<h1>{{ SysBasicTgkTitle }}</h1>
<div class="title-decoration right"></div>
</div>
@ -32,10 +32,17 @@
设备号{{ commit_uid }}
</div>
<div class="status-item">
版本号1.0.0
设备名称{{ device_name }}
</div>
<div class="status-item">
系统状态<span class="status-online">开启</span>
版本号1.0.0
</div>
<div class="status-item" v-if="status !== -1">
开关量
<span v-if="status === 1" class="status-online"></span>
<span v-else-if="status === 0" class="status-offline">关闭</span>
<span v-else class="status-offline">{{ status }}</span>
</div>
</div>
</div>
@ -51,6 +58,7 @@ import {
VideoPlay,
Bell
} from '@element-plus/icons-vue'
import RPC from '@/utils/rpc'
const currentTime = ref('')
const router = useRouter()
const route = useRoute()
@ -58,9 +66,23 @@ const route = useRoute()
if (route.query.comm_uid) {
localStorage.setItem('central_control_comm_uid', route.query.comm_uid)
}
if (route.query.deviceName) {
localStorage.setItem('central_control_device_name', route.query.deviceName)
}
if (route.query.temperature) {
localStorage.setItem('temperature', route.query.temperature)
}
const commit_uid = localStorage.getItem('central_control_comm_uid')
const device_name = localStorage.getItem('central_control_device_name')
const status = ref(-1)
onMounted(() => {
RPC.post('/m9z/getRelayStatus', { comm_uid: commit_uid }).then(res => {
status.value = res
})
})
const functionCards = [
{ key: 'monitor', title: '实时监控', icon: Camera, route: '/monitoring' },
{ key: 'control', title: '手动控制', icon: Operation, route: '/handle-control' },
@ -92,6 +114,7 @@ const handleCardClick = (key) => {
}
}
}
const SysBasicTgkTitle = localStorage.getItem('SysBasicTgkTitle') || '智能中控装置'
let timeInterval = null
@ -307,6 +330,11 @@ onUnmounted(() => {
font-weight: bold;
}
.status-offline {
color: #f12323;
font-weight: bold;
}
/* Element Plus 卡片样式重写 */
:deep(.el-card) {
background: transparent !important;

@ -20,7 +20,7 @@
<!-- 左侧电力参数区域 -->
<div class="power-section">
<!-- ABC三相电力参数 -->
<div class="power-params">
<div class="power-params" v-loading="phaseLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<div v-for="phase in powerPhases" :key="phase.name" class="phase-card">
<div class="phase-name"><span>{{ phase.name }}</span></div>
<div class="param-list">
@ -76,66 +76,72 @@
<el-button class="mode-button active">{{ info.Mode ? '手动' : '自动' }}</el-button>
</div>
</div>
<div class="circuit-section">
<!-- 上排回路 -->
<div class="circuit-row">
<div v-for="(circuit, index) in info.Loops.slice(0, 5)" :key="circuit.name" class="circuit-item">
<div class="circuit-status" :class="{ active: circuit.is_open }">
回路{{ index + 1 }}{{ circuit.is_open ? '打开' : '关闭' }}
</div>
<!-- <div class="circuit-icon" :class="{ active: circuit.is_open }">
<el-icon>
<Sunny />
</el-icon>
</div> -->
<div class="circuitStatus">
<div class="line">直流电流: <span>{{ circuit.A }}A</span></div>
<div class="line">
<div class="line_item">电源: <span>{{ circuit.V }}V</span></div>
<div class="line_item">功率: <span>{{ circuit.Kw }}kw</span></div>
<div v-loading="infoLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<div class="circuit-section">
<!-- 上排回路 -->
<div class="circuit-row">
<div v-for="(circuit, index) in info.Loops.slice(0, 5)" :key="circuit.name" class="circuit-item">
<div class="circuit-status" :class="{ active: circuit.is_open }">
直流回路{{ index + 1 }}{{ circuit.is_open ? '打开' : '关闭' }}
</div>
<!-- <div class="circuit-icon" :class="{ active: circuit.is_open }">
<el-icon>
<Sunny />
</el-icon>
</div> -->
<div class="circuitStatus">
<div class="line">
<div class="line_item">电压: <span>{{ circuit.V ? circuit.V?.toFixed(2) : 0 }}V</span></div>
<div class="line_item">电流: <span>{{ circuit.A ? circuit.A?.toFixed(2) : 0 }}A</span></div>
</div>
<div class="line">
<div class="line_item">功率: <span>{{ circuit.Kw ? circuit.Kw?.toFixed(3) : 0 }}kW</span></div>
</div>
</div>
</div>
</div>
</div>
<!-- 下排回路 -->
<div class="circuit-row">
<div v-for="(circuit, index) in info.Loops.slice(5, 10)" :key="circuit.name" class="circuit-item">
<div class="circuit-status" :class="{ active: circuit.is_open }">
回路{{ index + 6 }}{{ circuit.is_open ? '打开' : '关闭' }}
</div>
<!-- <div class="circuit-icon" :class="{ active: circuit.is_open }">
<el-icon>
<Sunny />
</el-icon>
</div> -->
<div class="circuitStatus">
<div class="line">直流电流: <span>{{ circuit.A }}A</span></div>
<div class="line">
<div class="line_item">电源: <span>{{ circuit.V }}V</span></div>
<div class="line_item">功率: <span>{{ circuit.Kw }}kw</span></div>
<!-- 下排回路 -->
<div class="circuit-row">
<div v-for="(circuit, index) in info.Loops.slice(5, 10)" :key="circuit.name" class="circuit-item">
<div class="circuit-status" :class="{ active: circuit.is_open }">
直流回路{{ index + 6 }}{{ circuit.is_open ? '打开' : '关闭' }}
</div>
<!-- <div class="circuit-icon" :class="{ active: circuit.is_open }">
<el-icon>
<Sunny />
</el-icon>
</div> -->
<div class="circuitStatus">
<div class="line">
<div class="line_item">电压: <span>{{ circuit.V ? circuit.V?.toFixed(2) : 0 }}V</span></div>
<div class="line_item">电流: <span>{{ circuit.A ? circuit.A?.toFixed(2) : 0 }}A</span></div>
</div>
<div class="line">
<div class="line_item">功率: <span>{{ circuit.Kw ? circuit.Kw?.toFixed(3) : 0 }}kW</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="dimming-section">
<!-- 上排调光通道 -->
<div class="dimming-row">
<div v-for="(channel, index) in info.Loops.slice(0, 5)" :key="channel.name" class="dimming-item">
<div class="channel-label">调光通道{{ index + 1 }}</div>
<div class="brightness-display" :class="{ active: channel.pwm > 0 }">
{{ channel.pwm }}%
<div class="dimming-section">
<!-- 上排调光通道 -->
<div class="dimming-row">
<div v-for="(channel, index) in info.Loops.slice(0, 5)" :key="channel.name" class="dimming-item">
<div class="channel-label">调光通道{{ index + 1 }}</div>
<div class="brightness-display" :class="{ active: channel.pwm > 0 }">
{{ channel.pwm }}%
</div>
</div>
</div>
</div>
<!-- 下排调光通道 -->
<div class="dimming-row">
<div v-for="(channel, index) in info.Loops.slice(5, 10)" :key="channel.name" class="dimming-item">
<div class="channel-label">调光通道{{ index + 6 }}</div>
<div class="brightness-display" :class="{ active: channel.pwm > 0 }">
{{ channel.pwm }}%
<!-- 下排调光通道 -->
<div class="dimming-row">
<div v-for="(channel, index) in info.Loops.slice(5, 10)" :key="channel.name" class="dimming-item">
<div class="channel-label">调光通道{{ index + 6 }}</div>
<div class="brightness-display" :class="{ active: channel.pwm > 0 }">
{{ channel.pwm }}%
</div>
</div>
</div>
</div>
@ -144,6 +150,9 @@
<div class="search">
<el-date-picker value-format="YYYY-MM-DD" v-model="recdDate" type="date" placeholder="请选择时间" />
<el-button type="primary" :loading="lineDataLoading" @click="getLineData"></el-button>
<div class="info_item">当前功率{{ energyParams.activePower }}</div>
<div class="info_item">今日峰值{{ maxEnergy }}kW</div>
<div class="info_item">平均功率{{ agvEnergy }}kW</div>
</div>
<Linechart :lineData="lineData"></Linechart>
</div>
@ -163,6 +172,12 @@
<div style="color:#fff">
设备号{{ commit_uid }}
</div>
<div style="color:#fff">
设备名称{{ device_name }}
</div>
<div style="color:#fff" v-if="temperature">
温度{{ temperature }}
</div>
<div class="bottom_item">
<!-- <el-button class="restart-button" @click="restartSystem">
<el-icon>
@ -205,6 +220,8 @@ import dayjs from 'dayjs'
import Linechart from '@/components/Linechart.vue';
const commit_uid = localStorage.getItem('central_control_comm_uid')
const device_name = localStorage.getItem('central_control_device_name')
const temperature = localStorage.getItem('temperature')
const router = useRouter()
const currentTime = ref('')
@ -232,15 +249,58 @@ function transformHourlyData(data) {
const lineData = ref([])
const recdDate = ref(dayjs().add(-1, 'day').format('YYYY-MM-DD'))
const lineDataLoading = ref(false)
const agvEnergy = ref(0)
const maxEnergy = ref(0)
const getLineData = () => {
lineDataLoading.value = true
RPC.post('/lightm/rtu/his', { commUid: commit_uid, recdDate: recdDate.value }).then(res => {
lineData.value = transformHourlyData(res)
// RPC.post('/lightm/rtu/his', { commUid: commit_uid, recdDate: recdDate.value }).then(res => {
// lineData.value = transformHourlyData(res)
// }).finally(() => {
// lineDataLoading.value = false
// })
// RPC.post('/lightm/rtu/minHis', { CommUid: commit_uid, recdDate: recdDate.value }).then((res) => {
// //
// // console.log(res)
// agvEnergy.value = res.agvEnergy?.toFixed(3)
// maxEnergy.value = res.maxEnergy?.toFixed(3)
// // lineData.value = transformminHisData(res.minutesEnergy)
// }).finally(() => {
// lineDataLoading.value = false
// })
RPC.post('/hisMinEnergy/getMinEnergyListByDay', { CommUid: commit_uid, day: recdDate.value }).then((res) => {
//
console.log(res)
agvEnergy.value = res.avg?.toFixed(3) || 0
maxEnergy.value = res.max?.toFixed(3) || 0
const arr = []
for (let k in res?.energy) {
arr.push(k)
}
lineData.value = arr.map(item => {
return {
name: item,
value: res?.energy[item]
}
})
// agvEnergy.value = res.agvEnergy?.toFixed(3)
// maxEnergy.value = res.maxEnergy?.toFixed(3)
// lineData.value = transformminHisData(res.minutesEnergy)
}).finally(() => {
lineDataLoading.value = false
})
}
getLineData()
const transformminHisData = arr => {
if (!arr) return
return arr.map(item => {
return {
name: dayjs(item.record_time).format('HH:mm'),
value: item.energy
}
})
}
// getLineData()
//
const powerPhases = ref([
@ -269,7 +329,7 @@ const powerPhases = ref([
const energyParams = ref({
dcVoltage: '0.0V',
activeEnergy: '0kwh',
activeEnergy: '0kh',
activePower: '0kW',
powerFactor: '0'
})
@ -373,43 +433,60 @@ const info = ref({
"backup_byte4": 0
})
const infoLoading = ref(false)
const phaseLoading = ref(false)
const getInfo = () => {
// RPC.post('/m9z/getDeviceManualInfo', { comm_uid: commit_uid }).then(res => {
// info.value = res
// })
infoLoading.value = true
phaseLoading.value = true
RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
powerPhases.value[0].voltage = res.aVoltage + 'V'
powerPhases.value[0].current = res.aElectricCurrent + 'A'
powerPhases.value[0].power = res.aPower + 'kW'
powerPhases.value[0].factor = res.aPowerFactor
powerPhases.value[1].voltage = res.bVoltage + 'V'
powerPhases.value[1].current = res.bElectricCurrent + 'A'
powerPhases.value[1].power = res.bPower + 'kW'
powerPhases.value[1].factor = res.bPowerFactor
powerPhases.value[2].voltage = res.cVoltage + 'V'
powerPhases.value[2].current = res.cElectricCurrent + 'A'
powerPhases.value[2].power = res.cPower + 'kW'
powerPhases.value[2].factor = res.cPowerFactor
energyParams.value.activeEnergy = res.activeEnergy + 'A'
energyParams.value.powerFactor = res.powerFactor
powerPhases.value[0].voltage = res.aVoltage ? res.aVoltage + 'V' : '0V'
powerPhases.value[0].current = res.aElectricCurrent ? res.aElectricCurrent + 'A' : '0A'
powerPhases.value[0].power = res.aPower ? res.aPower + 'kW' : '0kW'
powerPhases.value[0].factor = res.aPowerFactor ? res.aPowerFactor : 0
powerPhases.value[1].voltage = res.bVoltage ? res.bVoltage + 'V' : '0V'
powerPhases.value[1].current = res.bElectricCurrent ? res.bElectricCurrent + 'A' : '0A'
powerPhases.value[1].power = res.bPower ? res.bPower + 'kW' : '0kW'
powerPhases.value[1].factor = res.bPowerFactor ? res.bPowerFactor : 0
powerPhases.value[2].voltage = res.cVoltage ? res.cVoltage + 'V' : '0V'
powerPhases.value[2].current = res.cElectricCurrent ? res.cElectricCurrent + 'A' : '0A'
powerPhases.value[2].power = res.cPower ? res.cPower + 'kW' : '0kW'
powerPhases.value[2].factor = res.cPowerFactor ? res.cPowerFactor : 0
energyParams.value.activeEnergy = res.activeEnergy ? res.activeEnergy + 'kW·h' : '0kW·h'
energyParams.value.activePower = res.activePower ? res.activePower + 'kW' : '0kW'
energyParams.value.powerFactor = res.powerFactor ? res.powerFactor : 0
}).finally(() => {
phaseLoading.value = false
})
RPC.post('/m9z/getDeviceStatus2', { comm_uid: commit_uid }).then((res) => {
//
info.value = res
if (res.Loops?.length === 10) {
info.value = res
}
}).finally(() => {
infoLoading.value = false
})
getLineData()
// RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
// sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
// sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
// })
}
getInfo()
const timer = setInterval(() => {
getInfo()
RPC.post('/lightm/rtu/isOnline', { commUid: commit_uid }).then(res => {
console.log('/lightm/rtu/isOnlin', res)
isOnline.value = res
if (isOnline.value) {
getInfo()
}
})
}, 30000)
onUnmounted(() => {
@ -526,7 +603,17 @@ const restartSystem = () => {
let timeInterval = null
const isOnline = ref(false)
onMounted(() => {
RPC.post('/lightm/rtu/isOnline', { commUid: commit_uid }).then(res => {
console.log('/lightm/rtu/isOnlin', res)
isOnline.value = res
if (isOnline.value) {
getInfo()
} else {
ElMessage.error('设备不在线')
}
})
updateTime()
timeInterval = setInterval(updateTime, 1000)
})
@ -990,6 +1077,14 @@ onUnmounted(() => {
border-color: #006eff;
margin-left: 20px;
}
.info_item {
color: #fff;
margin-left: 20px;
border: 0.5px solid #00E0F4;
padding: 5px 10px;
border-radius: 5px;
}
}
}
</style>

@ -25,7 +25,7 @@ function closed() {
<el-table-column align="center" prop="DeviceAddress" label="设备地址" />
<el-table-column align="center" prop="CurrentPWMDuty" label="电流PWM">
<template #default="{ row }">
{{ row.CurrentPWMDuty && row.CurrentPWMDuty + '%' }}
{{ row.CurrentPWMDuty && row.CurrentPWMDuty?.toFixed(2) + '%' }}
</template>
</el-table-column>
<el-table-column align="center" prop="VoltagePWMDuty" label="电压PWM">

@ -18,51 +18,57 @@
<!-- 主体区域 -->
<div class="control-content">
<div class="main_item">
<div class="main_title">
主控器设置
</div>
<div class="main_title">主控器设置</div>
<div class="main_content">
<div class="line">
<div class="item">
<div class="key">设备时间</div>
<el-date-picker value-format="YYYY-MM-DD HH:mm:ss" style="flex: 1;" v-model="deviceTime" type="datetime" placeholder="请选择时间" />
<el-date-picker value-format="YYYY-MM-DD HH:mm:ss" style="flex: 1" v-model="deviceTime" type="datetime" placeholder="请选择时间" />
</div>
</div>
<div class="line">
<div class="item">
<div class="key">大地经度</div>
<!-- <el-input v-model="formField.lat" style="width: 100px" placeholder="请输入" :formatter="(value) => `${value}˚`" :parser="(value) => value.replace(/˚/g, '')" /> -->
<el-input-number :min="0" :max="180" v-model="formField.lat" style="width: 100px" placeholder="请输入" :controls="false" />
<el-input-number :min="0" :max="180" v-model="formField.lgn" style="width: 100px" placeholder="请输入" :controls="false" />
</div>
<div class="item">
<div class="key">大地纬度</div>
<!-- <el-input v-model="formField.lgn" style="width: 100px" placeholder="请输入" :formatter="(value) => `${value}˚`" :parser="(value) => value.replace(/˚/g, '')" /> -->
<el-input-number :min="0" :max="90" v-model="formField.lgn" style="width: 100px" placeholder="请输入" :controls="false" />
<el-input-number :min="0" :max="90" v-model="formField.lat" style="width: 100px" placeholder="请输入" :controls="false" />
</div>
</div>
<div class="line">
<div class="item">
<div class="key">经纬开灯偏差</div>
<!-- <el-input readonly v-model="formField.rise" style="width: 100px" placeholder="请输入" :formatter="(value) => `${value}分`" :parser="(value) => value.replace(/分/g, '')" /> -->
<el-select v-model="formField.rise" placeholder="请选择">
<div>
<el-input-number :controls="false" v-model="formField.rise" style="width: 100px" placeholder="请输入" />
<span style="color: #fff; margin-left: 8px"></span>
</div>
<!-- <el-select v-model="formField.rise" placeholder="请选择">
<el-option v-for="item in RiseSetOption" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-select> -->
</div>
</div>
<div class="line">
<div class="item">
<div class="key">经纬关灯偏差</div>
<!-- <el-input readonly v-model="formField.set" style="width: 100px" placeholder="请输入" :formatter="(value) => `${value}分`" :parser="(value) => value.replace(/分/g, '')" /> -->
<el-select v-model="formField.set" placeholder="请选择">
<div>
<el-input-number :controls="false" v-model="formField.set" style="width: 100px" placeholder="请输入" />
<span style="color: #fff; margin-left: 8px"></span>
</div>
<!-- <el-select v-model="formField.set" placeholder="请选择">
<el-option v-for="item in RiseSetOption" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-select> -->
</div>
<!-- <div class="item"></div> -->
</div>
<div class="line">
<div class="item">
<div class="key">控制回路数</div>
<div class="value" style="min-width: 100px;">{{ subLoopParameter.subLoopData?.length || 0 }}</div>
<div class="value" style="min-width: 100px">
{{ subLoopParameter.subLoopData?.length || 0 }}
</div>
</div>
<div class="item"></div>
</div>
@ -80,10 +86,8 @@
</div>
</div>
<div class="main_item">
<div class="main_title">
稳压分控器
</div>
<div class="main_content energy_meter subLoopParame" style="width:235px">
<div class="main_title">稳压分控器</div>
<div class="main_content energy_meter subLoopParame" style="width: 235px">
<div class="subLoopParameter_item" v-for="item in subLoopParameter.subLoopData">
<div class="item">
<div class="key">回路地址</div>
@ -95,19 +99,21 @@
</div>
<div class="item">
<div class="key">调光幅度</div>
<div class="value">{{ item.DimmingValue ? item.DimmingValue + '%' : item.DimmingValue }}</div>
<div class="value">
{{ item.DimmingValue ? item.DimmingValue + '%' : item.DimmingValue }}
</div>
</div>
<div class="buttonBox" v-if="item.Modules?.length">
<div class="button save" style="width: 100px;" @click="openDialog(item)"></div>
<div class="button save" style="width: 100px" @click="openDialog(item)">
查看子模块
</div>
</div>
</div>
</div>
</div>
<div class="main_item">
<div class="main_title">
电能表
</div>
<div class="main_content energy_meter" style="width:235px">
<div class="main_title">电能表</div>
<div class="main_content energy_meter" style="width: 235px">
<!-- <div class="line">
<div class="item">
<div class="key">主控器地址</div>
@ -134,9 +140,8 @@
</div>
<!-- 底部信息 -->
<div class="bottom-info">
<div style="color:#fff">
设备号{{ commit_uid }}
</div>
<div style="color: #fff">设备号{{ commit_uid }}</div>
<div style="color: #fff">设备名称{{ device_name }}</div>
<div class="bottom_item">
<!-- <div class="time-item">
<span>日出时间{{ sunriseTime }}</span>
@ -167,8 +172,8 @@
<script setup>
import { ref, onMounted, onUnmounted } from 'vue'
import { useRouter } from 'vue-router'
import RPC from '@/utils/rpc';
import TableDialog from './TableDialog.vue';
import RPC from '@/utils/rpc'
import TableDialog from './TableDialog.vue'
const router = useRouter()
const currentTime = ref('')
@ -177,6 +182,7 @@ const formField = ref({})
const deviceTime = ref('')
const subLoopParameter = ref([])
const commit_uid = localStorage.getItem('central_control_comm_uid')
const device_name = localStorage.getItem('central_control_device_name')
const RiseSetOption = [
{ label: '0', value: 0 },
@ -194,320 +200,12 @@ const RiseSetOption = [
{ label: '延后60分钟', value: -60 },
]
RPC.post('/m9z/getLgnLatData', { comm_uid: commit_uid }).then(res => {
formField.value.lat = res.lat
formField.value.lgn = res.lgn
formField.value.loc = res.loc
})
RPC.post('/m9z/getSunRiseSet', { comm_uid: commit_uid }).then(res => {
formField.value.rise = res.rise
formField.value.set = res.set
})
RPC.post('/m9z/getDeviceTime', { comm_uid: commit_uid }).then(res => {
deviceTime.value = res.deviceTime
})
RPC.post('/m9z/getAllSubLoopParameter', { comm_uid: commit_uid }).then(res => {
subLoopParameter.value = res
// subLoopParameter.value = {
// "subLoopData": [
// {
// "DCVoltage": 0.5,
// "DCCurrent": 0,
// "DimmingValue": 70,
// "AlarmStatus": 9,
// "AlarmCode": "09 01",
// "RelayStatus": 1,
// "LoopAddress": "0x1",
// "SubModuleCount": 1,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": [
// {
// "OutputVoltage": 0,
// "OutputCurrent": 0,
// "CurrentPWMDuty": 0,
// "VoltagePWMDuty": 0,
// "DeviceAddress": "0x0",
// "ModuleLoopAddress": "0x0",
// "CurrentLimitPct": 0,
// "OperatingMode": 0,
// "ModuleVersion": 0,
// "RatedVoltageDuty": 0,
// "RatedCurrentDuty": 0,
// "RatedOutputVoltage": 0,
// "RatedOutputCurrent": 0
// }
// ]
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x1",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x2",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x4",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// }
// ],
// "totalP": 0
// }
})
const address = ref('')
RPC.post('/adl400/getMsgAddress', { comm_uid: commit_uid }).then(res => {
address.value = res
})
const week = ref('')
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
//
const updateTime = () => {
const now = new Date()
@ -523,16 +221,12 @@ const updateTime = () => {
}
const restartSystem = () => {
ElMessageBox.confirm(
`此操作将远程重启,是否继续?`,
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
RPC.post('/m9z/setRestart', { comm_uid: commit_uid }).then(res => {
ElMessageBox.confirm(`此操作将远程重启,是否继续?`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
RPC.post('/m9z/setRestart', { comm_uid: commit_uid }).then((res) => {
ElMessage.success('远程重启成功')
getInfo()
})
@ -540,24 +234,23 @@ const restartSystem = () => {
}
const save = () => {
ElMessageBox.confirm(
`此操作将保存配置,是否继续?`,
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
ElMessageBox.confirm(`此操作将保存配置,是否继续?`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
const params = {
"comm_uid": commit_uid,
"lat": Number(formField.value.lat),
"lgn": Number(formField.value.lgn),
"loc_str": formField.value.loc,
"rise": Number(formField.value.rise),
"set": Number(formField.value.set)
comm_uid: commit_uid,
lat: Number(formField.value.lat),
lgn: Number(formField.value.lgn),
loc_str: formField.value.loc,
rise: Number(formField.value.rise),
set: Number(formField.value.set),
}
Promise.all(RPC.post('/m9z/setDeviceLgnLatAndSunRsTime', params), RPC.post('/m9z/setDeviceTime', { "comm_uid": commit_uid, device_time: deviceTime.value })).then(res => {
Promise.all(
RPC.post('/m9z/setDeviceLgnLatAndSunRsTime', params),
RPC.post('/m9z/setDeviceTime', { comm_uid: commit_uid, device_time: deviceTime.value }),
).then((res) => {
ElMessage.success('操作成功')
})
})
@ -565,7 +258,7 @@ const save = () => {
const currentTableData = ref([])
const currentTitle = ref('')
const isShowDialog = ref(false)
const openDialog = item => {
const openDialog = (item) => {
isShowDialog.value = true
currentTableData.value = item.Modules
currentTitle.value = item.LoopAddress
@ -578,7 +271,325 @@ const goBack = () => {
let timeInterval = null
const isOnline = ref(false)
onMounted(() => {
RPC.post('/lightm/rtu/isOnline', { commUid: commit_uid }).then(res => {
console.log('/lightm/rtu/isOnlin', res)
isOnline.value = res
if (isOnline.value) {
RPC.post('/adl400/getMsgAddress', { comm_uid: commit_uid }).then((res) => {
address.value = res
})
RPC.post('/m9z/getLgnLatData', { comm_uid: commit_uid }).then((res) => {
formField.value.lat = res.lat
formField.value.lgn = res.lgn
formField.value.loc = res.loc
})
RPC.post('/m9z/getSunRiseSet', { comm_uid: commit_uid }).then((res) => {
formField.value.rise = res.rise
formField.value.set = res.set
})
RPC.post('/m9z/getDeviceTime', { comm_uid: commit_uid }).then((res) => {
deviceTime.value = res.deviceTime
})
RPC.post('/m9z/getAllSubLoopParameter', { comm_uid: commit_uid }).then((res) => {
subLoopParameter.value = res
// subLoopParameter.value = {
// "subLoopData": [
// {
// "DCVoltage": 0.5,
// "DCCurrent": 0,
// "DimmingValue": 70,
// "AlarmStatus": 9,
// "AlarmCode": "09 01",
// "RelayStatus": 1,
// "LoopAddress": "0x1",
// "SubModuleCount": 1,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": [
// {
// "OutputVoltage": 0,
// "OutputCurrent": 0,
// "CurrentPWMDuty": 0,
// "VoltagePWMDuty": 0,
// "DeviceAddress": "0x0",
// "ModuleLoopAddress": "0x0",
// "CurrentLimitPct": 0,
// "OperatingMode": 0,
// "ModuleVersion": 0,
// "RatedVoltageDuty": 0,
// "RatedCurrentDuty": 0,
// "RatedOutputVoltage": 0,
// "RatedOutputCurrent": 0
// }
// ]
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x1",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x2",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x4",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// }
// ],
// "totalP": 0
// }
})
} else {
ElMessage.error('设备不在线')
}
})
updateTime()
timeInterval = setInterval(updateTime, 1000)
})
@ -646,7 +657,7 @@ onUnmounted(() => {
box-sizing: border-box;
.main_item {
border: .5px solid #ddd;
border: 0.5px solid #ddd;
display: flex;
flex-direction: column;
height: 450px;
@ -657,9 +668,9 @@ onUnmounted(() => {
align-items: center;
height: 50px;
font-size: 16px;
background-color: #21232A;
color: #8088AA;
border-bottom: .5px solid #ddd;
background-color: #21232a;
color: #8088aa;
border-bottom: 0.5px solid #ddd;
}
.main_content {
@ -686,8 +697,8 @@ onUnmounted(() => {
.value {
text-align: center;
background-color: #21232A;
color: #8088AA;
background-color: #21232a;
color: #8088aa;
padding: 5px 10px;
min-height: 32px;
box-sizing: border-box;
@ -758,7 +769,6 @@ onUnmounted(() => {
}
}
.bottom-info {
display: flex;
justify-content: space-between;
@ -802,27 +812,26 @@ onUnmounted(() => {
}
.el-input {
background-color: #21232A;
background-color: #21232a;
}
:deep(.el-input__wrapper) {
background-color: #212329 !important;
box-shadow: none;
border: 1px soild #3B3D45;
border: 1px soild #3b3d45;
input {
color: #8088AA;
color: #8088aa;
}
}
:deep(.el-select__wrapper) {
background-color: #212329 !important;
box-shadow: none;
border: 1px soild #3B3D45;
border: 1px soild #3b3d45;
.el-select__placeholder {
color: #8088AA;
color: #8088aa;
}
}
</style>

@ -59,7 +59,9 @@ export default defineConfig({
open: true,
proxy: {
'/jsonrpc': {
target: 'https://lamp-dev.ruixininfo.com',
// target: 'https://lamp.ruixininfo.com',
target: 'https://smart-light.ruixininfo.com',
// target: 'http://171.208.94.46:7070',
changeOrigin: true,
secure: false,
},

Loading…
Cancel
Save