vsyswin-ui 0.2.54 → 0.2.55

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": "vsyswin-ui",
3
- "version": "0.2.54",
3
+ "version": "0.2.55",
4
4
  "main": "lib/vsyswin-ui.umd.min.js",
5
5
  "private": false,
6
6
  "description": "Vue2.x的应用组件库.",
@@ -91,6 +91,7 @@
91
91
  <template v-else-if="item.type === 'select'">
92
92
  <span class="syswin-filter-item__name" v-if="item.name && !item.hideName">{{ item.name }}</span>
93
93
  <el-select
94
+ size="small"
94
95
  :multiple="!!item.multiple"
95
96
  collapse-tags
96
97
  clearable
@@ -179,6 +180,7 @@
179
180
  <template v-else-if="item.type === 'select'">
180
181
  <span class="syswin-filter-item__name" v-if="item.name && !item.hideName">{{ item.name }}</span>
181
182
  <el-select
183
+ size="small"
182
184
  :multiple="!!item.multiple"
183
185
  collapse-tags
184
186
  clearable
@@ -251,6 +253,7 @@
251
253
  <template v-else-if="item.type === 'select'">
252
254
  <span class="syswin-filter-item__name" v-if="item.name">{{ item.name }}</span>
253
255
  <el-select
256
+ size="small"
254
257
  :multiple="!!item.multiple"
255
258
  collapse-tags
256
259
  clearable
@@ -379,7 +382,7 @@ export default {
379
382
  saveToLocalPosition: {
380
383
  type: String,
381
384
  default: 'right',
382
- validator: function(value) {
385
+ validator: function (value) {
383
386
  return ['left', 'right'].indexOf(value) !== -1
384
387
  }
385
388
  },
@@ -435,8 +438,8 @@ export default {
435
438
  createTagList() {
436
439
  const list = []
437
440
  this.currentSearchList.length &&
438
- this.currentSearchList.forEach(ele => {
439
- ele.itemList.forEach(item => {
441
+ this.currentSearchList.forEach((ele) => {
442
+ ele.itemList.forEach((item) => {
440
443
  if (item.isActive || item.type === 'slot') {
441
444
  let obj = {
442
445
  pId: ele.id,
@@ -469,10 +472,10 @@ export default {
469
472
  } else if (item.type === 'select') {
470
473
  if (!item.value) return
471
474
  if (item.multiple) {
472
- const valueOptions = item.value.map(x => item.options.find(f => f.value === x))
473
- obj.name = valueOptions.map(x => x.label).join(',')
475
+ const valueOptions = item.value.map((x) => item.options.find((f) => f.value === x))
476
+ obj.name = valueOptions.map((x) => x.label).join(',')
474
477
  } else {
475
- obj.name = item.options.find(x => x.value === item.value).label
478
+ obj.name = item.options.find((x) => x.value === item.value).label
476
479
  }
477
480
  } else if (item.type === 'slot') {
478
481
  const info = item.getValue()
@@ -529,9 +532,9 @@ export default {
529
532
  this.$emit('on-search', { keyword: this.keyword, filterList })
530
533
  },
531
534
  handleTagClose(tag) {
532
- const parentItem = this.currentSearchList.find(x => x.id === tag.pId)
533
- const parentIndex = this.currentSearchList.findIndex(x => x.id === tag.pId)
534
- const childIndex = parentItem.itemList.findIndex(x => x.id === tag.id)
535
+ const parentItem = this.currentSearchList.find((x) => x.id === tag.pId)
536
+ const parentIndex = this.currentSearchList.findIndex((x) => x.id === tag.pId)
537
+ const childIndex = parentItem.itemList.findIndex((x) => x.id === tag.id)
535
538
  parentItem.itemList.forEach((item, index) => {
536
539
  if (parentItem.multiple) {
537
540
  // 多选
@@ -560,10 +563,10 @@ export default {
560
563
  },
561
564
  // 关闭所有的标签
562
565
  handleClearAllTags() {
563
- this.tagList.forEach(tag => {
564
- const parentItem = this.currentSearchList.find(x => x.id === tag.pId)
565
- const parentIndex = this.currentSearchList.findIndex(x => x.id === tag.pId)
566
- const childIndex = parentItem.itemList.findIndex(x => x.id === tag.id)
566
+ this.tagList.forEach((tag) => {
567
+ const parentItem = this.currentSearchList.find((x) => x.id === tag.pId)
568
+ const parentIndex = this.currentSearchList.findIndex((x) => x.id === tag.pId)
569
+ const childIndex = parentItem.itemList.findIndex((x) => x.id === tag.id)
567
570
  parentItem.itemList.forEach((item, index) => {
568
571
  if (parentItem.multiple) {
569
572
  // 多选
@@ -597,8 +600,8 @@ export default {
597
600
  this.keyword = ''
598
601
 
599
602
  const currentSearchList = _.cloneDeep(this.currentSearchList)
600
- currentSearchList.forEach(ele => {
601
- ele.itemList.forEach(item => {
603
+ currentSearchList.forEach((ele) => {
604
+ ele.itemList.forEach((item) => {
602
605
  item.isActive = !!item.default
603
606
  if (['month', 'year'].includes(item.type)) {
604
607
  item.value = item.default && item.defaultValue ? item.defaultValue : ''
@@ -609,8 +612,8 @@ export default {
609
612
  if (item.type === 'select') {
610
613
  if (item.default && item.defaultValue) {
611
614
  if (item.multiple) {
612
- const valueOptions = item.defaultValue.map(x => item.options.find(f => f.value === x))
613
- item.value = valueOptions.map(x => x.value)
615
+ const valueOptions = item.defaultValue.map((x) => item.options.find((f) => f.value === x))
616
+ item.value = valueOptions.map((x) => x.value)
614
617
  } else {
615
618
  item.value = item.defaultValue
616
619
  }
@@ -627,8 +630,8 @@ export default {
627
630
  setDefaultTagList() {
628
631
  const list = []
629
632
  if (this.currentSearchList) {
630
- this.currentSearchList.forEach(ele => {
631
- ele.itemList.forEach(item => {
633
+ this.currentSearchList.forEach((ele) => {
634
+ ele.itemList.forEach((item) => {
632
635
  if (item.default) {
633
636
  // 如果是默认值
634
637
  const obj = {
@@ -661,10 +664,10 @@ export default {
661
664
  } else if (item.type === 'select') {
662
665
  if (!item.defaultValue) return
663
666
  if (item.multiple) {
664
- const valueOptions = item.defaultValue.map(x => item.options.find(f => f.value === x))
665
- obj.name = valueOptions.map(x => x.label).join(',')
667
+ const valueOptions = item.defaultValue.map((x) => item.options.find((f) => f.value === x))
668
+ obj.name = valueOptions.map((x) => x.label).join(',')
666
669
  } else {
667
- const defaultItem = item.options.find(x => x.value === item.defaultValue)
670
+ const defaultItem = item.options.find((x) => x.value === item.defaultValue)
668
671
  obj.name = defaultItem.label
669
672
  obj.value = defaultItem
670
673
  }
@@ -736,15 +739,15 @@ export default {
736
739
  // 切换保存过滤条件的下拉框
737
740
  handleChangeCondition(value) {
738
741
  this.conditionValue = value
739
- const list = this.conditionList.filter(item => item.value === value)
742
+ const list = this.conditionList.filter((item) => item.value === value)
740
743
  if (list.length) {
741
744
  const currentSearchList = _.cloneDeep(this.currentSearchList)
742
745
  const { keyword = '', filterList = [] } = list[0]
743
746
  this.keyword = keyword
744
747
 
745
748
  // 先清空所有标签
746
- currentSearchList.forEach(ele => {
747
- ele.itemList.forEach(item => {
749
+ currentSearchList.forEach((ele) => {
750
+ ele.itemList.forEach((item) => {
748
751
  item.isActive = false
749
752
  item.type === 'daterange' && (item.value = null)
750
753
  })
@@ -752,10 +755,10 @@ export default {
752
755
 
753
756
  // 设置选中的标签
754
757
  if (filterList && filterList.length) {
755
- filterList.forEach(ele => {
756
- currentSearchList.forEach(item => {
758
+ filterList.forEach((ele) => {
759
+ currentSearchList.forEach((item) => {
757
760
  if (ele.pId === item.id) {
758
- item.itemList.forEach(v => {
761
+ item.itemList.forEach((v) => {
759
762
  if (v.type === 'slot') {
760
763
  v.setValue({ value: ele.value, name: ele.name, ...ele })
761
764
  }
@@ -792,7 +795,7 @@ export default {
792
795
  let localList = localStorage.getItem(`syswin${this.storageName}`)
793
796
  if (!['', undefined, null].includes(localList)) {
794
797
  localList = JSON.parse(localList)
795
- const idx = localList.findIndex(ele => ele.value === item.value)
798
+ const idx = localList.findIndex((ele) => ele.value === item.value)
796
799
  idx > -1 && localList.splice(idx, 1)
797
800
  localList.length > 0
798
801
  ? localStorage.setItem(`syswin${this.storageName}`, JSON.stringify(localList))
@@ -813,7 +816,7 @@ export default {
813
816
  this.conditionValue = momentValue
814
817
  } else {
815
818
  // 编辑
816
- const index = this.conditionList.findIndex(ele => ele.value === this.currentData.value)
819
+ const index = this.conditionList.findIndex((ele) => ele.value === this.currentData.value)
817
820
  const item = this.conditionList[index]
818
821
  item.label = label
819
822
  this.$set(this.conditionList, index, item)