three-trees-ui 1.0.99 → 1.1.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.99",
3
+ "version": "1.1.1",
4
4
  "publicPath": "/ui",
5
5
  "author": "hotent",
6
6
  "private": false,
@@ -33,9 +33,8 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "element-resize-detector": "^1.2.3",
36
- "v-viewer": "^1.7.4",
37
- "vee-validate": "2.1.7",
38
- "viewerjs": "^1.11.7"
36
+ "v-viewer": "1.6.4",
37
+ "vee-validate": "2.1.7"
39
38
  },
40
39
  "peerDependencies": {
41
40
  "axios": "^0.21.1",
@@ -64,9 +63,9 @@
64
63
  },
65
64
  "devDependencies": {
66
65
  "@babel/core": "^7.19.0",
67
- "@babel/runtime-corejs3": "^7.19.0",
68
66
  "@babel/plugin-transform-runtime": "^7.18.10",
69
67
  "@babel/preset-env": "^7.19.0",
68
+ "@babel/runtime-corejs3": "^7.19.0",
70
69
  "@vue/cli-plugin-babel": "^3.8.0",
71
70
  "@vue/cli-plugin-eslint": "^3.8.0",
72
71
  "@vue/cli-plugin-unit-jest": "^4.0.5",
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <el-collapse
3
3
  ref="collapse"
4
- v-model="openDefaultArr"
5
4
  :accordion="accordion"
5
+ :value="openDefaultArr"
6
6
  @change="handleChange"
7
7
  >
8
8
  <slot></slot>
@@ -15,7 +15,6 @@
15
15
  name: 'HtCollapse',
16
16
  mixins: [regionValidator],
17
17
  props: {
18
- value: Array,
19
18
  accordion: {
20
19
  type: Boolean,
21
20
  default: false,
@@ -41,8 +40,6 @@
41
40
  openDefaultArr: {
42
41
  handler(val) {
43
42
  this.$root.$emit('collapse-active-names', val)
44
- console.log('zlc val', val)
45
- this.$emit('input', val)
46
43
  },
47
44
  deep: true,
48
45
  },
@@ -363,7 +363,7 @@
363
363
  </div>
364
364
  <el-scrollbar
365
365
  v-if="selectsCount > 0"
366
- class="selector-selected-height"
366
+ class="selector-selected__scroll"
367
367
  >
368
368
  <draggable
369
369
  v-model="selects"
@@ -2678,21 +2678,12 @@
2678
2678
  display: flex;
2679
2679
  align-items: center;
2680
2680
  justify-content: center;
2681
- .el-dialog {
2682
- height: calc(100vh - 60px);
2683
- }
2684
2681
  .el-dialog__body {
2685
2682
  overflow: hidden;
2686
2683
  }
2687
2684
  .hotent-custom-scrollbar {
2688
2685
  height: 100%;
2689
- .el-scrollbar__view {
2690
- display: flex;
2691
- height: 100%;
2692
- }
2693
- }
2694
- .el-container {
2695
- flex-basis: min-content;
2686
+ display: flex;
2696
2687
  }
2697
2688
 
2698
2689
  #container {
@@ -2716,21 +2707,13 @@
2716
2707
  }
2717
2708
  #right {
2718
2709
  order: 2;
2719
- width: 310px;
2720
- padding: 24px;
2721
- height: auto;
2722
- box-sizing: border-box;
2723
- .el-card {
2724
- height: 100%;
2725
- margin: 0;
2726
- }
2727
- .el-card__body {
2728
- box-sizing: border-box;
2729
- height: calc(100% - 48px);
2730
- }
2731
- .selector-selected-height {
2732
- height: 100%;
2733
- }
2710
+ width: 250px;
2711
+ padding-left: 24px;
2712
+ }
2713
+ .el-card__body {
2714
+ height: calc(var(--customHeight) - 130px - 48px - 25px - 24px);
2715
+ overflow: auto;
2716
+ @include base-scrollbar;
2734
2717
  }
2735
2718
  .el-card__header {
2736
2719
  height: 48px;
@@ -12,51 +12,62 @@
12
12
  <div
13
13
  v-if="inputWriteable"
14
14
  style="width: 100%"
15
- :class="{ 'has-value': value, 'custom-selector-mobile': isMobile }"
16
- @click="showEditInput"
15
+ class="el-select"
16
+ :class="{ 'has-value': value }"
17
17
  >
18
- <div v-if="value && isSrcColor && !isMobile" class="custom-jump">
19
- <span v-for="(item, index) in inputVal" :key="index">
20
- <span class="src-color" @click.stop="jumpUrl(item)">
21
- {{ item.value }}
22
- </span>
23
- <span v-if="index != inputVal.length - 1">,</span>
24
- </span>
25
- </div>
26
- <div class="el-input el-input--suffix">
27
- <div v-if="isMobile" class="custom-selector-mobile-box">
28
- <div
18
+ <div
19
+ ref="tagSpans"
20
+ class="el-select__tags"
21
+ :style="{ width: 'calc(100% - 10px - ' + inputSuffixWidth + 'px)' }"
22
+ @click="showEditInput"
23
+ >
24
+ <span class="tag-wrap">
25
+ <span
29
26
  v-for="(item, index) in inputVal"
30
- :key="index"
31
- class="common-selector-tag"
27
+ :key="item.value"
28
+ class="el-tag el-tag--info el-tag--small no-background"
29
+ @click.stop="jumpUrl(item)"
32
30
  >
33
31
  <span
32
+ class="el-select__tags-text"
34
33
  :class="{ 'src-color': isSrcColor }"
35
- @click.stop="jumpUrl(item)"
36
34
  >
37
35
  {{ item.value }}
38
36
  </span>
39
- <i class="el-icon-error" @click.stop="removeSelectOrg(index)"></i>
40
- </div>
41
- </div>
37
+ <i
38
+ class="el-tag__close el-icon-close"
39
+ @click.stop="removeSelectOrg(index)"
40
+ ></i>
41
+ </span>
42
+ </span>
43
+ </div>
44
+ <div class="el-input el-input--suffix">
42
45
  <input
43
46
  ref="inputEl"
44
- v-model="calcInputValue"
47
+ v-model="inputVal"
45
48
  v-validate="inputValidate"
46
49
  type="text"
47
- readonly
50
+ readonly="readonly"
48
51
  :name="inputName"
49
52
  autocomplete="off"
50
53
  class="el-input__inner"
51
- :placeholder="placeholder || '请选择'"
54
+ :placeholder="placeholder"
55
+ :style="{ height: inputSuffixHeight + 'px' }"
56
+ @click="showEditInput"
52
57
  />
53
58
  <!-- 允许手动输入时 -->
54
59
  <el-input
55
60
  v-if="isAllowCustom && isEditInputShow"
56
61
  ref="editInputRef"
57
62
  v-model="customValue"
63
+ clearable
58
64
  class="edit-input"
59
65
  size="mini"
66
+ :style="{
67
+ right: inputSuffixWidth - 1 + 'px',
68
+ width: 'auto!important',
69
+ height: inputSuffixHeight - 4 + 'px',
70
+ }"
60
71
  @blur="editInputBlur"
61
72
  ></el-input>
62
73
  <span ref="inputSuffix" class="el-input__suffix" @click="showDialog">
@@ -65,11 +76,23 @@
65
76
  :class="{ 'has-clear-all': value }"
66
77
  >
67
78
  <i
68
- v-if="value"
69
79
  class="el-icon-circle-close clear-icon"
70
80
  @click.stop="clear"
71
81
  ></i>
72
- <i class="el-icon-search"></i>
82
+ <el-button slot="append" type="info" size="mini">
83
+ <i
84
+ :class="
85
+ custdialog.icon
86
+ ? 'el-input__icon ' + custdialog.icon
87
+ : 'el-input__icon icon-duihuakuang'
88
+ "
89
+ :style="{
90
+ fontSize: '17px',
91
+ lineHeight: inputSuffixHeight + 'px',
92
+ }"
93
+ ></i>
94
+ {{ custdialog.name }}
95
+ </el-button>
73
96
  </span>
74
97
  </span>
75
98
  </div>
@@ -83,52 +106,49 @@
83
106
  style="margin-right: 8px"
84
107
  @click.stop="jumpUrl(item)"
85
108
  >
86
- <span class="el-select__tags-text">
109
+ <span class="el-select__tags-text" :class="{ 'src-color': isSrcColor }">
87
110
  {{ item.value }}
88
111
  </span>
89
112
  </span>
90
113
  </span>
91
- <template v-if="isDialogShow">
92
- <custom-mobile-dialog
93
- v-if="isMobile"
94
- ref="customMobileDialogRef"
95
- :model-name="modelName"
96
- :custdialog="custdialog"
97
- :sub-index="subIndex"
98
- :sun-index="sunIndex"
99
- :sub-path="subPath"
100
- :current-sub-data="currentSubData"
101
- :dialog-config="dialogConfig"
102
- :dialog-type="dialogType"
103
- @calacInputSuffixHeight="calacInputSuffixHeight"
104
- @updateInput="updateInput"
105
- ></custom-mobile-dialog>
106
- <custom-dialog
107
- v-else
108
- ref="customDialogRef"
109
- v-model="value"
110
- :model-name="modelName"
111
- :custdialog="custdialog"
112
- :sub-index="subIndex"
113
- :sun-index="sunIndex"
114
- :sub-path="subPath"
115
- :current-sub-data="currentSubData"
116
- :is-read-only="!inputWriteable"
117
- :dialog-config="dialogConfig"
118
- :dialog-type="dialogType"
119
- @calacInputSuffixHeight="calacInputSuffixHeight"
120
- @updateInput="updateInput"
121
- ></custom-dialog>
122
- </template>
123
-
114
+ <custom-mobile-dialog
115
+ v-if="isMobile"
116
+ ref="customMobileDialogRef"
117
+ :model-name="modelName"
118
+ :custdialog="custdialog"
119
+ :sub-index="subIndex"
120
+ :sun-index="sunIndex"
121
+ :sub-path="subPath"
122
+ :current-sub-data="currentSubData"
123
+ :dialog-config="dialogConfig"
124
+ :dialog-type="dialogType"
125
+ @calacInputSuffixHeight="calacInputSuffixHeight"
126
+ @updateInput="updateInput"
127
+ ></custom-mobile-dialog>
128
+ <custom-dialog
129
+ v-else
130
+ ref="customDialogRef"
131
+ v-model="value"
132
+ :model-name="modelName"
133
+ :custdialog="custdialog"
134
+ :sub-index="subIndex"
135
+ :sun-index="sunIndex"
136
+ :sub-path="subPath"
137
+ :current-sub-data="currentSubData"
138
+ :is-read-only="!inputWriteable"
139
+ :dialog-config="dialogConfig"
140
+ :dialog-type="dialogType"
141
+ @calacInputSuffixHeight="calacInputSuffixHeight"
142
+ @updateInput="updateInput"
143
+ ></custom-dialog>
124
144
  <span style="display: none">
125
145
  <slot name="labeldesc">{{ inputName }}</slot>
126
146
  </span>
127
147
  <ht-field-tail :field-name="inputName" :input-value="value" />
128
148
  <el-dialog
129
- v-if="isDialogFormShow"
130
149
  title="表单详情"
131
150
  :visible.sync="isDialogFormShow"
151
+ v-if="isDialogFormShow"
132
152
  width="100%"
133
153
  custom-class="custom-dialog-form"
134
154
  fullscreen
@@ -186,7 +206,6 @@
186
206
  },
187
207
  data() {
188
208
  return {
189
- isDialogShow: false,
190
209
  mobileSrc: '',
191
210
  isDialogFormShow: false,
192
211
  dialogConfig: null, // 对话框配置信息
@@ -219,17 +238,6 @@
219
238
  }
220
239
  },
221
240
  computed: {
222
- calcInputValue: function() {
223
- let name = ''
224
- if (this.inputVal) {
225
- name = this.inputVal
226
- .map((k) => {
227
- return k.value
228
- })
229
- .join(',')
230
- }
231
- return name
232
- },
233
241
  inputVal: function() {
234
242
  if (!this.value || this.value == '||[]') {
235
243
  return null
@@ -302,10 +310,10 @@
302
310
  }
303
311
  }
304
312
  //获取对话框按钮名称宽度
305
- // this.calacInputSuffixWidth()
306
- // if (this.value && this.inputWriteable) {
307
- // this.calacInputSuffixHeight()
308
- // }
313
+ this.calacInputSuffixWidth()
314
+ if (this.value && this.inputWriteable) {
315
+ this.calacInputSuffixHeight()
316
+ }
309
317
  }, 50)
310
318
  },
311
319
  methods: {
@@ -386,9 +394,8 @@
386
394
  editInputBlur() {
387
395
  this.$emit('input', this.customValue)
388
396
  this.isEditInputShow = false
389
- this.validateInput()
390
397
  },
391
- async showEditInput() {
398
+ showEditInput() {
392
399
  if (!this.isAllowCustom) {
393
400
  this.showDialog()
394
401
  return
@@ -399,14 +406,10 @@
399
406
  this.$refs.editInputRef.focus()
400
407
  })
401
408
  },
402
- async showDialog() {
409
+ showDialog() {
403
410
  if (!this.inputWriteable) {
404
411
  return
405
412
  }
406
- if (this.isDialogShow === false) {
407
- this.isDialogShow = true
408
- await this.$nextTick()
409
- }
410
413
  if (this.isMobile) {
411
414
  this.$refs.customMobileDialogRef.showDialog()
412
415
  } else {
@@ -426,7 +429,7 @@
426
429
  this.clear()
427
430
  }
428
431
  this.$emit('input', value)
429
-
432
+ this.calacInputSuffixHeight()
430
433
  if (this.isMobile) {
431
434
  this.$refs.customMobileDialogRef.removeSelectOrg(item)
432
435
  } else {
@@ -436,38 +439,30 @@
436
439
  clear() {
437
440
  this.$emit('input', '')
438
441
  this.$refs.customDialogRef.clearAll()
439
- this.validateInput()
442
+ this.calacInputSuffixHeight()
440
443
  },
441
444
  calacInputSuffixHeight() {
442
445
  setTimeout(() => {
443
- // if (!this.$refs.tagSpans) return
444
- // if (this.$refs.tagSpans.offsetHeight) {
445
- // this.inputSuffixHeight = this.$refs.tagSpans.offsetHeight + 5
446
- // } else {
447
- // this.inputSuffixHeight = 30
448
- // }
446
+ if (!this.$refs.tagSpans) return
447
+ if (this.$refs.tagSpans.offsetHeight) {
448
+ this.inputSuffixHeight = this.$refs.tagSpans.offsetHeight + 5
449
+ } else {
450
+ this.inputSuffixHeight = 30
451
+ }
449
452
  // 触发验证
450
453
  if (this.$refs.inputEl) {
451
454
  this.$validator.validate(this.inputName)
452
455
  }
453
456
  }, 0)
454
- // this.calacInputSuffixWidth()
457
+ this.calacInputSuffixWidth()
455
458
  },
456
459
  calacInputSuffixWidth() {
457
- // if (this.$refs.inputSuffix) {
458
- // this.inputSuffixWidth = this.$refs.inputSuffix.offsetWidth + 1
459
- // }
460
- },
461
- validateInput() {
462
- setTimeout(() => {
463
- if (this.$refs.inputEl) {
464
- this.$validator.validate(this.inputName)
465
- }
466
- })
460
+ if (this.$refs.inputSuffix) {
461
+ this.inputSuffixWidth = this.$refs.inputSuffix.offsetWidth + 1
462
+ }
467
463
  },
468
464
  updateInput(data) {
469
465
  this.$emit('input', data)
470
- this.validateInput()
471
466
  },
472
467
  },
473
468
  }
@@ -475,17 +470,15 @@
475
470
  <style lang="scss" scoped>
476
471
  .edit-input {
477
472
  position: absolute;
478
- top: 50%;
479
- transform: translateY(-50%);
480
- height: 30px;
481
473
  left: 1px;
482
- right: 34px;
483
474
  border: none;
484
- z-index: 2;
475
+ top: 50%;
476
+ transform: translateY(-50%);
477
+ z-index: 50;
485
478
  display: flex;
486
479
  align-items: center;
487
- width: auto !important;
488
480
  ::v-deep .el-input__inner {
481
+ height: 100%;
489
482
  border: none;
490
483
  }
491
484
  }
@@ -504,9 +497,20 @@
504
497
  color: #c0c4cc;
505
498
  }
506
499
  .el-input__suffix {
507
- display: flex;
508
- flex-direction: column;
509
- justify-content: center;
500
+ position: absolute;
501
+ height: 100%;
502
+ right: 0px !important;
503
+ top: 0;
504
+ text-align: center;
505
+ color: #c0c4cc;
506
+ -webkit-transition: all 0.3s;
507
+ transition: all 0.3s;
508
+ pointer-events: none;
509
+ z-index: 100;
510
+ .has-clear-all {
511
+ display: flex;
512
+ align-items: center;
513
+ }
510
514
  }
511
515
  .el-dialog__body {
512
516
  padding: 0;
@@ -540,11 +544,6 @@
540
544
  height: 100%;
541
545
  }
542
546
  }
543
- .el-input__inner {
544
- height: 32px;
545
- line-height: 32px;
546
- }
547
-
548
547
  .el-input__inner[aria-invalid='true'] {
549
548
  border-color: #f56c6c;
550
549
  }
@@ -645,7 +644,6 @@
645
644
  margin: 8px 0;
646
645
  }
647
646
  .src-color {
648
- font-size: 12px;
649
647
  cursor: pointer;
650
648
  color: #409eff !important;
651
649
  }
@@ -687,58 +685,4 @@
687
685
  }
688
686
  }
689
687
  }
690
- .el-select {
691
- line-height: normal;
692
- }
693
- .custom-jump {
694
- position: absolute;
695
- height: 28px;
696
- left: 15px;
697
- top: 50%;
698
- transform: translateY(-50%);
699
- right: 32px;
700
- display: flex;
701
- align-items: center;
702
- background-color: #fff;
703
- z-index: 1;
704
- }
705
- .custom-selector-mobile {
706
- .custom-selector-mobile-box {
707
- display: flex;
708
- min-height: 32px;
709
- align-items: center;
710
- padding: 4px 14px;
711
- flex-wrap: wrap;
712
- gap: 4px;
713
- line-height: 22px;
714
- padding-right: 40px;
715
- box-sizing: border-box;
716
- .el-icon-error {
717
- color: #909399;
718
- }
719
- }
720
- .el-input__inner {
721
- position: absolute;
722
- left: 0;
723
- top: 0;
724
- right: 0;
725
- bottom: 0;
726
- user-select: none;
727
- background: none;
728
- color: transparent !important;
729
- pointer-events: none;
730
- height: 100%;
731
- }
732
- .el-input__suffix-inner {
733
- display: flex;
734
- align-items: center;
735
- }
736
- .el-icon-circle-close {
737
- margin-right: 3px;
738
- }
739
- .user-icon,
740
- .el-icon-circle-close {
741
- display: inline-block !important;
742
- }
743
- }
744
688
  </style>