three-trees-ui 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-trees-ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "publicPath": "/ui",
5
5
  "author": "hotent",
6
6
  "private": false,
@@ -139,6 +139,7 @@
139
139
  class="org-table"
140
140
  size="medium"
141
141
  style="width: 100%"
142
+ :height="tableHeight"
142
143
  @row-click="orgRowClick"
143
144
  @selection-change="orgTableSelection"
144
145
  @select="onTableSelect"
@@ -323,9 +324,14 @@
323
324
  sunIndex: Number,
324
325
  subPath: String,
325
326
  currentSubData: Array,
327
+ isReadOnly: {
328
+ type: Boolean,
329
+ default: false,
330
+ },
326
331
  },
327
332
  data() {
328
333
  return {
334
+ tableHeight: 350,
329
335
  isEditInputShow: false,
330
336
  customValue: '',
331
337
  defualtTooltipplacement: 'bottom',
@@ -416,15 +422,21 @@
416
422
  })
417
423
  }
418
424
  }
425
+ this.initTableHeight()
419
426
  },
420
427
  immediate: true,
421
428
  deep: true,
422
429
  },
423
430
  },
424
431
  mounted() {
425
- if (this.value) {
426
- this.showDialog(true)
427
- }
432
+ this.$root.$on('resize', () => {
433
+ this.initTableHeight()
434
+ })
435
+ this.$nextTick(() => {
436
+ if (this.value && !this.isReadOnly) {
437
+ this.showDialog(true)
438
+ }
439
+ })
428
440
  },
429
441
  methods: {
430
442
  showDialog(isMounted = false) {
@@ -565,6 +577,14 @@
565
577
  }
566
578
  })
567
579
  },
580
+ initTableHeight() {
581
+ this.$nextTick(() => {
582
+ let mainEl = document.getElementsByClassName('custom-dialog_main')
583
+ if (mainEl && mainEl.length) {
584
+ this.tableHeight = mainEl[0].clientHeight - 40
585
+ }
586
+ })
587
+ },
568
588
  treeClick(data) {
569
589
  // 单选
570
590
  if (this.customDialog.selectNum === 1) {
@@ -121,6 +121,7 @@
121
121
  :sun-index="sunIndex"
122
122
  :sub-path="subPath"
123
123
  :current-sub-data="currentSubData"
124
+ :is-read-only="!inputWriteable"
124
125
  @calacInputSuffixHeight="calacInputSuffixHeight"
125
126
  @updateInput="updateInput"
126
127
  ></custom-dialog>