sone-ui-component-3.2.4 2.1.42 → 2.1.44

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": "sone-ui-component-3.2.4",
3
- "version": "2.1.42",
3
+ "version": "2.1.44",
4
4
  "private": false,
5
5
  "main": "lib/sone-ui.common.js",
6
6
  "files": [
@@ -186,10 +186,7 @@
186
186
  </template>
187
187
 
188
188
  <!-- 日期范围、日期时间范围 -->
189
- <template
190
- v-if="(item.layoutType === 'daterange' ||
191
- item.layoutType === 'datetimerange' ) &&
192
- form.hasOwnProperty(item.fieldName)">
189
+ <template v-if="['daterange', 'datetimerange', 'monthrange'].includes(item.layoutType) && form.hasOwnProperty(item.fieldName)">
193
190
  <el-date-picker
194
191
  :clearable="item.hasOwnProperty('clearable') ? item.clearable : true"
195
192
  v-model="form[item.fieldName]"
@@ -201,6 +198,7 @@
201
198
  :disabled="item.disabled"
202
199
  :value-format="item.valueFormat"
203
200
  :default-time="item.defaultTime"
201
+ :picker-options="item.layoutType === 'monthrange'? monthPickerOptions : pickerOptions"
204
202
  @focus="focusFn(item.fieldName)"
205
203
  @change="val => updateDate(val, item)"
206
204
  ></el-date-picker>
@@ -305,6 +303,56 @@ export default {
305
303
  data() {
306
304
  return {
307
305
  isBottomCollapse: false,
306
+ monthPickerOptions: {
307
+ shortcuts: [{
308
+ text: '本月',
309
+ onClick(picker) {
310
+ picker.$emit('pick', [new Date(), new Date()]);
311
+ }
312
+ }, {
313
+ text: '今年至今',
314
+ onClick(picker) {
315
+ const end = new Date();
316
+ const start = new Date(new Date().getFullYear(), 0);
317
+ picker.$emit('pick', [start, end]);
318
+ }
319
+ }, {
320
+ text: '最近六个月',
321
+ onClick(picker) {
322
+ const end = new Date();
323
+ const start = new Date();
324
+ start.setMonth(start.getMonth() - 6);
325
+ picker.$emit('pick', [start, end]);
326
+ }
327
+ }]
328
+ },
329
+ pickerOptions: {
330
+ shortcuts: [{
331
+ text: '最近一周',
332
+ onClick(picker) {
333
+ const end = new Date();
334
+ const start = new Date();
335
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
336
+ picker.$emit('pick', [start, end]);
337
+ }
338
+ }, {
339
+ text: '最近一个月',
340
+ onClick(picker) {
341
+ const end = new Date();
342
+ const start = new Date();
343
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
344
+ picker.$emit('pick', [start, end]);
345
+ }
346
+ }, {
347
+ text: '最近三个月',
348
+ onClick(picker) {
349
+ const end = new Date();
350
+ const start = new Date();
351
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
352
+ picker.$emit('pick', [start, end]);
353
+ }
354
+ }]
355
+ },
308
356
  }
309
357
  },
310
358
  methods: {
@@ -461,7 +509,37 @@ export default {
461
509
  this.$refs['sone-form'].$el.scrollTop = 0;
462
510
  this.isBottomCollapse = !this.isBottomCollapse;
463
511
  this.$emit('toggle', this.isBottomCollapse);
464
- }
512
+ },
513
+
514
+ // pickerOptions(){
515
+ // return {
516
+ // shortcuts: [{
517
+ // text: '最近一周',
518
+ // onClick(picker) {
519
+ // const end = new Date();
520
+ // const start = new Date();
521
+ // start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
522
+ // picker.$emit('pick', [start, end]);
523
+ // }
524
+ // }, {
525
+ // text: '最近一个月',
526
+ // onClick(picker) {
527
+ // const end = new Date();
528
+ // const start = new Date();
529
+ // start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
530
+ // picker.$emit('pick', [start, end]);
531
+ // }
532
+ // }, {
533
+ // text: '最近三个月',
534
+ // onClick(picker) {
535
+ // const end = new Date();
536
+ // const start = new Date();
537
+ // start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
538
+ // picker.$emit('pick', [start, end]);
539
+ // }
540
+ // }]
541
+ // }
542
+ // }
465
543
  },
466
544
  };
467
545
  </script>
Binary file
Binary file
@@ -9,7 +9,10 @@
9
9
  <!-- 展示类型 -->
10
10
  <div class="sone-tree" v-if="type === 'normal'">
11
11
  <div v-if="lineDirection === 'left'" class="show-line" :style="dragWidth?'cursor:col-resize;':''" ref='line'>
12
- <div class="show-line-box" @click="onShow(2)" :style="showStyle2"></div>
12
+ <div class="show-line-box" @click="onShow(2)">
13
+ <img v-show="show" :src="leftImg"/>
14
+ <img v-show="!show" :src="rightImg"/>
15
+ </div>
13
16
  </div>
14
17
  <div class="tree-wrap" ref="menu" v-show="show" :style="'width:' + defaultWidth + 'px'">
15
18
  <div class="sone-tree-title">
@@ -59,13 +62,19 @@
59
62
  </div>
60
63
  </div>
61
64
  <div v-if="lineDirection === 'right'" class="show-line" :style="dragWidth?'cursor:col-resize;':''" ref='line'>
62
- <div class="show-line-box" @click="onShow(1)" :style="showStyle"></div>
65
+ <div class="show-line-box" @click="onShow(1)">
66
+ <img v-show="show" :src="leftImg"/>
67
+ <img v-show="!show" :src="rightImg"/>
68
+ </div>
63
69
  </div>
64
70
  </div>
65
71
  <!-- 操作类型 -->
66
72
  <div class="sone-tree" v-else >
67
73
  <div v-if="lineDirection === 'left'" class="show-line" :style="dragWidth?'cursor:col-resize;':''" ref='line'>
68
- <div class="show-line-box" @click="onShow(2)" :style="showStyle2"></div>
74
+ <div class="show-line-box" @click="onShow(2)">
75
+ <img v-show="show" :src="leftImg"/>
76
+ <img v-show="!show" :src="rightImg"/>
77
+ </div>
69
78
  </div>
70
79
  <div class="tree-wrap" ref="menu" v-show="show" :style="'width:' + defaultWidth + 'px'" >
71
80
  <div class="sone-tree-title">
@@ -157,7 +166,10 @@
157
166
 
158
167
  </div>
159
168
  <div v-if="lineDirection === 'right'" class="show-line" :style="dragWidth?'cursor:col-resize;':''" ref='line'>
160
- <div class="show-line-box" @click="onShow(1)" :style="showStyle"></div>
169
+ <div class="show-line-box" @click="onShow(1)">
170
+ <img v-show="show" :src="leftImg"/>
171
+ <img v-show="!show" :src="rightImg"/>
172
+ </div>
161
173
  </div>
162
174
  </div>
163
175
  </div>
@@ -165,6 +177,8 @@
165
177
 
166
178
  <script>
167
179
  // import { deepClone } from '../../../../src/utils/util';
180
+ import leftImg from "../img/left.png"
181
+ import rightImg from "../img/right.png"
168
182
  export const getObjType = obj => {
169
183
  var toString = Object.prototype.toString
170
184
  var map = {
@@ -281,6 +295,8 @@ export default {
281
295
  },
282
296
  data() {
283
297
  return {
298
+ leftImg,
299
+ rightImg,
284
300
  show: true,
285
301
  showStyle: "border-right: 6px solid #019bee;transform: translate(-100%,-50%)",
286
302
  showStyle2: "border-left: 6px solid #019bee;transform: translate(0,-50%)",
Binary file
Binary file
package/src/index.js CHANGED
@@ -57,7 +57,7 @@ if (typeof window !== 'undefined' && window.Vue) {
57
57
  }
58
58
 
59
59
  export default {
60
- version: '2.1.42',
60
+ version: '2.1.44',
61
61
  locale: locale.use,
62
62
  i18n: locale.i18n,
63
63
  install,
@@ -191,8 +191,8 @@
191
191
 
192
192
  .more-line {
193
193
  width: 100%;
194
- height: 8px;
195
- border-top: 1px solid #009bee;
194
+ height: 14px;
195
+ // border-top: 1px solid #009bee;
196
196
  background: #fff;
197
197
  cursor: pointer;
198
198
  position: absolute;
@@ -201,8 +201,11 @@
201
201
  }
202
202
  .more-line::before {
203
203
  content: "";
204
- border: 6px solid transparent;
205
- border-top-color: #009bee;
204
+ // border: 6px solid transparent;
205
+ // border-top-color: #009bee;
206
+ width: 28px;
207
+ height: 14px;
208
+ background-image:url('../assets/img/down.png');
206
209
  position: absolute;
207
210
  left: calc(50% - 5px);
208
211
  top: 0px;
@@ -210,14 +213,17 @@
210
213
  }
211
214
  .more-collapse{
212
215
  border-top: none !important;
213
- border-bottom: 1px solid #009bee;
216
+ // border-bottom: 1px solid #009bee;
214
217
  background: unset;
215
218
  position: sticky;
216
219
  }
217
220
  .more-collapse::before {
218
221
  content: "";
219
- border: 6px solid transparent;
220
- border-bottom-color: #009bee;
222
+ // border: 6px solid transparent;
223
+ // border-bottom-color: #009bee;
224
+ width: 28px;
225
+ height: 14px;
226
+ background-image:url('../assets/img/up.png');
221
227
  position: absolute;
222
228
  z-index: 10;
223
229
  left: calc(50% - 5px);
@@ -76,14 +76,18 @@
76
76
  .show-line{
77
77
  position: relative;
78
78
  height: 100%;
79
- border-right:1px solid #019bee;
79
+ border-right:1px solid #fff;
80
+ width: 18px;
81
+ background: #fff;
82
+ box-shadow: 10px 0 5px -3px rgba(0, 0, 0, 0.12);
80
83
  .show-line-box{
84
+ border: 1px solid red;
81
85
  width: 0;
82
86
  height: 0;
83
87
  cursor: pointer;
84
88
  border: 6px solid transparent;
85
89
  position: absolute;
86
- top: 50%;
90
+ top: 49%;
87
91
  }
88
92
  }
89
93
  }