el-plus-crud 0.0.95 → 0.0.97

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.
Files changed (82) hide show
  1. package/.eslintignore +18 -17
  2. package/.eslintrc.js +78 -78
  3. package/.lintstagedrc +3 -3
  4. package/.prettierrc.js +39 -39
  5. package/CHANGELOG.md +113 -109
  6. package/LICENSE +21 -21
  7. package/README.md +127 -127
  8. package/build.js +31 -31
  9. package/dist/el-plus-crud.mjs +2726 -6246
  10. package/example/App.vue +252 -252
  11. package/example/main.js +18 -18
  12. package/example/style.css +4 -4
  13. package/index.html +13 -13
  14. package/lib/components/el-plus-form/ElPlusForm.vue +88 -74
  15. package/lib/components/el-plus-form/ElPlusFormDialog.vue +5 -1
  16. package/lib/components/el-plus-form/ElPlusFormGroup.vue +49 -26
  17. package/lib/components/el-plus-form/components/ElPlusFormArea.vue +61 -62
  18. package/lib/components/el-plus-form/components/ElPlusFormAutocomplete.vue +49 -49
  19. package/lib/components/el-plus-form/components/ElPlusFormBtn.vue +28 -28
  20. package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +8 -8
  21. package/lib/components/el-plus-form/components/ElPlusFormCascader.vue +64 -64
  22. package/lib/components/el-plus-form/components/ElPlusFormCascaderPanel.vue +71 -71
  23. package/lib/components/el-plus-form/components/ElPlusFormCheckbox.vue +5 -5
  24. package/lib/components/el-plus-form/components/ElPlusFormCheckboxButton.vue +45 -45
  25. package/lib/components/el-plus-form/components/ElPlusFormColor.vue +38 -39
  26. package/lib/components/el-plus-form/components/ElPlusFormDate.vue +40 -40
  27. package/lib/components/el-plus-form/components/ElPlusFormDaterange.vue +47 -47
  28. package/lib/components/el-plus-form/components/ElPlusFormDatetime.vue +41 -41
  29. package/lib/components/el-plus-form/components/ElPlusFormDatetimerange.vue +47 -47
  30. package/lib/components/el-plus-form/components/ElPlusFormFile.vue +2 -2
  31. package/lib/components/el-plus-form/components/ElPlusFormImage.vue +117 -117
  32. package/lib/components/el-plus-form/components/ElPlusFormInput.vue +3 -3
  33. package/lib/components/el-plus-form/components/ElPlusFormLink.vue +6 -6
  34. package/lib/components/el-plus-form/components/ElPlusFormLkuser.vue +6 -6
  35. package/lib/components/el-plus-form/components/ElPlusFormNbinput.vue +54 -54
  36. package/lib/components/el-plus-form/components/ElPlusFormNumber.vue +19 -11
  37. package/lib/components/el-plus-form/components/ElPlusFormPassword.vue +3 -3
  38. package/lib/components/el-plus-form/components/ElPlusFormQuickInput.vue +5 -5
  39. package/lib/components/el-plus-form/components/ElPlusFormRadio.vue +68 -68
  40. package/lib/components/el-plus-form/components/ElPlusFormRate.vue +54 -54
  41. package/lib/components/el-plus-form/components/ElPlusFormSelect.vue +57 -36
  42. package/lib/components/el-plus-form/components/ElPlusFormSlider.vue +39 -39
  43. package/lib/components/el-plus-form/components/ElPlusFormStatus.vue +7 -7
  44. package/lib/components/el-plus-form/components/ElPlusFormSwitch.vue +4 -4
  45. package/lib/components/el-plus-form/components/ElPlusFormTag.vue +8 -7
  46. package/lib/components/el-plus-form/components/ElPlusFormText.vue +111 -99
  47. package/lib/components/el-plus-form/components/ElPlusFormTextarea.vue +4 -3
  48. package/lib/components/el-plus-form/components/ElPlusFormTime.vue +3 -3
  49. package/lib/components/el-plus-form/components/ElPlusFormTimerange.vue +3 -3
  50. package/lib/components/el-plus-form/components/ElPlusFormTransfer.vue +46 -45
  51. package/lib/components/el-plus-form/components/ElPlusFormTree.vue +78 -77
  52. package/lib/components/el-plus-form/components/ElPlusFormTreeSelect.vue +61 -60
  53. package/lib/components/el-plus-form/components/ElPlusFormUpbtn.vue +6 -5
  54. package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +161 -60
  55. package/lib/components/el-plus-form/components/components/file-icons/FileIcons.vue +1 -2
  56. package/lib/components/el-plus-form/components/components/file-icons/data/index.ts +27 -27
  57. package/lib/components/el-plus-form/components/components/file-icons/images/doc.svg +12 -12
  58. package/lib/components/el-plus-form/components/components/file-icons/images/file.svg +18 -18
  59. package/lib/components/el-plus-form/components/components/file-icons/images/jpg.svg +13 -13
  60. package/lib/components/el-plus-form/components/components/file-icons/images/pdf.svg +12 -12
  61. package/lib/components/el-plus-form/components/components/file-icons/images/png.svg +12 -12
  62. package/lib/components/el-plus-form/components/components/file-icons/images/ppt.svg +12 -12
  63. package/lib/components/el-plus-form/components/components/file-icons/images/xls.svg +12 -12
  64. package/lib/components/el-plus-form/components/index.ts +17 -17
  65. package/lib/components/el-plus-form/data/file.ts +74 -74
  66. package/lib/components/el-plus-form/mixins/index.ts +6 -3
  67. package/lib/components/el-plus-form/util/index.ts +84 -0
  68. package/lib/components/el-plus-form/util/validate.ts +2 -2
  69. package/lib/components/el-plus-table/ElPlusTable.vue +908 -897
  70. package/lib/components/el-plus-table/ElPlusTableColumn.vue +1 -1
  71. package/lib/components/el-plus-table/components/columnItem.vue +4 -2
  72. package/lib/components/el-plus-table/components/settingColumn.vue +172 -172
  73. package/lib/components/el-plus-table/components/statisticInfo.vue +47 -47
  74. package/lib/components/el-plus-table/util/index.ts +22 -2
  75. package/lib/config/index.ts +39 -7
  76. package/lib/index.d.ts +4 -4
  77. package/lib/index.ts +2 -2
  78. package/package-lock.json +8100 -8101
  79. package/package.json +70 -71
  80. package/tsconfig.json +78 -78
  81. package/types/index.d.ts +60 -11
  82. package/vite.config.ts +78 -78
@@ -1,45 +1,45 @@
1
- <template>
2
- <el-checkbox-group v-if="isInit" class="ElPlusFormCheckboxButton-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" :disabled="disabled">
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
- disabled?: boolean
26
- }>()
27
-
28
- const emits = defineEmits(['update:modelValue'])
29
- const currentValue = ref(props.modelValue)
30
- emits('update:modelValue', currentValue)
31
-
32
- const attrs = ref({} as any)
33
- const isInit = ref(false)
34
- const onEvents = ref(getEvents(props))
35
-
36
- onBeforeMount(async () => {
37
- attrs.value = await getAttrs(props, { ...useAttrs() })
38
- isInit.value = true
39
- })
40
- </script>
41
- <style lang="scss" scoped>
42
- .ElPlusFormCheckboxButton-panel {
43
- display: flex;
44
- }
45
- </style>
1
+ <template>
2
+ <el-checkbox-group v-if="isInit" class="ElPlusFormCheckboxButton-panel" v-bind="attrs" :disabled="disabled" 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
+ disabled?: boolean
26
+ }>()
27
+
28
+ const emits = defineEmits(['update:modelValue'])
29
+ const currentValue = ref(props.modelValue)
30
+ emits('update:modelValue', currentValue)
31
+
32
+ const attrs = ref({} as any)
33
+ const isInit = ref(false)
34
+ const onEvents = ref(getEvents(props))
35
+
36
+ onBeforeMount(async () => {
37
+ attrs.value = await getAttrs(props, { ...useAttrs() })
38
+ isInit.value = true
39
+ })
40
+ </script>
41
+ <style lang="scss" scoped>
42
+ .ElPlusFormCheckboxButton-panel {
43
+ display: flex;
44
+ }
45
+ </style>
@@ -1,39 +1,38 @@
1
- <template>
2
- <el-color-picker class="ElPlusFormColor-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" :disabled="disabled" />
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
- disabled?: boolean
22
- }>()
23
-
24
- const emits = defineEmits(['update:modelValue'])
25
- const currentValue = ref(props.modelValue)
26
- const attrs = ref({} as any)
27
- const onEvents = ref(getEvents(props))
28
- // const { attrs, slots, onEvents } = useMixins({ modelValue: props.modelValue, field: props.field, desc: props.desc, formData: props.formData, useAttrs, useSlots })
29
- emits('update:modelValue', currentValue)
30
-
31
- onBeforeMount(async () => {
32
- attrs.value = await getAttrs(props, { ...useAttrs() })
33
- })
34
- </script>
35
- <style lang="scss" scoped>
36
- .ElPlusFormColor-panel {
37
- display: flex;
38
- }
39
- </style>
1
+ <template>
2
+ <el-color-picker class="ElPlusFormColor-panel" v-bind="attrs" :disabled="disabled" 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
+ disabled?: boolean
22
+ }>()
23
+
24
+ const emits = defineEmits(['update:modelValue'])
25
+ const currentValue = ref(props.modelValue)
26
+ const attrs = ref({} as any)
27
+ const onEvents = ref(getEvents(props))
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,40 +1,40 @@
1
- <template>
2
- <el-date-picker v-if="isInit" class="ElPlusFormDate-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" :disabled="disabled" />
3
- </template>
4
- <script lang="ts">
5
- export default {
6
- name: 'ElPlusFormDate',
7
- inheritAttrs: false,
8
- typeName: 'date',
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
- disabled?: boolean
22
- }>()
23
-
24
- const emits = defineEmits(['update:modelValue'])
25
- const isInit = ref(false)
26
- const attrs = ref({} as any)
27
- const onEvents = ref(getEvents(props))
28
- const currentValue = ref(props.modelValue)
29
- emits('update:modelValue', currentValue)
30
-
31
- onBeforeMount(async () => {
32
- attrs.value = await getAttrs(props, { valueFormat: 'YYYY-MM-DD HH:mm:ss', editable: false, ...useAttrs() })
33
- isInit.value = true
34
- })
35
- </script>
36
- <style lang="scss" scoped>
37
- .ElPlusFormDate-panel {
38
- display: flex;
39
- }
40
- </style>
1
+ <template>
2
+ <el-date-picker v-if="isInit" class="ElPlusFormDate-panel" v-bind="attrs" :disabled="disabled" v-on="onEvents" v-model="currentValue" />
3
+ </template>
4
+ <script lang="ts">
5
+ export default {
6
+ name: 'ElPlusFormDate',
7
+ inheritAttrs: false,
8
+ typeName: 'date',
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
+ disabled?: boolean
22
+ }>()
23
+
24
+ const emits = defineEmits(['update:modelValue'])
25
+ const isInit = ref(false)
26
+ const attrs = ref({} as any)
27
+ const onEvents = ref(getEvents(props))
28
+ const currentValue = ref(props.modelValue)
29
+ emits('update:modelValue', currentValue)
30
+
31
+ onBeforeMount(async () => {
32
+ attrs.value = await getAttrs(props, { valueFormat: 'YYYY-MM-DD HH:mm:ss', editable: false, ...useAttrs() })
33
+ isInit.value = true
34
+ })
35
+ </script>
36
+ <style lang="scss" scoped>
37
+ .ElPlusFormDate-panel {
38
+ display: flex;
39
+ }
40
+ </style>
@@ -1,47 +1,47 @@
1
- <template>
2
- <el-date-picker v-if="isInit" class="el-plusF-form-daterange-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" :disabled="disabled">
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
- disabled?: boolean
27
- }>()
28
-
29
- const emits = defineEmits(['update:modelValue'])
30
- const currentValue = ref(props.modelValue)
31
- const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
32
- const isInit = ref(false)
33
- const attrs = ref({} as any)
34
- const onEvents = ref(getEvents(props))
35
-
36
- emits('update:modelValue', currentValue)
37
-
38
- onBeforeMount(async () => {
39
- attrs.value = await getAttrs(props, { type: 'daterange', format: 'YYYY-MM-DD', valueFormat: 'x', editable: false, ...useAttrs() })
40
- isInit.value = true
41
- })
42
- </script>
43
- <style lang="scss" scoped>
44
- .el-plusF-form-daterange-panel {
45
- display: flex;
46
- }
47
- </style>
1
+ <template>
2
+ <el-date-picker v-if="isInit" class="el-plusF-form-daterange-panel" v-bind="attrs" :disabled="disabled" 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
+ disabled?: boolean
27
+ }>()
28
+
29
+ const emits = defineEmits(['update:modelValue'])
30
+ const currentValue = ref(props.modelValue)
31
+ const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
32
+ const isInit = ref(false)
33
+ const attrs = ref({} as any)
34
+ const onEvents = ref(getEvents(props))
35
+
36
+ emits('update:modelValue', currentValue)
37
+
38
+ onBeforeMount(async () => {
39
+ attrs.value = await getAttrs(props, { type: 'daterange', format: 'YYYY-MM-DD', valueFormat: 'x', editable: false, ...useAttrs() })
40
+ isInit.value = true
41
+ })
42
+ </script>
43
+ <style lang="scss" scoped>
44
+ .el-plusF-form-daterange-panel {
45
+ display: flex;
46
+ }
47
+ </style>
@@ -1,41 +1,41 @@
1
- <template>
2
- <el-date-picker v-if="isInit" class="ElPlusFormDatetime-panel" v-bind="attrs" v-on="onEvents" type="datetime" v-model="currentValue" :disabled="disabled" />
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
- disabled?: boolean
22
- }>()
23
-
24
- const emits = defineEmits(['update:modelValue'])
25
- const currentValue = ref(props.modelValue)
26
- const attrs = ref({} as any)
27
- const isInit = ref(false)
28
- const onEvents = ref(getEvents(props))
29
-
30
- emits('update:modelValue', currentValue)
31
-
32
- onBeforeMount(async () => {
33
- attrs.value = await getAttrs(props, { valueFormat: 'YYYY-MM-DD HH:mm:ss', ...useAttrs() })
34
- isInit.value = true
35
- })
36
- </script>
37
- <style lang="scss" scoped>
38
- .ElPlusFormDatetime-panel {
39
- display: flex;
40
- }
41
- </style>
1
+ <template>
2
+ <el-date-picker v-if="isInit" class="ElPlusFormDatetime-panel" v-bind="attrs" :disabled="disabled" 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
+ disabled?: boolean
22
+ }>()
23
+
24
+ const emits = defineEmits(['update:modelValue'])
25
+ const currentValue = ref(props.modelValue)
26
+ const attrs = ref({} as any)
27
+ const isInit = ref(false)
28
+ const onEvents = ref(getEvents(props))
29
+
30
+ emits('update:modelValue', currentValue)
31
+
32
+ onBeforeMount(async () => {
33
+ attrs.value = await getAttrs(props, { valueFormat: 'YYYY-MM-DD HH:mm:ss', ...useAttrs() })
34
+ isInit.value = true
35
+ })
36
+ </script>
37
+ <style lang="scss" scoped>
38
+ .ElPlusFormDatetime-panel {
39
+ display: flex;
40
+ }
41
+ </style>
@@ -1,47 +1,47 @@
1
- <template>
2
- <el-date-picker v-if="isInit" class="el-plusF-form-datetimerange-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" :disabled="disabled">
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: 'ElPlusFormDatetimerange',
12
- inheritAttrs: false,
13
- typeName: 'datetimerange',
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
- disabled?: boolean
27
- }>()
28
-
29
- const emits = defineEmits(['update:modelValue'])
30
- const currentValue = ref(props.modelValue)
31
- const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
32
- const attrs = ref({} as any)
33
- const isInit = ref(false)
34
- const onEvents = ref(getEvents(props))
35
-
36
- emits('update:modelValue', currentValue)
37
-
38
- onBeforeMount(async () => {
39
- attrs.value = await getAttrs(props, { type: 'datetimerange', format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', editable: false, ...useAttrs() })
40
- isInit.value = true
41
- })
42
- </script>
43
- <style lang="scss" scoped>
44
- .el-plusF-form-datetimerange-panel {
45
- display: flex;
46
- }
47
- </style>
1
+ <template>
2
+ <el-date-picker v-if="isInit" class="el-plusF-form-datetimerange-panel" v-bind="attrs" :disabled="disabled" 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: 'ElPlusFormDatetimerange',
12
+ inheritAttrs: false,
13
+ typeName: 'datetimerange',
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
+ disabled?: boolean
27
+ }>()
28
+
29
+ const emits = defineEmits(['update:modelValue'])
30
+ const currentValue = ref(props.modelValue)
31
+ const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
32
+ const attrs = ref({} as any)
33
+ const isInit = ref(false)
34
+ const onEvents = ref(getEvents(props))
35
+
36
+ emits('update:modelValue', currentValue)
37
+
38
+ onBeforeMount(async () => {
39
+ attrs.value = await getAttrs(props, { type: 'datetimerange', format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', editable: false, ...useAttrs() })
40
+ isInit.value = true
41
+ })
42
+ </script>
43
+ <style lang="scss" scoped>
44
+ .el-plusF-form-datetimerange-panel {
45
+ display: flex;
46
+ }
47
+ </style>
@@ -20,10 +20,10 @@ import FileIcons from './components/file-icons/FileIcons.vue'
20
20
 
21
21
  const props = defineProps<{
22
22
  modelValue?: Array<IOssInfo>
23
- field: string
23
+ field?: string
24
24
  loading?: boolean
25
25
  desc: { [key: string]: any }
26
- formData: { [key: string]: any }
26
+ formData?: { [key: string]: any }
27
27
  }>()
28
28
  </script>
29
29
  <style lang="scss">