bri-components 1.3.82 → 1.3.84
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/form/DshDefaultSearch.vue +3 -1
- package/src/components/form/DshForm.vue +2 -3
- package/src/components/form/searchMixin.js +13 -11
- package/src/components/list/BriTable.vue +2 -4
- package/src/components/list/DshFlatTable.vue +96 -23
- package/src/components/list/DshTreeTable.vue +12 -2
- package/src/components/list/common/quoteListModal.vue +44 -54
- package/src/components/list/mixins/DshCascaderTableMixin.js +4 -3
- package/src/components/list/mixins/DshTreeTableMixin.js +29 -10
- package/src/components/list/mixins/tableBaseMixin.js +97 -81
- package/src/utils/table.js +1 -1
package/package.json
CHANGED
|
@@ -109,7 +109,9 @@
|
|
|
109
109
|
},
|
|
110
110
|
computed: {
|
|
111
111
|
canSearchFormList () {
|
|
112
|
-
return this.formList.filter(formItem =>
|
|
112
|
+
return this.formList.filter(formItem =>
|
|
113
|
+
this.$formHasAbility(formItem, "canDefaultSearch") && formItem._displayType !== "hide"
|
|
114
|
+
);
|
|
113
115
|
},
|
|
114
116
|
|
|
115
117
|
// 总span
|
|
@@ -184,7 +184,6 @@
|
|
|
184
184
|
formControlClass: String,
|
|
185
185
|
|
|
186
186
|
/* 本组件使用 -不传递子组件的 */
|
|
187
|
-
monitorFormList: Array,
|
|
188
187
|
showRules: {
|
|
189
188
|
type: Boolean,
|
|
190
189
|
default: true
|
|
@@ -199,7 +198,7 @@
|
|
|
199
198
|
|
|
200
199
|
forceValidateTypes: [
|
|
201
200
|
"select", "region", "cascader", "regions", "cascaders", "file", "coordinates", "editor",
|
|
202
|
-
"users", "departments", "labels", "flatTable", "reference", "referenceBy"
|
|
201
|
+
"users", "departments", "labels", "flatTable", "cascaderTable", "reference", "referenceBy"
|
|
203
202
|
],
|
|
204
203
|
ignoreProperties: [
|
|
205
204
|
"_name", "_key", "_default", "_required", "_regStr", "_regMessage", "_span", "_br", "_line", "_noLabel", "_clearable",
|
|
@@ -229,7 +228,7 @@
|
|
|
229
228
|
},
|
|
230
229
|
// 初始化监测 -监测所有字段
|
|
231
230
|
initMonitor () {
|
|
232
|
-
(this.
|
|
231
|
+
(this.allFormList || this.formList).forEach(formItem => {
|
|
233
232
|
this.$set(this.formData, formItem._key, this.formData[formItem._key]);
|
|
234
233
|
});
|
|
235
234
|
},
|
|
@@ -60,7 +60,10 @@ export default {
|
|
|
60
60
|
},
|
|
61
61
|
computed: {
|
|
62
62
|
canSearchFormList () {
|
|
63
|
-
return this.formList.filter(formItem =>
|
|
63
|
+
return this.formList.filter(formItem =>
|
|
64
|
+
this.$formHasAbility(formItem, "canSearch") &&
|
|
65
|
+
(this.mode === "set" ? true : formItem._displayType !== "hide")
|
|
66
|
+
);
|
|
64
67
|
},
|
|
65
68
|
dynamicFieldsMap () {
|
|
66
69
|
return this.$arrToCategoryArr(this.dynamicFormList);
|
|
@@ -220,15 +223,15 @@ export default {
|
|
|
220
223
|
return {
|
|
221
224
|
_id: this.$ObjectID().str,
|
|
222
225
|
logic: "field",
|
|
223
|
-
fieldKey
|
|
224
|
-
fieldType
|
|
225
|
-
fieldOperator
|
|
226
|
+
fieldKey,
|
|
227
|
+
fieldType,
|
|
228
|
+
fieldOperator,
|
|
226
229
|
fieldValue: [],
|
|
227
230
|
fieldSearch: {
|
|
228
231
|
logic: "and",
|
|
229
232
|
conditions: []
|
|
230
233
|
},
|
|
231
|
-
parameterType
|
|
234
|
+
parameterType,
|
|
232
235
|
fieldParams: [],
|
|
233
236
|
chainFieldKey: "",
|
|
234
237
|
...initContion,
|
|
@@ -236,11 +239,11 @@ export default {
|
|
|
236
239
|
// 下面的是前端所用
|
|
237
240
|
dynamicList: dynamicList,
|
|
238
241
|
parameterTypeName: parameterTypeName,
|
|
239
|
-
operators
|
|
242
|
+
operators,
|
|
240
243
|
fieldOperatorName: fieldOperatorName,
|
|
241
244
|
formItem: this.getFormItem(curFormItem),
|
|
242
245
|
subFormList: curFormItem._subForm || [],
|
|
243
|
-
finished:
|
|
246
|
+
finished: !operators.some(operator => ["subSearch"].includes(operator._key)) // 子集条件的 请求form数据 是否完成状态
|
|
244
247
|
};
|
|
245
248
|
} else {
|
|
246
249
|
return {
|
|
@@ -315,13 +318,12 @@ export default {
|
|
|
315
318
|
this.getModData(conditionItem.formItem, data => {
|
|
316
319
|
conditionItem.finished = true;
|
|
317
320
|
conditionItem.subFormList = (data.screens.find(screenItem =>
|
|
318
|
-
this.mode === "set"
|
|
321
|
+
this.mode === "set"
|
|
322
|
+
? screenItem.screenType === "all"
|
|
323
|
+
: screenItem._key === conditionItem.formItem._screen
|
|
319
324
|
) || { form: [] }).form;
|
|
320
325
|
});
|
|
321
326
|
}
|
|
322
|
-
} else if (["subTableSearch", "cascaderTableSearch", "treeTableSearch"].includes(conditionItem.fieldOperator)) {
|
|
323
|
-
conditionItem.finished = true;
|
|
324
|
-
conditionItem.subFormList = conditionItem.formItem._subForm;
|
|
325
327
|
}
|
|
326
328
|
},
|
|
327
329
|
// 加载 reference数据
|
|
@@ -187,13 +187,11 @@
|
|
|
187
187
|
},
|
|
188
188
|
mounted () {},
|
|
189
189
|
methods: {
|
|
190
|
-
// hidden columns
|
|
191
190
|
hideColumnsByKeys (keys = []) {
|
|
192
|
-
this.$refs
|
|
191
|
+
this.$refs.briTable.hideColumnsByKeys(keys);
|
|
193
192
|
},
|
|
194
|
-
// show cloumns
|
|
195
193
|
showColumnsByKeys (keys = []) {
|
|
196
|
-
this.$refs
|
|
194
|
+
this.$refs.briTable.showColumnsByKeys(keys);
|
|
197
195
|
}
|
|
198
196
|
}
|
|
199
197
|
};
|
|
@@ -9,29 +9,62 @@
|
|
|
9
9
|
:render="topSearchRender"
|
|
10
10
|
></dsh-render>
|
|
11
11
|
|
|
12
|
-
<!--
|
|
13
|
-
<
|
|
14
|
-
v-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
12
|
+
<!-- 表单展示模式 -->
|
|
13
|
+
<div
|
|
14
|
+
v-if="showMode === 'form'"
|
|
15
|
+
class="DshFlatTable-form"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
v-for="(row, rowIndex) in showListData"
|
|
19
|
+
:key="row._id"
|
|
20
|
+
class="item"
|
|
21
|
+
>
|
|
22
|
+
<dsh-form
|
|
23
|
+
:canEdit="getRowCanEdit(row)"
|
|
24
|
+
:formData="row"
|
|
25
|
+
:formList="getRowFormList(row)"
|
|
26
|
+
:allFormList="getRowFormList(row)"
|
|
27
|
+
:inTableType="inTableType"
|
|
28
|
+
:allListRows="allListData"
|
|
29
|
+
:rowIndex="rowIndex"
|
|
30
|
+
:parentFormList="allFormList"
|
|
31
|
+
:parentObj="parentObj"
|
|
32
|
+
></dsh-form>
|
|
33
|
+
|
|
34
|
+
<dsh-icons
|
|
35
|
+
v-if="$getOperationList(['canCreate', 'canDelete']).length"
|
|
36
|
+
class="item-icons"
|
|
37
|
+
itemClass="item-icons-item"
|
|
38
|
+
:list="$getOperationList(['canCreate', 'canDelete'])"
|
|
39
|
+
@click="$dispatchEvent($event, row, rowIndex)"
|
|
40
|
+
></dsh-icons>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<!-- 表格展示模式 -->
|
|
45
|
+
<template v-else>
|
|
46
|
+
<bri-table
|
|
47
|
+
v-show="showListData.length"
|
|
48
|
+
ref="briTable"
|
|
49
|
+
class="DshFlatTable-main"
|
|
50
|
+
:columns="showColumns"
|
|
51
|
+
:data="renderedListData"
|
|
52
|
+
:footer-data="footerData"
|
|
53
|
+
:propsObj="tablePropsObj"
|
|
54
|
+
@changeSelect="changeSelect"
|
|
55
|
+
@selectAll="changeSelect"
|
|
56
|
+
></bri-table>
|
|
57
|
+
<bri-table
|
|
58
|
+
v-show="!showListData.length"
|
|
59
|
+
class="DshFlatTable-main"
|
|
60
|
+
:columns="showColumns"
|
|
61
|
+
:data="showListData"
|
|
62
|
+
:footer-data="footerData"
|
|
63
|
+
:propsObj="tablePropsObj"
|
|
64
|
+
@changeSelect="changeSelect"
|
|
65
|
+
@selectAll="changeSelect"
|
|
66
|
+
></bri-table>
|
|
67
|
+
</template>
|
|
35
68
|
|
|
36
69
|
<!-- 添加行 -->
|
|
37
70
|
<dsh-render :render="createOperationRender"></dsh-render>
|
|
@@ -58,6 +91,7 @@
|
|
|
58
91
|
|
|
59
92
|
<!-- 表格 -->
|
|
60
93
|
<bri-table
|
|
94
|
+
v-show="showListData.length"
|
|
61
95
|
class="DshFlatTable-main"
|
|
62
96
|
:columns="showColumns"
|
|
63
97
|
:data="renderedListData"
|
|
@@ -66,6 +100,16 @@
|
|
|
66
100
|
@changeSelect="changeSelect"
|
|
67
101
|
@selectAll="changeSelect"
|
|
68
102
|
></bri-table>
|
|
103
|
+
<bri-table
|
|
104
|
+
v-show="!showListData.length"
|
|
105
|
+
class="DshFlatTable-main"
|
|
106
|
+
:columns="showColumns"
|
|
107
|
+
:data="showListData"
|
|
108
|
+
:footer-data="footerData"
|
|
109
|
+
:propsObj="tablePropsObj"
|
|
110
|
+
@changeSelect="changeSelect"
|
|
111
|
+
@selectAll="changeSelect"
|
|
112
|
+
></bri-table>
|
|
69
113
|
|
|
70
114
|
<!-- 添加行 -->
|
|
71
115
|
<dsh-render :render="createOperationRender"></dsh-render>
|
|
@@ -97,6 +141,13 @@
|
|
|
97
141
|
|
|
98
142
|
<style lang="less" scoped>
|
|
99
143
|
.DshFlatTable {
|
|
144
|
+
&-form {
|
|
145
|
+
.item {
|
|
146
|
+
border: 1px solid #E5E5E6;
|
|
147
|
+
margin-bottom: 5px;
|
|
148
|
+
position: relative;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
100
151
|
|
|
101
152
|
&-main {
|
|
102
153
|
width: 100%;
|
|
@@ -110,3 +161,25 @@
|
|
|
110
161
|
}
|
|
111
162
|
}
|
|
112
163
|
</style>
|
|
164
|
+
<style lang="less">
|
|
165
|
+
.DshFlatTable {
|
|
166
|
+
&-form {
|
|
167
|
+
.item {
|
|
168
|
+
&-icons {
|
|
169
|
+
position: absolute;
|
|
170
|
+
top: -10px;
|
|
171
|
+
right: -10px;
|
|
172
|
+
line-height: 18px;
|
|
173
|
+
z-index: 2;
|
|
174
|
+
display: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&:hover {
|
|
178
|
+
.item-icons {
|
|
179
|
+
display: block !important;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
</style>
|
|
@@ -23,10 +23,9 @@
|
|
|
23
23
|
></bri-table>
|
|
24
24
|
<bri-table
|
|
25
25
|
v-show="!showListData.length"
|
|
26
|
-
ref="briTable"
|
|
27
26
|
class="DshTreeTable-main"
|
|
28
27
|
:columns="showColumns"
|
|
29
|
-
:data="
|
|
28
|
+
:data="showListData"
|
|
30
29
|
:footer-data="footerData"
|
|
31
30
|
:propsObj="tablePropsObj"
|
|
32
31
|
@changeSelect="changeSelect"
|
|
@@ -58,6 +57,7 @@
|
|
|
58
57
|
|
|
59
58
|
<!-- 表格 -->
|
|
60
59
|
<bri-table
|
|
60
|
+
v-show="showListData.length"
|
|
61
61
|
class="DshTreeTable-main"
|
|
62
62
|
:columns="showColumns"
|
|
63
63
|
:data="renderedListData"
|
|
@@ -66,6 +66,16 @@
|
|
|
66
66
|
@changeSelect="changeSelect"
|
|
67
67
|
@selectAll="changeSelect"
|
|
68
68
|
></bri-table>
|
|
69
|
+
<bri-table
|
|
70
|
+
v-show="!showListData.length"
|
|
71
|
+
class="DshTreeTable-main"
|
|
72
|
+
:columns="showColumns"
|
|
73
|
+
:data="showListData"
|
|
74
|
+
:footer-data="footerData"
|
|
75
|
+
:propsObj="tablePropsObj"
|
|
76
|
+
@changeSelect="changeSelect"
|
|
77
|
+
@selectAll="changeSelect"
|
|
78
|
+
></bri-table>
|
|
69
79
|
|
|
70
80
|
<!-- 添加行 -->
|
|
71
81
|
<dsh-render :render="createOperationRender"></dsh-render>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
:closable="true"
|
|
10
10
|
:draggable="true"
|
|
11
11
|
>
|
|
12
|
-
<div class="quoteListModal-
|
|
12
|
+
<div class="quoteListModal-body">
|
|
13
13
|
<div class="list">
|
|
14
14
|
<template v-if="listData.length">
|
|
15
15
|
<div
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
</div>
|
|
35
35
|
|
|
36
36
|
<dsh-buttons
|
|
37
|
-
class="quoteListModal-
|
|
38
|
-
itemClass="
|
|
37
|
+
class="quoteListModal-body-btns"
|
|
38
|
+
itemClass="btns-item"
|
|
39
39
|
:list="$getOperationList()"
|
|
40
40
|
@click="$dispatchEvent($event)"
|
|
41
41
|
></dsh-buttons>
|
|
@@ -74,12 +74,6 @@
|
|
|
74
74
|
curDataItem: undefined,
|
|
75
75
|
|
|
76
76
|
operationMap: {
|
|
77
|
-
canReset: {
|
|
78
|
-
name: "重 置",
|
|
79
|
-
type: "canReset",
|
|
80
|
-
size: "small",
|
|
81
|
-
event: "clickReset"
|
|
82
|
-
},
|
|
83
77
|
confirm: {
|
|
84
78
|
name: "确 认",
|
|
85
79
|
type: "confirm",
|
|
@@ -123,10 +117,6 @@
|
|
|
123
117
|
} else {
|
|
124
118
|
this.curDataItem = dataItem;
|
|
125
119
|
}
|
|
126
|
-
},
|
|
127
|
-
// 点击重置
|
|
128
|
-
clickReset () {
|
|
129
|
-
|
|
130
120
|
},
|
|
131
121
|
// 点击确认
|
|
132
122
|
clickConfirm () {
|
|
@@ -155,47 +145,6 @@
|
|
|
155
145
|
<style lang="less">
|
|
156
146
|
.quoteListModal {
|
|
157
147
|
&-drawer {
|
|
158
|
-
&-body {
|
|
159
|
-
width: 100%;
|
|
160
|
-
height: 100%;
|
|
161
|
-
padding: 20px;
|
|
162
|
-
overflow: auto;
|
|
163
|
-
|
|
164
|
-
.list {
|
|
165
|
-
&-item {
|
|
166
|
-
padding: 8px 12px;
|
|
167
|
-
margin-bottom: 8px;
|
|
168
|
-
border-radius: 4px;
|
|
169
|
-
cursor: pointer;
|
|
170
|
-
|
|
171
|
-
&-active {
|
|
172
|
-
color: #ffffff;
|
|
173
|
-
background-color: @theme-hover;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
&-nodata {
|
|
178
|
-
#dsh-nodata();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
&-btns {
|
|
183
|
-
position: absolute;
|
|
184
|
-
bottom: 0px;
|
|
185
|
-
left: 0px;
|
|
186
|
-
.dsh-flex-row-start-stretch();
|
|
187
|
-
width: calc(100% - 48px);
|
|
188
|
-
height: 51px;
|
|
189
|
-
margin: 25px 20px 25px 28px;
|
|
190
|
-
|
|
191
|
-
&-item {
|
|
192
|
-
flex: 1;
|
|
193
|
-
margin: 5px;
|
|
194
|
-
height: 40px;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
148
|
.ivu-drawer-mask,
|
|
200
149
|
.ivu-drawer-wrap {
|
|
201
150
|
z-index: 88888888;
|
|
@@ -212,5 +161,46 @@
|
|
|
212
161
|
font-weight: bold;
|
|
213
162
|
}
|
|
214
163
|
}
|
|
164
|
+
|
|
165
|
+
&-body {
|
|
166
|
+
width: 100%;
|
|
167
|
+
height: 100%;
|
|
168
|
+
padding: 20px;
|
|
169
|
+
overflow: auto;
|
|
170
|
+
|
|
171
|
+
.list {
|
|
172
|
+
&-item {
|
|
173
|
+
padding: 8px 12px;
|
|
174
|
+
margin-bottom: 8px;
|
|
175
|
+
border-radius: 4px;
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
|
|
178
|
+
&-active {
|
|
179
|
+
color: #ffffff;
|
|
180
|
+
background-color: @theme-hover;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&-nodata {
|
|
185
|
+
#dsh-nodata();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&-btns {
|
|
190
|
+
position: absolute;
|
|
191
|
+
bottom: 0px;
|
|
192
|
+
left: 0px;
|
|
193
|
+
.dsh-flex-row-start-stretch();
|
|
194
|
+
width: calc(100% - 48px);
|
|
195
|
+
height: 51px;
|
|
196
|
+
margin: 25px 20px 25px 28px;
|
|
197
|
+
|
|
198
|
+
.btns-item {
|
|
199
|
+
flex: 1;
|
|
200
|
+
min-width: 0px;
|
|
201
|
+
height: 40px;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
215
205
|
}
|
|
216
206
|
</style>
|
|
@@ -105,6 +105,7 @@ export default {
|
|
|
105
105
|
computed: {
|
|
106
106
|
selfPropsObj () {
|
|
107
107
|
return {
|
|
108
|
+
_treeForm: [],
|
|
108
109
|
...this.commonPropsObj,
|
|
109
110
|
|
|
110
111
|
_contentHeight: this.propsObj._contentHeight || 400 // 表格最大高度
|
|
@@ -113,7 +114,7 @@ export default {
|
|
|
113
114
|
|
|
114
115
|
allTreeData () {
|
|
115
116
|
// console.log("allTreeData");
|
|
116
|
-
return this.getCalcuedTree(this.data, this.treeColumns, this.
|
|
117
|
+
return this.getCalcuedTree(this.data, this.treeColumns, this.selfColumns);
|
|
117
118
|
},
|
|
118
119
|
allListData () {
|
|
119
120
|
return this.$getTreeFlatArr(this.data, node => !(node.children && node.children.length));
|
|
@@ -156,7 +157,7 @@ export default {
|
|
|
156
157
|
loop(node.children);
|
|
157
158
|
} else {
|
|
158
159
|
// 根节点下所有表格字段加上监测,注入到节点对象中,必须$set,牵扯_rely值再出现并没有检测
|
|
159
|
-
this.
|
|
160
|
+
this.selfColumns.forEach(subFormItem => {
|
|
160
161
|
this.$set(node, subFormItem._key, node[subFormItem._key]);
|
|
161
162
|
});
|
|
162
163
|
}
|
|
@@ -812,7 +813,7 @@ export default {
|
|
|
812
813
|
},
|
|
813
814
|
getSummaryVal (col, row) {
|
|
814
815
|
if (col._calField && col._operator) {
|
|
815
|
-
const calFieldFormItem = this.
|
|
816
|
+
const calFieldFormItem = this.selfColumns.find(item => item._key === col._calField);
|
|
816
817
|
|
|
817
818
|
if (calFieldFormItem) {
|
|
818
819
|
let loop = (nodes, arr) => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { resourceData } from "bri-datas";
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
mixins: [],
|
|
3
5
|
components: {},
|
|
@@ -11,19 +13,36 @@ export default {
|
|
|
11
13
|
};
|
|
12
14
|
},
|
|
13
15
|
computed: {
|
|
16
|
+
selfColumns () {
|
|
17
|
+
return this.columns.map(column => {
|
|
18
|
+
// 层级表格类型,level字段的进行特殊处理(_treeForm加工成_data)
|
|
19
|
+
return column._key === "level"
|
|
20
|
+
? {
|
|
21
|
+
...column,
|
|
22
|
+
_data: this.selfPropsObj._treeForm.map((treeFormItem, treeFormIndex) => ({
|
|
23
|
+
name: treeFormItem._name,
|
|
24
|
+
_key: (treeFormIndex + 1),
|
|
25
|
+
color: Object.keys(resourceData.colorMap)[treeFormIndex + 1]
|
|
26
|
+
}))
|
|
27
|
+
}
|
|
28
|
+
: column;
|
|
29
|
+
});
|
|
30
|
+
},
|
|
14
31
|
selfPropsObj () {
|
|
15
32
|
return {
|
|
16
|
-
|
|
17
|
-
...this.commonPropsObj
|
|
33
|
+
_treeForm: [],
|
|
34
|
+
...this.commonPropsObj,
|
|
35
|
+
|
|
36
|
+
_maxLevel: this.commonPropsObj._maxLevel || 3 // 最大级数
|
|
18
37
|
};
|
|
19
38
|
},
|
|
20
39
|
maxLevel () {
|
|
21
|
-
return this.selfPropsObj._maxLevel
|
|
40
|
+
return this.selfPropsObj._maxLevel;
|
|
22
41
|
},
|
|
23
42
|
|
|
24
43
|
allTreeData () {
|
|
25
44
|
// console.log("allTreeData");
|
|
26
|
-
return this.getCalcuedTree(this.data, this.
|
|
45
|
+
return this.getCalcuedTree(this.data, this.selfColumns);
|
|
27
46
|
},
|
|
28
47
|
allListData () {
|
|
29
48
|
// console.log("allListData");
|
|
@@ -186,7 +205,7 @@ export default {
|
|
|
186
205
|
color: "#3DB8C5"
|
|
187
206
|
},
|
|
188
207
|
props: {
|
|
189
|
-
type: "md-add-circle",
|
|
208
|
+
type: "md-add-circle",
|
|
190
209
|
size: "14"
|
|
191
210
|
},
|
|
192
211
|
on: {
|
|
@@ -224,7 +243,7 @@ export default {
|
|
|
224
243
|
color: "#3DB8C5"
|
|
225
244
|
},
|
|
226
245
|
props: {
|
|
227
|
-
type: "ios-add",
|
|
246
|
+
type: "ios-add",
|
|
228
247
|
size: "14"
|
|
229
248
|
},
|
|
230
249
|
on: {
|
|
@@ -322,11 +341,11 @@ export default {
|
|
|
322
341
|
|
|
323
342
|
/* ------ 工具方法 ------- */
|
|
324
343
|
// 加工树形数据
|
|
325
|
-
getCalcuedTree (treeData = [],
|
|
344
|
+
getCalcuedTree (treeData = [], cols = []) {
|
|
326
345
|
const loop = (list = [], parentRow) =>
|
|
327
346
|
list.forEach((row) => {
|
|
328
347
|
// 递归到叶子节点前 从上往下执行 要处理的
|
|
329
|
-
|
|
348
|
+
cols.reduce((newRow, column) => {
|
|
330
349
|
if (["number", "date"].includes(column._type)) {
|
|
331
350
|
if (![undefined, null, "", "no"].includes(column._summaryType)) {
|
|
332
351
|
// 不做处理,_summaryType和_writeSort互反,更安全的判断
|
|
@@ -349,7 +368,7 @@ export default {
|
|
|
349
368
|
loop(row.children, row);
|
|
350
369
|
|
|
351
370
|
// 递归到叶子节点后到 从下往上执行 要处理的(非叶子节点)
|
|
352
|
-
|
|
371
|
+
cols.reduce((newRow, column) => {
|
|
353
372
|
if (["number", "date"].includes(column._type)) {
|
|
354
373
|
if (![undefined, null, "", "no"].includes(column._summaryType)) {
|
|
355
374
|
const val = ["number"].includes(column._type)
|
|
@@ -383,7 +402,7 @@ export default {
|
|
|
383
402
|
row.isLeaf = true;
|
|
384
403
|
|
|
385
404
|
// 递归到叶子节点后到 从下往上执行 要处理的(叶子节点)
|
|
386
|
-
|
|
405
|
+
cols.reduce((newRow, column) => {
|
|
387
406
|
if (["number", "date"].includes(column._type)) {
|
|
388
407
|
if (![undefined, null, "", "no"].includes(column._summaryType)) {
|
|
389
408
|
this.$set(newRow, column._key, newRow[column._key]);
|
|
@@ -137,6 +137,7 @@ export default {
|
|
|
137
137
|
name: "添加一行",
|
|
138
138
|
type: "canCreate",
|
|
139
139
|
btnType: "default",
|
|
140
|
+
icon: "md-add-circle",
|
|
140
141
|
size: "default",
|
|
141
142
|
long: true,
|
|
142
143
|
disabled: false,
|
|
@@ -190,6 +191,13 @@ export default {
|
|
|
190
191
|
allScreenKey () {
|
|
191
192
|
return this.propsObj.allScreenKey;
|
|
192
193
|
},
|
|
194
|
+
selfColumns () {
|
|
195
|
+
return this.columns;
|
|
196
|
+
},
|
|
197
|
+
filterColumns () {
|
|
198
|
+
// console.log("filterColumns");
|
|
199
|
+
return this.selfColumns.filter(col => this.$isAdvRelyShow(col, this.allListData, this.parentObj, true));
|
|
200
|
+
},
|
|
193
201
|
|
|
194
202
|
commonPropsObj () {
|
|
195
203
|
return {
|
|
@@ -276,29 +284,10 @@ export default {
|
|
|
276
284
|
disabledOldDataRow () {
|
|
277
285
|
return this.selfPropsObj._disabledOldDataRow;
|
|
278
286
|
},
|
|
279
|
-
|
|
280
|
-
isImport () {
|
|
281
|
-
return this.selfPropsObj._isImport;
|
|
282
|
-
},
|
|
283
|
-
isExport () {
|
|
284
|
-
return this.selfPropsObj._isExport;
|
|
285
|
-
},
|
|
286
|
-
isQuote () {
|
|
287
|
-
return this.selfPropsObj._isQuote;
|
|
288
|
-
},
|
|
289
|
-
quoteDisabledColKeys () {
|
|
290
|
-
return this.selfPropsObj._quoteDisabledColKeys;
|
|
291
|
-
},
|
|
292
|
-
quoteListFields () {
|
|
293
|
-
return this.selfPropsObj._quoteListFields;
|
|
294
|
-
},
|
|
295
|
-
quoteAdvSearch () {
|
|
296
|
-
return this.$transformAdvSearch(this.selfPropsObj._quoteAdvSearch, this.allFormList, this.parentObj);
|
|
297
|
-
},
|
|
298
|
-
|
|
299
287
|
hideColKeys () {
|
|
300
288
|
return this.selfPropsObj._hideColKeys || [];
|
|
301
289
|
},
|
|
290
|
+
|
|
302
291
|
searchLabelWidth () {
|
|
303
292
|
return this.selfPropsObj._searchLabelWidth;
|
|
304
293
|
},
|
|
@@ -312,13 +301,12 @@ export default {
|
|
|
312
301
|
return this.searchList.map(searchItem => searchItem._key);
|
|
313
302
|
},
|
|
314
303
|
searchFormList () {
|
|
315
|
-
return this.$filterList(this.searchListFields, this.
|
|
304
|
+
return this.$filterList(this.searchListFields, this.selfColumns).map(formItem => ({
|
|
316
305
|
...formItem,
|
|
317
306
|
...this.searchListMap[formItem._key],
|
|
318
307
|
_name: formItem._name
|
|
319
308
|
}));
|
|
320
309
|
},
|
|
321
|
-
|
|
322
310
|
tableAdvSearch () {
|
|
323
311
|
return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.allFormList, this.parentObj);
|
|
324
312
|
},
|
|
@@ -382,7 +370,7 @@ export default {
|
|
|
382
370
|
return this.parentObj._id;
|
|
383
371
|
},
|
|
384
372
|
selfRowDefault () {
|
|
385
|
-
return this.
|
|
373
|
+
return this.selfColumns.reduce((obj, column) => {
|
|
386
374
|
const defaultVal = this.rowDefault[column._key];
|
|
387
375
|
const initDftVal = this.initDftValMap[column._type];
|
|
388
376
|
|
|
@@ -432,53 +420,6 @@ export default {
|
|
|
432
420
|
}
|
|
433
421
|
};
|
|
434
422
|
},
|
|
435
|
-
modalPropsObj () {
|
|
436
|
-
return {
|
|
437
|
-
mode: "fullscreen",
|
|
438
|
-
title: this.controlName
|
|
439
|
-
};
|
|
440
|
-
},
|
|
441
|
-
quoteParams () {
|
|
442
|
-
return {
|
|
443
|
-
screenKey: this.allScreenKey,
|
|
444
|
-
fields: [
|
|
445
|
-
...this.quoteListFields,
|
|
446
|
-
this.controlKey,
|
|
447
|
-
"createdAt"
|
|
448
|
-
],
|
|
449
|
-
advSearch: {
|
|
450
|
-
logic: "and",
|
|
451
|
-
conditions: [
|
|
452
|
-
{
|
|
453
|
-
fieldKey: "_id",
|
|
454
|
-
fieldOperator: "ne",
|
|
455
|
-
fieldValue: [this.parentDataId]
|
|
456
|
-
},
|
|
457
|
-
this.quoteAdvSearch
|
|
458
|
-
]
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
},
|
|
462
|
-
importParams () {
|
|
463
|
-
return {
|
|
464
|
-
_id: this.parentDataId,
|
|
465
|
-
_key: this.controlKey,
|
|
466
|
-
importType: this.inTableType
|
|
467
|
-
};
|
|
468
|
-
},
|
|
469
|
-
exportParams () {
|
|
470
|
-
return {
|
|
471
|
-
screenKey: this.screenKey,
|
|
472
|
-
_id: this.parentDataId,
|
|
473
|
-
_key: this.controlKey,
|
|
474
|
-
advSearch: this.finalTableAdvSearch
|
|
475
|
-
};
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
filterColumns () {
|
|
479
|
-
// console.log("filterColumns");
|
|
480
|
-
return this.columns.filter(col => this.$isAdvRelyShow(col, this.allListData, this.parentObj, true));
|
|
481
|
-
},
|
|
482
423
|
contentColumns () {
|
|
483
424
|
// console.log("contentColumns");
|
|
484
425
|
return this.filterColumns.map(colItem => ({
|
|
@@ -510,7 +451,7 @@ export default {
|
|
|
510
451
|
canEdit: unitCanEdit,
|
|
511
452
|
formData: row,
|
|
512
453
|
formItem: column,
|
|
513
|
-
allFormList: this.
|
|
454
|
+
allFormList: this.selfColumns,
|
|
514
455
|
inTableType: this.inTableType,
|
|
515
456
|
allListRows: this.allListData,
|
|
516
457
|
rowIndex: rowIndex,
|
|
@@ -529,7 +470,7 @@ export default {
|
|
|
529
470
|
canEdit: unitCanEdit,
|
|
530
471
|
formData: row,
|
|
531
472
|
formItem: column,
|
|
532
|
-
allFormList: this.
|
|
473
|
+
allFormList: this.selfColumns,
|
|
533
474
|
inTableType: this.inTableType,
|
|
534
475
|
allListRows: this.allListData,
|
|
535
476
|
rowIndex: rowIndex,
|
|
@@ -602,6 +543,67 @@ export default {
|
|
|
602
543
|
};
|
|
603
544
|
},
|
|
604
545
|
|
|
546
|
+
isImport () {
|
|
547
|
+
return this.selfPropsObj._isImport;
|
|
548
|
+
},
|
|
549
|
+
importParams () {
|
|
550
|
+
return {
|
|
551
|
+
_id: this.parentDataId,
|
|
552
|
+
_key: this.controlKey,
|
|
553
|
+
importType: this.inTableType
|
|
554
|
+
};
|
|
555
|
+
},
|
|
556
|
+
isExport () {
|
|
557
|
+
return this.selfPropsObj._isExport;
|
|
558
|
+
},
|
|
559
|
+
exportParams () {
|
|
560
|
+
return {
|
|
561
|
+
screenKey: this.screenKey,
|
|
562
|
+
_id: this.parentDataId,
|
|
563
|
+
_key: this.controlKey,
|
|
564
|
+
advSearch: this.finalTableAdvSearch
|
|
565
|
+
};
|
|
566
|
+
},
|
|
567
|
+
isQuote () {
|
|
568
|
+
return this.selfPropsObj._isQuote;
|
|
569
|
+
},
|
|
570
|
+
quoteDisabledColKeys () {
|
|
571
|
+
return this.selfPropsObj._quoteDisabledColKeys;
|
|
572
|
+
},
|
|
573
|
+
quoteListFields () {
|
|
574
|
+
return this.selfPropsObj._quoteListFields;
|
|
575
|
+
},
|
|
576
|
+
quoteAdvSearch () {
|
|
577
|
+
return this.$transformAdvSearch(this.selfPropsObj._quoteAdvSearch, this.allFormList, this.parentObj);
|
|
578
|
+
},
|
|
579
|
+
quoteParams () {
|
|
580
|
+
return {
|
|
581
|
+
screenKey: this.allScreenKey,
|
|
582
|
+
fields: [
|
|
583
|
+
...this.quoteListFields,
|
|
584
|
+
this.controlKey,
|
|
585
|
+
"createdAt"
|
|
586
|
+
],
|
|
587
|
+
advSearch: {
|
|
588
|
+
logic: "and",
|
|
589
|
+
conditions: [
|
|
590
|
+
{
|
|
591
|
+
fieldKey: "_id",
|
|
592
|
+
fieldOperator: "ne",
|
|
593
|
+
fieldValue: [this.parentDataId]
|
|
594
|
+
},
|
|
595
|
+
this.quoteAdvSearch
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
},
|
|
600
|
+
modalPropsObj () {
|
|
601
|
+
return {
|
|
602
|
+
mode: "fullscreen",
|
|
603
|
+
title: this.controlName
|
|
604
|
+
};
|
|
605
|
+
},
|
|
606
|
+
|
|
605
607
|
topOperationBtns () {
|
|
606
608
|
return Object.keys(this.topOperationMap);
|
|
607
609
|
},
|
|
@@ -673,6 +675,7 @@ export default {
|
|
|
673
675
|
this.initFlag = true;
|
|
674
676
|
this.showRuleMessage = false;
|
|
675
677
|
this.ruleRecordMap = {};
|
|
678
|
+
this.selfReset && this.selfReset();
|
|
676
679
|
},
|
|
677
680
|
// 共外部使用
|
|
678
681
|
validate () {
|
|
@@ -704,15 +707,15 @@ export default {
|
|
|
704
707
|
|
|
705
708
|
/* ----------- 隐藏/显示字段 ---------- */
|
|
706
709
|
toggleHideOrShow () {
|
|
707
|
-
if (this.$refs
|
|
710
|
+
if (this.$refs.briTable) {
|
|
708
711
|
if (this.hideStatus === true) {
|
|
709
|
-
this.$refs
|
|
712
|
+
this.$refs.briTable.showColumnsByKeys(this.hideColKeys);
|
|
710
713
|
} else {
|
|
711
|
-
this.$refs
|
|
714
|
+
this.$refs.briTable.hideColumnsByKeys(this.hideColKeys);
|
|
712
715
|
}
|
|
713
|
-
}
|
|
714
716
|
|
|
715
|
-
|
|
717
|
+
this.hideStatus = !this.hideStatus;
|
|
718
|
+
}
|
|
716
719
|
},
|
|
717
720
|
|
|
718
721
|
/* ----------- 全屏 ---------- */
|
|
@@ -769,7 +772,8 @@ export default {
|
|
|
769
772
|
...fieldVal,
|
|
770
773
|
list: fieldVal.list.map(item => ({
|
|
771
774
|
...item,
|
|
772
|
-
__isQuote__: true
|
|
775
|
+
__isQuote__: true,
|
|
776
|
+
__old__: false
|
|
773
777
|
}))
|
|
774
778
|
};
|
|
775
779
|
} else if (["cascaderTable"].includes(this.controlType)) {
|
|
@@ -778,7 +782,8 @@ export default {
|
|
|
778
782
|
list.map(item => ({
|
|
779
783
|
...item,
|
|
780
784
|
children: item.children ? loop(item.children) : item.children,
|
|
781
|
-
__isQuote__: true
|
|
785
|
+
__isQuote__: true,
|
|
786
|
+
__old__: false
|
|
782
787
|
}));
|
|
783
788
|
|
|
784
789
|
return loop(list);
|
|
@@ -792,7 +797,6 @@ export default {
|
|
|
792
797
|
|
|
793
798
|
this.$Message.success("引用成功!");
|
|
794
799
|
this.reset();
|
|
795
|
-
this.selfReset && this.selfReset();
|
|
796
800
|
this.change("quote");
|
|
797
801
|
}
|
|
798
802
|
} else {
|
|
@@ -1028,7 +1032,7 @@ export default {
|
|
|
1028
1032
|
// 校验必填不通过 => 校验对比
|
|
1029
1033
|
const resultObj = {};
|
|
1030
1034
|
this.$getFieldRuleResult(col, row, resultObj) &&
|
|
1031
|
-
this.$normalComparedFunc(col, row, this.
|
|
1035
|
+
this.$normalComparedFunc(col, row, this.selfColumns, this.parentObj, this.allFormList, this.inTableType, resultObj) &&
|
|
1032
1036
|
this.$levelComparedFunc(col, row, this.allListData, this.inTableType, resultObj);
|
|
1033
1037
|
|
|
1034
1038
|
return resultObj;
|
|
@@ -1065,6 +1069,7 @@ export default {
|
|
|
1065
1069
|
: true
|
|
1066
1070
|
: true
|
|
1067
1071
|
) &&
|
|
1072
|
+
!(["cascaderTable"].includes(this.controlType) && ["level", "children"].includes(col._key)) && // 级联表格类型,固定字段不编辑
|
|
1068
1073
|
(col._oldReadonly ? row.__old__ !== true : true) && // 老数据行里某些列不可编辑
|
|
1069
1074
|
(row.__isQuote__ ? !this.quoteDisabledColKeys.includes(col._key) : true) && // 引用过来的数据是否可编辑
|
|
1070
1075
|
col._enterType !== "calculate" && // 计算的不可编辑
|
|
@@ -1076,6 +1081,17 @@ export default {
|
|
|
1076
1081
|
return this.getRowCanEdit(row) &&
|
|
1077
1082
|
this.getColCanEdit(col, row) &&
|
|
1078
1083
|
this.$isAdvRelyShow(col, row, this.parentObj, true);
|
|
1084
|
+
},
|
|
1085
|
+
getRowFormList (row) {
|
|
1086
|
+
return this.selfColumns.map(column => {
|
|
1087
|
+
column = this.$transformDynamicProperty(column, row, this.parentObj);
|
|
1088
|
+
const unitCanEdit = this.getColCanEdit(column, row);
|
|
1089
|
+
|
|
1090
|
+
return {
|
|
1091
|
+
...column,
|
|
1092
|
+
canEdit: unitCanEdit
|
|
1093
|
+
};
|
|
1094
|
+
});
|
|
1079
1095
|
}
|
|
1080
1096
|
}
|
|
1081
1097
|
};
|