yuanchao пре 2 месеци
родитељ
комит
0ac878c6f6
2 измењених фајлова са 41 додато и 20 уклоњено
  1. 40 17
      src/views/pms/iotopeationfill/index1.vue
  2. 1 3
      src/views/pms/modeltemplate/TemplateForm.vue

+ 40 - 17
src/views/pms/iotopeationfill/index1.vue

@@ -26,11 +26,24 @@
                     {{item.orgName}}
                   </span>
                 </el-form-item>
-                <el-form-item :label="t('operationFillForm.sumTime')" class="custom-label1">
+                <el-row :gutter="20">
+                  <el-col
+                    v-for="(item,index) in attrList1"
+                    :key="index"
+                    :span="4"
+                  >
+                    <el-form-item :label='item.name' class="custom-label1">
+                  <span style="text-decoration: underline;">
+                  {{item.totalRunTime}}h
+                  </span>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+<!--                <el-form-item :label="t('operationFillForm.sumTime')" class="custom-label1">
                   <span style="text-decoration: underline;">
                   {{totalRunTime1}}h
                   </span>
-                </el-form-item>
+                </el-form-item>-->
               </el-form>
             </div>
             <div v-for="(item,index) in attrList" :key="index">
@@ -84,7 +97,8 @@ const loading = ref(true) // 列表的加载中
 const { params, name } = useRoute() // 查询参数
 const deptId = params.id
 const list = ref<IotOpeationFillVO[]>([]) // 列表的数据
-const attrList = ref<IotOpeationFillVO[]>([]) // 列表的数据
+const attrList = ref<IotOpeationFillVO[]>([]) // 非累计属性集合
+const attrList1 = ref<IotOpeationFillVO[]>([]) // 累计属性集合
 const total = ref(0) // 列表的总页数
 const arry1 =ref([]);
 let totalRunTime1: string = '123'
@@ -179,7 +193,6 @@ const open = async (type: string, id?: number) => {
 }
 defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 const openFill = (deviceCategoryId?:number,deviceId?:number,deptId?:number,deviceName?:string,deviceCode?:string) =>{
-
   queryParams.deviceCategoryId = deviceCategoryId;
   queryParams.deptId = deptId;
   queryParams.deviceCode = deviceCode;
@@ -192,26 +205,26 @@ const openFill = (deviceCategoryId?:number,deviceId?:number,deptId?:number,devic
 const getAttrList = async () => {
   loading.value = true
   try {
-    totalRunTime1 = 0;
     queryParams.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2].substring(0,10)));
     const data = await IotOpeationFillApi.getAttrs(queryParams)
-    attrList.value = data;
+    attrList.value = data[0].nonSumList;
+    attrList1.value = data[0].sumList;
     attrList.value.forEach(function (item,index){
-
-      if(item.name==='累计运行时间'){
-        item.name = '当日运转时间'
+      /*if(item.name === '当日运转时间'){
         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;
       item.deviceId = queryParams.deviceId;
       item.deviceCategoryId = queryParams.deviceCategoryId;
     })
+    attrList1.value.forEach(function (item,index){
+      item.deviceCode = queryParams.deviceCode;
+      item.deptId = queryParams.deptId;
+      item.deviceId = queryParams.deviceId;
+      item.deviceCategoryId = queryParams.deviceCategoryId;
+    })
   } finally {
     loading.value = false
   }
@@ -220,10 +233,9 @@ const getAttrList = async () => {
 /** 获取填写信息保存到后台*/
 const getFillInfo = async () => {
   try {
+    attrList.value = attrList.value.concat(attrList1.value)
+
     attrList.value.forEach(function (item,index){
-      if(item.isCollection===1){
-        item.totalRunTime = totalRunTime1;
-      }
       item.pointName = item.name;
       item.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2].substring(0,10)));
       item.userId = deptId.split(",")[1];
@@ -371,4 +383,15 @@ onMounted(() => {
 }
 
 }
+
+.horizontal-container {
+  display: flex;
+  flex-wrap: wrap; /* 允许换行 */
+  gap: 20px; /* 项目间距 */
+}
+
+.form-item-container {
+  flex: 1; /* 等宽分布 */
+  min-width: 200px; /* 最小宽度防止挤压 */
+}
 </style>

+ 1 - 3
src/views/pms/modeltemplate/TemplateForm.vue

@@ -8,7 +8,7 @@
       label-width="100px"
     >
       <el-row>
-        <el-col :span="24">
+        <el-col :span="12">
           <el-form-item label="设备分类" prop="deviceCategoryId">
             <el-tree-select
               v-model="formData.deviceCategoryId"
@@ -23,8 +23,6 @@
             />
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row>
         <el-col :span="12">
           <el-form-item label="模板名称" prop="name">
             <el-input v-model="formData.name" maxlength="32" placeholder="请输入模板名称" />