add rfid
This commit is contained in:
parent
8756ffe09b
commit
54b2e0b57c
|
@ -90,10 +90,10 @@ const { optionsData } = useDictOptions<{
|
|||
|
||||
const loading = ref(false)
|
||||
|
||||
const queryFenceHouse = async (user_id: string) => {
|
||||
const queryFenceHouse = async (fence_house_name: string) => {
|
||||
loading.value = true
|
||||
const fenceHouseList = await apiFenceHouseLists({
|
||||
user_id: user_id ?? ''
|
||||
fence_house_name: fence_house_name ?? ''
|
||||
})
|
||||
optionsData.fenceHouse = fenceHouseList
|
||||
loading.value = false
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
:remote-method="queryUser"
|
||||
@change="selectedUser"
|
||||
:loading="loading"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in optionsData.user"
|
||||
|
@ -70,6 +71,7 @@
|
|||
placeholder="请选择"
|
||||
:remote-method="queryFenceHouse"
|
||||
:loading="loading"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in optionsData.fenceHouse"
|
||||
|
@ -126,7 +128,7 @@ const handleAvatarSuccessAvatar: UploadProps["onSuccess"] = (
|
|||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑产品' : '新增产品'
|
||||
})
|
||||
|
||||
const fence_house_name = ref('')
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
|
@ -183,7 +185,7 @@ const { optionsData } = useDictOptions<{
|
|||
api: getUserList
|
||||
},
|
||||
fenceHouse: {
|
||||
api: apiLandLists
|
||||
api: apiFenceHouseLists
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -201,13 +203,15 @@ const queryUser = async (query: string) => {
|
|||
const selectedUser = (value: any) => {
|
||||
optionsData.fenceHouse = []
|
||||
formData.fence_house_id = ''
|
||||
queryFenceHouse(value)
|
||||
queryFenceHouse({user_id: value})
|
||||
}
|
||||
const queryFenceHouse = async (user_id: string) => {
|
||||
const queryFenceHouse = async (query: any) => {
|
||||
// string类型表示手动查询筛选条件
|
||||
if(typeof query == 'string') {
|
||||
query = {fence_house_name: query}
|
||||
}
|
||||
loading.value = true
|
||||
const fenceHouseList = await apiFenceHouseLists({
|
||||
user_id: user_id ?? ''
|
||||
})
|
||||
const fenceHouseList = await apiFenceHouseLists(query)
|
||||
optionsData.fenceHouse = fenceHouseList
|
||||
loading.value = false
|
||||
}
|
||||
|
@ -239,7 +243,7 @@ const open = (type = 'add') => {
|
|||
const root = res.user.root ?? 0
|
||||
formData.root = root
|
||||
if (type == 'edit') {
|
||||
queryFenceHouse(formData.user_id)
|
||||
queryFenceHouse({user_id: formData.user_id})
|
||||
}
|
||||
})
|
||||
.catch((err: any) => {
|
||||
|
|
Loading…
Reference in New Issue