| | |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[80rpx]" @click.stop="itemClick(item)"> |
| | | <view class="flex h-[80rpx] items-center" @click.stop="itemClick(item)"> |
| | | <image class="slot-img text-center" src="/static/images/camera.png" /> |
| | | <view> |
| | | <view class="flex-1"> |
| | | <view class="text-color-base"> |
| | | {{ item.equName }} |
| | | <text class="text-color-gray ml-2 text-mini">{{ item.modelNo }}</text> |
| | |
| | | <view class="text-color-gray text-xs mt-1"> |
| | | {{ item.location }} | {{ item.madeIn }} |
| | | </view> |
| | | </view> |
| | | <view v-if="isSelectEqu"> |
| | | <wd-button |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="handleSelectEqu(item)" |
| | | > |
| | | 选中 |
| | | </wd-button> |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | |
| | | getEquList({ pageNum, pageSize }) |
| | | .then((res: any) => { |
| | | // 请勿在网络请求回调中给dataList赋值!!只需要调用complete就可以了 |
| | | console.log(res) |
| | | paging.value.complete(res.rows) |
| | | paging.value.completeByTotal(res.rows, res.total) |
| | | }) |
| | | .catch((res) => { |
| | | // 如果请求失败写paging.value.complete(false),会自动展示错误页面 |
| | |
| | | * @param item |
| | | */ |
| | | function itemClick(item: any) { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 其它页面选择设备 |
| | | * @param item |
| | | */ |
| | | function handleSelectEqu(item: any) { |
| | | if (isSelectEqu.value) { |
| | | emitSelectEqu(item) |
| | | uni.navigateBack() |
| | |
| | | const instance: any = getCurrentInstance().proxy |
| | | const event = instance.getOpenerEventChannel() |
| | | eventChannel.value = event |
| | | event.on('handleSelectEqu', function (data) { |
| | | event.on('OnSelectEqu', function (data) { |
| | | isSelectEqu.value = true |
| | | console.log('handleSelectEqu', data) |
| | | console.log('OnSelectEqu', data) |
| | | }) |
| | | }) |
| | | </script> |