index.vue 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <script setup lang="ts">
  2. import { ref } from 'vue'
  3. import { type CompanyData, type CompanyListData, getCompanyList } from '@/views/creditWarning/type'
  4. import { queryFieldMethod } from '@/utils/queryFieldMethod'
  5. import { getNews, type NewsData } from '@/api/home'
  6. import { useRouter } from 'vue-router'
  7. import SmallSearch from '@/components/SmallSearch.vue'
  8. import NewDynamics from '@/components/NewDynamics.vue'
  9. const companyList = ref<CompanyData[]>();
  10. const pageSize = ref<number>(10);
  11. const currentPage = ref<number>(1);
  12. const total = ref<number>(0);
  13. let router = useRouter()
  14. const getCompany = async (currentPage:number, pageSize:number)=>{
  15. const res = await getCompanyList(currentPage,pageSize);
  16. if(res.code == 200){
  17. companyList.value = res.data.result;
  18. console.log(companyList.value)
  19. total.value = res.data.totalSize;
  20. }
  21. }
  22. const handleChange = ()=>{
  23. getCompany(currentPage.value, pageSize.value)
  24. }
  25. const creditDynamics = ref<NewsData[]>([])
  26. const init = async ()=>{
  27. await getCompany(currentPage.value, pageSize.value)
  28. //获取信用动态 数据
  29. const res3 = await getNews(queryFieldMethod('special_column','credit_dynamics'))
  30. if(res3.code == 200){
  31. creditDynamics.value = res3.data;
  32. }
  33. }
  34. const toDetail = (id:number|undefined)=>{
  35. if(!id){
  36. return
  37. }
  38. router.push({
  39. path:'/newsDetail',
  40. query:{
  41. id
  42. }
  43. })
  44. }
  45. init()
  46. </script>
  47. <template>
  48. <div class="resContainer">
  49. <div class="w-1112px ml-auto mr-auto pt-20px mb-20px text-14px">
  50. 你所在的位置:<span class="cursor-pointer" @click="$router.push('/')">首页</span> > <span class="color-#006eff">信用警示</span>
  51. </div>
  52. <div class="w-1112px ml-auto mr-auto flex">
  53. <div class="w-753px bg-white bg-opacity-90 mr-15px h-750px">
  54. <!-- <div class="p-20px pl-24px pr-24px">-->
  55. <!-- <div class="text-16px text-#000000 bold ">文本企业</div>-->
  56. <!-- <div class="mt-8px line-height-23px text-13px text-#464646 line-clamp-4">文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本</div>-->
  57. <!-- <div class="mt-20px h-1px bg-#e9e9e9"></div>-->
  58. <!-- </div>-->
  59. <div class="flex justify-around border-solid border-#e9e9e9 border-b-1px text-18px line-height-28px bg-[#fbfbfbff]">
  60. <div class="w-65% text-center border-solid border-#e9e9e9 border-1px">企业名称</div>
  61. <div class="w-35% text-center border-solid border-#e9e9e9 border-1px">企业信用评价等级</div>
  62. </div>
  63. <div class="flex justify-around border-solid border-#e9e9e9 border-b-1px text-18px line-height-60px" v-for="(item,index) in companyList" :key="index">
  64. <div class="w-65% pl-20px border-solid border-#e9e9e9 border-b-1px">
  65. <div class="border-solid border-#e9e9e9 border-b-1px line-clamp-1">{{ item.enterpriseName }}</div>
  66. </div>
  67. <div class="w-35% text-center border-solid border-#e9e9e9 border-b-1px">
  68. <div class="text-center border-solid border-#e9e9e9 border-b-1px">{{item.grade}}</div>
  69. </div>
  70. </div>
  71. <div class="ml-260px mt-20px">
  72. <div class="example-pagination-block">
  73. <el-pagination
  74. layout="prev, pager, next, total"
  75. v-model:pageSize = pageSize
  76. v-model:currentPage = currentPage
  77. :total="total"
  78. @change = handleChange
  79. />
  80. </div>
  81. </div>
  82. </div>
  83. <div class="w-344px bg-opacity-90">
  84. <small-search />
  85. <new-dynamics />
  86. </div>
  87. </div>
  88. </div>
  89. </template>
  90. <style scoped>
  91. .resContainer {
  92. background-color: #ecf0f9;
  93. }
  94. </style>