bulletin.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div>
  3. <div>
  4. <el-card style="font-family: 'Microsoft YaHei'; font-weight: 600">
  5. <div slot="header" style="font-size: 18px">
  6. <span>公告栏</span>
  7. <el-button style="float: right; padding: 3px 0; font-weight: 600" type="text" @click="inPage"
  8. >更多公告</el-button
  9. >
  10. </div>
  11. <div v-for="item in data" :key="item.id" style="font-size: 14px">
  12. <el-link style="cursor: pointer;font-weight: 600;font-size: 14px" @click="rowEdit(item)">
  13. {{ item.title }}
  14. </el-link>
  15. </div>
  16. <div v-if="data.length == 0" style="font-size: 14px; color: #c0c4cc">
  17. <div>暂无公告</div>
  18. </div>
  19. </el-card>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. // @ts-nocheck
  25. import { getList } from "@/api/wel/bulletin.js";
  26. export default {
  27. data() {
  28. return {
  29. data: [],
  30. };
  31. },
  32. created() {
  33. this.getData();
  34. },
  35. components: {},
  36. methods: {
  37. getData() {
  38. let obj = {
  39. visibleRoles: 2,
  40. };
  41. getList(obj)
  42. .then((res) => {
  43. this.data = res.data.data;
  44. })
  45. .finally(() => {
  46. this.loading = false;
  47. });
  48. },
  49. inPage() {
  50. this.$router.push("/bulletin/index");
  51. },
  52. rowEdit(row) {
  53. this.$router.push({
  54. path: `/bulletin/details`,
  55. query: {
  56. id: row.id,
  57. },
  58. });
  59. },
  60. },
  61. };
  62. </script>
  63. <style lang="scss" scoped></style>