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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.4.22",
3
+ "version": "1.4.23",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -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)) val = Number(Number(val).toFixed(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) return;
369
-
370
- if (event.type == "input" && !this.activeChange) return;
369
+ if (event.type == "change" && this.activeChange) {
371
370
 
372
- let val = event.target.value.trim();
373
- if (this.parser) {
374
- val = this.parser(val);
375
- }
371
+ } else if (event.type == "input" && !this.activeChange) {
376
372
 
377
- const isEmptyString = val.length === 0;
378
- if (isEmptyString) {
379
- this.setValue(null);
380
- return;
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
- // eslint认为\为无用的转义符(-不需要转义)
385
- // if (event.type == "input" && val.match(/^\-?\.?$|\.$/)) return; // prevent fire early if decimal. If no more input the change event will fire later
386
- val = Number(val);
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
- if (!isNaN(val)) {
389
- // this.currentValue = val;
390
- this.setValue(val);
391
- } else {
392
- event.target.value = this.currentValue;
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) {
@@ -15,7 +15,6 @@
15
15
  :max="maxNum"
16
16
  :min="minNum"
17
17
  :precision="digit"
18
- @on-change="change"
19
18
  >
20
19
  <div
21
20
  v-if="unitStr"
@@ -170,8 +170,6 @@ export default {
170
170
  clickInput (e) {
171
171
  if (!this.disabled) {
172
172
  this.showModal = true;
173
- } else {
174
- e.stopPropagation();
175
173
  }
176
174
  },
177
175
  clickCancel () {
@@ -10,7 +10,7 @@
10
10
  maxWidth="200"
11
11
  :transfer="true"
12
12
  >
13
- <div @click.stop="clickInput">
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-if="isUnitShow"
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-auto': true
146
+ 'selectDepartments-show-ellipsis': true
145
147
  }"
146
- itemClass="selectDepartments-show-auto-tag"
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.stop="clickInput">
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
- ...this.getAllListFilterVals(item.children)
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
- is_leaf: true,
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
- : !this.curDepart._key
369
- ? list
370
- : list.filter(item => item.departmentKey === this.curDepart._key);
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 === "_resign" ? "_resign" : undefined,
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: 800px!important;
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: 3;
575
+ flex: 4;
574
576
  height: 100%;
575
577
  overflow: auto;
576
578
  }
577
579
 
578
580
  &-users {
579
- flex: 2;
581
+ flex: 3;
580
582
  border-left: 1px solid #E5E5E5;
581
583
  position: relative;
582
584