bri-components 1.4.43 → 1.4.45
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/lib/0.bri-components.min.js +1 -1
- package/lib/1.bri-components.min.js +1 -1
- package/lib/10.bri-components.min.js +1 -1
- package/lib/2.bri-components.min.js +1 -1
- package/lib/3.bri-components.min.js +1 -1
- package/lib/4.bri-components.min.js +1 -1
- package/lib/5.bri-components.min.js +1 -1
- package/lib/6.bri-components.min.js +1 -1
- package/lib/7.bri-components.min.js +1 -1
- package/lib/8.bri-components.min.js +1 -1
- package/lib/9.bri-components.min.js +1 -1
- package/lib/bri-components.min.js +4 -76
- package/package.json +1 -1
- package/src/components/controls/base/BriUpload/BriUpload.vue +6 -5
- package/src/components/controls/base/DshDate/DshDaterange.vue +57 -25
- package/src/components/controls/base/DshInput/DshInput.vue +1 -1
- package/src/components/controls/base/DshNumber/DshNumber.vue +4 -6
- package/src/components/controls/mixins/userAndDepartMixin.js +3 -3
- package/src/components/controls/senior/selectDepartments.vue +13 -12
- package/src/components/controls/senior/selectUsers/selectUsers.vue +7 -7
- package/src/components/list/BriCard.vue +43 -0
- package/src/components/list/BriTree.vue +59 -1
- package/src/components/list/BriTreeItem.vue +53 -0
- package/src/components/list/DshFlatTable.vue +136 -61
- package/src/components/list/DshPage.vue +95 -0
- package/src/components/list/mixins/DshCascaderTableMixin.js +4 -0
- package/src/components/list/mixins/DshFlatTableMixin.js +87 -12
- package/src/components/list/mixins/tableBaseMixin.js +23 -18
- package/src/components/other/BriAvatar.vue +77 -12
- package/src/components/other/BriCode.vue +9 -2
- package/src/components/other/BriCollapseTree.vue +97 -2
- package/src/components/other/BriGantt.vue +319 -6
- package/src/components/other/BriIframe.vue +20 -0
- package/src/components/other/BriLoading.vue +61 -2
- package/src/components/other/DshColorPanel.vue +43 -0
- package/src/components/other/DshMenuNav.vue +84 -0
- package/src/components/small/BriDrawer.vue +43 -8
- package/src/components/small/DshBtnModal.vue +6 -0
- package/src/components/small/DshButtons.vue +34 -0
- package/src/components/small/DshIcons.vue +10 -0
- package/src/components/small/DshSteps.vue +61 -0
- package/src/components/small/DshTitle.vue +14 -0
- package/src/styles/components/index.less +3 -29
- package/src/styles/reset-iview-other.less +4 -0
- package/src/styles/components/list/BriCard.less +0 -40
- package/src/styles/components/list/BriTree.less +0 -56
- package/src/styles/components/list/BriTreeItem.less +0 -50
- package/src/styles/components/list/DshPage.less +0 -92
- package/src/styles/components/other/BriAvatar.less +0 -64
- package/src/styles/components/other/BriCode.less +0 -5
- package/src/styles/components/other/BriCollapseTree.less +0 -91
- package/src/styles/components/other/BriGantt.less +0 -313
- package/src/styles/components/other/BriIframe.less +0 -17
- package/src/styles/components/other/BriLoading.less +0 -57
- package/src/styles/components/other/DshColorPanel.less +0 -40
- package/src/styles/components/other/DshMenuNav.less +0 -82
- package/src/styles/components/small/BriDrawer.less +0 -34
- package/src/styles/components/small/DshBtnModal.less +0 -3
- package/src/styles/components/small/DshButtons.less +0 -31
- package/src/styles/components/small/DshIcons.less +0 -7
- package/src/styles/components/small/DshSteps.less +0 -58
- package/src/styles/components/small/DshTitle.less +0 -15
- /package/src/styles/components/{small/BriButton.less → BriButton.less} +0 -0
- /package/src/styles/components/{list/BriTable.less → BriTable.less} +0 -0
- /package/src/styles/components/{small/DshModal.less → DshModal.less} +0 -0
|
@@ -9,73 +9,103 @@
|
|
|
9
9
|
:render="topSearchRender"
|
|
10
10
|
></dsh-render>
|
|
11
11
|
|
|
12
|
-
<!--
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
class="DshFlatTable-form"
|
|
16
|
-
>
|
|
12
|
+
<!-- 内容 -->
|
|
13
|
+
<template>
|
|
14
|
+
<!-- 表单展示模式 -->
|
|
17
15
|
<div
|
|
18
|
-
v-
|
|
19
|
-
|
|
20
|
-
class="item"
|
|
16
|
+
v-if="showMode === 'form'"
|
|
17
|
+
class="DshFlatTable-form"
|
|
21
18
|
>
|
|
22
|
-
<div
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
<div
|
|
20
|
+
v-for="(row, rowIndex) in curPageListData"
|
|
21
|
+
:key="row._id"
|
|
22
|
+
class="item"
|
|
23
|
+
>
|
|
24
|
+
<div class="item-index">
|
|
25
|
+
<p>第{{ rowIndex + 1 }}条</p>
|
|
26
|
+
<span></span>
|
|
27
|
+
</div>
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
<dsh-form
|
|
30
|
+
class="item-form"
|
|
31
|
+
:canEdit="getRowCanEdit(row, rowIndex)"
|
|
32
|
+
:formData="row"
|
|
33
|
+
:formList="getRowFormList(row, rowIndex)"
|
|
34
|
+
:allFormList="getRowFormList(row, rowIndex)"
|
|
35
|
+
:inTableType="inTableType"
|
|
36
|
+
:allListRows="allListData"
|
|
37
|
+
:rowIndex="rowIndex"
|
|
38
|
+
:parentFormList="allFormList"
|
|
39
|
+
:parentObj="parentObj"
|
|
40
|
+
></dsh-form>
|
|
41
|
+
|
|
42
|
+
<dsh-icons
|
|
43
|
+
v-if="$getOperationList(['canInsert', 'canDelete']).length"
|
|
44
|
+
class="item-icons"
|
|
45
|
+
itemClass="item-icons-item"
|
|
46
|
+
:list="$getOperationList(['canInsert', 'canDelete'])"
|
|
47
|
+
@click="$dispatchEvent($event, row, rowIndex)"
|
|
48
|
+
></dsh-icons>
|
|
49
|
+
</div>
|
|
47
50
|
</div>
|
|
48
|
-
</div>
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
52
|
+
<!-- 表格展示模式 -->
|
|
53
|
+
<template v-else>
|
|
54
|
+
<bri-table
|
|
55
|
+
v-show="curPageListData.length && !isSearching"
|
|
56
|
+
ref="briTable"
|
|
57
|
+
class="DshFlatTable-main"
|
|
58
|
+
:columns="showColumns"
|
|
59
|
+
:data="renderedShowListData"
|
|
60
|
+
:footer-data="footerData"
|
|
61
|
+
:propsObj="tablePropsObj"
|
|
62
|
+
@changeSelect="changeSelect"
|
|
63
|
+
@selectAll="changeSelect"
|
|
64
|
+
></bri-table>
|
|
65
|
+
<bri-table
|
|
66
|
+
v-show="!curPageListData.length || isSearching"
|
|
67
|
+
ref="briTable"
|
|
68
|
+
class="DshFlatTable-main"
|
|
69
|
+
:columns="showColumns"
|
|
70
|
+
:data="curPageListData"
|
|
71
|
+
:footer-data="footerData"
|
|
72
|
+
:propsObj="tablePropsObj"
|
|
73
|
+
@changeSelect="changeSelect"
|
|
74
|
+
@selectAll="changeSelect"
|
|
75
|
+
></bri-table>
|
|
76
|
+
</template>
|
|
74
77
|
</template>
|
|
75
78
|
|
|
76
79
|
<!-- 添加行 -->
|
|
77
80
|
<dsh-render :render="createBtnRender"></dsh-render>
|
|
78
81
|
|
|
82
|
+
<!-- 分页 -->
|
|
83
|
+
<div class="DshFlatTable-page">
|
|
84
|
+
<dsh-page
|
|
85
|
+
:mode="pageMode"
|
|
86
|
+
:total="total"
|
|
87
|
+
:propsObj="pagePropsObj"
|
|
88
|
+
@changePage="changePage"
|
|
89
|
+
@changePageSize="changePageSize"
|
|
90
|
+
>
|
|
91
|
+
共 {{ total }} 条
|
|
92
|
+
|
|
93
|
+
<span
|
|
94
|
+
class="DshFlatTable-sort"
|
|
95
|
+
:style="{ color: appColor }"
|
|
96
|
+
@click="changeSort()"
|
|
97
|
+
>
|
|
98
|
+
<dsh-icons
|
|
99
|
+
class="DshFlatTable-sort-icons"
|
|
100
|
+
:list="[{ icon: 'md-swap', size: 14 }]"
|
|
101
|
+
/>
|
|
102
|
+
<span class="DshFlatTable-sort-name">
|
|
103
|
+
{{ isUseDescSort ? "使用正序" : "使用倒序" }}
|
|
104
|
+
</span>
|
|
105
|
+
</span>
|
|
106
|
+
</dsh-page>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
79
109
|
<!-- 各种模态框共用 -->
|
|
80
110
|
<dsh-render :render="dshRender"></dsh-render>
|
|
81
111
|
|
|
@@ -99,20 +129,20 @@
|
|
|
99
129
|
|
|
100
130
|
<!-- 表格 -->
|
|
101
131
|
<bri-table
|
|
102
|
-
v-show="
|
|
132
|
+
v-show="curPageListData.length && !isSearching"
|
|
103
133
|
class="DshFlatTable-fullscreen-inner-main"
|
|
104
134
|
:columns="showColumns"
|
|
105
|
-
:data="
|
|
135
|
+
:data="renderedShowListData"
|
|
106
136
|
:footer-data="footerData"
|
|
107
137
|
:propsObj="tableInModalPropsObj"
|
|
108
138
|
@changeSelect="changeSelect"
|
|
109
139
|
@selectAll="changeSelect"
|
|
110
140
|
></bri-table>
|
|
111
141
|
<bri-table
|
|
112
|
-
v-show="!
|
|
142
|
+
v-show="!curPageListData.length || isSearching"
|
|
113
143
|
class="DshFlatTable-fullscreen-inner-main"
|
|
114
144
|
:columns="showColumns"
|
|
115
|
-
:data="
|
|
145
|
+
:data="curPageListData"
|
|
116
146
|
:footer-data="footerData"
|
|
117
147
|
:propsObj="tableInModalPropsObj"
|
|
118
148
|
@changeSelect="changeSelect"
|
|
@@ -121,6 +151,33 @@
|
|
|
121
151
|
|
|
122
152
|
<!-- 添加行 -->
|
|
123
153
|
<dsh-render :render="createBtnRender"></dsh-render>
|
|
154
|
+
|
|
155
|
+
<!-- 分页 -->
|
|
156
|
+
<div class="DshFlatTable-page">
|
|
157
|
+
<dsh-page
|
|
158
|
+
:mode="pageMode"
|
|
159
|
+
:total="total"
|
|
160
|
+
:propsObj="pagePropsObj"
|
|
161
|
+
@changePage="changePage"
|
|
162
|
+
@changePageSize="changePageSize"
|
|
163
|
+
>
|
|
164
|
+
共 {{ total }} 条
|
|
165
|
+
|
|
166
|
+
<span
|
|
167
|
+
class="DshFlatTable-sort"
|
|
168
|
+
:style="{ color: appColor }"
|
|
169
|
+
@click="changeSort()"
|
|
170
|
+
>
|
|
171
|
+
<dsh-icons
|
|
172
|
+
class="DshFlatTable-sort-icons"
|
|
173
|
+
:list="[{ icon: 'md-swap', size: 14 }]"
|
|
174
|
+
/>
|
|
175
|
+
<span class="DshFlatTable-sort-name">
|
|
176
|
+
{{ isUseDescSort ? "使用正序" : "使用倒序" }}
|
|
177
|
+
</span>
|
|
178
|
+
</span>
|
|
179
|
+
</dsh-page>
|
|
180
|
+
</div>
|
|
124
181
|
</div>
|
|
125
182
|
</dsh-modal>
|
|
126
183
|
</div>
|
|
@@ -217,6 +274,24 @@
|
|
|
217
274
|
height: auto;
|
|
218
275
|
}
|
|
219
276
|
|
|
277
|
+
&-page {
|
|
278
|
+
padding: 5px 3px;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
&-sort {
|
|
282
|
+
margin-left: 5px;
|
|
283
|
+
font-weight: 600;
|
|
284
|
+
// color: @themeColor;
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
|
|
287
|
+
&-icons {
|
|
288
|
+
|
|
289
|
+
}
|
|
290
|
+
&-name {
|
|
291
|
+
font-size: 12px;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
220
295
|
&-fullscreen {
|
|
221
296
|
&-inner {
|
|
222
297
|
width: 100%;
|
|
@@ -97,3 +97,98 @@
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
</script>
|
|
100
|
+
|
|
101
|
+
<style lang="less">
|
|
102
|
+
.DshPage {
|
|
103
|
+
width: 100%;
|
|
104
|
+
height: 24px;
|
|
105
|
+
line-height: 24px;
|
|
106
|
+
text-align: right;
|
|
107
|
+
font-size: 14px;
|
|
108
|
+
|
|
109
|
+
.ivu-page-total {
|
|
110
|
+
float: left;
|
|
111
|
+
}
|
|
112
|
+
.ivu-select-selection {
|
|
113
|
+
border: 0px!important;
|
|
114
|
+
}
|
|
115
|
+
.ivu-page-item-active {
|
|
116
|
+
a,
|
|
117
|
+
&:hover a {
|
|
118
|
+
color: @themeColor!important;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
.ivu-select-single .ivu-select-selection .ivu-select-placeholder,
|
|
122
|
+
.ivu-select-single .ivu-select-selection,
|
|
123
|
+
.ivu-page-simple-pager input,
|
|
124
|
+
.ivu-page-options-elevator input,
|
|
125
|
+
.ivu-page-item-jump-next,
|
|
126
|
+
.ivu-page-item-jump-prev,
|
|
127
|
+
.ivu-page-next,
|
|
128
|
+
.ivu-page-prev,
|
|
129
|
+
.ivu-page-total,
|
|
130
|
+
.ivu-page-item {
|
|
131
|
+
height: 24px!important;
|
|
132
|
+
line-height: 24px!important;
|
|
133
|
+
background: transparent;
|
|
134
|
+
display: inline-block;
|
|
135
|
+
vertical-align: middle;
|
|
136
|
+
}
|
|
137
|
+
.ivu-select-single .ivu-select-selection .ivu-select-selected-value {
|
|
138
|
+
height: 24px!important;
|
|
139
|
+
line-height: 24px!important;
|
|
140
|
+
}
|
|
141
|
+
.ivu-page-next,
|
|
142
|
+
.ivu-page-prev {
|
|
143
|
+
background: @white;
|
|
144
|
+
min-width: 26px;
|
|
145
|
+
border: 1px solid #d9d9d9;
|
|
146
|
+
a {
|
|
147
|
+
color: #000;
|
|
148
|
+
font-weight: bold;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
.ivu-page-item {
|
|
152
|
+
min-width: 24px;
|
|
153
|
+
&:hover {
|
|
154
|
+
color: @themeColor;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
.ivu-page-options {
|
|
158
|
+
margin-left: 4px;
|
|
159
|
+
}
|
|
160
|
+
.ivu-select-visible .ivu-select-selection{
|
|
161
|
+
box-shadow: unset;
|
|
162
|
+
}
|
|
163
|
+
.ivu-select-item-selected,
|
|
164
|
+
.ivu-select-item-selected:hover {
|
|
165
|
+
color: @themeColor;
|
|
166
|
+
}
|
|
167
|
+
.ivu-icon {
|
|
168
|
+
vertical-align: baseline;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&-small,
|
|
172
|
+
&-simple.ivu-page-simple{
|
|
173
|
+
a {
|
|
174
|
+
&:hover {
|
|
175
|
+
color: @themeColor !important;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
.ivu-page-next,
|
|
179
|
+
.ivu-page-prev {
|
|
180
|
+
background: transparent;
|
|
181
|
+
border-color: transparent;
|
|
182
|
+
&:hover {
|
|
183
|
+
border-color: transparent;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&-small {
|
|
189
|
+
.ivu-icon {
|
|
190
|
+
vertical-align: -.125em;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
@@ -35,6 +35,10 @@ export default {
|
|
|
35
35
|
...(this.selfPropsObj._showCreateBtnColKeys || [])
|
|
36
36
|
];
|
|
37
37
|
},
|
|
38
|
+
// 顶替tableBaseMixin里的
|
|
39
|
+
rowsNumStr () {
|
|
40
|
+
return `${this.isSearching ? "筛选" : "全部"}数据,共 ${this.total} 条;`;
|
|
41
|
+
},
|
|
38
42
|
|
|
39
43
|
allTreeData () {
|
|
40
44
|
return this.getCalcuedTree(this.data, this.treeColumns, this.selfColumns);
|
|
@@ -3,7 +3,15 @@ export default {
|
|
|
3
3
|
components: {},
|
|
4
4
|
props: {},
|
|
5
5
|
data () {
|
|
6
|
-
return {
|
|
6
|
+
return {
|
|
7
|
+
isUseDescSort: false,
|
|
8
|
+
pageMode: "small",
|
|
9
|
+
pagePropsObj: {
|
|
10
|
+
page: 1,
|
|
11
|
+
pagesize: 10,
|
|
12
|
+
pagesizeOpts: [10, 20, 30, 50]
|
|
13
|
+
}
|
|
14
|
+
};
|
|
7
15
|
},
|
|
8
16
|
computed: {
|
|
9
17
|
rowspanMap () {
|
|
@@ -12,17 +20,26 @@ export default {
|
|
|
12
20
|
selfBasePropsObj () {
|
|
13
21
|
return {
|
|
14
22
|
_mergeRowColKeys: [] // 合并行的列
|
|
23
|
+
// _isUseDescSort: false // 是否使用使用倒序
|
|
15
24
|
};
|
|
16
25
|
},
|
|
26
|
+
// // 是否使用倒序
|
|
27
|
+
// isUseDescSort () {
|
|
28
|
+
// return this.selfPropsObj._isUseDescSort;
|
|
29
|
+
// },
|
|
17
30
|
mergeRowColKeys () {
|
|
18
31
|
const mergeRowColKeys = this.selfPropsObj._mergeRowColKeys || []; // 配置端有问题,高级依赖时值成undefined了
|
|
19
32
|
return this.selfColumns
|
|
20
33
|
.filter(colItem => mergeRowColKeys.includes(colItem._key))
|
|
21
34
|
.map(colItem => colItem._key);
|
|
22
35
|
},
|
|
36
|
+
// 是不是合并行表格
|
|
37
|
+
isMergeRowTable () {
|
|
38
|
+
return this.mergeRowColKeys.length;
|
|
39
|
+
},
|
|
23
40
|
// 一级合并列keys(一级合并列:左侧第一合并列和右侧和并列)
|
|
24
41
|
firstMergeRowColKeys () {
|
|
25
|
-
if (this.
|
|
42
|
+
if (this.isMergeRowTable) {
|
|
26
43
|
const firstNormalIndex = this.selfColumns.findIndex(colItem => !this.mergeRowColKeys.includes(colItem._key));
|
|
27
44
|
|
|
28
45
|
// -1代表无普通单元格,0代表第一列就是普通单元格
|
|
@@ -41,21 +58,38 @@ export default {
|
|
|
41
58
|
notFirstMergeRowColKeys () {
|
|
42
59
|
return this.mergeRowColKeys.filter(colKey => !this.firstMergeRowColKeys.includes(colKey));
|
|
43
60
|
},
|
|
61
|
+
// 顶替tableBaseMixin里的
|
|
62
|
+
rowsNumStr () {
|
|
63
|
+
return `${this.isSearching ? "筛选" : "全部"}数据${this.isMergeRowTable ? `,共 ${this.total}条;` : ";"}`;
|
|
64
|
+
},
|
|
44
65
|
|
|
45
66
|
allListData () {
|
|
46
67
|
this.data.forEach(rowItem => {
|
|
47
68
|
this.fixRowItem(rowItem);
|
|
48
69
|
});
|
|
49
|
-
|
|
50
70
|
this.initFlag = false;
|
|
51
|
-
|
|
71
|
+
|
|
72
|
+
return this.isMergeRowTable
|
|
73
|
+
? this.data
|
|
74
|
+
: this.isUseDescSort
|
|
75
|
+
? [...this.data].reverse()
|
|
76
|
+
: this.data;
|
|
52
77
|
},
|
|
53
78
|
allListMap () {
|
|
54
79
|
return this.$arrToMap(this.allListData, "_id");
|
|
55
80
|
},
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
81
|
+
// 渲染过的行 -但显示当前页
|
|
82
|
+
renderedShowListData () {
|
|
83
|
+
return this.isMergeRowTable
|
|
84
|
+
? this.renderedListData
|
|
85
|
+
: this.curPageListData;
|
|
86
|
+
},
|
|
87
|
+
// 全部数据或筛选时符合条件的数据
|
|
88
|
+
curPageListData () {
|
|
89
|
+
return this.isMergeRowTable
|
|
90
|
+
? this.showListData
|
|
91
|
+
: this.showListData.slice((this.pagePropsObj.page - 1) * this.pagePropsObj.pagesize, this.pagePropsObj.page * this.pagePropsObj.pagesize);
|
|
92
|
+
},
|
|
59
93
|
footerData () {
|
|
60
94
|
return this.isSearching
|
|
61
95
|
? []
|
|
@@ -80,6 +114,12 @@ export default {
|
|
|
80
114
|
]
|
|
81
115
|
: [];
|
|
82
116
|
},
|
|
117
|
+
// 共多少分页
|
|
118
|
+
PageNum () {
|
|
119
|
+
return this.total % this.pagePropsObj.pagesize > 0
|
|
120
|
+
? Math.ceil(this.total / this.pagePropsObj.pagesize)
|
|
121
|
+
: Math.floor(this.total / this.pagePropsObj.pagesize);
|
|
122
|
+
},
|
|
83
123
|
|
|
84
124
|
showColumns () {
|
|
85
125
|
return [
|
|
@@ -100,7 +140,7 @@ export default {
|
|
|
100
140
|
fixed: "left",
|
|
101
141
|
renderBodyCell: ({ row, rowIndex, column }, h) => {
|
|
102
142
|
return [
|
|
103
|
-
h("div", rowIndex + 1),
|
|
143
|
+
h("div", this.isMergeRowTable ? rowIndex + 1 : row.__index__),
|
|
104
144
|
|
|
105
145
|
// 添加符
|
|
106
146
|
...this.operationIconRender(h, { row, rowIndex, column })
|
|
@@ -119,7 +159,7 @@ export default {
|
|
|
119
159
|
},
|
|
120
160
|
// 初始化合并单元格的rowspan
|
|
121
161
|
initRowspan () {
|
|
122
|
-
if (this.
|
|
162
|
+
if (this.isMergeRowTable) {
|
|
123
163
|
this.$set(this.tableDataObj, "rowspanMap", this.tableDataObj.rowspanMap || {});
|
|
124
164
|
|
|
125
165
|
// TODO: 待删除
|
|
@@ -158,6 +198,20 @@ export default {
|
|
|
158
198
|
}
|
|
159
199
|
},
|
|
160
200
|
|
|
201
|
+
// 切换正倒序
|
|
202
|
+
changeSort () {
|
|
203
|
+
this.isUseDescSort = !this.isUseDescSort;
|
|
204
|
+
this.pagePropsObj.page = 1;
|
|
205
|
+
},
|
|
206
|
+
// 切换分页
|
|
207
|
+
changePage (page) {
|
|
208
|
+
this.pagePropsObj.page = page;
|
|
209
|
+
},
|
|
210
|
+
// 切换分页条数
|
|
211
|
+
changePageSize (pagesize) {
|
|
212
|
+
this.pagePropsObj.page = 1;
|
|
213
|
+
this.pagePropsObj.pagesize = pagesize;
|
|
214
|
+
},
|
|
161
215
|
// 点击 -添加行
|
|
162
216
|
clickCreate (operationItem, row, rowIndex, column) {
|
|
163
217
|
const curColKey = column ? column._key : undefined;
|
|
@@ -165,7 +219,7 @@ export default {
|
|
|
165
219
|
const newRow = this.getNewRowData();
|
|
166
220
|
|
|
167
221
|
// 处理单元格合并相关
|
|
168
|
-
if (this.
|
|
222
|
+
if (this.isMergeRowTable) {
|
|
169
223
|
// 非底部按钮添加时
|
|
170
224
|
if (row) {
|
|
171
225
|
// 寻找对应的行数据 -当前列是合并列会寻找,普通列不用找(就是row)
|
|
@@ -230,7 +284,28 @@ export default {
|
|
|
230
284
|
const newRowIndex = row
|
|
231
285
|
? list.findIndex(rowItem => rowItem._id === row._id) + 1
|
|
232
286
|
: list.length;
|
|
233
|
-
|
|
287
|
+
|
|
288
|
+
if (this.isMergeRowTable) {
|
|
289
|
+
list.splice(newRowIndex, 0, newRow);
|
|
290
|
+
} else {
|
|
291
|
+
if (this.isUseDescSort) {
|
|
292
|
+
if (row) {
|
|
293
|
+
list.splice(newRowIndex - 1, 0, newRow);
|
|
294
|
+
rowIndex + 1 === this.pagePropsObj.pagesize && this.changePage(this.pagePropsObj.page + 1);
|
|
295
|
+
} else {
|
|
296
|
+
list.splice(newRowIndex, 0, newRow);
|
|
297
|
+
this.changePage(1);
|
|
298
|
+
}
|
|
299
|
+
} else {
|
|
300
|
+
if (row) {
|
|
301
|
+
list.splice(newRowIndex, 0, newRow);
|
|
302
|
+
rowIndex + 1 === this.pagePropsObj.pagesize && this.changePage(this.pagePropsObj.page + 1);
|
|
303
|
+
} else {
|
|
304
|
+
list.splice(newRowIndex, 0, newRow);
|
|
305
|
+
this.changePage(this.PageNum);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
234
309
|
|
|
235
310
|
this.change("createRow", newRow, newRowIndex, null);
|
|
236
311
|
},
|
|
@@ -243,7 +318,7 @@ export default {
|
|
|
243
318
|
const list = this.data;
|
|
244
319
|
|
|
245
320
|
// 处理单元格合并相关
|
|
246
|
-
if (this.
|
|
321
|
+
if (this.isMergeRowTable) {
|
|
247
322
|
this.mergeRowColKeys.forEach(colKey => {
|
|
248
323
|
const column = { _key: colKey };
|
|
249
324
|
const rowIndex = list.findIndex(dataItem => dataItem._id === row._id);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import DshListUnit from "../../unit/DshListUnit.vue";
|
|
2
2
|
import importModal from "../common/importModal.vue";
|
|
3
3
|
import quoteListModal from "../common/quoteListModal.vue";
|
|
4
|
-
import { mapGetters } from "vuex";
|
|
5
4
|
|
|
6
5
|
export default {
|
|
7
6
|
mixins: [],
|
|
@@ -195,13 +194,11 @@ export default {
|
|
|
195
194
|
};
|
|
196
195
|
},
|
|
197
196
|
computed: {
|
|
198
|
-
...mapGetters(["appObj"]),
|
|
199
197
|
appObj () {
|
|
200
198
|
return this.$store.getters.appObj || {};
|
|
201
199
|
},
|
|
202
200
|
appColor () {
|
|
203
|
-
|
|
204
|
-
return (themeColorMap[this.appObj.colorType] || { color: "#3DB8C5" }).color;
|
|
201
|
+
return ((this.$appData.themeColors || {})[this.appObj.colorType] || {}).color || "#3DB8C5";
|
|
205
202
|
},
|
|
206
203
|
|
|
207
204
|
dshRender () {
|
|
@@ -285,8 +282,8 @@ export default {
|
|
|
285
282
|
list: [],
|
|
286
283
|
tree: []
|
|
287
284
|
},
|
|
288
|
-
|
|
289
285
|
...(this.selfBasePropsObj || {}),
|
|
286
|
+
|
|
290
287
|
...this.propsObj
|
|
291
288
|
};
|
|
292
289
|
},
|
|
@@ -418,14 +415,12 @@ export default {
|
|
|
418
415
|
isSearching () {
|
|
419
416
|
return this.$isAdvSearching(this.finalTableAdvSearch);
|
|
420
417
|
},
|
|
421
|
-
// 当前行数
|
|
422
|
-
rowsNum () {
|
|
423
|
-
return this.isSearching
|
|
424
|
-
? this.showListData.length
|
|
425
|
-
: this.allListData.length;
|
|
426
|
-
},
|
|
427
418
|
rowsNumStr () {
|
|
428
|
-
return
|
|
419
|
+
return `${this.isSearching ? "筛选" : "全部"}数据;`;
|
|
420
|
+
// return `${this.isSearching ? "筛选" : "全部"}数据;共 ${this.total}条;`;
|
|
421
|
+
},
|
|
422
|
+
controlShowKey () {
|
|
423
|
+
return this.isSearching ? "__isSearchShow__" : "__isShow__";
|
|
429
424
|
},
|
|
430
425
|
|
|
431
426
|
/* --- 数据 --- */
|
|
@@ -449,6 +444,7 @@ export default {
|
|
|
449
444
|
.map(rowItem => rowItem._id)
|
|
450
445
|
.filter(id => !!id);
|
|
451
446
|
},
|
|
447
|
+
// 渲染过的行
|
|
452
448
|
renderedListData () {
|
|
453
449
|
return this.allListData.filter(rowItem => {
|
|
454
450
|
this.dealSearchShow(rowItem);
|
|
@@ -456,13 +452,20 @@ export default {
|
|
|
456
452
|
return rowItem.__isRendered__;
|
|
457
453
|
});
|
|
458
454
|
},
|
|
455
|
+
// 全部数据或筛选时符合条件的数据 -但显示当前页
|
|
459
456
|
showListData () {
|
|
460
|
-
return this.renderedListData
|
|
461
|
-
this.
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
457
|
+
return this.renderedListData
|
|
458
|
+
.filter(rowItem => !!rowItem[this.controlShowKey])
|
|
459
|
+
.map((rowItem, rowIndex) => {
|
|
460
|
+
rowItem.__index__ = rowIndex + 1;
|
|
461
|
+
return rowItem;
|
|
462
|
+
});
|
|
463
|
+
},
|
|
464
|
+
// 全部数据或筛选时符合条件的数据 总数
|
|
465
|
+
total () {
|
|
466
|
+
return this.showListData.length;
|
|
465
467
|
},
|
|
468
|
+
|
|
466
469
|
parentDataId () {
|
|
467
470
|
return this.parentObj._id;
|
|
468
471
|
},
|
|
@@ -804,9 +807,11 @@ export default {
|
|
|
804
807
|
this.isExpandAction = false;
|
|
805
808
|
this.dftAdvSearch.conditions = conditions;
|
|
806
809
|
},
|
|
810
|
+
// 列表选择项改变
|
|
807
811
|
changeSelect (list) {
|
|
808
812
|
this.$emit("changeSelect", list);
|
|
809
813
|
},
|
|
814
|
+
|
|
810
815
|
// 输入框失去焦点
|
|
811
816
|
controlBlur (operationItem, row, rowIndex, column, params) {
|
|
812
817
|
this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
|
|
@@ -1089,7 +1094,7 @@ export default {
|
|
|
1089
1094
|
"display": "flex",
|
|
1090
1095
|
"flex-direction": "row",
|
|
1091
1096
|
"align-items": "center",
|
|
1092
|
-
"margin-left": "
|
|
1097
|
+
"margin-left": "12px"
|
|
1093
1098
|
}
|
|
1094
1099
|
}, [
|
|
1095
1100
|
h("div", {
|