diff --git a/src/utils/getRobotInfo.js b/src/utils/getRobotInfo.js index a8e727f..448ef5b 100644 --- a/src/utils/getRobotInfo.js +++ b/src/utils/getRobotInfo.js @@ -32,6 +32,7 @@ export const getRobotTokenFn = async () => { bfix: 1, } const res = await initLoginApi(loginParams) + console.log(res, '机器人token信息---') robotData.setTokenInfo({ deviceToken: res.data.token, }) @@ -59,6 +60,8 @@ export const getRobotDeviceListFn = async () => { // } const { data: res } = await getDeviceInfoApi() + + console.log(res, '机器人设备信息---') if (res?.data?.length > 0) { const deviceInfo = res.data[0] robotData.setRobotInfo({ @@ -70,6 +73,18 @@ export const getRobotDeviceListFn = async () => { puId: deviceInfo.puId, } } + + if (res.length > 0) { + const deviceInfo = res[0] + robotData.setRobotInfo({ + devName: deviceInfo.devName, + puId: deviceInfo.puId, + }) + return { + devName: deviceInfo.devName, + puId: deviceInfo.puId, + } + } } // 获取地图信息 @@ -99,6 +114,8 @@ export const getRobotMapInfoFn = async (puId) => { puId, type: 4, }) + + console.log(res, '机器人地图信息---') if (res.code === 200) { const { Data, Height, Width, MapId, Name } = res.data const mapInfo = { @@ -137,6 +154,7 @@ export const getRobotPointsInfoFn = async (puId) => { puId, type: 2, }) + console.log(res, '机器人实时定位信息---') if (res.code === 200) { const pointsInfo = { Robot_x: res?.data?.Robot_x, diff --git a/src/views/home/components/right-one.vue b/src/views/home/components/right-one.vue index 7b083b0..3f3b7e1 100644 --- a/src/views/home/components/right-one.vue +++ b/src/views/home/components/right-one.vue @@ -526,12 +526,16 @@ const tableColumns_1 = ref([ key: 'dataImage', align: 'center', render(row) { - return h(NImage, { - width: '48px', - height: '48px', - src: imgPreviewUrl + row.dataImage, - fit: 'cover', - }) + if (row.dataImage) { + return h(NImage, { + width: '48px', + height: '48px', + src: imgPreviewUrl + row.dataImage, + fit: 'cover', + }) + } else { + return '-' + } }, }, { @@ -539,12 +543,16 @@ const tableColumns_1 = ref([ key: 'image', align: 'center', render(row) { - return h(NImage, { - width: '48px', - height: '48px', - src: imgPreviewUrl + row.image, - fit: 'cover', - }) + if (row.image) { + return h(NImage, { + width: '48px', + height: '48px', + src: imgPreviewUrl + row.image, + fit: 'cover', + }) + } else { + return '-' + } }, }, ]) @@ -597,7 +605,16 @@ const onHandlePageSize_1Change = (pageSize) => { // 新增项目部人员 const onHandleAddPerson = () => { - console.log('新增项目部人员') + // console.log('新增项目部人员') + addOrEditPersonForm.value.id = null + addOrEditPersonForm.value.facePhoto = [] + previewFileList.value = [] + addOrEditPersonForm.value.userName = '' + addOrEditPersonForm.value.mobile = '' + addOrEditPersonForm.value.idCard = '' + addOrEditPersonForm.value.age = '' + addOrEditPersonForm.value.sex = '' + addOrEditPersonForm.value.workType = '' addPersonPanelVisible.value = true } @@ -785,12 +802,16 @@ const tableColumns_2 = ref([ key: 'image', align: 'center', render(row) { - return h(NImage, { - width: '48px', - height: '48px', - src: imgPreviewUrl + row.image, - fit: 'cover', - }) + if (row.image) { + return h(NImage, { + width: '48px', + height: '48px', + src: imgPreviewUrl + row.image, + fit: 'cover', + }) + } else { + return '-' + } }, }, @@ -832,7 +853,7 @@ const getProjectPersonList = async () => { const { data: res } = await getUserInfoListApi(innerQueryParams_2.value) if (res.code == 200) { - tableData_2.value = res?.rows + tableData_2.value = res?.rows.map((item) => ({ ...item, select: false })) tableTotal_2.value = res?.total } } @@ -909,12 +930,16 @@ const onHandleReset_2 = () => { // 人员信息列表 分页 const onHandlePage_2Change = (page) => { innerQueryParams_2.value.pageNum = page + selectList.value = [] + allSelect.value = false getProjectPersonList() } // 人员信息列表 分页大小 const onHandlePageSize_2Change = (pageSize) => { innerQueryParams_2.value.pageSize = pageSize + selectList.value = [] + allSelect.value = false getProjectPersonList() } diff --git a/src/views/home/components/right-two/taps-one.vue b/src/views/home/components/right-two/taps-one.vue index 1d348cd..6331f32 100644 --- a/src/views/home/components/right-two/taps-one.vue +++ b/src/views/home/components/right-two/taps-one.vue @@ -77,12 +77,16 @@ const columns = ref([ key: 'image', align: 'center', render(row) { - return h(NImage, { - width: '48px', - height: '48px', - src: imgPreviewUrl + row.image, - fit: 'cover', - }) + if (row.image) { + return h(NImage, { + width: '48px', + height: '48px', + src: imgPreviewUrl + row.image, + fit: 'cover', + }) + } else { + return '-' + } }, }, ]) diff --git a/src/views/home/components/right-two/taps-three.vue b/src/views/home/components/right-two/taps-three.vue index ee5dfc3..49bb8fb 100644 --- a/src/views/home/components/right-two/taps-three.vue +++ b/src/views/home/components/right-two/taps-three.vue @@ -98,12 +98,16 @@ const columns = ref([ key: 'image', align: 'center', render(row) { - return h(NImage, { - width: '48px', - height: '48px', - src: imgPreviewUrl + row.image, - fit: 'cover', - }) + if (row.image) { + return h(NImage, { + width: '48px', + height: '48px', + src: imgPreviewUrl + row.image, + fit: 'cover', + }) + } else { + return '-' + } }, }, { @@ -111,12 +115,16 @@ const columns = ref([ key: 'lastImage', align: 'center', render(row) { - return h(NImage, { - width: '48px', - height: '48px', - src: imgPreviewUrl + row.lastImage, - fit: 'cover', - }) + if (row.lastImage) { + return h(NImage, { + width: '48px', + height: '48px', + src: imgPreviewUrl + row.lastImage, + fit: 'cover', + }) + } else { + return '-' + } }, }, {