bri-components 1.4.86 → 1.4.88
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/mixins/controlMixin.js +6 -6
- package/src/components/controls/mixins/flatTableMixin.js +111 -0
- package/src/components/controls/senior/cascaderTable.vue +12 -12
- package/src/components/controls/senior/flatTable.vue +7 -104
- package/src/components/form/DshForm.vue +16 -18
- package/src/components/list/DshFlatTable.vue +2 -4
- package/src/components/list/mixins/tableBaseMixin.js +89 -91
- package/src/components/unit/unitMixin.js +6 -6
- package/src/utils/table.js +4 -4
package/package.json
CHANGED
|
@@ -38,17 +38,17 @@ export default {
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
rowIndex: Number,
|
|
41
|
-
parentFormList: {
|
|
42
|
-
type: Array,
|
|
43
|
-
default () {
|
|
44
|
-
return [];
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
41
|
parentObj: {
|
|
48
42
|
type: Object,
|
|
49
43
|
default () {
|
|
50
44
|
return {};
|
|
51
45
|
}
|
|
46
|
+
},
|
|
47
|
+
parentFormList: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default () {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
data () {
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import controlMixin from "./controlMixin.js";
|
|
2
|
+
import DshFlatTable from "../../list/DshFlatTable.vue";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
mixins: [
|
|
6
|
+
controlMixin
|
|
7
|
+
],
|
|
8
|
+
components: {
|
|
9
|
+
DshFlatTable
|
|
10
|
+
},
|
|
11
|
+
props: {},
|
|
12
|
+
data () {
|
|
13
|
+
return {};
|
|
14
|
+
},
|
|
15
|
+
computed: {
|
|
16
|
+
selfPropsObj () {
|
|
17
|
+
return {
|
|
18
|
+
_subForm: [],
|
|
19
|
+
_searchList: [], // 作为搜索的字段
|
|
20
|
+
_tableAdvSearch: {
|
|
21
|
+
logic: "and",
|
|
22
|
+
conditions: []
|
|
23
|
+
},
|
|
24
|
+
...this.propsObj
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
defaultPropsObj () {
|
|
28
|
+
return {
|
|
29
|
+
...this.selfPropsObj,
|
|
30
|
+
_tableAdvSearch: {
|
|
31
|
+
logic: "and",
|
|
32
|
+
conditions: []
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
subForm () {
|
|
37
|
+
return this.selfPropsObj._subForm;
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
searchList () {
|
|
41
|
+
return this.selfPropsObj._searchList;
|
|
42
|
+
},
|
|
43
|
+
searchListMap () {
|
|
44
|
+
return this.$arrToMap(this.searchList, "_key");
|
|
45
|
+
},
|
|
46
|
+
searchListFields () {
|
|
47
|
+
return this.searchList.map(searchItem => searchItem._key);
|
|
48
|
+
},
|
|
49
|
+
tableAdvSearch () {
|
|
50
|
+
return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.allFormList, this.value);
|
|
51
|
+
},
|
|
52
|
+
dftAdvSearch () {
|
|
53
|
+
return {
|
|
54
|
+
logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
|
|
55
|
+
conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
|
|
56
|
+
this.searchListFields.includes(conditionItem.fieldKey)
|
|
57
|
+
)
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
// 配置的默认筛选值里 隐藏的看不到的筛选条件
|
|
61
|
+
hideAdvSearch () {
|
|
62
|
+
return {
|
|
63
|
+
logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
|
|
64
|
+
conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
|
|
65
|
+
!this.searchListFields.includes(conditionItem.fieldKey)
|
|
66
|
+
)
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
// 过滤行数据的 最终的筛选条件
|
|
70
|
+
finalTableAdvSearch () {
|
|
71
|
+
return {
|
|
72
|
+
logic: "and",
|
|
73
|
+
conditions: [
|
|
74
|
+
this.hideAdvSearch,
|
|
75
|
+
this.dftAdvSearch
|
|
76
|
+
]
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
isSearching () {
|
|
80
|
+
return this.$isAdvSearching(this.finalTableAdvSearch);
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
curVal () {
|
|
84
|
+
return this.value[this.controlKey] || {
|
|
85
|
+
list: []
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
showVal () {
|
|
89
|
+
return `${this.curVal
|
|
90
|
+
? this.curVal.list.filter((row) =>
|
|
91
|
+
this.isSearching
|
|
92
|
+
? this.$isAdvRelyAccord(this.finalTableAdvSearch, row)
|
|
93
|
+
: true
|
|
94
|
+
).length
|
|
95
|
+
: 0
|
|
96
|
+
} 行`;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
created () { },
|
|
100
|
+
methods: {
|
|
101
|
+
// 校验方法 -供外部使用
|
|
102
|
+
validate () {
|
|
103
|
+
return this.$refs.table.validate();
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
// 发生变动
|
|
107
|
+
change (...params) {
|
|
108
|
+
this.$emit("change", ...params);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
:data="curVal.tree"
|
|
34
34
|
:rowDefault="curVal.rowDefault"
|
|
35
35
|
:columns="subForm"
|
|
36
|
+
:treeColumns="treeForm"
|
|
36
37
|
:propsObj="{
|
|
37
38
|
...selfPropsObj,
|
|
38
39
|
_contentHeight: undefined,
|
|
39
40
|
_useEnlarge: false
|
|
40
41
|
}"
|
|
41
|
-
:allFormList="allFormList"
|
|
42
42
|
:parentObj="value"
|
|
43
|
-
:
|
|
43
|
+
:parentFormList="allFormList"
|
|
44
44
|
></dsh-cascader-table>
|
|
45
45
|
|
|
46
46
|
<!-- 横向层级表格 -->
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
:data="curVal.tree"
|
|
57
57
|
:rowDefault="curVal.rowDefault"
|
|
58
58
|
:columns="subForm"
|
|
59
|
+
:treeColumns="treeForm"
|
|
59
60
|
:propsObj="{
|
|
60
61
|
...selfPropsObj,
|
|
61
62
|
_contentHeight: undefined,
|
|
62
63
|
_useEnlarge: false
|
|
63
64
|
}"
|
|
64
|
-
:allFormList="allFormList"
|
|
65
65
|
:parentObj="value"
|
|
66
|
-
:
|
|
66
|
+
:parentFormList="allFormList"
|
|
67
67
|
></dsh-tree-table>
|
|
68
68
|
</div>
|
|
69
69
|
</dsh-modal>
|
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
:data="curVal.tree"
|
|
83
83
|
:rowDefault="curVal.rowDefault"
|
|
84
84
|
:columns="subForm"
|
|
85
|
+
:treeColumns="treeForm"
|
|
85
86
|
:propsObj="defaultPropsObj"
|
|
86
|
-
:allFormList="allFormList"
|
|
87
87
|
:parentObj="value"
|
|
88
|
-
:
|
|
88
|
+
:parentFormList="allFormList"
|
|
89
89
|
@change="change"
|
|
90
90
|
></dsh-cascader-table>
|
|
91
91
|
|
|
@@ -102,10 +102,10 @@
|
|
|
102
102
|
:data="curVal.tree"
|
|
103
103
|
:rowDefault="curVal.rowDefault"
|
|
104
104
|
:columns="subForm"
|
|
105
|
+
:treeColumns="treeForm"
|
|
105
106
|
:propsObj="defaultPropsObj"
|
|
106
|
-
:allFormList="allFormList"
|
|
107
107
|
:parentObj="value"
|
|
108
|
-
:
|
|
108
|
+
:parentFormList="allFormList"
|
|
109
109
|
@change="change"
|
|
110
110
|
></dsh-tree-table>
|
|
111
111
|
</template>
|
|
@@ -122,10 +122,10 @@
|
|
|
122
122
|
:data="curVal.tree"
|
|
123
123
|
:rowDefault="curVal.rowDefault"
|
|
124
124
|
:columns="subForm"
|
|
125
|
+
:treeColumns="treeForm"
|
|
125
126
|
:propsObj="selfPropsObj"
|
|
126
|
-
:allFormList="allFormList"
|
|
127
127
|
:parentObj="value"
|
|
128
|
-
:
|
|
128
|
+
:parentFormList="allFormList"
|
|
129
129
|
@change="change"
|
|
130
130
|
></dsh-cascader-table>
|
|
131
131
|
|
|
@@ -143,10 +143,10 @@
|
|
|
143
143
|
:data="curVal.tree"
|
|
144
144
|
:rowDefault="curVal.rowDefault"
|
|
145
145
|
:columns="subForm"
|
|
146
|
+
:treeColumns="treeForm"
|
|
146
147
|
:propsObj="selfPropsObj"
|
|
147
|
-
:allFormList="allFormList"
|
|
148
148
|
:parentObj="value"
|
|
149
|
-
:
|
|
149
|
+
:parentFormList="allFormList"
|
|
150
150
|
@change="change"
|
|
151
151
|
></dsh-tree-table>
|
|
152
152
|
</template>
|
|
@@ -36,9 +36,8 @@
|
|
|
36
36
|
_contentHeight: undefined,
|
|
37
37
|
_useEnlarge: false
|
|
38
38
|
}"
|
|
39
|
-
:compareData="curVal.oldList"
|
|
40
|
-
:allFormList="allFormList"
|
|
41
39
|
:parentObj="value"
|
|
40
|
+
:parentFormList="allFormList"
|
|
42
41
|
></dsh-flat-table>
|
|
43
42
|
</div>
|
|
44
43
|
</dsh-modal>
|
|
@@ -55,8 +54,8 @@
|
|
|
55
54
|
:rowDefault="curVal.rowDefault"
|
|
56
55
|
:columns="subForm"
|
|
57
56
|
:propsObj="defaultPropsObj"
|
|
58
|
-
:allFormList="allFormList"
|
|
59
57
|
:parentObj="value"
|
|
58
|
+
:parentFormList="allFormList"
|
|
60
59
|
@change="change"
|
|
61
60
|
></dsh-flat-table>
|
|
62
61
|
</dsh-btn-modal>
|
|
@@ -71,9 +70,8 @@
|
|
|
71
70
|
:rowDefault="curVal.rowDefault"
|
|
72
71
|
:columns="subForm"
|
|
73
72
|
:propsObj="propsObj"
|
|
74
|
-
:compareData="curVal.oldList"
|
|
75
|
-
:allFormList="allFormList"
|
|
76
73
|
:parentObj="value"
|
|
74
|
+
:parentFormList="allFormList"
|
|
77
75
|
@change="change"
|
|
78
76
|
></dsh-flat-table>
|
|
79
77
|
</template>
|
|
@@ -81,119 +79,24 @@
|
|
|
81
79
|
</template>
|
|
82
80
|
|
|
83
81
|
<script>
|
|
84
|
-
import
|
|
85
|
-
import DshFlatTable from "../../list/DshFlatTable.vue";
|
|
82
|
+
import flatTableMixin from "../mixins/flatTableMixin.js";
|
|
86
83
|
import DshBtnModal from "../../small/DshBtnModal.vue";
|
|
87
84
|
|
|
88
85
|
export default {
|
|
89
86
|
name: "flatTable",
|
|
90
87
|
mixins: [
|
|
91
|
-
|
|
88
|
+
flatTableMixin
|
|
92
89
|
],
|
|
93
90
|
components: {
|
|
94
|
-
DshFlatTable,
|
|
95
91
|
DshBtnModal
|
|
96
92
|
},
|
|
97
93
|
props: {},
|
|
98
94
|
data () {
|
|
99
95
|
return {};
|
|
100
96
|
},
|
|
101
|
-
computed: {
|
|
102
|
-
selfPropsObj () {
|
|
103
|
-
return {
|
|
104
|
-
_subForm: [],
|
|
105
|
-
_searchList: [], // 作为搜索的字段
|
|
106
|
-
_tableAdvSearch: {
|
|
107
|
-
logic: "and",
|
|
108
|
-
conditions: []
|
|
109
|
-
},
|
|
110
|
-
...this.propsObj
|
|
111
|
-
};
|
|
112
|
-
},
|
|
113
|
-
defaultPropsObj () {
|
|
114
|
-
return {
|
|
115
|
-
...this.selfPropsObj,
|
|
116
|
-
_tableAdvSearch: {
|
|
117
|
-
logic: "and",
|
|
118
|
-
conditions: []
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
},
|
|
122
|
-
subForm () {
|
|
123
|
-
return this.selfPropsObj._subForm;
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
searchList () {
|
|
127
|
-
return this.selfPropsObj._searchList;
|
|
128
|
-
},
|
|
129
|
-
searchListMap () {
|
|
130
|
-
return this.$arrToMap(this.searchList, "_key");
|
|
131
|
-
},
|
|
132
|
-
searchListFields () {
|
|
133
|
-
return this.searchList.map(searchItem => searchItem._key);
|
|
134
|
-
},
|
|
135
|
-
tableAdvSearch () {
|
|
136
|
-
return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.allFormList, this.value);
|
|
137
|
-
},
|
|
138
|
-
dftAdvSearch () {
|
|
139
|
-
return {
|
|
140
|
-
logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
|
|
141
|
-
conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
|
|
142
|
-
this.searchListFields.includes(conditionItem.fieldKey)
|
|
143
|
-
)
|
|
144
|
-
};
|
|
145
|
-
},
|
|
146
|
-
// 配置的默认筛选值里 隐藏的看不到的筛选条件
|
|
147
|
-
hideAdvSearch () {
|
|
148
|
-
return {
|
|
149
|
-
logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
|
|
150
|
-
conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
|
|
151
|
-
!this.searchListFields.includes(conditionItem.fieldKey)
|
|
152
|
-
)
|
|
153
|
-
};
|
|
154
|
-
},
|
|
155
|
-
// 过滤行数据的 最终的筛选条件
|
|
156
|
-
finalTableAdvSearch () {
|
|
157
|
-
return {
|
|
158
|
-
logic: "and",
|
|
159
|
-
conditions: [
|
|
160
|
-
this.hideAdvSearch,
|
|
161
|
-
this.dftAdvSearch
|
|
162
|
-
]
|
|
163
|
-
};
|
|
164
|
-
},
|
|
165
|
-
isSearching () {
|
|
166
|
-
return this.$isAdvSearching(this.finalTableAdvSearch);
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
curVal () {
|
|
170
|
-
return this.value[this.controlKey] || {
|
|
171
|
-
list: []
|
|
172
|
-
};
|
|
173
|
-
},
|
|
174
|
-
showVal () {
|
|
175
|
-
return `${
|
|
176
|
-
this.curVal
|
|
177
|
-
? this.curVal.list.filter((row) =>
|
|
178
|
-
this.isSearching
|
|
179
|
-
? this.$isAdvRelyAccord(this.finalTableAdvSearch, row)
|
|
180
|
-
: true
|
|
181
|
-
).length
|
|
182
|
-
: 0
|
|
183
|
-
} 行`;
|
|
184
|
-
}
|
|
185
|
-
},
|
|
97
|
+
computed: {},
|
|
186
98
|
created () {},
|
|
187
|
-
methods: {
|
|
188
|
-
// 校验方法 -供外部使用
|
|
189
|
-
validate () {
|
|
190
|
-
return this.$refs.table.validate();
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
change (...params) {
|
|
194
|
-
this.$emit("change", ...params);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
99
|
+
methods: {}
|
|
197
100
|
};
|
|
198
101
|
</script>
|
|
199
102
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
:canEdit="canEdit"
|
|
28
28
|
:formData="formData"
|
|
29
29
|
:formItem="formItem"
|
|
30
|
-
:allFormList="
|
|
30
|
+
:allFormList="selfAllFormList"
|
|
31
31
|
:inTableType="inTableType"
|
|
32
32
|
:allListRows="allListRows"
|
|
33
33
|
:rowIndex="rowIndex"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
:canEdit="canEdit"
|
|
47
47
|
:formItem="formItem"
|
|
48
48
|
:formData="formData"
|
|
49
|
-
:allFormList="
|
|
49
|
+
:allFormList="selfAllFormList"
|
|
50
50
|
></slot>
|
|
51
51
|
|
|
52
52
|
<slot
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
:canEdit="canEdit"
|
|
56
56
|
:formItem="formItem"
|
|
57
57
|
:formData="formData"
|
|
58
|
-
:allFormList="
|
|
58
|
+
:allFormList="selfAllFormList"
|
|
59
59
|
></slot>
|
|
60
60
|
|
|
61
61
|
<slot
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
:canEdit="canEdit"
|
|
65
65
|
:formItem="formItem"
|
|
66
66
|
:formData="formData"
|
|
67
|
-
:allFormList="
|
|
67
|
+
:allFormList="selfAllFormList"
|
|
68
68
|
></slot>
|
|
69
69
|
|
|
70
70
|
<slot
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
:canEdit="canEdit"
|
|
74
74
|
:formItem="formItem"
|
|
75
75
|
:formData="formData"
|
|
76
|
-
:allFormList="
|
|
76
|
+
:allFormList="selfAllFormList"
|
|
77
77
|
></slot>
|
|
78
78
|
</dsh-form-unit>
|
|
79
79
|
</FormItem>
|
|
@@ -108,11 +108,6 @@
|
|
|
108
108
|
DshFormUnit
|
|
109
109
|
},
|
|
110
110
|
props: {
|
|
111
|
-
// // 启用该参数后,查看状态时,空值字段不显示
|
|
112
|
-
// notShowEmpty: {
|
|
113
|
-
// type: Boolean,
|
|
114
|
-
// default: false
|
|
115
|
-
// },
|
|
116
111
|
canEdit: {
|
|
117
112
|
type: Boolean,
|
|
118
113
|
default: true
|
|
@@ -150,18 +145,18 @@
|
|
|
150
145
|
}
|
|
151
146
|
},
|
|
152
147
|
rowIndex: Number,
|
|
153
|
-
parentFormList: {
|
|
154
|
-
type: Array,
|
|
155
|
-
default () {
|
|
156
|
-
return [];
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
148
|
parentObj: {
|
|
160
149
|
type: Object,
|
|
161
150
|
default () {
|
|
162
151
|
return {};
|
|
163
152
|
}
|
|
164
153
|
},
|
|
154
|
+
parentFormList: {
|
|
155
|
+
type: Array,
|
|
156
|
+
default () {
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
},
|
|
165
160
|
|
|
166
161
|
changedFields: {
|
|
167
162
|
type: Array,
|
|
@@ -209,6 +204,9 @@
|
|
|
209
204
|
};
|
|
210
205
|
},
|
|
211
206
|
computed: {
|
|
207
|
+
selfAllFormList () {
|
|
208
|
+
return this.allFormList.length ? this.allFormList : this.formList;
|
|
209
|
+
},
|
|
212
210
|
showFormList () {
|
|
213
211
|
return this.formList.filter(formItem => this.isShow(formItem, this.formData, this.parentObj));
|
|
214
212
|
}
|
|
@@ -229,7 +227,7 @@
|
|
|
229
227
|
},
|
|
230
228
|
// 初始化监测 -监测所有字段
|
|
231
229
|
initMonitor () {
|
|
232
|
-
|
|
230
|
+
this.selfAllFormList.forEach(formItem => {
|
|
233
231
|
this.$set(this.formData, formItem._key, this.formData[formItem._key]);
|
|
234
232
|
});
|
|
235
233
|
},
|
|
@@ -428,7 +426,7 @@
|
|
|
428
426
|
trigger: "blur, change",
|
|
429
427
|
type: "string",
|
|
430
428
|
transform: (val) => {
|
|
431
|
-
return this.$normalComparedFunc(formItem, this.formData, this.
|
|
429
|
+
return this.$normalComparedFunc(formItem, this.formData, this.selfAllFormList, this.parentObj, this.parentFormList, this.inTableType, ruleObj)
|
|
432
430
|
? val
|
|
433
431
|
: false;
|
|
434
432
|
},
|
|
@@ -31,11 +31,10 @@
|
|
|
31
31
|
:canEdit="getRowCanEdit(row, rowIndex)"
|
|
32
32
|
:formData="row"
|
|
33
33
|
:formList="getRowFormList(row, rowIndex)"
|
|
34
|
-
:allFormList="getRowFormList(row, rowIndex)"
|
|
35
34
|
:inTableType="inTableType"
|
|
36
35
|
:allListRows="allListData"
|
|
37
36
|
:rowIndex="rowIndex"
|
|
38
|
-
:parentFormList="
|
|
37
|
+
:parentFormList="parentFormList"
|
|
39
38
|
:parentObj="parentObj"
|
|
40
39
|
></dsh-form>
|
|
41
40
|
|
|
@@ -141,11 +140,10 @@
|
|
|
141
140
|
:canEdit="getRowCanEdit(row, rowIndex)"
|
|
142
141
|
:formData="row"
|
|
143
142
|
:formList="getRowFormList(row, rowIndex)"
|
|
144
|
-
:allFormList="getRowFormList(row, rowIndex)"
|
|
145
143
|
:inTableType="inTableType"
|
|
146
144
|
:allListRows="allListData"
|
|
147
145
|
:rowIndex="rowIndex"
|
|
148
|
-
:parentFormList="
|
|
146
|
+
:parentFormList="parentFormList"
|
|
149
147
|
:parentObj="parentObj"
|
|
150
148
|
></dsh-form>
|
|
151
149
|
|
|
@@ -45,25 +45,25 @@ export default {
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
type:
|
|
48
|
+
parentObj: {
|
|
49
|
+
type: Object,
|
|
50
50
|
default () {
|
|
51
|
-
return
|
|
51
|
+
return {};
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
|
-
|
|
55
|
-
allFormList: {
|
|
54
|
+
parentFormList: {
|
|
56
55
|
type: Array,
|
|
57
56
|
default () {
|
|
58
57
|
return [];
|
|
59
58
|
}
|
|
60
|
-
},
|
|
61
|
-
parentObj: {
|
|
62
|
-
type: Object,
|
|
63
|
-
default () {
|
|
64
|
-
return {};
|
|
65
|
-
}
|
|
66
59
|
}
|
|
60
|
+
|
|
61
|
+
// compareData: {
|
|
62
|
+
// type: Array,
|
|
63
|
+
// default () {
|
|
64
|
+
// return [];
|
|
65
|
+
// }
|
|
66
|
+
// }
|
|
67
67
|
},
|
|
68
68
|
data () {
|
|
69
69
|
return {
|
|
@@ -395,7 +395,7 @@ export default {
|
|
|
395
395
|
}));
|
|
396
396
|
},
|
|
397
397
|
tableAdvSearch () {
|
|
398
|
-
return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.
|
|
398
|
+
return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.parentFormList, this.parentObj);
|
|
399
399
|
},
|
|
400
400
|
// 默认筛选配置里-隐藏的筛选条件
|
|
401
401
|
hideAdvSearch () {
|
|
@@ -562,7 +562,7 @@ export default {
|
|
|
562
562
|
return this.selfPropsObj._quoteListFields;
|
|
563
563
|
},
|
|
564
564
|
quoteAdvSearch () {
|
|
565
|
-
return this.$transformAdvSearch(this.selfPropsObj._quoteAdvSearch, this.
|
|
565
|
+
return this.$transformAdvSearch(this.selfPropsObj._quoteAdvSearch, this.parentFormList, this.parentObj);
|
|
566
566
|
},
|
|
567
567
|
quoteParams () {
|
|
568
568
|
return {
|
|
@@ -669,18 +669,18 @@ export default {
|
|
|
669
669
|
});
|
|
670
670
|
}, {});
|
|
671
671
|
},
|
|
672
|
-
compareListData () {
|
|
673
|
-
this.compareData.forEach(item => {
|
|
674
|
-
!item._id && this.$set(item, "_id", this.$ObjectID().str);
|
|
675
|
-
});
|
|
676
|
-
return this.compareData;
|
|
677
|
-
},
|
|
678
|
-
useCampare () {
|
|
679
|
-
return !!this.compareListData.length;
|
|
680
|
-
},
|
|
681
672
|
parentDataId () {
|
|
682
673
|
return this.parentObj._id;
|
|
683
674
|
},
|
|
675
|
+
// compareListData () {
|
|
676
|
+
// this.compareData.forEach(item => {
|
|
677
|
+
// !item._id && this.$set(item, "_id", this.$ObjectID().str);
|
|
678
|
+
// });
|
|
679
|
+
// return this.compareData;
|
|
680
|
+
// },
|
|
681
|
+
// useCampare () {
|
|
682
|
+
// return !!this.compareListData.length;
|
|
683
|
+
// },
|
|
684
684
|
|
|
685
685
|
/* --- 功能按钮 --- */
|
|
686
686
|
baseOperationBtns () {
|
|
@@ -1221,65 +1221,63 @@ export default {
|
|
|
1221
1221
|
const ruleResultObj = this.getColRuleResult({ row, rowIndex, column });
|
|
1222
1222
|
|
|
1223
1223
|
return [
|
|
1224
|
-
this.isShowCompare({ row, rowIndex, column })
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
}
|
|
1261
|
-
:
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
...column,
|
|
1268
|
-
_key: column.colType === "tree" ? "name" : column._key
|
|
1269
|
-
},
|
|
1270
|
-
allFormList: this.selfColumns,
|
|
1271
|
-
inTableType: this.inTableType,
|
|
1272
|
-
allListRows: this.allListData,
|
|
1273
|
-
rowIndex: rowIndex,
|
|
1274
|
-
parentFormList: this.allFormList,
|
|
1275
|
-
parentObj: this.parentObj
|
|
1224
|
+
// this.isShowCompare({ row, rowIndex, column })
|
|
1225
|
+
// ? h("Tooltip", {
|
|
1226
|
+
// style: {
|
|
1227
|
+
// width: "100%"
|
|
1228
|
+
// },
|
|
1229
|
+
// props: {
|
|
1230
|
+
// content: this.$isEmptyData(this.compareListData[rowIndex][column._key]) ? "" : this.compareListData[rowIndex][column._key],
|
|
1231
|
+
// transfer: true,
|
|
1232
|
+
// maxWidth: 200,
|
|
1233
|
+
// placement: "top"
|
|
1234
|
+
// },
|
|
1235
|
+
// scopedSlots: {
|
|
1236
|
+
// default: props => h("dsh-list-unit", {
|
|
1237
|
+
// props: {
|
|
1238
|
+
// canEdit: unitCanEdit,
|
|
1239
|
+
// formData: row,
|
|
1240
|
+
// formItem: {
|
|
1241
|
+
// ...column,
|
|
1242
|
+
// _key: column.colType === "tree" ? "name" : column._key
|
|
1243
|
+
// },
|
|
1244
|
+
// allFormList: this.selfColumns,
|
|
1245
|
+
// inTableType: this.inTableType,
|
|
1246
|
+
// allListRows: this.allListData,
|
|
1247
|
+
// rowIndex: rowIndex,
|
|
1248
|
+
// parentFormList: this.parentFormList,
|
|
1249
|
+
// parentObj: this.parentObj
|
|
1250
|
+
// },
|
|
1251
|
+
// on: {
|
|
1252
|
+
// blur: () => this.controlBlur(null, row, rowIndex, column, arguments),
|
|
1253
|
+
// quickChange: () => this.$dispatchEvent(this.operationMap.canQuickChangeVal, row, rowIndex, column, arguments),
|
|
1254
|
+
// change: () => this.$dispatchEvent(this.operationMap.canChangeVal, row, rowIndex, column, arguments)
|
|
1255
|
+
// }
|
|
1256
|
+
// })
|
|
1257
|
+
// }
|
|
1258
|
+
// })
|
|
1259
|
+
h("dsh-list-unit", {
|
|
1260
|
+
key: `${row._id}--${column._key}`,
|
|
1261
|
+
props: {
|
|
1262
|
+
canEdit: unitCanEdit,
|
|
1263
|
+
formData: row,
|
|
1264
|
+
formItem: {
|
|
1265
|
+
...column,
|
|
1266
|
+
_key: column.colType === "tree" ? "name" : column._key
|
|
1276
1267
|
},
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1268
|
+
allFormList: this.selfColumns,
|
|
1269
|
+
inTableType: this.inTableType,
|
|
1270
|
+
allListRows: this.allListData,
|
|
1271
|
+
rowIndex: rowIndex,
|
|
1272
|
+
parentFormList: this.parentFormList,
|
|
1273
|
+
parentObj: this.parentObj
|
|
1274
|
+
},
|
|
1275
|
+
on: {
|
|
1276
|
+
blur: () => this.controlBlur(null, row, rowIndex, column, arguments),
|
|
1277
|
+
quickChange: () => this.$dispatchEvent(this.operationMap.canQuickChangeVal, row, rowIndex, column, arguments),
|
|
1278
|
+
change: () => this.$dispatchEvent(this.operationMap.canChangeVal, row, rowIndex, column, arguments)
|
|
1279
|
+
}
|
|
1280
|
+
}),
|
|
1283
1281
|
|
|
1284
1282
|
// 校验文字
|
|
1285
1283
|
!ruleResultObj.bool
|
|
@@ -1491,7 +1489,7 @@ export default {
|
|
|
1491
1489
|
// 校验必填不通过 => 校验对比
|
|
1492
1490
|
const resultObj = {};
|
|
1493
1491
|
this.$getFieldRuleResult(column, row, resultObj) &&
|
|
1494
|
-
this.$normalComparedFunc(column, row, this.selfColumns, this.parentObj, this.
|
|
1492
|
+
this.$normalComparedFunc(column, row, this.selfColumns, this.parentObj, this.parentFormList, this.inTableType, resultObj) &&
|
|
1495
1493
|
this.$levelComparedFunc(column, row, this.allListData, this.inTableType, resultObj);
|
|
1496
1494
|
|
|
1497
1495
|
return resultObj;
|
|
@@ -1623,17 +1621,17 @@ export default {
|
|
|
1623
1621
|
return parentRow;
|
|
1624
1622
|
}
|
|
1625
1623
|
},
|
|
1626
|
-
// 单元格是否显示对比
|
|
1627
|
-
isShowCompare ({ row, rowIndex, column }) {
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1624
|
+
// // 单元格是否显示对比
|
|
1625
|
+
// isShowCompare ({ row, rowIndex, column }) {
|
|
1626
|
+
// const oldRow = this.compareListData[rowIndex] || {};
|
|
1627
|
+
// const curVal = row[column._key];
|
|
1628
|
+
// const oldVal = oldRow[column._key];
|
|
1631
1629
|
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
},
|
|
1630
|
+
// return this.useCampare &&
|
|
1631
|
+
// ["number"].includes(column._type) &&
|
|
1632
|
+
// !(this.$isEmptyData(curVal) && this.$isEmptyData(oldVal)) &&
|
|
1633
|
+
// curVal !== oldVal;
|
|
1634
|
+
// },
|
|
1637
1635
|
// 比较两行某列的值是否相等
|
|
1638
1636
|
isCompareSame (column, row, compareRow) {
|
|
1639
1637
|
const curColKey = column ? column._key : undefined;
|
|
@@ -40,17 +40,17 @@ export default {
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
rowIndex: Number,
|
|
43
|
-
parentFormList: {
|
|
44
|
-
type: Array,
|
|
45
|
-
default () {
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
43
|
parentObj: {
|
|
50
44
|
type: Object,
|
|
51
45
|
default () {
|
|
52
46
|
return {};
|
|
53
47
|
}
|
|
48
|
+
},
|
|
49
|
+
parentFormList: {
|
|
50
|
+
type: Array,
|
|
51
|
+
default () {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
data () {
|
package/src/utils/table.js
CHANGED
|
@@ -61,13 +61,13 @@ const getHeadRender = function (h, column, {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
// 转化表单字段属性 to 表格参数, 是否需要过滤tag
|
|
64
|
-
const transformToColumns = function (
|
|
64
|
+
const transformToColumns = function (formList, {
|
|
65
65
|
showHeadFilter = false,
|
|
66
66
|
showRequired = false,
|
|
67
67
|
showDescription = false,
|
|
68
68
|
headHeightAuto = false
|
|
69
69
|
} = {}, allFormList = []) {
|
|
70
|
-
return
|
|
70
|
+
return formList
|
|
71
71
|
.map(col => {
|
|
72
72
|
const typeData = this.$modFieldMap[col._type] || {};
|
|
73
73
|
const typeWidth = typeData.width + (col._type === "number" && col._unit ? col._unit.length * 16 : 0);
|
|
@@ -154,7 +154,7 @@ const transformToColumns = function (form, {
|
|
|
154
154
|
rowIndex: rowIndex,
|
|
155
155
|
formData: row,
|
|
156
156
|
formItem: col,
|
|
157
|
-
allFormList: allFormList
|
|
157
|
+
allFormList: allFormList.length ? allFormList : formList
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
160
|
}
|
|
@@ -162,7 +162,7 @@ const transformToColumns = function (form, {
|
|
|
162
162
|
|
|
163
163
|
...col
|
|
164
164
|
};
|
|
165
|
-
|
|
165
|
+
});
|
|
166
166
|
};
|
|
167
167
|
|
|
168
168
|
export default {
|