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