This commit is contained in:
JayJiaJun 2025-03-27 14:26:47 +08:00
parent d0fbb67812
commit feb5a9c1f5
2 changed files with 48 additions and 97 deletions

View File

@ -5,9 +5,9 @@
"author": "kerwincui",
"license": "AGPL3.0",
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"build:stage": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src",
"genrate:lang": "node build/lang.js"
@ -132,4 +132,4 @@
"> 1%",
"last 2 versions"
]
}
}

View File

@ -10,7 +10,7 @@
{{ $t('device.running-status.866086-0') }}
</template>
<el-link :underline="false" style="line-height: 28px; font-size: 16px; padding-right: 10px">{{ title
}}</el-link>
}}</el-link>
</el-descriptions-item>
<!-- 设备升级-->
<el-descriptions-item :labelStyle="statusColor">
@ -72,15 +72,17 @@
</div>
</div>
<div v-if="item.datatype.type == 'integer'">
<el-input v-model="item.shadow"
:placeholder="item.datatype.unit ? $t('device.running-status.866086-5', [item.datatype.unit]) : $t('device.running-status.866086-4')"
:disabled="shadowUnEnable || item.isReadonly == 1">
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, item)"
style="font-size: 20px" :title="$t('device.running-status.866086-6')"
v-if="!shadowUnEnable && item.isReadonly == 0">
</el-button>
</el-input>
<div style="width: 80%; float: left">
<el-slider v-model="item.shadow" :min="item.datatype.min" :max="item.datatype.max"
:step="item.datatype.step" :format-tooltip="(x) => x + ' ' + item.datatype.unit"
:disabled="shadowUnEnable || item.isReadonly == 1"></el-slider>
</div>
<div style="width: 20%; float: left">
<el-button icon="el-icon-s-promotion" type="info" @click="mqttPublish(deviceInfo, item)"
style="font-size: 16px; padding: 1px 8px; margin: 4px 0 0 10px; border-radius: 3px"
:title="$t('device.running-status.866086-6')"
v-if="!shadowUnEnable && item.isReadonly == 0"></el-button>
</div>
</div>
<div v-if="item.datatype.type == 'object'">
<el-descriptions :column="1" size="mini" border>
@ -356,12 +358,15 @@
</div>
</el-descriptions-item>
</el-descriptions>
<!-- 监测图表 -->
<el-form ref="elForm" :model="elForm" label-width="120px">
<el-row style="background-color: #f5f7fa; padding: 20px 10px; border-radius: 15px;">
<div>
</el-col>
<!-- 检测图表部分 -->
<el-col :xs="24" :sm="24" :md="24" :lg="10" :xl="14">
<!-- 设备监测图表-->
<template v-if="deviceInfo.productName === '机械压力表' && deviceInfo.chartList && deviceInfo.chartList.length >= 2">
<!-- 机械压力表的监测图表 -->
<el-row style="background-color: #f5f7fa; padding: 20px 10px; border-radius: 15px;">
<div>
<el-form>
<!-- 第一项 -->
<el-col :xs="24" :sm="24" :md="24" :lg="14" :xl="10">
<div>
@ -387,84 +392,30 @@
<img src="../../../assets/press/电池.svg" style="width: 20px; height: 20px; margin-right: 5px;">
<span style="font-size: 24px;">{{ deviceInfo.chartList[1].name }}</span>
</template>
<!-- 设置输入框的宽度 -->
<el-input v-model="deviceInfo.chartList[1].value" readonly style="width: 150px;">
<template slot="suffix">MV</template>
</el-input>
</el-form-item>
</div>
</el-col>
</div>
</el-row>
</el-form>
</el-form>
</div>
</el-row>
</template>
<template v-else>
<!-- 原来的图表 -->
<el-row :gutter="20"
style="background-color: #f5f7fa; padding: 20px 10px 20px 10px; border-radius: 15px; margin-right: 5px"
v-if="deviceInfo.chartList.length > 0">
<el-col :xs="24" :sm="12" :md="12" :lg="24" :xl="8" v-for="(item, index) in deviceInfo.chartList"
:key="index">
<el-card shadow="hover" style="border-radius: 30px; margin-bottom: 20px">
<div ref="map" style="height: 230px; width: 185px; margin: 0 auto"></div>
</el-card>
</el-col>
</el-row>
</template>
</el-col>
<!-- <el-col :xs="24" :sm="24" :md="24" :lg="10" :xl="14">
<el-row :gutter="20"
style="background-color: #f5f7fa; padding: 20px 10px 20px 10px; border-radius: 15px; margin-right: 5px"
v-if="deviceInfo.chartList.length > 0">
<el-col :xs="24" :sm="12" :md="12" :lg="24" :xl="8" v-for="(item, index) in deviceInfo.chartList"
:key="index">
<el-card shadow="hover" style="border-radius: 30px; margin-bottom: 20px">
<div ref="map" style="height: 230px; width: 185px; margin: 0 auto"></div>
</el-card>
</el-col>
</el-row>
</el-col> -->
<!-- 监测图表 -->
<!-- <el-col :xs="24" :sm="24" :md="24" :lg="10" :xl="14">
<el-form ref="elForm" :model="elForm" label-width="120px">
<el-row :gutter="20" style="background-color: #f5f7fa; padding: 20px 10px; border-radius: 15px;">
<div>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<div
style="display: flex; font-size: 30px; flex-direction: column; margin-top: 15px; text-align: left; margin-right: 20px;">
<el-form-item style="flex: 1;">
<template slot="label">
<img src="../../../assets/press/压力.svg" style="width: 20px; height: 20px; margin-right: 5px;">
<span style="font-size: 24px;">{{ deviceInfo.chartList[0].name }}</span>
</template>
<el-input v-model="deviceInfo.chartList[0].value" readonly style="width: 150px;">
<template slot="suffix">MP</template>
</el-input>
</el-form-item>
</div>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<div
style="display: flex; font-size: 30px; flex-direction: column; margin-top: 15px; text-align: left; margin-right: 20px;">
<el-form-item style="flex: 1;">
<template slot="label">
<img src="../../../assets/press/电池.svg" style="width: 20px; height: 20px; margin-right: 5px;">
<span style="font-size: 24px;">{{ deviceInfo.chartList[1].name }}</span>
</template>
<el-input v-model="deviceInfo.chartList[1].value" readonly style="width: 150px;">
<template slot="suffix">MV</template>
</el-input>
</el-form-item>
</div>
</el-col>
</div>
</el-row>
</el-form>
</el-col> -->
</el-row>
<!-- 添加或修改产品固件对话框 -->
@ -478,20 +429,20 @@
:labelStyle="{ width: '150px', 'font-weight': 'bold' }">
<template slot="title">
<el-link icon="el-icon-success" type="success" :underline="false">{{ $t('device.running-status.866086-12')
}}</el-link>
}}</el-link>
</template>
<el-descriptions-item :label="$t('device.running-status.866086-13')">{{ firmware.firmwareName
}}</el-descriptions-item>
}}</el-descriptions-item>
<el-descriptions-item :label="$t('device.device-edit.148398-4')">{{ firmware.productName
}}</el-descriptions-item>
}}</el-descriptions-item>
<el-descriptions-item :label="$t('device.device-edit.148398-12')">Version {{ firmware.version
}}</el-descriptions-item>
}}</el-descriptions-item>
<el-descriptions-item :label="$t('device.running-status.866086-16')">
<el-link :href="getDownloadUrl(firmware.filePath)" :underline="false" type="primary">{{
getDownloadUrl(firmware.filePath) }}</el-link>
</el-descriptions-item>
<el-descriptions-item :label="$t('device.running-status.866086-17')">{{ firmware.remark
}}</el-descriptions-item>
}}</el-descriptions-item>
</el-descriptions>
<div slot="footer" class="dialog-footer">
<el-button type="success" @click="otaUpgrade"
@ -751,7 +702,7 @@ export default {
remoteCommand: command,
identifier: model.id,
modelName: model.name,
isShadow: device.status = true,
isShadow: device.status != 3,
type: model.type,
};
serviceInvoke(data).then((response) => {