definitionDetials.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <ele-modal
  3. :title="title"
  4. :visible.sync="visible"
  5. :close-on-click-modal="false"
  6. @close="handleClose"
  7. resizable
  8. maxable
  9. width="60%"
  10. >
  11. <div>
  12. <ele-pro-table
  13. ref="table"
  14. row-key="id"
  15. :columns="columns"
  16. :datasource="list"
  17. >
  18. <template v-slot:expand="{ row }">
  19. <el-table :data="row.values" border style="width: 100%">
  20. <el-table-column type="index" width="50" label="序号">
  21. </el-table-column>
  22. <el-table-column prop="name" label="选项"> </el-table-column>
  23. </el-table>
  24. </template>
  25. </ele-pro-table>
  26. </div>
  27. <template v-slot:footer>
  28. <el-button type="primary" @click="handleClose">确 定</el-button>
  29. </template>
  30. </ele-modal>
  31. </template>
  32. <script>
  33. import dictMixins from '@/mixins/dictMixins';
  34. export default {
  35. mixins: [dictMixins],
  36. data() {
  37. return {
  38. visible: false,
  39. title: '详情',
  40. list: []
  41. };
  42. },
  43. computed: {
  44. columns() {
  45. return [
  46. {
  47. width: 50,
  48. type: 'expand',
  49. columnKey: 'expand',
  50. align: 'center',
  51. slot: 'expand'
  52. },
  53. {
  54. width: 50,
  55. type: 'index',
  56. columnKey: 'index',
  57. align: 'center',
  58. label: '序号'
  59. },
  60. {
  61. prop: 'columnComment',
  62. label: '条件名称',
  63. align: 'center',
  64. minWidth: 150,
  65. showOverflowTooltip: true
  66. }
  67. ];
  68. }
  69. },
  70. methods: {
  71. // 外部调用,打开弹窗
  72. open(list) {
  73. this.list = list;
  74. console.log('this.list', this.list);
  75. this.visible = true;
  76. },
  77. // 关闭时清理表单
  78. handleClose() {
  79. this.visible = false;
  80. },
  81. // 提交
  82. submit() {}
  83. }
  84. };
  85. </script>
  86. <style scoped lang="scss"></style>