bri-components 1.3.52 → 1.3.54
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/DshDate/DshDate.vue +1 -1
- package/src/components/controls/controlMap.js +1 -1
- package/src/components/controls/mixins/controlMixin.js +2 -2
- package/src/components/controls/senior/cascaderTable.vue +21 -13
- package/src/components/controls/senior/{flatTable/flatTable.vue → flatTable.vue} +5 -5
- package/src/components/form/DshAdvSearch.vue +13 -8
- package/src/components/form/DshForm.vue +4 -3
- package/src/components/form/searchMixin.js +59 -39
- package/src/components/list/DshCascaderTable.vue +36 -4
- package/src/components/list/DshTreeTable.vue +8 -5
- package/src/components/list/mixins/tableBaseMixin.js +26 -24
- package/src/components/unit/DshFormUnit.vue +1 -1
- package/src/components/unit/DshListUnit.vue +1 -1
- package/src/components/unit/unitMixin.js +2 -1
package/package.json
CHANGED
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
bool: true
|
|
136
136
|
};
|
|
137
137
|
if (this.isInTable && this.writeSort === "upToDown" && this.value.level !== 1) {
|
|
138
|
-
const parentRow = this.
|
|
138
|
+
const parentRow = this.allListRows.find(row =>
|
|
139
139
|
row.level === this.value.level - 1 && row.children.some(childNode => childNode._id === this.value._id)
|
|
140
140
|
) || {};
|
|
141
141
|
const parentDateStr = parentRow[this.controlKey];
|
|
@@ -70,7 +70,7 @@ const pathMap = {
|
|
|
70
70
|
selectDepartments: "./senior/selectDepartments.vue",
|
|
71
71
|
BriLabels: "./senior/BriLabels.vue",
|
|
72
72
|
DshPackage: "./senior/DshPackage.vue",
|
|
73
|
-
flatTable: "./senior/flatTable
|
|
73
|
+
flatTable: "./senior/flatTable.vue",
|
|
74
74
|
cascaderTable: "./senior/cascaderTable"
|
|
75
75
|
},
|
|
76
76
|
special: {
|
|
@@ -25,13 +25,13 @@ export default {
|
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
/* 内部表,层级表内的字段用到的 */
|
|
28
|
-
|
|
29
|
-
parentListData: {
|
|
28
|
+
allListRows: {
|
|
30
29
|
type: Array,
|
|
31
30
|
default () {
|
|
32
31
|
return [];
|
|
33
32
|
}
|
|
34
33
|
},
|
|
34
|
+
rowIndex: Number,
|
|
35
35
|
parentFormList: {
|
|
36
36
|
type: Array,
|
|
37
37
|
default () {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
<template v-else>
|
|
17
17
|
<!-- 配置端 设置默认值用-->
|
|
18
|
-
<dsh-btn-modal v-if="
|
|
18
|
+
<dsh-btn-modal v-if="selfPropsObj._key === '_default'">
|
|
19
19
|
<template>
|
|
20
20
|
<dsh-tree-table
|
|
21
21
|
v-if="showMode === 'treeTable'"
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
:data="curVal.tree"
|
|
24
24
|
:rowDefault="curVal.rowDefault"
|
|
25
25
|
:columns="subForm"
|
|
26
|
-
:propsObj="
|
|
27
|
-
:
|
|
26
|
+
:propsObj="defaultPropsObj"
|
|
27
|
+
:allFormList="allFormList"
|
|
28
28
|
:parentObj="value"
|
|
29
29
|
@change="change"
|
|
30
30
|
></dsh-tree-table>
|
|
@@ -35,9 +35,8 @@
|
|
|
35
35
|
:rowDefault="curVal.rowDefault"
|
|
36
36
|
:columns="subForm"
|
|
37
37
|
:data="curVal"
|
|
38
|
-
:
|
|
39
|
-
:
|
|
40
|
-
:parentFormList="allFormList"
|
|
38
|
+
:propsObj="defaultPropsObj"
|
|
39
|
+
:allFormList="allFormList"
|
|
41
40
|
:parentObj="value"
|
|
42
41
|
@change="change"
|
|
43
42
|
></dsh-cascader-table>
|
|
@@ -54,8 +53,8 @@
|
|
|
54
53
|
:data="curVal.tree"
|
|
55
54
|
:rowDefault="curVal.rowDefault"
|
|
56
55
|
:columns="subForm"
|
|
57
|
-
:propsObj="
|
|
58
|
-
:
|
|
56
|
+
:propsObj="selfPropsObj"
|
|
57
|
+
:allFormList="allFormList"
|
|
59
58
|
:parentObj="value"
|
|
60
59
|
@change="change"
|
|
61
60
|
></dsh-tree-table>
|
|
@@ -69,8 +68,8 @@
|
|
|
69
68
|
:columns="subForm"
|
|
70
69
|
:data="curVal"
|
|
71
70
|
:treeColumns="treeForm"
|
|
72
|
-
:propsObj="
|
|
73
|
-
:
|
|
71
|
+
:propsObj="selfPropsObj"
|
|
72
|
+
:allFormList="allFormList"
|
|
74
73
|
:parentObj="value"
|
|
75
74
|
@change="change"
|
|
76
75
|
></dsh-cascader-table>
|
|
@@ -108,17 +107,26 @@
|
|
|
108
107
|
...this.propsObj
|
|
109
108
|
};
|
|
110
109
|
},
|
|
110
|
+
defaultPropsObj () {
|
|
111
|
+
return {
|
|
112
|
+
...this.selfPropsObj,
|
|
113
|
+
_tableAdvSearch: {
|
|
114
|
+
logic: "and",
|
|
115
|
+
conditions: []
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
},
|
|
111
119
|
showMode () {
|
|
112
|
-
return this.
|
|
120
|
+
return this.selfPropsObj._showMode;
|
|
113
121
|
},
|
|
114
122
|
subForm () {
|
|
115
|
-
return this.
|
|
123
|
+
return this.selfPropsObj._subForm;
|
|
116
124
|
},
|
|
117
125
|
// 用户态的每条数据的表头配置,都是存的自己的,不用通用配置_treeForm的
|
|
118
126
|
treeForm () {
|
|
119
127
|
return this.curVal && this.curVal._treeForm
|
|
120
128
|
? this.curVal._treeForm
|
|
121
|
-
: this.
|
|
129
|
+
: this.selfPropsObj._treeForm;
|
|
122
130
|
},
|
|
123
131
|
|
|
124
132
|
showVal () {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
:rowDefault="curVal.rowDefault"
|
|
24
24
|
:columns="subForm"
|
|
25
25
|
:propsObj="propsObj"
|
|
26
|
-
:
|
|
26
|
+
:allFormList="allFormList"
|
|
27
27
|
:parentObj="value"
|
|
28
28
|
@change="change"
|
|
29
29
|
></dsh-flat-table>
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
:rowDefault="curVal.rowDefault"
|
|
40
40
|
:columns="subForm"
|
|
41
41
|
:propsObj="propsObj"
|
|
42
|
-
:
|
|
42
|
+
:allFormList="allFormList"
|
|
43
43
|
:parentObj="value"
|
|
44
44
|
@change="change"
|
|
45
45
|
></dsh-flat-table>
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
</template>
|
|
49
49
|
|
|
50
50
|
<script>
|
|
51
|
-
import controlMixin from "
|
|
52
|
-
import DshFlatTable from "
|
|
53
|
-
import DshBtnModal from "
|
|
51
|
+
import controlMixin from "../mixins/controlMixin.js";
|
|
52
|
+
import DshFlatTable from "../../list/DshFlatTable.vue";
|
|
53
|
+
import DshBtnModal from "../../small/DshBtnModal.vue";
|
|
54
54
|
|
|
55
55
|
export default {
|
|
56
56
|
name: "flatTable",
|
|
@@ -65,14 +65,15 @@
|
|
|
65
65
|
>
|
|
66
66
|
<template v-if="!conditionItem.__isDelete__">
|
|
67
67
|
<slot :conditionItem="conditionItem">
|
|
68
|
-
<!-- 为空和不为空时
|
|
68
|
+
<!-- 为空和不为空时 啥内容也不显示 -->
|
|
69
69
|
<div
|
|
70
70
|
v-if="['isnull', 'notnull', 'nosize', 'size', 'nolist', 'list'].includes(conditionItem.fieldOperator)"
|
|
71
71
|
class="DshAdvSearch-conditions-item-blank"
|
|
72
72
|
>请选择右上角条件</div>
|
|
73
73
|
|
|
74
|
-
<!--
|
|
75
|
-
<template v-else-if="['subSearch', 'subTableSearch'].includes(conditionItem.fieldOperator)">
|
|
74
|
+
<!-- 子表的筛选,递归 -->
|
|
75
|
+
<template v-else-if="['subSearch', 'subTableSearch', 'cascaderTableSearch', 'treeTableSearch'].includes(conditionItem.fieldOperator)">
|
|
76
|
+
<!-- 出现是有条件的 -->
|
|
76
77
|
<dsh-adv-search
|
|
77
78
|
v-if="conditionItem.finished === true"
|
|
78
79
|
style="padding: 0px 0px 0px 8px;"
|
|
@@ -94,7 +95,7 @@
|
|
|
94
95
|
>加载中……</div>
|
|
95
96
|
</template>
|
|
96
97
|
|
|
97
|
-
<!--
|
|
98
|
+
<!-- 其他 -->
|
|
98
99
|
<template v-else>
|
|
99
100
|
<!-- 动态文本 -匹配的动态字段 -->
|
|
100
101
|
<template v-if="conditionItem.parameterType === 'dynamicText'">
|
|
@@ -134,11 +135,15 @@
|
|
|
134
135
|
slot="extra"
|
|
135
136
|
class="DshAdvSearch-conditions-item-extra"
|
|
136
137
|
>
|
|
137
|
-
<!--
|
|
138
|
+
<!-- 动态类型 or 固定类型 -->
|
|
138
139
|
<dsh-dropdown
|
|
139
|
-
v-if="
|
|
140
|
+
v-if="
|
|
141
|
+
conditionItem.dynamicList.length &&
|
|
142
|
+
!['isnull', 'notnull', 'nosize', 'size', 'nolist', 'list'].includes(conditionItem.fieldOperator) &&
|
|
143
|
+
!['subSearch', 'subTableSearch', 'cascaderTableSearch', 'treeTableSearch'].includes(conditionItem.fieldOperator)
|
|
144
|
+
"
|
|
140
145
|
class="extra-dynamic"
|
|
141
|
-
:list="
|
|
146
|
+
:list="getParameterData(conditionItem)"
|
|
142
147
|
@click="$dispatchEvent(operationMap.selectParameterType, conditionItem, conditionIndex, advSearchObj.conditions, $event)"
|
|
143
148
|
>
|
|
144
149
|
<span class="extra-operator-wrap">
|
|
@@ -146,7 +151,7 @@
|
|
|
146
151
|
{{ conditionItem.parameterTypeName }}
|
|
147
152
|
</span>
|
|
148
153
|
<Icon
|
|
149
|
-
v-if="
|
|
154
|
+
v-if="getParameterData(conditionItem).length"
|
|
150
155
|
class="extra-operator-icon"
|
|
151
156
|
type="ios-arrow-down"
|
|
152
157
|
/>
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
:formData="formData"
|
|
28
28
|
:formItem="formItem"
|
|
29
29
|
:allFormList="allFormList"
|
|
30
|
+
:allListRows="allListRows"
|
|
30
31
|
:rowIndex="rowIndex"
|
|
31
|
-
:parentListData="parentListData"
|
|
32
32
|
:parentFormList="parentFormList"
|
|
33
33
|
:parentObj="parentObj"
|
|
34
34
|
:changedFields="changedFields"
|
|
@@ -134,13 +134,14 @@
|
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
/* 内部表,层级表内的字段用到的 */
|
|
138
|
+
allListRows: {
|
|
139
139
|
type: Array,
|
|
140
140
|
default () {
|
|
141
141
|
return [];
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
|
+
rowIndex: Number,
|
|
144
145
|
parentFormList: {
|
|
145
146
|
type: Array,
|
|
146
147
|
default () {
|
|
@@ -97,6 +97,13 @@ export default {
|
|
|
97
97
|
|
|
98
98
|
this.change(operationItem.type, conditionItem);
|
|
99
99
|
},
|
|
100
|
+
// 获取动态文本或固定文本类型 选项列表
|
|
101
|
+
getParameterData (conditionItem) {
|
|
102
|
+
// 配置端 且 含有子集的
|
|
103
|
+
return !!conditionItem.dynamicList.length && conditionItem.operators.some(operator => ["subSearch", "subTableSearch", "cascaderTableSearch", "treeTableSearch"].includes(operator._key))
|
|
104
|
+
? []
|
|
105
|
+
: this.parameterPropsObj._data;
|
|
106
|
+
},
|
|
100
107
|
// 选择某控件的动态文本或固定文本类型
|
|
101
108
|
changeParameterType (operationItem, conditionItem, conditionIndex, list, optionItem) {
|
|
102
109
|
conditionItem.parameterType = optionItem._key;
|
|
@@ -121,7 +128,7 @@ export default {
|
|
|
121
128
|
logic: "and",
|
|
122
129
|
conditions: []
|
|
123
130
|
};
|
|
124
|
-
} else if (["subSearch", "subTableSearch"].includes(conditionItem.fieldOperator)) {
|
|
131
|
+
} else if (["subSearch", "subTableSearch", "cascaderTableSearch", "treeTableSearch"].includes(conditionItem.fieldOperator)) {
|
|
125
132
|
conditionItem.fieldParams = [];
|
|
126
133
|
conditionItem.chainFieldKey = "";
|
|
127
134
|
conditionItem.fieldValue = [];
|
|
@@ -161,9 +168,13 @@ export default {
|
|
|
161
168
|
|
|
162
169
|
if (curFormItem) {
|
|
163
170
|
const fieldType = curFormItem._type;
|
|
171
|
+
fieldKey = curFormItem._key;
|
|
172
|
+
const cascaderTableMode = curFormItem._showMode;
|
|
164
173
|
const fieldData = this.fieldMap[fieldType];
|
|
165
174
|
|
|
166
|
-
const dynamicTypes = this.useChainField
|
|
175
|
+
const dynamicTypes = this.useChainField
|
|
176
|
+
? [...new Set([...(fieldData.categoryTypes || []), fieldType])]
|
|
177
|
+
: [fieldType];
|
|
167
178
|
let dynamicList = dynamicTypes.reduce((list, type) => list.concat(this.dynamicFieldsMap[type] || []), []);
|
|
168
179
|
dynamicList = this.useChainField
|
|
169
180
|
? ["select", "checkbox", "cascader", "cascaders"].includes(fieldType)
|
|
@@ -172,32 +183,44 @@ export default {
|
|
|
172
183
|
? dynamicList.filter(dynamicItem => dynamicItem._ref === curFormItem._ref)
|
|
173
184
|
: dynamicList
|
|
174
185
|
: dynamicList;
|
|
175
|
-
const parameterType = initContion.parameterType || (
|
|
176
|
-
(initContion.fieldParams || []).length || initContion.chainFieldKey || (!!dynamicList.length && ["reference", "flatTable"].includes(fieldType))
|
|
177
|
-
? "dynamicText"
|
|
178
|
-
: "fixedText"
|
|
179
|
-
);
|
|
180
|
-
const parameterTypeName = (this.parameterPropsObj._data.find(parameterTypeItem => parameterTypeItem._key === parameterType) || { name: `${parameterType}不存在` }).name;
|
|
181
186
|
|
|
182
|
-
const operators =
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
+
const operators = (
|
|
188
|
+
["_id"].includes(fieldKey)
|
|
189
|
+
? []
|
|
190
|
+
: ["cascaderTable"].includes(fieldType)
|
|
191
|
+
? cascaderTableMode === "treeTable"
|
|
192
|
+
? fieldData.operators.filter(operator => !["cascaderTableSearch"].includes(operator._key))
|
|
193
|
+
: fieldData.operators.filter(operator => !["treeTableSearch"].includes(operator._key))
|
|
194
|
+
// 单条关联类型 -配置端:无动态字段的地方过滤掉“是”和“不是”筛选条件,有动态字段的地方用的全部条件;用户端:用的全部条件,
|
|
195
|
+
: ["reference"].includes(fieldType)
|
|
196
|
+
? this.mode === "set" && !dynamicList.length
|
|
197
|
+
? fieldData.operators.filter(operator => !["eq", "ne"].includes(operator._key))
|
|
198
|
+
: fieldData.operators
|
|
199
|
+
: fieldData.operators
|
|
200
|
+
) || [];
|
|
201
|
+
|
|
202
|
+
const fieldOperator = ["_id"].includes(fieldKey)
|
|
187
203
|
? "eq"
|
|
188
|
-
:
|
|
189
|
-
initContion.fieldOperator
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
)
|
|
194
|
-
);
|
|
204
|
+
: initContion.fieldOperator
|
|
205
|
+
? initContion.fieldOperator
|
|
206
|
+
: ["reference"].includes(fieldType) && this.isSimpleSearch
|
|
207
|
+
? "eq"
|
|
208
|
+
: (operators[0] || {})._key;
|
|
195
209
|
const fieldOperatorName = (operators.find(operatorItem => operatorItem._key === fieldOperator) || { name: `${fieldOperator}不存在` }).name;
|
|
196
210
|
|
|
211
|
+
const parameterType = initContion.parameterType || (
|
|
212
|
+
(
|
|
213
|
+
(initContion.fieldParams || []).length ||
|
|
214
|
+
initContion.chainFieldKey ||
|
|
215
|
+
(!!dynamicList.length && operators.some(operator => ["subSearch", "subTableSearch", "cascaderTableSearch", "treeTableSearch"].includes(operator._key)))
|
|
216
|
+
) ? "dynamicText" : "fixedText"
|
|
217
|
+
);
|
|
218
|
+
const parameterTypeName = (this.parameterPropsObj._data.find(parameterTypeItem => parameterTypeItem._key === parameterType) || { name: `${parameterType}不存在` }).name;
|
|
219
|
+
|
|
197
220
|
return {
|
|
198
221
|
_id: this.$ObjectID().str,
|
|
199
222
|
logic: "field",
|
|
200
|
-
fieldKey:
|
|
223
|
+
fieldKey: fieldKey,
|
|
201
224
|
fieldType: fieldType,
|
|
202
225
|
fieldValue: [],
|
|
203
226
|
fieldOperator: fieldOperator,
|
|
@@ -296,7 +319,7 @@ export default {
|
|
|
296
319
|
) || { form: [] }).form;
|
|
297
320
|
});
|
|
298
321
|
}
|
|
299
|
-
} else if (
|
|
322
|
+
} else if (["subTableSearch", "cascaderTableSearch", "treeTableSearch"].includes(conditionItem.fieldOperator)) {
|
|
300
323
|
conditionItem.finished = true;
|
|
301
324
|
conditionItem.subFormList = conditionItem.formItem._subForm;
|
|
302
325
|
}
|
|
@@ -319,7 +342,7 @@ export default {
|
|
|
319
342
|
},
|
|
320
343
|
// 剔除conditions项里不要的属性
|
|
321
344
|
transformConditions (list = []) {
|
|
322
|
-
const loop = (list) => {
|
|
345
|
+
const loop = (list = []) => {
|
|
323
346
|
const conditionFields = [
|
|
324
347
|
"_id", "logic", "conditions", "textSearch", "nativeSearch",
|
|
325
348
|
"fieldKey", "fieldType", "fieldValue", "fieldOperator", "fieldSearch",
|
|
@@ -327,22 +350,19 @@ export default {
|
|
|
327
350
|
];
|
|
328
351
|
|
|
329
352
|
return list.map(item =>
|
|
330
|
-
conditionFields.reduce((obj, key) =>
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
: item[key]
|
|
344
|
-
}), {})
|
|
345
|
-
);
|
|
353
|
+
conditionFields.reduce((obj, key) => ({
|
|
354
|
+
...obj,
|
|
355
|
+
[key]: item[key]
|
|
356
|
+
? key === "fieldSearch"
|
|
357
|
+
? {
|
|
358
|
+
...item[key],
|
|
359
|
+
conditions: loop(item[key].conditions)
|
|
360
|
+
}
|
|
361
|
+
: key === "conditions"
|
|
362
|
+
? loop(item[key])
|
|
363
|
+
: item[key]
|
|
364
|
+
: item[key]
|
|
365
|
+
})), {});
|
|
346
366
|
};
|
|
347
367
|
|
|
348
368
|
return loop(list);
|
|
@@ -166,7 +166,15 @@
|
|
|
166
166
|
v-else
|
|
167
167
|
class="table-nodata"
|
|
168
168
|
>
|
|
169
|
-
<td
|
|
169
|
+
<td
|
|
170
|
+
:style="{
|
|
171
|
+
width: `${boxWidth}px`,
|
|
172
|
+
minWidth: `${boxWidth}px`,
|
|
173
|
+
maxWidth: `${boxWidth}px`,
|
|
174
|
+
}"
|
|
175
|
+
:rowspan="1"
|
|
176
|
+
:colspan="showColumns.length"
|
|
177
|
+
>暂无数据…</td>
|
|
170
178
|
</tr>
|
|
171
179
|
</tbody>
|
|
172
180
|
</table>
|
|
@@ -338,7 +346,15 @@
|
|
|
338
346
|
v-else
|
|
339
347
|
class="table-nodata"
|
|
340
348
|
>
|
|
341
|
-
<td
|
|
349
|
+
<td
|
|
350
|
+
:style="{
|
|
351
|
+
width: `${boxWidth}px`,
|
|
352
|
+
minWidth: `${boxWidth}px`,
|
|
353
|
+
maxWidth: `${boxWidth}px`,
|
|
354
|
+
}"
|
|
355
|
+
:rowspan="1"
|
|
356
|
+
:colspan="showColumns.length"
|
|
357
|
+
>暂无数据…</td>
|
|
342
358
|
</tr>
|
|
343
359
|
</tbody>
|
|
344
360
|
</table>
|
|
@@ -472,6 +488,22 @@
|
|
|
472
488
|
allTreeData () {
|
|
473
489
|
return this.getCalcuedTree();
|
|
474
490
|
},
|
|
491
|
+
showAllTreeData () {
|
|
492
|
+
const loop = (list = []) => {
|
|
493
|
+
return list.filter(row => {
|
|
494
|
+
if (row.children && row.children.length) {
|
|
495
|
+
row.children = loop(row.children);
|
|
496
|
+
return !!row.children.length;
|
|
497
|
+
} else {
|
|
498
|
+
return this.$isAdvRelyAccord(this.finalTableAdvSearch, row);
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
return this.isSearching
|
|
504
|
+
? loop(this.allTreeData)
|
|
505
|
+
: this.allTreeData;
|
|
506
|
+
},
|
|
475
507
|
allListData () {
|
|
476
508
|
return this.$getTreeFlatArr(this.data.tree, node => !(node.children && node.children.length));
|
|
477
509
|
},
|
|
@@ -736,7 +768,7 @@
|
|
|
736
768
|
return this.data.tree;
|
|
737
769
|
},
|
|
738
770
|
// 转化渲染使用的columns数组
|
|
739
|
-
transformRowColumnsArr (nodes = this.
|
|
771
|
+
transformRowColumnsArr (nodes = this.showAllTreeData, treeForm = this.treeColumns) {
|
|
740
772
|
let loop = (nodes, rowColumnsArr) => {
|
|
741
773
|
return nodes.reduce((rowColumnsArr, node, nodeIndex) => {
|
|
742
774
|
if (nodeIndex !== 0 || rowColumnsArr.length === 0) {
|
|
@@ -753,7 +785,7 @@
|
|
|
753
785
|
return loop(nodes, []);
|
|
754
786
|
},
|
|
755
787
|
// 转化表格数据
|
|
756
|
-
transformRows (nodes = this.
|
|
788
|
+
transformRows (nodes = this.showAllTreeData, treeForm = this.treeColumns) {
|
|
757
789
|
const loop = (nodes, rows) => {
|
|
758
790
|
return nodes.reduce((rows, node, nodeIndex) => {
|
|
759
791
|
// 创建行,并把节点数据(对象类型)注入到行对象内
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<dsh-default-search
|
|
16
16
|
v-if="searchFormList.length && !isEnlarge"
|
|
17
17
|
:formList="searchFormList"
|
|
18
|
-
:initValue="
|
|
18
|
+
:initValue="dftAdvSearch.conditions"
|
|
19
19
|
:labelWidth="searchLabelWidth"
|
|
20
20
|
@change="searchCb"
|
|
21
21
|
></dsh-default-search>
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<template v-if="searchFormList.length">
|
|
55
55
|
<dsh-default-search
|
|
56
56
|
:formList="searchFormList"
|
|
57
|
-
:initValue="
|
|
57
|
+
:initValue="dftAdvSearch.conditions"
|
|
58
58
|
:labelWidth="searchLabelWidth"
|
|
59
59
|
@change="searchCb"
|
|
60
60
|
></dsh-default-search>
|
|
@@ -339,13 +339,16 @@
|
|
|
339
339
|
selfReset () {
|
|
340
340
|
this.isExpandAction = false;
|
|
341
341
|
this.searchMode = "flat";
|
|
342
|
-
this.
|
|
342
|
+
this.dftAdvSearch = {
|
|
343
|
+
logic: "and",
|
|
344
|
+
conditions: []
|
|
345
|
+
};
|
|
343
346
|
},
|
|
344
347
|
|
|
345
348
|
// 筛选回调
|
|
346
349
|
searchCb (conditions) {
|
|
347
350
|
this.isExpandAction = false;
|
|
348
|
-
this.
|
|
351
|
+
this.dftAdvSearch.conditions = conditions;
|
|
349
352
|
},
|
|
350
353
|
// 展开/隐藏节点
|
|
351
354
|
toggleExpand (row, bool = true) {
|
|
@@ -401,7 +404,7 @@
|
|
|
401
404
|
|
|
402
405
|
/* ------ 工具方法 ------- */
|
|
403
406
|
// 加工树形数据
|
|
404
|
-
getCalcuedTree (treeData = [], columns) {
|
|
407
|
+
getCalcuedTree (treeData = [], columns = []) {
|
|
405
408
|
const loop = (list = [], parentRow) =>
|
|
406
409
|
list.forEach((row) => {
|
|
407
410
|
// 递归到叶子节点前 从上往下要处理的
|
|
@@ -36,13 +36,13 @@ export default {
|
|
|
36
36
|
return {};
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
|
|
40
|
-
parentFormList: {
|
|
39
|
+
allFormList: {
|
|
41
40
|
type: Array,
|
|
42
41
|
default () {
|
|
43
42
|
return [];
|
|
44
43
|
}
|
|
45
44
|
},
|
|
45
|
+
|
|
46
46
|
parentObj: {
|
|
47
47
|
type: Object,
|
|
48
48
|
default () {
|
|
@@ -59,8 +59,10 @@ export default {
|
|
|
59
59
|
showRuleMessage: false, // 进行全体校验
|
|
60
60
|
ruleRecordMap: {}, // 单元格是否发生校验的记录映射
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
dftAdvSearch: {
|
|
63
|
+
logic: "and",
|
|
64
|
+
conditions: []
|
|
65
|
+
},
|
|
64
66
|
|
|
65
67
|
dshRenderName: undefined,
|
|
66
68
|
showQuoteModal: false,
|
|
@@ -239,7 +241,7 @@ export default {
|
|
|
239
241
|
return this.selfPropsObj._quoteListFields;
|
|
240
242
|
},
|
|
241
243
|
quoteAdvSearch () {
|
|
242
|
-
return this.$transformAdvSearch(this.selfPropsObj._quoteAdvSearch, this.
|
|
244
|
+
return this.$transformAdvSearch(this.selfPropsObj._quoteAdvSearch, this.allFormList, this.parentObj);
|
|
243
245
|
},
|
|
244
246
|
|
|
245
247
|
searchList () {
|
|
@@ -255,24 +257,24 @@ export default {
|
|
|
255
257
|
return this.selfPropsObj._searchLabelWidth;
|
|
256
258
|
},
|
|
257
259
|
tableAdvSearch () {
|
|
258
|
-
return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.
|
|
260
|
+
return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.allFormList, this.parentObj);
|
|
259
261
|
},
|
|
260
262
|
// 配置的默认筛选值里 隐藏的看不到的筛选条件
|
|
261
|
-
|
|
262
|
-
return
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
hideAdvSearch () {
|
|
264
|
+
return {
|
|
265
|
+
logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
|
|
266
|
+
conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
|
|
267
|
+
!this.searchListFields.includes(conditionItem.fieldKey)
|
|
268
|
+
)
|
|
269
|
+
};
|
|
265
270
|
},
|
|
266
271
|
// 过滤行数据的 最终的筛选条件
|
|
267
272
|
finalTableAdvSearch () {
|
|
268
273
|
return {
|
|
269
|
-
logic:
|
|
274
|
+
logic: "and",
|
|
270
275
|
conditions: [
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
logic: this.dftLogic,
|
|
274
|
-
conditions: this.dftConditions
|
|
275
|
-
}
|
|
276
|
+
this.hideAdvSearch,
|
|
277
|
+
this.dftAdvSearch
|
|
276
278
|
]
|
|
277
279
|
};
|
|
278
280
|
},
|
|
@@ -388,10 +390,10 @@ export default {
|
|
|
388
390
|
canEdit: unitCanEdit,
|
|
389
391
|
formData: row,
|
|
390
392
|
formItem: column,
|
|
391
|
-
rowIndex: rowIndex,
|
|
392
393
|
allFormList: this.columns,
|
|
393
|
-
|
|
394
|
-
|
|
394
|
+
allListRows: this.allListData,
|
|
395
|
+
rowIndex: rowIndex,
|
|
396
|
+
parentFormList: this.allFormList,
|
|
395
397
|
parentObj: this.parentObj
|
|
396
398
|
},
|
|
397
399
|
on: {
|
|
@@ -406,10 +408,10 @@ export default {
|
|
|
406
408
|
canEdit: unitCanEdit,
|
|
407
409
|
formData: row,
|
|
408
410
|
formItem: column,
|
|
409
|
-
rowIndex: rowIndex,
|
|
410
411
|
allFormList: this.columns,
|
|
411
|
-
|
|
412
|
-
|
|
412
|
+
allListRows: this.allListData,
|
|
413
|
+
rowIndex: rowIndex,
|
|
414
|
+
parentFormList: this.allFormList,
|
|
413
415
|
parentObj: this.parentObj
|
|
414
416
|
},
|
|
415
417
|
on: {
|
|
@@ -488,7 +490,7 @@ export default {
|
|
|
488
490
|
},
|
|
489
491
|
methods: {
|
|
490
492
|
baseInit () {
|
|
491
|
-
this.
|
|
493
|
+
this.dftAdvSearch.conditions = this.tableAdvSearch.conditions.filter(conditionItem =>
|
|
492
494
|
this.searchListFields.includes(conditionItem.fieldKey)
|
|
493
495
|
);
|
|
494
496
|
},
|
|
@@ -508,7 +510,7 @@ export default {
|
|
|
508
510
|
// 筛选回调
|
|
509
511
|
searchCb (conditions) {
|
|
510
512
|
this.isExpandAction = false;
|
|
511
|
-
this.
|
|
513
|
+
this.dftAdvSearch.conditions = conditions;
|
|
512
514
|
},
|
|
513
515
|
// 表单控件失去焦点
|
|
514
516
|
controlBlur (operationItem, col, row, rowIndex, params) {
|