|
@ -1,18 +1,22 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="DeviceAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search |
|
|
|
|
|
:schema="DeviceAccounts.allSchemas.searchSchema" |
|
|
|
|
|
@search="setSearchParams" |
|
|
|
|
|
@reset="setSearchParams" |
|
|
|
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
|
<TableHead |
|
|
<TableHead |
|
|
:HeadButttondata="HeadButttondata" |
|
|
:HeadButttondata="HeadButttondata" |
|
|
@button-base-click="buttonBaseClick" |
|
|
@button-base-click="buttonBaseClick" |
|
|
:routeName="routeName" |
|
|
:routeName="routeName" |
|
|
@updataTableColumns="updataTableColumns" |
|
|
@updataTableColumns="updataTableColumns" |
|
|
@searchFormClick="searchFormClick" |
|
|
@searchFormClick="searchFormClick" |
|
|
:allSchemas="DeviceAccounts.allSchemas" |
|
|
:allSchemas="DeviceAccounts.allSchemas" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
@ -27,13 +31,13 @@ |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:sort="tableObject.sort" |
|
|
v-model:sort="tableObject.sort" |
|
|
> |
|
|
> |
|
|
<template #number="{row}"> |
|
|
<template #number="{ row }"> |
|
|
<el-button type="primary" link @click="openDetail(row, '编号', row.number)"> |
|
|
<el-button type="primary" link @click="openDetail(row, '编号', row.number)"> |
|
|
<span>{{ row.number }}</span> |
|
|
<span>{{ row.number }}</span> |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row }"> |
|
|
<template #action="{ row }"> |
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" /> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
@ -49,43 +53,62 @@ |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
:isBusiness="false" |
|
|
:isBusiness="false" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<SearchTable |
|
|
|
|
|
ref="searchTableRef" |
|
|
|
|
|
@searchTableSuccess="submitItem" |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" /> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<DetailDeviceLedger |
|
|
<DetailDeviceLedger |
|
|
ref="detailRef" |
|
|
ref="detailRef" |
|
|
:tabs="DeviceLedgerTabsList" |
|
|
:tabs="DeviceLedgerTabsList" |
|
|
:isBasic="true" |
|
|
:subTabs="DeviceLedgerSubTabsList" |
|
|
:allSchemas="allSchemas" |
|
|
:isBasic="true" |
|
|
|
|
|
:allSchemas="allSchemas" |
|
|
@changeTabs="changeTabs" |
|
|
@changeTabs="changeTabs" |
|
|
:detailAllSchemas="detailAllSchemas" |
|
|
:detailAllSchemas="detailAllSchemas" |
|
|
:apiPage="apiPage" |
|
|
:apiPage="apiPage" |
|
|
:tabsExtend="tabsExtend" |
|
|
:tabsExtend="tabsExtend" |
|
|
:tableObjectExtend="tableObjectExtend" |
|
|
:tableObjectExtend="tableObjectExtend" |
|
|
|
|
|
:imageFormAllSchemas="UpImage.allSchemas" |
|
|
|
|
|
:upImageRules="UpImageRules" |
|
|
|
|
|
:fileFormAllSchemas="UploadFile.allSchemas" |
|
|
|
|
|
:upFileRules="UpFileRules" |
|
|
|
|
|
@uploadImage="uploadImage" |
|
|
|
|
|
@subTabsChick="subTabsChick" |
|
|
|
|
|
@uploadFile="uploadFile" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/eam/device-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
<ImportForm |
|
|
|
|
|
ref="importFormRef" |
|
|
|
|
|
url="/eam/device-accounts/import" |
|
|
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
|
|
@success="importSuccess" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { DeviceAccounts, DeviceAccountsRules } from './deviceAccounts.data' |
|
|
import { |
|
|
|
|
|
DeviceAccounts, |
|
|
|
|
|
DeviceAccountsRules, |
|
|
|
|
|
UpImage, |
|
|
|
|
|
UpImageRules, |
|
|
|
|
|
UploadFile, |
|
|
|
|
|
UpFileRules |
|
|
|
|
|
} from './deviceAccounts.data' |
|
|
import { Item } from '@/views/eam/basic/item/item.data' |
|
|
import { Item } from '@/views/eam/basic/item/item.data' |
|
|
import { createDeviceItemBatch,getDeviceItemPage } from '@/api/eam/basic/rel' |
|
|
import * as ItemApi from '@/api/eam/basic/item' |
|
|
|
|
|
import { createDeviceItemBatch, getDeviceItemPage } from '@/api/eam/basic/rel' |
|
|
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|
|
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import { DeviceLedgerTabsList } from '@/utils/disposition/tabsList' |
|
|
import { DeviceLedgerTabsList } from '@/utils/disposition/tabsList' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import DetailDeviceLedger from '@/components/Detail/src/DetailDeviceLedger.vue' |
|
|
import DetailDeviceLedger from '@/components/Detail/src/DetailDeviceLedger.vue' |
|
|
import * as ItemApi from '@/api/eam/basic/item' |
|
|
import { DeviceRepair } from '@/views/eam/device/deviceRepair/deviceRepair.data' |
|
|
|
|
|
import * as deviceRepairApi from '@/api/eam/device/deviceRepair' |
|
|
|
|
|
import * as uploadApi from '@/api/eam/upload' |
|
|
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
|
|
|
|
|
|
defineOptions({ name: 'DeviceAccounts' }) |
|
|
defineOptions({ name: 'DeviceAccounts' }) |
|
|
|
|
|
|
|
@ -94,13 +117,15 @@ const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
|
const route = useRoute() // 路由信息 |
|
|
const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
const deviceNumber = ref(); |
|
|
const deviceNumber = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(DeviceAccounts.allSchemas.tableColumns) |
|
|
const tableColumns = ref(DeviceAccounts.allSchemas.tableColumns) |
|
|
|
|
|
|
|
|
const allSchemas = ref(Item.allSchemas) |
|
|
const allSchemas = ref(DeviceAccounts.allSchemas) |
|
|
const detailAllSchemas = ref() |
|
|
const detailAllSchemas = ref() |
|
|
const apiPage = ref() |
|
|
const apiPage = ref() |
|
|
|
|
|
const itemCodeRow = ref() |
|
|
|
|
|
const tableObjectExtend = ref() |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
@ -130,7 +155,7 @@ const HeadButttondata = [ |
|
|
defaultButtons.defaultExportBtn(null), // 导出 |
|
|
defaultButtons.defaultExportBtn(null), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
// { |
|
|
// { |
|
|
// label: '自定义扩展按钮', |
|
|
// label: '自定义扩展按钮', |
|
|
// name: 'zdy', |
|
|
// name: 'zdy', |
|
@ -143,16 +168,22 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { |
|
|
|
|
|
// 新增 |
|
|
openForm('create') |
|
|
openForm('create') |
|
|
} else if (val == 'import') { // 导入 |
|
|
} else if (val == 'import') { |
|
|
|
|
|
// 导入 |
|
|
handleImport() |
|
|
handleImport() |
|
|
} else if (val == 'export') { // 导出 |
|
|
} else if (val == 'export') { |
|
|
|
|
|
// 导出 |
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
} else if (val == 'refresh') { |
|
|
|
|
|
// 刷新 |
|
|
getList() |
|
|
getList() |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { |
|
|
} else { // 其他按钮 |
|
|
// 筛选 |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他按钮 |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -161,15 +192,17 @@ const buttonBaseClick = (val, item) => { |
|
|
const butttondata = [ |
|
|
const butttondata = [ |
|
|
defaultButtons.mainListEditBtn(null), // 编辑 |
|
|
defaultButtons.mainListEditBtn(null), // 编辑 |
|
|
// defaultButtons.mainListDeleteBtn(null), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn(null), // 删除 |
|
|
defaultButtons.selectQrCodeBtn(null),//二维码 |
|
|
defaultButtons.selectQrCodeBtn(null), //二维码 |
|
|
defaultButtons.selectItemBtn(null),//备件 |
|
|
defaultButtons.selectItemBtn(null) //备件 |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'edit') { // 编辑 |
|
|
if (val == 'edit') { |
|
|
|
|
|
// 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'selectQrCode') { // 二维码 |
|
|
} else if (val == 'selectQrCode') { |
|
|
|
|
|
// 二维码 |
|
|
openQrCode(row.number) |
|
|
openQrCode(row.number) |
|
|
} else if (val == 'selectItem') { |
|
|
} else if (val == 'selectItem') { |
|
|
openItem(row.number) |
|
|
openItem(row.number) |
|
@ -179,23 +212,22 @@ const buttonTableClick = async (val, row) => { |
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
|
|
|
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// form表单提交 |
|
|
// form表单提交 |
|
|
const formsSuccess = async (formType,data) => { |
|
|
const formsSuccess = async (formType, data) => { |
|
|
var isHave =DeviceAccounts.allSchemas.formSchema.some(function (item) { |
|
|
var isHave = DeviceAccounts.allSchemas.formSchema.some(function (item) { |
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
return item.field === 'activeTime' || item.field === 'expireTime' |
|
|
}); |
|
|
}) |
|
|
if(isHave){ |
|
|
if (isHave) { |
|
|
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|
|
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { |
|
|
message.error('失效时间要大于生效时间') |
|
|
message.error('失效时间要大于生效时间') |
|
|
return; |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
if (data.activeTime == 0) data.activeTime = null |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
await DeviceAccountsApi.createDeviceAccounts(data) |
|
|
await DeviceAccountsApi.createDeviceAccounts(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
@ -210,6 +242,7 @@ const formsSuccess = async (formType,data) => { |
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
|
|
itemCodeRow.value = row.number |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceAccounts') |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceAccounts') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -266,13 +299,85 @@ const searchFormClick = (searchData) => { |
|
|
getList() // 刷新当前列表 |
|
|
getList() // 刷新当前列表 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const DeviceLedgerSubTabsList = getStrDictOptions(DICT_TYPE.DEVICE_DOC_TYPE) |
|
|
|
|
|
const tabsExtend = ref() |
|
|
|
|
|
const funcCode = ref('device_mould_picture') |
|
|
|
|
|
// tabs 切换事件 |
|
|
|
|
|
const changeTabs = (item) => { |
|
|
|
|
|
if (item.prop == 'Image') { |
|
|
|
|
|
tabsExtend.value = 1 |
|
|
|
|
|
funcCode.value = 'device_mould_picture' |
|
|
|
|
|
// apiPage.value = CustomeritemApi.getCustomeritemPage |
|
|
|
|
|
// detailAllSchemas.value = Customeritem.allSchemas |
|
|
|
|
|
} else if (item.prop == 'Word') { |
|
|
|
|
|
tabsExtend.value = 2 |
|
|
|
|
|
funcCode.value = 'device_mould_attachment' |
|
|
|
|
|
apiPage.value = PurchaseDetailApi.getPurchaseDetailPage |
|
|
|
|
|
detailAllSchemas.value = PurchaseMain.allSchemas |
|
|
|
|
|
} else if (item.prop == 'Part') { |
|
|
|
|
|
tabsExtend.value = 3 |
|
|
|
|
|
apiPage.value = deviceRepairApi.getDeviceRepairPage |
|
|
|
|
|
detailAllSchemas.value = DeviceRepair.allSchemas |
|
|
|
|
|
} else if (item.prop == 'DeviceReportRecord') { |
|
|
|
|
|
tabsExtend.value = 3 |
|
|
|
|
|
apiPage.value = BalanceApi.getBalancePage |
|
|
|
|
|
detailAllSchemas.value = Balance.allSchemas |
|
|
|
|
|
} else if (item.prop == 'RepairRecord') { |
|
|
|
|
|
tabsExtend.value = 3 |
|
|
|
|
|
apiPage.value = ExpectinApi.getExpectinPage |
|
|
|
|
|
detailAllSchemas.value = Expectin.allSchemas |
|
|
|
|
|
} else if (item.prop == 'MaintenanceRecord') { |
|
|
|
|
|
tabsExtend.value = 3 |
|
|
|
|
|
apiPage.value = ExpectinApi.getExpectinPage |
|
|
|
|
|
detailAllSchemas.value = Expectin.allSchemas |
|
|
|
|
|
} |
|
|
|
|
|
detailAllSchemas.value.tableColumns.map((item, index) => { |
|
|
|
|
|
if (item.field == 'action') { |
|
|
|
|
|
detailAllSchemas.value.tableColumns.splice(index, 1) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
// 当前物料代码作为条件 |
|
|
|
|
|
tableObjectExtend.value = [ |
|
|
|
|
|
{ |
|
|
|
|
|
key: 'itemCode', |
|
|
|
|
|
value: itemCodeRow.value |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
const uploadImage = (number, filePath, fileBusiType) => { |
|
|
|
|
|
let data = { |
|
|
|
|
|
number, |
|
|
|
|
|
filePathList: filePath, |
|
|
|
|
|
funcCode: funcCode.value, |
|
|
|
|
|
fileBusiType: fileBusiType ? fileBusiType : '' |
|
|
|
|
|
} |
|
|
|
|
|
uploadApi.uploadImage(data).then((res) => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 二级切换事件 |
|
|
|
|
|
const fileBusiType = ref() |
|
|
|
|
|
const subTabsChick = (e) => { |
|
|
|
|
|
fileBusiType.value = e |
|
|
|
|
|
} |
|
|
|
|
|
// 上传文件 |
|
|
|
|
|
const uploadFile = (number, filePath, fileBusiType) => { |
|
|
|
|
|
let data = { |
|
|
|
|
|
number, |
|
|
|
|
|
filePathList: filePath, |
|
|
|
|
|
funcCode: funcCode.value, |
|
|
|
|
|
fileBusiType: fileBusiType ? fileBusiType : '' |
|
|
|
|
|
} |
|
|
|
|
|
uploadApi.uploadImage(data).then((res) => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|
importTemplateData.templateUrl = await DeviceAccountsApi.importTemplate() |
|
|
importTemplateData.templateUrl = await DeviceAccountsApi.importTemplate() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 二维码 */ |
|
|
/** 二维码 */ |
|
|
const openQrCode = async (number: String) => { |
|
|
const openQrCode = async (number: String) => { |
|
|
// const data = await DeviceAccountsApi.getQrCode(number) |
|
|
// const data = await DeviceAccountsApi.getQrCode(number) |
|
@ -297,26 +402,37 @@ const openQrCode = async (number: String) => { |
|
|
const searchTableRef = ref() |
|
|
const searchTableRef = ref() |
|
|
/** 绑定备件操作 */ |
|
|
/** 绑定备件操作 */ |
|
|
const openItem = async (number: String) => { |
|
|
const openItem = async (number: String) => { |
|
|
deviceNumber.value = number; |
|
|
deviceNumber.value = number |
|
|
searchTableRef.value.open("选择备件",Item.allSchemas,getDeviceItemList,null,Item.allSchemas.searchSchema,true,null, null, null, null); |
|
|
searchTableRef.value.open( |
|
|
|
|
|
'选择备件', |
|
|
|
|
|
Item.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) => ({ |
|
|
deviceNumber: deviceNumber.value, |
|
|
deviceNumber: deviceNumber.value, |
|
|
itemNumber: element.number, |
|
|
itemNumber: element.number |
|
|
})); |
|
|
})) |
|
|
createDeviceItemBatch(deviceItemRelList).then(res => { |
|
|
createDeviceItemBatch(deviceItemRelList).then((res) => { |
|
|
console.log('res', res); |
|
|
console.log('res', res) |
|
|
}) |
|
|
}) |
|
|
console.log('deviceItemRelList', deviceItemRelList); |
|
|
console.log('deviceItemRelList', deviceItemRelList) |
|
|
}; |
|
|
} |
|
|
|
|
|
|
|
|
const getItemWithOutBind = async () => { |
|
|
const getItemWithOutBind = async () => { |
|
|
try { |
|
|
try { |
|
|
const res = await ItemApi.getItemPage({ |
|
|
const res = await ItemApi.getItemPage({ |
|
|
...Item.allSchemas.searchSchema |
|
|
...Item.allSchemas.searchSchema |
|
|
}); |
|
|
}) |
|
|
if (res.list?.length > 0) { |
|
|
if (res.list?.length > 0) { |
|
|
// const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema); |
|
|
// const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema); |
|
|
// const filteredList = res.list.filter(item => { |
|
|
// const filteredList = res.list.filter(item => { |
|
@ -325,32 +441,30 @@ const getItemWithOutBind = async () => { |
|
|
// }); |
|
|
// }); |
|
|
// }); |
|
|
// }); |
|
|
// console.log('filteredList',filteredList); |
|
|
// console.log('filteredList',filteredList); |
|
|
const filteredList = res.list; |
|
|
const filteredList = res.list |
|
|
return filteredList; // 返回过滤后的列表 |
|
|
return filteredList // 返回过滤后的列表 |
|
|
} |
|
|
} |
|
|
return []; // 如果没有数据,返回空数组 |
|
|
return [] // 如果没有数据,返回空数组 |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error(error); |
|
|
console.error(error) |
|
|
throw error; // 抛出错误 |
|
|
throw error // 抛出错误 |
|
|
} |
|
|
} |
|
|
}; |
|
|
} |
|
|
|
|
|
|
|
|
// 将 getListApi 替换为 getItemWithOutBind |
|
|
// 将 getListApi 替换为 getItemWithOutBind |
|
|
const getDeviceItemList = async () => { |
|
|
const getDeviceItemList = async () => { |
|
|
tableObject.loading = true; |
|
|
tableObject.loading = true |
|
|
try { |
|
|
try { |
|
|
const res = await getItemWithOutBind(); |
|
|
const res = await getItemWithOutBind() |
|
|
let result = { |
|
|
let result = { |
|
|
list : res, |
|
|
list: res, |
|
|
total : res.length, |
|
|
total: res.length |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error(error); |
|
|
console.error(error) |
|
|
} finally { |
|
|
} finally { |
|
|
tableObject.loading = false; |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
}; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|