vsyswin-ui 0.2.84 → 0.2.86
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/lib/vsyswin-ui.common.js +56442 -61077
- package/lib/vsyswin-ui.common.js.map +1 -1
- package/lib/vsyswin-ui.umd.js +56442 -61077
- package/lib/vsyswin-ui.umd.js.map +1 -1
- package/lib/vsyswin-ui.umd.min.js +158 -158
- package/lib/vsyswin-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/packages/search-bar/src/search-bar.vue +58 -0
- package/vue.config.js +5 -0
package/package.json
CHANGED
|
@@ -123,6 +123,12 @@
|
|
|
123
123
|
<el-option v-for="opt in item.options" :key="opt.id" :label="opt.label" :value="opt.value"></el-option>
|
|
124
124
|
</el-select>
|
|
125
125
|
</template>
|
|
126
|
+
<template v-else-if="item.type === 'cascade'">
|
|
127
|
+
<span class="syswin-filter-item__name" v-if="item.name && !item.hideName">{{ item.name }}</span>
|
|
128
|
+
<el-cascader size="small" v-model="item.value" :placeholder="`请选择${item.name}`" :style="{
|
|
129
|
+
width: item.width ? item.width : '200px'
|
|
130
|
+
}" :options="item.options" :props="{ multiple: !!item.multiple, checkStrictly: !!item.checkStrictly }" collapse-tags clearable @change="handleChangeDateragne(idx, index)"></el-cascader>
|
|
131
|
+
</template>
|
|
126
132
|
<template v-else-if="item.type === 'slot'">
|
|
127
133
|
<slot :name="item.slot" :item="item">内容为空</slot>
|
|
128
134
|
</template>
|
|
@@ -230,6 +236,12 @@
|
|
|
230
236
|
<el-option v-for="opt in item.options" :key="opt.id" :label="opt.label" :value="opt.value"></el-option>
|
|
231
237
|
</el-select>
|
|
232
238
|
</template>
|
|
239
|
+
<template v-else-if="item.type === 'cascade'">
|
|
240
|
+
<span class="syswin-filter-item__name" v-if="item.name && !item.hideName">{{ item.name }}</span>
|
|
241
|
+
<el-cascader size="small" v-model="item.value" :placeholder="`请选择${item.name}`" :style="{
|
|
242
|
+
width: item.width ? item.width : '200px'
|
|
243
|
+
}" :options="item.options" :props="{ multiple: !!item.multiple, checkStrictly: !!item.checkStrictly }" collapse-tags clearable @change="handleChangeDateragne(idx, index)"></el-cascader>
|
|
244
|
+
</template>
|
|
233
245
|
<template v-else-if="item.type === 'slot'">
|
|
234
246
|
<slot :name="item.slot" :item="item">内容为空</slot>
|
|
235
247
|
</template>
|
|
@@ -324,6 +336,12 @@
|
|
|
324
336
|
<el-option v-for="opt in item.options" :key="opt.id" :label="opt.label" :value="opt.value"></el-option>
|
|
325
337
|
</el-select>
|
|
326
338
|
</template>
|
|
339
|
+
<template v-else-if="item.type === 'cascade'">
|
|
340
|
+
<span class="syswin-filter-item__name" v-if="item.name && !item.hideName">{{ item.name }}</span>
|
|
341
|
+
<el-cascader size="small" v-model="item.value" :placeholder="`请选择${item.name}`" :style="{
|
|
342
|
+
width: item.width ? item.width : '200px'
|
|
343
|
+
}" :options="item.options" :props="{ multiple: !!item.multiple, checkStrictly: !!item.checkStrictly }" collapse-tags clearable @change="handleChangeDateragne(idx, index + maxConditionLength)"></el-cascader>
|
|
344
|
+
</template>
|
|
327
345
|
<template v-else-if="item.type === 'slot'">
|
|
328
346
|
<slot :name="item.slot" :item="item">内容为空</slot>
|
|
329
347
|
</template>
|
|
@@ -371,6 +389,8 @@
|
|
|
371
389
|
import _ from 'lodash'
|
|
372
390
|
import moment from 'moment'
|
|
373
391
|
import saveLocal from './save-local'
|
|
392
|
+
// import XEUtils from 'xe-utils'
|
|
393
|
+
import findTree from 'xe-utils/findTree'
|
|
374
394
|
|
|
375
395
|
function deepCopyFunction(arr1, arr2) {
|
|
376
396
|
for (let i = 0; i < arr1.length; i++) {
|
|
@@ -601,6 +621,25 @@ export default {
|
|
|
601
621
|
} else {
|
|
602
622
|
obj.name = item.options.find((x) => x.value === item.value).label
|
|
603
623
|
}
|
|
624
|
+
} else if (item.type === 'cascade') {
|
|
625
|
+
if (!item.value) return
|
|
626
|
+
if (item.multiple) {
|
|
627
|
+
if (!item.value.length) {
|
|
628
|
+
return
|
|
629
|
+
}
|
|
630
|
+
// const valueOptions = item.value.map((x) => item.options.find((f) => f.value === x))
|
|
631
|
+
const valueOptions = item.value.map((x) => {
|
|
632
|
+
// console.log('xxxxxxxxxxxxx', x) // 这里的x是个数组
|
|
633
|
+
const lastValue = x[x.length - 1]
|
|
634
|
+
const find = findTree(item.options, tItem => tItem.value === lastValue)
|
|
635
|
+
return find
|
|
636
|
+
})
|
|
637
|
+
obj.name = valueOptions.map((x) => x.nodes.map(y => y.label).join('/')).join(',')
|
|
638
|
+
} else {
|
|
639
|
+
const lastValue = item.value[item.value.length - 1]
|
|
640
|
+
const find = findTree(item.options, tItem => tItem.value === lastValue)
|
|
641
|
+
obj.name = find.nodes.map(y => y.label).join('/')
|
|
642
|
+
}
|
|
604
643
|
} else if (item.type === 'slot') {
|
|
605
644
|
if (!item.getValue) return
|
|
606
645
|
const info = item.getValue() // 这里不能直接调,因为是深拷贝过来的
|
|
@@ -687,6 +726,9 @@ export default {
|
|
|
687
726
|
if (item.type === 'select') {
|
|
688
727
|
item.value = item.multiple ? [] : null
|
|
689
728
|
}
|
|
729
|
+
if (item.type === 'cascade') {
|
|
730
|
+
item.value = item.multiple ? [] : null
|
|
731
|
+
}
|
|
690
732
|
if (item.type === 'slot') {
|
|
691
733
|
item.setValue({ name: '', value: '' })
|
|
692
734
|
}
|
|
@@ -719,6 +761,9 @@ export default {
|
|
|
719
761
|
if (item.type === 'select') {
|
|
720
762
|
item.value = item.multiple ? [] : null
|
|
721
763
|
}
|
|
764
|
+
if (item.type === 'cascade') {
|
|
765
|
+
item.value = item.multiple ? [] : null
|
|
766
|
+
}
|
|
722
767
|
if (item.type === 'slot') {
|
|
723
768
|
item.setValue({ name: '', value: '' })
|
|
724
769
|
}
|
|
@@ -758,6 +803,13 @@ export default {
|
|
|
758
803
|
item.value = null
|
|
759
804
|
}
|
|
760
805
|
}
|
|
806
|
+
if (item.type === 'cascade') {
|
|
807
|
+
if (item.multiple) {
|
|
808
|
+
item.value = []
|
|
809
|
+
} else {
|
|
810
|
+
item.value = null
|
|
811
|
+
}
|
|
812
|
+
}
|
|
761
813
|
item.type === 'slot' && item.setValue({ value: '', name: '' })
|
|
762
814
|
})
|
|
763
815
|
})
|
|
@@ -840,6 +892,9 @@ export default {
|
|
|
840
892
|
if (item.type === 'select') {
|
|
841
893
|
item.value = item.multiple ? [] : null
|
|
842
894
|
}
|
|
895
|
+
if (item.type === 'cascade') {
|
|
896
|
+
item.value = item.multiple ? [] : null
|
|
897
|
+
}
|
|
843
898
|
}
|
|
844
899
|
})
|
|
845
900
|
this.$set(this.currentSearchList, parentIndex, parentItem)
|
|
@@ -920,6 +975,9 @@ export default {
|
|
|
920
975
|
v.value = ele.value
|
|
921
976
|
}
|
|
922
977
|
if (ele.value) v.isActive = true
|
|
978
|
+
} else if (v.type === 'cascade') {
|
|
979
|
+
v.value = ele.value
|
|
980
|
+
if (ele.value) v.isActive = true
|
|
923
981
|
} else if (v.type === 'month' || v.type === 'year') {
|
|
924
982
|
v.value = ele.value
|
|
925
983
|
if (ele.value) v.isActive = true
|
package/vue.config.js
CHANGED
|
@@ -10,6 +10,11 @@ module.exports = {
|
|
|
10
10
|
// 强制内联CSS
|
|
11
11
|
css: { extract: false },
|
|
12
12
|
// 扩展 webpack 配置,使 packages 加入编译
|
|
13
|
+
// configureWebpack: {
|
|
14
|
+
// externals: {
|
|
15
|
+
// 'xe-utils': 'XEUtils'
|
|
16
|
+
// }
|
|
17
|
+
// },
|
|
13
18
|
chainWebpack: config => {
|
|
14
19
|
/* config.module.rule('js')
|
|
15
20
|
.include
|