|
@ -123,12 +123,32 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 添加设备操作 */ |
|
|
/** 添加设备操作 */ |
|
|
|
|
|
// const searchTableRef = ref() |
|
|
|
|
|
// const openItem = (number : String) => { |
|
|
|
|
|
// itemNumber.value = number; |
|
|
|
|
|
// searchTableRef.value.open('设备列表', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage(), null, Item.allSchemas.searchSchema, true, null, null, null, null); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
const searchTableRef = ref() |
|
|
const openItem = (number : String) => { |
|
|
/** 绑定备件操作 */ |
|
|
itemNumber.value = number; |
|
|
const openItem = async (number: String) => { |
|
|
searchTableRef.value.open('设备列表', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage(), null, Item.allSchemas.searchSchema, true, null, null, null, null); |
|
|
itemNumber.value = number |
|
|
|
|
|
searchTableRef.value.open( |
|
|
|
|
|
'选择设备', |
|
|
|
|
|
DeviceAccounts.allSchemas, |
|
|
|
|
|
getDeviceItemList, |
|
|
|
|
|
null, |
|
|
|
|
|
Item.allSchemas.searchSchema, |
|
|
|
|
|
true, |
|
|
|
|
|
null, |
|
|
|
|
|
null, |
|
|
|
|
|
null, |
|
|
|
|
|
null |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => { |
|
|
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => { |
|
|
const deviceItemRelList = selections.map(element => ({ |
|
|
const deviceItemRelList = selections.map(element => ({ |
|
|
itemNumber: itemNumber.value, |
|
|
itemNumber: itemNumber.value, |
|
@ -139,6 +159,47 @@ |
|
|
}) |
|
|
}) |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getItemWithOutBind = async () => { |
|
|
|
|
|
try { |
|
|
|
|
|
const res = await DeviceAccountsApi.getDeviceAccountsPage({ |
|
|
|
|
|
...Item.allSchemas.searchSchema |
|
|
|
|
|
}) |
|
|
|
|
|
if (res.list?.length > 0) { |
|
|
|
|
|
// const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema); |
|
|
|
|
|
// const filteredList = res.list.filter(item => { |
|
|
|
|
|
// return !response.list?.some(element => { |
|
|
|
|
|
// return item.number === element.itemNumber |
|
|
|
|
|
// }); |
|
|
|
|
|
// }); |
|
|
|
|
|
// console.log('filteredList',filteredList); |
|
|
|
|
|
const filteredList = res.list |
|
|
|
|
|
return filteredList // 返回过滤后的列表 |
|
|
|
|
|
} |
|
|
|
|
|
return [] // 如果没有数据,返回空数组 |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error(error) |
|
|
|
|
|
throw error // 抛出错误 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 将 getListApi 替换为 getItemWithOutBind |
|
|
|
|
|
const getDeviceItemList = async () => { |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
try { |
|
|
|
|
|
const res = await getItemWithOutBind() |
|
|
|
|
|
let result = { |
|
|
|
|
|
list: res, |
|
|
|
|
|
total: res.length |
|
|
|
|
|
} |
|
|
|
|
|
return result |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error(error) |
|
|
|
|
|
} finally { |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type : string, row ?: any) => { |
|
|
const openForm = (type : string, row ?: any) => { |
|
|