ci-plus 1.8.2 → 1.8.3
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/README.md +2 -0
- package/package.json +1 -1
- package/src/select/select.vue +11 -7
- package/src/utils/Dayjs.ts +11 -21
- package/src/utils/index.ts +3 -2
package/README.md
CHANGED
package/package.json
CHANGED
package/src/select/select.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
|
-
:is="!useVirtual ?
|
|
3
|
+
:is="!useVirtual ? ElSelect : ElSelectV2"
|
|
4
4
|
popper-class="t_select"
|
|
5
5
|
v-model="childSelectedValue"
|
|
6
6
|
:options="!useVirtual ? null : optionSource"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
:pager-count="paginationOption.pagerCount"
|
|
44
44
|
:total="paginationOption.total"
|
|
45
45
|
v-bind="{
|
|
46
|
-
|
|
46
|
+
size: 'small',
|
|
47
47
|
background: true,
|
|
48
48
|
...$attrs,
|
|
49
49
|
...paginationOption.bind
|
|
@@ -60,7 +60,11 @@ import { computed, useSlots } from 'vue'
|
|
|
60
60
|
import {
|
|
61
61
|
ElPagination,
|
|
62
62
|
ElCheckbox,
|
|
63
|
-
ElOption
|
|
63
|
+
ElOption,
|
|
64
|
+
ElSelect,
|
|
65
|
+
ElSelectV2,
|
|
66
|
+
ElInput,
|
|
67
|
+
ElIcon
|
|
64
68
|
} from 'element-plus'
|
|
65
69
|
const props: any = defineProps({
|
|
66
70
|
modelValue: {
|
|
@@ -92,7 +96,7 @@ const props: any = defineProps({
|
|
|
92
96
|
// 下拉框组件数据源
|
|
93
97
|
optionSource: {
|
|
94
98
|
type: Array as unknown as any[],
|
|
95
|
-
default: () => []
|
|
99
|
+
default: (): any[] => []
|
|
96
100
|
},
|
|
97
101
|
// 是否显示分页
|
|
98
102
|
isShowPagination: {
|
|
@@ -170,9 +174,9 @@ const selectAll = (val: any) => {
|
|
|
170
174
|
const customLabelHandler = (item) => {
|
|
171
175
|
console.log('customLabelHandler', item)
|
|
172
176
|
// return eval(props.customLabel)
|
|
173
|
-
const expression = props.customLabel.replace(/item/g, 'item.value')
|
|
174
|
-
const safeEval = new Function('item', `return ${expression};`)
|
|
175
|
-
return safeEval({ value: item })
|
|
177
|
+
const expression = props.customLabel.replace(/item/g, 'item.value')
|
|
178
|
+
const safeEval = new Function('item', `return ${expression};`)
|
|
179
|
+
return safeEval({ value: item })
|
|
176
180
|
}
|
|
177
181
|
</script>
|
|
178
182
|
<style lang="scss" scoped>
|
package/src/utils/Dayjs.ts
CHANGED
|
@@ -6,28 +6,18 @@
|
|
|
6
6
|
* @param date 传入日期或者字符串
|
|
7
7
|
* @param geshi? 想要输出的格式
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
import dayjs from 'dayjs'
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// }
|
|
19
|
-
// // 格式化日期时间
|
|
20
|
-
// export const setDateTime = (
|
|
21
|
-
// date: string | Date,
|
|
22
|
-
// geshi: string = 'YYYY-MM-DD hh:mm:ss',
|
|
23
|
-
// ): string => {
|
|
24
|
-
// return dayjs(date).format(geshi)
|
|
25
|
-
// }
|
|
26
|
-
let dayjs = 2
|
|
27
|
-
export const setDate = (val) => {
|
|
28
|
-
return val
|
|
11
|
+
// 格式化日期
|
|
12
|
+
export const setDate = (date?: string | Date, geshi: string = 'YYYY-MM-DD') => {
|
|
13
|
+
if (date == '' || date == null || date == undefined) {
|
|
14
|
+
return ''
|
|
15
|
+
} else {
|
|
16
|
+
return dayjs(date).format(geshi)
|
|
17
|
+
}
|
|
29
18
|
}
|
|
30
19
|
// 格式化日期时间
|
|
31
|
-
export const setDateTime = (
|
|
32
|
-
return
|
|
20
|
+
export const setDateTime = (date: string | Date, geshi: string = 'YYYY-MM-DD hh:mm:ss'): string => {
|
|
21
|
+
return dayjs(date).format(geshi)
|
|
33
22
|
}
|
|
23
|
+
export { dayjs }
|
package/src/utils/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { default as withInstall } from './withinstall/index'
|
|
|
5
5
|
import withInstall from './withinstall/index'
|
|
6
6
|
import { cardPrint, setCardList } from './cardPrint'
|
|
7
7
|
import apis from './baseApi'
|
|
8
|
-
import { setDate, setDateTime } from './Dayjs'
|
|
8
|
+
import { dayjs, setDate, setDateTime } from './Dayjs'
|
|
9
9
|
import ajaxBox from './ajaxBox' // 处理文件下载方法
|
|
10
10
|
import getAffiliationOptions from './getAffiliationOptions' // 处理文件下载方法
|
|
11
11
|
|
|
@@ -17,7 +17,8 @@ let func = {
|
|
|
17
17
|
setDateTime,
|
|
18
18
|
getAffiliationOptions,
|
|
19
19
|
apis,
|
|
20
|
-
ajaxBox
|
|
20
|
+
ajaxBox,
|
|
21
|
+
dayjs
|
|
21
22
|
}
|
|
22
23
|
// 导出 所有方法
|
|
23
24
|
export default func
|