index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div id="login">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <el-col :span="24" class="top">
  6. <top></top>
  7. </el-col>
  8. <el-col :span="24" class="menu">
  9. <div class="w_1200">
  10. <menus></menus>
  11. </div>
  12. </el-col>
  13. <el-col :span="24" class="main">
  14. <div class="w_1200">
  15. <el-col :span="24" class="info">
  16. <detail :form="form"></detail>
  17. </el-col>
  18. </div>
  19. </el-col>
  20. <el-col :span="24" class="foot">
  21. <div class="w_1200">
  22. <foot></foot>
  23. </div>
  24. </el-col>
  25. </el-col>
  26. </el-row>
  27. </div>
  28. </template>
  29. <script>
  30. import top from '@/layout/common/top.vue';
  31. import menus from '@/layout/common/menus.vue';
  32. import foot from '@/layout/common/foot.vue';
  33. import detail from '@/layout/demand/detail.vue';
  34. import { mapState, createNamespacedHelpers } from 'vuex';
  35. const { mapActions: demand } = createNamespacedHelpers('demand');
  36. export default {
  37. name: 'login',
  38. props: {},
  39. components: {
  40. top,
  41. menus,
  42. foot,
  43. detail,
  44. },
  45. data: function() {
  46. return {
  47. form: {},
  48. };
  49. },
  50. created() {
  51. this.search();
  52. },
  53. methods: {
  54. ...demand(['update', 'fetch', 'query', 'create', 'delete']),
  55. async search() {
  56. console.log(this.id);
  57. let res = await this.fetch(this.id);
  58. this.$set(this, `form`, res.data);
  59. },
  60. },
  61. computed: {
  62. id() {
  63. return this.$route.query.id;
  64. },
  65. ...mapState(['user']),
  66. pageTitle() {
  67. return `${this.$route.meta.title}`;
  68. },
  69. },
  70. metaInfo() {
  71. return { title: this.$route.meta.title };
  72. },
  73. };
  74. </script>
  75. <style lang="less" scoped>
  76. .w_1200 {
  77. width: 1200px;
  78. margin: 0 auto;
  79. }
  80. .style {
  81. .menu {
  82. height: 70px;
  83. margin: 0 0 10px 0;
  84. }
  85. .main {
  86. min-height: 600px;
  87. margin: 0 0 10px 0;
  88. }
  89. .info {
  90. background-color: #fff;
  91. min-height: 600px;
  92. }
  93. .foot {
  94. height: 135px;
  95. }
  96. }
  97. </style>