You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.vue 5.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div>
  3. <TopHeader :menu="'my_view'"></TopHeader>
  4. <div class="ui container">
  5. <div class="table-container">
  6. <div class="table-title">2030科技项目</div>
  7. <div class="table-wrap">
  8. <el-table ref="tableRef" border :data="tableData" style="width:100%;" v-loading="loading" stripe row-key="id">
  9. <el-table-column label="序号" type="index" align="center" header-align="center" width="50"
  10. fixed></el-table-column>
  11. <el-table-column label="启智项目名称" align="center" header-align="center" fixed min-width="140">
  12. <template slot-scope="scope">
  13. <a target="_blank" :href="`/${scope.row.repo_owner_name}/${scope.row.repo_name}`">{{
  14. `${scope.row.repo_owner_name}/${scope.row.repo_name}` }}</a>
  15. </template>
  16. </el-table-column>
  17. <el-table-column prop="name" label="科技项目名称" align="center" header-align="center" fixed
  18. min-width="200"></el-table-column>
  19. <el-table-column prop="status" label="展示状态" align="center" header-align="center" fixed>
  20. <template slot-scope="scope">
  21. <span style="color:rgb(255, 37, 37)"
  22. :style="scope.row.status == 1 ? { color: 'rgb(56, 158, 13)' } : ''">{{
  23. statusMap[scope.row.status] }}</span>
  24. </template>
  25. </el-table-column>
  26. <el-table-column prop="no" label="项目立项编号" align="center" header-align="center"
  27. min-width="120"></el-table-column>
  28. <el-table-column prop="institution" label="项目承担单位" align="center" header-align="center"
  29. min-width="120"></el-table-column>
  30. <el-table-column prop="all_institution" label="所有参与单位" align="center" header-align="center"
  31. min-width="280"></el-table-column>
  32. <el-table-column prop="contribution_institution" label="成果贡献单位" align="center" header-align="center"
  33. min-width="280"></el-table-column>
  34. <el-table-column prop="contribution_institution" label="申请时间" align="center" header-align="center"
  35. min-width="120">
  36. <template slot-scope="scope">
  37. <span>{{ dateFormat(scope.row.created_unix) }}</span>
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. </div>
  42. <div class="center">
  43. <el-pagination ref="paginationRef" background @current-change="currentChange" @size-change="sizeChange"
  44. :current-page.sync="page" :page-sizes="pageSizes" :page-size.sync="pageSize"
  45. layout="total, sizes, prev, pager, next, jumper" :total="total">
  46. </el-pagination>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </template>
  52. <script>
  53. import dayjs from 'dayjs';
  54. import TopHeader from '../components/TopHeader.vue';
  55. import { getTechMyList } from '~/apis/modules/tech';
  56. export default {
  57. data() {
  58. return {
  59. loading: false,
  60. tableData: [],
  61. page: 1,
  62. pageSizes: [15, 30, 50],
  63. pageSize: 15,
  64. total: 0,
  65. statusMap: {
  66. '1': '已展示',
  67. '2': '未展示',
  68. '3': '项目迁移中',
  69. '4': '项目迁移失败',
  70. '5': '项目不存在',
  71. },
  72. };
  73. },
  74. components: { TopHeader },
  75. methods: {
  76. getData() {
  77. this.loading = true;
  78. getTechMyList({
  79. page: this.page,
  80. pageSize: this.pageSize,
  81. }).then(res => {
  82. this.loading = false;
  83. const { total, data } = res.data;
  84. this.tableData = data.map((item, index) => {
  85. return { ...item, }
  86. });
  87. this.total = total;
  88. }).catch(err => {
  89. this.loading = false;
  90. console.log(err);
  91. });
  92. },
  93. currentChange(page) {
  94. this.page = page;
  95. this.getData();
  96. },
  97. sizeChange(pageSize) {
  98. this.pageSize = pageSize;
  99. this.getData();
  100. },
  101. dateFormat(unix) {
  102. return dayjs(unix * 1000).format('YYYY-MM-DD HH:mm');
  103. }
  104. },
  105. beforeMount() {
  106. this.getData();
  107. },
  108. mounted() { },
  109. beforeDestroy() { },
  110. };
  111. </script>
  112. <style scoped lang="less">
  113. .table-container {
  114. margin-top: 30px;
  115. .table-title {
  116. height: 43px;
  117. font-size: 16px;
  118. font-weight: 700;
  119. padding: 15px;
  120. color: rgb(16, 16, 16);
  121. border-color: rgb(212, 212, 213);
  122. border-width: 1px;
  123. border-style: solid;
  124. border-radius: 5px 5px 0px 0px;
  125. background: rgb(240, 240, 240);
  126. display: flex;
  127. align-items: center;
  128. }
  129. .table-wrap {
  130. overflow-x: auto;
  131. margin-bottom: 20px;
  132. /deep/ .el-table__header {
  133. th {
  134. background: rgb(249, 249, 249);
  135. font-size: 12px;
  136. color: rgb(136, 136, 136);
  137. font-weight: normal;
  138. }
  139. }
  140. /deep/ .el-table__body {
  141. td {
  142. font-size: 12px;
  143. }
  144. }
  145. /deep/ .el-radio__label {
  146. display: none;
  147. }
  148. }
  149. }
  150. </style>