diff --git a/admin/src/api/fence_house.ts b/admin/src/api/fence_house.ts index 40ed34a..bf7bec6 100644 --- a/admin/src/api/fence_house.ts +++ b/admin/src/api/fence_house.ts @@ -23,4 +23,8 @@ export function apiFenceHouseDelete(params: any) { // 栏舍管理详情 export function apiFenceHouseDetail(params: any) { return request.get({ url: '/fence_house.fence_house/detail', params }) +} + +export function apiFarmLists(params: any) { + return request.get({ url: '/farm.farm/datas', params }) } \ No newline at end of file diff --git a/admin/src/api/monitor_threshold.ts b/admin/src/api/monitor_threshold.ts index b4f33f1..d7abd6f 100644 --- a/admin/src/api/monitor_threshold.ts +++ b/admin/src/api/monitor_threshold.ts @@ -23,4 +23,8 @@ export function apiMonitorThresholdDelete(params: any) { // 报警配置详情 export function apiMonitorThresholdDetail(params: any) { return request.get({ url: '/device.monitor_threshold/detail', params }) +} + +export function apiFenceHouseLists(params: any) { + return request.get({ url: '/fence_house.fence_house/datas', params }) } \ No newline at end of file diff --git a/admin/src/views/device/edit.vue b/admin/src/views/device/edit.vue index ee9205d..0306990 100644 --- a/admin/src/views/device/edit.vue +++ b/admin/src/views/device/edit.vue @@ -43,7 +43,7 @@ - + { popupRef.value?.close() emit('success') } - +const generateUuid = () => { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + const r = (Math.random() * 16) | 0 + const v = c == 'x' ? r : (r & 0x3) | 0x8 + return v.toString(16) + }) +} //打开弹窗 const open = (type = 'add') => { mode.value = type - popupRef.value?.open() + formData.code = generateUuid() + popupRef.value?.open() } // 关闭回调 diff --git a/admin/src/views/fence_house/edit.vue b/admin/src/views/fence_house/edit.vue index 6302db9..d150794 100644 --- a/admin/src/views/fence_house/edit.vue +++ b/admin/src/views/fence_house/edit.vue @@ -9,8 +9,21 @@ @close="handleClose" > - - + + + + @@ -56,9 +69,11 @@