| | |
| | | /** |
| | | * 将秒转化成时:分 |
| | | * |
| | | * @param {[Number]} value 分 |
| | | * @param {[value]} value 秒数 |
| | | * |
| | | * @return {[String]} 00h00m |
| | | */ |
| | |
| | | value = 0; |
| | | } |
| | | // 分 |
| | | var theTime = parseInt(value); |
| | | var theTime = parseInt(value/60); |
| | | // 小时 |
| | | var theTime1 = 0; |
| | | if (theTime >= 60) { |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 一体机 暂停 继续 |
| | | * type 1暂停 2继续 |
| | | */ |
| | | export const pauseA200 = (devId, type) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "a200param/pauseA200Param", |
| | | params: { devId, type }, |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 批量启动一体机 |
| | | */ |
| | | export const startA200ParamPl = (type, devIds) => { |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 批量 暂停 继续一体机 |
| | | * type 1暂停 2继续 |
| | | */ |
| | | export const pauseA200ParamPl = (devIds, type) => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: "a200param/pauseA200ParamPl", |
| | | params: { type }, |
| | | data: devIds, |
| | | }); |
| | | }; |
| | | /** |
| | | * 批量停止一体机 |
| | | */ |
| | | export const stopA200ParamPl = (devIds) => { |
| | |
| | | import jhParamContent from "./jhParamContent.vue"; |
| | | import ytjRtInfo from "./ytjRtInfo.vue"; |
| | | import jhyRtInfo from "./jhyRtInfo.vue"; |
| | | import { controllerActmParam, stopA200 } from "./api"; |
| | | import { controllerActmParam, stopA200, pauseA200 } from "./api"; |
| | | |
| | | import useElement from "@/hooks/useElement.js"; |
| | | |
| | |
| | | } |
| | | return currentDev.value.state[0].batteryCount == 1; |
| | | }); |
| | | |
| | | |
| | | // 正在测试中 获取测试类型 是充电还是放电 |
| | | const currentType = computed(() => { |
| | |
| | | |
| | | const testStates = computed(() => { |
| | | if (1 == devType.value) { |
| | | return currentDev.value.state?.isTesting ? "测试中" : "--"; |
| | | return currentDev.value.state?.isTesting |
| | | ? currentDev.value.state?.testPause |
| | | ? "暂停中" |
| | | : "测试中" |
| | | : "--"; |
| | | } else { |
| | | let [res1, res2] = [0, 1].map((v) => |
| | | currentDev.value.state |
| | |
| | | } |
| | | }); |
| | | |
| | | function pauseYtj() {} |
| | | |
| | | function stopYtj() { |
| | | let loading = $loading(); |
| | | stopA200(currentDevId.value) |
| | |
| | | testGroupIdx.value = groupIdx; |
| | | isUpdateParam.value = !!isUpdate; |
| | | testVisible.value = true; |
| | | } |
| | | |
| | | function pauseYtj(type) { |
| | | console.log("currentDev", currentDev, "============="); |
| | | if (!currentDev.value.devId) { |
| | | return false; |
| | | } |
| | | |
| | | let loading = $loading(); |
| | | pauseA200(currentDev.value.devId, type) |
| | | .then((res) => { |
| | | let { code, data } = res.data; |
| | | if (code == 200) { |
| | | console.log(data); |
| | | $message.success("操作成功"); |
| | | } else { |
| | | $message.error("操作失败"); |
| | | } |
| | | loading.close(); |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | loading.close(); |
| | | $message.error("操作失败"); |
| | | }); |
| | | } |
| | | onMounted(() => {}); |
| | | </script> |
| | |
| | | @click="test(true)" |
| | | >修改参数</el-button |
| | | > |
| | | <!-- TODO 是否是暂停 --> |
| | | <el-button |
| | | size="small" |
| | | :disabled="!currentDev.devOnline" |
| | | v-if="!currentDev.state.testPause" |
| | | class="btn-start" |
| | | @click="pauseYtj(1)" |
| | | >暂停测试</el-button |
| | | > |
| | | <el-button |
| | | size="small" |
| | | :disabled="!currentDev.devOnline" |
| | | v-if="currentDev.state.testPause" |
| | | class="btn-start" |
| | | @click="pauseYtj(2)" |
| | | >继续测试</el-button |
| | | > |
| | | <el-button |
| | | size="small" |
| | | :disabled="!currentDev.devOnline" |
| | |
| | | idx: { |
| | | type: Number, |
| | | required: true, |
| | | } |
| | | }, |
| | | }); |
| | | const temp = computed(() => { |
| | | let tlist = props.rtdata.slice(0, 4).map((v) => v.monTmp); |
| | |
| | | <div class="box"> |
| | | <div class="label">测试时长</div> |
| | | <div class="content">{{ formatSeconds(datas.testDuration) }}</div> |
| | | </div> |
| | | <div class="box"> |
| | | <div class="label">停止原因</div> |
| | | <div class="content"> |
| | | {{ datas.isTesting ? datas.stopTypeReason : "--" }} |
| | | </div> |
| | | </div> |
| | | <div class="box"> |
| | | <div class="label">工作电流</div> |
| | |
| | | <div class="value">{{toFixed(datas.minBatteryVoltage, VOL) }} V</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="label"><el-icon><icon-avg class="avg-icon" /></el-icon>U</div> |
| | | <div class="label"> |
| | | <el-icon><icon-avg class="avg-icon" /></el-icon>U |
| | | </div> |
| | | <div class="value">{{ toFixed(datas.avgBatteryVoltage, VOL) }} V</div> |
| | | </div> |
| | | <div class="item"> |
| | |
| | | router.push({ |
| | | path: "/test-batch", |
| | | query: { |
| | | devType: 1, |
| | | devType: 2, |
| | | }, |
| | | }); |
| | | } |
| | |
| | | <div class="page"> |
| | | <yc-card class="p-header" title="测试操作"> |
| | | <template #tools> |
| | | <el-button |
| | | <div class="btn-start" @click="goBack">返回</div> |
| | | <!-- <el-button |
| | | size="small" |
| | | :disabled="!devInfo.devOnline" |
| | | class="btn-start btn-grp1" |
| | |
| | | " |
| | | @click="controlTest(0, 4)" |
| | | >停止组1</el-button |
| | | > |
| | | > --> |
| | | <!-- --> |
| | | <template v-if="!onlyOneGroup"> |
| | | <el-button |
| | | <!-- <el-button |
| | | size="small" |
| | | :disabled="!devInfo.devOnline" |
| | | class="btn-start btn-grp2" |
| | |
| | | " |
| | | @click="controlTest(1, 4)" |
| | | >停止组2</el-button |
| | | > |
| | | > --> |
| | | </template> |
| | | </template> |
| | | <div class="card-content"> |
| | |
| | | batteryNumber: 0, |
| | | diffBatteryVoltage: 0, |
| | | // 放电参数 |
| | | dischargeMode: 0, |
| | | dischargePower: 0, |
| | | dischargeCurrent: 0, |
| | | dischargeTime: 0, |
| | | dischargeVoltage: 0, |
| | |
| | | }, |
| | | ], |
| | | // 放电参数 |
| | | dischargePower: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | dischargeCurrent: [ |
| | | { |
| | | required: true, |
| | |
| | | |
| | | onMounted(() => { |
| | | params.testType = props.testType; |
| | | if (props.isBatch) { |
| | | // console.log('dev0', props.devs[0], '============='); |
| | | params.testType = props.devs[0].state.testType; |
| | | } |
| | | getParams(); |
| | | }); |
| | | </script> |
| | |
| | | <!-- 放电参数 --> |
| | | <template v-if="1 == params.testType"> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="放电模式" prop="dischargeMode"> |
| | | <el-select |
| | | v-model="params.dischargeMode" |
| | | class="" |
| | | placeholder="Select" |
| | | > |
| | | <el-option label="恒流模式" :value="0" /> |
| | | <el-option label="恒功率模式" :value="1" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="放电功率(KW)" prop="dischargePower"> |
| | | <el-input v-model="params.dischargePower"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="放电电流(A)" prop="dischargeCurrent"> |
| | | <el-input v-model="params.dischargeCurrent"></el-input> |
| | | </el-form-item> |
| | |
| | | <!-- 充电参数 --> |
| | | <template v-else> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="充电功率" prop="chargePower"> |
| | | <el-select |
| | | v-model="params.chargePower" |
| | | class="" |
| | | placeholder="Select" |
| | | > |
| | | <el-option label="2.2KW插座" :value="2.2" /> |
| | | <el-option label="4.4KW配电箱" :value="4.4" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="充电限压(V)" prop="chargeVoltage"> |
| | | <el-input v-model="params.chargeVoltage"></el-input> |
| | | </el-form-item> |
| | |
| | | import { useRoute, useRouter } from "vue-router"; |
| | | import battCountContent from "./battCountContent.vue"; |
| | | |
| | | import { cancelContPl, controllerActmParam, stopA200ParamPl } from "./api.js"; |
| | | import { cancelContPl, controllerActmParam, stopA200ParamPl, pauseA200ParamPl } from "./api.js"; |
| | | |
| | | import useElement from "@/hooks/useElement.js"; |
| | | const { $alert, $loading, $message, $confirm } = useElement(); |
| | |
| | | jhyBattCountVisible.value = true; |
| | | } |
| | | |
| | | function pauseYtj(type) { |
| | | let devIds = devs.value.map((v) => v.devId); |
| | | let loading = $loading(); |
| | | pauseA200ParamPl(devIds, type) |
| | | .then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | loading.close(); |
| | | let failList = []; |
| | | let successList = []; |
| | | Object.keys(data2).forEach((v) => { |
| | | if (200 == data2[v].code) { |
| | | successList.push(v); |
| | | } else { |
| | | failList.push(v); |
| | | } |
| | | }); |
| | | if (code && data && successList.length) { |
| | | $message.success("操作成功"); |
| | | if (failList.length) { |
| | | let failNames = props.devs |
| | | .filter((v) => failList.some((vv) => vv == v.devId)) |
| | | .map((v) => v.devIdcode); |
| | | |
| | | $alert(`操作失败的设备列表:${failNames.join(", ")}。`); |
| | | } |
| | | close(); |
| | | } else { |
| | | $message.error("操作失败"); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | loading.close(); |
| | | $message.error("操作失败"); |
| | | console.log(err); |
| | | }); |
| | | } |
| | | |
| | | onMounted(() => {}); |
| | | onActivated(() => { |
| | | if ($route.query.devType) { |
| | |
| | | class="btn-start" |
| | | @click="test" |
| | | >启动测试</el-button |
| | | > |
| | | <el-button size="small" class="btn-start" @click="pauseYtj(1)" |
| | | >暂停测试</el-button |
| | | > |
| | | <el-button size="small" class="btn-start" @click="pauseYtj(2)" |
| | | >继续测试</el-button |
| | | > |
| | | <el-button |
| | | size="small" |
| | |
| | | .card-content { |
| | | height: 100%; |
| | | // padding: 0 400px 0 20px; |
| | | padding: 0 320px 0 20px; |
| | | padding: 0 414px 0 20px; |
| | | display: grid; |
| | | // grid-template-columns: repeat(3, 10em 1fr); |
| | | grid-template-columns: 5em 1fr 9em 1fr 8em 2fr; |
| | |
| | | </yc-card> |
| | | <yc-card class="params" title="测试参数"> |
| | | <div class="card-content"> |
| | | <template v-if="1 == params.testType"> |
| | | <template v-if="1 == rtDatas.devStates.testType"> |
| | | <div class="label">测试类型</div> |
| | | <div class="value">放电测试</div> |
| | | <div class="label">放电模式</div> |
| | | <div class="value">{{ ["恒流模式", "恒功率模式"][params.dischargeMode] }}</div> |
| | | <div class="label">放电功率</div> |
| | | <div class="value">{{ params.dischargePower }}KW</div> |
| | | <div class="label">放电电流</div> |
| | | <div class="value">{{ params.dischargeCurrent }}A</div> |
| | | <div class="label">放电时间</div> |
| | |
| | | <div class="value">{{ params.dischargeVoltage }}V</div> |
| | | <div class="label">预放容量限制</div> |
| | | <div class="value"> |
| | | {{ ["关闭", "开启"][params.isDischargeCapacityEnable] }} |
| | | {{ ["关闭", "开启"][params.isDischargeCapacityEnable * 1] }} |
| | | </div> |
| | | <div class="label">预放容量</div> |
| | | <div class="value">{{ params.dischargeCapacity }}AH</div> |
| | | <div class="label">单串下限限制</div> |
| | | <div class="value"> |
| | | {{ ["关闭", "开启"][params.isMinBatteryVoltageEnable] }} |
| | | {{ ["关闭", "开启"][params.isMinBatteryVoltageEnable * 1] }} |
| | | </div> |
| | | <div class="label">单串下限</div> |
| | | <div class="value">{{ params.minBatteryVoltage }}V</div> |
| | | </template> |
| | | <template v-else> |
| | | <div class="label">测试类型</div> |
| | | <div class="value">充电测试</div> |
| | | <div class="label">充电功率</div> |
| | | <div class="value">{{ params.chargePower }}KW</div> |
| | | <div class="label">充电限压</div> |
| | | <div class="value">{{ params.chargeVoltage }}V</div> |
| | | <div class="label">充电保护</div> |
| | |
| | | .batt-info { |
| | | .card-content { |
| | | height: 100%; |
| | | padding: 20px 6px 0; |
| | | padding: 6px 6px 0; |
| | | display: grid; |
| | | grid-template-columns: 8em 1fr; |
| | | // grid-template-rows: 1fr 1fr; |
| | | place-content: start center; |
| | | place-items: center start; |
| | | gap: 8px; |
| | | gap: 6px; |
| | | .label { |
| | | place-self: end; |
| | | } |