userCenterConferenceOnline.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div class="container-box">
  3. <el-table ref="multipleTable" v-loading="loading" element-loading-text="拼命加载中"
  4. element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.6)"
  5. :data="tableData" tooltip-effect="dark" :border="true" size="small" :lazy="true" height="570"
  6. :empty-text="$i18n.locale == 'en' ? 'Sorry no data!' : '暂无数据'" @selection-change="handleSelectionChange">
  7. <el-table-column prop="meetingId" :label="$i18n.locale == 'en' ? 'Events' : '会议名称'" header-align="center">
  8. <template slot-scope="scope">{{ meetingNameMap[scope.row.meetingId] }}</template>
  9. </el-table-column>
  10. <el-table-column :label="$i18n.locale == 'en' ? 'Date' : '会议时间'" width="100" header-align="center">
  11. <template slot-scope="scope">{{ formatDate(meetingStartDateMap[scope.row.meetingId]) }}</template>
  12. </el-table-column>
  13. <el-table-column prop="name" :label="$i18n.locale == 'en' ? 'Name' : '嘉宾姓名'" width="100" header-align="center">
  14. </el-table-column>
  15. <el-table-column prop="auditStatusDict" :label="$i18n.locale == 'en' ? 'Status' : '状态'" width="100"
  16. header-align="center">
  17. <template>{{ $i18n.locale == 'en' ? 'Registered' : '报名成功' }}</template>
  18. </el-table-column>
  19. </el-table>
  20. <div style="width: 100%;text-align: center;">
  21. <el-pagination style="margin-top: 20px" layout="prev, pager, next" @current-change="currentChange"
  22. :total="totalNum">
  23. </el-pagination>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import { getApplyHistory, getMeetingInfo, getMeetingApproveHistory, getOnlineApplyHistory } from '@/api/meeting/meetingApply'
  29. import { getDicts } from "@/api/dict";
  30. export default {
  31. data() {
  32. return {
  33. tableData: [],
  34. multipleSelection: [],
  35. meetingInfoArray: [],
  36. statusArray: [],
  37. statusEnArray: [],
  38. cureentPage: 1,
  39. userId: JSON.parse(localStorage.getItem('user')).userId,
  40. totalNum: 0,
  41. loading: true
  42. }
  43. },
  44. mounted() {
  45. this.getApplyHistory();
  46. getMeetingInfo().then(res => {
  47. this.meetingInfoArray = res.data.meetingBasicInfos
  48. //debugger
  49. });
  50. getDicts('APPROVAL_STATUS').then(res => {
  51. this.statusArray = res.data[0];
  52. this.statusEnArray = [{ "label": "UnderApproval", "value": "2" },
  53. { "label": "Registration Failed", "value": "3" },
  54. { "label": "Registration Successful", "value": "4" }];
  55. })
  56. },
  57. computed: {
  58. meetingNameMap: function () {
  59. if (this.$i18n.locale == "en") {
  60. return this.meetingInfoArray.array2Obj('id', 'meetingNameEn');
  61. } else {
  62. return this.meetingInfoArray.array2Obj('id', 'meetingName');
  63. }
  64. },
  65. meetingStartDateMap: function () {
  66. return this.meetingInfoArray.array2Obj('id', 'meetingStartDate');
  67. },
  68. approvalStatus: function () {
  69. if (this.$i18n.locale == "en") {
  70. return this.statusEnArray.array2Obj('value', 'label');
  71. } else {
  72. return this.statusArray.array2Obj('value', 'label');
  73. }
  74. }
  75. },
  76. methods: {
  77. currentChange(p) {
  78. this.cureentPage = p;
  79. this.getApplyHistory();
  80. },
  81. getApplyHistory() {
  82. getOnlineApplyHistory({ pageNo: this.cureentPage, createBy: this.userId }).then(res => {
  83. let that = this;
  84. if (res.data) {
  85. if (res.data.page) {
  86. this.totalNum = Number(res.data.page.totalCount);
  87. }
  88. if (res.data.meetingApplyOnlines) {
  89. that.tableData = res.data.meetingApplyOnlines;
  90. } else {
  91. that.tableData = []
  92. }
  93. this.loading = false
  94. } else {
  95. that.tableData = []
  96. }
  97. }).catch(() => {
  98. this.loading = false
  99. })
  100. },
  101. handleSelectionChange(val) {
  102. this.multipleSelection = val;
  103. },
  104. formatDate(t) {
  105. if (!t) {
  106. return ''
  107. } else {
  108. var original = new Date(t);
  109. var year = original.getFullYear();
  110. var month = original.getMonth() + 1;
  111. var date = original.getDate();
  112. var hour = original.getHours();
  113. var minute = original.getMinutes();
  114. var second = original.getSeconds();
  115. // return year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
  116. return year + "/" + month + "/" + date;
  117. }
  118. },
  119. toView(router, json) {
  120. this.$router.push({ name: router, params: { key: json } });
  121. },
  122. }
  123. }
  124. </script>
  125. <style scoped>
  126. .container-box {
  127. padding: 20px;
  128. }
  129. </style>