+
调光通道{{ index + 1 }}
{{ channel.pwm }}%
@@ -120,7 +132,7 @@
-
+
调光通道{{ index + 6 }}
{{ channel.pwm }}%
@@ -128,7 +140,9 @@
-
+
@@ -184,6 +198,7 @@ import { ref, onMounted, onUnmounted, watch } from 'vue'
import { useRouter } from 'vue-router'
import RPC from '@/utils/rpc'
import dayjs from 'dayjs'
+// import Linechart from '@/components/Linechart.vue';
const commit_uid = localStorage.getItem('central_control_comm_uid')
@@ -231,77 +246,107 @@ const energyParams = ref({
const info = ref({
- "disable": false,
+ "Mode": 0,
"backup_byte1": 0,
- "loops": [
+ "Loops": [
{
"index": 0,
"name": "#1",
"is_open": false,
- "pwm": 0
+ "pwm": 0,
+ A: 0,
+ V: 0,
+ Kw: 0,
},
{
"index": 1,
"name": "#2",
"is_open": false,
- "pwm": 0
+ "pwm": 0,
+ A: 0,
+ V: 0,
+ Kw: 0,
},
{
"index": 2,
"name": "#3",
"is_open": false,
- "pwm": 0
+ "pwm": 0,
+ A: 0,
+ V: 0,
+ Kw: 0,
},
{
"index": 3,
"name": "#4",
"is_open": false,
- "pwm": 0
+ "pwm": 0,
+ A: 0,
+ V: 0,
+ Kw: 0,
},
{
"index": 4,
"name": "#5",
"is_open": false,
- "pwm": 0
+ "pwm": 0,
+ A: 0,
+ V: 0,
+ Kw: 0,
},
{
"index": 5,
"name": "#6",
"is_open": false,
- "pwm": 0
+ "pwm": 0,
+ A: 0,
+ V: 0,
+ Kw: 0,
},
{
"index": 6,
"name": "#7",
"is_open": false,
- "pwm": 0
+ "pwm": 0,
+ A: 0,
+ V: 0,
+ Kw: 0,
},
{
"index": 7,
"name": "#8",
"is_open": false,
- "pwm": 0
+ "pwm": 0,
+ A: 0,
+ V: 0,
+ Kw: 0,
},
{
"index": 8,
"name": "#9",
"is_open": false,
- "pwm": 0
+ "pwm": 0,
+ A: 0,
+ V: 0,
+ Kw: 0,
},
{
"index": 9,
"name": "#10",
"is_open": false,
- "pwm": 0
+ "pwm": 0,
+ A: 0,
+ V: 0,
+ Kw: 0,
}
],
"backup_byte4": 0
})
const getInfo = () => {
- RPC.post('/m9z/getDeviceManualInfo', { comm_uid: commit_uid }).then(res => {
- info.value = res
- })
+ // RPC.post('/m9z/getDeviceManualInfo', { comm_uid: commit_uid }).then(res => {
+ // info.value = res
+ // })
RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
powerPhases.value[0].voltage = res.aVoltage + 'V'
powerPhases.value[0].current = res.aElectricCurrent + 'A'
@@ -321,6 +366,10 @@ const getInfo = () => {
energyParams.value.activeEnergy = res.activeEnergy + 'A'
energyParams.value.powerFactor = res.powerFactor
})
+ RPC.post('/m9z/getDeviceStatus2', { comm_uid: commit_uid }).then((res) => {
+ // 直流电流、电源、功率
+ info.value = res
+ })
// RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
// sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
@@ -329,6 +378,15 @@ const getInfo = () => {
}
getInfo()
+const timer = setInterval(() => {
+ console.log('setInterval')
+ getInfo()
+}, 30000)
+
+onUnmounted(() => {
+ clearInterval(timer)
+})
+
const oldInfo = ref('')
// watch(info, () => {
// if (oldInfo.value === JSON.stringify(info.value)) return
@@ -578,20 +636,41 @@ onUnmounted(() => {
.circuit-section {
display: flex;
flex-direction: column;
- gap: 20px;
+ gap: 10px;
}
.circuit-row {
display: flex;
justify-content: space-between;
font-size: 12px;
+
+ .circuitStatus {
+ color: #fff;
+ width: 100%;
+
+ .line {
+ width: 100%;
+ display: flex;
+ margin-top: 10px;
+ display: flex;
+ justify-content: space-between;
+
+ .line_item {
+ width: 45%;
+ // flex: 1;
+ flex-shrink: 0;
+ display: flex;
+ justify-content: space-between;
+ }
+ }
+ }
}
.circuit-item {
display: flex;
flex-direction: column;
align-items: center;
- gap: 10px;
+ // gap: 10px;
width: 18%;
}
@@ -867,4 +946,9 @@ onUnmounted(() => {
gap: 20px;
padding-top: 20px;
}
+
+.chart {
+ width: 100%;
+ height: 400px;
+}