|
@@ -25,15 +25,28 @@ const activeDeviceId = ref<number>();
|
|
const activeDeviceType = ref<DeviceType>(DeviceType.空);
|
|
const activeDeviceType = ref<DeviceType>(DeviceType.空);
|
|
const activeDeviceStatus = ref<DeviceStatusQuery>(DeviceStatusQuery.All);
|
|
const activeDeviceStatus = ref<DeviceStatusQuery>(DeviceStatusQuery.All);
|
|
|
|
|
|
|
|
+const deviceTypeOrder = [
|
|
|
|
+ DeviceType.冷水主机,
|
|
|
|
+ DeviceType.控制柜,
|
|
|
|
+ DeviceType.冷却塔,
|
|
|
|
+ DeviceType.冷却泵,
|
|
|
|
+ DeviceType.冷冻泵,
|
|
|
|
+];
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
handleRequest(async () => {
|
|
handleRequest(async () => {
|
|
- deviceTypes.value = await getDevWorkTypeCount(props.deviceGroupId, [
|
|
|
|
- DeviceType.冷水主机,
|
|
|
|
- DeviceType.控制柜,
|
|
|
|
- DeviceType.冷却塔,
|
|
|
|
- DeviceType.冷却泵,
|
|
|
|
- DeviceType.冷冻泵,
|
|
|
|
- ]);
|
|
|
|
|
|
+ deviceTypes.value = await getDevWorkTypeCount(props.deviceGroupId, deviceTypeOrder);
|
|
|
|
+
|
|
|
|
+ deviceTypes.value.sort((a, b) => {
|
|
|
|
+ const indexA = deviceTypeOrder.indexOf(a.deviceType);
|
|
|
|
+ const indexB = deviceTypeOrder.indexOf(b.deviceType);
|
|
|
|
+
|
|
|
|
+ // 如果某个设备类型不在指定顺序中,将其放在末尾
|
|
|
|
+ if (indexA === -1) return 1;
|
|
|
|
+ if (indexB === -1) return -1;
|
|
|
|
+
|
|
|
|
+ return indexA - indexB;
|
|
|
|
+ });
|
|
|
|
|
|
if (deviceTypes.value.length) {
|
|
if (deviceTypes.value.length) {
|
|
if (route.query.deviceType && route.query.deviceId) {
|
|
if (route.query.deviceType && route.query.deviceId) {
|