el-plus-crud 0.0.72 → 0.0.75
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 +6 -0
- package/dist/el-plus-crud.mjs +12 -12
- package/example/App.vue +68 -67
- package/lib/components/el-plus-form/ElPlusForm.vue +1 -0
- package/lib/components/el-plus-form/ElPlusFormDialog.vue +89 -88
- package/lib/components/el-plus-form/ElPlusFormGroup.vue +1 -0
- package/lib/components/el-plus-form/components/ElPlusFormBtn.vue +1 -0
- package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +1 -0
- package/lib/components/el-plus-form/components/ElPlusFormFile.vue +48 -47
- package/lib/components/el-plus-form/components/ElPlusFormInput.vue +63 -62
- package/lib/components/el-plus-form/components/ElPlusFormLink.vue +283 -282
- package/lib/components/el-plus-form/components/ElPlusFormLkuser.vue +491 -490
- package/lib/components/el-plus-form/components/ElPlusFormNumber.vue +148 -147
- package/lib/components/el-plus-form/components/ElPlusFormPassword.vue +45 -44
- package/lib/components/el-plus-form/components/ElPlusFormQuickInput.vue +97 -96
- package/lib/components/el-plus-form/components/ElPlusFormSelect.vue +163 -162
- package/lib/components/el-plus-form/components/ElPlusFormTextarea.vue +51 -50
- package/lib/components/el-plus-form/components/ElPlusFormUpbtn.vue +145 -144
- package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +370 -369
- package/lib/components/el-plus-form/components/components/file-icons/FileIcons.vue +136 -135
- package/lib/components/el-plus-table/ElPlusTable.vue +1 -0
- package/lib/components/el-plus-table/components/columnItem.vue +213 -212
- package/lib/components/el-plus-table/components/header.vue +1 -0
- package/lib/components/el-plus-table/components/settingColumn.vue +179 -178
- package/lib/components/el-plus-table/util/index.ts +148 -147
- package/lib/config/index.ts +32 -30
- package/lib/index.ts +52 -51
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/types/formList.d.ts +98 -91
- package/types/global.d.ts +13 -145
- package/types/axios.d.ts +0 -13
- package/types/layout.d.ts +0 -57
- package/types/mitt.d.ts +0 -38
- package/types/pinia.d.ts +0 -149
- package/types/views.d.ts +0 -329
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-input v-if="isInit" style="display: flex" v-bind="attrs" v-on="onEvents" :disabled="disabled" v-model="currentValue">
|
|
3
|
-
<template v-for="(item, key, index) of slots" #[key] :key="index">
|
|
4
|
-
<slot :name="key" />
|
|
5
|
-
</template>
|
|
6
|
-
</el-input>
|
|
7
|
-
</template>
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
export default {
|
|
10
|
-
name: 'ElPlusFormInput',
|
|
11
|
-
inheritAttrs: false,
|
|
12
|
-
typeName: 'input',
|
|
13
|
-
customOptions: {}
|
|
14
|
-
}
|
|
15
|
-
</script>
|
|
16
|
-
<script lang="ts" setup>
|
|
17
|
-
import { ref, watch, useAttrs, useSlots, onBeforeMount, inject } from 'vue'
|
|
18
|
-
import { getAttrs, getEvents } from '../mixins'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
() =>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<el-input v-if="isInit" style="display: flex" v-bind="attrs" v-on="onEvents" :disabled="disabled" v-model="currentValue">
|
|
3
|
+
<template v-for="(item, key, index) of slots" #[key] :key="index">
|
|
4
|
+
<slot :name="key" />
|
|
5
|
+
</template>
|
|
6
|
+
</el-input>
|
|
7
|
+
</template>
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default {
|
|
10
|
+
name: 'ElPlusFormInput',
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
typeName: 'input',
|
|
13
|
+
customOptions: {}
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
<script lang="ts" setup>
|
|
17
|
+
import { ref, watch, useAttrs, useSlots, onBeforeMount, inject } from 'vue'
|
|
18
|
+
import { getAttrs, getEvents } from '../mixins'
|
|
19
|
+
import { ICRUDConfig } from 'types/formList'
|
|
20
|
+
|
|
21
|
+
const defaultConf = inject('defaultConf') as ICRUDConfig
|
|
22
|
+
|
|
23
|
+
const props = defineProps<{
|
|
24
|
+
modelValue?: string | 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', 'validateThis'])
|
|
32
|
+
const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
|
|
33
|
+
const attrs = ref({} as any)
|
|
34
|
+
const isInit = ref(false)
|
|
35
|
+
const onEvents = ref(getEvents(props))
|
|
36
|
+
|
|
37
|
+
const currentValue = ref()
|
|
38
|
+
emits('update:modelValue', currentValue)
|
|
39
|
+
|
|
40
|
+
onBeforeMount(async () => {
|
|
41
|
+
attrs.value = await getAttrs(props, { autocomplete: 'new-password', maxlength: defaultConf.form?.leng?.input || 0, clearable: true, ...useAttrs() })
|
|
42
|
+
isInit.value = true
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
watch(
|
|
46
|
+
() => props.modelValue,
|
|
47
|
+
(data: string | null | undefined) => {
|
|
48
|
+
// 这里要截取一下字符串长度
|
|
49
|
+
if (data && data.length > attrs.value.maxlength) {
|
|
50
|
+
data = data.substring(0, attrs.value.maxlength)
|
|
51
|
+
}
|
|
52
|
+
currentValue.value = data
|
|
53
|
+
},
|
|
54
|
+
{ immediate: true }
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
watch(
|
|
58
|
+
() => currentValue.value,
|
|
59
|
+
() => {
|
|
60
|
+
emits('validateThis')
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
</script>
|