| | |
| | | function chooseDev(params) { |
| | | currentDevId.value = params.devId; |
| | | testRecordCode.value = undefined; |
| | | testDatas.value = []; |
| | | updateChart([]); |
| | | getList(); |
| | | } |
| | | |
| | |
| | | let type = ""; |
| | | switch (v) { |
| | | case "chr": |
| | | type = "充电测试"; |
| | | type = devType.value == 1 ? "充电测试" : "充电"; |
| | | break; |
| | | case "dis": |
| | | type = "放电测试"; |
| | | type = devType.value == 1 ? "放电测试" : "放电"; |
| | | break; |
| | | case "jun": |
| | | type = "均衡"; |
| | | break; |
| | | } |
| | | let label = type; |
| | | let value = v; |
| | | let children = arr.map((vv) => ({ |
| | | ...vv, |
| | | label: vv.testStarttime, |
| | | value: vv.testRecordCount, |
| | | })); |
| | | return { label, value, disabled: !arr.length, children }; |
| | | let children = []; |
| | | let count = arr.length; |
| | | if (devType.value == 1) { |
| | | children = arr.map((vv) => ({ |
| | | ...vv, |
| | | label: vv.testStarttime, |
| | | value: vv.testRecordCount, |
| | | })); |
| | | } else { |
| | | // 添加一级 区分是组1还是组2 |
| | | let _obj = {}; |
| | | for (let i = arr.length; i--; ) { |
| | | let item = arr[i]; |
| | | let idx = item.battIdx; |
| | | _obj[idx] = _obj[idx] || []; |
| | | _obj[idx].push(item); |
| | | } |
| | | |
| | | Object.keys(_obj).forEach((vv) => { |
| | | let item = _obj[vv]; |
| | | let idx = `组${vv * 1 + 1}`; |
| | | let _count = item.length; |
| | | children.push({ |
| | | label: idx, |
| | | count: _count, |
| | | value: `group_${vv}`, |
| | | children: item.map((vvv) => ({ |
| | | ...vvv, |
| | | label: vvv.testStarttime, |
| | | value: vvv.testRecordCount, |
| | | })), |
| | | }); |
| | | }); |
| | | // children = arr.map((vv) => ({ |
| | | // ...vv, |
| | | // label: vv.testStarttime, |
| | | // value: vv.testRecordCount, |
| | | // })); |
| | | } |
| | | return { label, value, count, disabled: !arr.length, children }; |
| | | }); |
| | | } |
| | | testRecordList.value = _list; |
| | |
| | | |
| | | const canSlide = computed(() => !!testDatas.value.length); |
| | | |
| | | const testInf = computed(() => { |
| | | if (testDatas.value.length) { |
| | | return testDatas.value[0]; |
| | | } else { |
| | | return {}; |
| | | } |
| | | }); |
| | | // const testInf = computed(() => { |
| | | // if (testDatas.value.length) { |
| | | // return testDatas.value[0]; |
| | | // } else { |
| | | // return {}; |
| | | // } |
| | | // }); |
| | | |
| | | function updateChart(data) { |
| | | let labels = [], |
| | |
| | | |
| | | // 设置柱状图 |
| | | function setBarChart(dataList) { |
| | | if (!dataList.length) { |
| | | return false; |
| | | } |
| | | // if (!dataList.length) { |
| | | // return false; |
| | | // } |
| | | |
| | | let unit = "V"; |
| | | let fixed = 3; |
| | |
| | | let index = getDataIndex(dataList.length, slideValue.value); |
| | | let labels = [], |
| | | datas = []; |
| | | if (index != -1) { |
| | | if (dataList.length && index != -1) { |
| | | let data = dataList[index]; |
| | | let batNum = getBarNum(data); |
| | | title = |
| | |
| | | } |
| | | |
| | | function selectRecord() { |
| | | let res = testRecordCode.value[1]; |
| | | console.log("res", res, "============="); |
| | | let res = testRecordCode.value[testRecordCode.value.length - 1]; |
| | | // console.log("res", res, "============="); |
| | | |
| | | getRecordInf(currentDevId.value, res) |
| | | .then((res) => { |
| | |
| | | size="default" |
| | | is-button |
| | | > |
| | | <el-radio-button :value="1">充放电一体机</el-radio-button> |
| | | <el-radio-button :value="1">充放电测试仪</el-radio-button> |
| | | <el-radio-button :value="2">均衡测试仪</el-radio-button> |
| | | </el-radio-group> |
| | | </div> |
| | |
| | | @change="selectRecord" |
| | | ><template #default="{ node, data }"> |
| | | <span>{{ data.label }}</span> |
| | | <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> |
| | | <span v-if="!node.isLeaf"> ({{ data.count }}) </span> |
| | | </template></el-cascader |
| | | > |
| | | <div class="info-title"> |
| | |
| | | </div> |
| | | <div class="info"> |
| | | <div class="label">测试时间</div> |
| | | <div class="content">{{ testInf.testStarttime }}</div> |
| | | <div class="content">{{ testObj.testStarttime }}</div> |
| | | <div class="label">测试时长</div> |
| | | <div class="content">{{ formatSeconds(testObj.testTimelong) }}</div> |
| | | <div class="label">数据类型</div> |
| | | <div class="content"> |
| | | {{ { 2: "充电数据", 3: "放电数据" }[testInf.testType] }} |
| | | {{ |
| | | { 2: "充电数据", 3: "放电数据", 4: "均衡数据" }[testObj.testType] |
| | | }} |
| | | </div> |
| | | <div class="label">停止原因</div> |
| | | <div class="content">{{ testObj.stopTypeReason }}</div> |
| | | <!-- <div class="label">标称容量</div> |
| | | <div class="content">4444444</div> |
| | | <div class="label">单体数量</div> |