后端

meeting.vue 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
  4. <el-form-item>
  5. <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
  6. </el-form-item>
  7. <el-form-item>
  8. <el-button @click="getDataList()">查询</el-button>
  9. <el-button v-if="isAuth('admin:meeting:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
  10. <el-button v-if="isAuth('admin:meeting:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
  11. </el-form-item>
  12. </el-form>
  13. <el-table
  14. :data="dataList"
  15. border
  16. v-loading="dataListLoading"
  17. @selection-change="selectionChangeHandle"
  18. style="width: 100%;">
  19. <el-table-column
  20. type="selection"
  21. header-align="center"
  22. align="center"
  23. width="50">
  24. </el-table-column>
  25. <el-table-column
  26. prop="id"
  27. header-align="center"
  28. align="center"
  29. label="会议id (会议表)">
  30. </el-table-column>
  31. <el-table-column
  32. prop="companyId"
  33. header-align="center"
  34. align="center"
  35. label="举办单位id">
  36. </el-table-column>
  37. <el-table-column
  38. prop="nameCn"
  39. header-align="center"
  40. align="center"
  41. label="会议名称(中文)">
  42. </el-table-column>
  43. <el-table-column
  44. prop="nameEn"
  45. header-align="center"
  46. align="center"
  47. label="会议名称(英文)">
  48. </el-table-column>
  49. <el-table-column
  50. prop="address"
  51. header-align="center"
  52. align="center"
  53. label="举办地点">
  54. </el-table-column>
  55. <el-table-column
  56. prop="startTime"
  57. header-align="center"
  58. align="center"
  59. label="开始时间">
  60. </el-table-column>
  61. <el-table-column
  62. prop="endTime"
  63. header-align="center"
  64. align="center"
  65. label="结束时间">
  66. </el-table-column>
  67. <el-table-column
  68. prop="officeWebsite"
  69. header-align="center"
  70. align="center"
  71. label="官方网址">
  72. </el-table-column>
  73. <el-table-column
  74. prop="titlePicture"
  75. header-align="center"
  76. align="center"
  77. label="会议封面图片地址">
  78. </el-table-column>
  79. <el-table-column
  80. prop="subjects"
  81. header-align="center"
  82. align="center"
  83. label="涉及学科">
  84. </el-table-column>
  85. <el-table-column
  86. prop="industries"
  87. header-align="center"
  88. align="center"
  89. label="涉及行业">
  90. </el-table-column>
  91. <el-table-column
  92. prop="serviceEmp"
  93. header-align="center"
  94. align="center"
  95. label="会议负责人">
  96. </el-table-column>
  97. <el-table-column
  98. prop="onlineRegDeadline"
  99. header-align="center"
  100. align="center"
  101. label="线上报名截止时间">
  102. </el-table-column>
  103. <el-table-column
  104. prop="onsiteRegDeadline"
  105. header-align="center"
  106. align="center"
  107. label="现场报名截止时间">
  108. </el-table-column>
  109. <el-table-column
  110. prop="subDeadline"
  111. header-align="center"
  112. align="center"
  113. label="投稿截止时间">
  114. </el-table-column>
  115. <el-table-column
  116. prop="subRequirement"
  117. header-align="center"
  118. align="center"
  119. label="投稿范围及要求">
  120. </el-table-column>
  121. <el-table-column
  122. prop="introduction"
  123. header-align="center"
  124. align="center"
  125. label="会议介绍">
  126. </el-table-column>
  127. <el-table-column
  128. prop="createTime"
  129. header-align="center"
  130. align="center"
  131. label="创建时间">
  132. </el-table-column>
  133. <el-table-column
  134. prop="modifyTime"
  135. header-align="center"
  136. align="center"
  137. label="修改时间">
  138. </el-table-column>
  139. <el-table-column
  140. prop="isCheck"
  141. header-align="center"
  142. align="center"
  143. label="是否通过审核 0:未通过 1:通过">
  144. </el-table-column>
  145. <el-table-column
  146. prop="isDel"
  147. header-align="center"
  148. align="center"
  149. label="是否被删除 状态 0:正常 1:删除">
  150. </el-table-column>
  151. <el-table-column
  152. fixed="right"
  153. header-align="center"
  154. align="center"
  155. width="150"
  156. label="操作">
  157. <template slot-scope="scope">
  158. <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
  159. <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
  160. </template>
  161. </el-table-column>
  162. </el-table>
  163. <el-pagination
  164. @size-change="sizeChangeHandle"
  165. @current-change="currentChangeHandle"
  166. :current-page="pageIndex"
  167. :page-sizes="[10, 20, 50, 100]"
  168. :page-size="pageSize"
  169. :total="totalPage"
  170. layout="total, sizes, prev, pager, next, jumper">
  171. </el-pagination>
  172. <!-- 弹窗, 新增 / 修改 -->
  173. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  174. </div>
  175. </template>
  176. <script>
  177. import AddOrUpdate from './meeting-add-or-update'
  178. export default {
  179. data () {
  180. return {
  181. dataForm: {
  182. key: ''
  183. },
  184. dataList: [],
  185. pageIndex: 1,
  186. pageSize: 10,
  187. totalPage: 0,
  188. dataListLoading: false,
  189. dataListSelections: [],
  190. addOrUpdateVisible: false
  191. }
  192. },
  193. components: {
  194. AddOrUpdate
  195. },
  196. activated () {
  197. this.getDataList()
  198. },
  199. methods: {
  200. // 获取数据列表
  201. getDataList () {
  202. this.dataListLoading = true
  203. this.$http({
  204. url: this.$http.adornUrl('/admin/meeting/list'),
  205. method: 'get',
  206. params: this.$http.adornParams({
  207. 'page': this.pageIndex,
  208. 'limit': this.pageSize,
  209. 'key': this.dataForm.key
  210. })
  211. }).then(({data}) => {
  212. if (data && data.code === 0) {
  213. this.dataList = data.page.list
  214. this.totalPage = data.page.totalCount
  215. } else {
  216. this.dataList = []
  217. this.totalPage = 0
  218. }
  219. this.dataListLoading = false
  220. })
  221. },
  222. // 每页数
  223. sizeChangeHandle (val) {
  224. this.pageSize = val
  225. this.pageIndex = 1
  226. this.getDataList()
  227. },
  228. // 当前页
  229. currentChangeHandle (val) {
  230. this.pageIndex = val
  231. this.getDataList()
  232. },
  233. // 多选
  234. selectionChangeHandle (val) {
  235. this.dataListSelections = val
  236. },
  237. // 新增 / 修改
  238. addOrUpdateHandle (id) {
  239. this.addOrUpdateVisible = true
  240. this.$nextTick(() => {
  241. this.$refs.addOrUpdate.init(id)
  242. })
  243. },
  244. // 删除
  245. deleteHandle (id) {
  246. var ids = id ? [id] : this.dataListSelections.map(item => {
  247. return item.id
  248. })
  249. this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
  250. confirmButtonText: '确定',
  251. cancelButtonText: '取消',
  252. type: 'warning'
  253. }).then(() => {
  254. this.$http({
  255. url: this.$http.adornUrl('/admin/meeting/delete'),
  256. method: 'post',
  257. data: this.$http.adornData(ids, false)
  258. }).then(({data}) => {
  259. if (data && data.code === 0) {
  260. this.$message({
  261. message: '操作成功',
  262. type: 'success',
  263. duration: 1500,
  264. onClose: () => {
  265. this.getDataList()
  266. }
  267. })
  268. } else {
  269. this.$message.error(data.msg)
  270. }
  271. })
  272. })
  273. }
  274. }
  275. }
  276. </script>