OutputFieldDialog.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <div>
  3. <el-dialog
  4. title="输出字段配置"
  5. :visible.sync="dialogVisible"
  6. width="1000px"
  7. append-to-body
  8. :close-on-click-modal="false"
  9. :before-close="handleClose"
  10. class="bs-dialog-wrap bs-el-dialog"
  11. >
  12. <div class="bs-table-box">
  13. <el-table
  14. :data="outputFieldList"
  15. :border="true"
  16. align="center"
  17. class="bs-el-table"
  18. >
  19. <el-empty slot="empty" />
  20. <el-table-column
  21. align="left"
  22. show-overflow-tooltip
  23. prop="fieldName"
  24. label="字段值"
  25. />
  26. <el-table-column
  27. align="center"
  28. prop="fieldDesc"
  29. label="字段描述"
  30. >
  31. <template slot-scope="scope">
  32. <el-input
  33. v-model="scope.row.fieldDesc"
  34. size="small"
  35. class="labeldsc bs-el-input"
  36. />
  37. </template>
  38. </el-table-column>
  39. </el-table>
  40. </div>
  41. <span
  42. slot="footer"
  43. class="dialog-footer"
  44. >
  45. <el-button
  46. class="bs-el-button-default"
  47. @click="cancelField"
  48. >
  49. 取消
  50. </el-button>
  51. <el-button
  52. type="primary"
  53. @click="setField"
  54. >
  55. 确定
  56. </el-button>
  57. </span>
  58. </el-dialog>
  59. </div>
  60. </template>
  61. <script>
  62. import { cloneDeep } from 'lodash'
  63. export default {
  64. name: 'OutputFieldDialog',
  65. props: {
  66. outputFieldList: {
  67. type: Array,
  68. default: () => []
  69. }
  70. },
  71. data () {
  72. return {
  73. dialogVisible: false,
  74. structurePreviewListCopy: []
  75. }
  76. },
  77. methods: {
  78. open () {
  79. this.dialogVisible = true
  80. },
  81. close () {
  82. this.dialogVisible = false
  83. },
  84. handleClose () {
  85. this.fieldsetVisible = false
  86. },
  87. cancelField () {
  88. this.dialogVisible = false
  89. },
  90. setField () {
  91. if (this.outputFieldList.length) {
  92. this.fieldDesc = {}
  93. this.outputFieldList.forEach(key => {
  94. this.fieldDesc[key.fieldName] = key.fieldDesc
  95. })
  96. } else {
  97. this.fieldDesc = null
  98. }
  99. this.dialogVisible = false
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. @import '../../../packages/assets/style/bsTheme.scss';
  106. </style>