Explorar o código

运行记录填报

yuanchao hai 2 meses
pai
achega
95bd4c5213

+ 4 - 1
src/views/pms/iotopeationfill/index1.vue

@@ -203,7 +203,10 @@ const getAttrList = async () => {
         item.name = '当日运转时间'
         totalRunTime1 = Number(item.totalRunTime).toFixed(2)
       }
-      totalRunTime1 = Number(item.totalRunTime).toFixed(2)
+      if(item.name === '当日运转时间'){
+        totalRunTime1 = Number(item.totalRunTime).toFixed(2)
+      }
+
       item.fillContent = Number(item.fillContent).toFixed(2)
       item.deviceCode = queryParams.deviceCode;
       item.deptId = queryParams.deptId;

+ 7 - 1
src/views/pms/modeltemplate/ModelCategoryTree.vue

@@ -50,6 +50,8 @@ const menuVisible = ref(false);
 const menuX = ref(0);
 const menuY = ref(0);
 let selectedNode = null;
+const firstLevelKeys = ref([])
+
 const handleRightClick = (event, { node, data }) => {
   event.preventDefault();
   menuX.value = event.clientX;
@@ -76,7 +78,11 @@ const handleMenuClick = (action) => {
 const getTree = async () => {
   const res = await DeviceCategoryApi.IotProductClassifyApi.getSimpleProductClassifyList()
   deviceCategoryList.value = []
-  deviceCategoryList.value.push(...handleTree(res))
+  let device: Tree = { id: 0, name: '顶级设备分类', children: [] }
+  device.children = handleTree(res)
+  // deviceCategoryList.value.push(...handleTree(res))
+  deviceCategoryList.value.push(device)
+  firstLevelKeys.value = deviceCategoryList.value.map(node => node.id);
 }
 
 /** 基于名字过滤 */