Jelajahi Sumber

组件参数单位值缓存;弹窗单位值获取

lichunyang 1 bulan lalu
induk
melakukan
294a5a9e66
1 mengubah file dengan 6 tambahan dan 6 penghapusan
  1. 6 6
      src/views/model/vueflow/aside/asideData.vue

+ 6 - 6
src/views/model/vueflow/aside/asideData.vue

@@ -155,15 +155,15 @@
               <div style="width: 50%; min-width: 100px">
                 <el-select
                   v-if="col.unit !== '无'"
-                  v-model="col.unit"
+                  v-model="col.unitDef"
                   size="small"
-                  @change="(val) => handleUnitChange(col, val)"
+                  @focus="fetchUnitsForRow(col)"
                 >
                   <el-option
                     v-for="opt in col.unitoptions"
-                    :key="opt.val"
-                    :label="opt.tag"
-                    :value="opt.val"
+                    :key="opt.utId"
+                    :label="opt.value"
+                    :value="opt.value"
                   />
                 </el-select>
               </div>
@@ -956,7 +956,7 @@ const openresultline = (name, unit, coms) => {
 // 组件参数点击下拉框调用接口获取单位
 const fetchUnitsForRow = async (row) => {
   if (unitOptionsCache.value[row.unitType]) {
-    row.unitoptions  = unitOptionsCache.value[row.gutId]
+    row.unitoptions  = unitOptionsCache.value[row.unitType]
     if (!row.unitDef && row.unitOptions.length > 0) {
       row.unitDef = row.unitOptions[0].value
     }