n20-common-lib 1.3.50 → 1.3.53

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": "n20-common-lib",
3
- "version": "1.3.50",
3
+ "version": "1.3.53",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -106,11 +106,15 @@ $--input-max: 304px;
106
106
 
107
107
  .el-input__inner {
108
108
  padding-left: 10px;
109
-
109
+ padding-right: 10px;
110
110
  &[oreadonly] {
111
111
  border-color: $--border-color-base;
112
112
  }
113
113
  }
114
+ .el-input-number.is-without-controls .el-input__inner {
115
+ padding-left: 10px;
116
+ padding-right: 10px;
117
+ }
114
118
 
115
119
  .w-224 {
116
120
  width: $--input-width !important;
@@ -679,6 +683,10 @@ $--input-max: 304px;
679
683
  .el-input__suffix {
680
684
  font-size: 14px;
681
685
  }
686
+ .el-icon-circle-close {
687
+ pointer-events: all;
688
+ cursor: pointer;
689
+ }
682
690
  }
683
691
 
684
692
  /* 多选搜索框 */
@@ -693,26 +701,19 @@ $--input-max: 304px;
693
701
  .el-select__input {
694
702
  margin-left: 10px;
695
703
  }
704
+ .el-input__suffix {
705
+ display: none;
706
+ }
696
707
  }
697
- &[clearable] {
708
+ &.is-clearable {
698
709
  .el-select {
699
710
  .el-input__inner {
700
- padding-right: 48px;
701
- }
702
- .el-input__suffix {
703
- right: 26px;
704
- .el-icon-arrow-up {
705
- display: none;
706
- }
711
+ padding-right: 50px;
707
712
  }
708
713
  }
709
714
  }
710
- &:not([clearable]) {
711
- .el-select {
712
- .el-input__suffix {
713
- display: none;
714
- }
715
- }
715
+ .el-input__suffix {
716
+ z-index: 1;
716
717
  }
717
718
  }
718
719
 
@@ -22,7 +22,7 @@
22
22
  <template v-if="dataPorp.slotHeader">
23
23
  <el-table-column
24
24
  v-for="item in dataPorp.slotHeader"
25
- :key="item"
25
+ :key="item.prop"
26
26
  :label="item.label"
27
27
  :prop="item.prop"
28
28
  :align="item.align || 'center'"
@@ -85,7 +85,7 @@
85
85
  <el-button
86
86
  type="text"
87
87
  icon="el-icon-download"
88
- :disabled="!row[keys.url] || row.url"
88
+ :disabled="!row[keys.url]"
89
89
  @click="downFile(row)"
90
90
  />
91
91
  </slot>
@@ -172,7 +172,7 @@
172
172
  :ref="'upload' + $index"
173
173
  class="n20-upload-table-up"
174
174
  :file-name="row['_name'] || row[keys.name]"
175
- :data="row['_fileData']"
175
+ :data="row['_fileData'] || fileData"
176
176
  :msg-type="null"
177
177
  :show-clear="false"
178
178
  :action="action"
@@ -330,6 +330,7 @@
330
330
  :auto-upload="false"
331
331
  :multiple="true"
332
332
  :action="action"
333
+ :data="fileData"
333
334
  :headers="headers"
334
335
  :accept="fileAccept"
335
336
  :http-request="uploadHttpRequest"
@@ -339,9 +340,7 @@
339
340
  <template slot="trigger">
340
341
  <i class="drag-icon n20-icon-shangchuan"></i>
341
342
  <span class="drag-text">点击或将文件拖拽到这里上传</span>
342
- <span class="drag-tip">
343
- <slot>支持扩展名:.rar .zip .doc .docx .pdf .jpg...</slot>
344
- </span>
343
+ <span class="drag-tip">{{ fileAcceptTip }}</span>
345
344
  </template>
346
345
  </clUpload>
347
346
  <div class="dialog-footer">
@@ -420,30 +419,6 @@ export default {
420
419
  return {
421
420
  imgType: /\.jpg|\.png|\.gif|\.svg$/i,
422
421
  selectionList: [],
423
- fileAccept: this.dataPorp.fileAccept || undefined,
424
- fileSize: this.dataPorp.fileSize || undefined,
425
- typeOptions: this.dataPorp.typeOptions || [
426
- {
427
- type: '001',
428
- label: '信贷合同'
429
- },
430
- {
431
- type: '002',
432
- label: '贴现合同'
433
- },
434
- {
435
- type: '003',
436
- label: '其他合同'
437
- }
438
- ],
439
- keys: this.dataPorp.keys || {
440
- rowKey: 'id',
441
- type: 'type',
442
- name: 'name',
443
- url: 'url',
444
- time: 'time',
445
- user: 'user'
446
- },
447
422
  currFileList: [],
448
423
  visibleP: false,
449
424
  visibleBatch: false,
@@ -452,6 +427,29 @@ export default {
452
427
  previewSameOrg: false
453
428
  }
454
429
  },
430
+ computed: {
431
+ fileAccept() {
432
+ return this.dataPorp.fileAccept || undefined
433
+ },
434
+ fileSize() {
435
+ return this.dataPorp.fileSize || undefined
436
+ },
437
+ fileAcceptTip() {
438
+ return (
439
+ this.dataPorp.fileAcceptTip ||
440
+ '支持扩展名:.rar .zip .doc .docx .pdf .jpg...'
441
+ )
442
+ },
443
+ fileData() {
444
+ return this.dataPorp.fileData || undefined
445
+ },
446
+ typeOptions() {
447
+ return this.dataPorp.typeOptions || typeOptionsD
448
+ },
449
+ keys() {
450
+ return this.dataPorp.keys || keysD
451
+ }
452
+ },
455
453
  methods: {
456
454
  batchUploadFn() {
457
455
  let $uploadwrap = this.$refs['upload-batch']
@@ -580,4 +578,18 @@ export default {
580
578
  }
581
579
  }
582
580
  }
581
+
582
+ const keysD = {
583
+ rowKey: 'id',
584
+ type: 'type',
585
+ name: 'name',
586
+ url: 'url',
587
+ time: 'time',
588
+ user: 'user'
589
+ }
590
+ const typeOptionsD = [
591
+ { type: '001', label: '信贷合同' },
592
+ { type: '002', label: '贴现合同' },
593
+ { type: '003', label: '其他合同' }
594
+ ]
583
595
  </script>
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <el-popover
3
+ ref="popover"
3
4
  v-model="showPop"
4
5
  trigger="manual"
5
6
  :width="width"
@@ -39,7 +40,7 @@
39
40
  <el-button
40
41
  class="p-t-0 m-b-s color-primary"
41
42
  type="text"
42
- @click="showMore = !showMore"
43
+ @click="moreFn"
43
44
  ><span>更多条件</span
44
45
  ><i
45
46
  :class="showMore ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
@@ -197,6 +198,14 @@ export default {
197
198
  this.showPop = false
198
199
  }
199
200
  },
201
+ moreFn() {
202
+ if (this.showMore) {
203
+ this.showMore = false
204
+ } else {
205
+ this.showMore = true
206
+ setTimeout(() => this.$refs['popover'].updatePopper(), 360)
207
+ }
208
+ },
200
209
  setOptions(key, opts) {
201
210
  let item = this.filterList.find((f) => f.value === key)
202
211
  if (item) {
@@ -205,11 +214,20 @@ export default {
205
214
  },
206
215
  getRemote() {
207
216
  this.$refs['setRemote'].getColumns().then((list) => {
208
- this.remoteList = list || this.filterList
217
+ if (list) {
218
+ this.remoteList = list
219
+ } else {
220
+ let defaultList = this.filterList.filter((col) => col.isDefault)
221
+ this.remoteList = defaultList.length
222
+ ? defaultList
223
+ : this.filterList.slice(0, this.defaultShow)
224
+ }
225
+ setTimeout(() => this.$refs['popover'].updatePopper(), 360)
209
226
  })
210
227
  },
211
228
  setRemoteChange(list) {
212
229
  this.remoteList = list
230
+ setTimeout(() => this.$refs['popover'].updatePopper(), 360)
213
231
  }
214
232
  }
215
233
  }
@@ -1,9 +1,13 @@
1
1
  <template>
2
- <div class="n20-num-w">
2
+ <div
3
+ class="n20-num-w"
4
+ @mouseenter="isHove = true"
5
+ @mouseleave="isHove = false"
6
+ >
3
7
  <el-input
4
8
  v-if="showStr"
5
9
  class="n20-stc"
6
- :class="{ 'n20-num--rate': type === 'rate' }"
10
+ :class="{ 'n20-num--rate': type === 'rate' || isClearable }"
7
11
  :value="valueStr"
8
12
  :disabled="disabled"
9
13
  :placeholder="phd"
@@ -14,7 +18,7 @@
14
18
  v-else
15
19
  ref="input-number"
16
20
  class="n20-num"
17
- :class="{ 'n20-num--rate': type === 'rate' }"
21
+ :class="{ 'n20-num--rate': type === 'rate' || isClearable }"
18
22
  :controls="false"
19
23
  v-bind="$attrs"
20
24
  :value="valueNum"
@@ -24,11 +28,14 @@
24
28
  @blur="blurFn"
25
29
  @change="changeFn"
26
30
  />
27
- <span v-if="type === 'rate'" class="el-input__suffix">
28
- <span class="el-input__icon" style="display: inline-block">{{
31
+ <span v-if="isClearable && isHove && value" class="el-input__suffix"
32
+ ><i class="el-input__icon el-icon-circle-close" @click="closeFn"></i
33
+ ></span>
34
+ <span v-else-if="type === 'rate'" class="el-input__suffix"
35
+ ><span class="el-input__icon" style="display: inline-block">{{
29
36
  suffix
30
- }}</span>
31
- </span>
37
+ }}</span></span
38
+ >
32
39
  </div>
33
40
  </template>
34
41
 
@@ -52,7 +59,7 @@ export default {
52
59
  type: Boolean,
53
60
  default: undefined
54
61
  },
55
- clearable: {
62
+ isClearable: {
56
63
  type: Boolean,
57
64
  default: false
58
65
  },
@@ -78,7 +85,8 @@ export default {
78
85
  return {
79
86
  valueStr: '',
80
87
  valueNum: undefined,
81
- showStr: true
88
+ showStr: true,
89
+ isHove: false
82
90
  }
83
91
  },
84
92
  computed: {
@@ -178,6 +186,10 @@ export default {
178
186
  } else {
179
187
  this.preValue = target.value
180
188
  }
189
+ },
190
+ closeFn() {
191
+ this.$emit('input', undefined)
192
+ this.$emit('change', undefined)
181
193
  }
182
194
  }
183
195
  }
@@ -3,6 +3,7 @@
3
3
  v-if="!select"
4
4
  v-bind="$attrs"
5
5
  :value="value"
6
+ :clearable="clearable"
6
7
  v-on="$listeners"
7
8
  @change="searchFn"
8
9
  >
@@ -12,7 +13,13 @@
12
13
  @click.stop="searchFn"
13
14
  ></i>
14
15
  </el-input>
15
- <div v-else class="n20-input-search">
16
+ <div
17
+ v-else
18
+ class="n20-input-search"
19
+ :class="{ 'is-clearable': clearable }"
20
+ @mouseenter="isHove = true"
21
+ @mouseleave="isHove = false"
22
+ >
16
23
  <el-select
17
24
  ref="input-search"
18
25
  v-bind="$attrs"
@@ -26,12 +33,17 @@
26
33
  >
27
34
  <slot></slot>
28
35
  </el-select>
29
- <span class="el-input__suffix">
30
- <span
36
+ <span class="el-input__suffix"
37
+ ><i
31
38
  class="is-search el-input__icon el-icon-zoom-in"
32
39
  @click.stop="searchFn"
33
- ></span>
34
- </span>
40
+ ></i
41
+ ><i
42
+ v-if="clearable && isHove && hasVal"
43
+ class="is-search el-input__icon el-icon-circle-close"
44
+ @click="closeFn"
45
+ ></i
46
+ ></span>
35
47
  </div>
36
48
  </template>
37
49
 
@@ -51,14 +63,36 @@ export default {
51
63
  type: Boolean,
52
64
  default: false
53
65
  },
66
+ clearable: {
67
+ type: Boolean,
68
+ default: false
69
+ },
54
70
  allowCreate: {
55
71
  type: Boolean,
56
72
  default: true
57
73
  }
58
74
  },
59
75
  data() {
60
- this.listeners = Object.assign({}, this.$listeners, { input: () => {} })
61
- return {}
76
+ return {
77
+ isHove: false
78
+ }
79
+ },
80
+ computed: {
81
+ hasVal() {
82
+ if (this.multiple) {
83
+ if (this.value && this.value.length) {
84
+ return true
85
+ } else {
86
+ return false
87
+ }
88
+ } else {
89
+ if (this.value || this.value === 0) {
90
+ return true
91
+ } else {
92
+ return false
93
+ }
94
+ }
95
+ }
62
96
  },
63
97
  methods: {
64
98
  visibleChangeFn(val) {
@@ -75,6 +109,10 @@ export default {
75
109
  },
76
110
  searchFn() {
77
111
  this.$emit('search', this.value)
112
+ },
113
+ closeFn() {
114
+ this.$emit('input', undefined)
115
+ this.$emit('change', undefined)
78
116
  }
79
117
  }
80
118
  }
@@ -1,11 +1,13 @@
1
1
  <template>
2
2
  <dialog-wrap
3
3
  ref="dialog"
4
+ v-drag
4
5
  class="p-t-0"
5
6
  v-bind="$attrs"
6
7
  :visible.sync="visible"
7
- :width="width"
8
8
  :title="title"
9
+ :width="width"
10
+ :close-on-click-modal="false"
9
11
  @open="popOpen"
10
12
  >
11
13
  <div class="dialog-view">
@@ -172,6 +174,11 @@ export default {
172
174
  }
173
175
  },
174
176
  reset() {
177
+ if (this.isFilter) {
178
+ let dragList = this.columns.filter((col) => col.isDefault)
179
+ this.dragList = dragList.length ? dragList : this.checkColumns
180
+ return
181
+ }
175
182
  this.dragList = this.checkColumns.filter((col) => !col.static)
176
183
  },
177
184
  setChange() {