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", "author": "kerwincui",
"license": "AGPL3.0", "license": "AGPL3.0",
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build:prod": "vue-cli-service build", "build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging", "build:stage": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode staging",
"preview": "node build/index.js --preview", "preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src", "lint": "eslint --ext .js,.vue src",
"genrate:lang": "node build/lang.js" "genrate:lang": "node build/lang.js"

View File

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