bri-components 1.2.69 → 1.2.71

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.71",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -30,7 +30,7 @@
30
30
  >
31
31
  <!-- 有值 -->
32
32
  <template v-if="!$isEmptyData(curValList)">
33
- <!-- 详情页查看 且单独占一行高度自由时 -->
33
+ <!-- 高度自由时 单元格-级联表格内,详情页-独占一行宽度时 -->
34
34
  <div
35
35
  v-if="isHeightAuto"
36
36
  :class="{
@@ -103,7 +103,7 @@
103
103
  >
104
104
  <!-- 有值 -->
105
105
  <template v-if="!$isEmptyData(curValList)">
106
- <!-- 详情页查看 且单独占一行高度自由时 -->
106
+ <!-- 高度自由时 单元格-级联表格内,详情页-独占一行宽度时 -->
107
107
  <dsh-tags
108
108
  v-if="isHeightAuto"
109
109
  :class="{
@@ -194,7 +194,7 @@
194
194
 
195
195
  #show {
196
196
  white-space: pre-wrap;
197
- word-break: break-word;
197
+ word-break: break-all;
198
198
 
199
199
  p {
200
200
  font-size: 14px !important;
@@ -38,18 +38,37 @@
38
38
  </div>
39
39
 
40
40
  <!-- 单选模式 查看 -->
41
- <div v-else-if="!multipleMode && !canEdit">
41
+ <div
42
+ v-else-if="!multipleMode && !canEdit"
43
+ class="DshInput-show"
44
+ >
42
45
  <!-- 有值 -->
43
46
  <template v-if="!$isEmptyData(curVal)">
44
- <!-- 详情页查看 且单独占一行高度自由时 -->
45
- <div
46
- v-if="isHeightAuto"
47
- :class="{
48
- ...commonClass,
49
- 'DshInput-show-auto': true
50
- }"
51
- v-html="showVal"
52
- ></div>
47
+ <!-- 高度自由时 单元格-级联表格内,详情页-独占一行宽度时 -->
48
+ <template v-if="isHeightAuto">
49
+ <a
50
+ v-if="inputType === 'url'"
51
+ :class="{
52
+ ...commonClass2,
53
+ 'DshInput-show-auto': true,
54
+ 'DshInput-show-auto-url': true
55
+ }"
56
+ @click="goHttpWindow($event)"
57
+ >
58
+ {{ showVal }}
59
+ </a>
60
+
61
+ <div
62
+ v-else
63
+ :class="{
64
+ ...commonClass2,
65
+ 'DshInput-show-auto': true,
66
+ 'DshInput-show-auto-detail': isDetailShow,
67
+ 'DshInput-show-auto-text': ['text', 'textarea'].includes(inputType)
68
+ }"
69
+ v-html="showVal"
70
+ ></div>
71
+ </template>
53
72
 
54
73
  <!-- 表格和查看页 里的查看 -->
55
74
  <bri-tooltip
@@ -61,7 +80,7 @@
61
80
  <a
62
81
  v-if="inputType === 'url'"
63
82
  :class="{
64
- ...commonClass,
83
+ ...commonClass2,
65
84
  'DshInput-show-ellipsis': true,
66
85
  'DshInput-show-ellipsis-url': true
67
86
  }"
@@ -73,7 +92,7 @@
73
92
  <div
74
93
  v-else
75
94
  :class="{
76
- ...commonClass,
95
+ ...commonClass2,
77
96
  'DshInput-show-ellipsis': true
78
97
  }"
79
98
  >
@@ -85,7 +104,7 @@
85
104
  <!-- 无值 -->
86
105
  <div
87
106
  v-else
88
- :class="commonClass"
107
+ :class="commonClass2"
89
108
  >
90
109
  {{ emptyShowVal }}
91
110
  </div>
@@ -197,13 +216,21 @@
197
216
 
198
217
  .DshInput {
199
218
  #control-show();
200
- width: 100%;
201
219
 
202
220
  &-show {
203
221
  &-auto {
204
- white-space: pre-wrap!important;
205
- max-height: 500px;
206
- overflow: auto;
222
+ &-detail {
223
+ max-height: 500px;
224
+ overflow: auto;
225
+ }
226
+
227
+ &-text {
228
+ white-space: pre-wrap!important;
229
+ }
230
+
231
+ &-url {
232
+ color: @themeColor!important;
233
+ }
207
234
  }
208
235
 
209
236
  &-ellipsis {
@@ -79,7 +79,7 @@
79
79
  >
80
80
  <!-- 有值 -->
81
81
  <template v-if="!$isEmptyData(curValList)">
82
- <!-- 详情页查看 且单独占一行高度自由时 -->
82
+ <!-- 高度自由时 单元格-级联表格内,详情页-独占一行宽度时 -->
83
83
  <dsh-tags
84
84
  v-if="isHeightAuto"
85
85
  :class="{
@@ -85,7 +85,7 @@
85
85
  >
86
86
  <!-- 有值 -->
87
87
  <template v-if="!$isEmptyData(curVal)">
88
- <!-- 详情页查看 且单独占一行高度自由时 -->
88
+ <!-- 高度自由时 单元格-级联表格内,详情页-独占一行宽度时 -->
89
89
  <dsh-tags
90
90
  v-if="isHeightAuto"
91
91
  :class="{
@@ -30,7 +30,7 @@
30
30
  >
31
31
  <!-- 有值 -->
32
32
  <template v-if="!$isEmptyData(curVal)">
33
- <!-- 详情页查看 且单独占一行高度自由时 -->
33
+ <!-- 高度自由时 单元格-级联表格内,详情页-独占一行宽度时 -->
34
34
  <dsh-tags
35
35
  v-if="isHeightAuto"
36
36
  :class="{
@@ -3,8 +3,8 @@
3
3
  &-show {
4
4
  &-auto {
5
5
  white-space: normal!important;
6
- word-break: normal!important;
7
- text-overflow: auto!important;
6
+ word-break: break-all!important;
7
+ text-overflow: clip!important;
8
8
 
9
9
  &-tag {
10
10
  height: auto!important;
@@ -205,7 +205,7 @@ export default {
205
205
  },
206
206
  // 每项的颜色相关style --flat方式在用
207
207
  getItemColorStyle (item) {
208
- const color = this.colorMap[item.color] || this.colorMap["color-1"];
208
+ const color = this.colorMap[item.color] || this.colorMap["color-default"];
209
209
  return this.useColor
210
210
  ? {
211
211
  backgroundColor: this.$getColor(color, 0.1),
@@ -132,39 +132,38 @@ export default {
132
132
  "bri-control-disabled": this.canEdit && !this.finalCanEdit,
133
133
  "bri-control-unit": this.isUnitShow,
134
134
  "bri-control-show": this.isDetailShow,
135
-
136
135
  "dsh-ellipsis": this.isUnitShow,
137
136
  "bri-control-nodata": this.$isEmptyData(this.curVal)
138
137
  };
139
138
  },
139
+ commonClass2 () {
140
+ return {
141
+ "bri-control-edit": this.canEdit && this.finalCanEdit,
142
+ "bri-control-disabled": this.canEdit && !this.finalCanEdit,
143
+ "bri-control-unit": this.isUnitShow,
144
+ "bri-control-show": this.isDetailShow,
145
+ "bri-control-nodata": this.$isEmptyData(this.curVal)
146
+ };
147
+ },
148
+ clearable () {
149
+ return this.commonDealPropsObj._clearable;
150
+ },
140
151
  // 单独一行
141
152
  isFullRow () {
142
153
  return this.propsObj._span === 24 || !this.propsObj._span;
143
154
  },
144
- // 控件内容高度 自由
155
+ // 控件内容的高度自由(在表格内且_heightAuto为true,2.详情页内且独占一行)
145
156
  isHeightAuto () {
146
157
  return this.isInTable
147
- ? false
148
- // ? this.isUnitShow
158
+ ? !!this.propsObj._heightAuto
149
159
  : this.isFullRow;
150
160
  },
151
- clearable () {
152
- return this.commonDealPropsObj._clearable;
153
- },
154
- // showAlign () {
155
- // return !this.isUnitShow
156
- // ? "flex-start"
157
- // : this.propsObj._align === "right"
158
- // ? "flex-end"
159
- // : this.propsObj._align === "center"
160
- // ? "center"
161
- // : "flex-start";
162
- // },
163
161
 
164
162
  /* 部分条件下 才使用的属性 */
165
163
  // isShare () {
166
164
  // return !!this.propsObj.isShare;
167
165
  // },
166
+ // 单元格状态
168
167
  isInTable () {
169
168
  return !!this.propsObj.isInTable;
170
169
  },
@@ -188,6 +187,15 @@ export default {
188
187
  isDetailShow () {
189
188
  return !this.isInTable && !this.canEdit;
190
189
  },
190
+ // showAlign () {
191
+ // return !this.isUnitShow
192
+ // ? "flex-start"
193
+ // : this.propsObj._align === "right"
194
+ // ? "flex-end"
195
+ // : this.propsObj._align === "center"
196
+ // ? "center"
197
+ // : "flex-start";
198
+ // },
191
199
 
192
200
  /* 部分控件下 才使用的属性 */
193
201
  compKey () {
@@ -158,14 +158,14 @@ export default {
158
158
  getItemClass (item) {
159
159
  return [
160
160
  this.useColor
161
- ? this.colorMap[item.color] ? item.color : "color-1"
161
+ ? this.colorMap[item.color] ? item.color : "color-default"
162
162
  : undefined,
163
163
  item.class
164
164
  ];
165
165
  },
166
166
  // 获取某项的颜色相关style --flat方式在用
167
167
  getItemColorStyle (item) {
168
- const color = this.colorMap[item.color] || this.colorMap["color-1"];
168
+ const color = this.colorMap[item.color] || this.colorMap["color-default"];
169
169
  return this.useColor
170
170
  ? {
171
171
  backgroundColor: this.$getColor(color, 0.1),
@@ -355,7 +355,7 @@
355
355
  props: {
356
356
  dropdownObj: {
357
357
  icon: "md-arrow-dropdown-circle",
358
- color: this.colorMap[data.color] || this.colorMap["color-1"]
358
+ color: this.colorMap[data.color] || this.colorMap["color-default"]
359
359
  },
360
360
  menuClass: "BriTree-dropdown-menu",
361
361
  list: this.colorArr
@@ -52,8 +52,8 @@
52
52
  <!-- 表头s -->
53
53
  <div class="DshCrossTable-left-body">
54
54
  <div :style="{
55
- height: '10000px'
56
- }">
55
+ height: '10000px'
56
+ }">
57
57
  <table
58
58
  cellspacing="0"
59
59
  cellpadding="0"
@@ -96,9 +96,9 @@
96
96
  }"
97
97
  >
98
98
  <bri-tooltip
99
- transfer
100
- :content="colItem.title"
101
99
  style="width: calc(100% - 16px)"
100
+ :content="colItem.title"
101
+ transfer
102
102
  >
103
103
  <div class="td-content dsh-ellipsis">
104
104
  <slot
@@ -119,13 +119,14 @@
119
119
  </slot>
120
120
  </div>
121
121
  </bri-tooltip>
122
+
122
123
  <Tooltip
123
- style="width:16px"
124
124
  v-if="colItem._comment"
125
+ style="width:16px"
125
126
  :content="colItem._comment"
126
- :transfer="true"
127
127
  placement="top-start"
128
128
  max-width="200"
129
+ :transfer="true"
129
130
  >
130
131
  <Icon
131
132
  type="ios-help-circle-outline"
@@ -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
  <!-- 操作下拉 -->
@@ -153,7 +149,10 @@
153
149
  :canEdit="canEdit"
154
150
  :rowIndex="rowIndex"
155
151
  :formData="row[col.nodeKey]"
156
- :formItem="col"
152
+ :formItem="{
153
+ ...col,
154
+ _heightAuto: true
155
+ }"
157
156
  @change="$dispatchEvent(operationMap.changeVal, col, row, arguments)"
158
157
  ></dsh-list-unit>
159
158
  </td>
@@ -360,46 +359,6 @@
360
359
  this.disabledBtns ? ["changeVal"] : undefined
361
360
  )
362
361
  : {};
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
362
  }
404
363
  },
405
364
  created () {
@@ -779,6 +738,36 @@
779
738
  : "未选择算法";
780
739
  }
781
740
  },
741
+ getThStyle (col) {
742
+ const boxColWidth = this.boxWidth / this.columns.length;
743
+ const defaultWidth = Math.max(boxColWidth, this.widthMap[col._type], (col._name ? col._name.length * 14 : 36) + (col._type === "reference" ? 200 : 26));
744
+ const width = col._width || defaultWidth;
745
+
746
+ const selfStyle = col.colType === "tree"
747
+ ? {
748
+ backgroundColor: "f0f0f0",
749
+ textAlign: col._align || "left",
750
+ fontSize: "14px"
751
+ }
752
+ : col.colType === "summary"
753
+ ? {
754
+ backgroundColor: "#eeeeee",
755
+ textAlign: "right"
756
+ }
757
+ : {
758
+ textAlign: col._align || "left"
759
+ };
760
+
761
+ return {
762
+ width: `${width}px`,
763
+ minWidth: `${width}px`,
764
+ maxWidth: `${width}px`,
765
+ padding: "5px 12px",
766
+ "word-break": "break-all",
767
+ cursor: "pointer",
768
+ ...selfStyle
769
+ };
770
+ },
782
771
  getTdStyle (col, row) {
783
772
  return {
784
773
  ...this.getThStyle(col),
@@ -811,3 +800,130 @@
811
800
  }
812
801
  };
813
802
  </script>
803
+
804
+ <style lang="less">
805
+ .DshCascaderTable {
806
+ width: 100%;
807
+
808
+ &-wrap {
809
+ width: 100%;
810
+
811
+ &-center {
812
+ width: 100%;
813
+ height: 100%;
814
+ max-height: 600px;
815
+ margin-left: 0px;
816
+ margin-right: 0px;
817
+ position: relative;
818
+ display: flex;
819
+
820
+ &-top {
821
+ width: 100%;
822
+ height: 40px;
823
+ overflow: hidden;
824
+ position: absolute;
825
+ top: 0px;
826
+ left: 0px;
827
+ z-index: 99;
828
+
829
+ &-inner {
830
+ display: block;
831
+ float: left;
832
+ width: 10000px;
833
+
834
+ .table {
835
+ background-color: #f0f0f0;
836
+ }
837
+ }
838
+ }
839
+
840
+ &-list {
841
+ width: 100%;
842
+ flex: 1;
843
+ min-height: 0px;
844
+ margin-top: 40px;
845
+ overflow: auto;
846
+
847
+ &-inner {}
848
+ }
849
+
850
+ .table {
851
+ border-spacing: 0;
852
+ border-collapse: collapse;
853
+ border-color: #E5E5E5;
854
+ line-height: 18px;
855
+
856
+ &-col {
857
+ height: 40px;
858
+ }
859
+
860
+ &-row {
861
+ .textarea {
862
+ .ivu-input {
863
+ min-height: 18px;
864
+ padding: 0px;
865
+ border: none;
866
+ background-color: transparent;
867
+ box-shadow: none;
868
+ line-height: 18px;
869
+ }
870
+ }
871
+ }
872
+
873
+ .th-tree,
874
+ .td-tree {
875
+ position: relative;
876
+
877
+ &-dropdown {
878
+ position: absolute;
879
+ right: 0px;
880
+ bottom: 0px;
881
+ display: none;
882
+ z-index: 2;
883
+ text-align: left;
884
+
885
+ &-list {
886
+ min-width: 120px;
887
+ margin: 0px;
888
+
889
+ li {
890
+ padding-left: 15px !important;
891
+ }
892
+ }
893
+ }
894
+
895
+ &:hover {
896
+ .th-tree-dropdown,
897
+ .td-tree-dropdown {
898
+ display: inline-block;
899
+ }
900
+ }
901
+ }
902
+
903
+ // 表头
904
+ .th-tree {
905
+ // .dsh-ellipsis2();
906
+ // line-height: 16px;
907
+ // display: table-cell;
908
+
909
+ &-name {
910
+ position: relative;
911
+
912
+ &-icon {
913
+ position: absolute;
914
+ top: 0px;
915
+ left: -10px;
916
+ color: red;
917
+ }
918
+ }
919
+ }
920
+
921
+ &-nodata {
922
+ height: 30px;
923
+ text-align: center;
924
+ }
925
+ }
926
+ }
927
+ }
928
+ }
929
+ </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";
package/src/.DS_Store DELETED
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -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
-