|
|
@ -123,11 +123,31 @@ |
|
|
|
} |
|
|
|
|
|
|
|
/** 添加设备操作 */ |
|
|
|
// 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 openItem = (number : String) => { |
|
|
|
itemNumber.value = number; |
|
|
|
searchTableRef.value.open('设备列表', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage(), null, Item.allSchemas.searchSchema, true, null, null, null, null); |
|
|
|
/** 绑定备件操作 */ |
|
|
|
const openItem = async (number: String) => { |
|
|
|
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 deviceItemRelList = selections.map(element => ({ |
|
|
@ -138,6 +158,47 @@ |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
}) |
|
|
|
}; |
|
|
|
|
|
|
|
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() |
|
|
|