From 685f965d5ae0acaa8547d159c52c55bb722172cd Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 18 Jan 2024 11:21:28 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=A0=8F=E8=88=8D=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/views/fence_house/edit.vue | 94 ++++++++++- admin/src/views/fence_house/index.vue | 8 +- .../lists/fence_house/FenceHouseLists.php | 152 +++++++++--------- .../logic/fence_house/FenceHouseLogic.php | 10 +- 4 files changed, 177 insertions(+), 87 deletions(-) diff --git a/admin/src/views/fence_house/edit.vue b/admin/src/views/fence_house/edit.vue index d150794..f09f1aa 100644 --- a/admin/src/views/fence_house/edit.vue +++ b/admin/src/views/fence_house/edit.vue @@ -28,6 +28,9 @@ + + + - + + + - - + + + + +
+ + + +
+
@@ -72,19 +103,37 @@ import Popup from '@/components/popup/index.vue' import {apiFenceHouseAdd, apiFenceHouseEdit, apiFenceHouseDetail, apiFenceHouseLists, apiFarmLists} from '@/api/fence_house' import { timeFormat } from '@/utils/util' import type { PropType } from 'vue' -import {useDictOptions} from "@/hooks/useDictOptions"; -import {ref} from "vue"; +import {useDictOptions} from "@/hooks/useDictOptions" +import {ref} from "vue" +import config from "@/config"; +import useUserStore from "@/stores/modules/user"; +import {ElMessage, type UploadProps} from "element-plus"; + defineProps({ dictData: { type: Object as PropType>, default: () => ({}) } }) + const emit = defineEmits(['success', 'close']) const formRef = shallowRef() const popupRef = shallowRef>() const mode = ref('add') +const acceptFileTypes = ref(".png, .jpg, .jpeg, image/png, image/jpeg") +const action = ref(`${config.baseUrl}${config.urlPrefix}/upload/image`) +const userStore = useUserStore() +const handleAvatarSuccessAvatar: UploadProps["onSuccess"] = ( + response, + uploadFile +) => { + if (response.code == 0) { + ElMessage.error(response.msg); + return; + } + formData.image = response.data.uri; +} // 弹窗标题 const popupTitle = computed(() => { @@ -95,6 +144,7 @@ const popupTitle = computed(() => { const formData = reactive({ id: '', farm_id: '', + animal_name: '', fence_house_name: '', animal_type: '', fence_house_type: '', @@ -102,6 +152,7 @@ const formData = reactive({ master: '', status: '', qr_code: '', + image: '', }) @@ -130,7 +181,6 @@ const queryFarm= async (query: string) => { optionsData.farmList = farmList loading.value = false } -console.log(optionsData) // 获取详情 @@ -183,3 +233,35 @@ defineExpose({ getDetail }) + + + \ No newline at end of file diff --git a/admin/src/views/fence_house/index.vue b/admin/src/views/fence_house/index.vue index 5ed311c..e22fe9c 100644 --- a/admin/src/views/fence_house/index.vue +++ b/admin/src/views/fence_house/index.vue @@ -47,7 +47,11 @@ - + + +