index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <div>
  3. <detailTemplate :headData="mainAreaData" :title="'卡号:' + listData.msisdn" :tabs="['详细信息']" ownertable="w_iotcard"
  4. :delParam="{id:'20230619142203',content:{w_iotcardid:router.currentRoute.value.query.id}}">
  5. <template #tab0>
  6. <div class="defaultInfo">
  7. <span >基本信息</span>
  8. </div>
  9. <defaultInfo :data="basicData"></defaultInfo>
  10. </template>
  11. </detailTemplate>
  12. </div>
  13. </template>
  14. <script setup>
  15. import detailTemplate from '@/components/detailTemplate/index.vue'
  16. import defaultInfo from '@/template/defaultInfo/index.vue'
  17. import { useRouter } from "vue-router";
  18. import Api from '@/api/api'
  19. import tool from '@/utils/utils'
  20. import {onMounted, ref} from "vue";
  21. const router = useRouter()
  22. const listData = ref({})
  23. const mianData = async ()=>{
  24. const res = await Api.requested({
  25. "id": "20230619142003",
  26. "content": {
  27. "w_iotcardid":router.currentRoute.value.query.id
  28. }
  29. })
  30. listData.value = res.data
  31. changeDataStructure(res.data)
  32. }
  33. const mainAreaData = ref([])
  34. const basicData = ref([])
  35. const changeDataStructure = (data)=>{
  36. mainAreaData.value = [
  37. {
  38. label:'ICCID',
  39. value:data.iccid
  40. },
  41. {
  42. label:'绑定设备',
  43. value:data.devicename
  44. },
  45. {
  46. label:'运营商',
  47. value:data.telecomoperator == 'CM'?'移动':data.telecomoperator == 'CT'?'电信':data.telecomoperator == 'CU'?'联通':''
  48. },
  49. {
  50. label:'总流量',
  51. value:data.totalAmount
  52. },
  53. {
  54. label:'使用流量',
  55. value:data.useAmount
  56. },
  57. {
  58. label:'剩余流量',
  59. value:data.remainAmount
  60. },
  61. {
  62. label:'激活日期',
  63. value:data.activationdate
  64. },
  65. {
  66. label:'余额',
  67. value:data.amount
  68. },
  69. {
  70. label:'状态',
  71. value:data.status
  72. },
  73. {
  74. label:'站点',
  75. value:data.sitename
  76. },
  77. ]
  78. basicData.value = [
  79. {
  80. label:'ICCID',
  81. value:data.iccid
  82. },
  83. {
  84. label:'绑定设备',
  85. value:data.devicename
  86. },
  87. {
  88. label:'运营商',
  89. value:data.telecomoperator == 'CM'?'移动':data.telecomoperator == 'CT'?'电信':data.telecomoperator == 'CU'?'联通':''
  90. },
  91. {
  92. label:'状态',
  93. value:data.status
  94. },
  95. {
  96. label:'激活日期',
  97. value:data.activationdate
  98. },
  99. {
  100. label:'站点',
  101. value:data.sitename
  102. }
  103. ]
  104. }
  105. onMounted (()=>{
  106. mianData()
  107. })
  108. </script>
  109. <style scoped>
  110. </style>