【Element】el-form-item 下 slot="label" 使用 el-tooltip 不显示的问题

在不使用label-width和label-action属性的Vue项目中,遇到el-form-item的label插槽内放置的el-tooltip无法正常显示的问题。解决方案是调整标签的样式,移除浮动设置,从而使el-tooltip能够在label区域内正确显示。

问题描述

el-form-item 使用 label 插槽放入 el-tooltip 不显示(未使用 label-width 和 label-action 属性的情况下)。

image

image

解决方法

将标签的样式修改,去掉浮动。

image

成功!!!

image

<template> <el-dialog :title="!dataForm.id ? '新增电池信息' : '修改电池信息'" :close-on-click-modal="false" :visible.sync="visible" width="80%" top="5vh" class="custom-dialog" @close="resetForm" > <el-tabs v-model="activeTab" type="border-card"> <el-tab-pane label="基础信息" name="basic"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="180px" size="small" > <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="电池ID" prop="batteryId"> <el-input v-model="dataForm.batteryId" placeholder="请输入电池ID"></el-input> </el-form-item> <el-form-item label="电池类型" prop="batteryKind"> <el-select v-model="dataForm.batteryKind" placeholder="请选择电池类型" clearable style="width:100%" > <el-option label="运营" :value="0"></el-option> <el-option label="售后" :value="1"></el-option> <el-option label="内测" :value="2"></el-option> <el-option label="报废" :value="3"></el-option> </el-select> </el-form-item> <el-form-item label="电池电压(V)" prop="batteryVoltage"> <el-input-number v-model="dataForm.batteryVoltage" :min="0" :precision="2" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="电池电流(A)" prop="batteryCurrent"> <el-input-number v-model="dataForm.batteryCurrent" :min="0" :precision="2" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="电池SOC(%)" prop="batterySoc"> <el-input-number v-model="dataForm.batterySoc" :min="0" :max="100" :precision="0" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="工作模式" prop="batteryWorkMode"> <el-select v-model="dataForm.batteryWorkMode" placeholder="请选择工作模式" clearable style="width:100%" > <el-option label="放电模式(0x01)" :value="1"></el-option> <el-option label="充电模式(0x10)" :value="16"></el-option> <el-option label="保护模式(0x21)" :value="33"></el-option> <el-option label="待机无输出模式(0x30)" :value="48"></el-option> <el-option label="待机预放电模式(0x31)" :value="49"></el-option> <el-option label="故障需返厂(0xFF)" :value="255"></el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="最高温度(℃)" prop="batteryTemperatureMax"> <el-input-number v-model="dataForm.batteryTemperatureMax" :min="-50" :max="100" :precision="1" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="最低温度(℃)" prop="batteryTemperatureMin"> <el-input-number v-model="dataForm.batteryTemperatureMin" :min="-50" :max="100" :precision="1" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="最高电压(V)" prop="batteryVoltageMax"> <el-input-number v-model="dataForm.batteryVoltageMax" :min="0" :precision="2" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="最低电压(V)" prop="batteryVoltageMin"> <el-input-number v-model="dataForm.batteryVoltageMin" :min="0" :precision="2" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="循环次数" prop="batteryCycleTimes"> <el-input-number v-model="dataForm.batteryCycleTimes" :min="0" :precision="0" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> </el-col> </el-row> </el-form> </el-tab-pane> <el-tab-pane label="状态信息" name="status"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="180px" size="small" > <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="保护状态码" prop="batteryProtectCode"> <el-input v-model="dataForm.batteryProtectCode" placeholder="16位二进制保护状态码"> <el-tooltip slot="append" content="保护状态 bit16~bit 31 保留 bit15:Gsensor 故障 bit14:BMS 与 Tracker通讯超时 bit13: 预放电失败 bit12: IC保护 bit11: 智能充电通信超时 bit10:压差过大 bit9:温差过大 bit8:短路 bit7:充电过压 bit6:充电过流 bit5:放电欠压 bit4:放电过流 bit3:充电低温 bit2:充电高温 bit1:放电高温 bit0:放电低温" placement="top" :open-delay="500"> <el-button icon="el-icon-question"></el-button> </el-tooltip> </el-input> </el-form-item> <el-form-item label="故障状态码" prop="batteryErrorCode"> <el-input v-model="dataForm.batteryErrorCode" placeholder="16位二进制故障状态码"> <el-tooltip slot="append" content="转成2进制, 总共为16位,高8位为电池包工作状态,低8位为故障状态码 bit9BMS 与 Tracker通讯故障,bit8BMS 板 G sensor损坏,(8/9无效)bit7:失效,bit6:失衡,bit5:放电 MOS 损坏,bit4:充电 MOS 损坏,bit3IC 损坏,bit2:温度传感器损坏,bit1:采样线断线,虚焊等故障 保留,置 0,bit0:保留" placement="top" :open-delay="500"> <el-button icon="el-icon-question"></el-button> </el-tooltip> </el-input> </el-form-item> <el-form-item label="MOS状态" prop="mosStatus"> <el-input v-model="dataForm.mosStatus" placeholder="MOS状态"></el-input> </el-form-item> <el-form-item label="MOS温度(℃)" prop="mosTemp"> <el-input-number v-model="dataForm.mosTemp" :min="-50" :max="150" :precision="1" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="稳定状态" prop="steadyStatus"> <el-input v-model="dataForm.steadyStatus" placeholder="稳定状态"></el-input> </el-form-item> <el-form-item label="单体电压(V)" prop="cellVoltage"> <el-input-number v-model="dataForm.cellVoltage" :min="0" :precision="2" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="业务模式" prop="businessmode"> <el-select v-model="dataForm.businessmode" placeholder="请选择业务模式" clearable style="width:100%" > <el-option label="关机模式(1)" :value="1"></el-option> <el-option label="运营模式(2)" :value="2"></el-option> <el-option label="运输模式(3)" :value="3"></el-option> <el-option label="通讯充电模式(4)" :value="4"></el-option> <el-option label="盲充模式(5)" :value="5"></el-option> <el-option label="存储模式(6)" :value="6"></el-option> <el-option label="搜寻模式(7)" :value="7"></el-option> <el-option label="返厂模式(8)" :value="8"></el-option> </el-select> </el-form-item> <el-form-item label="数据标志" prop="flag"> <el-select v-model="dataForm.flag" placeholder="请选择数据标志" clearable style="width:100%" > <el-option label="设备主动上报(1)" :value="1"></el-option> <el-option label="平台主动推送(2)" :value="2"></el-option> <el-option label="平台指令反馈(3)" :value="3"></el-option> </el-select> </el-form-item> </el-col> </el-row> </el-form> </el-tab-pane> <el-tab-pane label="设备信息" name="device"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="180px" size="small" > <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="设备型号" prop="model"> <el-input v-model="dataForm.model" placeholder="设备型号"></el-input> </el-form-item> <el-form-item label="制造商" prop="manufacture"> <el-input v-model="dataForm.manufacture" placeholder="制造商"></el-input> </el-form-item> <el-form-item label="IMEI" prop="imei"> <el-input v-model="dataForm.imei" placeholder="IMEI"></el-input> </el-form-item> <el-form-item label="IMSI" prop="imsi"> <el-input v-model="dataForm.imsi" placeholder="IMSI"></el-input> </el-form-item> <el-form-item label="ICCID" prop="iccid"> <el-input v-model="dataForm.iccid" placeholder="ICCID"></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="硬件版本" prop="trackerHardwareVersion"> <el-input v-model="dataForm.trackerHardwareVersion" placeholder="硬件版本"></el-input> </el-form-item> <el-form-item label="软件版本" prop="trackerSoftwareVersion"> <el-input v-model="dataForm.trackerSoftwareVersion" placeholder="软件版本"></el-input> </el-form-item> <el-form-item label="上报原因" prop="reportreason"> <el-input v-model="dataForm.reportreason" placeholder="上报原因"></el-input> </el-form-item> <el-form-item label="检测状态" prop="detstatus"> <el-input v-model="dataForm.detstatus" placeholder="检测状态"></el-input> </el-form-item> <el-form-item label="信号强度" prop="csq"> <el-input-number v-model="dataForm.csq" :min="0" :max="31" :precision="0" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> </el-col> </el-row> </el-form> </el-tab-pane> <el-tab-pane label="位置信息" name="location"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="180px" size="small" > <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="网络类型" prop="networkType"> <el-input v-model="dataForm.networkType" placeholder="网络类型"></el-input> </el-form-item> <el-form-item label="定位模式" prop="locationMode"> <el-input v-model="dataForm.locationMode" placeholder="定位模式"></el-input> </el-form-item> <el-form-item label="经度" prop="longitude"> <el-input-number v-model="dataForm.longitude" :min="-180" :max="180" :precision="6" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="经度方向" prop="longitudeDirection"> <el-select v-model="dataForm.longitudeDirection" placeholder="请选择方向" clearable style="width:100%" > <el-option label="东经(E)" value="E"></el-option> <el-option label="西经(W)" value="W"></el-option> </el-select> </el-form-item> <el-form-item label="纬度" prop="latitude"> <el-input-number v-model="dataForm.latitude" :min="-90" :max="90" :precision="6" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="纬度方向" prop="latitudeDirection"> <el-select v-model="dataForm.latitudeDirection" placeholder="请选择方向" clearable style="width:100%" > <el-option label="北纬(N)" value="N"></el-option> <el-option label="南纬(S)" value="S"></el-option> </el-select> </el-form-item> <el-form-item label="GPS速度(km/h)" prop="gpsSpeed"> <el-input-number v-model="dataForm.gpsSpeed" :min="0" :precision="2" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="GPS信号" prop="gpsSignal"> <el-input-number v-model="dataForm.gpsSignal" :min="0" :precision="0" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="卫星数量" prop="satelliteNum"> <el-input-number v-model="dataForm.satelliteNum" :min="0" :max="32" :precision="0" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> <el-form-item label="定位精度(m)" prop="accuracy"> <el-input-number v-model="dataForm.accuracy" :min="0" :precision="2" controls-position="right" style="width:100%" ></el-input-number> </el-form-item> </el-col> </el-row> </el-form> </el-tab-pane> </el-tabs> <span slot="footer" class="dialog-footer"> <el-button @click="visible = false">取消</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button> </span> </el-dialog> </template> <script> export default { data () { // 验证16位二进制码的自定义规则 const validateBinary16 = (rule, value, callback) => { if (!value) { callback(new Error('能为空')); } else if (!/^[01]{16}$/.test(value)) { callback(new Error('必须是16位二进制数(由0和1组成)')); } else { callback(); } }; return { visible: false, activeTab: 'basic', // 当前激活的标签页 dataForm: { id: 0, batteryKind: null, // 新增的电池类型字段 batteryId: '', batteryVoltage: '', batteryCurrent: '', batterySoc: '', batteryHardVersion: '', batterySoftVersion: '', batteryWorkMode: '', batteryProtectCode: '', batteryErrorCode: '', batteryTemperatureMax: '', batteryTemperatureMin: '', batteryVoltageMax: '', batteryVoltageMin: '', mosStatus: '', mosTemp: '', batteryCycleTimes: '', steadyStatus: '', cellVoltage: '', model: '', manufacture: '', imei: '', imsi: '', iccid: '', trackerHardwareVersion: '', trackerSoftwareVersion: '', reportreason: '', detstatus: '', csq: '', networkType: '', locationMode: '', longitude: '', longitudeDirection: '', latitude: '', latitudeDirection: '', gpsSpeed: '', gpsSignal: '', satelliteNum: '', accuracy: '', businessmode: '', flag: '', uploadTime: '', createTime: '', updateTime: '' }, dataRule: { batteryId: [ { required: true, message: '请输入电池ID', trigger: 'blur' } ], batteryKind: [ { required: true, message: '请选择电池类型', trigger: 'change' } ], batteryVoltage: [ { required: true, message: '请输入电池电压', trigger: 'blur' }, { type: 'number', message: '必须为数字值' } ], batteryCurrent: [ { required: true, message: '请输入电池电流', trigger: 'blur' }, { type: 'number', message: '必须为数字值' } ], batterySoc: [ { required: true, message: '请输入电池SOC', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: 0, max: 100 } ], batteryWorkMode: [ { required: true, message: '请选择工作模式', trigger: 'change' } ], batteryProtectCode: [ { required: true, validator: validateBinary16, trigger: 'blur' } ], batteryErrorCode: [ { required: true, validator: validateBinary16, trigger: 'blur' } ], batteryTemperatureMax: [ { required: true, message: '请输入最高温度', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: -50, max: 100 } ], batteryTemperatureMin: [ { required: true, message: '请输入最低温度', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: -50, max: 100 } ], batteryVoltageMax: [ { required: true, message: '请输入最高电压', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: 0 } ], batteryVoltageMin: [ { required: true, message: '请输入最低电压', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: 0 } ], mosStatus: [ { required: true, message: '请输入MOS状态', trigger: 'blur' } ], mosTemp: [ { required: true, message: '请输入MOS温度', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: -50, max: 150 } ], batteryCycleTimes: [ { required: true, message: '请输入循环次数', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: 0 } ], steadyStatus: [ { required: true, message: '请输入稳定状态', trigger: 'blur' } ], cellVoltage: [ { required: true, message: '请输入单体电压', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: 0 } ], model: [ { required: true, message: '请输入设备型号', trigger: 'blur' } ], manufacture: [ { required: true, message: '请输入制造商', trigger: 'blur' } ], imei: [ { required: true, message: '请输入IMEI', trigger: 'blur' } ], imsi: [ { required: true, message: '请输入IMSI', trigger: 'blur' } ], iccid: [ { required: true, message: '请输入ICCID', trigger: 'blur' } ], trackerHardwareVersion: [ { required: true, message: '请输入硬件版本', trigger: 'blur' } ], trackerSoftwareVersion: [ { required: true, message: '请输入软件版本', trigger: 'blur' } ], reportreason: [ { required: true, message: '请输入上报原因', trigger: 'blur' } ], detstatus: [ { required: true, message: '请输入检测状态', trigger: 'blur' } ], csq: [ { required: true, message: '请输入信号强度', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: 0, max: 31 } ], networkType: [ { required: true, message: '请输入网络类型', trigger: 'blur' } ], locationMode: [ { required: true, message: '请输入定位模式', trigger: 'blur' } ], longitude: [ { required: true, message: '请输入经度', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: -180, max: 180 } ], longitudeDirection: [ { required: true, message: '请选择经度方向', trigger: 'change' } ], latitude: [ { required: true, message: '请输入纬度', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: -90, max: 90 } ], latitudeDirection: [ { required: true, message: '请选择纬度方向', trigger: 'change' } ], gpsSpeed: [ { required: true, message: '请输入GPS速度', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: 0 } ], gpsSignal: [ { required: true, message: '请输入GPS信号', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: 0 } ], satelliteNum: [ { required: true, message: '请输入卫星数量', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: 0, max: 32 } ], accuracy: [ { required: true, message: '请输入定位精度', trigger: 'blur' }, { type: 'number', message: '必须为数字值', min: 0 } ], businessmode: [ { required: true, message: '请选择业务模式', trigger: 'change' } ], flag: [ { required: true, message: '请选择数据标志', trigger: 'change' } ], uploadTime: [ { required: true, message: '请选择上传时间', trigger: 'change' } ], createTime: [ { required: true, message: '请选择创建时间', trigger: 'change' } ], updateTime: [ { required: true, message: '请选择更新时间', trigger: 'change' } ] } } }, methods: { init (id) { this.dataForm.id = id || 0 this.visible = true this.$nextTick(() => { this.$refs['dataForm'].resetFields() if (this.dataForm.id) { this.$http({ url: this.$http.adornUrl(`/maya/mybatteryinfolastest/info/${this.dataForm.id}`), method: 'get', params: this.$http.adornParams() }).then(({data}) => { if (data && data.code === 0) { this.dataForm = { ...this.dataForm, ...data.myBatteryInfoLastest } } }) } }) }, // 重置表单 resetForm() { if (this.$refs['dataForm']) { this.$refs['dataForm'].resetFields(); this.activeTab = 'basic'; } }, // 表单提交 dataFormSubmit () { this.$refs['dataForm'].validate((valid) => { if (valid) { this.$http({ url: this.$http.adornUrl(`/maya/mybatteryinfolastest/${!this.dataForm.id ? 'save' : 'update'}`), method: 'post', data: this.$http.adornData({ ...this.dataForm }) }).then(({data}) => { if (data && data.code === 0) { this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => { this.visible = false this.$emit('refreshDataList') } }) } else { this.$message.error(data.msg) } }) } }) } } } </script> <style scoped> .custom-dialog >>> .el-dialog__body { padding: 20px 30px; max-height: 70vh; overflow-y: auto; } .custom-dialog >>> .el-tabs--border-card { box-shadow: none; border: none; } .custom-dialog >>> .el-tabs__content { padding: 15px; } .custom-dialog >>> .el-tabs__item { font-weight: bold; } .custom-dialog >>> .el-tabs__item.is-active { color: #409EFF; background-color: #f5f7fa; } .custom-dialog >>> .el-tabs--border-card > .el-tabs__header { background-color: #f5f7fa; border-bottom: 1px solid #e4e7ed; } .custom-dialog >>> .el-form-item { margin-bottom: 20px; } .custom-dialog >>> .el-input-number { width: 100%; } .custom-dialog >>> .el-select { width: 100%; } </style> 根据这些Map<String, Object> mapinfo = new HashMap<String, Object>(); mapinfo.put("battery_id", device_id); //device_id mapinfo.put("upload_time", uploadtime); mapinfo.put("payload", data); mapinfo.put("create_time", DateUtils.getCurrentDateTime()); //mapinfo.put("topic", topic); if("getBatteryInfo".equals(topic_arr[5].trim())){ // 查询电池数据 //mapinfo.put("battery_id", data_arr[0]); //device_id //mapinfo.put("upload_time", uploadtime); //mapinfo.put("payload", data); mapinfo.put("imei", data_arr[1]); mapinfo.put("iccid", data_arr[2]); mapinfo.put("longitude_direction", data_arr[3]); mapinfo.put("longitude", data_arr[4]); mapinfo.put("latitude_direction", data_arr[5]); mapinfo.put("latitude", data_arr[6]); mapinfo.put("gpsSpeed", data_arr[7]); mapinfo.put("battery_soft_version", data_arr[8]); mapinfo.put("tracker_software_version", data_arr[9]); mapinfo.put("gps_signal", data_arr[10]); mapinfo.put("satellite_num", data_arr[11]); mapinfo.put("soc", data_arr[12]); mapinfo.put("battery_cycle_times", data_arr[13]); mapinfo.put("battery_temperature_max", data_arr[14]); mapinfo.put("battery_temperature_min", data_arr[15]); mapinfo.put("mos_temp", data_arr[16]); mapinfo.put("battery_voltage", data_arr[17]); mapinfo.put("battery_voltage_max", data_arr[18]); mapinfo.put("battery_voltage_min", data_arr[19]); mapinfo.put("battery_work_mode", data_arr[20]); mapinfo.put("mos_status", data_arr[21]); mapinfo.put("battery_current", data_arr[22]); mapinfo.put("cell_voltage", data_arr[23]); mapinfo.put("steady_status", data_arr[24]); mapinfo.put("battery_error_code", data_arr[25]); //mapinfo.put("create_time", DateUtils.getCurrentDateTime()); mapinfo.put("flag", 3); // 1:设备主动请求或上报 2:平台主动推送或下指令 3:平台指令反馈的结果 Integer batteryKind=(Integer) SqlUtils.queryInfoOne(Config.getConfigBean().getDatasourcesBean().getDatasourceBean().get(0).getAlias() , "getBatteryKindByImei", mapinfo); mapinfo.put("battery_kind",Objects.isNull(batteryKind)?2:batteryKind);有的字段全部判断为可编辑,除了电池类型,帮我修改该页面
07-22
<template> <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> <el-form-item label="" prop="batteryId"> <el-input v-model="dataForm.batteryId" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="batteryVoltage"> <el-input v-model="dataForm.batteryVoltage" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="batteryCurrent"> <el-input v-model="dataForm.batteryCurrent" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="batterySoc"> <el-input v-model="dataForm.batterySoc" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="batteryHardVersion"> <el-input v-model="dataForm.batteryHardVersion" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="batterySoftVersion"> <el-input v-model="dataForm.batterySoftVersion" placeholder=""></el-input> </el-form-item> <el-form-item label="0x01(1):放电模式 0x10(16):充电模式 0x21(33):保护模式 0x30(48):待机无输出模式 0x31(49):待机预放电模式 0xFF(255):故障需返厂" prop="batteryWorkMode"> <el-input v-model="dataForm.batteryWorkMode" placeholder="0x01(1):放电模式 0x10(16):充电模式 0x21(33):保护模式 0x30(48):待机无输出模式 0x31(49):待机预放电模式 0xFF(255):故障需返厂"></el-input> </el-form-item> <el-form-item label="保护状态 bit16~bit 31 保留 bit15:Gsensor 故障 bit14:BMS 与 Tracker通讯超时 bit13: 预放电失败 bit12: IC保护 bit11: 智能充电通信超时 bit10:压差过大 bit9:温差过大 bit8:短路 bit7:充电过压 bit6:充电过流 bit5:放电欠压 bit4:放电过流 bit3:充电低温 bit2:充电高温 bit1:放电高温 bit0:放电低温" prop="batteryProtectCode"> <el-input v-model="dataForm.batteryProtectCode" placeholder="保护状态 bit16~bit 31 保留 bit15:Gsensor 故障 bit14:BMS 与 Tracker通讯超时 bit13: 预放电失败 bit12: IC保护 bit11: 智能充电通信超时 bit10:压差过大 bit9:温差过大 bit8:短路 bit7:充电过压 bit6:充电过流 bit5:放电欠压 bit4:放电过流 bit3:充电低温 bit2:充电高温 bit1:放电高温 bit0:放电低温"></el-input> </el-form-item> <el-form-item label="转成2进制, 总共为16位,高8位为电池包工作状态,低8位为故障状态码 bit9BMS 与 Tracker通讯故障,bit8BMS 板 G sensor损坏,(8/9无效)bit7:失效,bit6:失衡,bit5:放电 MOS 损坏,bit4:充电 MOS 损坏,bit3IC 损坏,bit2:温度传感器损坏,bit1:采样线断线,虚焊等故障 保留,置 0,bit0:保留" prop="batteryErrorCode"> <el-input v-model="dataForm.batteryErrorCode" placeholder="转成2进制, 总共为16位,高8位为电池包工作状态,低8位为故障状态码 bit9BMS 与 Tracker通讯故障,bit8BMS 板 G sensor损坏,(8/9无效)bit7:失效,bit6:失衡,bit5:放电 MOS 损坏,bit4:充电 MOS 损坏,bit3IC 损坏,bit2:温度传感器损坏,bit1:采样线断线,虚焊等故障 保留,置 0,bit0:保留"></el-input> </el-form-item> <el-form-item label="" prop="batteryTemperatureMax"> <el-input v-model="dataForm.batteryTemperatureMax" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="batteryTemperatureMin"> <el-input v-model="dataForm.batteryTemperatureMin" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="batteryVoltageMax"> <el-input v-model="dataForm.batteryVoltageMax" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="batteryVoltageMin"> <el-input v-model="dataForm.batteryVoltageMin" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="mosStatus"> <el-input v-model="dataForm.mosStatus" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="mosTemp"> <el-input v-model="dataForm.mosTemp" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="batteryCycleTimes"> <el-input v-model="dataForm.batteryCycleTimes" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="steadyStatus"> <el-input v-model="dataForm.steadyStatus" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="cellVoltage"> <el-input v-model="dataForm.cellVoltage" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="model"> <el-input v-model="dataForm.model" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="manufacture"> <el-input v-model="dataForm.manufacture" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="imei"> <el-input v-model="dataForm.imei" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="imsi"> <el-input v-model="dataForm.imsi" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="iccid"> <el-input v-model="dataForm.iccid" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="trackerHardwareVersion"> <el-input v-model="dataForm.trackerHardwareVersion" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="trackerSoftwareVersion"> <el-input v-model="dataForm.trackerSoftwareVersion" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="reportreason"> <el-input v-model="dataForm.reportreason" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="detstatus"> <el-input v-model="dataForm.detstatus" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="csq"> <el-input v-model="dataForm.csq" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="networkType"> <el-input v-model="dataForm.networkType" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="locationMode"> <el-input v-model="dataForm.locationMode" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="longitude"> <el-input v-model="dataForm.longitude" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="longitudeDirection"> <el-input v-model="dataForm.longitudeDirection" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="latitude"> <el-input v-model="dataForm.latitude" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="latitudeDirection"> <el-input v-model="dataForm.latitudeDirection" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="gpsSpeed"> <el-input v-model="dataForm.gpsSpeed" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="gpsSignal"> <el-input v-model="dataForm.gpsSignal" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="satelliteNum"> <el-input v-model="dataForm.satelliteNum" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="accuracy"> <el-input v-model="dataForm.accuracy" placeholder=""></el-input> </el-form-item> <el-form-item label="业务模式 1:关机模式 2:运营模式 3:运输模式 4:通讯充电模式 5:盲充模式 6:存储模式 7:搜寻模式 8:返厂模式" prop="businessmode"> <el-input v-model="dataForm.businessmode" placeholder="业务模式 1:关机模式 2:运营模式 3:运输模式 4:通讯充电模式 5:盲充模式 6:存储模式 7:搜寻模式 8:返厂模式"></el-input> </el-form-item> <el-form-item label="1:设备主动请求或上报 2:平台主动推送或下指令 3:平台指令反馈的结果" prop="flag"> <el-input v-model="dataForm.flag" placeholder="1:设备主动请求或上报 2:平台主动推送或下指令 3:平台指令反馈的结果"></el-input> </el-form-item> <el-form-item label="" prop="uploadTime"> <el-input v-model="dataForm.uploadTime" placeholder=""></el-input> </el-form-item> <el-form-item label="" prop="createTime"> <el-input v-model="dataForm.createTime" placeholder=""></el-input> </el-form-item> <el-form-item label="更新时间" prop="updateTime"> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> <el-button @click="visible = false">取消</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button> </span> </el-dialog> </template> <script> export default { data () { return { visible: false, dataForm: { id: 0, batteryId: '', batteryVoltage: '', batteryCurrent: '', batterySoc: '', batteryHardVersion: '', batterySoftVersion: '', batteryWorkMode: '', batteryProtectCode: '', batteryErrorCode: '', batteryTemperatureMax: '', batteryTemperatureMin: '', batteryVoltageMax: '', batteryVoltageMin: '', mosStatus: '', mosTemp: '', batteryCycleTimes: '', steadyStatus: '', cellVoltage: '', model: '', manufacture: '', imei: '', imsi: '', iccid: '', trackerHardwareVersion: '', trackerSoftwareVersion: '', reportreason: '', detstatus: '', csq: '', networkType: '', locationMode: '', longitude: '', longitudeDirection: '', latitude: '', latitudeDirection: '', gpsSpeed: '', gpsSignal: '', satelliteNum: '', accuracy: '', businessmode: '', flag: '', uploadTime: '', createTime: '', updateTime: '' }, dataRule: { batteryId: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryVoltage: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryCurrent: [ { required: true, message: '能为空', trigger: 'blur' } ], batterySoc: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryHardVersion: [ { required: true, message: '能为空', trigger: 'blur' } ], batterySoftVersion: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryWorkMode: [ { required: true, message: '0x01(1):放电模式 0x10(16):充电模式 0x21(33):保护模式 0x30(48):待机无输出模式 0x31(49):待机预放电模式 0xFF(255):故障需返厂能为空', trigger: 'blur' } ], batteryProtectCode: [ { required: true, message: '保护状态 bit16~bit 31 保留 bit15:Gsensor 故障 bit14:BMS 与 Tracker通讯超时 bit13: 预放电失败 bit12: IC保护 bit11: 智能充电通信超时 bit10:压差过大 bit9:温差过大 bit8:短路 bit7:充电过压 bit6:充电过流 bit5:放电欠压 bit4:放电过流 bit3:充电低温 bit2:充电高温 bit1:放电高温 bit0:放电低温能为空', trigger: 'blur' } ], batteryErrorCode: [ { required: true, message: '转成2进制, 总共为16位,高8位为电池包工作状态,低8位为故障状态码 bit9BMS 与 Tracker通讯故障,bit8BMS 板 G sensor损坏,(8/9无效)bit7:失效,bit6:失衡,bit5:放电 MOS 损坏,bit4:充电 MOS 损坏,bit3IC 损坏,bit2:温度传感器损坏,bit1:采样线断线,虚焊等故障 保留,置 0,bit0:保留能为空', trigger: 'blur' } ], batteryTemperatureMax: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryTemperatureMin: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryVoltageMax: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryVoltageMin: [ { required: true, message: '能为空', trigger: 'blur' } ], mosStatus: [ { required: true, message: '能为空', trigger: 'blur' } ], mosTemp: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryCycleTimes: [ { required: true, message: '能为空', trigger: 'blur' } ], steadyStatus: [ { required: true, message: '能为空', trigger: 'blur' } ], cellVoltage: [ { required: true, message: '能为空', trigger: 'blur' } ], model: [ { required: true, message: '能为空', trigger: 'blur' } ], manufacture: [ { required: true, message: '能为空', trigger: 'blur' } ], imei: [ { required: true, message: '能为空', trigger: 'blur' } ], imsi: [ { required: true, message: '能为空', trigger: 'blur' } ], iccid: [ { required: true, message: '能为空', trigger: 'blur' } ], trackerHardwareVersion: [ { required: true, message: '能为空', trigger: 'blur' } ], trackerSoftwareVersion: [ { required: true, message: '能为空', trigger: 'blur' } ], reportreason: [ { required: true, message: '能为空', trigger: 'blur' } ], detstatus: [ { required: true, message: '能为空', trigger: 'blur' } ], csq: [ { required: true, message: '能为空', trigger: 'blur' } ], networkType: [ { required: true, message: '能为空', trigger: 'blur' } ], locationMode: [ { required: true, message: '能为空', trigger: 'blur' } ], longitude: [ { required: true, message: '能为空', trigger: 'blur' } ], longitudeDirection: [ { required: true, message: '能为空', trigger: 'blur' } ], latitude: [ { required: true, message: '能为空', trigger: 'blur' } ], latitudeDirection: [ { required: true, message: '能为空', trigger: 'blur' } ], gpsSpeed: [ { required: true, message: '能为空', trigger: 'blur' } ], gpsSignal: [ { required: true, message: '能为空', trigger: 'blur' } ], satelliteNum: [ { required: true, message: '能为空', trigger: 'blur' } ], accuracy: [ { required: true, message: '能为空', trigger: 'blur' } ], businessmode: [ { required: true, message: '业务模式 1:关机模式 2:运营模式 3:运输模式 4:通讯充电模式 5:盲充模式 6:存储模式 7:搜寻模式 8:返厂模式能为空', trigger: 'blur' } ], flag: [ { required: true, message: '1:设备主动请求或上报 2:平台主动推送或下指令 3:平台指令反馈的结果能为空', trigger: 'blur' } ], uploadTime: [ { required: true, message: '能为空', trigger: 'blur' } ], createTime: [ { required: true, message: '能为空', trigger: 'blur' } ], updateTime: [ { required: true, message: '更新时间能为空', trigger: 'blur' } ] } } }, methods: { init (id) { this.dataForm.id = id || 0 this.visible = true this.$nextTick(() => { this.$refs['dataForm'].resetFields() if (this.dataForm.id) { this.$http({ url: this.$http.adornUrl(`/maya/mybatteryinfolastest/info/${this.dataForm.id}`), method: 'get', params: this.$http.adornParams() }).then(({data}) => { if (data && data.code === 0) { this.dataForm.batteryId = data.myBatteryInfoLastest.batteryId this.dataForm.batteryVoltage = data.myBatteryInfoLastest.batteryVoltage this.dataForm.batteryCurrent = data.myBatteryInfoLastest.batteryCurrent this.dataForm.batterySoc = data.myBatteryInfoLastest.batterySoc this.dataForm.batteryHardVersion = data.myBatteryInfoLastest.batteryHardVersion this.dataForm.batterySoftVersion = data.myBatteryInfoLastest.batterySoftVersion this.dataForm.batteryWorkMode = data.myBatteryInfoLastest.batteryWorkMode this.dataForm.batteryProtectCode = data.myBatteryInfoLastest.batteryProtectCode this.dataForm.batteryErrorCode = data.myBatteryInfoLastest.batteryErrorCode this.dataForm.batteryTemperatureMax = data.myBatteryInfoLastest.batteryTemperatureMax this.dataForm.batteryTemperatureMin = data.myBatteryInfoLastest.batteryTemperatureMin this.dataForm.batteryVoltageMax = data.myBatteryInfoLastest.batteryVoltageMax this.dataForm.batteryVoltageMin = data.myBatteryInfoLastest.batteryVoltageMin this.dataForm.mosStatus = data.myBatteryInfoLastest.mosStatus this.dataForm.mosTemp = data.myBatteryInfoLastest.mosTemp this.dataForm.batteryCycleTimes = data.myBatteryInfoLastest.batteryCycleTimes this.dataForm.steadyStatus = data.myBatteryInfoLastest.steadyStatus this.dataForm.cellVoltage = data.myBatteryInfoLastest.cellVoltage this.dataForm.model = data.myBatteryInfoLastest.model this.dataForm.manufacture = data.myBatteryInfoLastest.manufacture this.dataForm.imei = data.myBatteryInfoLastest.imei this.dataForm.imsi = data.myBatteryInfoLastest.imsi this.dataForm.iccid = data.myBatteryInfoLastest.iccid this.dataForm.trackerHardwareVersion = data.myBatteryInfoLastest.trackerHardwareVersion this.dataForm.trackerSoftwareVersion = data.myBatteryInfoLastest.trackerSoftwareVersion this.dataForm.reportreason = data.myBatteryInfoLastest.reportreason this.dataForm.detstatus = data.myBatteryInfoLastest.detstatus this.dataForm.csq = data.myBatteryInfoLastest.csq this.dataForm.networkType = data.myBatteryInfoLastest.networkType this.dataForm.locationMode = data.myBatteryInfoLastest.locationMode this.dataForm.longitude = data.myBatteryInfoLastest.longitude this.dataForm.longitudeDirection = data.myBatteryInfoLastest.longitudeDirection this.dataForm.latitude = data.myBatteryInfoLastest.latitude this.dataForm.latitudeDirection = data.myBatteryInfoLastest.latitudeDirection this.dataForm.gpsSpeed = data.myBatteryInfoLastest.gpsSpeed this.dataForm.gpsSignal = data.myBatteryInfoLastest.gpsSignal this.dataForm.satelliteNum = data.myBatteryInfoLastest.satelliteNum this.dataForm.accuracy = data.myBatteryInfoLastest.accuracy this.dataForm.businessmode = data.myBatteryInfoLastest.businessmode this.dataForm.flag = data.myBatteryInfoLastest.flag this.dataForm.uploadTime = data.myBatteryInfoLastest.uploadTime this.dataForm.createTime = data.myBatteryInfoLastest.createTime this.dataForm.updateTime = data.myBatteryInfoLastest.updateTime } }) } }) }, // 表单提交 dataFormSubmit () { this.$refs['dataForm'].validate((valid) => { if (valid) { this.$http({ url: this.$http.adornUrl(`/maya/mybatteryinfolastest/${!this.dataForm.id ? 'save' : 'update'}`), method: 'post', data: this.$http.adornData({ 'id': this.dataForm.id || undefined, 'batteryId': this.dataForm.batteryId, 'batteryVoltage': this.dataForm.batteryVoltage, 'batteryCurrent': this.dataForm.batteryCurrent, 'batterySoc': this.dataForm.batterySoc, 'batteryHardVersion': this.dataForm.batteryHardVersion, 'batterySoftVersion': this.dataForm.batterySoftVersion, 'batteryWorkMode': this.dataForm.batteryWorkMode, 'batteryProtectCode': this.dataForm.batteryProtectCode, 'batteryErrorCode': this.dataForm.batteryErrorCode, 'batteryTemperatureMax': this.dataForm.batteryTemperatureMax, 'batteryTemperatureMin': this.dataForm.batteryTemperatureMin, 'batteryVoltageMax': this.dataForm.batteryVoltageMax, 'batteryVoltageMin': this.dataForm.batteryVoltageMin, 'mosStatus': this.dataForm.mosStatus, 'mosTemp': this.dataForm.mosTemp, 'batteryCycleTimes': this.dataForm.batteryCycleTimes, 'steadyStatus': this.dataForm.steadyStatus, 'cellVoltage': this.dataForm.cellVoltage, 'model': this.dataForm.model, 'manufacture': this.dataForm.manufacture, 'imei': this.dataForm.imei, 'imsi': this.dataForm.imsi, 'iccid': this.dataForm.iccid, 'trackerHardwareVersion': this.dataForm.trackerHardwareVersion, 'trackerSoftwareVersion': this.dataForm.trackerSoftwareVersion, 'reportreason': this.dataForm.reportreason, 'detstatus': this.dataForm.detstatus, 'csq': this.dataForm.csq, 'networkType': this.dataForm.networkType, 'locationMode': this.dataForm.locationMode, 'longitude': this.dataForm.longitude, 'longitudeDirection': this.dataForm.longitudeDirection, 'latitude': this.dataForm.latitude, 'latitudeDirection': this.dataForm.latitudeDirection, 'gpsSpeed': this.dataForm.gpsSpeed, 'gpsSignal': this.dataForm.gpsSignal, 'satelliteNum': this.dataForm.satelliteNum, 'accuracy': this.dataForm.accuracy, 'businessmode': this.dataForm.businessmode, 'flag': this.dataForm.flag, 'uploadTime': this.dataForm.uploadTime, 'createTime': this.dataForm.createTime, 'updateTime': this.dataForm.updateTime }) }).then(({data}) => { if (data && data.code === 0) { this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => { this.visible = false this.$emit('refreshDataList') } }) } else { this.$message.error(data.msg) } }) } }) } } } </script> 优化此页面ui,并添加字段batteryKind电池类型: 0-运营、1-售后、2-内测、3-报废
07-19
<template> <div class="app-container"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <!-- <el-form-item label="业务信息" prop="businessKey"> <el-input v-model="queryParams.businessKey" placeholder="请输入业务信息" clearable @keyup.enter.native="handleQuery"/> </el-form-item> --> <!-- 新增:申请流程查询输入框 --> <el-form-item label="申请流程" prop="defName"> <el-input v-model="queryParams.defName" placeholder="请输入申请流程名称" clearable @keyup.enter.native="handleQuery" /> </el-form-item> <el-form-item label="开始时间" prop="startTime"> <el-date-picker v-model="queryParams.startTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择开始时间" clearable @change="handleQuery" style="width: 180px" /> </el-form-item> <el-form-item label="结束时间" prop="endTime"> <el-date-picker v-model="queryParams.endTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择结束时间" clearable @change="handleQuery" style="width: 180px" /> </el-form-item> <el-form-item label="起始人" prop="startUserId"> <el-input v-model="queryParams.startUserId" placeholder="请输入流程发起人账号" clearable @keyup.enter.native="handleQuery" style="width: 180px" /> </el-form-item> <el-form-item> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> </el-form-item> </el-form> <TableCard> <el-row :gutter="10" class="mb8"> <!-- <el-col :span="1.5">--> <!-- <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['oa:procinst:edit']">--> <!-- 修改--> <!-- </el-button>--> <!-- </el-col>--> <el-col :span="1.5"> <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['oa:procinst:export']"> 导出 </el-button> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> <el-table :border="Global.tableShowBorder" v-loading="loading" :data="procinstList" @selection-change="handleSelectionChange"> <el-table-column label="流程实例ID" align="center" prop="procInstId" width="200" :show-overflow-tooltip="true"/> <el-table-column label="申请流程" align="center" prop="defName" width="200"/> <!-- <el-table-column label="流程定义编码" align="center" prop="defKey" width="200"/> --> <!-- <el-table-column label="业务信息" align="center" prop="businessKey" width="200"/> --> <el-table-column label="标题" align="center" prop="orderinfo" width="200" :show-overflow-tooltip="true"> <template slot-scope="scope"> <span v-text="formatOrderInfo(scope.row.orderinfo,'title')"></span> </template> </el-table-column> <!-- <el-table-column label="流程定义ID" align="center" prop="procDefId" width="150" :show-overflow-tooltip="true"/> --> <el-table-column label="开始时间" align="center" prop="startTime" width="180"> <template slot-scope="scope"> <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span> </template> </el-table-column> <el-table-column label="结束时间" align="center" prop="endTime" width="180"> <template slot-scope="scope"> <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span> </template> </el-table-column> <el-table-column label="耗时" align="center" prop="duration" width="150"> <template slot-scope="scope"> <span v-html="formatDuring(scope.row.duration)"></span> </template> </el-table-column> <el-table-column label="起始人" align="center" prop="startUserId"/> <el-table-column label="删除原因" align="center" prop="deleteReason"/> <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">--> <!-- <template slot-scope="scope">--> <!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['oa:procinst:edit']">--> <!-- 修改--> <!-- </el-button>--> <!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['oa:procinst:remove']">--> <!-- 删除--> <!-- </el-button>--> <!-- </template>--> <!-- </el-table-column>--> </el-table> <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/> </TableCard> <!-- 添加或修改流程实例对话框 --> <!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>--> <!-- <el-form ref="form" :model="form" :rules="rules" label-width="120px">--> <!-- <el-form-item label="" prop="rev">--> <!-- <el-input v-model="form.rev" placeholder="请输入"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="流程实例ID" prop="procInstId">--> <!-- <el-input v-model="form.procInstId" placeholder="请输入流程实例ID"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="业务信息" prop="businessKey">--> <!-- <el-input v-model="form.businessKey" placeholder="请输入业务信息"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="流程定义ID" prop="procDefId">--> <!-- <el-input v-model="form.procDefId" placeholder="请输入流程定义ID"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="开始时间" prop="startTime">--> <!-- <el-date-picker clearable--> <!-- v-model="form.startTime"--> <!-- type="date"--> <!-- value-format="yyyy-MM-dd"--> <!-- placeholder="请选择开始时间">--> <!-- </el-date-picker>--> <!-- </el-form-item>--> <!-- <el-form-item label="结束时间" prop="endTime">--> <!-- <el-date-picker clearable--> <!-- v-model="form.endTime"--> <!-- type="date"--> <!-- value-format="yyyy-MM-dd"--> <!-- placeholder="请选择结束时间">--> <!-- </el-date-picker>--> <!-- </el-form-item>--> <!-- <el-form-item label="耗时" prop="duration">--> <!-- <el-input v-model="form.duration" placeholder="请输入耗时"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="起始人" prop="startUserId">--> <!-- <el-input v-model="form.startUserId" placeholder="请输入起始人"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="起始节点ID" prop="startActId">--> <!-- <el-input v-model="form.startActId" placeholder="请输入起始节点ID"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="结束节点ID" prop="endActId">--> <!-- <el-input v-model="form.endActId" placeholder="请输入结束节点ID"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="父流程实例ID" prop="superProcessInstanceId">--> <!-- <el-input v-model="form.superProcessInstanceId" placeholder="请输入父流程实例ID"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="删除原因" prop="deleteReason">--> <!-- <el-input v-model="form.deleteReason" type="textarea" :rows="5" placeholder="请输入内容"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="${comment}" prop="tenantId">--> <!-- <el-input v-model="form.tenantId" placeholder="请输入${comment}"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="名称" prop="name">--> <!-- <el-input v-model="form.name" placeholder="请输入名称"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="${comment}" prop="callbackId">--> <!-- <el-input v-model="form.callbackId" placeholder="请输入${comment}"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="${comment}" prop="callbackType">--> <!-- <el-input v-model="form.callbackType" placeholder="请输入${comment}"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="${comment}" prop="referenceId">--> <!-- <el-input v-model="form.referenceId" placeholder="请输入${comment}"/>--> <!-- </el-form-item>--> <!-- <el-form-item label="${comment}" prop="referenceType">--> <!-- <el-input v-model="form.referenceType" placeholder="请输入${comment}"/>--> <!-- </el-form-item>--> <!-- </el-form>--> <!-- <div slot="footer" class="dialog-footer">--> <!-- <el-button type="primary" @click="submitForm">确 定</el-button>--> <!-- <el-button @click="cancel">取 消</el-button>--> <!-- </div>--> <!-- </el-dialog>--> </div> </template> <script> import {listProcinst, getProcinst, delProcinst, addProcinst, updateProcinst} from "@/api/workflow/procinst"; export default { name: "Procinst", data() { return { // 遮罩层 loading: true, // 选中数组 ids: [], // 非单个禁用 single: true, // 非多个禁用 multiple: true, // 显示搜索条件 showSearch: true, // 总条数 total: 0, // 流程实例表格数据 procinstList: [], // 弹出层标题 title: "", // 是否显示弹出层 open: false, // 查询参数 queryParams: { pageNum: 1, pageSize: 20, rev: null, procInstId: null, businessKey: null, procDefId: null, startTime: null, endTime: null, duration: null, startUserId: null, startActId: null, endActId: null, superProcessInstanceId: null, deleteReason: null, tenantId: null, name: null, callbackId: null, callbackType: null, referenceId: null, referenceType: null, defName: null, startStartTime: null, endStartTime: null }, // 表单参数 form: {}, // 表单校验 rules: { procInstId: [ {required: true, message: "流程实例ID能为空", trigger: "blur"} ], procDefId: [ {required: true, message: "流程定义ID能为空", trigger: "blur"} ], startTime: [ {required: true, message: "开始时间能为空", trigger: "blur"} ], } }; }, created() { this.getList(); }, methods: { /** 查询流程实例列表 */ getList() { this.loading = true; listProcinst(this.queryParams).then(response => { this.procinstList = response.rows; this.total = response.total; this.loading = false; }); }, // 取消按钮 cancel() { this.open = false; this.reset(); }, // 表单重置 reset() { this.form = { id: null, rev: null, procInstId: null, businessKey: null, procDefId: null, startTime: null, endTime: null, duration: null, startUserId: null, startActId: null, endActId: null, superProcessInstanceId: null, deleteReason: null, tenantId: null, name: null, callbackId: null, callbackType: null, referenceId: null, referenceType: null }; this.resetForm("form"); }, /** 搜索按钮操作 */ handleQuery() { this.queryParams.pageNum = 1; this.getList(); }, /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); // 手动清空 dateRange 和相关参数 this.queryParams.startStartTime = null; this.queryParams.endStartTime = null; this.handleQuery(); }, // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map(item => item.id) this.single = selection.length !== 1 this.multiple = !selection.length }, /** 新增按钮操作 */ handleAdd() { this.reset(); this.open = true; this.title = "添加流程实例"; }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); const id = row.id || this.ids getProcinst(id).then(response => { this.form = response.data; this.open = true; this.title = "修改流程实例"; }); }, // formatOrderInfo(orderInfo,key){ // let obj = JSON.parse(orderInfo); // return obj[key]; // }, formatOrderInfo(orderInfo, key) { if (!orderInfo) return ''; try { const obj = JSON.parse(orderInfo); return obj && typeof obj === 'object' ? obj[key] || '' : ''; } catch (e) { console.warn('Invalid JSON in orderinfo:', orderInfo); return ''; } }, formatDuring(millisecond) { var days = parseInt(millisecond / (1000 * 60 * 60 * 24)); var hours = parseInt((millisecond % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = parseInt((millisecond % (1000 * 60 * 60)) / (1000 * 60)); var seconds = (millisecond % (1000 * 60)) / 1000; let arr = [] let html = '<span ' if(days>0){ if(days>5){ html = html + 'style="color:red" ' } arr.push(days+"天") } if(hours>0){ arr.push(hours+"时") } if(minutes>0){ arr.push(minutes+"分") } if(seconds>0){ arr.push(seconds+"秒") } console.log(html); return html; }, /** 保存按钮 */ submitForm() { this.$refs["form"].validate(valid => { if (valid) { if (this.form.id != null) { updateProcinst(this.form).then(response => { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); }); } else { addProcinst(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); }); } } }); }, /** 删除按钮操作 */ handleDelete(row) { const ids = row.id || this.ids; this.$modal.confirm('是否确认删除流程实例的数据项?').then(function () { return delProcinst(ids); }).then(() => { this.getList(); this.$modal.msgSuccess("删除成功"); }).catch(() => { }); }, /** 导出按钮操作 */ handleExport() { this.download('oa/procinst/export', { ...this.queryParams }, `procinst_${new Date().getTime()}.xlsx`) } } }; </script> 开始时间和结束时间点击为啥没有反应, 日期选择无法弹出
最新发布
11-05
<template> <el-dialog :title="!dataForm.id ? '新增电池信息' : '修改电池信息'" :close-on-click-modal="false" :visible.sync="visible" width="80%" top="5vh" custom-class="battery-form-dialog" > <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="180px" label-position="top" > <el-collapse v-model="activePanels" accordion> <!-- 电池基本信息 --> <el-collapse-item title="电池基本信息" name="1"> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="电池ID" prop="batteryId"> <el-input v-model="dataForm.batteryId" placeholder="请输入电池唯一标识"> <i slot="prefix" class="el-icon-files"></i> </el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="电池电压(V)" prop="batteryVoltage"> <el-input v-model="dataForm.batteryVoltage" type="number"> <i slot="prefix" class="el-icon-data-line"></i> </el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="电池电流(A)" prop="batteryCurrent"> <el-input v-model="dataForm.batteryCurrent" type="number"> <i slot="prefix" class="el-icon-sort"></i> </el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="电池SOC(%)" prop="batterySoc"> <el-input v-model="dataForm.batterySoc" type="number" min="0" max="100"> <i slot="prefix" class="el-icon-pie-chart"></i> </el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="硬件版本" prop="batteryHardVersion"> <el-input v-model="dataForm.batteryHardVersion"> <i slot="prefix" class="el-icon-cpu"></i> </el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="软件版本" prop="batterySoftVersion"> <el-input v-model="dataForm.batterySoftVersion"> <i slot="prefix" class="el-icon-setting"></i> </el-input> </el-form-item> </el-col> </el-row> </el-collapse-item> <!-- 电池状态信息 --> <el-collapse-item title="电池状态信息" name="2"> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="工作模式" prop="batteryWorkMode"> <el-select v-model="dataForm.batteryWorkMode" placeholder="请选择工作模式"> <el-option label="放电模式 (0x01)" value="1"></el-option> <el-option label="充电模式 (0x10)" value="16"></el-option> <el-option label="保护模式 (0x21)" value="33"></el-option> <el-option label="待机无输出模式 (0x30)" value="48"></el-option> <el-option label="待机预放电模式 (0x31)" value="49"></el-option> <el-option label="故障需返厂 (0xFF)" value="255"></el-option> </el-select> </el-form-item> </el-col> <el-col span="12"> <el-form-item label="电池类型" prop="batteryKind"> <el-select v-model="dataForm.batteryKind" placeholder="请选择电池类型"> <el-option label="运营" value="0"></el-option> <el-option label="售后" value="1"></el-option> <el-option label="内测" value="2"></el-option> <el-option label="报废" value="3"></el-option> </el-select> </el-form-item> </el-col> </el-row> <el-form-item label="保护状态码" prop="batteryProtectCode"> <el-tooltip effect="dark" placement="top"> <div slot="content"> bit0: 放电低温 | bit1: 放电高温 | bit2: 充电高温<br> bit3: 充电低温 | bit4: 放电过流 | bit5: 放电欠压<br> bit6: 充电过流 | bit7: 充电过压 | bit8: 短路<br> bit9: 温差过大 | bit10: 压差过大 | bit11: 智能充电通信超时<br> bit12: IC保护 | bit13: 预放电失败 | bit14: BMS与Tracker通讯超时<br> bit15: Gsensor故障 | bit16~31: 保留 </div> <el-input v-model="dataForm.batteryProtectCode" placeholder="请输入保护状态码"> <i slot="prefix" class="el-icon-warning"></i> </el-input> </el-tooltip> </el-form-item> <el-form-item label="错误状态码" prop="batteryErrorCode"> <el-tooltip effect="dark" placement="top"> <div slot="content"> 低8位故障状态码:<br> bit0: 保留 | bit1: 采样线故障 | bit2: 温度传感器损坏<br> bit3: IC损坏 | bit4: 充电MOS损坏 | bit5: 放电MOS损坏<br> bit6: 失衡 | bit7: 失效<br> 高8位工作状态:<br> bit8: G sensor损坏 | bit9: BMS与Tracker通讯故障 </div> <el-input v-model="dataForm.batteryErrorCode" placeholder="请输入错误状态码"> <i slot="prefix" class="el-icon-warning-outline"></i> </el-input> </el-tooltip> </el-form-item> </el-collapse-item> <!-- 温度电压信息 --> <el-collapse-item title="温度与电压信息" name="3"> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="最高温度(℃)" prop="batteryTemperatureMax"> <el-input v-model="dataForm.batteryTemperatureMax" type="number"> <i slot="prefix" class="el-icon-sunny"></i> </el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="最低温度(℃)" prop="batteryTemperatureMin"> <el-input v-model="dataForm.batteryTemperatureMin" type="number"> <i slot="prefix" class="el-icon-cold-drink"></i> </el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="最高电压(V)" prop="batteryVoltageMax"> <el-input v-model="dataForm.batteryVoltageMax" type="number"> <i slot="prefix" class="el-icon-top"></i> </el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="最低电压(V)" prop="batteryVoltageMin"> <el-input v-model="dataForm.batteryVoltageMin" type="number"> <i slot="prefix" class="el-icon-bottom"></i> </el-input> </el-form-item> </el-col> </el-row> </el-collapse-item> <!-- 设备信息 --> <el-collapse-item title="设备信息" name="4"> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="设备型号" prop="model"> <el-input v-model="dataForm.model"> <i slot="prefix" class="el-icon-mobile"></i> </el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="制造商" prop="manufacture"> <el-input v-model="dataForm.manufacture"> <i slot="prefix" class="el-icon-office-building"></i> </el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="8"> <el-form-item label="IMEI" prop="imei"> <el-input v-model="dataForm.imei"> <i slot="prefix" class="el-icon-phone"></i> </el-input> </el-form-item> </el-col> <el-col :span="8"> <el-form-item label="IMSI" prop="imsi"> <el-input v-model="dataForm.imsi"> <i slot="prefix" class="el-icon-sim-card"></i> </el-input> </el-form-item> </el-col> <el-col :span="8"> <el-form-item label="ICCID" prop="iccid"> <el-input v-model="dataForm.iccid"> <i slot="prefix" class="el-icon-credit-card"></i> </el-input> </el-form-item> </el-col> </el-row> </el-collapse-item> <!-- GPS定位信息 --> <el-collapse-item title="GPS定位信息" name="5"> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="经度" prop="longitude"> <el-input v-model="dataForm.longitude" type="number"> <i slot="prefix" class="el-icon-place"></i> </el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="经度方向" prop="longitudeDirection"> <el-select v-model="dataForm.longitudeDirection"> <el-option label="东经" value="E"></el-option> <el-option label="西经" value="W"></el-option> </el-select> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="纬度" prop="latitude"> <el-input v-model="dataForm.latitude" type="number"> <i slot="prefix" class="el-icon-place"></i> </el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="纬度方向" prop="latitudeDirection"> <el-select v-model="dataForm.latitudeDirection"> <el-option label="北纬" value="N"></el-option> <el-option label="南纬" value="S"></el-option> </el-select> </el-form-item> </el-col> </el-row> </el-collapse-item> <!-- 业务信息 --> <el-collapse-item title="业务信息" name="6"> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="业务模式" prop="businessmode"> <el-select v-model="dataForm.businessmode"> <el-option v-for="mode in businessModes" :key="mode.value" :label="mode.label" :value="mode.value" ></el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="处理状态" prop="handled"> <el-select v-model="dataForm.handled"> <el-option label="已处理" :value="1"></el-option> <el-option label="待处理" :value="0"></el-option> </el-select> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="执行方式" prop="todoNow"> <el-select v-model="dataForm.todoNow"> <el-option label="立即执行" :value="1"></el-option> <el-option label="等待执行" :value="0"></el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="需要回复" prop="needack"> <el-select v-model="dataForm.needack"> <el-option label="是" :value="1"></el-option> <el-option label="否" :value="0"></el-option> </el-select> </el-form-item> </el-col> </el-row> <!-- 消息类型 --> <el-form-item label="消息类型" prop="flag"> <el-select v-model="dataForm.flag"> <el-option label="设备主动请求或上报" :value="1"></el-option> <el-option label="平台主动推送或下指令" :value="2"></el-option> <el-option label="平台指令反馈的结果" :value="3"></el-option> </el-select> </el-form-item> </el-collapse-item> <!-- 其他信息 --> <el-collapse-item title="其他信息" name="7"> <el-form-item label="原始数据" prop="payload"> <el-input v-model="dataForm.payload" type="textarea" :rows="3" placeholder="请输入原始数据" ></el-input> </el-form-item> </el-collapse-item> </el-collapse> </el-form> <span slot="footer" class="dialog-footer"> <el-button @click="visible = false">取消</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button> </span> </el-dialog> </template> <script> export default { data() { return { visible: false, activePanels: ['1'], dataForm: { id: 0, batteryId: '', batteryVoltage: '', batteryCurrent: '', batterySoc: '', batteryHardVersion: '', batterySoftVersion: '', batteryWorkMode: '', batteryKind: "0", batteryProtectCode: '', batteryErrorCode: '', batteryTemperatureMax: '', batteryTemperatureMin: '', batteryVoltageMax: '', batteryVoltageMin: '', mosStatus: '', mosTemp: '', batteryCycleTimes: '', steadyStatus: '', cellVoltage: '', model: '', manufacture: '', imei: '', imsi: '', iccid: '', trackerHardwareVersion: '', trackerSoftwareVersion: '', csq: '', networkType: '', locationMode: '', longitude: '', longitudeDirection: '', latitude: '', latitudeDirection: '', gpsSpeed: '', gpsSignal: '', satelliteNum: '', accuracy: '', flag: '', clientId: '', topic: '', productKey: '', handled: '', todoNow: '', needack: '', businessmode: '', uploadTime: '', createTime: '', updateTime: '', payload: '' }, businessModes: [ { value: 1, label: "关机模式" }, { value: 2, label: "运营模式" }, { value: 3, label: "运输模式" }, { value: 4, label: "通讯充电模式" }, { value: 5, label: "盲充模式" }, { value: 6, label: "存储模式" }, { value: 7, label: "搜寻模式" }, { value: 8, label: "返厂模式" } ], dataRule: { batteryId: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryVoltage: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryCurrent: [ { required: true, message: '能为空', trigger: 'blur' } ], batterySoc: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryHardVersion: [ { required: true, message: '能为空', trigger: 'blur' } ], batterySoftVersion: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryWorkMode: [ { required: true, message: '0x01(1):放电模式 0x10(16):充电模式 0x21(33):保护模式 0x30(48):待机无输出模式 0x31(49):待机预放电模式 0xFF(255):故障需返厂能为空', trigger: 'blur' } ], batteryProtectCode: [ { required: true, message: '保护状态 bit16~bit 31 保留 bit15:Gsensor 故障 bit14:BMS 与 Tracker通讯超时 bit13: 预放电失败 bit12: IC保护 bit11: 智能充电通信超时 bit10:压差过大 bit9:温差过大 bit8:短路 bit7:充电过压 bit6:充电过流 bit5:放电欠压 bit4:放电过流 bit3:充电低温 bit2:充电高温 bit1:放电高温 bit0:放电低温能为空', trigger: 'blur' } ], batteryErrorCode: [ { required: true, message: '转成2进制, 总共为16位,高8位为电池包工作状态,低8位为故障状态码 bit9BMS 与 Tracker通讯故障,bit8BMS 板 G sensor损坏,(8/9无效)bit7:失效,bit6:失衡,bit5:放电 MOS 损坏,bit4:充电 MOS 损坏,bit3IC 损坏,bit2:温度传感器损坏,bit1:采样线断线,虚焊等故障 保留,置 0,bit0:保留能为空', trigger: 'blur' } ], batteryTemperatureMax: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryTemperatureMin: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryVoltageMax: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryVoltageMin: [ { required: true, message: '能为空', trigger: 'blur' } ], mosStatus: [ { required: true, message: '能为空', trigger: 'blur' } ], mosTemp: [ { required: true, message: '能为空', trigger: 'blur' } ], batteryCycleTimes: [ { required: true, message: '能为空', trigger: 'blur' } ], steadyStatus: [ { required: true, message: '能为空', trigger: 'blur' } ], cellVoltage: [ { required: true, message: '能为空', trigger: 'blur' } ], model: [ { required: true, message: '能为空', trigger: 'blur' } ], manufacture: [ { required: true, message: '能为空', trigger: 'blur' } ], imei: [ { required: true, message: '能为空', trigger: 'blur' } ], imsi: [ { required: true, message: '能为空', trigger: 'blur' } ], iccid: [ { required: true, message: '能为空', trigger: 'blur' } ], trackerHardwareVersion: [ { required: true, message: '能为空', trigger: 'blur' } ], trackerSoftwareVersion: [ { required: true, message: '能为空', trigger: 'blur' } ], csq: [ { required: true, message: '能为空', trigger: 'blur' } ], networkType: [ { required: true, message: '能为空', trigger: 'blur' } ], locationMode: [ { required: true, message: '能为空', trigger: 'blur' } ], longitude: [ { required: true, message: '能为空', trigger: 'blur' } ], longitudeDirection: [ { required: true, message: '能为空', trigger: 'blur' } ], latitude: [ { required: true, message: '能为空', trigger: 'blur' } ], latitudeDirection: [ { required: true, message: '能为空', trigger: 'blur' } ], gpsSpeed: [ { required: true, message: '能为空', trigger: 'blur' } ], gpsSignal: [ { required: true, message: '能为空', trigger: 'blur' } ], satelliteNum: [ { required: true, message: '能为空', trigger: 'blur' } ], accuracy: [ { required: true, message: '能为空', trigger: 'blur' } ], flag: [ { required: true, message: '1:设备主动请求或上报 2:平台主动推送或下指令 3:平台指令反馈的结果能为空', trigger: 'blur' } ], clientId: [ { required: true, message: 'MQTT发布消息所需的clientId能为空', trigger: 'blur' } ], topic: [ { required: true, message: 'MQTT主题能为空', trigger: 'blur' } ], productKey: [ { required: true, message: '主题名称中需要的productKey能为空', trigger: 'blur' } ], handled: [ { required: true, message: '配置是否处理 1:已处理 0:待处理能为空', trigger: 'blur' } ], todoNow: [ { required: true, message: '是否立即执行 0:等待执行 1:立即执行能为空', trigger: 'blur' } ], needack: [ { required: true, message: '是否回复能为空', trigger: 'blur' } ], businessmode: [ { required: true, message: '业务模式 1:关机模式 2:运营模式 3:运输模式 4:通讯充电模式 5:盲充模式 6:存储模式 7:搜寻模式 8:返厂模式能为空', trigger: 'blur' } ], uploadTime: [ { required: true, message: '能为空', trigger: 'blur' } ], createTime: [ { required: true, message: '能为空', trigger: 'blur' } ], updateTime: [ { required: true, message: '更新时间能为空', trigger: 'blur' } ], payload: [ { required: true, message: '原始数据能为空', trigger: 'blur' } ] } } }, computed: { // 处理状态标签 handledLabel() { return this.dataForm.handled === 1 ? "已处理" : this.dataForm.handled === 0 ? "待处理" : ""; }, // 执行方式标签 todoNowLabel() { return this.dataForm.todoNow === 1 ? "立即执行" : this.dataForm.todoNow === 0 ? "等待执行" : ""; }, // 需要回复标签 needackLabel() { return this.dataForm.needack === 1 ? "是" : this.dataForm.needack === 0 ? "否" : ""; }, // 业务模式标签 businessModeLabel() { const mode = this.businessModes.find(m => m.value == this.dataForm.businessmode); return mode ? mode.label : ""; }, // 消息类型标签 flagLabel() { switch (this.dataForm.flag) { case 1: return "设备主动请求或上报"; case 2: return "平台主动推送或下指令"; case 3: return "平台指令反馈的结果"; default: return ""; } } }, methods: { init (id) { this.dataForm.id = id || 0 this.visible = true this.$nextTick(() => { this.$refs['dataForm'].resetFields() if (this.dataForm.id) { this.$http({ url: this.$http.adornUrl(`/maya/mybatteryinfo/info/${this.dataForm.id}`), method: 'get', params: this.$http.adornParams() }).then(({data}) => { if (data && data.code === 0) { this.dataForm.batteryId = data.myBatteryInfo.batteryId this.dataForm.batteryVoltage = data.myBatteryInfo.batteryVoltage this.dataForm.batteryCurrent = data.myBatteryInfo.batteryCurrent this.dataForm.batterySoc = data.myBatteryInfo.batterySoc this.dataForm.batteryHardVersion = data.myBatteryInfo.batteryHardVersion this.dataForm.batterySoftVersion = data.myBatteryInfo.batterySoftVersion this.dataForm.batteryWorkMode = data.myBatteryInfo.batteryWorkMode this.dataForm.batteryKind = String(data.myBatteryInfo.batteryKind); this.dataForm.batteryProtectCode = data.myBatteryInfo.batteryProtectCode this.dataForm.batteryErrorCode = data.myBatteryInfo.batteryErrorCode this.dataForm.batteryTemperatureMax = data.myBatteryInfo.batteryTemperatureMax this.dataForm.batteryTemperatureMin = data.myBatteryInfo.batteryTemperatureMin this.dataForm.batteryVoltageMax = data.myBatteryInfo.batteryVoltageMax this.dataForm.batteryVoltageMin = data.myBatteryInfo.batteryVoltageMin this.dataForm.mosStatus = data.myBatteryInfo.mosStatus this.dataForm.mosTemp = data.myBatteryInfo.mosTemp this.dataForm.batteryCycleTimes = data.myBatteryInfo.batteryCycleTimes this.dataForm.steadyStatus = data.myBatteryInfo.steadyStatus this.dataForm.cellVoltage = data.myBatteryInfo.cellVoltage this.dataForm.model = data.myBatteryInfo.model this.dataForm.manufacture = data.myBatteryInfo.manufacture this.dataForm.imei = data.myBatteryInfo.imei this.dataForm.imsi = data.myBatteryInfo.imsi this.dataForm.iccid = data.myBatteryInfo.iccid this.dataForm.trackerHardwareVersion = data.myBatteryInfo.trackerHardwareVersion this.dataForm.trackerSoftwareVersion = data.myBatteryInfo.trackerSoftwareVersion this.dataForm.csq = data.myBatteryInfo.csq this.dataForm.networkType = data.myBatteryInfo.networkType this.dataForm.locationMode = data.myBatteryInfo.locationMode this.dataForm.longitude = data.myBatteryInfo.longitude this.dataForm.longitudeDirection = data.myBatteryInfo.longitudeDirection this.dataForm.latitude = data.myBatteryInfo.latitude this.dataForm.latitudeDirection = data.myBatteryInfo.latitudeDirection this.dataForm.gpsSpeed = data.myBatteryInfo.gpsSpeed this.dataForm.gpsSignal = data.myBatteryInfo.gpsSignal this.dataForm.satelliteNum = data.myBatteryInfo.satelliteNum this.dataForm.accuracy = data.myBatteryInfo.accuracy this.dataForm.flag = data.myBatteryInfo.flag this.dataForm.clientId = data.myBatteryInfo.clientId this.dataForm.topic = data.myBatteryInfo.topic this.dataForm.productKey = data.myBatteryInfo.productKey this.dataForm.handled = data.myBatteryInfo.handled this.dataForm.todoNow = data.myBatteryInfo.todoNow this.dataForm.needack = data.myBatteryInfo.needack this.dataForm.businessmode = data.myBatteryInfo.businessmode this.dataForm.uploadTime = data.myBatteryInfo.uploadTime this.dataForm.createTime = data.myBatteryInfo.createTime this.dataForm.updateTime = data.myBatteryInfo.updateTime this.dataForm.payload = data.myBatteryInfo.payload } }) } }) }, // 表单提交 dataFormSubmit () { this.$refs['dataForm'].validate((valid) => { if (valid) { this.$http({ url: this.$http.adornUrl(`/maya/mybatteryinfo/${!this.dataForm.id ? 'save' : 'update'}`), method: 'post', data: this.$http.adornData({ 'id': this.dataForm.id || undefined, 'batteryId': this.dataForm.batteryId, 'batteryVoltage': this.dataForm.batteryVoltage, 'batteryCurrent': this.dataForm.batteryCurrent, 'batterySoc': this.dataForm.batterySoc, 'batteryHardVersion': this.dataForm.batteryHardVersion, 'batterySoftVersion': this.dataForm.batterySoftVersion, 'batteryWorkMode': this.dataForm.batteryWorkMode, 'batteryKind': Number(this.dataForm.batteryKind), 'batteryProtectCode': this.dataForm.batteryProtectCode, 'batteryErrorCode': this.dataForm.batteryErrorCode, 'batteryTemperatureMax': this.dataForm.batteryTemperatureMax, 'batteryTemperatureMin': this.dataForm.batteryTemperatureMin, 'batteryVoltageMax': this.dataForm.batteryVoltageMax, 'batteryVoltageMin': this.dataForm.batteryVoltageMin, 'mosStatus': this.dataForm.mosStatus, 'mosTemp': this.dataForm.mosTemp, 'batteryCycleTimes': this.dataForm.batteryCycleTimes, 'steadyStatus': this.dataForm.steadyStatus, 'cellVoltage': this.dataForm.cellVoltage, 'model': this.dataForm.model, 'manufacture': this.dataForm.manufacture, 'imei': this.dataForm.imei, 'imsi': this.dataForm.imsi, 'iccid': this.dataForm.iccid, 'trackerHardwareVersion': this.dataForm.trackerHardwareVersion, 'trackerSoftwareVersion': this.dataForm.trackerSoftwareVersion, 'csq': this.dataForm.csq, 'networkType': this.dataForm.networkType, 'locationMode': this.dataForm.locationMode, 'longitude': this.dataForm.longitude, 'longitudeDirection': this.dataForm.longitudeDirection, 'latitude': this.dataForm.latitude, 'latitudeDirection': this.dataForm.latitudeDirection, 'gpsSpeed': this.dataForm.gpsSpeed, 'gpsSignal': this.dataForm.gpsSignal, 'satelliteNum': this.dataForm.satelliteNum, 'accuracy': this.dataForm.accuracy, 'flag': this.dataForm.flag, 'clientId': this.dataForm.clientId, 'topic': this.dataForm.topic, 'productKey': this.dataForm.productKey, 'handled': this.dataForm.handled, 'todoNow': this.dataForm.todoNow, 'needack': this.dataForm.needack, 'businessmode': this.dataForm.businessmode, 'uploadTime': this.dataForm.uploadTime, 'createTime': this.dataForm.createTime, 'updateTime': this.dataForm.updateTime, 'payload': this.dataForm.payload }) }).then(({data}) => { if (data && data.code === 0) { this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => { this.visible = false this.$emit('refreshDataList') } }) } else { this.$message.error(data.msg) } }) } }) } } } </script> <style scoped> /* 添加状态显示样式 */ .status-display { margin-top: 8px; padding: 6px 12px; background-color: #f5f7fa; border-radius: 4px; border: 1px solid #dcdfe6; font-size: 14px; color: #606266; } /* 在查看模式下隐藏选择框,显示纯文本 */ .view-mode .el-select { display: none; } .view-mode .status-display { display: block; } </style> 优化此此页面的ui
07-22
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值