bri-components 1.4.22 → 1.4.23
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/DshNumber/BriInputNumber/BriInputNumber.vue +35 -30
- package/src/components/controls/base/DshNumber/DshNumber.vue +0 -1
- package/src/components/controls/mixins/cascaderPickerMixin.js +0 -2
- package/src/components/controls/senior/selectDepartments.vue +18 -51
- package/src/components/controls/senior/selectUsers/selectUsers.vue +17 -15
package/package.json
CHANGED
|
@@ -309,12 +309,16 @@
|
|
|
309
309
|
} else if (type === "down") {
|
|
310
310
|
val = addNum(val, -step);
|
|
311
311
|
}
|
|
312
|
+
|
|
312
313
|
this.setValue(val, "step");
|
|
313
314
|
},
|
|
314
315
|
setValue (val, setType) {
|
|
315
316
|
// 如果 step 是小数,且没有设置 precision,是有问题的
|
|
316
|
-
if (val && !isNaN(this.precision))
|
|
317
|
+
if (val && !isNaN(this.precision)) {
|
|
318
|
+
val = Number(Number(val).toFixed(this.precision));
|
|
319
|
+
}
|
|
317
320
|
|
|
321
|
+
// 处理最大值最小值
|
|
318
322
|
const {min, max} = this;
|
|
319
323
|
if (val !== null) {
|
|
320
324
|
if (val > max) {
|
|
@@ -324,20 +328,13 @@
|
|
|
324
328
|
}
|
|
325
329
|
}
|
|
326
330
|
|
|
331
|
+
// emit事件
|
|
327
332
|
this.$nextTick(() => {
|
|
328
333
|
this.transferValue = val;
|
|
329
334
|
if (setType && setType === "step") {
|
|
330
335
|
this.$emit("input", val);
|
|
331
336
|
this.$emit("on-change", val);
|
|
332
337
|
this.dispatch("FormItem", "on-form-change", val);
|
|
333
|
-
} else {
|
|
334
|
-
clearTimeout(this.timer);
|
|
335
|
-
this.timer = setTimeout(() => {
|
|
336
|
-
this.currentValue = val;
|
|
337
|
-
this.$emit("input", val);
|
|
338
|
-
this.$emit("on-change", val);
|
|
339
|
-
this.dispatch("FormItem", "on-form-change", val);
|
|
340
|
-
}, 600);
|
|
341
338
|
}
|
|
342
339
|
});
|
|
343
340
|
},
|
|
@@ -348,6 +345,10 @@
|
|
|
348
345
|
blur () {
|
|
349
346
|
this.focused = false;
|
|
350
347
|
if (this.transferValue !== this.currentValue) {
|
|
348
|
+
this.currentValue = this.transferValue;
|
|
349
|
+
this.$emit("input", this.transferValue);
|
|
350
|
+
this.$emit("on-change", this.transferValue);
|
|
351
|
+
this.dispatch("FormItem", "on-form-change", this.transferValue);
|
|
351
352
|
this.focused = false;
|
|
352
353
|
this.$emit("on-blur");
|
|
353
354
|
if (!findComponentUpward(this, ["DatePicker", "TimePicker", "Cascader", "Search"])) {
|
|
@@ -365,31 +366,35 @@
|
|
|
365
366
|
}
|
|
366
367
|
},
|
|
367
368
|
change (event) {
|
|
368
|
-
if (event.type == "change" && this.activeChange)
|
|
369
|
-
|
|
370
|
-
if (event.type == "input" && !this.activeChange) return;
|
|
369
|
+
if (event.type == "change" && this.activeChange) {
|
|
371
370
|
|
|
372
|
-
|
|
373
|
-
if (this.parser) {
|
|
374
|
-
val = this.parser(val);
|
|
375
|
-
}
|
|
371
|
+
} else if (event.type == "input" && !this.activeChange) {
|
|
376
372
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
this.
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
if (event.type == "input" && val.match(/^-?\.?$|\.$/)) return; // prevent fire early if decimal. If no more input the change event will fire later
|
|
373
|
+
} else {
|
|
374
|
+
let val = event.target.value.trim();
|
|
375
|
+
if (this.parser) {
|
|
376
|
+
val = this.parser(val);
|
|
377
|
+
}
|
|
383
378
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
379
|
+
const isEmptyString = val.length === 0;
|
|
380
|
+
if (isEmptyString) {
|
|
381
|
+
this.setValue(null);
|
|
382
|
+
} else {
|
|
383
|
+
if (event.type == "input" && val.match(/^-?\.?$|\.$/)) {
|
|
384
|
+
// prevent fire early if decimal. If no more input the change event will fire later
|
|
385
|
+
} else {
|
|
386
|
+
// eslint认为\为无用的转义符(-不需要转义)
|
|
387
|
+
// if (event.type == "input" && val.match(/^\-?\.?$|\.$/)) return; // prevent fire early if decimal. If no more input the change event will fire later
|
|
388
|
+
val = Number(val);
|
|
387
389
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
390
|
+
if (!isNaN(val)) {
|
|
391
|
+
// this.currentValue = val;
|
|
392
|
+
this.setValue(val);
|
|
393
|
+
} else {
|
|
394
|
+
event.target.value = this.currentValue;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
393
398
|
}
|
|
394
399
|
},
|
|
395
400
|
changeVal (val) {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
maxWidth="200"
|
|
11
11
|
:transfer="true"
|
|
12
12
|
>
|
|
13
|
-
<div @click
|
|
13
|
+
<div @click="clickInput">
|
|
14
14
|
<slot>
|
|
15
15
|
<!-- 编辑 -->
|
|
16
16
|
<dsh-control-input
|
|
@@ -120,51 +120,35 @@
|
|
|
120
120
|
>
|
|
121
121
|
<!-- 有值 -->
|
|
122
122
|
<template v-if="!$isEmptyData(curShowValList)">
|
|
123
|
-
<!--
|
|
123
|
+
<!-- 表单查看 -->
|
|
124
|
+
<!-- 高度自由时 -->
|
|
125
|
+
<dsh-tags
|
|
126
|
+
v-if="isHeightAuto"
|
|
127
|
+
:class="{
|
|
128
|
+
...commonClass,
|
|
129
|
+
'selectDepartments-show-auto': true
|
|
130
|
+
}"
|
|
131
|
+
itemClass="selectDepartments-show-auto-tag"
|
|
132
|
+
:list="curShowValList"
|
|
133
|
+
></dsh-tags>
|
|
134
|
+
|
|
135
|
+
<!-- 高度不自由(不换行) -->
|
|
124
136
|
<bri-tooltip
|
|
125
|
-
v-
|
|
137
|
+
v-else
|
|
126
138
|
:content="showVal"
|
|
127
139
|
placement="top"
|
|
128
140
|
maxWidth="200"
|
|
129
141
|
:transfer="true"
|
|
130
142
|
>
|
|
131
143
|
<dsh-tags
|
|
132
|
-
class="text"
|
|
133
|
-
:list="curShowValList"
|
|
134
|
-
></dsh-tags>
|
|
135
|
-
</bri-tooltip>
|
|
136
|
-
|
|
137
|
-
<!-- 表单查看 -->
|
|
138
|
-
<template v-else>
|
|
139
|
-
<!-- 高度自由时 -->
|
|
140
|
-
<dsh-tags
|
|
141
|
-
v-if="isHeightAuto"
|
|
142
144
|
:class="{
|
|
143
145
|
...commonClass,
|
|
144
|
-
'selectDepartments-show-
|
|
146
|
+
'selectDepartments-show-ellipsis': true
|
|
145
147
|
}"
|
|
146
|
-
itemClass="selectDepartments-show-
|
|
148
|
+
itemClass="selectDepartments-show-ellipsis-tag"
|
|
147
149
|
:list="curShowValList"
|
|
148
150
|
></dsh-tags>
|
|
149
|
-
|
|
150
|
-
<!-- 高度不自由(不换行) -->
|
|
151
|
-
<bri-tooltip
|
|
152
|
-
v-else
|
|
153
|
-
:content="showVal"
|
|
154
|
-
placement="top"
|
|
155
|
-
maxWidth="200"
|
|
156
|
-
:transfer="true"
|
|
157
|
-
>
|
|
158
|
-
<dsh-tags
|
|
159
|
-
:class="{
|
|
160
|
-
...commonClass,
|
|
161
|
-
'selectDepartments-show-ellipsis': true
|
|
162
|
-
}"
|
|
163
|
-
itemClass="selectDepartments-show-ellipsis-tag"
|
|
164
|
-
:list="curShowValList"
|
|
165
|
-
></dsh-tags>
|
|
166
|
-
</bri-tooltip>
|
|
167
|
-
</template>
|
|
151
|
+
</bri-tooltip>
|
|
168
152
|
</template>
|
|
169
153
|
|
|
170
154
|
<!-- 无值 -->
|
|
@@ -349,23 +333,6 @@
|
|
|
349
333
|
&-ellipsis {
|
|
350
334
|
margin: 5px 0px;
|
|
351
335
|
}
|
|
352
|
-
|
|
353
|
-
&-unit {
|
|
354
|
-
.dsh-ellipsis();
|
|
355
|
-
padding-left: 5px;
|
|
356
|
-
|
|
357
|
-
&-img {
|
|
358
|
-
width: 18px;
|
|
359
|
-
height: 18px;
|
|
360
|
-
vertical-align: middle;
|
|
361
|
-
margin-left: -5px;
|
|
362
|
-
border-radius: 50%;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
&-text {
|
|
366
|
-
vertical-align: middle;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
336
|
}
|
|
370
337
|
}
|
|
371
338
|
</style>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
maxWidth="200"
|
|
11
11
|
:transfer="true"
|
|
12
12
|
>
|
|
13
|
-
<div @click
|
|
13
|
+
<div @click="clickInput">
|
|
14
14
|
<slot>
|
|
15
15
|
<dsh-control-input
|
|
16
16
|
:class="commonClass"
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
return list.reduce((arr, item) => {
|
|
316
316
|
return [
|
|
317
317
|
...arr,
|
|
318
|
-
...
|
|
318
|
+
...loop(item.children)
|
|
319
319
|
];
|
|
320
320
|
}, list);
|
|
321
321
|
};
|
|
@@ -327,10 +327,10 @@
|
|
|
327
327
|
return [
|
|
328
328
|
...(this.highSearch ? this.highDepartList : []),
|
|
329
329
|
{
|
|
330
|
-
_key: "",
|
|
331
330
|
name: "全部",
|
|
332
|
-
|
|
333
|
-
level: 1
|
|
331
|
+
_key: "",
|
|
332
|
+
level: 1,
|
|
333
|
+
is_leaf: true
|
|
334
334
|
},
|
|
335
335
|
...(
|
|
336
336
|
this.allFilterDepartKeys.length
|
|
@@ -345,10 +345,10 @@
|
|
|
345
345
|
this.isCompAdmin
|
|
346
346
|
? [
|
|
347
347
|
{
|
|
348
|
-
is_leaf: true,
|
|
349
|
-
level: 1,
|
|
350
348
|
name: "离职人员",
|
|
351
|
-
_key: "_resign"
|
|
349
|
+
_key: "_resign",
|
|
350
|
+
level: 1,
|
|
351
|
+
is_leaf: true
|
|
352
352
|
}
|
|
353
353
|
]
|
|
354
354
|
: []
|
|
@@ -365,9 +365,11 @@
|
|
|
365
365
|
: this.dataList;
|
|
366
366
|
list = this.curDepart._key === "_highSearch"
|
|
367
367
|
? this.highList
|
|
368
|
-
:
|
|
369
|
-
?
|
|
370
|
-
:
|
|
368
|
+
: this.curDepart._key === "_resign"
|
|
369
|
+
? this.dataList
|
|
370
|
+
: !this.curDepart._key
|
|
371
|
+
? list
|
|
372
|
+
: list.filter(item => item.departmentKey === this.curDepart._key);
|
|
371
373
|
|
|
372
374
|
return this.transformDepartList(list, this.tmpValKeys);
|
|
373
375
|
},
|
|
@@ -438,7 +440,7 @@
|
|
|
438
440
|
}
|
|
439
441
|
: undefined
|
|
440
442
|
},
|
|
441
|
-
department: this.curDepart._key
|
|
443
|
+
// department: this.curDepart._key,
|
|
442
444
|
pagination: this.pagePropsObj
|
|
443
445
|
},
|
|
444
446
|
loadingName: "loading",
|
|
@@ -537,7 +539,7 @@
|
|
|
537
539
|
&-modal {
|
|
538
540
|
.ivu-modal {
|
|
539
541
|
width: 40%!important;
|
|
540
|
-
min-width:
|
|
542
|
+
min-width: 900px!important;
|
|
541
543
|
height: 60%;
|
|
542
544
|
min-height: 600px;
|
|
543
545
|
}
|
|
@@ -570,13 +572,13 @@
|
|
|
570
572
|
border-top: 1px solid #E5E5E5;
|
|
571
573
|
|
|
572
574
|
&-menu {
|
|
573
|
-
flex:
|
|
575
|
+
flex: 4;
|
|
574
576
|
height: 100%;
|
|
575
577
|
overflow: auto;
|
|
576
578
|
}
|
|
577
579
|
|
|
578
580
|
&-users {
|
|
579
|
-
flex:
|
|
581
|
+
flex: 3;
|
|
580
582
|
border-left: 1px solid #E5E5E5;
|
|
581
583
|
position: relative;
|
|
582
584
|
|