guidanceData.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <div id="guidanceData">
  3. <el-row>
  4. <el-col :span="24" class="guidanceData">
  5. <el-table :data="tableData" style="width: 100%" border>
  6. <el-table-column prop="name" label="指导信息名称" width="" align="left"> </el-table-column>
  7. <el-table-column prop="type" label="指导信息类型" width="" align="left"> </el-table-column>
  8. <el-table-column prop="user" label="发布人" width="" align="left"> </el-table-column>
  9. <el-table-column prop="date" label="申请日期" width="" align="left"> </el-table-column>
  10. <el-table-column label="操作" width="" align="left">
  11. <template slot-scope="scoped">
  12. <el-button size="mini" type="primary" icon="el-icon-view" @click="openDialog(scoped.$index)"></el-button>
  13. <el-button size="mini" type="primary" icon="el-icon-edit" @click="addData(scoped.$index)"></el-button>
  14. <el-button size="mini" type="danger" icon="el-icon-delete" @click.native.prevent="deleteRow(scoped.$index, tableData)"></el-button>
  15. </template>
  16. </el-table-column>
  17. </el-table>
  18. <el-col :span="24" class="page">
  19. <el-pagination
  20. @size-change="handleSizeChange"
  21. @current-change="handleCurrentChange"
  22. :current-page="currentPage"
  23. layout="total, prev, pager, next, jumper"
  24. :total="1"
  25. >
  26. </el-pagination>
  27. </el-col>
  28. </el-col>
  29. </el-row>
  30. <el-dialog title="详细信息" :visible.sync="dialog">
  31. <p class="text">就业指导名称:{{ info.name }}</p>
  32. <p class="text">就业指导类型:{{ info.type }}</p>
  33. <p class="text">就业指导发布人:{{ info.user }}</p>
  34. <p class="text">申请日期:{{ info.date }}</p>
  35. <p class="text">
  36. 内容:<span>{{ info.content }}</span>
  37. </p>
  38. </el-dialog>
  39. </div>
  40. </template>
  41. <script>
  42. export default {
  43. name: 'guidanceData',
  44. props: {
  45. tableData: null,
  46. },
  47. components: {},
  48. data: () => ({
  49. currentPage: 1,
  50. dialog: false,
  51. info: {},
  52. pic: require('@/assets/logo.png'),
  53. }),
  54. created() {},
  55. computed: {},
  56. methods: {
  57. handleSizeChange(val) {
  58. console.log(`每页 ${val} 条`);
  59. },
  60. handleCurrentChange(val) {
  61. console.log(`当前页: ${val}`);
  62. },
  63. addData(index) {
  64. if (index !== undefined) {
  65. let data = this.tableData[index];
  66. } else {
  67. this.form = {};
  68. }
  69. this.$router.push({ path: './detail' });
  70. },
  71. deleteRow(index, rows) {
  72. rows.splice(index, 1);
  73. },
  74. openDialog(index) {
  75. if (index !== undefined) {
  76. let data = JSON.parse(JSON.stringify(this.tableData[index]));
  77. data[`index`] = index;
  78. this.$set(this, `info`, data);
  79. }
  80. this.dialog = true;
  81. },
  82. },
  83. };
  84. </script>
  85. <style lang="less" scoped>
  86. p {
  87. padding: 0;
  88. margin: 0;
  89. }
  90. /deep/.el-table th {
  91. padding: 5px 0;
  92. background: #f2f2f2;
  93. }
  94. /deep/.el-table td {
  95. padding: 5px 0;
  96. }
  97. /deep/.el-table tr {
  98. background: #f9f9f9;
  99. }
  100. /deep/.el-table tr:nth-child(2n) {
  101. background: #fff;
  102. }
  103. .page {
  104. text-align: center;
  105. padding: 30px 0;
  106. }
  107. .text {
  108. font-size: 16px;
  109. padding: 0 0 10px 0;
  110. }
  111. .text span {
  112. display: inherit;
  113. text-indent: 1rem;
  114. }
  115. </style>