index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div class="tab-table-wrap">
  3. <el-tabs
  4. v-model="activeName"
  5. @tab-click="handleClick"
  6. >
  7. <el-tab-pane
  8. label="城市管理"
  9. name="first"
  10. >
  11. <el-table
  12. :data="tableData"
  13. style="width: 100%"
  14. >
  15. <el-table-column
  16. prop="name"
  17. label="城市"
  18. width="180"
  19. />
  20. <el-table-column
  21. prop="number"
  22. label="数量"
  23. />
  24. </el-table>
  25. <el-tab-pane
  26. label="用户信息"
  27. name="second"
  28. >
  29. <el-descriptions title="用户信息">
  30. <el-descriptions-item label="用户名">
  31. {{ customize.username }}
  32. </el-descriptions-item>
  33. <el-descriptions-item label="手机号">
  34. {{ customize.phone }}
  35. </el-descriptions-item>
  36. </el-descriptions>
  37. </el-tab-pane>
  38. <el-tab-pane
  39. label="角色管理"
  40. name="third"
  41. >
  42. 角色管理
  43. </el-tab-pane>
  44. <el-tab-pane
  45. label="定时任务补偿"
  46. name="fourth"
  47. >
  48. 定时任务补偿
  49. </el-tab-pane>
  50. </el-tab-pane>
  51. </el-tabs>
  52. </div>
  53. </template>
  54. <script>
  55. export default {
  56. data () {
  57. return {
  58. activeName: 'first'
  59. }
  60. },
  61. props: {
  62. config: {
  63. type: Object,
  64. default: () => ({})
  65. }
  66. },
  67. computed: {
  68. option () {
  69. return this.config.option
  70. },
  71. optionData () {
  72. return this.option.data
  73. },
  74. customize () {
  75. return this.option.customize
  76. },
  77. tableData () {
  78. if (this.optionData && this.optionData.length) {
  79. return this.optionData.map((item) => ({
  80. name: item[this.option.xField],
  81. number: item[this.option.yField]
  82. }))
  83. }
  84. return []
  85. }
  86. },
  87. methods: {
  88. handleClick (tab, event) {
  89. },
  90. linkage (row) {
  91. this.$emit('linkage', row)
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .tab-table-wrap {
  98. padding: 16px;
  99. font-size: 20px;
  100. position: absolute;
  101. width: 100%;
  102. height: 100%;
  103. background: #fff;
  104. }
  105. </style>