| | |
| | | } |
| | | 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; |
| | |
| | | } |
| | | |
| | | function selectRecord() { |
| | | let res = testRecordCode.value[1]; |
| | | let res = testRecordCode.value[testRecordCode.value.length - 1]; |
| | | // console.log("res", res, "============="); |
| | | |
| | | getRecordInf(currentDevId.value, 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"> |