ProjectScatter.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div class="project-scatter">
  3. <div class="project-scatter-chart" v-if="chartData.rows.length">
  4. <SimpleHistogramChart
  5. :id="id"
  6. :data="chartData"
  7. />
  8. </div>
  9. <div class="ar-table" v-if="tableData.length">
  10. <p class="ar-table-title">项目规模TOP10</p>
  11. <el-table
  12. :data="tableData"
  13. header-row-class-name="ar-table-thead"
  14. row-class-name="ar-table-row"
  15. border
  16. style="width: 100%">
  17. <el-table-column
  18. align="center"
  19. header-align="center"
  20. type="index"
  21. label="序号"
  22. width="50">
  23. <template slot-scope="scope">
  24. <span
  25. :class="{
  26. 'table-index-rect': scope.$index < 3,
  27. red: scope.$index === 0,
  28. orange: scope.$index === 1,
  29. 'soft-orange': scope.$index === 2
  30. }"
  31. >{{ scope.$index + 1 }}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column
  35. align="center"
  36. header-align="center"
  37. class-name="cursor"
  38. label="项目名称">
  39. <template slot-scope="scope">
  40. <div @click="toContentPage(scope.row)">{{ scope.row.projectname }}</div>
  41. </template>
  42. </el-table-column>
  43. <el-table-column
  44. align="center"
  45. header-align="center"
  46. width="100px"
  47. prop="area"
  48. label="省份">
  49. </el-table-column>
  50. <el-table-column
  51. align="center"
  52. header-align="center"
  53. prop="city"
  54. width="100px"
  55. label="城市">
  56. </el-table-column>
  57. <el-table-column
  58. align="right"
  59. header-align="center"
  60. width="140px"
  61. prop="sortprice"
  62. label="项目金额(万元)">
  63. </el-table-column>
  64. <el-table-column
  65. align="center"
  66. header-align="center"
  67. prop="jgtime"
  68. width="120px"
  69. label="成交时间">
  70. </el-table-column>
  71. <el-table-column
  72. header-align="center"
  73. class-name="cursor"
  74. label="中标单位">
  75. <template slot-scope="scope">
  76. <el-link
  77. @click="toEntProPage(item.id)"
  78. :underline="false"
  79. :disabled="!item.id"
  80. v-for="(item, index) in (scope.row.winner_s || [])"
  81. :key="index"
  82. >{{ item.name }}<span v-if="index !== scope.row.winner_s.length - 1">,</span></el-link>
  83. <div v-if="scope.row.winner_s.length === 0">-</div>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. import { Table, TableColumn, Link } from 'element-ui'
  92. import SimpleHistogramChart from '@/components/chart/SimpleHistogramChart.vue'
  93. export default {
  94. name: 'project-scatter',
  95. components: {
  96. [Link.name]: Link,
  97. [Table.name]: Table,
  98. [TableColumn.name]: TableColumn,
  99. SimpleHistogramChart
  100. },
  101. props: {
  102. chartData: {
  103. type: Object,
  104. default () {
  105. return {
  106. columns: ['项目规模', '项目总金额占比', '项目总数占比'],
  107. rows: [
  108. // {
  109. // 项目规模: '≥1亿',
  110. // 项目总金额占比: 20,
  111. // 项目总数占比: 10
  112. // },
  113. // {
  114. // 项目规模: '1000万-1亿',
  115. // 项目总金额占比: 50,
  116. // 项目总数占比: 40
  117. // },
  118. // {
  119. // 项目规模: '500万-1000万',
  120. // 项目总金额占比: 20,
  121. // 项目总数占比: 30
  122. // },
  123. // {
  124. // 项目规模: '100万-500万',
  125. // 项目总金额占比: 20,
  126. // 项目总数占比: 30
  127. // }
  128. ]
  129. }
  130. }
  131. },
  132. tableData: {
  133. type: Array,
  134. default () {
  135. return []
  136. }
  137. }
  138. },
  139. data () {
  140. return {
  141. id: `ve-histogram-${Date.now()}`
  142. }
  143. },
  144. methods: {
  145. // 去三级页
  146. toContentPage (row) {
  147. window.open(`/article/content/${row._id}.html`)
  148. },
  149. // 去企业画像
  150. toEntProPage (id) {
  151. const routeUrl = this.$router.resolve({
  152. path: `/svip/ent_ser_portrait/${id}`
  153. })
  154. window.open(routeUrl.href)
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. </style>