aevMobiel.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <el-dialog
  3. :title="modalTitle"
  4. :visible.sync="modalVisible"
  5. :width="formLabelWidth"
  6. top="2vh"
  7. @close="handleCancel">
  8. <div class="userMobile" v-loading="loading">
  9. <!-- {{datas}} -->
  10. <el-row :gutter="20">
  11. <el-col :span="14">
  12. <div class="grid-content bg-purple">
  13. <b>数据名称:</b>
  14. {{datas.dataName}}
  15. </div>
  16. </el-col>
  17. <el-col :span="6">
  18. <div class="grid-content bg-purple">
  19. <b>修改人:</b>
  20. {{datas.createUser}}
  21. </div>
  22. </el-col>
  23. </el-row>
  24. <el-row :gutter="20">
  25. <el-col :span="14">
  26. <div class="grid-content bg-purple">
  27. <b>上次修改时间:</b>
  28. {{datas.createDate}}
  29. </div>
  30. </el-col>
  31. </el-row>
  32. <div style="custom-table">
  33. <el-table
  34. :data="datas.valList"
  35. border
  36. height="330"
  37. style="width: 100%">
  38. <el-table-column type="index" width="50" label="序号" align="center"></el-table-column>
  39. <el-table-column
  40. align="center"
  41. v-for="(item,index) in column"
  42. :key="index"
  43. :label="item.fieldName"
  44. :prop="item.prop">
  45. </el-table-column>
  46. </el-table>
  47. </div>
  48. </div>
  49. <div slot="footer" class="dialog-footer">
  50. <el-button @click="handleCancel">取 消</el-button>
  51. </div>
  52. </el-dialog>
  53. </template>
  54. <script>
  55. import {globalReg} from '@/api/CONST'
  56. export default {
  57. name: 'userMobiel',
  58. props: {
  59. visible: {
  60. type: Boolean,
  61. default: false
  62. },
  63. title: {
  64. type: String,
  65. default: 'title'
  66. },
  67. selectRow:{
  68. type:Object,
  69. default:{}
  70. }
  71. },
  72. watch: {
  73. visible(newVal, oldVal) {
  74. this.modalVisible = newVal;
  75. },
  76. title(newVal, oldVal) {
  77. this.modalTitle = newVal;
  78. },
  79. selectRow(newVal,oldVal){
  80. this.modalSelectRow = newVal
  81. }
  82. },
  83. data() {
  84. return {
  85. modalTitle: this.title,
  86. modalVisible: this.visible,
  87. modalAction: this.action,
  88. modalSelectRow:this.selectRow,
  89. formLabelWidth: '920px',
  90. loading:true,
  91. datas:{},
  92. column:[],
  93. tableconfig:{
  94. rowWidth:0,
  95. lineWidth:0
  96. }
  97. };
  98. },
  99. created() {
  100. this.getDetail(this.modalSelectRow.id)
  101. },
  102. methods: {
  103. //获取坝区详情
  104. getDetail(id){
  105. let params = {
  106. id:id
  107. }
  108. this.$port.getAreaManageInfo(params)
  109. .then(res => {
  110. this.datas = res
  111. let columns = this.datas.fieldList;
  112. for(let i = 0;i<columns.length;i++){
  113. columns[i].prop = 'fieldVal' + i
  114. }
  115. this.column = columns;
  116. this.loading = false
  117. })
  118. },
  119. handleCancel() {
  120. this.$emit('closeModal', false);
  121. }
  122. }
  123. };
  124. </script>
  125. <style scoped lang="less">
  126. .table-head table,
  127. .table-body table{width:100%;text-align:center;border-collapse: collapse;}
  128. .table-head{padding-right:17px;color:#000;border:1px solid #EBEEF5;border-spacing:0px;border-collapse: collapse;}
  129. .table-head table tr th{height:45px;border-right:1px solid #EBEEF5;}
  130. .table-head table tr th:last-child{border-right:none;}
  131. .table-body{width:100%; height:300px;overflow-y:scroll;}
  132. .table-body table tr{height:40px;border-spacing: 0px; border-collapse: collapse;}
  133. .table-body table tr td{border:1px solid #EBEEF5;}
  134. .table-body table tr:nth-child(2n+1){background-color:#f2f2f2;}
  135. .el-row{margin-bottom:20px;}
  136. </style>