dataSetSetting.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <el-dialog
  3. :close-on-click-modal="false"
  4. :append-to-body="true"
  5. title="数据集设置"
  6. :visible.sync="dataSetVisible"
  7. width="80%"
  8. class="bs-dialog-wrap data-set-wrap bs-el-dialog"
  9. >
  10. <DataSetManagement
  11. ref="dataSetSetting"
  12. class="bs-data-set-management"
  13. theme-class="bs-"
  14. :is-border="true"
  15. :is-dialog="true"
  16. :ds-id="dataSetId"
  17. :multiple="multiple"
  18. :ds-value="DataDsValue"
  19. />
  20. <span
  21. slot="footer"
  22. class="dialog-footer"
  23. >
  24. <el-button
  25. class="bs-el-button-default"
  26. @click="dataSetVisible = false"
  27. >
  28. 取消
  29. </el-button>
  30. <el-button
  31. type="primary"
  32. @click="sure"
  33. >确定</el-button>
  34. </span>
  35. </el-dialog>
  36. </template>
  37. <script>
  38. import DataSetManagement from 'packages/DataSetManagement'
  39. export default {
  40. name: 'DataSetSetting',
  41. components: { DataSetManagement },
  42. props: {
  43. config: {
  44. type: Object,
  45. default: () => {
  46. }
  47. },
  48. dsId: {
  49. type: String,
  50. default: ''
  51. },
  52. multiple: {
  53. type: Boolean,
  54. default: false
  55. },
  56. dsValue: {
  57. type: [Array, Object],
  58. default: () => ([])
  59. }
  60. },
  61. data () {
  62. return {
  63. dataSetVisible: false,
  64. dataSetId: null
  65. }
  66. },
  67. computed: {
  68. DataDsValue () {
  69. if (this.multiple) {
  70. return this.dsValue
  71. } else {
  72. return {
  73. id: this.dsId
  74. }
  75. }
  76. }
  77. },
  78. mounted () {
  79. this.dataSetId = this.dsId
  80. },
  81. methods: {
  82. sure () {
  83. this.dataSetVisible = false
  84. const getSelectDs = this.$refs.dataSetSetting.getSelectDs()
  85. if (Object.prototype.hasOwnProperty.call(getSelectDs, 'id')) {
  86. this.dataSetId = getSelectDs.id
  87. }
  88. this.$emit('getDsId', this.dataSetId)
  89. this.$emit('getSelectDs', getSelectDs)
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss"></style>
  95. <style lang="scss" scoped>
  96. @import '../assets/style/bsTheme.scss';
  97. .data-set-wrap {
  98. /deep/ .el-dialog__body {
  99. position: relative;
  100. padding: 0 !important;
  101. min-height: 535px;
  102. overflow: hidden;
  103. }
  104. ::v-deep .bs-container {
  105. padding: 0;
  106. min-height: 535px;
  107. .el-table {
  108. max-height: calc(90vh - 350px);
  109. }
  110. .bs-table-box {
  111. margin-bottom: 0px;
  112. }
  113. .ztree {
  114. max-height: none !important;
  115. }
  116. }
  117. .bs-data-set-management {
  118. ::v-deep .ztree {
  119. height: auto !important;
  120. }
  121. ::v-deep .bs-table-box {
  122. height: auto !important;
  123. }
  124. ::v-deep .bs-el-pagination {
  125. right: 6px !important;
  126. }
  127. ::v-deep .data-set-scrollbar {
  128. height: 515px !important;
  129. }
  130. }
  131. }
  132. </style>