bri-components 1.4.49 → 1.4.51
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 +2 -2
- package/src/components/controls/base/DshDate/DshDaterange.vue +22 -161
- package/src/components/controls/base/DshInput/DshInput.vue +9 -12
- package/src/components/controls/base/DshNumber/DshNumber.vue +8 -13
- package/src/components/controls/extra/DshColor.vue +1 -1
- package/src/components/list/BriTree.vue +1 -1
- package/src/components/list/DshBox/DshPanel.vue +1 -1
- package/src/components/list/mixins/DshFlatTableMixin.js +16 -13
- package/src/components/list/mixins/tableBaseMixin.js +8 -3
- package/src/data/index.js +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bri-components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.51",
|
|
4
4
|
"author": "dengshanghui",
|
|
5
5
|
"description": "a component lib for vue project",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"ali-oss": "^6.13.1",
|
|
34
34
|
"axios": "^0.23.0",
|
|
35
|
-
"bri-datas": "^1.
|
|
35
|
+
"bri-datas": "^1.2.31",
|
|
36
36
|
"jshint": "^2.12.0",
|
|
37
37
|
"jsonlint": "^1.6.3",
|
|
38
38
|
"minio": "7.1.0",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
|
|
76
76
|
<script>
|
|
77
77
|
import controlMixin from "../../mixins/controlMixin.js";
|
|
78
|
+
import { dateDynSearchs } from "../../../../data/index.js";
|
|
78
79
|
|
|
79
80
|
export default {
|
|
80
81
|
name: "DshDaterange",
|
|
@@ -85,165 +86,15 @@
|
|
|
85
86
|
data () {
|
|
86
87
|
return {
|
|
87
88
|
open0: false,
|
|
88
|
-
open1: false
|
|
89
|
-
|
|
90
|
-
dynDate: [
|
|
91
|
-
{
|
|
92
|
-
_key: "dyn_today_start",
|
|
93
|
-
name: "今天",
|
|
94
|
-
numbers: [0],
|
|
95
|
-
dateTypes: ["date", "datetime"]
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
_key: "dyn_today_end",
|
|
99
|
-
name: "今天",
|
|
100
|
-
numbers: [1],
|
|
101
|
-
dateTypes: ["date", "datetime"]
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
_key: "dyn_now",
|
|
105
|
-
name: "现在",
|
|
106
|
-
numbers: [0, 1],
|
|
107
|
-
dateTypes: ["date", "datetime"]
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
_key: "dyn_yesterday",
|
|
111
|
-
name: "昨天",
|
|
112
|
-
numbers: [0],
|
|
113
|
-
dateTypes: ["date", "datetime"]
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
_key: "dyn_subtract_3_days",
|
|
117
|
-
name: "三天前",
|
|
118
|
-
numbers: [0],
|
|
119
|
-
dateTypes: ["date", "datetime"]
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
_key: "dyn_add_3_days",
|
|
123
|
-
name: "三天后",
|
|
124
|
-
numbers: [1],
|
|
125
|
-
dateTypes: ["date", "datetime"]
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
_key: "dyn_subtract_7_days",
|
|
129
|
-
name: "七天前",
|
|
130
|
-
numbers: [0],
|
|
131
|
-
dateTypes: ["date", "datetime"]
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
_key: "dyn_add_7_days",
|
|
135
|
-
name: "七天后",
|
|
136
|
-
numbers: [1],
|
|
137
|
-
dateTypes: ["date", "datetime"]
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
_key: "dyn_subtract_30_days",
|
|
141
|
-
name: "三十天前",
|
|
142
|
-
numbers: [0],
|
|
143
|
-
dateTypes: ["date", "datetime"]
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
_key: "dyn_add_30_days",
|
|
147
|
-
name: "三十后",
|
|
148
|
-
numbers: [1],
|
|
149
|
-
dateTypes: ["date", "datetime"]
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
// 月
|
|
153
|
-
{
|
|
154
|
-
_key: "last_month_start",
|
|
155
|
-
name: "上月初",
|
|
156
|
-
numbers: [0],
|
|
157
|
-
dateTypes: ["month", "date", "datetime"]
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
_key: "dyn_month_start",
|
|
161
|
-
name: "上月末",
|
|
162
|
-
numbers: [1],
|
|
163
|
-
dateTypes: ["month", "date", "datetime"]
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
_key: "dyn_month_start",
|
|
167
|
-
name: "月初",
|
|
168
|
-
numbers: [0],
|
|
169
|
-
dateTypes: ["month", "date", "datetime"]
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
_key: "dyn_month_end",
|
|
173
|
-
name: "月末",
|
|
174
|
-
numbers: [1],
|
|
175
|
-
dateTypes: ["month", "date", "datetime"]
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
_key: "dyn_nextmonth_start",
|
|
179
|
-
name: "下月初",
|
|
180
|
-
numbers: [0],
|
|
181
|
-
dateTypes: ["month", "date", "datetime"]
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
_key: "dyn_nextmonth_end",
|
|
185
|
-
name: "下月末",
|
|
186
|
-
numbers: [1],
|
|
187
|
-
dateTypes: ["month", "date", "datetime"]
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
_key: "last_month_21",
|
|
191
|
-
name: "上月21日",
|
|
192
|
-
numbers: [0],
|
|
193
|
-
dateTypes: ["month", "date", "datetime"]
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
_key: "dyn_month_21",
|
|
197
|
-
name: "本月21日",
|
|
198
|
-
numbers: [0, 1],
|
|
199
|
-
dateTypes: ["month", "date", "datetime"]
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
// 季度、年
|
|
203
|
-
{
|
|
204
|
-
_key: "dyn_quarter_start",
|
|
205
|
-
name: "本季初",
|
|
206
|
-
numbers: [0],
|
|
207
|
-
dateTypes: ["month", "date", "datetime"]
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
_key: "dyn_quarter_end",
|
|
211
|
-
name: "本季末",
|
|
212
|
-
numbers: [1],
|
|
213
|
-
dateTypes: ["month", "date", "datetime"]
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
_key: "dyn_year_start",
|
|
217
|
-
name: "年初",
|
|
218
|
-
numbers: [0],
|
|
219
|
-
dateTypes: ["year", "date", "datetime"]
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
_key: "dyn_year_end",
|
|
223
|
-
name: "年末",
|
|
224
|
-
numbers: [1],
|
|
225
|
-
dateTypes: ["year", "date", "datetime"]
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
_key: "dyn_nextyear_start",
|
|
229
|
-
name: "次年初",
|
|
230
|
-
numbers: [0],
|
|
231
|
-
dateTypes: ["year", "date", "datetime"]
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
_key: "dyn_nextyear_end",
|
|
235
|
-
name: "次年末",
|
|
236
|
-
numbers: [1],
|
|
237
|
-
dateTypes: ["year", "date", "datetime"]
|
|
238
|
-
}
|
|
239
|
-
]
|
|
89
|
+
open1: false
|
|
240
90
|
};
|
|
241
91
|
},
|
|
242
92
|
computed: {
|
|
243
93
|
selfPropsObj () {
|
|
244
94
|
return {
|
|
245
95
|
_icon: "ios-calendar-outline",
|
|
246
|
-
_useShortcuts: true,
|
|
96
|
+
_useShortcuts: true, // 是否使用动态筛选
|
|
97
|
+
_dynSearchKeys: [], // 动态筛选条件列表
|
|
247
98
|
_transferClassName: "DshDaterange-dropdown",
|
|
248
99
|
|
|
249
100
|
...this.propsObj,
|
|
@@ -256,6 +107,16 @@
|
|
|
256
107
|
useShortcuts () {
|
|
257
108
|
return this.selfPropsObj._useShortcuts;
|
|
258
109
|
},
|
|
110
|
+
dynSearchKeys () {
|
|
111
|
+
return this.selfPropsObj._dynSearchKeys;
|
|
112
|
+
},
|
|
113
|
+
dynSearchList () {
|
|
114
|
+
return this.dynSearchKeys.length
|
|
115
|
+
? this.dynSearchKeys.map(dynSearchKey =>
|
|
116
|
+
dateDynSearchs.find(dynSearchItem => dynSearchItem._key === dynSearchKey) || { _key: dynSearchKey }
|
|
117
|
+
)
|
|
118
|
+
: dateDynSearchs;
|
|
119
|
+
},
|
|
259
120
|
options0 () {
|
|
260
121
|
return this.getOptions(0);
|
|
261
122
|
},
|
|
@@ -311,12 +172,12 @@
|
|
|
311
172
|
getVal (index) {
|
|
312
173
|
const val = this.value[this.controlKey][index];
|
|
313
174
|
|
|
314
|
-
return this.
|
|
175
|
+
return this.isDynSearch(val)
|
|
315
176
|
? val
|
|
316
177
|
: this.$transformDateCompatible(val, this.subType);
|
|
317
178
|
},
|
|
318
179
|
setVal (val, index) {
|
|
319
|
-
const newVal = this.
|
|
180
|
+
const newVal = this.isDynSearch(val) ? val : this.$transformDate(val, "-", this.subType);
|
|
320
181
|
this.value[this.controlKey] = index === 0
|
|
321
182
|
? [newVal, this.value[this.controlKey][1] || ""]
|
|
322
183
|
: [this.value[this.controlKey][0] || "", newVal];
|
|
@@ -329,7 +190,7 @@
|
|
|
329
190
|
|
|
330
191
|
return {
|
|
331
192
|
shortcuts: this.useShortcuts
|
|
332
|
-
? this.
|
|
193
|
+
? this.dynSearchList
|
|
333
194
|
.filter(dynItem => dynItem.numbers.includes(index) && dynItem.dateTypes.includes(this.subType))
|
|
334
195
|
.map(dynItem => ({
|
|
335
196
|
text: dynItem.name,
|
|
@@ -340,7 +201,7 @@
|
|
|
340
201
|
const curDateStr = this.$transformDate(date, "/", this.subType);
|
|
341
202
|
|
|
342
203
|
return compareDateStr
|
|
343
|
-
? this.
|
|
204
|
+
? this.isDynSearch(compareDateStr)
|
|
344
205
|
? true
|
|
345
206
|
: !this.$isComparedAccord(curDateStr, compareDateStr, compareOperator, "date", this.subType, this.subType)
|
|
346
207
|
: false;
|
|
@@ -348,12 +209,12 @@
|
|
|
348
209
|
};
|
|
349
210
|
},
|
|
350
211
|
getShowVal (val) {
|
|
351
|
-
return this.
|
|
352
|
-
? (this.
|
|
212
|
+
return this.isDynSearch(val)
|
|
213
|
+
? (this.dynSearchList.find(dynItem => dynItem._key === val) || { name: `"${val}"动态条件不存在` }).name
|
|
353
214
|
: this.$transformDate(val, "-", this.subType);
|
|
354
215
|
},
|
|
355
|
-
|
|
356
|
-
return this.
|
|
216
|
+
isDynSearch (dynKey) {
|
|
217
|
+
return this.dynSearchList.some(dynItem => dynItem._key === dynKey);
|
|
357
218
|
}
|
|
358
219
|
}
|
|
359
220
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<i-input
|
|
8
8
|
class="DshInput-edit"
|
|
9
9
|
v-model="value[controlKey]"
|
|
10
|
-
:type="
|
|
10
|
+
:type="subType"
|
|
11
11
|
:placeholder="selfPropsObj._placeholder"
|
|
12
12
|
:readonly="selfPropsObj._readonly"
|
|
13
13
|
:disabled="disabled"
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
>
|
|
45
45
|
<!-- 有值 -->
|
|
46
46
|
<template v-if="!$isEmptyData(curVal)">
|
|
47
|
-
<!--
|
|
47
|
+
<!-- 高度自由时(单元格-内容高度自由,详情页-独占一行) -->
|
|
48
48
|
<template v-if="isHeightAuto">
|
|
49
49
|
<a
|
|
50
|
-
v-if="
|
|
50
|
+
v-if="subType === 'url'"
|
|
51
51
|
:class="{
|
|
52
52
|
...commonClass2,
|
|
53
53
|
'DshInput-show-auto': true,
|
|
@@ -64,13 +64,13 @@
|
|
|
64
64
|
...commonClass2,
|
|
65
65
|
'DshInput-show-auto': true,
|
|
66
66
|
'DshInput-show-auto-detail': isDetailShow,
|
|
67
|
-
'DshInput-show-auto-text': ['text', 'textarea'].includes(
|
|
67
|
+
'DshInput-show-auto-text': ['text', 'textarea'].includes(subType)
|
|
68
68
|
}"
|
|
69
69
|
v-html="showVal"
|
|
70
70
|
></div>
|
|
71
71
|
</template>
|
|
72
72
|
|
|
73
|
-
<!--
|
|
73
|
+
<!-- 单元格的查看 和 详情页的查看 -->
|
|
74
74
|
<bri-tooltip
|
|
75
75
|
v-else
|
|
76
76
|
:content="showVal"
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
:transfer="true"
|
|
79
79
|
>
|
|
80
80
|
<a
|
|
81
|
-
v-if="
|
|
81
|
+
v-if="subType === 'url'"
|
|
82
82
|
:class="{
|
|
83
83
|
...commonClass2,
|
|
84
84
|
'DshInput-show-ellipsis': true,
|
|
@@ -154,18 +154,15 @@
|
|
|
154
154
|
...this.commonDealPropsObj
|
|
155
155
|
};
|
|
156
156
|
},
|
|
157
|
-
|
|
157
|
+
// 子类型,只在type="text"有效
|
|
158
|
+
subType () {
|
|
158
159
|
return ["textarea", "email", "password", "url", "number", "tel"].includes(this.controlType)
|
|
159
160
|
? this.controlType
|
|
160
|
-
: ["text"].includes(this.controlType) && ["url"].includes(this.
|
|
161
|
+
: ["text"].includes(this.controlType) && ["url"].includes(this.selfPropsObj._textType)
|
|
161
162
|
? "url"
|
|
162
163
|
: ["serialNumber"].includes(this.controlType)
|
|
163
164
|
? "text"
|
|
164
165
|
: "text";
|
|
165
|
-
},
|
|
166
|
-
// 子类型,只在type="text"有效
|
|
167
|
-
subType () {
|
|
168
|
-
return this.selfPropsObj._textType;
|
|
169
166
|
}
|
|
170
167
|
},
|
|
171
168
|
created () {},
|
|
@@ -45,20 +45,15 @@
|
|
|
45
45
|
</Progress>
|
|
46
46
|
</div>
|
|
47
47
|
|
|
48
|
-
<!-- 单元格的查看-非进度条模式
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
maxWidth="200"
|
|
53
|
-
:transfer="true"
|
|
54
|
-
>
|
|
55
|
-
<div :class="{
|
|
48
|
+
<!-- 单元格的查看-非进度条模式 和 详情页的查看 -->
|
|
49
|
+
<div
|
|
50
|
+
v-else
|
|
51
|
+
:class="{
|
|
56
52
|
...commonClass,
|
|
57
|
-
}"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
</template>
|
|
53
|
+
}"
|
|
54
|
+
>
|
|
55
|
+
{{ showVal }}
|
|
56
|
+
</div>
|
|
62
57
|
</template>
|
|
63
58
|
</div>
|
|
64
59
|
|
|
@@ -321,7 +321,7 @@ export default {
|
|
|
321
321
|
});
|
|
322
322
|
},
|
|
323
323
|
quickChangeVal (operationItem, row, rowIndex, column, params) {
|
|
324
|
-
if (
|
|
324
|
+
if (["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
|
|
325
325
|
this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
|
|
326
326
|
this.dealSameRowsVal({ row, rowIndex, column });
|
|
327
327
|
|
|
@@ -329,7 +329,7 @@ export default {
|
|
|
329
329
|
}
|
|
330
330
|
},
|
|
331
331
|
changeVal (operationItem, row, rowIndex, column, params) {
|
|
332
|
-
if (!
|
|
332
|
+
if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
|
|
333
333
|
this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
|
|
334
334
|
this.dealSameRowsVal({ row, rowIndex, column });
|
|
335
335
|
|
|
@@ -385,19 +385,22 @@ export default {
|
|
|
385
385
|
|
|
386
386
|
return rowspan;
|
|
387
387
|
},
|
|
388
|
-
// 是都满足使用quickChange
|
|
389
|
-
isUseQuickChange ({ row, rowIndex, column }) {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
},
|
|
388
|
+
// // 是都满足使用quickChange
|
|
389
|
+
// isUseQuickChange ({ row, rowIndex, column }) {
|
|
390
|
+
// return ["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type) &&
|
|
391
|
+
// this.mergeRowColKeys.includes(column._key) &&
|
|
392
|
+
// this.rowspanMap[this.getMixKey(row, column)] > 1;
|
|
393
|
+
// },
|
|
394
394
|
// 合并单元格的行,某列的值全部跟着修改
|
|
395
395
|
dealSameRowsVal ({ row, rowIndex, column }, list = this.allListData) {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
.
|
|
399
|
-
rowItem
|
|
400
|
-
|
|
396
|
+
if (this.mergeRowColKeys.includes(column._key) && this.rowspanMap[this.getMixKey(row, column)] > 1) {
|
|
397
|
+
const indexInAll = list.findIndex(dataItem => dataItem._id === row._id);
|
|
398
|
+
list.slice(indexInAll + 1, indexInAll + this.rowspanMap[this.getMixKey(row, column)])
|
|
399
|
+
.forEach(rowItem => {
|
|
400
|
+
console.log(rowItem[column._key]);
|
|
401
|
+
rowItem[column._key] = this.$deepCopy(row[column._key]);
|
|
402
|
+
});
|
|
403
|
+
}
|
|
401
404
|
}
|
|
402
405
|
}
|
|
403
406
|
};
|
|
@@ -856,12 +856,17 @@ export default {
|
|
|
856
856
|
},
|
|
857
857
|
// 输入框值改变立即
|
|
858
858
|
quickChangeVal (operationItem, row, rowIndex, column, params) {
|
|
859
|
-
|
|
859
|
+
if (["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
|
|
860
|
+
this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
|
|
861
|
+
this.change("quickChangeVal", row, rowIndex, column, ...params);
|
|
862
|
+
}
|
|
860
863
|
},
|
|
861
864
|
// 输入框值改变
|
|
862
865
|
changeVal (operationItem, row, rowIndex, column, params) {
|
|
863
|
-
|
|
864
|
-
|
|
866
|
+
if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
|
|
867
|
+
this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
|
|
868
|
+
this.change("changeVal", row, rowIndex, column, ...params);
|
|
869
|
+
}
|
|
865
870
|
},
|
|
866
871
|
change (eventType, row, rowIndex, column, ...params) {
|
|
867
872
|
this.$emit("change", this.tableDataObj, eventType, column, row, rowIndex, ...params);
|