Files
hazardousWaste_app/pages/components/ProjectOverView.vue

55 lines
1.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script setup>
import { warehouseList } from '@/api/home';
import { ref } from 'vue';
import { transformData, objectToQuery } from '../until'
const myWarehouseList = ref([])
const onChecked = (item) => {
if (!item.deptId) return
uni.navigateTo({
url: `/pages/components/EquipmentInfo?deptId=${item.deptId}&warehouseName=${item.warehouseName || ''}&projectName=${item.parentName || ''}`
})
}
const getMyWarehouseList = () => {
warehouseList().then((res) => {
myWarehouseList.value = transformData(res.data)
console.log('我的仓库===>', res, transformData(res.data));
})
}
getMyWarehouseList()
</script>
<template>
<uv-list v-for="(item, index) in myWarehouseList" :key="index" class="list">
<view class="title line">{{ item.parentName }}</view>
<uv-list-item v-for="(i, idx) in item.items" :key="idx" link clickable @tap="onChecked(i)"
:title="i.warehouseName">
<template v-slot:footer>
<view :style="i?.onlineRate > 0 ? 'color :#9CCC65;font-size: 14px;' : 'color :#000;font-size: 14px;'">
<text>在线率</text>
<text>{{ i?.onlineRate }}%</text>
</view>
</template>
</uv-list-item>
</uv-list>
</template>
<style scoped>
.list {
background-color: #fff;
margin-bottom: 8px;
}
.title {
padding: 8px 30rpx;
}
</style>