bri-components 1.3.76 → 1.3.78
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/DshForm.vue +7 -11
- package/src/components/list/DshFlatTable.vue +12 -0
- package/src/components/list/DshTreeTable.vue +12 -0
- package/src/components/list/mixins/DshFlatTableMixin.js +42 -2
- package/src/components/list/mixins/DshTreeTableMixin.js +2 -2
package/package.json
CHANGED
|
@@ -198,16 +198,14 @@
|
|
|
198
198
|
},
|
|
199
199
|
|
|
200
200
|
forceValidateTypes: [
|
|
201
|
-
"select", "cascader", "regions", "cascaders", "file", "coordinates", "editor",
|
|
201
|
+
"select", "region", "cascader", "regions", "cascaders", "file", "coordinates", "editor",
|
|
202
202
|
"users", "departments", "labels", "flatTable", "reference", "referenceBy"
|
|
203
203
|
],
|
|
204
204
|
ignoreProperties: [
|
|
205
|
-
"_name", "_key", "_default", "_required", "_span", "_br", "_line", "_noLabel", "_clearable",
|
|
205
|
+
"_name", "_key", "_default", "_required", "_regStr", "_regMessage", "_span", "_br", "_line", "_noLabel", "_clearable",
|
|
206
206
|
"_disabledBtns", "_disabledOldDataRow"
|
|
207
|
-
],
|
|
208
|
-
subIgnoreProperties: [
|
|
209
|
-
"_regStr", "_regMessage"
|
|
210
207
|
]
|
|
208
|
+
// subIgnoreProperties: []
|
|
211
209
|
};
|
|
212
210
|
},
|
|
213
211
|
computed: {
|
|
@@ -290,11 +288,9 @@
|
|
|
290
288
|
if (this.$refs.dshFormUnit) {
|
|
291
289
|
errorRefs = this.$refs.dshFormUnit.filter(refItem => !refItem.validate());
|
|
292
290
|
bool = !errorRefs.length;
|
|
293
|
-
} else {
|
|
294
|
-
bool = true;
|
|
295
291
|
}
|
|
296
|
-
cb && cb(bool, errorRefs.map(errorRefItem => errorRefItem.formItem));
|
|
297
292
|
|
|
293
|
+
cb && cb(bool, errorRefs.map(errorRefItem => errorRefItem.formItem));
|
|
298
294
|
return bool;
|
|
299
295
|
},
|
|
300
296
|
// iview的校验回调
|
|
@@ -342,9 +338,9 @@
|
|
|
342
338
|
_displayType: "show",
|
|
343
339
|
canEdit: !["createdAt", "updatedAt", "_creaters"].includes(formData._key)
|
|
344
340
|
}).forEach(arr => {
|
|
345
|
-
!this.ignoreProperties.includes(arr[0])
|
|
346
|
-
(formData.__parentKey__ ? !this.subIgnoreProperties.includes(arr[0]) : true) &&
|
|
341
|
+
if (!this.ignoreProperties.includes(arr[0])) {
|
|
347
342
|
this.$set(formItem, arr[0], arr[1]);
|
|
343
|
+
}
|
|
348
344
|
});
|
|
349
345
|
}
|
|
350
346
|
|
|
@@ -378,7 +374,7 @@
|
|
|
378
374
|
if (ruleConfig.regs && ruleConfig.regs.length) {
|
|
379
375
|
rules.push({
|
|
380
376
|
message: formItem._regMessage || `${formItem._name}格式不正确!`,
|
|
381
|
-
trigger: "blur",
|
|
377
|
+
trigger: "blur, change",
|
|
382
378
|
type: "string",
|
|
383
379
|
transform: (val) => {
|
|
384
380
|
return this.$isEmptyData(val)
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
<!-- 表格 -->
|
|
13
13
|
<bri-table
|
|
14
|
+
v-show="showListData.length"
|
|
14
15
|
ref="briTable"
|
|
15
16
|
class="DshFlatTable-main"
|
|
16
17
|
:columns="showColumns"
|
|
@@ -20,6 +21,17 @@
|
|
|
20
21
|
@changeSelect="changeSelect"
|
|
21
22
|
@selectAll="changeSelect"
|
|
22
23
|
></bri-table>
|
|
24
|
+
<bri-table
|
|
25
|
+
v-show="!showListData.length"
|
|
26
|
+
ref="briTable"
|
|
27
|
+
class="DshFlatTable-main"
|
|
28
|
+
:columns="showColumns"
|
|
29
|
+
:data="showListData"
|
|
30
|
+
:footer-data="footerData"
|
|
31
|
+
:propsObj="tablePropsObj"
|
|
32
|
+
@changeSelect="changeSelect"
|
|
33
|
+
@selectAll="changeSelect"
|
|
34
|
+
></bri-table>
|
|
23
35
|
|
|
24
36
|
<!-- 添加行 -->
|
|
25
37
|
<dsh-render :render="createOperationRender"></dsh-render>
|
|
@@ -11,6 +11,18 @@
|
|
|
11
11
|
|
|
12
12
|
<!-- 表格 -->
|
|
13
13
|
<bri-table
|
|
14
|
+
v-show="showListData.length"
|
|
15
|
+
ref="briTable"
|
|
16
|
+
class="DshTreeTable-main"
|
|
17
|
+
:columns="showColumns"
|
|
18
|
+
:data="renderedListData"
|
|
19
|
+
:footer-data="footerData"
|
|
20
|
+
:propsObj="tablePropsObj"
|
|
21
|
+
@changeSelect="changeSelect"
|
|
22
|
+
@selectAll="changeSelect"
|
|
23
|
+
></bri-table>
|
|
24
|
+
<bri-table
|
|
25
|
+
v-show="!showListData.length"
|
|
14
26
|
ref="briTable"
|
|
15
27
|
class="DshTreeTable-main"
|
|
16
28
|
:columns="showColumns"
|
|
@@ -71,7 +71,47 @@ export default {
|
|
|
71
71
|
width: 76,
|
|
72
72
|
align: "center",
|
|
73
73
|
fixed: "left",
|
|
74
|
-
renderBodyCell: ({
|
|
74
|
+
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
75
|
+
return [
|
|
76
|
+
h("div", rowIndex + 1),
|
|
77
|
+
|
|
78
|
+
// 添加符
|
|
79
|
+
// this.operationMap.canCreate && !this.isSearching && rowIndex !== this.allListData.length - 1
|
|
80
|
+
this.operationMap.canCreate && !this.isSearching
|
|
81
|
+
? h("div", {
|
|
82
|
+
style: {
|
|
83
|
+
position: "absolute",
|
|
84
|
+
bottom: "0px",
|
|
85
|
+
right: "0px",
|
|
86
|
+
display: "inline-block",
|
|
87
|
+
width: "16px",
|
|
88
|
+
height: " 16px",
|
|
89
|
+
border: "1px solid #dcdee2",
|
|
90
|
+
backgroundColor: "#ffffff",
|
|
91
|
+
lineHeight: "12px",
|
|
92
|
+
cursor: "pointer",
|
|
93
|
+
verticalAlign: "middle",
|
|
94
|
+
transition: "color .2s ease-in-out,border-color .2s ease-in-out"
|
|
95
|
+
}
|
|
96
|
+
}, [
|
|
97
|
+
h("Icon", {
|
|
98
|
+
style: {
|
|
99
|
+
fontWeight: "500"
|
|
100
|
+
},
|
|
101
|
+
props: {
|
|
102
|
+
type: "md-add-circle", // "ios-add"
|
|
103
|
+
size: "14"
|
|
104
|
+
},
|
|
105
|
+
on: {
|
|
106
|
+
click: () => {
|
|
107
|
+
this.clickCreate(this.operationMap.canCreate, row, rowIndex);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
])
|
|
112
|
+
: h("span", "")
|
|
113
|
+
];
|
|
114
|
+
}
|
|
75
115
|
};
|
|
76
116
|
}
|
|
77
117
|
},
|
|
@@ -90,7 +130,7 @@ export default {
|
|
|
90
130
|
};
|
|
91
131
|
const newRowIndex = rowIndex == null ? list.length : rowIndex + 1;
|
|
92
132
|
list.splice(newRowIndex, 0, newRow);
|
|
93
|
-
this.$forceUpdate(); // 自定义页中点击添加一行没有更新页面
|
|
133
|
+
// this.$forceUpdate(); // 自定义页中点击添加一行没有更新页面
|
|
94
134
|
|
|
95
135
|
this.change("createRow", null, newRow, newRowIndex);
|
|
96
136
|
},
|
|
@@ -161,7 +161,7 @@ export default {
|
|
|
161
161
|
}, row.__treeIndex__),
|
|
162
162
|
|
|
163
163
|
// 添加符
|
|
164
|
-
this.operationMap.canCreate && row.level < this.maxLevel
|
|
164
|
+
this.operationMap.canCreate && !this.isSearching && row.level < this.maxLevel
|
|
165
165
|
? h("div", {
|
|
166
166
|
style: {
|
|
167
167
|
position: "absolute",
|
|
@@ -339,7 +339,7 @@ export default {
|
|
|
339
339
|
}, row);
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
// 初次进来把前端存的状态值全部清除(除了__readonly__
|
|
342
|
+
// 初次进来把前端存的状态值全部清除(除了__readonly__和__isQuote__不处理)
|
|
343
343
|
if (this.initFlag) {
|
|
344
344
|
this.deleteProperties.forEach(property => {
|
|
345
345
|
delete row[property];
|