n20-common-lib 2.5.5-beta.7 → 2.5.5-beta.8

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": "2.5.5-beta.7",
3
+ "version": "2.5.5-beta.8",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  $--s: 1024px;
2
2
  $--m: 1600px;
3
3
  $--l: 1920px;
4
- $--input-max: 300px;
4
+ $--input-max: 224px;
5
5
 
6
6
  .el-form-item[span],
7
7
  .el-form-item[span-s],
@@ -30,6 +30,7 @@ $--input-max: 300px;
30
30
 
31
31
  @media only screen and (max-width: $--l) {
32
32
  @for $i from 0 through 24 {
33
+
33
34
  .el-form-item[span-l='#{$i}'],
34
35
  .el-form-item[span-lg='#{$i}'] {
35
36
  width: (1 / 24 * $i * 100) * 1%;
@@ -108,10 +109,12 @@ $--input-max: 300px;
108
109
  .el-textarea__inner {
109
110
  padding-left: 10px;
110
111
  padding-right: 10px;
112
+
111
113
  &[oreadonly] {
112
114
  border-color: $--border-color-base;
113
115
  }
114
116
  }
117
+
115
118
  .el-input-number.is-without-controls .el-input__inner {
116
119
  padding-left: 10px;
117
120
  padding-right: 10px;
@@ -563,12 +566,14 @@ $--input-max: 300px;
563
566
  font-size: 16px;
564
567
  transition: all 0.3s;
565
568
  }
569
+
566
570
  &.has-value {
567
571
  &:hover {
568
572
  .el-range__icon {
569
573
  display: none;
570
574
  }
571
575
  }
576
+
572
577
  &.is-disabled {
573
578
  .el-range__icon {
574
579
  display: initial;
@@ -676,6 +681,7 @@ $--input-max: 300px;
676
681
  .el-input__suffix {
677
682
  font-size: 14px;
678
683
  }
684
+
679
685
  .el-icon-circle-close {
680
686
  pointer-events: all;
681
687
  cursor: pointer;
@@ -694,10 +700,12 @@ $--input-max: 300px;
694
700
  .el-select__input {
695
701
  margin-left: 10px;
696
702
  }
703
+
697
704
  .el-input__suffix {
698
705
  display: none;
699
706
  }
700
707
  }
708
+
701
709
  &.is-clearable {
702
710
  .el-select {
703
711
  .el-input__inner {
@@ -705,6 +713,7 @@ $--input-max: 300px;
705
713
  }
706
714
  }
707
715
  }
716
+
708
717
  .el-input__suffix {
709
718
  z-index: 1;
710
719
  }
@@ -728,6 +737,7 @@ $--input-max: 300px;
728
737
  /* 脱离form-item校验 */
729
738
  .rule-key__is-error {
730
739
  position: relative;
740
+
731
741
  .el-input__inner,
732
742
  .el-input__inner:focus,
733
743
  .el-textarea__inner,
@@ -735,6 +745,7 @@ $--input-max: 300px;
735
745
  border-color: $--color-danger;
736
746
  }
737
747
  }
748
+
738
749
  .rule-key__error_msg {
739
750
  color: $--color-danger;
740
751
  font-size: 12px;
@@ -750,8 +761,9 @@ $--input-max: 300px;
750
761
  }
751
762
 
752
763
  .n20-approval-Button {
764
+
753
765
  .el-form-item--small .el-form-item__content,
754
766
  .el-form-item--small .el-form-item__label {
755
767
  line-height: 1.5;
756
768
  }
757
- }
769
+ }
@@ -167,6 +167,12 @@ th.vxe-header--column {
167
167
  font-family: PingFang SC, Microsoft YaHei, Arial, sans-serif !important;
168
168
  color: #333;
169
169
  }
170
+
171
+ .vxe-header--column {
172
+ .vxe-cell {
173
+ justify-content: center !important;
174
+ }
175
+ }
170
176
  @import '../../components/TableSetSize/style.scss';
171
177
  .el-table-set-size-item {
172
178
  .icon-mini {
@@ -9,15 +9,19 @@
9
9
  align-items: center;
10
10
  flex: 1;
11
11
  padding: 8px;
12
+
12
13
  &-item.n20-advanced-filter-active {
13
14
  border-color: #b3d0ff;
14
15
  background: #e9f2ff !important;
15
16
  }
17
+
16
18
  &-body {
19
+
17
20
  .el-form-item,
18
21
  .el-form-item--small.el-form-item {
19
22
  margin-bottom: 10px;
20
23
  }
24
+
21
25
  .el-form-item__content {
22
26
  display: inline-block;
23
27
  vertical-align: middle;
@@ -38,6 +42,7 @@
38
42
  border-radius: 4px;
39
43
  white-space: nowrap;
40
44
  cursor: pointer;
45
+
41
46
  .el-form-item__label {
42
47
  padding: 0;
43
48
  display: inline-block;
@@ -51,9 +56,11 @@
51
56
  .n20-date-editor.el-input--prefix {
52
57
  max-width: 166px;
53
58
  }
59
+
54
60
  .el-range-editor.el-input__inner {
55
61
  min-width: 168px;
56
62
  max-width: 224px;
63
+
57
64
  .el-range-input {
58
65
  background-color: transparent;
59
66
  }
@@ -65,6 +72,7 @@
65
72
  width: 100%;
66
73
  background-color: transparent;
67
74
  }
75
+
68
76
  .el-input__inner:active,
69
77
  .el-input__inner:focus {
70
78
  box-shadow: none;
@@ -78,32 +86,45 @@
78
86
  vertical-align: middle;
79
87
  padding: 0 10px;
80
88
  }
89
+
81
90
  .el-radio-group {
82
91
  padding: 0 10px;
83
92
  }
84
93
 
85
94
  .n20-num-w {
95
+
86
96
  .el-input,
87
97
  .el-input__inner {
88
98
  padding-left: 0;
89
99
  }
90
100
  }
101
+
91
102
  &-close {
92
103
  display: none;
93
104
  position: absolute;
94
105
  top: -6px;
95
106
  right: -10px;
96
107
  }
108
+
97
109
  &:hover {
98
110
  .n20-advanced-filter-item-close {
99
111
  display: inline-block;
100
112
  }
101
113
  }
102
114
  }
115
+
116
+ &-item.el-form-item[disabled] {
117
+ background-color: #f5f5f5;
118
+ border-color: #e4e7ed;
119
+ color: #333333;
120
+ cursor: not-allowed;
121
+ }
122
+
103
123
  &-content {
104
124
  display: inline-block;
105
125
  white-space: nowrap;
106
126
  text-overflow: ellipsis;
127
+
107
128
  .el-select.el-select--small {
108
129
  .el-select__tags {
109
130
  max-width: 88px !important;
@@ -112,10 +133,12 @@
112
133
  }
113
134
  }
114
135
  }
136
+
115
137
  :hover {
116
138
  border-color: $--color-primary;
117
139
  cursor: pointer;
118
140
  }
141
+
119
142
  &-add {
120
143
  display: inline-block;
121
144
  vertical-align: middle;
@@ -125,4 +148,4 @@
125
148
  .popover-check-box {
126
149
  max-height: 300px;
127
150
  overflow-y: auto;
128
- }
151
+ }
@@ -1,20 +1,27 @@
1
1
  <template>
2
- <div class="popover-check-box">
3
- <el-checkbox-group v-model="checkList" class="flex-column" @change="checkChange">
4
- <el-checkbox
5
- v-for="(item, i) in filterList"
6
- :key="i"
7
- class="m-t-b"
8
- :disabled="checkList.includes(item.label)"
9
- :label="item.label"
10
- />
11
- </el-checkbox-group>
12
- </div>
2
+ <el-checkbox-group v-model="checkArrayCalc" class="popover-check-box" @change="checkChange">
3
+ <vue-draggable
4
+ :list="filterList"
5
+ :animation="200"
6
+ group="dragBox"
7
+ :handle="'.n20-icon-tuodong'"
8
+ @change="dragChange"
9
+ >
10
+ <div v-for="(item, index) in filterList" :key="index" class="n20-drag-list-item">
11
+ <el-checkbox :disabled="item.static" :label="item">{{ item.label }}</el-checkbox
12
+ ><i class="n20-drag-icon n20-icon-tuodong"></i>
13
+ </div>
14
+ </vue-draggable>
15
+ </el-checkbox-group>
13
16
  </template>
14
17
 
15
18
  <script>
19
+ import importGlobal from '../../utils/importGlobal.js'
16
20
  export default {
17
21
  name: 'FilterItem',
22
+ components: {
23
+ vueDraggable: () => importGlobal('vuedraggable', () => import(/*webpackChunkName: "vuedraggable"*/ 'vuedraggable'))
24
+ },
18
25
  props: {
19
26
  filterList: {
20
27
  type: Array,
@@ -25,22 +32,23 @@ export default {
25
32
  default: () => []
26
33
  }
27
34
  },
28
- data() {
29
- return {
30
- checkList: ''
31
- }
32
- },
33
- watch: {
34
- checkArray: {
35
- handler(val) {
36
- this.checkList = val
35
+ computed: {
36
+ checkArrayCalc: {
37
+ get() {
38
+ return this.checkArray
37
39
  },
38
- deep: true
40
+ set(value) {
41
+ this.$emit('update:checkArray', value)
42
+ return value
43
+ }
39
44
  }
40
45
  },
41
46
  methods: {
42
47
  checkChange(keys) {
43
48
  this.$emit('checked', keys)
49
+ },
50
+ dragChange() {
51
+ this.$emit('checked', this.checkArrayCalc)
44
52
  }
45
53
  }
46
54
  }
@@ -6,16 +6,17 @@
6
6
  :style="{
7
7
  width:
8
8
  form[item.value] && form[item.value].length > 0
9
- ? (context.measureText(form[item.value]).width * 1.4 < 75
9
+ ? (context.measureText(form[item.value]).width * 1.4 + 45 < 75
10
10
  ? 75
11
- : context.measureText(form[item.value]).width * 1.4 > 396
11
+ : context.measureText(form[item.value]).width * 1.4 + 45 > 396
12
12
  ? 396
13
- : context.measureText(form[item.value]).width * 1.4 + 35) + 'px'
14
- : 120 - 18 - context.measureText(item.label).width * 1.4 + 'px'
13
+ : context.measureText(form[item.value]).width * 1.4 + 45) + 'px'
14
+ : item.width || 100
15
15
  }"
16
+ :value-data="context.measureText(form[item.value]).width * 1.4 + 45 + 'px'"
16
17
  v-bind="item.props"
17
18
  :placeholder="item.props && item.props.placeholder ? item.props.placeholder : $lc('请输入')"
18
- v-on="item.on"
19
+ @blur="handleBlur"
19
20
  />
20
21
  <el-input
21
22
  v-else-if="item.type === 'search'"
@@ -24,12 +25,12 @@
24
25
  :style="{
25
26
  width:
26
27
  form[item.value] && form[item.value].length > 0
27
- ? context.measureText(form[item.value]).width * 1.4 + 40 + 'px'
28
- : 120 - 18 - context.measureText(item.label).width * 1.4 + 'px'
28
+ ? context.measureText(form[item.value]).width * 1.4 + 50 + 'px'
29
+ : item.width || 100
29
30
  }"
30
31
  readonly
31
32
  v-bind="item.props"
32
- v-on="item.on"
33
+ @blur="handleBlur"
33
34
  >
34
35
  <i
35
36
  slot="suffix"
@@ -55,15 +56,15 @@
55
56
  (r) =>
56
57
  r.value === form[item.value] ||
57
58
  (item.props && item.props.valueKey && r[item.props.valueKey] === form[item.value])
58
- ).label
59
+ )
59
60
  ).width *
60
61
  1.4 +
61
62
  48 +
62
63
  'px'
63
- : 120 - 18 - context.measureText(item.label).width * 1.4 + 'px'
64
+ : item.width || 100
64
65
  }"
65
66
  v-bind="item.props"
66
- v-on="item.on"
67
+ @change="handleChange"
67
68
  >
68
69
  <template v-if="item.props && item.props.labelKey && item.props.valueKey">
69
70
  <el-option
@@ -90,34 +91,36 @@
90
91
  :style="{
91
92
  width:
92
93
  form[item.value] && Math.floor(Math.log10(form[item.value])) + 1 > 0
93
- ? (context.measureText(form[item.value]).width * 1.4 < 74
94
+ ? (context.measureText(form[item.value]).width * 1.6 + 60 < 74
94
95
  ? 74
95
- : context.measureText(form[item.value]).width * 1.4 > 396
96
+ : context.measureText(form[item.value]).width * 1.6 + 60 > 396
96
97
  ? 396
97
- : context.measureText(form[item.value]).width * 1.4 + 35) + 'px'
98
- : 120 - 18 - context.measureText(item.label).width * 1.4 + 'px'
98
+ : context.measureText(form[item.value]).width * 1.6 + 60) + 'px'
99
+ : item.width || 100
99
100
  }"
100
101
  v-bind="item.props"
101
- v-on="item.on"
102
+ @blur="handleChange"
102
103
  />
103
104
  <inputNumberRange
104
105
  v-else-if="item.type === 'numberrange'"
105
106
  :start-value.sync="form[item.startValue]"
106
107
  :end-value.sync="form[item.endValue]"
107
108
  :style="{
108
- width: (form[item.startValue] && Math.floor(Math.log10(form[item.startValue])) + 1 > 0 ? 202 : 166) + 'px'
109
+ width:
110
+ item.width ||
111
+ (form[item.startValue] && Math.floor(Math.log10(form[item.startValue])) + 1 > 0 ? 202 : 166) + 'px'
109
112
  }"
110
113
  v-bind="item.props"
111
- v-on="item.on"
114
+ @blur="handleChange"
112
115
  />
113
116
  <datePickerPor
114
117
  v-else-if="['date', 'datetime', 'year', 'month', 'week'].includes(item.type)"
115
118
  v-model="form[item.value]"
116
119
  :type="item.type"
117
120
  :clearable="(item.props && item.props.clearable) || false"
118
- :style="{ width: 166 + 'px' }"
121
+ :style="{ width: item.width || 166 + 'px' }"
119
122
  v-bind="item.props"
120
- v-on="item.on"
123
+ @change="handleChange"
121
124
  />
122
125
  <datePickerPor
123
126
  v-else-if="['daterange', 'datetimerange', ' monthrange'].includes(item.type)"
@@ -125,11 +128,16 @@
125
128
  :start-date.sync="form[item.startDate]"
126
129
  :end-date.sync="form[item.endDate]"
127
130
  :clearable="(item.props && item.props.clearable) || false"
128
- style="width: 100%"
131
+ :style="{ width: item.width || 100 }"
129
132
  v-bind="item.props"
130
- v-on="item.on"
133
+ @change="handleChange"
131
134
  />
132
- <el-checkbox-group v-else-if="item.type === 'checkbox'" v-model="form[item.value]" v-bind="item.props" v-on="item.on">
135
+ <el-checkbox-group
136
+ v-else-if="item.type === 'checkbox'"
137
+ v-model="form[item.value]"
138
+ v-bind="item.props"
139
+ @change="handleChange"
140
+ >
133
141
  <el-checkbox v-for="c in item.options" :key="c.value" :label="c.value" :disabled="c.disabled">{{
134
142
  c.label
135
143
  }}</el-checkbox>
@@ -144,6 +152,7 @@ import axios from '../../utils/axios'
144
152
  import inputNumber from '../InputNumber/index.vue'
145
153
  import inputNumberRange from '../InputNumber/numberRange.vue'
146
154
  import datePickerPor from '../DatePicker/por.vue'
155
+ import { $lc } from '../../utils/i18n/index.js'
147
156
 
148
157
  const canvas = document.createElement('canvas')
149
158
  const context = canvas.getContext('2d')
@@ -169,12 +178,19 @@ export default {
169
178
  context
170
179
  }
171
180
  },
181
+
172
182
  created() {
173
183
  if (this.item.reqOptions) {
174
184
  this.getOptions()
175
185
  }
176
186
  },
177
187
  methods: {
188
+ handleBlur(fn, value) {
189
+ this.$emit('blur')
190
+ },
191
+ handleChange() {
192
+ this.$emit('blur')
193
+ },
178
194
  getOptions() {
179
195
  let reqOptions = this.item.reqOptions
180
196
  let url = reqOptions.url || ''