bri-components 1.3.24 → 1.3.25
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/uploadList.vue +1 -1
- package/src/components/controls/base/DshDate/DshDate.vue +6 -2
- package/src/components/controls/mixins/controlMixin.js +17 -5
- package/src/components/controls/senior/cascaderTable.vue +18 -9
- package/src/components/controls/senior/flatTable/flatTable.vue +14 -6
- package/src/components/form/DshForm.vue +25 -1
- package/src/components/list/DshBox/DshBox.vue +19 -9
- package/src/components/list/DshBox/DshCrossTable.vue +9 -8
- package/src/components/list/DshBox/DshTable.vue +97 -93
- package/src/components/list/DshCascaderTable.vue +17 -2
- package/src/components/list/DshTreeTable.vue +24 -14
- package/src/components/list/mixins/DshFlatTableMixin.js +17 -4
- package/src/components/list/mixins/tableMixin.js +26 -20
- package/src/components/unit/DshFormUnit.vue +4 -0
- package/src/components/unit/DshListUnit.vue +4 -9
- package/src/components/unit/unitMixin.js +20 -0
- package/src/styles/components/list/BriTable.less +1 -1
- package/src/styles/reset-iview-other.less +6 -4
package/package.json
CHANGED
|
@@ -109,12 +109,16 @@
|
|
|
109
109
|
shortcuts: [],
|
|
110
110
|
disabledDate: (date) => {
|
|
111
111
|
const resultObj = this.$validateComparedRule(
|
|
112
|
-
[
|
|
112
|
+
[{
|
|
113
|
+
...this.selfPropsObj,
|
|
114
|
+
_isCompareByParent: true
|
|
115
|
+
}],
|
|
113
116
|
{
|
|
114
117
|
...this.value,
|
|
115
118
|
[this.controlKey]: this.$transformDate(date, "/", this.subType)
|
|
116
119
|
},
|
|
117
|
-
this.allFormList
|
|
120
|
+
this.selfPropsObj._isCompareByParent === true ? this.parentFormList : this.allFormList,
|
|
121
|
+
this.selfPropsObj._isCompareByParent === true ? this.parentObj : undefined
|
|
118
122
|
);
|
|
119
123
|
return !resultObj.bool;
|
|
120
124
|
}
|
|
@@ -16,8 +16,6 @@ export default {
|
|
|
16
16
|
return {};
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
-
|
|
20
|
-
/* 表单形式下用到的 */
|
|
21
19
|
// 暂时是dshDate里在用,时间对比时需要用其他时间字段
|
|
22
20
|
allFormList: {
|
|
23
21
|
type: Array,
|
|
@@ -25,13 +23,26 @@ export default {
|
|
|
25
23
|
return [];
|
|
26
24
|
}
|
|
27
25
|
},
|
|
28
|
-
|
|
26
|
+
|
|
27
|
+
/* 内部表,层级表内的字段用到的 */
|
|
29
28
|
rowIndex: Number,
|
|
30
29
|
parentListData: {
|
|
31
30
|
type: Array,
|
|
32
31
|
default () {
|
|
33
32
|
return [];
|
|
34
33
|
}
|
|
34
|
+
},
|
|
35
|
+
parentFormList: {
|
|
36
|
+
type: Array,
|
|
37
|
+
default () {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
parentObj: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default () {
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
35
46
|
}
|
|
36
47
|
},
|
|
37
48
|
data () {
|
|
@@ -60,11 +71,12 @@ export default {
|
|
|
60
71
|
return this.value[this.controlKey];
|
|
61
72
|
},
|
|
62
73
|
set (val) {
|
|
63
|
-
this.value[this.controlKey] = val;
|
|
64
74
|
// 修复文本框clear后值为undefined,后端无法更新保存数据bug
|
|
65
75
|
if (["select"].includes(this.controlType) && this.value[this.controlKey] === undefined) {
|
|
66
|
-
|
|
76
|
+
val = "";
|
|
67
77
|
}
|
|
78
|
+
|
|
79
|
+
this.$set(this.value, this.controlKey, val);
|
|
68
80
|
this.change();
|
|
69
81
|
}
|
|
70
82
|
},
|
|
@@ -20,20 +20,23 @@
|
|
|
20
20
|
<dsh-tree-table
|
|
21
21
|
v-if="showMode === 'treeTable'"
|
|
22
22
|
:canEdit="finalCanEdit"
|
|
23
|
-
:columns="subForm"
|
|
24
23
|
:data="curVal.tree"
|
|
25
24
|
:rowDefault="curVal.rowDefault"
|
|
26
|
-
:
|
|
25
|
+
:columns="subForm"
|
|
27
26
|
:propsObj="propsObj"
|
|
27
|
+
:parentFormList="allFormList"
|
|
28
|
+
:parentObj="value"
|
|
28
29
|
@change="change"
|
|
29
30
|
></dsh-tree-table>
|
|
30
31
|
<dsh-cascader-table
|
|
31
32
|
v-else
|
|
32
33
|
:canEdit="finalCanEdit"
|
|
34
|
+
:data="curVal"
|
|
33
35
|
:treeColumns="treeColumns"
|
|
34
36
|
:subColumns="subForm"
|
|
35
|
-
:data="curVal"
|
|
36
37
|
:propsObj="propsObj"
|
|
38
|
+
:parentFormList="allFormList"
|
|
39
|
+
:parentObj="value"
|
|
37
40
|
@change="change"
|
|
38
41
|
></dsh-cascader-table>
|
|
39
42
|
</template>
|
|
@@ -54,11 +57,12 @@
|
|
|
54
57
|
v-if="showMode === 'treeTable'"
|
|
55
58
|
ref="table"
|
|
56
59
|
:canEdit="finalCanEdit"
|
|
57
|
-
:columns="subForm"
|
|
58
60
|
:data="curVal.tree"
|
|
59
61
|
:rowDefault="curVal.rowDefault"
|
|
60
|
-
:
|
|
62
|
+
:columns="subForm"
|
|
61
63
|
:propsObj="propsObj"
|
|
64
|
+
:parentFormList="allFormList"
|
|
65
|
+
:parentObj="value"
|
|
62
66
|
@change="change"
|
|
63
67
|
></dsh-tree-table>
|
|
64
68
|
<dsh-cascader-table
|
|
@@ -66,10 +70,12 @@
|
|
|
66
70
|
ref="table"
|
|
67
71
|
useCol
|
|
68
72
|
:canEdit="finalCanEdit"
|
|
73
|
+
:data="curVal"
|
|
69
74
|
:treeColumns="treeColumns"
|
|
70
75
|
:subColumns="subForm"
|
|
71
|
-
:data="curVal"
|
|
72
76
|
:propsObj="propsObj"
|
|
77
|
+
:parentFormList="allFormList"
|
|
78
|
+
:parentObj="value"
|
|
73
79
|
@change="change"
|
|
74
80
|
></dsh-cascader-table>
|
|
75
81
|
</template>
|
|
@@ -84,21 +90,24 @@
|
|
|
84
90
|
<dsh-tree-table
|
|
85
91
|
v-if="showMode === 'treeTable'"
|
|
86
92
|
:canEdit="finalCanEdit"
|
|
87
|
-
:columns="subForm"
|
|
88
93
|
:data="curVal.tree"
|
|
89
94
|
:rowDefault="curVal.rowDefault"
|
|
90
|
-
:
|
|
95
|
+
:columns="subForm"
|
|
91
96
|
:propsObj="propsObj"
|
|
97
|
+
:parentFormList="allFormList"
|
|
98
|
+
:parentObj="value"
|
|
92
99
|
@change="change"
|
|
93
100
|
></dsh-tree-table>
|
|
94
101
|
<dsh-cascader-table
|
|
95
102
|
v-else
|
|
96
103
|
useCol
|
|
97
104
|
:canEdit="finalCanEdit"
|
|
105
|
+
:data="curVal"
|
|
98
106
|
:treeColumns="treeColumns"
|
|
99
107
|
:subColumns="subForm"
|
|
100
|
-
:data="curVal"
|
|
101
108
|
:propsObj="propsObj"
|
|
109
|
+
:parentFormList="allFormList"
|
|
110
|
+
:parentObj="value"
|
|
102
111
|
@change="change"
|
|
103
112
|
></dsh-cascader-table>
|
|
104
113
|
</template>
|
|
@@ -24,11 +24,12 @@
|
|
|
24
24
|
<dsh-btn-modal v-if="propsObj._key === '_default'">
|
|
25
25
|
<dsh-flat-table
|
|
26
26
|
:canEdit="finalCanEdit"
|
|
27
|
-
:columns="columns"
|
|
28
27
|
:data="curVal.list"
|
|
29
28
|
:rowDefault="curVal.rowDefault"
|
|
30
|
-
:
|
|
29
|
+
:columns="columns"
|
|
31
30
|
:propsObj="propsObj"
|
|
31
|
+
:parentFormList="allFormList"
|
|
32
|
+
:parentObj="value"
|
|
32
33
|
@change="change"
|
|
33
34
|
></dsh-flat-table>
|
|
34
35
|
</dsh-btn-modal>
|
|
@@ -46,12 +47,13 @@
|
|
|
46
47
|
<dsh-flat-table
|
|
47
48
|
ref="dshFatTable"
|
|
48
49
|
:canEdit="finalCanEdit"
|
|
49
|
-
:columns="columns"
|
|
50
50
|
:data="curVal.list"
|
|
51
51
|
:oldData="curVal.oldList"
|
|
52
52
|
:rowDefault="curVal.rowDefault"
|
|
53
|
-
:
|
|
53
|
+
:columns="columns"
|
|
54
54
|
:propsObj="propsObj"
|
|
55
|
+
:parentFormList="allFormList"
|
|
56
|
+
:parentObj="value"
|
|
55
57
|
@change="change"
|
|
56
58
|
></dsh-flat-table>
|
|
57
59
|
|
|
@@ -63,12 +65,13 @@
|
|
|
63
65
|
>
|
|
64
66
|
<dsh-flat-table
|
|
65
67
|
:canEdit="finalCanEdit"
|
|
66
|
-
:columns="columns"
|
|
67
68
|
:data="curVal.list"
|
|
68
69
|
:oldData="curVal.oldList"
|
|
69
70
|
:rowDefault="curVal.rowDefault"
|
|
70
|
-
:
|
|
71
|
+
:columns="columns"
|
|
71
72
|
:propsObj="propsObj"
|
|
73
|
+
:parentFormList="allFormList"
|
|
74
|
+
:parentObj="value"
|
|
72
75
|
@change="change"
|
|
73
76
|
></dsh-flat-table>
|
|
74
77
|
</dsh-modal>
|
|
@@ -198,6 +201,9 @@
|
|
|
198
201
|
},
|
|
199
202
|
// 导出点击
|
|
200
203
|
clickExport (operationItem) {
|
|
204
|
+
if (operationItem.disabled || this.timer) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
201
207
|
operationItem.disabled = true;
|
|
202
208
|
this.$https({
|
|
203
209
|
url: {
|
|
@@ -235,9 +241,11 @@
|
|
|
235
241
|
callback: data => {
|
|
236
242
|
if (data.status === "completed") {
|
|
237
243
|
clearInterval(this.timer);
|
|
244
|
+
this.timer = null;
|
|
238
245
|
window.location.href = data.url;
|
|
239
246
|
} else if (data.status === "failed") {
|
|
240
247
|
clearInterval(this.timer);
|
|
248
|
+
this.timer = null;
|
|
241
249
|
// this.exportBtnLoading = false;
|
|
242
250
|
this.$Message.info({ content: "操作失败,请稍后再试" });
|
|
243
251
|
}
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
:formData="formData"
|
|
28
28
|
:formItem="formItem"
|
|
29
29
|
:allFormList="allFormList"
|
|
30
|
+
:rowIndex="rowIndex"
|
|
31
|
+
:parentListData="parentListData"
|
|
32
|
+
:parentFormList="parentFormList"
|
|
33
|
+
:parentObj="parentObj"
|
|
30
34
|
:changedFields="changedFields"
|
|
31
35
|
:height="height"
|
|
32
36
|
:rowStyle="rowStyle"
|
|
@@ -123,13 +127,33 @@
|
|
|
123
127
|
return [];
|
|
124
128
|
}
|
|
125
129
|
},
|
|
126
|
-
|
|
127
130
|
allFormList: {
|
|
128
131
|
type: Array,
|
|
129
132
|
default () {
|
|
130
133
|
return [];
|
|
131
134
|
}
|
|
132
135
|
},
|
|
136
|
+
|
|
137
|
+
rowIndex: Number,
|
|
138
|
+
parentListData: {
|
|
139
|
+
type: Array,
|
|
140
|
+
default () {
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
parentFormList: {
|
|
145
|
+
type: Array,
|
|
146
|
+
default () {
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
parentObj: {
|
|
151
|
+
type: Object,
|
|
152
|
+
default () {
|
|
153
|
+
return {};
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
|
|
133
157
|
changedFields: {
|
|
134
158
|
type: Array,
|
|
135
159
|
default () {
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
ref="list"
|
|
7
7
|
:data="data"
|
|
8
8
|
:columns="columns"
|
|
9
|
-
:fixTitle="fixTitle"
|
|
10
9
|
:ownColumns="ownColumns"
|
|
11
10
|
:operationList="dropdownOperationList"
|
|
12
11
|
:extraOperationList="extraOperationList"
|
|
@@ -83,13 +82,24 @@
|
|
|
83
82
|
return ["table", "crossTable", "panel", "card", "list", "singleData"].includes(val);
|
|
84
83
|
}
|
|
85
84
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
data: {
|
|
86
|
+
type: Array,
|
|
87
|
+
default () {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
ownColumns: {
|
|
92
|
+
type: Array,
|
|
93
|
+
default () {
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
columns: {
|
|
98
|
+
type: Array,
|
|
99
|
+
default () {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
90
102
|
},
|
|
91
|
-
data: Array,
|
|
92
|
-
columns: Array,
|
|
93
103
|
changedFields: {
|
|
94
104
|
type: Array,
|
|
95
105
|
default () {
|
|
@@ -103,10 +113,10 @@
|
|
|
103
113
|
}
|
|
104
114
|
},
|
|
105
115
|
listPropsObj: Object,
|
|
116
|
+
|
|
106
117
|
pageMode: String,
|
|
107
118
|
total: Number,
|
|
108
|
-
pagePropsObj: Object
|
|
109
|
-
ownColumns: Array
|
|
119
|
+
pagePropsObj: Object
|
|
110
120
|
},
|
|
111
121
|
data () {
|
|
112
122
|
return {};
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
|
|
142
142
|
<!-- 操作 -->
|
|
143
143
|
<div
|
|
144
|
-
v-if="
|
|
144
|
+
v-if="operationColumn && selfPropsObj.showAction"
|
|
145
145
|
class="DshCrossTable-left-footer"
|
|
146
146
|
>
|
|
147
147
|
<table
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
background: '#f4f4f4'
|
|
156
156
|
}"
|
|
157
157
|
>
|
|
158
|
-
<div class="td-content"
|
|
158
|
+
<div class="td-content">{{ operationColumn.title }}</div>
|
|
159
159
|
</td>
|
|
160
160
|
</tr>
|
|
161
161
|
</table>
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
|
|
318
318
|
<!-- 操作 -->
|
|
319
319
|
<div
|
|
320
|
-
v-if="
|
|
320
|
+
v-if="operationColumn && selfPropsObj.showAction"
|
|
321
321
|
class="DshCrossTable-right-footer"
|
|
322
322
|
>
|
|
323
323
|
<table
|
|
@@ -340,7 +340,7 @@
|
|
|
340
340
|
<dsh-list-render
|
|
341
341
|
:row="dataItem"
|
|
342
342
|
:index="dataIndex"
|
|
343
|
-
:render="
|
|
343
|
+
:render="operationColumn.renderBodyCell"
|
|
344
344
|
></dsh-list-render>
|
|
345
345
|
</div>
|
|
346
346
|
</td>
|
|
@@ -422,13 +422,14 @@
|
|
|
422
422
|
};
|
|
423
423
|
},
|
|
424
424
|
columnList () {
|
|
425
|
-
return this.columns
|
|
425
|
+
return this.columns;
|
|
426
426
|
},
|
|
427
|
-
|
|
427
|
+
operationColumn () {
|
|
428
428
|
return {
|
|
429
429
|
title: "操作",
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
_key: "__operation__",
|
|
431
|
+
key: "__operation__",
|
|
432
|
+
field: "__operation__",
|
|
432
433
|
width: 150,
|
|
433
434
|
renderBodyCell: (params, h) => {
|
|
434
435
|
return this.operationList.length < 3
|
|
@@ -30,25 +30,29 @@
|
|
|
30
30
|
return [];
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
type:
|
|
35
|
-
default
|
|
33
|
+
ownColumns: {
|
|
34
|
+
type: Array,
|
|
35
|
+
default () {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
36
38
|
},
|
|
37
|
-
ownColumns: Array,
|
|
38
39
|
operationList: {
|
|
39
40
|
type: Array,
|
|
40
41
|
default () {
|
|
41
42
|
return [];
|
|
42
43
|
}
|
|
43
44
|
},
|
|
44
|
-
|
|
45
45
|
propsObj: {
|
|
46
46
|
type: Object,
|
|
47
47
|
default () {
|
|
48
48
|
return {};
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
|
|
51
|
+
|
|
52
|
+
isLoading: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
52
56
|
noDataText: String
|
|
53
57
|
},
|
|
54
58
|
data () {
|
|
@@ -60,6 +64,9 @@
|
|
|
60
64
|
multiple () {
|
|
61
65
|
return !!this.propsObj.multiple;
|
|
62
66
|
},
|
|
67
|
+
maxBtnNum () {
|
|
68
|
+
return Math.max(this.propsObj.maxBtnNum || 4, 2);
|
|
69
|
+
},
|
|
63
70
|
selfOperationList () {
|
|
64
71
|
const getOperationItemMaxWidth = (operationItem) => {
|
|
65
72
|
// 字宽
|
|
@@ -82,96 +89,93 @@
|
|
|
82
89
|
};
|
|
83
90
|
});
|
|
84
91
|
},
|
|
85
|
-
selfColumns () {
|
|
86
|
-
if (this.ownColumns) {
|
|
87
|
-
return this.ownColumns;
|
|
88
|
-
} else {
|
|
89
|
-
const maxBtnNum = Math.max(this.propsObj.maxBtnNum || 4, 2);
|
|
90
|
-
|
|
91
|
-
return [
|
|
92
|
-
...(
|
|
93
|
-
this.multiple
|
|
94
|
-
? [{
|
|
95
|
-
field: "selection",
|
|
96
|
-
key: "selection",
|
|
97
|
-
type: "checkbox",
|
|
98
|
-
width: 66,
|
|
99
|
-
align: "center",
|
|
100
|
-
fixed: "left"
|
|
101
|
-
}]
|
|
102
|
-
: []
|
|
103
|
-
),
|
|
104
|
-
{
|
|
105
|
-
title: "序号",
|
|
106
|
-
field: "custome",
|
|
107
|
-
key: "customes",
|
|
108
|
-
width: 78,
|
|
109
|
-
align: "center",
|
|
110
|
-
fixed: "left",
|
|
111
|
-
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
112
|
-
return ++rowIndex;
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
92
|
|
|
93
|
+
selfColumns () {
|
|
94
|
+
return this.ownColumns.length
|
|
95
|
+
? this.ownColumns
|
|
96
|
+
: [
|
|
97
|
+
...(this.multiple ? [this.selectionColumn] : []),
|
|
98
|
+
this.indexColumn,
|
|
116
99
|
...this.columns,
|
|
100
|
+
...(this.selfOperationList.length ? [this.operationColumn] : [])
|
|
101
|
+
];
|
|
102
|
+
},
|
|
103
|
+
selectionColumn () {
|
|
104
|
+
return {
|
|
105
|
+
_key: "__selection__",
|
|
106
|
+
key: "__selection__",
|
|
107
|
+
field: "__selection__",
|
|
108
|
+
type: "checkbox", // 内置类型
|
|
109
|
+
width: 66,
|
|
110
|
+
align: "center",
|
|
111
|
+
fixed: "left"
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
indexColumn () {
|
|
115
|
+
return {
|
|
116
|
+
title: "序号",
|
|
117
|
+
_key: "__index__",
|
|
118
|
+
key: "__index__",
|
|
119
|
+
field: "__index__",
|
|
120
|
+
width: 78,
|
|
121
|
+
align: "center",
|
|
122
|
+
fixed: "left",
|
|
123
|
+
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
124
|
+
return ++rowIndex;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
operationColumn () {
|
|
129
|
+
return {
|
|
130
|
+
title: "操作",
|
|
131
|
+
_key: "__operation__",
|
|
132
|
+
key: "__operation__",
|
|
133
|
+
field: "__operation__",
|
|
134
|
+
align: "center",
|
|
135
|
+
fixed: "right",
|
|
136
|
+
width: Math.max(
|
|
137
|
+
// 漏在外部按钮的宽度
|
|
138
|
+
this.selfOperationList
|
|
139
|
+
.slice(0, this.selfOperationList.length > this.maxBtnNum ? this.maxBtnNum - 1 : this.selfOperationList.length)
|
|
140
|
+
.reduce((total, operationItem) => total + operationItem.width + 9, 0) +
|
|
141
|
+
(this.selfOperationList.length > this.maxBtnNum ? 70 : 0) + // 出现更多按钮的宽度
|
|
142
|
+
(this.selfOperationList.length > 0 ? 40 : 0) + // 操作列的padding
|
|
143
|
+
4 // 留出4px空间,避免麻烦问题
|
|
144
|
+
, 80
|
|
145
|
+
),
|
|
146
|
+
renderBodyCell: (params, h) => {
|
|
147
|
+
const totalOperationList = this.selfOperationList.map(operationItem => {
|
|
148
|
+
return {
|
|
149
|
+
...operationItem,
|
|
150
|
+
...(
|
|
151
|
+
operationItem.operationFunc
|
|
152
|
+
? operationItem.operationFunc(operationItem, params.row, params.index)
|
|
153
|
+
: {}
|
|
154
|
+
)
|
|
155
|
+
};
|
|
156
|
+
});
|
|
117
157
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return {
|
|
140
|
-
...operationItem,
|
|
141
|
-
...(
|
|
142
|
-
operationItem.operationFunc
|
|
143
|
-
? operationItem.operationFunc(operationItem, params.row, params.index)
|
|
144
|
-
: {}
|
|
145
|
-
)
|
|
146
|
-
};
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
// TODO: 注意此处totalOperationList用的一定是表格行显示最多的操作按钮数组,有改动注意看此备注!!!
|
|
150
|
-
return h("dsh-buttons", {
|
|
151
|
-
class: "bri-table-td-operation",
|
|
152
|
-
props: {
|
|
153
|
-
list: totalOperationList,
|
|
154
|
-
maxFlatNum: maxBtnNum - 1,
|
|
155
|
-
itemClass: "bri-table-td-operation-btn"
|
|
156
|
-
},
|
|
157
|
-
on: {
|
|
158
|
-
click: (operationItem) => {
|
|
159
|
-
this.$dshEmit(operationItem, params.row, params.row);
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
nativeOn: {
|
|
163
|
-
click: (e) => {
|
|
164
|
-
e.stopPropagation();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
: []
|
|
172
|
-
)
|
|
173
|
-
];
|
|
174
|
-
}
|
|
158
|
+
// TODO: 注意此处totalOperationList用的一定是表格行显示最多的操作按钮数组,有改动注意看此备注!!!
|
|
159
|
+
return h("dsh-buttons", {
|
|
160
|
+
class: "bri-table-td-operation",
|
|
161
|
+
props: {
|
|
162
|
+
list: totalOperationList,
|
|
163
|
+
maxFlatNum: this.maxBtnNum - 1,
|
|
164
|
+
itemClass: "bri-table-td-operation-btn"
|
|
165
|
+
},
|
|
166
|
+
on: {
|
|
167
|
+
click: (operationItem) => {
|
|
168
|
+
this.$dshEmit(operationItem, params.row, params.row);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
nativeOn: {
|
|
172
|
+
click: (e) => {
|
|
173
|
+
e.stopPropagation();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
};
|
|
175
179
|
}
|
|
176
180
|
},
|
|
177
181
|
created () {
|
|
@@ -155,13 +155,16 @@
|
|
|
155
155
|
>
|
|
156
156
|
<dsh-list-unit
|
|
157
157
|
:canEdit="canEdit"
|
|
158
|
-
:rowIndex="rowIndex"
|
|
159
158
|
:formData="row[col.nodeKey]"
|
|
160
159
|
:formItem="{
|
|
161
160
|
...col,
|
|
162
161
|
_heightAuto: heightAuto
|
|
163
162
|
}"
|
|
164
163
|
:allFormList="subColumns"
|
|
164
|
+
:rowIndex="rowIndex"
|
|
165
|
+
:parentListData="rows"
|
|
166
|
+
:parentFormList="parentFormList"
|
|
167
|
+
:parentObj="parentObj"
|
|
165
168
|
@blur="controlBlur(null, col, row[col.nodeKey], arguments)"
|
|
166
169
|
@change="$dispatchEvent(operationMap.changeVal, col, row[col.nodeKey], arguments)"
|
|
167
170
|
></dsh-list-unit>
|
|
@@ -234,12 +237,24 @@
|
|
|
234
237
|
return [];
|
|
235
238
|
}
|
|
236
239
|
},
|
|
237
|
-
|
|
238
240
|
propsObj: {
|
|
239
241
|
type: Object,
|
|
240
242
|
default () {
|
|
241
243
|
return {};
|
|
242
244
|
}
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
parentFormList: {
|
|
248
|
+
type: Array,
|
|
249
|
+
default () {
|
|
250
|
+
return [];
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
parentObj: {
|
|
254
|
+
type: Object,
|
|
255
|
+
default () {
|
|
256
|
+
return {};
|
|
257
|
+
}
|
|
243
258
|
}
|
|
244
259
|
},
|
|
245
260
|
data () {
|
|
@@ -56,9 +56,18 @@
|
|
|
56
56
|
cellStyleOption: {
|
|
57
57
|
bodyCellClass: ({ row, column, rowIndex }) => {
|
|
58
58
|
return "bri-table-td" +
|
|
59
|
-
`${
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
`${
|
|
60
|
+
this.canEdit
|
|
61
|
+
? " bri-table-td-edit"
|
|
62
|
+
: " bri-table-td-show"
|
|
63
|
+
}` +
|
|
64
|
+
`${
|
|
65
|
+
["__isExpand__"].includes(column._key)
|
|
66
|
+
? " bri-table-td-normal"
|
|
67
|
+
: ["__index__"].includes(column._key)
|
|
68
|
+
? " bri-table-td-index"
|
|
69
|
+
: ""
|
|
70
|
+
}`;
|
|
62
71
|
}
|
|
63
72
|
},
|
|
64
73
|
// 通过实例方法 hideColumnsByKeys(keys)将列隐藏,通过实例方法 showColumnsByKeys(keys)将隐藏的列显示
|
|
@@ -69,9 +78,9 @@
|
|
|
69
78
|
},
|
|
70
79
|
showColumns () {
|
|
71
80
|
return [
|
|
72
|
-
...(this.useSelection === true ? [this.
|
|
81
|
+
...(this.useSelection === true ? [this.selectionColumn] : []),
|
|
73
82
|
this.expandColumn,
|
|
74
|
-
...(this.useIndex === true ? [this.
|
|
83
|
+
...(this.useIndex === true ? [this.indexColumn] : []),
|
|
75
84
|
...this.$transformToColumns(this.contentColumns),
|
|
76
85
|
...(this.$getOperationList(["canDelete"]).length ? [this.operationColumn] : [])
|
|
77
86
|
];
|
|
@@ -79,8 +88,9 @@
|
|
|
79
88
|
expandColumn () {
|
|
80
89
|
return {
|
|
81
90
|
// title: "开/合",
|
|
82
|
-
|
|
91
|
+
_key: "__isExpand__",
|
|
83
92
|
key: "__isExpand__",
|
|
93
|
+
field: "__isExpand__",
|
|
84
94
|
width: 46,
|
|
85
95
|
align: "center",
|
|
86
96
|
fixed: "left",
|
|
@@ -95,7 +105,6 @@
|
|
|
95
105
|
transition: "transform 0.4s"
|
|
96
106
|
},
|
|
97
107
|
props: {
|
|
98
|
-
// type: row.__isExpand__ ? "ios-arrow-down" : "ios-arrow-forward",
|
|
99
108
|
type: "ios-arrow-forward",
|
|
100
109
|
size: "14"
|
|
101
110
|
},
|
|
@@ -109,11 +118,12 @@
|
|
|
109
118
|
}
|
|
110
119
|
};
|
|
111
120
|
},
|
|
112
|
-
|
|
121
|
+
indexColumn () {
|
|
113
122
|
return {
|
|
114
123
|
title: "序号",
|
|
115
|
-
|
|
116
|
-
key: "
|
|
124
|
+
_key: "__index__",
|
|
125
|
+
key: "__index__",
|
|
126
|
+
field: "__index__",
|
|
117
127
|
width: 28 + 16 + (this.maxLevel - 1) * 36,
|
|
118
128
|
align: "left",
|
|
119
129
|
fixed: "left",
|
|
@@ -182,12 +192,12 @@
|
|
|
182
192
|
created () {},
|
|
183
193
|
methods: {
|
|
184
194
|
toggleExpand (row, bool = true) {
|
|
185
|
-
this.$set(row, "__isRendered__", true);
|
|
186
195
|
this.$set(row, "__isExpand__", bool);
|
|
187
196
|
|
|
188
|
-
row
|
|
189
|
-
|
|
190
|
-
|
|
197
|
+
// this.$set(row, "__isRendered__", true);
|
|
198
|
+
// row.children.forEach(subRow => {
|
|
199
|
+
// this.$set(subRow, "__isShow__", bool);
|
|
200
|
+
// });
|
|
191
201
|
}
|
|
192
202
|
}
|
|
193
203
|
};
|
|
@@ -30,13 +30,20 @@ export default {
|
|
|
30
30
|
return {};
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
propsObj: {
|
|
34
34
|
type: Object,
|
|
35
35
|
default () {
|
|
36
36
|
return {};
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
parentFormList: {
|
|
41
|
+
type: Array,
|
|
42
|
+
default () {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
parentObj: {
|
|
40
47
|
type: Object,
|
|
41
48
|
default () {
|
|
42
49
|
return {};
|
|
@@ -115,6 +122,7 @@ export default {
|
|
|
115
122
|
},
|
|
116
123
|
|
|
117
124
|
filterColumns () {
|
|
125
|
+
console.log(this.listData);
|
|
118
126
|
return this.columns.filter(col => this.$isAdvRelyShow(col, this.listData, this.parentObj, true));
|
|
119
127
|
},
|
|
120
128
|
selfRowDefault () {
|
|
@@ -174,10 +182,15 @@ export default {
|
|
|
174
182
|
/* --------------- 工具方法 ------------- */
|
|
175
183
|
getRowCanEdit (row) {
|
|
176
184
|
return this.canEdit && // 是否是编辑状态
|
|
177
|
-
(
|
|
185
|
+
(this.disabledOldDataRow ? !!row.__isCreate__ : true); // 是否让老数据行置灰
|
|
178
186
|
},
|
|
179
187
|
getColCanEdit (col, row) {
|
|
180
|
-
return
|
|
188
|
+
return col.dependRowCanEdit ? row.canEdit !== false : true;// 在老数据行里某些列不可编辑
|
|
189
|
+
},
|
|
190
|
+
getUnitCanEdit (col, row) {
|
|
191
|
+
return this.getRowCanEdit(row) &&
|
|
192
|
+
this.getColCanEdit(col, row) &&
|
|
193
|
+
this.$isAdvRelyShow(col, row, this.parentObj, true);
|
|
181
194
|
},
|
|
182
195
|
isShowCompare (col, row, oldRow = {}) {
|
|
183
196
|
return this.useCampare && ["number"].includes(col._type) &&
|
|
@@ -18,9 +18,9 @@ export default {
|
|
|
18
18
|
};
|
|
19
19
|
}, {
|
|
20
20
|
_id: this.$ObjectID().str,
|
|
21
|
-
|
|
21
|
+
__index__: "汇总",
|
|
22
22
|
__isExpand__: "-",
|
|
23
|
-
|
|
23
|
+
__operation__: "——"
|
|
24
24
|
})
|
|
25
25
|
];
|
|
26
26
|
} else {
|
|
@@ -33,7 +33,11 @@ export default {
|
|
|
33
33
|
maxHeight: this.contentHeight,
|
|
34
34
|
cellStyleOption: {
|
|
35
35
|
bodyCellClass: ({ row, column, rowIndex }) => {
|
|
36
|
-
return
|
|
36
|
+
return "bri-table-td" +
|
|
37
|
+
`${this.canEdit
|
|
38
|
+
? " bri-table-td-edit"
|
|
39
|
+
: " bri-table-td-show"
|
|
40
|
+
}`;
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
};
|
|
@@ -58,27 +62,29 @@ export default {
|
|
|
58
62
|
|
|
59
63
|
showColumns () {
|
|
60
64
|
return [
|
|
61
|
-
...(this.useSelection === true ? [this.
|
|
62
|
-
...(this.useIndex === true ? [this.
|
|
65
|
+
...(this.useSelection === true ? [this.selectionColumn] : []),
|
|
66
|
+
...(this.useIndex === true ? [this.indexColumn] : []),
|
|
63
67
|
...this.$transformToColumns(this.contentColumns),
|
|
64
68
|
...(this.$getOperationList(["canDelete"]).length ? [this.operationColumn] : [])
|
|
65
69
|
];
|
|
66
70
|
},
|
|
67
|
-
|
|
71
|
+
selectionColumn () {
|
|
68
72
|
return {
|
|
69
|
-
|
|
70
|
-
key: "
|
|
73
|
+
_key: "__selection__",
|
|
74
|
+
key: "__selection__",
|
|
75
|
+
field: "__selection__",
|
|
71
76
|
type: "checkbox",
|
|
72
77
|
width: 66,
|
|
73
78
|
align: "center",
|
|
74
79
|
fixed: "left"
|
|
75
80
|
};
|
|
76
81
|
},
|
|
77
|
-
|
|
82
|
+
indexColumn () {
|
|
78
83
|
return {
|
|
79
84
|
title: "序号",
|
|
80
|
-
|
|
81
|
-
key: "
|
|
85
|
+
_key: "__index__",
|
|
86
|
+
key: "__index__",
|
|
87
|
+
field: "__index__",
|
|
82
88
|
width: 76,
|
|
83
89
|
align: "center",
|
|
84
90
|
fixed: "left",
|
|
@@ -88,8 +94,9 @@ export default {
|
|
|
88
94
|
operationColumn () {
|
|
89
95
|
return {
|
|
90
96
|
title: "操作",
|
|
91
|
-
|
|
92
|
-
key: "
|
|
97
|
+
_key: "__operation__",
|
|
98
|
+
key: "__operation__",
|
|
99
|
+
field: "__operation__",
|
|
93
100
|
align: "center",
|
|
94
101
|
fixed: "right",
|
|
95
102
|
width: 100,
|
|
@@ -143,7 +150,9 @@ export default {
|
|
|
143
150
|
formItem: column,
|
|
144
151
|
rowIndex: rowIndex,
|
|
145
152
|
allFormList: this.columns,
|
|
146
|
-
parentListData: this.listData
|
|
153
|
+
parentListData: this.listData,
|
|
154
|
+
parentFormList: this.parentFormList,
|
|
155
|
+
parentObj: this.parentObj
|
|
147
156
|
},
|
|
148
157
|
on: {
|
|
149
158
|
blur: () => this.controlBlur(null, column, row, arguments),
|
|
@@ -159,7 +168,9 @@ export default {
|
|
|
159
168
|
formItem: column,
|
|
160
169
|
rowIndex: rowIndex,
|
|
161
170
|
allFormList: this.columns,
|
|
162
|
-
parentListData: this.listData
|
|
171
|
+
parentListData: this.listData,
|
|
172
|
+
parentFormList: this.parentFormList,
|
|
173
|
+
parentObj: this.parentObj
|
|
163
174
|
},
|
|
164
175
|
on: {
|
|
165
176
|
blur: () => this.controlBlur(null, column, row, arguments),
|
|
@@ -263,11 +274,6 @@ export default {
|
|
|
263
274
|
// isShare: this.isShare,
|
|
264
275
|
_heightAuto: this.heightAuto
|
|
265
276
|
};
|
|
266
|
-
},
|
|
267
|
-
getUnitCanEdit (col, row) {
|
|
268
|
-
return this.getRowCanEdit(row) &&
|
|
269
|
-
this.getColCanEdit(col, row) &&
|
|
270
|
-
this.$isAdvRelyShow(col, row, this.parentObj, true);
|
|
271
277
|
}
|
|
272
278
|
}
|
|
273
279
|
};
|
|
@@ -77,6 +77,10 @@
|
|
|
77
77
|
:value="formData"
|
|
78
78
|
:propsObj="formItem"
|
|
79
79
|
:allFormList="allFormList"
|
|
80
|
+
:rowIndex="rowIndex"
|
|
81
|
+
:parentListData="parentListData"
|
|
82
|
+
:parentFormList="parentFormList"
|
|
83
|
+
:parentObj="parentObj"
|
|
80
84
|
@change="change"
|
|
81
85
|
@refChange="refChange"
|
|
82
86
|
@changeField="changeField"
|
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
size: 'default',
|
|
24
24
|
inTable: true
|
|
25
25
|
}"
|
|
26
|
-
:rowIndex="rowIndex"
|
|
27
26
|
:allFormList="allFormList"
|
|
27
|
+
:rowIndex="rowIndex"
|
|
28
28
|
:parentListData="parentListData"
|
|
29
|
+
:parentFormList="parentFormList"
|
|
30
|
+
:parentObj="parentObj"
|
|
29
31
|
@blur="blur"
|
|
30
32
|
@change="change"
|
|
31
33
|
></component>
|
|
@@ -47,14 +49,7 @@
|
|
|
47
49
|
default: false
|
|
48
50
|
},
|
|
49
51
|
|
|
50
|
-
indexStr: String
|
|
51
|
-
rowIndex: Number,
|
|
52
|
-
parentListData: {
|
|
53
|
-
type: Array,
|
|
54
|
-
default () {
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
52
|
+
indexStr: String
|
|
58
53
|
},
|
|
59
54
|
data () {
|
|
60
55
|
return {};
|
|
@@ -24,6 +24,26 @@ export default {
|
|
|
24
24
|
default () {
|
|
25
25
|
return [];
|
|
26
26
|
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
rowIndex: Number,
|
|
30
|
+
parentListData: {
|
|
31
|
+
type: Array,
|
|
32
|
+
default () {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
parentFormList: {
|
|
37
|
+
type: Array,
|
|
38
|
+
default () {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
parentObj: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default () {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
27
47
|
}
|
|
28
48
|
},
|
|
29
49
|
data () {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
.ivu-tooltip {
|
|
2
|
-
&-rel {
|
|
2
|
+
&-rel {}
|
|
3
3
|
|
|
4
|
-
}
|
|
5
|
-
|
|
6
4
|
&-arrow {
|
|
7
5
|
border-bottom-color: @textColor !important;
|
|
8
6
|
}
|
|
@@ -37,7 +35,11 @@
|
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
// 下拉框
|
|
40
|
-
.ivu-select-dropdown {
|
|
38
|
+
.ivu-select-dropdown:not(.ivu-cascader-transfer) {
|
|
41
39
|
max-width: 420px;
|
|
42
40
|
max-height: 300px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ivu-cascader-menu {
|
|
44
|
+
max-width: 350px;
|
|
43
45
|
}
|