<script setup>
defineProps({
  item: {
    type: Object,
    required: true
  }
})

const emits = defineEmits(['imgHandler'])
const handleImg = (item) => {
  emits('imgHandler', item)
}
</script>

<template>
  <view w-full f-s-s mb-40 p-20>
    <view flex-none>
      <up-avatar shape="square" size="35" text="系统" />
    </view>
    <view flex-auto ml-28>
      <view text-28 font-bold>系统消息</view>
      <view bg-white p-16 max-w-350 lh-28 text-28 rounded-12 mt-8>
        电梯设备：{{ item.faultName }}
        {{ item.state ? '(已确认)' : '(未确认)' }},{{ item.floor }}层
      </view>
      <view v-if="item.picture" rounded-12 mt-16>
        <up-image
          :show-loading="true"
          :src="item.picture"
          width="120px"
          height="120px"
          @tap="handleImg(item)"
        />
      </view>
    </view>
  </view>
</template>
