|
@@ -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(()=>{
|
|
|
-
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
//监听
|