tangjunhao 2 luni în urmă
părinte
comite
6e17a20e2b
2 a modificat fișierele cu 28 adăugiri și 3 ștergeri
  1. 24 1
      src/views/model/index.vue
  2. 4 2
      src/views/model/vueflow/aside/asideData.vue

+ 24 - 1
src/views/model/index.vue

@@ -376,7 +376,7 @@ const btnfunc = (name) => {
 
 const runProject = () => {
   const params = {
-    transCode: "ES1001",
+    transCode: "ES0013",
     pid: pid.value
   }
   request(params)
@@ -472,6 +472,29 @@ const getlistopt = async (item, gettype) => {
 
 const saveSLTabelDialog = () => {
   SLdatadialog.value = false
+  console.log("tableSLData:", tableSLData.value)
+  // dataType 为 -1 的数据
+  const validItems = tableSLData.value.filter((item) => item.dataType === -1)
+  const pcavals = validItems
+    .map((item) => {
+      const pcaId = item.pcaId ?? ""
+      const value = item.value ?? ""
+      const unit = item.unit ?? ""
+      return `${pcaId},${value},${unit}`
+    })
+    .join(";")
+  const params = {
+    transCode: "ES0008",
+    pcavals: pcavals
+  }
+  request(params)
+    .then((res) => {
+      ElMessage.success("保存成功")
+    })
+    .catch((err) => {
+      console.error("err", err)
+      ElMessage.error("保存失败")
+    })
 }
 
 

+ 4 - 2
src/views/model/vueflow/aside/asideData.vue

@@ -406,6 +406,8 @@ const getcomdata = async (pcId) => {
 
       if (item.valueType === 1) {
         promises.push(getlistopt(item, "value"))
+      }else if( item.valueType === 0 ){
+        item.value = item.valueDef
       }
 
       if (item.unitType !== "无") {
@@ -526,8 +528,8 @@ const getbtnvalue = async (pcaId, dataType) => {
           cdvId: header.cdvId,
           property: header?.name || "",
           value: dataItem?.value || "",
-          pcadgId: dataItem?.pcadgId || "",
-          pcadId: rowCount,
+          pcadId: dataItem?.pcadId || "",
+          pcadgId: rowCount,
           unit: dataItem?.unit || "无"
         })
       })