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.

SciAndTechPrjItem.vue 7.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="item">
  3. <div class="header">
  4. <div class="header-l">
  5. <div class="title" :title="data.project_name">{{ data.project_name }}</div>
  6. <div class="prj-type">{{ data.type }}</div>
  7. </div>
  8. <div class="header-r">
  9. <a :href="`/tech/repo_view?project_name=${data.project_name}`">
  10. <span>更多成果</span>
  11. <i class="el-icon-arrow-right"></i>
  12. </a>
  13. </div>
  14. </div>
  15. <div class="content">
  16. <div class="item-l-c">
  17. <div class="row">
  18. <span class="tit">负责单位:</span>
  19. <span class="val" :title="data.institution">{{ data.institution }}</span>
  20. </div>
  21. <div class="row">
  22. <span class="tit">参与单位:</span>
  23. <span class="val" :title="data.all_institution.split(',').join('、')">{{
  24. data.all_institution.split(',').join('、')
  25. }}</span>
  26. </div>
  27. <div class="row">
  28. <span class="tit">申报年份:</span>
  29. <span class="val">{{ data.apply_year }}</span>
  30. </div>
  31. <div class="row">
  32. <span class="tit">执行周期:</span>
  33. <span class="val">{{ data.execute_period }}</span>
  34. </div>
  35. <div class="row">
  36. <span class="tit">项目成果数:</span>
  37. <span class="val">{{ data.repo_numer }}</span>
  38. </div>
  39. </div>
  40. <div class="item-r-c">
  41. <a class="repo-item-c" target="_blank" :href="`/${item.owner_name}/${item.name}`"
  42. v-for="(item, index) in data.Repos">
  43. <div class="repo-item">
  44. <div class="repo-hd">
  45. <div class="repo-avatar">
  46. <img v-if="data.rel_avatar_link" class="avatar" :src="data.rel_avatar_link" />
  47. <img v-else class="avatar" :avatar="item.owner_name" />
  48. </div>
  49. <div class="repo-tit">{{ item.alias }}</div>
  50. </div>
  51. <div class="repo-content">
  52. <div class="repo-descr">
  53. {{ item.description }}
  54. </div>
  55. </div>
  56. </div>
  57. </a>
  58. <div class="repo-item-c" v-if="!data.Repos.length">
  59. <div class="bgtask-header-pic" style="margin-top:-20px;"></div>
  60. <div class="repo-item" style="text-align:center;">项目成果待展示</div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import dayjs from 'dayjs';
  68. import { lang } from '~/langs';
  69. import { timeSinceUnix } from '~/utils';
  70. export default {
  71. name: "SciAndTechPrjItem",
  72. props: {
  73. data: { type: Object, default: () => ({}) },
  74. },
  75. components: {},
  76. data() {
  77. return {};
  78. },
  79. methods: {
  80. calcFromNow(unix) {
  81. return timeSinceUnix(unix, Date.now() / 1000);
  82. },
  83. dateFormat(unix) {
  84. return lang == 'zh-CN' ? dayjs(unix * 1000).format('YYYY年MM月DD日 HH时mm分ss秒') :
  85. dayjs(unix * 1000).format('ddd, D MMM YYYY HH:mm:ss [CST]');
  86. }
  87. },
  88. mounted() { },
  89. };
  90. </script>
  91. <style scoped lang="less">
  92. .item {
  93. border-color: rgb(232, 224, 236);
  94. border-width: 1px;
  95. border-style: solid;
  96. box-shadow: rgba(168, 157, 226, 0.2) 0px 5px 10px 0px;
  97. background: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%221%22%20x1%3D%220%22%20x2%3D%221%22%20y1%3D%220%22%20y2%3D%220%22%20gradientTransform%3D%22matrix(-0.01900000000000005%2C%200.997%2C%20-0.12862587255310284%2C%20-0.01900000000000005%2C%200.995%2C%200.014)%22%3E%3Cstop%20stop-color%3D%22%23f2edf5%22%20stop-opacity%3D%221%22%20offset%3D%220.01%22%3E%3C%2Fstop%3E%3Cstop%20stop-color%3D%22%23ffffff%22%20stop-opacity%3D%221%22%20offset%3D%220.31%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22url(%231)%22%3E%3C%2Frect%3E%3C%2Fsvg%3E");
  98. overflow: hidden;
  99. padding: 15px;
  100. .header {
  101. display: flex;
  102. align-items: center;
  103. justify-content: space-between;
  104. .header-l {
  105. display: flex;
  106. align-items: center;
  107. .title {
  108. color: rgb(16, 16, 16);
  109. font-size: 18px;
  110. font-weight: bold;
  111. overflow: hidden;
  112. text-overflow: ellipsis;
  113. white-space: nowrap;
  114. max-width: 800px;
  115. }
  116. .prj-type {
  117. margin-left: 14px;
  118. font-size: 12px;
  119. font-weight: 400;
  120. color: rgb(100, 59, 159);
  121. background: rgb(237, 234, 251);
  122. padding: 2px 5px;
  123. border-radius: 4px;
  124. }
  125. }
  126. .header-r {
  127. display: flex;
  128. align-items: baseline;
  129. text-align: right;
  130. color: rgb(50, 145, 248);
  131. font-size: 12px;
  132. width: 80px;
  133. justify-content: flex-end;
  134. i {
  135. margin-left: 1px;
  136. }
  137. }
  138. }
  139. .content {
  140. display: flex;
  141. margin-top: 10px;
  142. .item-l-c {
  143. flex: 1;
  144. .row {
  145. display: flex;
  146. font-size: 14px;
  147. color: rgb(16, 16, 16);
  148. margin: 8px 0;
  149. font-weight: 400;
  150. .tit {
  151. color: rgba(136, 136, 136, 1);
  152. }
  153. .val {
  154. flex: 1;
  155. width: 0;
  156. overflow: hidden;
  157. text-overflow: ellipsis;
  158. white-space: nowrap;
  159. }
  160. &:last-child {
  161. margin-bottom: 0;
  162. }
  163. }
  164. }
  165. .item-r-c {
  166. flex: 2;
  167. margin-left: 10px;
  168. display: flex;
  169. .repo-item-c {
  170. display: block;
  171. flex: 1;
  172. margin: 10px;
  173. padding: 20px;
  174. border-color: rgba(157, 197, 226, 0.4);
  175. border-width: 1px;
  176. border-style: solid;
  177. border-radius: 5px;
  178. box-shadow: rgba(157, 197, 226, 0.2) 0px 5px 10px 0px;
  179. background: rgb(255, 255, 255);
  180. width: 0;
  181. .repo-item {
  182. .repo-hd {
  183. display: flex;
  184. align-items: center;
  185. .repo-avatar {
  186. width: 28px;
  187. height: 28px;
  188. img {
  189. width: 100%;
  190. height: 100%;
  191. border-radius: 100%;
  192. }
  193. }
  194. .repo-tit {
  195. flex: 1;
  196. margin-left: 8px;
  197. width: 0;
  198. font-size: 14px;
  199. color: rgb(50, 145, 248);
  200. overflow: hidden;
  201. text-overflow: ellipsis;
  202. white-space: nowrap;
  203. }
  204. }
  205. .repo-content {
  206. margin-top: 10px;
  207. .repo-descr {
  208. width: 100%;
  209. font-size: 12px;
  210. color: rgb(136, 136, 136);
  211. text-overflow: ellipsis;
  212. word-break: break-all;
  213. display: -webkit-box;
  214. -webkit-box-orient: vertical;
  215. -webkit-line-clamp: 2;
  216. max-height: 41px;
  217. overflow: hidden;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. }
  224. }
  225. </style>