n20-common-lib 1.3.117 → 1.3.119

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.117",
3
+ "version": "1.3.119",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -15,6 +15,12 @@
15
15
  box-shadow: none;
16
16
  border-color: none;
17
17
  }
18
+ .el-date-editor.el-range-editor.el-input__inner {
19
+ border-top: none;
20
+ border-right: none;
21
+ border-bottom: none;
22
+ border-radius: 0 4px 4px 0;
23
+ }
18
24
  .el-date-editor .el-input__inner {
19
25
  // border-left: none;
20
26
  border-top: none;
@@ -11,9 +11,11 @@
11
11
  <el-date-picker
12
12
  v-if="selectType === 1"
13
13
  v-model="day"
14
+ style="width: 220px"
14
15
  format="yyyy-MM-dd"
15
16
  value-format="yyyy-MM-dd"
16
- type="date"
17
+ type="daterange"
18
+ clearable
17
19
  placeholder="选择日"
18
20
  @change="dayChange"
19
21
  />
@@ -54,6 +56,7 @@
54
56
 
55
57
  <script>
56
58
  import quarterDatePicker from './quarterDatePicker'
59
+ import dayjs from 'dayjs'
57
60
  export default {
58
61
  name: 'SelectDatePicker',
59
62
  components: {
@@ -61,7 +64,7 @@ export default {
61
64
  },
62
65
  props: {
63
66
  value: {
64
- type: String,
67
+ type: [String, Array],
65
68
  default: ''
66
69
  },
67
70
  selectType: {
@@ -120,7 +123,7 @@ export default {
120
123
 
121
124
  dayChange(val) {
122
125
  this.$emit('input', val)
123
- this.$emit('change', val)
126
+ this.$emit('change', val[0] + ' - ' + val[1])
124
127
  },
125
128
  timestampToTime(timestamp) {
126
129
  var date = new Date(timestamp) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
@@ -147,12 +150,16 @@ export default {
147
150
  this.$emit('change', weekTime)
148
151
  },
149
152
  monthChange(val) {
153
+ let IMonth =
154
+ dayjs(val).startOf('month').format('YYYY-MM-DD') + ' - ' + dayjs(val).endOf('month').format('YYYY-MM-DD')
150
155
  this.$emit('input', val)
151
- this.$emit('change', val)
156
+ this.$emit('change', IMonth)
152
157
  },
153
158
  yearChange(val) {
159
+ let iYear =
160
+ dayjs(val).startOf('year').format('YYYY-MM-DD') + ' - ' + dayjs(val).endOf('year').format('YYYY-MM-DD')
154
161
  this.$emit('input', val)
155
- this.$emit('change', val)
162
+ this.$emit('change', iYear)
156
163
  },
157
164
  handleChange(val, val2) {
158
165
  this.$emit('input', val)