From 6b030791bb07dc789d1298561a22618ba044d74a Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 17 Jan 2025 10:36:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(AppInsuranceAudit):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=80=B3=E6=A0=87=E5=8F=B7=E9=80=89=E6=8B=A9=E5=92=8C=E5=85=BB?= =?UTF-8?q?=E6=AE=96=E5=9C=BA=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 add.vue 中增加 targetUser 字段,用于查询养殖场 - 修改 AiEartagPicker 组件,增加 valueKey 属性默认值 - 优化代码格式和样式 --- project/xumu/AppInsuranceAudit/add.vue | 10 ++++++---- project/xumu/components/AiEartagPicker.vue | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/project/xumu/AppInsuranceAudit/add.vue b/project/xumu/AppInsuranceAudit/add.vue index b90ef26a..6118ab8d 100644 --- a/project/xumu/AppInsuranceAudit/add.vue +++ b/project/xumu/AppInsuranceAudit/add.vue @@ -104,8 +104,10 @@ export default { userId && this.instance.post("/api/siteUser/querySiteByUserId", null, { params: { userId } }).then(res => { - if (res?.data) { - this.$set(this.detail, "farmId", res.data?.[0]?.id) + if (res?.data?.[0]) { + const { id } = res.data[0] + this.$set(this.detail, "farmId", id) + this.$set(this.detail, "targetUser", userId) } }) } @@ -126,7 +128,7 @@ export default { + :action="`/api/siteUser/querySiteByUserId?userId=${detail.targetUser}`" :prop="{ label: 'name' }" /> @@ -185,7 +187,7 @@ export default { - + diff --git a/project/xumu/components/AiEartagPicker.vue b/project/xumu/components/AiEartagPicker.vue index f1705d22..f26d096a 100644 --- a/project/xumu/components/AiEartagPicker.vue +++ b/project/xumu/components/AiEartagPicker.vue @@ -3,10 +3,10 @@ export default { name: "AiEartagPicker", props: { instance: Function, - value: {default: () => []}, - action: {default: "/api/breed/earTag/getEarTagByPenId"}, + value: { default: () => [] }, + action: { default: "/api/breed/earTag/getEarTagByPenId" }, penId: String, - valueKey: String + valueKey: { type: String, default: "biochipEarNumber" } }, model: { prop: "value", @@ -45,9 +45,9 @@ export default { this.origin = res.data ?? [] this.list = res.data?.map(v => { if (typeof v == 'string') { - return {key: v, label: v} + return { key: v, label: v } } else if (key) { - return {key: v[key], label: v[key]} + return { key: v[key], label: v[key] } } }) || [] } @@ -65,15 +65,15 @@ export default { @@ -95,7 +95,7 @@ export default { right: 0; z-index: 999; - & > div { + &>div { height: 100%; } }