bri-components 1.2.69 → 1.2.70

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": "bri-components",
3
- "version": "1.2.69",
3
+ "version": "1.2.70",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -22,14 +22,14 @@
22
22
  <th
23
23
  v-for="(col, colIndex) in columns"
24
24
  :key="col._id"
25
- class="td-tree"
25
+ class="th-tree"
26
26
  :style="getThStyle(col)"
27
27
  @click="$dispatchEvent(operationMap.clickTh, col)"
28
28
  >
29
- <span>
29
+ <span class="th-tree-name">
30
30
  <i
31
31
  v-if="col._required"
32
- style="color:red"
32
+ class="th-tree-name-icon"
33
33
  >*</i>
34
34
  {{ col._name }}
35
35
  </span>
@@ -42,8 +42,8 @@
42
42
  col.level === treeColumns.length &&
43
43
  $getOperationList(getColOperationNames(col)).length
44
44
  "
45
- class="td-tree-dropdown"
46
- menuClass="td-tree-dropdown-list"
45
+ class="th-tree-dropdown"
46
+ menuClass="th-tree-dropdown-list"
47
47
  trigger="hover"
48
48
  :list="$getOperationList(getColOperationNames(col))"
49
49
  @click="$dispatchEvent($event, col, colIndex, columns)"
@@ -107,14 +107,10 @@
107
107
  <!-- 查看状态 -->
108
108
  <template v-else>
109
109
  <bri-tooltip
110
- :transfer="true"
111
110
  :content="enterText(row[col._key].name)"
111
+ :transfer="true"
112
112
  >
113
- <span
114
- v-html="enterText(row[col._key].name)"
115
- class="dsh-ellipsis"
116
- style="word-break:break-word"
117
- ></span>
113
+ <span v-html="enterText(row[col._key].name)"></span>
118
114
  </bri-tooltip>
119
115
 
120
116
  <!-- 操作下拉 -->
@@ -360,46 +356,6 @@
360
356
  this.disabledBtns ? ["changeVal"] : undefined
361
357
  )
362
358
  : {};
363
- },
364
- getThStyle () {
365
- return function (col) {
366
- let length = this.columns.length;
367
- let typeWidth = this.widthMap[col._type];
368
- if (col._type == "number") {
369
- typeWidth = 110;
370
- } else if (col._type === "reference") {
371
- typeWidth = (col._name ? col._name.length * 14 : 36) + 200;
372
- }
373
- let width = col.colType === "tree"
374
- ? Math.min(Math.max(this.boxWidth / length, 80), 160)
375
- : col.colType === "summary"
376
- ? 100
377
- : Math.max((this.boxWidth / length), typeWidth);
378
- let selfStyle = col.colType === "tree"
379
- ? {
380
- backgroundColor: "f0f0f0",
381
- textAlign: "center",
382
- fontSize: "14px"
383
- }
384
- : col.colType === "summary"
385
- ? {
386
- backgroundColor: "#eeeeee",
387
- textAlign: "right"
388
- }
389
- : {textAlign: col._align || "left"};
390
- width = col._width || width;
391
- return {
392
- width: `${width}px`,
393
- minWidth: `${width}px`,
394
- maxWidth: `${width}px`,
395
- height: "44px",
396
- padding: "5px 12px",
397
- cursor: "pointer",
398
- lineHeight: "20px",
399
- ...selfStyle
400
- };
401
- };
402
-
403
359
  }
404
360
  },
405
361
  created () {
@@ -779,6 +735,36 @@
779
735
  : "未选择算法";
780
736
  }
781
737
  },
738
+ getThStyle (col) {
739
+ const boxColWidth = this.boxWidth / this.columns.length;
740
+ const defaultWidth = Math.max(boxColWidth, this.widthMap[col._type], (col._name ? col._name.length * 14 : 36) + (col._type === "reference" ? 200 : 26));
741
+ const width = col._width || defaultWidth;
742
+
743
+ const selfStyle = col.colType === "tree"
744
+ ? {
745
+ backgroundColor: "f0f0f0",
746
+ textAlign: col._align || "left",
747
+ fontSize: "14px"
748
+ }
749
+ : col.colType === "summary"
750
+ ? {
751
+ backgroundColor: "#eeeeee",
752
+ textAlign: "right"
753
+ }
754
+ : {
755
+ textAlign: col._align || "left"
756
+ };
757
+
758
+ return {
759
+ width: `${width}px`,
760
+ minWidth: `${width}px`,
761
+ maxWidth: `${width}px`,
762
+ padding: "5px 12px",
763
+ "word-break": "break-all",
764
+ cursor: "pointer",
765
+ ...selfStyle
766
+ };
767
+ },
782
768
  getTdStyle (col, row) {
783
769
  return {
784
770
  ...this.getThStyle(col),
@@ -811,3 +797,130 @@
811
797
  }
812
798
  };
813
799
  </script>
800
+
801
+ <style lang="less">
802
+ .DshCascaderTable {
803
+ width: 100%;
804
+
805
+ &-wrap {
806
+ width: 100%;
807
+
808
+ &-center {
809
+ width: 100%;
810
+ height: 100%;
811
+ max-height: 600px;
812
+ margin-left: 0px;
813
+ margin-right: 0px;
814
+ position: relative;
815
+ display: flex;
816
+
817
+ &-top {
818
+ width: 100%;
819
+ height: 40px;
820
+ overflow: hidden;
821
+ position: absolute;
822
+ top: 0px;
823
+ left: 0px;
824
+ z-index: 99;
825
+
826
+ &-inner {
827
+ display: block;
828
+ float: left;
829
+ width: 10000px;
830
+
831
+ .table {
832
+ background-color: #f0f0f0;
833
+ }
834
+ }
835
+ }
836
+
837
+ &-list {
838
+ width: 100%;
839
+ flex: 1;
840
+ min-height: 0px;
841
+ margin-top: 40px;
842
+ overflow: auto;
843
+
844
+ &-inner {}
845
+ }
846
+
847
+ .table {
848
+ border-spacing: 0;
849
+ border-collapse: collapse;
850
+ border-color: #E5E5E5;
851
+ line-height: 18px;
852
+
853
+ &-col {
854
+ height: 40px;
855
+ }
856
+
857
+ &-row {
858
+ .textarea {
859
+ .ivu-input {
860
+ min-height: 18px;
861
+ padding: 0px;
862
+ border: none;
863
+ background-color: transparent;
864
+ box-shadow: none;
865
+ line-height: 18px;
866
+ }
867
+ }
868
+ }
869
+
870
+ .th-tree,
871
+ .td-tree {
872
+ position: relative;
873
+
874
+ &-dropdown {
875
+ position: absolute;
876
+ right: 0px;
877
+ bottom: 0px;
878
+ display: none;
879
+ z-index: 2;
880
+ text-align: left;
881
+
882
+ &-list {
883
+ min-width: 120px;
884
+ margin: 0px;
885
+
886
+ li {
887
+ padding-left: 15px !important;
888
+ }
889
+ }
890
+ }
891
+
892
+ &:hover {
893
+ .th-tree-dropdown,
894
+ .td-tree-dropdown {
895
+ display: inline-block;
896
+ }
897
+ }
898
+ }
899
+
900
+ // 表头
901
+ .th-tree {
902
+ // .dsh-ellipsis2();
903
+ // line-height: 16px;
904
+ // display: table-cell;
905
+
906
+ &-name {
907
+ position: relative;
908
+
909
+ &-icon {
910
+ position: absolute;
911
+ top: 0px;
912
+ left: -10px;
913
+ color: red;
914
+ }
915
+ }
916
+ }
917
+
918
+ &-nodata {
919
+ height: 30px;
920
+ text-align: center;
921
+ }
922
+ }
923
+ }
924
+ }
925
+ }
926
+ </style>
@@ -8,7 +8,6 @@
8
8
  @import "./list/DshPage.less";
9
9
 
10
10
  @import "./list/BriFlatTable.less"; // 不能注释flatTable在用
11
- @import "./list/DshCascaderTable.less"; // 不能注释cascaderTable在用
12
11
  @import "./list/BriCard.less";
13
12
  @import "./list/BriTree.less";
14
13
  @import "./list/BriTreeItem.less";
@@ -1,110 +0,0 @@
1
- .DshCascaderTable {
2
- width: 100%;
3
-
4
- &-wrap {
5
- width: 100%;
6
-
7
- &-center {
8
- width: 100%;
9
- height: 100%;
10
- max-height: 600px;
11
- margin-left: 0px;
12
- margin-right: 0px;
13
- position: relative;
14
- display: flex;
15
-
16
- &-top {
17
- width: 100%;
18
- height: 40px;
19
- overflow: hidden;
20
- position: absolute;
21
- top: 0px;
22
- left: 0px;
23
- z-index: 99;
24
-
25
- &-inner {
26
- display: block;
27
- float: left;
28
- width: 10000px;
29
-
30
- .table {
31
- background-color: #f0f0f0;
32
- }
33
- }
34
- }
35
-
36
- &-list {
37
- width: 100%;
38
- flex: 1;
39
- min-height: 0px;
40
- margin-top: 40px;
41
- overflow: auto;
42
-
43
- &-inner {}
44
- }
45
-
46
- .table {
47
- border-spacing: 0;
48
- border-collapse: collapse;
49
- border-color: #E5E5E5;
50
- line-height: 16px;
51
-
52
- &-col {
53
- height: 40px;
54
- }
55
-
56
- &-row {
57
- .textarea {
58
- .ivu-input {
59
- border: none;
60
- box-shadow: none;
61
- background-color: transparent;
62
- min-height: 16px;
63
- padding: 0px;
64
- line-height: 16px;
65
- font-size: 12px;
66
- }
67
- }
68
- }
69
-
70
- &-nodata {
71
- height: 30px;
72
- text-align: center;
73
- }
74
-
75
- .td-tree {
76
- position: relative;
77
- overflow: hidden;
78
- word-break: keep-all;
79
- white-space: nowrap;
80
- text-overflow: ellipsis;
81
-
82
- &-dropdown {
83
- display: none;
84
- position: absolute;
85
- right: 0px;
86
- bottom: 0px;
87
- z-index: 2;
88
- text-align: left;
89
-
90
- &-list {
91
- min-width: 120px;
92
- margin: 0px;
93
-
94
- li {
95
- padding-left: 15px !important;
96
- }
97
- }
98
- }
99
-
100
- &:hover {
101
- .td-tree-dropdown {
102
- display: inline-block;
103
- }
104
- }
105
- }
106
- }
107
- }
108
- }
109
- }
110
-