index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
  5. <cHead :is_menu="false">
  6. <template v-slot:info>
  7. <div class="w_1200">
  8. <el-col :span="24" class="one">
  9. <el-tabs v-model="activeName" @tab-click="handleClick">
  10. <el-tab-pane label="全部报名" name="0"></el-tab-pane>
  11. <el-tab-pane label="会议报名" name="1"></el-tab-pane>
  12. <el-tab-pane label="培训报名" name="2"></el-tab-pane>
  13. <el-tab-pane label="通知公告" name="3"></el-tab-pane>
  14. </el-tabs>
  15. </el-col>
  16. <el-col :span="24" class="two">
  17. <el-col :span="24" class="list" v-for="(item, index) in list" :key="index" @click="toView(item)">
  18. <el-col :span="17" class="left textOver">
  19. <span class="value" :class="[item.status == '0' ? 'status0' : 'status1']">{{ item.status == '0' ? '会议' : '培训' }}</span>
  20. {{ item.title || '暂无标题' }}
  21. </el-col>
  22. <el-col :span="7" class="right">
  23. <span class="time">{{ moment(item.time).format('MM-DD HH:mm') }}</span>
  24. &nbsp;
  25. <span class="time">{{ item.status == '0' ? '报名已截止' : '报名已截止' }}</span>
  26. </el-col>
  27. </el-col>
  28. </el-col>
  29. <el-col :span="24" class="thr">
  30. <a-pagination
  31. v-model:page-size="limit"
  32. show-size-changer
  33. :page-size-options="pageSizeOptions"
  34. :total="total"
  35. @showSizeChange="onShowSizeChange"
  36. />
  37. </el-col>
  38. </div>
  39. </template>
  40. </cHead>
  41. </el-col>
  42. </el-row>
  43. </div>
  44. </template>
  45. <script setup lang="ts">
  46. // 基础
  47. import type { TabsPaneContext } from 'element-plus';
  48. import type { Ref } from 'vue';
  49. import { onMounted, getCurrentInstance, ref } from 'vue';
  50. import { useRouter } from 'vue-router';
  51. import moment from 'moment';
  52. // 接口
  53. // import { ToolsStore } from '@/stores/tool';
  54. // import type { IQueryResult } from '@/util/types.util';
  55. // const toolsAxios = ToolsStore();
  56. const { proxy } = getCurrentInstance() as any;
  57. // 路由
  58. const router = useRouter();
  59. // 加载中
  60. const loading: Ref<any> = ref(false);
  61. let list: Ref<any> = ref([
  62. {
  63. title: '关于浙江大学衢州研究院1件技术秘密转让的公示',
  64. time: '2023-07-31',
  65. status: '0'
  66. },
  67. {
  68. title: '浙江省科学技术厅 关于第七届中国创新挑战赛(浙江)暨 2022年浙江省技术需求“揭榜挂帅”大赛技术需求公告',
  69. time: '2023-07-31',
  70. status: '1'
  71. },
  72. {
  73. title: '关于浙江大学衢州研究院1件技术秘密转让的公示',
  74. time: '2023-07-31',
  75. status: '0'
  76. },
  77. {
  78. title: '关于浙江大学衢州研究院1件技术秘密转让的公示',
  79. time: '2023-07-31',
  80. status: '0'
  81. },
  82. {
  83. title: '关于浙江大学衢州研究院1件技术秘密转让的公示',
  84. time: '2023-07-31',
  85. status: '0'
  86. },
  87. {
  88. title: '关于浙江大学衢州研究院1件技术秘密转让的公示',
  89. time: '2023-07-31',
  90. status: '1'
  91. },
  92. {
  93. title: '关于浙江大学衢州研究院1件技术秘密转让的公示',
  94. time: '2023-07-31',
  95. status: '1'
  96. },
  97. {
  98. title: '关于浙江大学衢州研究院1件技术秘密转让的公示',
  99. time: '2023-07-31',
  100. status: '1'
  101. },
  102. {
  103. title: '关于浙江大学衢州研究院1件技术秘密转让的公示',
  104. time: '2023-07-31',
  105. status: '0'
  106. }
  107. ]);
  108. let total: Ref<number> = ref(12);
  109. let skip = 0;
  110. let limit: number = proxy.$limit;
  111. const pageSizeOptions = ref<string[]>(['12', '24', '60', '120']);
  112. const activeName = ref('0');
  113. // 请求
  114. onMounted(async () => {
  115. loading.value = true;
  116. await searchOther();
  117. await search({ skip, limit });
  118. loading.value = false;
  119. });
  120. const search = async (e: { skip: number; limit: number }) => {
  121. const info = { skip: e.skip, limit: e.limit };
  122. // const res: IQueryResult = await userCheckAxios.query(info);
  123. // if (res.errcode == '0') {
  124. // list.value = res.data;
  125. // total.value = res.total;
  126. // }
  127. };
  128. // 查询其他信息
  129. const searchOther = async () => {
  130. // let res: IQueryResult;
  131. // // 性别
  132. // res = await dictAxios.query({ type: 'common_gender' });
  133. // if (res.errcode == '0') genderList.value = res.data;
  134. };
  135. // 活动大厅报告通知查看详情
  136. const toView = (item) => {
  137. router.push({ path: '/activity/new', query: { id: item.id || item._id } });
  138. };
  139. const onShowSizeChange = (current: number, pageSize: number) => {
  140. console.log(current, pageSize);
  141. limit = pageSize;
  142. };
  143. const handleClick = (tab: TabsPaneContext, event: Event) => {
  144. console.log(tab, event);
  145. }
  146. </script>
  147. <style scoped lang="scss">
  148. .main {
  149. .two {
  150. .list:hover {
  151. box-shadow: 0 0 16px rgba(35, 116, 255, 0.6);
  152. }
  153. .list {
  154. display: flex;
  155. justify-content: space-between;
  156. align-items: center;
  157. margin-bottom: 30px;
  158. padding: 20px;
  159. border-bottom: 1px solid #dcdfe6;
  160. .left {
  161. font-size: 16px;
  162. color: #383b40;
  163. letter-spacing: 0;
  164. line-height: 24px;
  165. cursor: pointer;
  166. .value {
  167. padding: 2px 10px;
  168. border-radius: 12px;
  169. margin-right: 5px;
  170. font-size: 12px;
  171. line-height: 20px;
  172. text-align: center;
  173. }
  174. .status0 {
  175. background: rgba(35, 116, 255, 0.05);
  176. color: #2374ff;
  177. }
  178. .status1 {
  179. background: rgba(18, 172, 117, 0.05);
  180. color: #12ac75;
  181. }
  182. }
  183. .left:hover {
  184. color: #2374ff;
  185. }
  186. .right {
  187. text-align: center;
  188. .time {
  189. color: #aaaaaa;
  190. }
  191. .date {
  192. color: #525a68;
  193. }
  194. }
  195. }
  196. }
  197. .thr {
  198. display: flex;
  199. flex-direction: row-reverse;
  200. padding: 10px 0;
  201. }
  202. }
  203. </style>