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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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. },
  80. methods: {
  81. calcFromNow(unix) {
  82. return timeSinceUnix(unix, Date.now() / 1000);
  83. },
  84. dateFormat(unix) {
  85. return lang == 'zh-CN' ? dayjs(unix * 1000).format('YYYY年MM月DD日 HH时mm分ss秒') :
  86. dayjs(unix * 1000).format('ddd, D MMM YYYY HH:mm:ss [CST]');
  87. }
  88. },
  89. mounted() { },
  90. };
  91. </script>
  92. <style scoped lang="less">
  93. .item {
  94. border-color: rgb(232, 224, 236);
  95. border-width: 1px;
  96. border-style: solid;
  97. box-shadow: rgba(168, 157, 226, 0.2) 0px 5px 10px 0px;
  98. 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");
  99. overflow: hidden;
  100. padding: 15px;
  101. .header {
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. .header-l {
  106. display: flex;
  107. align-items: center;
  108. .title {
  109. color: rgb(16, 16, 16);
  110. font-size: 18px;
  111. font-weight: bold;
  112. overflow: hidden;
  113. text-overflow: ellipsis;
  114. white-space: nowrap;
  115. max-width: 800px;
  116. }
  117. .prj-type {
  118. margin-left: 14px;
  119. font-size: 12px;
  120. font-weight: 400;
  121. color: rgb(100, 59, 159);
  122. background: rgb(237, 234, 251);
  123. padding: 2px 5px;
  124. border-radius: 4px;
  125. }
  126. }
  127. .header-r {
  128. display: flex;
  129. align-items: baseline;
  130. text-align: right;
  131. color: rgb(50, 145, 248);
  132. font-size: 12px;
  133. width: 80px;
  134. justify-content: flex-end;
  135. i {
  136. margin-left: 1px;
  137. }
  138. }
  139. }
  140. .content {
  141. display: flex;
  142. margin-top: 10px;
  143. .item-l-c {
  144. flex: 1;
  145. .row {
  146. display: flex;
  147. font-size: 14px;
  148. color: rgb(16, 16, 16);
  149. margin: 8px 0;
  150. font-weight: 400;
  151. .tit {
  152. color: rgba(136, 136, 136, 1);
  153. }
  154. .val {
  155. flex: 1;
  156. width: 0;
  157. overflow: hidden;
  158. text-overflow: ellipsis;
  159. white-space: nowrap;
  160. }
  161. &:last-child {
  162. margin-bottom: 0;
  163. }
  164. }
  165. }
  166. .item-r-c {
  167. flex: 2;
  168. margin-left: 10px;
  169. display: flex;
  170. .repo-item-c {
  171. display: block;
  172. flex: 1;
  173. margin: 10px;
  174. padding: 20px;
  175. border-color: rgba(157, 197, 226, 0.4);
  176. border-width: 1px;
  177. border-style: solid;
  178. border-radius: 5px;
  179. box-shadow: rgba(157, 197, 226, 0.2) 0px 5px 10px 0px;
  180. background: rgb(255, 255, 255);
  181. width: 0;
  182. .repo-item {
  183. .repo-hd {
  184. display: flex;
  185. align-items: center;
  186. .repo-avatar {
  187. width: 28px;
  188. height: 28px;
  189. img {
  190. width: 100%;
  191. height: 100%;
  192. border-radius: 100%;
  193. }
  194. }
  195. .repo-tit {
  196. flex: 1;
  197. margin-left: 8px;
  198. width: 0;
  199. font-size: 14px;
  200. color: rgb(50, 145, 248);
  201. overflow: hidden;
  202. text-overflow: ellipsis;
  203. white-space: nowrap;
  204. }
  205. }
  206. .repo-content {
  207. margin-top: 10px;
  208. .repo-descr {
  209. width: 100%;
  210. font-size: 12px;
  211. color: rgb(136, 136, 136);
  212. text-overflow: ellipsis;
  213. word-break: break-all;
  214. display: -webkit-box;
  215. -webkit-box-orient: vertical;
  216. -webkit-line-clamp: 2;
  217. max-height: 41px;
  218. overflow: hidden;
  219. }
  220. }
  221. }
  222. }
  223. }
  224. }
  225. }
  226. </style>