Explorar el Código

perf(components): 优化“设备详情”跳转地址

wangshun hace 1 mes
padre
commit
0e645c8294

+ 1 - 0
src/views/device-list/DeviceList.vue

@@ -231,6 +231,7 @@ onMounted(() => {
               :options="equipmentType"
               :field-names="{ label: 'dataName', value: 'id' }"
               placeholder="请选择"
+              :allow-clear="true"
             />
           </div>
           <div>

+ 2 - 2
src/views/equipment-details/EquipmentDetails.vue

@@ -207,11 +207,11 @@ const colorShow = (value: number | string) => {
 };
 
 const selectDeviceId = () => {
-  router.push(`/device-manage/equipment-details/${deviceId}`);
+  router.push(`/device-manage/device-list/equipment-details/${deviceId}`);
 };
 
 const switchDevices = (value: number) => {
-  router.push(`/device-manage/equipment-details/${getPreviousIdById(devicesList.value, deviceId, value)}`);
+  router.push(`/device-manage/device-list/equipment-details/${getPreviousIdById(devicesList.value, deviceId, value)}`);
 };
 
 const getPreviousIdById = (array: AllDevicesList[], targetId: number, value: number) => {