duy 3 месяцев назад
Родитель
Сommit
42abacc1f5
1 измененных файлов с 21 добавлено и 2 удалено
  1. 21 2
      src/views/tentative/detect/components/basicInfo.vue

+ 21 - 2
src/views/tentative/detect/components/basicInfo.vue

@@ -287,9 +287,28 @@ const isShow = defineModel('modelValue', {
     default: false,
 })
 const standardId = ref('')
+const ypList = ref([]) // 确保 ypList 已定义
+const ypLoad = ref(false)
+const getYpList = async (id)=>{
+        ypLoad.value = true
+    const { error, code, data } = await codeApi.getStandardInfoByStandardId({
+        standardId: id,
+    })
+    //处理数据
+    ypLoad.value = false
+    if (!error && code === 200) {
+        ypList.value = getArrValue(data)
+       
+    } else {
+        ypList.value = []
+    }
+}
+// 监听 standardId 的变化
+watch(standardId, async (newVal, oldVal) => {
+    if (newVal !== oldVal) {
+        getYpList(newVal)
 
-watch(()=>{
-
+    }
 })
 
 //监听