bri-components 1.3.26 → 1.3.28
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 +1 -1
- package/src/components/controls/base/BriUpload/BriUpload.vue +10 -10
- package/src/components/controls/base/BriUpload/uploadList.vue +3 -3
- package/src/components/controls/base/DshCascader/DshCascader.vue +2 -2
- package/src/components/controls/base/DshCascader/components/cascaderModal.vue +3 -3
- package/src/components/controls/base/DshCascader/components/cascaderPicker.vue +4 -4
- package/src/components/controls/base/DshCoordinates.vue +10 -9
- package/src/components/controls/base/DshNumber/DshNumber.vue +2 -2
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +1 -1
- package/src/components/controls/base/DshSelect/DshSelect.vue +2 -2
- package/src/components/controls/mixins/cascaderMixin.js +1 -1
- package/src/components/controls/mixins/cascaderPickerMixin.js +2 -2
- package/src/components/controls/mixins/controlMixin.js +1 -1
- package/src/components/controls/mixins/selectMixin.js +1 -1
- package/src/components/controls/senior/cascaderTable.vue +14 -12
- package/src/components/controls/senior/selectDepartments.vue +18 -1
- package/src/components/controls/senior/selectUsers/selectUsers.vue +19 -4
- package/src/components/list/DshBox/DshCrossTable.vue +11 -2
- package/src/components/list/DshCascaderTable.vue +42 -96
- package/src/components/list/DshFlatTable.vue +5 -8
- package/src/components/list/DshTreeTable.vue +203 -40
- package/src/components/list/mixins/{tableMixin.js → flatTableMixin.js} +81 -27
- package/src/components/list/mixins/{DshFlatTableMixin.js → tableBaseMixin.js} +28 -82
- package/src/styles/components/list/BriTable.less +41 -31
- package/src/styles/global/text.less +0 -3
- package/src/styles/reset-iview-other.less +0 -4
- package/src/utils/table.js +6 -5
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
'BriUpload-disabled': canEdit && !finalCanEdit,
|
|
16
16
|
'BriUpload-readonly': !canEdit,
|
|
17
17
|
'BriUpload-unit': !canEdit && isInTable,
|
|
18
|
-
[`BriUpload-${
|
|
18
|
+
[`BriUpload-${showMode}`]: true,
|
|
19
19
|
}"
|
|
20
20
|
>
|
|
21
21
|
<!-- 编辑 -->
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
>
|
|
41
41
|
|
|
42
42
|
<slot>
|
|
43
|
-
<div :class="`BriUpload-${
|
|
43
|
+
<div :class="`BriUpload-${showMode}-add`">
|
|
44
44
|
<!-- 上传 -->
|
|
45
45
|
<i-circle
|
|
46
46
|
v-if="percent"
|
|
47
|
-
:class="`BriUpload-${
|
|
47
|
+
:class="`BriUpload-${showMode}-circle`"
|
|
48
48
|
:percent="percent"
|
|
49
49
|
:stroke-color="percentColor"
|
|
50
50
|
>
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
type="ios-checkmark"
|
|
55
55
|
></Icon>
|
|
56
56
|
<!-- 上传中 -->
|
|
57
|
-
<span v-else-if="
|
|
57
|
+
<span v-else-if="showMode === 'old'">
|
|
58
58
|
{{ percent }}%
|
|
59
59
|
</span>
|
|
60
60
|
</i-circle>
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
@click="clickUpload"
|
|
67
67
|
></dsh-icons>
|
|
68
68
|
|
|
69
|
-
<span v-if="
|
|
69
|
+
<span v-if="showMode !== 'inline'">
|
|
70
70
|
点击上传{{ subType === 'image' ? "图片" : "文件" }}
|
|
71
71
|
</span>
|
|
72
72
|
</template>
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
:canEdit="finalCanEdit"
|
|
81
81
|
:files="curValList"
|
|
82
82
|
:emptyShowVal="emptyShowVal"
|
|
83
|
-
:
|
|
83
|
+
:showMode="showMode"
|
|
84
84
|
:propsObj="propsObj"
|
|
85
85
|
@deleteItem="clickDeteItem"
|
|
86
86
|
></upload-list>
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
selfPropsObj () {
|
|
139
139
|
return {
|
|
140
140
|
_fileType: "file",
|
|
141
|
-
|
|
141
|
+
_showMode: this.isHeightAuto ? "old" : "inline", // 宽度为100%、且不在级联表格或内部表格里的 显示老版
|
|
142
142
|
// _multiple: true,
|
|
143
143
|
_useType: "drag",
|
|
144
144
|
_maxSize: 1024 * 1024,
|
|
@@ -153,8 +153,8 @@
|
|
|
153
153
|
subType () {
|
|
154
154
|
return this.selfPropsObj._fileType;
|
|
155
155
|
},
|
|
156
|
-
|
|
157
|
-
return this.isInTable ? "inline" : this.selfPropsObj.
|
|
156
|
+
showMode () {
|
|
157
|
+
return this.isInTable ? "inline" : this.selfPropsObj._showMode;
|
|
158
158
|
},
|
|
159
159
|
useType () {
|
|
160
160
|
return this.selfPropsObj._useType;
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
[`${prefixCls}-select`]: this.useType === "select",
|
|
179
179
|
[`${prefixCls}-drag`]: this.useType === "drag",
|
|
180
180
|
[`${prefixCls}-dragOver`]: this.useType === "drag" && this.dragOver,
|
|
181
|
-
[`BriUpload-${this.
|
|
181
|
+
[`BriUpload-${this.showMode}-wrapper`]: true
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="uploadList"
|
|
4
|
-
:class="`uploadList-${
|
|
4
|
+
:class="`uploadList-${showMode}`"
|
|
5
5
|
>
|
|
6
6
|
<!-- 普通文本模式 -->
|
|
7
|
-
<template v-if="
|
|
7
|
+
<template v-if="showMode ==='old'">
|
|
8
8
|
<!-- 有值 -->
|
|
9
9
|
<div
|
|
10
10
|
v-if="files.length"
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
return [];
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
-
|
|
119
|
+
showMode: {
|
|
120
120
|
type: String,
|
|
121
121
|
default: "old" // inline, old, normal
|
|
122
122
|
},
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
class="DshCascader"
|
|
6
6
|
>
|
|
7
7
|
<component
|
|
8
|
-
:is="showTypeMap[
|
|
8
|
+
:is="showTypeMap[showMode]"
|
|
9
9
|
v-model="showModal"
|
|
10
10
|
:activeValue="curValList"
|
|
11
11
|
:data="cascaderData"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
class="DshCascaders"
|
|
78
78
|
>
|
|
79
79
|
<component
|
|
80
|
-
:is="showTypeMap[
|
|
80
|
+
:is="showTypeMap[showMode]"
|
|
81
81
|
v-model="showModal"
|
|
82
82
|
:multipleMode="multipleMode"
|
|
83
83
|
:data="cascaderData"
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
<div
|
|
41
41
|
v-if="canUseModeSwitch"
|
|
42
42
|
class="mode"
|
|
43
|
-
@click="
|
|
43
|
+
@click="searchMode = searchMode === 'default' ? 'flat' : 'default'"
|
|
44
44
|
>
|
|
45
45
|
<dsh-icons :list="[{ icon: 'md-swap' }]" />
|
|
46
46
|
<span class="mode-name">
|
|
47
|
-
{{
|
|
47
|
+
{{ searchMode === "default" ? "按层级" : "按平级" }}
|
|
48
48
|
</span>
|
|
49
49
|
</div>
|
|
50
50
|
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
|
|
207
207
|
search () {
|
|
208
208
|
this.selectedValue = [];
|
|
209
|
-
this.
|
|
209
|
+
this.searchMode = "default";
|
|
210
210
|
},
|
|
211
211
|
clickItem (node) {
|
|
212
212
|
// 避免重复点击
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
<div
|
|
52
52
|
v-if="canUseModeSwitch"
|
|
53
53
|
class="mode"
|
|
54
|
-
@click="
|
|
54
|
+
@click="searchMode = searchMode === 'default' ? 'flat' : 'default'"
|
|
55
55
|
>
|
|
56
56
|
<dsh-icons :list="[{ icon: 'md-swap' }]" />
|
|
57
57
|
<span class="mode-name">
|
|
58
|
-
{{
|
|
58
|
+
{{ searchMode === "default" ? "按层级" : "按平级" }}
|
|
59
59
|
</span>
|
|
60
60
|
</div>
|
|
61
61
|
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
|
|
244
244
|
search () {
|
|
245
245
|
this.selectedValue = [];
|
|
246
|
-
this.
|
|
246
|
+
this.searchMode = "default";
|
|
247
247
|
this.curTabIndex = 0;
|
|
248
248
|
},
|
|
249
249
|
clickItem (node) {
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
// 区分展示方式
|
|
264
|
-
if (this.
|
|
264
|
+
if (this.searchMode === "default" && node.children.length) {
|
|
265
265
|
this.curTabIndex = this.curTabIndex + 1;
|
|
266
266
|
}
|
|
267
267
|
}
|
|
@@ -191,13 +191,14 @@
|
|
|
191
191
|
computed: {
|
|
192
192
|
selfPropsObj () {
|
|
193
193
|
return {
|
|
194
|
+
_showType: "marker", // "marker", "multipleMarker", "polyline", "polygon", "rectangle"
|
|
194
195
|
_icon: "ios-map-outline",
|
|
195
196
|
|
|
196
197
|
...this.propsObj,
|
|
197
198
|
...this.commonDealPropsObj
|
|
198
199
|
};
|
|
199
200
|
},
|
|
200
|
-
|
|
201
|
+
showMode () {
|
|
201
202
|
return this.selfPropsObj._showType;
|
|
202
203
|
},
|
|
203
204
|
|
|
@@ -323,7 +324,7 @@
|
|
|
323
324
|
if (!this.$isEmptyData(this.newVal)) {
|
|
324
325
|
this.handleAddMarker(this.newVal.lnglat, true);
|
|
325
326
|
|
|
326
|
-
if (this.
|
|
327
|
+
if (this.showMode === "multipleMarker") { // 多选打开绘图功能
|
|
327
328
|
this.finalCanEdit && this.handleOpenDraw();
|
|
328
329
|
}
|
|
329
330
|
} else {
|
|
@@ -332,10 +333,10 @@
|
|
|
332
333
|
},
|
|
333
334
|
handleMouseToolCallback (e) {
|
|
334
335
|
if (e.obj.CLASS_NAME === "AMap.Marker") {
|
|
335
|
-
if (this.
|
|
336
|
+
if (this.showMode === "marker") {
|
|
336
337
|
this.plot = e.obj;
|
|
337
338
|
this.handleCloseDraw();
|
|
338
|
-
} else if (this.
|
|
339
|
+
} else if (this.showMode === "multipleMarker") {
|
|
339
340
|
if (this.plot) {
|
|
340
341
|
this.plot.push(e.obj);
|
|
341
342
|
} else {
|
|
@@ -369,7 +370,7 @@
|
|
|
369
370
|
}
|
|
370
371
|
},
|
|
371
372
|
// 打开绘图
|
|
372
|
-
handleOpenDraw (type = this.
|
|
373
|
+
handleOpenDraw (type = this.showMode) {
|
|
373
374
|
switch (type) {
|
|
374
375
|
case "marker": {
|
|
375
376
|
this.mouseTool.marker(markerOpt);
|
|
@@ -402,7 +403,7 @@
|
|
|
402
403
|
this.mouseTool.close();
|
|
403
404
|
},
|
|
404
405
|
// 添加图形
|
|
405
|
-
handleAddMarker (location, centerView = true, type = this.
|
|
406
|
+
handleAddMarker (location, centerView = true, type = this.showMode) {
|
|
406
407
|
location = JSON.parse(JSON.stringify(location));
|
|
407
408
|
// 分类型添加
|
|
408
409
|
if (["polygon", "rectangle", "circle"].includes(type)) {
|
|
@@ -417,12 +418,12 @@
|
|
|
417
418
|
!this.marker && (this.marker = new AMap.Marker());
|
|
418
419
|
this.marker.setPosition(location);
|
|
419
420
|
this.marker.setMap(this.map);
|
|
420
|
-
if (this.
|
|
421
|
+
if (this.showMode === "marker") {
|
|
421
422
|
this.handleRmoveMarker();
|
|
422
423
|
this.handleCloseDraw();
|
|
423
424
|
this.newVal.lnglat = [location];
|
|
424
425
|
this.getRegeoCode();
|
|
425
|
-
} else if (this.
|
|
426
|
+
} else if (this.showMode === "multipleMarker") {
|
|
426
427
|
this.newVal.lnglat.push(location);
|
|
427
428
|
this.getRegeoCode();
|
|
428
429
|
}
|
|
@@ -445,7 +446,7 @@
|
|
|
445
446
|
}
|
|
446
447
|
},
|
|
447
448
|
// 移除图形
|
|
448
|
-
handleRmoveMarker (type = this.
|
|
449
|
+
handleRmoveMarker (type = this.showMode) {
|
|
449
450
|
if (["default"].includes(type)) {
|
|
450
451
|
this.marker && this.map.remove(this.marker);
|
|
451
452
|
this.plot && this.map.remove(this.plot);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
class="DshSelect"
|
|
6
6
|
>
|
|
7
7
|
<!-- flat方式 -->
|
|
8
|
-
<template v-if="['flat', 'button'].includes(
|
|
8
|
+
<template v-if="['flat', 'button'].includes(showMode)">
|
|
9
9
|
<!-- 有选项 -->
|
|
10
10
|
<template v-if="listData.length">
|
|
11
11
|
<RadioGroup
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
};
|
|
162
162
|
},
|
|
163
163
|
radioGroupType () {
|
|
164
|
-
return this.
|
|
164
|
+
return this.showMode === "button" ? "button" : undefined;
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
167
|
created () {},
|
|
@@ -33,7 +33,7 @@ export default {
|
|
|
33
33
|
data () {
|
|
34
34
|
return {
|
|
35
35
|
searchName: "",
|
|
36
|
-
|
|
36
|
+
searchMode: "default", // "flat", "default"
|
|
37
37
|
maxFlatModeSearchNum: 80,
|
|
38
38
|
|
|
39
39
|
inputStr: "",
|
|
@@ -102,7 +102,7 @@ export default {
|
|
|
102
102
|
useFlatMode () {
|
|
103
103
|
return this.filterable &&
|
|
104
104
|
this.canUseModeSwitch &&
|
|
105
|
-
this.
|
|
105
|
+
this.searchMode === "flat";
|
|
106
106
|
},
|
|
107
107
|
modeTip () {
|
|
108
108
|
return `在搜索时,会出现层级和平级切换开关,但搜索出的结果超${this.maxFlatModeSearchNum}个时,\
|
|
@@ -132,7 +132,7 @@ export default {
|
|
|
132
132
|
return {
|
|
133
133
|
// TODO: 此处的请输入可能还有请选择之类的,待处理
|
|
134
134
|
_placeholder: this.canEdit && this.propsObj._enterType !== "calculate"
|
|
135
|
-
? (this.propsObj._placeholder ||
|
|
135
|
+
? (this.propsObj._placeholder || `${selectControlTypes.includes(this.controlType) ? "选择" : "输入"}${this.propsObj._name}`)
|
|
136
136
|
: undefined,
|
|
137
137
|
_clearable: this.finalCanEdit && (this.propsObj._clearable === undefined ? true : this.propsObj._clearable),
|
|
138
138
|
_disabled: this.propsObj._disabled || ["serialNumber"].includes(this.controlType) || !this.finalCanEdit
|
|
@@ -32,9 +32,12 @@
|
|
|
32
32
|
v-else
|
|
33
33
|
:canEdit="finalCanEdit"
|
|
34
34
|
:data="curVal"
|
|
35
|
-
:treeColumns="
|
|
35
|
+
:treeColumns="treeForm"
|
|
36
36
|
:subColumns="subForm"
|
|
37
|
-
:propsObj="
|
|
37
|
+
:propsObj="{
|
|
38
|
+
...propsObj,
|
|
39
|
+
_useCol: false
|
|
40
|
+
}"
|
|
38
41
|
:parentFormList="allFormList"
|
|
39
42
|
:parentObj="value"
|
|
40
43
|
@change="change"
|
|
@@ -68,10 +71,9 @@
|
|
|
68
71
|
<dsh-cascader-table
|
|
69
72
|
v-else
|
|
70
73
|
ref="table"
|
|
71
|
-
useCol
|
|
72
74
|
:canEdit="finalCanEdit"
|
|
73
75
|
:data="curVal"
|
|
74
|
-
:treeColumns="
|
|
76
|
+
:treeColumns="treeForm"
|
|
75
77
|
:subColumns="subForm"
|
|
76
78
|
:propsObj="propsObj"
|
|
77
79
|
:parentFormList="allFormList"
|
|
@@ -100,10 +102,9 @@
|
|
|
100
102
|
></dsh-tree-table>
|
|
101
103
|
<dsh-cascader-table
|
|
102
104
|
v-else
|
|
103
|
-
useCol
|
|
104
105
|
:canEdit="finalCanEdit"
|
|
105
106
|
:data="curVal"
|
|
106
|
-
:treeColumns="
|
|
107
|
+
:treeColumns="treeForm"
|
|
107
108
|
:subColumns="subForm"
|
|
108
109
|
:propsObj="propsObj"
|
|
109
110
|
:parentFormList="allFormList"
|
|
@@ -175,17 +176,18 @@
|
|
|
175
176
|
subForm () {
|
|
176
177
|
return this.propsObj._subForm;
|
|
177
178
|
},
|
|
178
|
-
treeForm () {
|
|
179
|
-
return this.propsObj._treeForm;
|
|
180
|
-
},
|
|
181
179
|
// 用户态的每条数据的表头配置,都是存的自己的,不用通用配置_treeForm的
|
|
182
|
-
|
|
180
|
+
treeForm () {
|
|
183
181
|
return this.curVal && this.curVal._treeForm
|
|
184
182
|
? this.curVal._treeForm
|
|
185
|
-
: this.
|
|
183
|
+
: this.propsObj._treeForm;
|
|
184
|
+
},
|
|
185
|
+
isExport () {
|
|
186
|
+
return this.propsObj._isExport;
|
|
186
187
|
},
|
|
188
|
+
|
|
187
189
|
operationBtns () {
|
|
188
|
-
return this.
|
|
190
|
+
return this.isExport
|
|
189
191
|
? ["canExport", "canEnlarge"]
|
|
190
192
|
: ["canEnlarge"];
|
|
191
193
|
},
|
|
@@ -172,11 +172,21 @@
|
|
|
172
172
|
_highSearch: false,
|
|
173
173
|
_changeOnSelect: true,
|
|
174
174
|
_searchString: "",
|
|
175
|
+
_reverseFilter: false,
|
|
176
|
+
_userDepartFilterVals: [],
|
|
175
177
|
|
|
176
178
|
...this.propsObj,
|
|
177
179
|
...this.commonDealPropsObj
|
|
178
180
|
};
|
|
179
181
|
},
|
|
182
|
+
// 反向过滤
|
|
183
|
+
reverseFilter () {
|
|
184
|
+
return this.selfPropsObj._reverseFilter;
|
|
185
|
+
},
|
|
186
|
+
// 禁止显示的部门以及部门下人员
|
|
187
|
+
listFilterVals () {
|
|
188
|
+
return this.selfPropsObj._userDepartFilterVals;
|
|
189
|
+
},
|
|
180
190
|
highSearch () {
|
|
181
191
|
return this.isOnSearch ? true : this.selfPropsObj._highSearch;
|
|
182
192
|
},
|
|
@@ -295,7 +305,14 @@
|
|
|
295
305
|
},
|
|
296
306
|
callback: data => {
|
|
297
307
|
this.loading = false;
|
|
298
|
-
this.departmentList =
|
|
308
|
+
this.departmentList = this.listFilterVals.length
|
|
309
|
+
? data.list.filter(
|
|
310
|
+
item =>
|
|
311
|
+
this.reverseFilter
|
|
312
|
+
? !this.listFilterVals.includes(item._key)
|
|
313
|
+
: this.listFilterVals.includes(item._key)
|
|
314
|
+
)
|
|
315
|
+
: data.list;
|
|
299
316
|
}
|
|
300
317
|
});
|
|
301
318
|
}
|
|
@@ -337,7 +337,6 @@
|
|
|
337
337
|
};
|
|
338
338
|
this.curDepartment = {};
|
|
339
339
|
this.pagePropsObj.page = 1;
|
|
340
|
-
this.getUserListData();
|
|
341
340
|
this.getDepartmentListData();
|
|
342
341
|
},
|
|
343
342
|
search () {
|
|
@@ -421,11 +420,11 @@
|
|
|
421
420
|
},
|
|
422
421
|
loadingName: "loading",
|
|
423
422
|
callback: data => {
|
|
424
|
-
this.userList = this.
|
|
423
|
+
this.userList = this.allListFilterVals.length
|
|
425
424
|
? data.list.filter(item =>
|
|
426
425
|
this.reverseFilter
|
|
427
|
-
? !this.
|
|
428
|
-
: this.
|
|
426
|
+
? !this.allListFilterVals.includes(item.departmentKey)
|
|
427
|
+
: this.allListFilterVals.includes(item.departmentKey)
|
|
429
428
|
)
|
|
430
429
|
: data.list;
|
|
431
430
|
this.total = data.total;
|
|
@@ -471,6 +470,10 @@
|
|
|
471
470
|
searchString: this.propsObj.searchString
|
|
472
471
|
},
|
|
473
472
|
callback: data => {
|
|
473
|
+
// 当前部门被过滤,所有子级部门同样过滤
|
|
474
|
+
const depts = data.list.filter(item => this.listFilterVals.includes(item._key));
|
|
475
|
+
this.allListFilterVals = this.getAllListFilterVals(depts).map(item => item._key);
|
|
476
|
+
|
|
474
477
|
this.departmentList = [
|
|
475
478
|
...(
|
|
476
479
|
this.highSearch
|
|
@@ -512,8 +515,20 @@
|
|
|
512
515
|
: data.list
|
|
513
516
|
)
|
|
514
517
|
];
|
|
518
|
+
|
|
519
|
+
this.getUserListData();
|
|
515
520
|
}
|
|
516
521
|
});
|
|
522
|
+
},
|
|
523
|
+
|
|
524
|
+
getAllListFilterVals (list) {
|
|
525
|
+
if (list.length) {
|
|
526
|
+
let stack = [...list];
|
|
527
|
+
return stack.reduce((prev, item) => {
|
|
528
|
+
return prev.concat(item.children && item.children.length ? this.getAllListFilterVals(item.children) : []);
|
|
529
|
+
}, stack);
|
|
530
|
+
}
|
|
531
|
+
return [];
|
|
517
532
|
}
|
|
518
533
|
},
|
|
519
534
|
filters: {
|
|
@@ -196,6 +196,7 @@
|
|
|
196
196
|
:key="dataItem._id"
|
|
197
197
|
class="DshCrossTable-td-checkbox"
|
|
198
198
|
:style="{
|
|
199
|
+
width: colWidth ? colWidth + 'px' : '200px',
|
|
199
200
|
background: '#f4f4f4',
|
|
200
201
|
textAlign: 'center'
|
|
201
202
|
}"
|
|
@@ -217,6 +218,7 @@
|
|
|
217
218
|
:key="dataItem._id"
|
|
218
219
|
class="DshCrossTable-td-index"
|
|
219
220
|
:style="{
|
|
221
|
+
width: colWidth ? colWidth + 'px' : '200px',
|
|
220
222
|
background: '#f4f4f4',
|
|
221
223
|
textAlign: 'center'
|
|
222
224
|
}"
|
|
@@ -232,6 +234,9 @@
|
|
|
232
234
|
<div
|
|
233
235
|
v-if="showTable"
|
|
234
236
|
class="DshCrossTable-right-body"
|
|
237
|
+
:style="showScrollX === false ? {
|
|
238
|
+
overflowX: 'hidden'
|
|
239
|
+
} : {}"
|
|
235
240
|
@scroll="tableScroll($event)"
|
|
236
241
|
>
|
|
237
242
|
<!-- 无数据 -->
|
|
@@ -333,6 +338,7 @@
|
|
|
333
338
|
:key="dataItem._id"
|
|
334
339
|
class="DshCrossTable-td-operation"
|
|
335
340
|
:style="{
|
|
341
|
+
width: colWidth ? colWidth + 'px' : '200px',
|
|
336
342
|
background: '#f4f4f4',
|
|
337
343
|
}"
|
|
338
344
|
>
|
|
@@ -403,6 +409,7 @@
|
|
|
403
409
|
rowWidth: 0,
|
|
404
410
|
colWidth: 0,
|
|
405
411
|
titleWidth: 200,
|
|
412
|
+
showScrollX: false,
|
|
406
413
|
showTable: false,
|
|
407
414
|
currentPage: 1,
|
|
408
415
|
pagesize: 10,
|
|
@@ -557,14 +564,16 @@
|
|
|
557
564
|
let that = this;
|
|
558
565
|
erd.listenTo(document.getElementById("DshCrossTable-right"), function (element) {
|
|
559
566
|
// 计算宽度
|
|
560
|
-
let tableWidth = that.$refs["DshCrossTable-right"].clientWidth;
|
|
567
|
+
let tableWidth = that.$refs["DshCrossTable-right"].clientWidth - 10;
|
|
561
568
|
let nums = tableWidth / 200;
|
|
562
569
|
let dataTotal = that.data.length;
|
|
563
570
|
if (nums >= dataTotal) {
|
|
564
571
|
that.rowWidth = tableWidth;
|
|
565
|
-
that.colWidth =
|
|
572
|
+
that.colWidth = tableWidth / dataTotal;
|
|
573
|
+
that.showScrollX = false;
|
|
566
574
|
} else {
|
|
567
575
|
that.rowWidth = dataTotal * 200;
|
|
576
|
+
that.showScrollX = true;
|
|
568
577
|
}
|
|
569
578
|
|
|
570
579
|
// that.rowWidth = 200 * that.data.length;
|