definitionDetials.vue 2.0 KB

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