el-plus-crud 0.0.12 → 0.0.13
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/CHANGELOG.md +2 -0
- package/README.md +115 -3
- package/dist/el-plus-crud.mjs +6968 -6968
- package/dist/el-plus-crud.umd.js +27 -27
- package/dist/style.css +1 -1
- package/lib/components/el-plus-form/ElPlusFormDialog.vue +107 -107
- package/lib/components/el-plus-form/components/ElPlusFormAutocomplete.vue +49 -49
- package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +133 -133
- package/lib/components/el-plus-form/components/ElPlusFormCascaderPanel.vue +51 -51
- package/lib/components/el-plus-form/components/ElPlusFormCheckbox.vue +42 -42
- package/lib/components/el-plus-form/components/ElPlusFormCheckboxButton.vue +42 -42
- package/lib/components/el-plus-form/components/ElPlusFormColor.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormDaterange.vue +44 -44
- package/lib/components/el-plus-form/components/ElPlusFormDatetime.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormImage.vue +113 -113
- package/lib/components/el-plus-form/components/ElPlusFormNbinput.vue +51 -51
- package/lib/components/el-plus-form/components/ElPlusFormRadio.vue +42 -42
- package/lib/components/el-plus-form/components/ElPlusFormRate.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormSlider.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormStatus.vue +67 -67
- package/lib/components/el-plus-form/components/ElPlusFormSwitch.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormTag.vue +78 -78
- package/lib/components/el-plus-form/components/ElPlusFormTransfer.vue +44 -44
- package/lib/components/el-plus-form/components/ElPlusFormTree.vue +53 -53
- package/lib/components/el-plus-form/components/ElPlusFormTreeSelect.vue +36 -36
- package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +2 -0
- package/lib/components/el-plus-form/components/index.ts +17 -17
- package/lib/components/el-plus-form/data/file.ts +74 -74
- package/lib/components/el-plus-form/mixins/index.ts +113 -113
- package/lib/components/el-plus-form/util/validate.ts +310 -310
- package/lib/components-list.ts +66 -66
- package/package.json +1 -1
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-cascader-panel class="ElPlusFormCascaderPanel-panel" v-bind="attrs" v-on="onEvents" :options="props.desc.options" v-model="currentValue">
|
|
3
|
-
<!-- 非作用域插槽 -->
|
|
4
|
-
<template v-for="(item, key, index) in slots" #[key]="data" :key="index">
|
|
5
|
-
<slot :name="key" :data="data" />
|
|
6
|
-
</template>
|
|
7
|
-
</el-cascader-panel>
|
|
8
|
-
</template>
|
|
9
|
-
<script lang="ts">
|
|
10
|
-
export default {
|
|
11
|
-
name: 'ElPlusFormCascaderPanel',
|
|
12
|
-
inheritAttrs: false,
|
|
13
|
-
typeName: 'cascaderPanel',
|
|
14
|
-
customOptions: {}
|
|
15
|
-
}
|
|
16
|
-
</script>
|
|
17
|
-
<script lang="ts" setup>
|
|
18
|
-
import { ref, useAttrs, useSlots, onBeforeMount } from 'vue'
|
|
19
|
-
import { getAttrs, getEvents } from '../mixins'
|
|
20
|
-
|
|
21
|
-
const props = defineProps<{
|
|
22
|
-
modelValue?: string | number | '' | null
|
|
23
|
-
field: string
|
|
24
|
-
desc: { [key: string]: any }
|
|
25
|
-
formData: { [key: string]: any }
|
|
26
|
-
}>()
|
|
27
|
-
|
|
28
|
-
const emits = defineEmits(['update:modelValue'])
|
|
29
|
-
const currentValue = ref(props.modelValue)
|
|
30
|
-
emits('update:modelValue', currentValue)
|
|
31
|
-
|
|
32
|
-
const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
|
|
33
|
-
const attrs = ref({} as any)
|
|
34
|
-
const onEvents = ref(getEvents(props))
|
|
35
|
-
|
|
36
|
-
onBeforeMount(async () => {
|
|
37
|
-
attrs.value = await getAttrs(props, {
|
|
38
|
-
props: { value: 'value', label: 'label', children: 'children' },
|
|
39
|
-
fetchSuggestions(s: any, cb: Function) {
|
|
40
|
-
const res: any[] = []
|
|
41
|
-
cb(res)
|
|
42
|
-
},
|
|
43
|
-
...useAttrs()
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
</script>
|
|
47
|
-
<style lang="scss" scoped>
|
|
48
|
-
.ElPlusFormCascaderPanel-panel {
|
|
49
|
-
display: flex;
|
|
50
|
-
}
|
|
51
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-cascader-panel class="ElPlusFormCascaderPanel-panel" v-bind="attrs" v-on="onEvents" :options="props.desc.options" v-model="currentValue">
|
|
3
|
+
<!-- 非作用域插槽 -->
|
|
4
|
+
<template v-for="(item, key, index) in slots" #[key]="data" :key="index">
|
|
5
|
+
<slot :name="key" :data="data" />
|
|
6
|
+
</template>
|
|
7
|
+
</el-cascader-panel>
|
|
8
|
+
</template>
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
export default {
|
|
11
|
+
name: 'ElPlusFormCascaderPanel',
|
|
12
|
+
inheritAttrs: false,
|
|
13
|
+
typeName: 'cascaderPanel',
|
|
14
|
+
customOptions: {}
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { ref, useAttrs, useSlots, onBeforeMount } from 'vue'
|
|
19
|
+
import { getAttrs, getEvents } from '../mixins'
|
|
20
|
+
|
|
21
|
+
const props = defineProps<{
|
|
22
|
+
modelValue?: string | number | '' | null
|
|
23
|
+
field: string
|
|
24
|
+
desc: { [key: string]: any }
|
|
25
|
+
formData: { [key: string]: any }
|
|
26
|
+
}>()
|
|
27
|
+
|
|
28
|
+
const emits = defineEmits(['update:modelValue'])
|
|
29
|
+
const currentValue = ref(props.modelValue)
|
|
30
|
+
emits('update:modelValue', currentValue)
|
|
31
|
+
|
|
32
|
+
const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
|
|
33
|
+
const attrs = ref({} as any)
|
|
34
|
+
const onEvents = ref(getEvents(props))
|
|
35
|
+
|
|
36
|
+
onBeforeMount(async () => {
|
|
37
|
+
attrs.value = await getAttrs(props, {
|
|
38
|
+
props: { value: 'value', label: 'label', children: 'children' },
|
|
39
|
+
fetchSuggestions(s: any, cb: Function) {
|
|
40
|
+
const res: any[] = []
|
|
41
|
+
cb(res)
|
|
42
|
+
},
|
|
43
|
+
...useAttrs()
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
</script>
|
|
47
|
+
<style lang="scss" scoped>
|
|
48
|
+
.ElPlusFormCascaderPanel-panel {
|
|
49
|
+
display: flex;
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-checkbox-group class="ElPlusFormCheckbox-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue">
|
|
3
|
-
<el-checkbox v-for="option of desc.options" :key="option.value" :label="option.value" v-bind="option.attrs">
|
|
4
|
-
{{ option.text }}
|
|
5
|
-
</el-checkbox>
|
|
6
|
-
</el-checkbox-group>
|
|
7
|
-
</template>
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
export default {
|
|
10
|
-
name: 'ElPlusFormCheckbox',
|
|
11
|
-
inheritAttrs: false,
|
|
12
|
-
typeName: 'checkbox',
|
|
13
|
-
customOptions: {}
|
|
14
|
-
}
|
|
15
|
-
</script>
|
|
16
|
-
<script lang="ts" setup>
|
|
17
|
-
import { ref, useAttrs, onBeforeMount } from 'vue'
|
|
18
|
-
import { getAttrs, getEvents } from '../mixins'
|
|
19
|
-
|
|
20
|
-
const props = defineProps<{
|
|
21
|
-
modelValue?: string | number | '' | null
|
|
22
|
-
field: string
|
|
23
|
-
desc: { [key: string]: any }
|
|
24
|
-
formData: { [key: string]: any }
|
|
25
|
-
}>()
|
|
26
|
-
|
|
27
|
-
const emits = defineEmits(['update:modelValue'])
|
|
28
|
-
const currentValue = ref(props.modelValue)
|
|
29
|
-
emits('update:modelValue', currentValue)
|
|
30
|
-
|
|
31
|
-
const attrs = ref({} as any)
|
|
32
|
-
const onEvents = ref(getEvents(props))
|
|
33
|
-
|
|
34
|
-
onBeforeMount(async () => {
|
|
35
|
-
attrs.value = await getAttrs(props, { ...useAttrs() })
|
|
36
|
-
})
|
|
37
|
-
</script>
|
|
38
|
-
<style lang="scss" scoped>
|
|
39
|
-
.ElPlusFormCheckbox-panel {
|
|
40
|
-
display: flex;
|
|
41
|
-
}
|
|
42
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-checkbox-group class="ElPlusFormCheckbox-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue">
|
|
3
|
+
<el-checkbox v-for="option of desc.options" :key="option.value" :label="option.value" v-bind="option.attrs">
|
|
4
|
+
{{ option.text }}
|
|
5
|
+
</el-checkbox>
|
|
6
|
+
</el-checkbox-group>
|
|
7
|
+
</template>
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default {
|
|
10
|
+
name: 'ElPlusFormCheckbox',
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
typeName: 'checkbox',
|
|
13
|
+
customOptions: {}
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
<script lang="ts" setup>
|
|
17
|
+
import { ref, useAttrs, onBeforeMount } from 'vue'
|
|
18
|
+
import { getAttrs, getEvents } from '../mixins'
|
|
19
|
+
|
|
20
|
+
const props = defineProps<{
|
|
21
|
+
modelValue?: string | number | '' | null
|
|
22
|
+
field: string
|
|
23
|
+
desc: { [key: string]: any }
|
|
24
|
+
formData: { [key: string]: any }
|
|
25
|
+
}>()
|
|
26
|
+
|
|
27
|
+
const emits = defineEmits(['update:modelValue'])
|
|
28
|
+
const currentValue = ref(props.modelValue)
|
|
29
|
+
emits('update:modelValue', currentValue)
|
|
30
|
+
|
|
31
|
+
const attrs = ref({} as any)
|
|
32
|
+
const onEvents = ref(getEvents(props))
|
|
33
|
+
|
|
34
|
+
onBeforeMount(async () => {
|
|
35
|
+
attrs.value = await getAttrs(props, { ...useAttrs() })
|
|
36
|
+
})
|
|
37
|
+
</script>
|
|
38
|
+
<style lang="scss" scoped>
|
|
39
|
+
.ElPlusFormCheckbox-panel {
|
|
40
|
+
display: flex;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-checkbox-group class="ElPlusFormCheckboxButton-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue">
|
|
3
|
-
<el-checkbox-button v-for="option of desc.options" :key="option.value" :label="option.value" v-bind="option.attrs">
|
|
4
|
-
{{ option.text }}
|
|
5
|
-
</el-checkbox-button>
|
|
6
|
-
</el-checkbox-group>
|
|
7
|
-
</template>
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
export default {
|
|
10
|
-
name: 'ElPlusFormCheckboxButton',
|
|
11
|
-
inheritAttrs: false,
|
|
12
|
-
typeName: 'checkboxButton',
|
|
13
|
-
customOptions: {}
|
|
14
|
-
}
|
|
15
|
-
</script>
|
|
16
|
-
<script lang="ts" setup>
|
|
17
|
-
import { ref, useAttrs, onBeforeMount } from 'vue'
|
|
18
|
-
import { getAttrs, getEvents } from '../mixins'
|
|
19
|
-
|
|
20
|
-
const props = defineProps<{
|
|
21
|
-
modelValue?: string | number | '' | null
|
|
22
|
-
field: string
|
|
23
|
-
desc: { [key: string]: any }
|
|
24
|
-
formData: { [key: string]: any }
|
|
25
|
-
}>()
|
|
26
|
-
|
|
27
|
-
const emits = defineEmits(['update:modelValue'])
|
|
28
|
-
const currentValue = ref(props.modelValue)
|
|
29
|
-
emits('update:modelValue', currentValue)
|
|
30
|
-
|
|
31
|
-
const attrs = ref({} as any)
|
|
32
|
-
const onEvents = ref(getEvents(props))
|
|
33
|
-
|
|
34
|
-
onBeforeMount(async () => {
|
|
35
|
-
attrs.value = await getAttrs(props, { ...useAttrs() })
|
|
36
|
-
})
|
|
37
|
-
</script>
|
|
38
|
-
<style lang="scss" scoped>
|
|
39
|
-
.ElPlusFormCheckboxButton-panel {
|
|
40
|
-
display: flex;
|
|
41
|
-
}
|
|
42
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-checkbox-group class="ElPlusFormCheckboxButton-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue">
|
|
3
|
+
<el-checkbox-button v-for="option of desc.options" :key="option.value" :label="option.value" v-bind="option.attrs">
|
|
4
|
+
{{ option.text }}
|
|
5
|
+
</el-checkbox-button>
|
|
6
|
+
</el-checkbox-group>
|
|
7
|
+
</template>
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default {
|
|
10
|
+
name: 'ElPlusFormCheckboxButton',
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
typeName: 'checkboxButton',
|
|
13
|
+
customOptions: {}
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
<script lang="ts" setup>
|
|
17
|
+
import { ref, useAttrs, onBeforeMount } from 'vue'
|
|
18
|
+
import { getAttrs, getEvents } from '../mixins'
|
|
19
|
+
|
|
20
|
+
const props = defineProps<{
|
|
21
|
+
modelValue?: string | number | '' | null
|
|
22
|
+
field: string
|
|
23
|
+
desc: { [key: string]: any }
|
|
24
|
+
formData: { [key: string]: any }
|
|
25
|
+
}>()
|
|
26
|
+
|
|
27
|
+
const emits = defineEmits(['update:modelValue'])
|
|
28
|
+
const currentValue = ref(props.modelValue)
|
|
29
|
+
emits('update:modelValue', currentValue)
|
|
30
|
+
|
|
31
|
+
const attrs = ref({} as any)
|
|
32
|
+
const onEvents = ref(getEvents(props))
|
|
33
|
+
|
|
34
|
+
onBeforeMount(async () => {
|
|
35
|
+
attrs.value = await getAttrs(props, { ...useAttrs() })
|
|
36
|
+
})
|
|
37
|
+
</script>
|
|
38
|
+
<style lang="scss" scoped>
|
|
39
|
+
.ElPlusFormCheckboxButton-panel {
|
|
40
|
+
display: flex;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-color-picker class="ElPlusFormColor-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" />
|
|
3
|
-
</template>
|
|
4
|
-
<script lang="ts">
|
|
5
|
-
export default {
|
|
6
|
-
name: 'ElPlusFormColor',
|
|
7
|
-
inheritAttrs: false,
|
|
8
|
-
typeName: 'color',
|
|
9
|
-
customOptions: {}
|
|
10
|
-
}
|
|
11
|
-
</script>
|
|
12
|
-
<script lang="ts" setup>
|
|
13
|
-
import { ref, useAttrs, onBeforeMount } from 'vue'
|
|
14
|
-
import { getAttrs, getEvents } from '../mixins'
|
|
15
|
-
|
|
16
|
-
const props = defineProps<{
|
|
17
|
-
modelValue?: string | number | '' | null
|
|
18
|
-
field: string
|
|
19
|
-
desc: { [key: string]: any }
|
|
20
|
-
formData: { [key: string]: any }
|
|
21
|
-
}>()
|
|
22
|
-
|
|
23
|
-
const emits = defineEmits(['update:modelValue'])
|
|
24
|
-
const currentValue = ref(props.modelValue)
|
|
25
|
-
const attrs = ref({} as any)
|
|
26
|
-
const onEvents = ref(getEvents(props))
|
|
27
|
-
// const { attrs, slots, onEvents } = useMixins({ modelValue: props.modelValue, field: props.field, desc: props.desc, formData: props.formData, useAttrs, useSlots })
|
|
28
|
-
emits('update:modelValue', currentValue)
|
|
29
|
-
|
|
30
|
-
onBeforeMount(async () => {
|
|
31
|
-
attrs.value = await getAttrs(props, { ...useAttrs() })
|
|
32
|
-
})
|
|
33
|
-
</script>
|
|
34
|
-
<style lang="scss" scoped>
|
|
35
|
-
.ElPlusFormColor-panel {
|
|
36
|
-
display: flex;
|
|
37
|
-
}
|
|
38
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-color-picker class="ElPlusFormColor-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" />
|
|
3
|
+
</template>
|
|
4
|
+
<script lang="ts">
|
|
5
|
+
export default {
|
|
6
|
+
name: 'ElPlusFormColor',
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
typeName: 'color',
|
|
9
|
+
customOptions: {}
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { ref, useAttrs, onBeforeMount } from 'vue'
|
|
14
|
+
import { getAttrs, getEvents } from '../mixins'
|
|
15
|
+
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
modelValue?: string | number | '' | null
|
|
18
|
+
field: string
|
|
19
|
+
desc: { [key: string]: any }
|
|
20
|
+
formData: { [key: string]: any }
|
|
21
|
+
}>()
|
|
22
|
+
|
|
23
|
+
const emits = defineEmits(['update:modelValue'])
|
|
24
|
+
const currentValue = ref(props.modelValue)
|
|
25
|
+
const attrs = ref({} as any)
|
|
26
|
+
const onEvents = ref(getEvents(props))
|
|
27
|
+
// const { attrs, slots, onEvents } = useMixins({ modelValue: props.modelValue, field: props.field, desc: props.desc, formData: props.formData, useAttrs, useSlots })
|
|
28
|
+
emits('update:modelValue', currentValue)
|
|
29
|
+
|
|
30
|
+
onBeforeMount(async () => {
|
|
31
|
+
attrs.value = await getAttrs(props, { ...useAttrs() })
|
|
32
|
+
})
|
|
33
|
+
</script>
|
|
34
|
+
<style lang="scss" scoped>
|
|
35
|
+
.ElPlusFormColor-panel {
|
|
36
|
+
display: flex;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-date-picker class="el-plusF-form-daterange-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue">
|
|
3
|
-
<!-- 非作用域插槽 -->
|
|
4
|
-
<template v-for="(item, key, index) in slots" #[key]="data" :key="index">
|
|
5
|
-
<slot :name="key" :data="data" />
|
|
6
|
-
</template>
|
|
7
|
-
</el-date-picker>
|
|
8
|
-
</template>
|
|
9
|
-
<script lang="ts">
|
|
10
|
-
export default {
|
|
11
|
-
name: 'ElPlusFormDaterange',
|
|
12
|
-
inheritAttrs: false,
|
|
13
|
-
typeName: 'daterange',
|
|
14
|
-
customOptions: {}
|
|
15
|
-
}
|
|
16
|
-
</script>
|
|
17
|
-
<script lang="ts" setup>
|
|
18
|
-
import { ref, useAttrs, useSlots, onBeforeMount } from 'vue'
|
|
19
|
-
import { getAttrs, getEvents } from '../mixins'
|
|
20
|
-
|
|
21
|
-
const props = defineProps<{
|
|
22
|
-
modelValue?: Array<string> | Date
|
|
23
|
-
field: string
|
|
24
|
-
desc: { [key: string]: any }
|
|
25
|
-
formData: { [key: string]: any }
|
|
26
|
-
}>()
|
|
27
|
-
|
|
28
|
-
const emits = defineEmits(['update:modelValue'])
|
|
29
|
-
const currentValue = ref(props.modelValue)
|
|
30
|
-
const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
|
|
31
|
-
const attrs = ref({} as any)
|
|
32
|
-
const onEvents = ref(getEvents(props))
|
|
33
|
-
|
|
34
|
-
emits('update:modelValue', currentValue)
|
|
35
|
-
|
|
36
|
-
onBeforeMount(async () => {
|
|
37
|
-
attrs.value = await getAttrs(props, { type: 'daterange', format: 'YYYY-MM-DD', valueFormat: 'x', editable: false, ...useAttrs() })
|
|
38
|
-
})
|
|
39
|
-
</script>
|
|
40
|
-
<style lang="scss" scoped>
|
|
41
|
-
.el-plusF-form-daterange-panel {
|
|
42
|
-
display: flex;
|
|
43
|
-
}
|
|
44
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-date-picker class="el-plusF-form-daterange-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue">
|
|
3
|
+
<!-- 非作用域插槽 -->
|
|
4
|
+
<template v-for="(item, key, index) in slots" #[key]="data" :key="index">
|
|
5
|
+
<slot :name="key" :data="data" />
|
|
6
|
+
</template>
|
|
7
|
+
</el-date-picker>
|
|
8
|
+
</template>
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
export default {
|
|
11
|
+
name: 'ElPlusFormDaterange',
|
|
12
|
+
inheritAttrs: false,
|
|
13
|
+
typeName: 'daterange',
|
|
14
|
+
customOptions: {}
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { ref, useAttrs, useSlots, onBeforeMount } from 'vue'
|
|
19
|
+
import { getAttrs, getEvents } from '../mixins'
|
|
20
|
+
|
|
21
|
+
const props = defineProps<{
|
|
22
|
+
modelValue?: Array<string> | Date
|
|
23
|
+
field: string
|
|
24
|
+
desc: { [key: string]: any }
|
|
25
|
+
formData: { [key: string]: any }
|
|
26
|
+
}>()
|
|
27
|
+
|
|
28
|
+
const emits = defineEmits(['update:modelValue'])
|
|
29
|
+
const currentValue = ref(props.modelValue)
|
|
30
|
+
const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
|
|
31
|
+
const attrs = ref({} as any)
|
|
32
|
+
const onEvents = ref(getEvents(props))
|
|
33
|
+
|
|
34
|
+
emits('update:modelValue', currentValue)
|
|
35
|
+
|
|
36
|
+
onBeforeMount(async () => {
|
|
37
|
+
attrs.value = await getAttrs(props, { type: 'daterange', format: 'YYYY-MM-DD', valueFormat: 'x', editable: false, ...useAttrs() })
|
|
38
|
+
})
|
|
39
|
+
</script>
|
|
40
|
+
<style lang="scss" scoped>
|
|
41
|
+
.el-plusF-form-daterange-panel {
|
|
42
|
+
display: flex;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-date-picker class="ElPlusFormDatetime-panel" v-bind="attrs" v-on="onEvents" type="datetime" v-model="currentValue" />
|
|
3
|
-
</template>
|
|
4
|
-
<script lang="ts">
|
|
5
|
-
export default {
|
|
6
|
-
name: 'ElPlusFormDatetime',
|
|
7
|
-
inheritAttrs: false,
|
|
8
|
-
typeName: 'datetime',
|
|
9
|
-
customOptions: {}
|
|
10
|
-
}
|
|
11
|
-
</script>
|
|
12
|
-
<script lang="ts" setup>
|
|
13
|
-
import { ref, useAttrs, onBeforeMount } from 'vue'
|
|
14
|
-
import { getAttrs, getEvents } from '../mixins'
|
|
15
|
-
|
|
16
|
-
const props = defineProps<{
|
|
17
|
-
modelValue?: string | number | '' | null
|
|
18
|
-
field: string
|
|
19
|
-
desc: { [key: string]: any }
|
|
20
|
-
formData: { [key: string]: any }
|
|
21
|
-
}>()
|
|
22
|
-
|
|
23
|
-
const emits = defineEmits(['update:modelValue'])
|
|
24
|
-
const currentValue = ref(props.modelValue)
|
|
25
|
-
const attrs = ref({} as any)
|
|
26
|
-
const onEvents = ref(getEvents(props))
|
|
27
|
-
|
|
28
|
-
emits('update:modelValue', currentValue)
|
|
29
|
-
|
|
30
|
-
onBeforeMount(async () => {
|
|
31
|
-
attrs.value = await getAttrs(props, { valueFormat: 'YYYY-MM-DD HH:mm:ss', ...useAttrs() })
|
|
32
|
-
})
|
|
33
|
-
</script>
|
|
34
|
-
<style lang="scss" scoped>
|
|
35
|
-
.ElPlusFormDatetime-panel {
|
|
36
|
-
display: flex;
|
|
37
|
-
}
|
|
38
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-date-picker class="ElPlusFormDatetime-panel" v-bind="attrs" v-on="onEvents" type="datetime" v-model="currentValue" />
|
|
3
|
+
</template>
|
|
4
|
+
<script lang="ts">
|
|
5
|
+
export default {
|
|
6
|
+
name: 'ElPlusFormDatetime',
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
typeName: 'datetime',
|
|
9
|
+
customOptions: {}
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { ref, useAttrs, onBeforeMount } from 'vue'
|
|
14
|
+
import { getAttrs, getEvents } from '../mixins'
|
|
15
|
+
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
modelValue?: string | number | '' | null
|
|
18
|
+
field: string
|
|
19
|
+
desc: { [key: string]: any }
|
|
20
|
+
formData: { [key: string]: any }
|
|
21
|
+
}>()
|
|
22
|
+
|
|
23
|
+
const emits = defineEmits(['update:modelValue'])
|
|
24
|
+
const currentValue = ref(props.modelValue)
|
|
25
|
+
const attrs = ref({} as any)
|
|
26
|
+
const onEvents = ref(getEvents(props))
|
|
27
|
+
|
|
28
|
+
emits('update:modelValue', currentValue)
|
|
29
|
+
|
|
30
|
+
onBeforeMount(async () => {
|
|
31
|
+
attrs.value = await getAttrs(props, { valueFormat: 'YYYY-MM-DD HH:mm:ss', ...useAttrs() })
|
|
32
|
+
})
|
|
33
|
+
</script>
|
|
34
|
+
<style lang="scss" scoped>
|
|
35
|
+
.ElPlusFormDatetime-panel {
|
|
36
|
+
display: flex;
|
|
37
|
+
}
|
|
38
|
+
</style>
|