el-plus-crud 0.1.13 → 0.1.14

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 (50) hide show
  1. package/.eslintignore +18 -18
  2. package/.eslintrc.js +78 -78
  3. package/.lintstagedrc +3 -3
  4. package/.prettierrc.js +39 -39
  5. package/CHANGELOG.md +261 -259
  6. package/LICENSE +21 -21
  7. package/README.md +19 -19
  8. package/build.js +31 -31
  9. package/dist/el-plus-crud.mjs +1952 -1952
  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 +4 -7
  15. package/lib/components/el-plus-form/ElPlusFormDialog.vue +93 -93
  16. package/lib/components/el-plus-form/ElPlusFormGroup.vue +201 -201
  17. package/lib/components/el-plus-form/components/ElPlusFormCascader.vue +65 -65
  18. package/lib/components/el-plus-form/components/ElPlusFormCascaderPanel.vue +72 -72
  19. package/lib/components/el-plus-form/components/ElPlusFormCheckbox.vue +81 -81
  20. package/lib/components/el-plus-form/components/ElPlusFormImage.vue +115 -115
  21. package/lib/components/el-plus-form/components/ElPlusFormLink.vue +285 -285
  22. package/lib/components/el-plus-form/components/ElPlusFormQuickInput.vue +98 -98
  23. package/lib/components/el-plus-form/components/ElPlusFormRadio.vue +69 -69
  24. package/lib/components/el-plus-form/components/ElPlusFormSelect.vue +185 -185
  25. package/lib/components/el-plus-form/components/ElPlusFormStatus.vue +102 -102
  26. package/lib/components/el-plus-form/components/ElPlusFormText.vue +113 -113
  27. package/lib/components/el-plus-form/components/ElPlusFormTree.vue +79 -79
  28. package/lib/components/el-plus-form/components/ElPlusFormTreeSelect.vue +62 -62
  29. package/lib/components/el-plus-form/components/components/file-icons/data/index.ts +27 -27
  30. package/lib/components/el-plus-form/components/components/file-icons/images/doc.svg +12 -12
  31. package/lib/components/el-plus-form/components/components/file-icons/images/file.svg +18 -18
  32. package/lib/components/el-plus-form/components/components/file-icons/images/jpg.svg +13 -13
  33. package/lib/components/el-plus-form/components/components/file-icons/images/pdf.svg +12 -12
  34. package/lib/components/el-plus-form/components/components/file-icons/images/png.svg +12 -12
  35. package/lib/components/el-plus-form/components/components/file-icons/images/ppt.svg +12 -12
  36. package/lib/components/el-plus-form/components/components/file-icons/images/xls.svg +12 -12
  37. package/lib/components/el-plus-form/components/index.ts +17 -17
  38. package/lib/components/el-plus-form/data/file.ts +74 -74
  39. package/lib/components/el-plus-form/util/validate.ts +346 -346
  40. package/lib/components/el-plus-table/ElPlusTable.vue +972 -972
  41. package/lib/components/el-plus-table/components/columnItem.vue +220 -220
  42. package/lib/components/el-plus-table/components/header.vue +345 -345
  43. package/lib/components/el-plus-table/components/statisticInfo.vue +47 -47
  44. package/lib/index.d.ts +4 -4
  45. package/lib/util/index.ts +390 -390
  46. package/package.json +70 -70
  47. package/tsconfig.json +78 -78
  48. package/types/global.d.ts +13 -13
  49. package/types/index.d.ts +561 -561
  50. package/vite.config.ts +78 -78
@@ -1,98 +1,98 @@
1
- <template>
2
- <el-input v-if="isInit" :class="desc.class" :style="desc.style" type="textarea" v-bind="attrs" :disabled="disabled" v-model="currentValue" v-on="onEvents" />
3
- <div class="el-plus-form-quick-input">
4
- <el-tag v-for="(option, index) in options" :key="index" type="info" @click="changeTip(option.label)">{{ option.label }}</el-tag>
5
- </div>
6
- </template>
7
- <script lang="ts">
8
- export default {
9
- name: 'ElPlusFormQuickinput',
10
- inheritAttrs: false,
11
- typeName: 'quickinput',
12
- customOptions: {}
13
- }
14
- </script>
15
- <script lang="ts" setup>
16
- import { ref, useAttrs, watch, onBeforeMount, inject, reactive } from 'vue'
17
- import { getAttrs, getEvents } from '../mixins'
18
- import { isEqual } from '../../../util'
19
- import { ICRUDConfig } from '../../../../types'
20
-
21
- const globalData = inject('globalData') as any
22
- const defaultConf = inject('defaultConf') as ICRUDConfig
23
-
24
- const props = defineProps<{
25
- modelValue?: string | null
26
- field?: string
27
- loading?: boolean
28
- desc: { [key: string]: any }
29
- formData?: { [key: string]: any }
30
- disabled?: boolean
31
- }>()
32
-
33
- const emits = defineEmits(['update:modelValue', 'validateThis'])
34
- const attrs = ref({} as any)
35
- const isInit = ref(false)
36
- const onEvents = ref(getEvents(props))
37
- const options = reactive([] as any[])
38
- const currentValue = ref(props.modelValue)
39
- emits('update:modelValue', currentValue)
40
-
41
- onBeforeMount(async () => {
42
- attrs.value = await getAttrs(props, { maxlength: defaultConf.form?.leng?.textare, showWordLimit: true, rows: 3, ...useAttrs() })
43
- isInit.value = true
44
- })
45
-
46
- /**
47
- *
48
- * @param text
49
- * 选中
50
- */
51
- function changeTip(text: any) {
52
- if (props.disabled) return false
53
- currentValue.value = text
54
- emits('validateThis')
55
- }
56
-
57
- watch(
58
- () => props.modelValue,
59
- (data: string | null | undefined) => {
60
- // 这里要截取一下字符串长度
61
- if (data && data.length > attrs.value.maxlength) {
62
- data = data.substring(0, attrs.value.maxlength)
63
- }
64
- currentValue.value = data
65
- },
66
- { immediate: true }
67
- )
68
- watch(
69
- () => props.desc.options,
70
- async (data) => {
71
- if (typeof data === 'string') {
72
- // // 从全局数据中获取options
73
- options.splice(0, options.length, ...(globalData[data] || []))
74
- } else if (typeof data === 'function') {
75
- options.splice(0, options.length, ...(await data(props.formData || {})))
76
- } else if (Array.isArray(data)) {
77
- if (data && options && !isEqual(data, options)) {
78
- options.splice(0, options.length, ...data)
79
- }
80
- } else {
81
- options.splice(0, options.length)
82
- }
83
- },
84
- { immediate: true }
85
- )
86
- </script>
87
- <style lang="scss">
88
- .el-plus-form-quick-input {
89
- width: 100%;
90
- display: flex;
91
- align-items: center;
92
- margin-top: 10px;
93
- .el-tag {
94
- margin-right: 10px;
95
- }
96
- }
97
- </style>
98
- ../util/aaaaa
1
+ <template>
2
+ <el-input v-if="isInit" :class="desc.class" :style="desc.style" type="textarea" v-bind="attrs" :disabled="disabled" v-model="currentValue" v-on="onEvents" />
3
+ <div class="el-plus-form-quick-input">
4
+ <el-tag v-for="(option, index) in options" :key="index" type="info" @click="changeTip(option.label)">{{ option.label }}</el-tag>
5
+ </div>
6
+ </template>
7
+ <script lang="ts">
8
+ export default {
9
+ name: 'ElPlusFormQuickinput',
10
+ inheritAttrs: false,
11
+ typeName: 'quickinput',
12
+ customOptions: {}
13
+ }
14
+ </script>
15
+ <script lang="ts" setup>
16
+ import { ref, useAttrs, watch, onBeforeMount, inject, reactive } from 'vue'
17
+ import { getAttrs, getEvents } from '../mixins'
18
+ import { isEqual } from '../../../util'
19
+ import { ICRUDConfig } from '../../../../types'
20
+
21
+ const globalData = inject('globalData') as any
22
+ const defaultConf = inject('defaultConf') as ICRUDConfig
23
+
24
+ const props = defineProps<{
25
+ modelValue?: string | null
26
+ field?: string
27
+ loading?: boolean
28
+ desc: { [key: string]: any }
29
+ formData?: { [key: string]: any }
30
+ disabled?: boolean
31
+ }>()
32
+
33
+ const emits = defineEmits(['update:modelValue', 'validateThis'])
34
+ const attrs = ref({} as any)
35
+ const isInit = ref(false)
36
+ const onEvents = ref(getEvents(props))
37
+ const options = reactive([] as any[])
38
+ const currentValue = ref(props.modelValue)
39
+ emits('update:modelValue', currentValue)
40
+
41
+ onBeforeMount(async () => {
42
+ attrs.value = await getAttrs(props, { maxlength: defaultConf.form?.leng?.textare, showWordLimit: true, rows: 3, ...useAttrs() })
43
+ isInit.value = true
44
+ })
45
+
46
+ /**
47
+ *
48
+ * @param text
49
+ * 选中
50
+ */
51
+ function changeTip(text: any) {
52
+ if (props.disabled) return false
53
+ currentValue.value = text
54
+ emits('validateThis')
55
+ }
56
+
57
+ watch(
58
+ () => props.modelValue,
59
+ (data: string | null | undefined) => {
60
+ // 这里要截取一下字符串长度
61
+ if (data && data.length > attrs.value.maxlength) {
62
+ data = data.substring(0, attrs.value.maxlength)
63
+ }
64
+ currentValue.value = data
65
+ },
66
+ { immediate: true }
67
+ )
68
+ watch(
69
+ () => props.desc.options,
70
+ async (data) => {
71
+ if (typeof data === 'string') {
72
+ // // 从全局数据中获取options
73
+ options.splice(0, options.length, ...(globalData[data] || []))
74
+ } else if (typeof data === 'function') {
75
+ options.splice(0, options.length, ...(await data(props.formData || {})))
76
+ } else if (Array.isArray(data)) {
77
+ if (data && options && !isEqual(data, options)) {
78
+ options.splice(0, options.length, ...data)
79
+ }
80
+ } else {
81
+ options.splice(0, options.length)
82
+ }
83
+ },
84
+ { immediate: true }
85
+ )
86
+ </script>
87
+ <style lang="scss">
88
+ .el-plus-form-quick-input {
89
+ width: 100%;
90
+ display: flex;
91
+ align-items: center;
92
+ margin-top: 10px;
93
+ .el-tag {
94
+ margin-right: 10px;
95
+ }
96
+ }
97
+ </style>
98
+ ../util/aaaaa
@@ -1,69 +1,69 @@
1
- <template>
2
- <el-radio-group v-if="isInit" class="ElPlusFormRadio-panel" v-bind="attrs" :disabled="disabled" v-on="onEvents" v-model="currentValue">
3
- <el-radio v-for="option of options" :key="option.value" :label="option.value">
4
- {{ option.l || option.label }}
5
- </el-radio>
6
- </el-radio-group>
7
- </template>
8
- <script lang="ts">
9
- export default {
10
- name: 'ElPlusFormRadio',
11
- inheritAttrs: false,
12
- typeName: 'radio',
13
- customOptions: {}
14
- }
15
- </script>
16
- <script lang="ts" setup>
17
- import { ref, reactive, useAttrs, watch, onBeforeMount, inject } from 'vue'
18
- import { getAttrs, getEvents } from '../mixins'
19
- import { isEqual } from '../../../util'
20
-
21
- const globalData = inject('globalData') as any
22
-
23
- const props = defineProps<{
24
- modelValue?: string | number | '' | null
25
- field?: string
26
- desc: { [key: string]: any }
27
- formData?: { [key: string]: any }
28
- disabled?: boolean
29
- }>()
30
-
31
- const emits = defineEmits(['update:modelValue'])
32
- const currentValue = ref(props.modelValue)
33
- emits('update:modelValue', currentValue)
34
-
35
- const options = reactive([] as any[])
36
- const isInit = ref(false)
37
- const attrs = ref({} as any)
38
- const onEvents = ref(getEvents(props))
39
-
40
- onBeforeMount(async () => {
41
- attrs.value = await getAttrs(props, { ...useAttrs() })
42
- isInit.value = true
43
- })
44
-
45
- watch(
46
- () => props.desc.options,
47
- async (data) => {
48
- if (typeof data === 'string') {
49
- // 从全局数据中获取options
50
- options.splice(0, options.length, ...(globalData[data] || []))
51
- } else if (typeof data === 'function') {
52
- options.splice(0, options.length, ...(await data(props.formData || {})))
53
- } else if (Array.isArray(data)) {
54
- if (data && options && !isEqual(data, options)) {
55
- options.splice(0, options.length, ...data)
56
- }
57
- } else {
58
- options.splice(0, options.length)
59
- }
60
- },
61
- { immediate: true }
62
- )
63
- </script>
64
- <style lang="scss" scoped>
65
- .ElPlusFormRadio-panel {
66
- display: flex;
67
- }
68
- </style>
69
- ../util/aaaaa
1
+ <template>
2
+ <el-radio-group v-if="isInit" class="ElPlusFormRadio-panel" v-bind="attrs" :disabled="disabled" v-on="onEvents" v-model="currentValue">
3
+ <el-radio v-for="option of options" :key="option.value" :label="option.value">
4
+ {{ option.l || option.label }}
5
+ </el-radio>
6
+ </el-radio-group>
7
+ </template>
8
+ <script lang="ts">
9
+ export default {
10
+ name: 'ElPlusFormRadio',
11
+ inheritAttrs: false,
12
+ typeName: 'radio',
13
+ customOptions: {}
14
+ }
15
+ </script>
16
+ <script lang="ts" setup>
17
+ import { ref, reactive, useAttrs, watch, onBeforeMount, inject } from 'vue'
18
+ import { getAttrs, getEvents } from '../mixins'
19
+ import { isEqual } from '../../../util'
20
+
21
+ const globalData = inject('globalData') as any
22
+
23
+ const props = defineProps<{
24
+ modelValue?: string | number | '' | null
25
+ field?: string
26
+ desc: { [key: string]: any }
27
+ formData?: { [key: string]: any }
28
+ disabled?: boolean
29
+ }>()
30
+
31
+ const emits = defineEmits(['update:modelValue'])
32
+ const currentValue = ref(props.modelValue)
33
+ emits('update:modelValue', currentValue)
34
+
35
+ const options = reactive([] as any[])
36
+ const isInit = ref(false)
37
+ const attrs = ref({} as any)
38
+ const onEvents = ref(getEvents(props))
39
+
40
+ onBeforeMount(async () => {
41
+ attrs.value = await getAttrs(props, { ...useAttrs() })
42
+ isInit.value = true
43
+ })
44
+
45
+ watch(
46
+ () => props.desc.options,
47
+ async (data) => {
48
+ if (typeof data === 'string') {
49
+ // 从全局数据中获取options
50
+ options.splice(0, options.length, ...(globalData[data] || []))
51
+ } else if (typeof data === 'function') {
52
+ options.splice(0, options.length, ...(await data(props.formData || {})))
53
+ } else if (Array.isArray(data)) {
54
+ if (data && options && !isEqual(data, options)) {
55
+ options.splice(0, options.length, ...data)
56
+ }
57
+ } else {
58
+ options.splice(0, options.length)
59
+ }
60
+ },
61
+ { immediate: true }
62
+ )
63
+ </script>
64
+ <style lang="scss" scoped>
65
+ .ElPlusFormRadio-panel {
66
+ display: flex;
67
+ }
68
+ </style>
69
+ ../util/aaaaa