fault-list.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="home">
  3. <!-- <view class="search-area" style="margin-bottom: 20rpx;">
  4. <u-search
  5. placeholder="搜索设备"
  6. v-model="keyword"
  7. shape="square"
  8. :clearabled="true"
  9. :show-action="true"
  10. action-text="搜索"
  11. :animation="true"
  12. search-icon-color="#000"
  13. color="#000"
  14. placeholder-color="#5c5b5b"
  15. ></u-search>
  16. </view> -->
  17. <u-empty
  18. :show="dataList.length===0?true:false"
  19. mode="list"
  20. :icon="require('@/static/images/list.png')"
  21. >
  22. <!-- http://cdn.uviewui.com/uview/empty/list.png -->
  23. </u-empty>
  24. <view v-show="dataList.length===0?false:true">
  25. <u-cell-group :border="true">
  26. <u-cell
  27. title="设备"
  28. value="状态"
  29. ></u-cell>
  30. <u-cell
  31. v-for="item in dataList"
  32. :key="item.id"
  33. :title="item.assetBarCode"
  34. :titleStyle="{ color:`${item.processState==='0'?'#ca2121':'#000'}` }"
  35. :value="item.processState==='0'?'待处理':'已处理'"
  36. :label="`上报时间:${item.reportDate}`"
  37. @click="toHandle(item.id)"
  38. ></u-cell>
  39. </u-cell-group>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import { getFaultReport } from '@/api/asset.js'
  45. export default {
  46. data() {
  47. return {
  48. pageNum:1,
  49. pageSize:10,
  50. dataList:[],
  51. keyword:"",
  52. color:""
  53. };
  54. },
  55. methods:{
  56. init(){
  57. getFaultReport().then(res=>{
  58. this.dataList = res.data.rows
  59. })
  60. },
  61. toHandle(id){
  62. uni.navigateTo({
  63. url:'/pages/fault/fault-handle/fault-handle?id='+id
  64. })
  65. }
  66. },
  67. onShow() {
  68. this.init()
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. .home{
  74. padding: 20rpx 20rpx 30rpx;
  75. display: flex;
  76. flex-direction: column;
  77. box-sizing: border-box;
  78. }
  79. /deep/ .u-cell-group__wrapper{
  80. border-left: 1rpx solid #d6d7d9;
  81. border-right: 1rpx solid #d6d7d9;
  82. }
  83. /deep/ .u-cell__label{
  84. color: #000!important;
  85. }
  86. </style>