@jari-ace/element-plus-component 0.1.0 → 0.1.1
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 +18 -18
- package/dist/components/tip/index.d.ts +1 -35
- package/dist/components/tip/index.d.ts.map +1 -1
- package/dist/components/upload/index.d.ts +1 -1
- package/dist/components/upload/index.d.ts.map +1 -1
- package/dist/hooks/useBridage.d.ts +3 -3
- package/dist/hooks/useBridage.d.ts.map +1 -1
- package/dist/hooks/useBridage.js +29 -22
- package/dist/hooks/useBridage.js.map +1 -1
- package/dist/hooks/useUserRefQuery.d.ts +2 -2
- package/lib/index.css +1 -1
- package/lib/index.js +32 -28
- package/lib/index.umd.cjs +2 -2
- package/package.json +61 -61
- package/packages/components/autoComplete/JaAutoComplete.vue +47 -47
- package/packages/components/autoComplete/index.ts +5 -5
- package/packages/components/avatar/JaAvatar.vue +126 -126
- package/packages/components/avatar/avatarToken.ts +11 -11
- package/packages/components/avatar/defaultImg.ts +14 -14
- package/packages/components/avatar/index.ts +7 -7
- package/packages/components/button/JaButton.vue +51 -51
- package/packages/components/button/index.ts +4 -4
- package/packages/components/channelPicker/index.ts +7 -7
- package/packages/components/channelPicker/src/ChannelPicker.vue +43 -43
- package/packages/components/channelPicker/src/JaChannelPicker.vue +42 -42
- package/packages/components/checkbox/JaCheckbox.vue +73 -73
- package/packages/components/checkbox/index.ts +4 -4
- package/packages/components/checkboxGroup/JaCheckboxGroup.vue +45 -45
- package/packages/components/checkboxGroup/index.ts +4 -4
- package/packages/components/customGroupTree/index.ts +10 -10
- package/packages/components/customGroupTree/src/customGroupTree.vue +91 -91
- package/packages/components/datePicker/JaDatePicker.vue +52 -52
- package/packages/components/datePicker/index.ts +4 -4
- package/packages/components/departmentPicker/index.ts +4 -4
- package/packages/components/departmentPicker/src/DepartmentPicker.vue +107 -107
- package/packages/components/departmentPicker/src/consts.ts +2 -2
- package/packages/components/departmentTree/index.ts +10 -10
- package/packages/components/departmentTree/src/departmentTree.vue +135 -135
- package/packages/components/dropdownButton/JaDropdownButton.vue +59 -59
- package/packages/components/dropdownButton/index.ts +4 -4
- package/packages/components/enumList/EnumListInput.vue +107 -107
- package/packages/components/enumList/JaEnumList.vue +39 -39
- package/packages/components/enumList/index.ts +7 -7
- package/packages/components/form/JaForm.vue +126 -126
- package/packages/components/form/index.ts +5 -5
- package/packages/components/form/types.ts +4 -4
- package/packages/components/formItem/JaFormItem.vue +68 -68
- package/packages/components/formItem/index.ts +4 -4
- package/packages/components/index.ts +33 -33
- package/packages/components/input/JaInput.vue +143 -143
- package/packages/components/input/index.ts +4 -4
- package/packages/components/inputI18n/I18nBundleEditor.vue +76 -76
- package/packages/components/inputI18n/InputI18n.vue +142 -142
- package/packages/components/inputI18n/JaInputI18n.vue +50 -50
- package/packages/components/inputI18n/index.ts +8 -8
- package/packages/components/inputNumber/JaInputNumber.vue +98 -98
- package/packages/components/inputNumber/index.ts +4 -4
- package/packages/components/mapItemList/JaMapItemList.vue +35 -35
- package/packages/components/mapItemList/MapItemListInput.vue +191 -191
- package/packages/components/mapItemList/index.ts +7 -7
- package/packages/components/numberList/JaNumberList.vue +36 -36
- package/packages/components/numberList/NumberListInput.vue +111 -111
- package/packages/components/numberList/index.ts +7 -7
- package/packages/components/properyPicker/JaPropertyPicker.vue +38 -38
- package/packages/components/properyPicker/PropertyPicker.vue +314 -314
- package/packages/components/properyPicker/index.ts +7 -7
- package/packages/components/radioGroup/JaRadioGroup.vue +50 -50
- package/packages/components/radioGroup/index.ts +4 -4
- package/packages/components/rolePicker/RoleEditor.vue +129 -129
- package/packages/components/rolePicker/RolePicker.vue +44 -44
- package/packages/components/rolePicker/RolePickerRaw.vue +56 -56
- package/packages/components/rolePicker/baseRolePicker.vue +86 -86
- package/packages/components/rolePicker/index.ts +10 -10
- package/packages/components/scrollbar/Scrollbar.vue +89 -89
- package/packages/components/scrollbar/index.ts +5 -5
- package/packages/components/scrollbar/utils.ts +17 -17
- package/packages/components/select/JaSelect.vue +48 -48
- package/packages/components/select/index.ts +4 -4
- package/packages/components/stringList/JaStringList.vue +36 -36
- package/packages/components/stringList/StringListInput.vue +96 -96
- package/packages/components/stringList/index.ts +7 -7
- package/packages/components/switch/JaSwitch.vue +50 -50
- package/packages/components/switch/index.ts +4 -4
- package/packages/components/timePicker/JaTimePicker.vue +52 -52
- package/packages/components/timePicker/index.ts +5 -5
- package/packages/components/tip/index.ts +4 -4
- package/packages/components/tip/src/AceTip.vue +43 -43
- package/packages/components/upload/index.ts +6 -6
- package/packages/components/upload/src/Upload.vue +25 -25
- package/packages/components/upload/src/type.ts +3 -3
- package/packages/components/userGroupPicker/index.ts +4 -4
- package/packages/components/userGroupPicker/src/UserGroupPicker.vue +94 -94
- package/packages/components/userGroupTree/index.ts +10 -10
- package/packages/components/userGroupTree/src/userGroupTree.vue +149 -149
- package/packages/components/userPicker/index.ts +10 -10
- package/packages/components/userPicker/src/CustomGroupManager.vue +189 -189
- package/packages/components/userPicker/src/JaUserList.vue +283 -283
- package/packages/components/userPicker/src/JaUserPicker.vue +37 -37
- package/packages/components/userPicker/src/UserPicker.vue +366 -366
- package/packages/components/userSelectDialog/index.ts +6 -6
- package/packages/components/userSelectDialog/src/userSelectDialog.vue +447 -447
- package/packages/components/userTag/UserInfoTag.vue +397 -397
- package/packages/components/userTag/index.ts +6 -6
- package/packages/components/userTag/sharedAxios.ts +8 -8
- package/packages/directives/auth/index.ts +41 -41
- package/packages/directives/autofocus/index.ts +29 -29
- package/packages/directives/index.ts +10 -10
- package/packages/directives/shortcut/index.ts +192 -192
- package/packages/hooks/useAppInstances.ts +34 -34
- package/packages/hooks/useBackendValidations.ts +55 -55
- package/packages/hooks/useBridage.ts +157 -148
- package/packages/hooks/useDateTimeShortCuts.ts +65 -65
- package/packages/hooks/useTreeData.ts +45 -45
- package/packages/hooks/useUserRefQuery.ts +222 -222
- package/packages/index.ts +21 -21
- package/packages/list.json +7 -7
- package/packages/types/custom.d.ts +13 -13
- package/packages/types/window.d.ts +16 -16
- package/packages/utils/install.ts +43 -43
- package/packages/utils/objectUtils.ts +31 -31
- package/theme-style/fonts/iconfont.json +5196 -5196
- package/theme-style/index.scss +10 -10
- package/theme-style/styles/element-plus-var.scss +1419 -1419
- package/theme-style/styles/iconfont.css +2979 -2979
- package/theme-style/styles/theme-var.scss +72 -72
- package/theme-style/styles/transition.scss +122 -122
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import {inject, watch, ref} from "vue";
|
|
3
|
-
import {getValue, setValue} from "../../utils/objectUtils";
|
|
4
|
-
import type {ValidationInstance} from "../../hooks/useBackendValidations";
|
|
5
|
-
import EnumListInput from "./EnumListInput.vue";
|
|
6
|
-
|
|
7
|
-
const model = inject('aceFormModel') as Record<string, never>
|
|
8
|
-
const prop = inject('aceFormItemProp') as string
|
|
9
|
-
const validator = inject('aceFormValidator') as ValidationInstance
|
|
10
|
-
const emit = defineEmits<{
|
|
11
|
-
change: [value: string[]]
|
|
12
|
-
}>()
|
|
13
|
-
|
|
14
|
-
const props = defineProps<{ enumValues: Record<string, string> }>()
|
|
15
|
-
|
|
16
|
-
function onChange(value: string[]) {
|
|
17
|
-
validator.removeFieldError(prop)
|
|
18
|
-
setValue(model.formData, prop, mv.value);
|
|
19
|
-
emit('change', value)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const mv = ref(getValue(model.formData, prop) as string[] ?? [""]);
|
|
23
|
-
watch(() => model.formData, () => {
|
|
24
|
-
mv.value = getValue(model.formData, prop) as string[] ?? [""]
|
|
25
|
-
}, {
|
|
26
|
-
deep: true
|
|
27
|
-
})
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<template>
|
|
31
|
-
<enum-list-input v-model="mv"
|
|
32
|
-
:enum-values="enumValues"
|
|
33
|
-
@change="onChange"
|
|
34
|
-
v-bind="$attrs"/>
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<style scoped lang="scss">
|
|
38
|
-
|
|
39
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {inject, watch, ref} from "vue";
|
|
3
|
+
import {getValue, setValue} from "../../utils/objectUtils";
|
|
4
|
+
import type {ValidationInstance} from "../../hooks/useBackendValidations";
|
|
5
|
+
import EnumListInput from "./EnumListInput.vue";
|
|
6
|
+
|
|
7
|
+
const model = inject('aceFormModel') as Record<string, never>
|
|
8
|
+
const prop = inject('aceFormItemProp') as string
|
|
9
|
+
const validator = inject('aceFormValidator') as ValidationInstance
|
|
10
|
+
const emit = defineEmits<{
|
|
11
|
+
change: [value: string[]]
|
|
12
|
+
}>()
|
|
13
|
+
|
|
14
|
+
const props = defineProps<{ enumValues: Record<string, string> }>()
|
|
15
|
+
|
|
16
|
+
function onChange(value: string[]) {
|
|
17
|
+
validator.removeFieldError(prop)
|
|
18
|
+
setValue(model.formData, prop, mv.value);
|
|
19
|
+
emit('change', value)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const mv = ref(getValue(model.formData, prop) as string[] ?? [""]);
|
|
23
|
+
watch(() => model.formData, () => {
|
|
24
|
+
mv.value = getValue(model.formData, prop) as string[] ?? [""]
|
|
25
|
+
}, {
|
|
26
|
+
deep: true
|
|
27
|
+
})
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<enum-list-input v-model="mv"
|
|
32
|
+
:enum-values="enumValues"
|
|
33
|
+
@change="onChange"
|
|
34
|
+
v-bind="$attrs"/>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<style scoped lang="scss">
|
|
38
|
+
|
|
39
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {type SFCWithInstall, withInstall} from "../../utils/install";
|
|
2
|
-
import EnumList from "./JaEnumList.vue";
|
|
3
|
-
import EnumListInput from "./EnumListInput.vue";
|
|
4
|
-
|
|
5
|
-
export const JaEnumList: SFCWithInstall<typeof EnumList> = withInstall(EnumList);
|
|
6
|
-
|
|
7
|
-
export const JaEnumListRaw: SFCWithInstall<typeof EnumListInput> = withInstall(EnumListInput);
|
|
1
|
+
import {type SFCWithInstall, withInstall} from "../../utils/install";
|
|
2
|
+
import EnumList from "./JaEnumList.vue";
|
|
3
|
+
import EnumListInput from "./EnumListInput.vue";
|
|
4
|
+
|
|
5
|
+
export const JaEnumList: SFCWithInstall<typeof EnumList> = withInstall(EnumList);
|
|
6
|
+
|
|
7
|
+
export const JaEnumListRaw: SFCWithInstall<typeof EnumListInput> = withInstall(EnumListInput);
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import {type PropType, provide, ref, computed, watch} from "vue";
|
|
3
|
-
import {ElForm, type FormInstance, type FormRules} from "element-plus";
|
|
4
|
-
import {type ValidationInstance} from "../../hooks/useBackendValidations";
|
|
5
|
-
import type {JaFormModel} from "./types";
|
|
6
|
-
|
|
7
|
-
const formRef = ref<FormInstance | undefined>(undefined);
|
|
8
|
-
|
|
9
|
-
const props = defineProps({
|
|
10
|
-
model: {
|
|
11
|
-
type: Object as PropType<JaFormModel>,
|
|
12
|
-
required: true,
|
|
13
|
-
},
|
|
14
|
-
inline: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
default: false,
|
|
17
|
-
},
|
|
18
|
-
labelPosition: {
|
|
19
|
-
type: String as PropType<"left" | "top" | "right">,
|
|
20
|
-
default: "top",
|
|
21
|
-
},
|
|
22
|
-
labelWidth: {
|
|
23
|
-
type: [String, Number],
|
|
24
|
-
},
|
|
25
|
-
labelSuffix: {
|
|
26
|
-
type: String,
|
|
27
|
-
},
|
|
28
|
-
hideRequiredAsterisk: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false,
|
|
31
|
-
},
|
|
32
|
-
showMessage: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: true,
|
|
35
|
-
},
|
|
36
|
-
inlineMessage: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: true,
|
|
39
|
-
},
|
|
40
|
-
statusIcon: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false,
|
|
43
|
-
},
|
|
44
|
-
validateOnRuleChange: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: true,
|
|
47
|
-
},
|
|
48
|
-
rules: {
|
|
49
|
-
type: Object as PropType<FormRules>,
|
|
50
|
-
default: {},
|
|
51
|
-
},
|
|
52
|
-
size: {
|
|
53
|
-
type: String as PropType<"small" | "default" | "large">,
|
|
54
|
-
default: "small",
|
|
55
|
-
},
|
|
56
|
-
disabled: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false,
|
|
59
|
-
},
|
|
60
|
-
scrollToError: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: true,
|
|
63
|
-
},
|
|
64
|
-
validator: {
|
|
65
|
-
type: Object as PropType<ValidationInstance>,
|
|
66
|
-
required: true,
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
defineEmits(["validate", "click"]);
|
|
71
|
-
provide("aceFormValidator", props.validator);
|
|
72
|
-
provide("aceFormModel", props.model);
|
|
73
|
-
provide("aceFormSize", props.size);
|
|
74
|
-
|
|
75
|
-
const rules = computed<FormRules>(() => {
|
|
76
|
-
return {
|
|
77
|
-
...props.rules,
|
|
78
|
-
...props.validator.rules,
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
defineExpose({
|
|
83
|
-
elForm: formRef,
|
|
84
|
-
validate: (submit: () => Promise<any>, onFail?: () => void) => {
|
|
85
|
-
formRef.value!.clearValidate();
|
|
86
|
-
return submit()
|
|
87
|
-
.then(() => {
|
|
88
|
-
props.validator?.clearFiledErrors();
|
|
89
|
-
})
|
|
90
|
-
.catch(() => {
|
|
91
|
-
formRef.value!.validate();
|
|
92
|
-
if (onFail) onFail();
|
|
93
|
-
});
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
watch(() => props.model.formData, () => {
|
|
98
|
-
props.validator?.clearFiledErrors();
|
|
99
|
-
})
|
|
100
|
-
</script>
|
|
101
|
-
|
|
102
|
-
<template>
|
|
103
|
-
<el-form
|
|
104
|
-
ref="formRef"
|
|
105
|
-
:model="model"
|
|
106
|
-
:rules="rules"
|
|
107
|
-
:inline="inline"
|
|
108
|
-
:label-position="labelPosition"
|
|
109
|
-
:label-width="labelWidth"
|
|
110
|
-
:label-suffix="labelSuffix"
|
|
111
|
-
:hide-required-asterisk="hideRequiredAsterisk"
|
|
112
|
-
:show-message="showMessage"
|
|
113
|
-
:inline-message="inlineMessage"
|
|
114
|
-
:status-icon="statusIcon"
|
|
115
|
-
:validate-on-rule-change="validateOnRuleChange"
|
|
116
|
-
:size="size"
|
|
117
|
-
:disabled="disabled"
|
|
118
|
-
:scroll-to-error="scrollToError"
|
|
119
|
-
@validate="(prop, isValid, message) => $emit('validate', prop, isValid)"
|
|
120
|
-
@click="() => $emit('click')"
|
|
121
|
-
>
|
|
122
|
-
<slot></slot>
|
|
123
|
-
</el-form>
|
|
124
|
-
</template>
|
|
125
|
-
|
|
126
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {type PropType, provide, ref, computed, watch} from "vue";
|
|
3
|
+
import {ElForm, type FormInstance, type FormRules} from "element-plus";
|
|
4
|
+
import {type ValidationInstance} from "../../hooks/useBackendValidations";
|
|
5
|
+
import type {JaFormModel} from "./types";
|
|
6
|
+
|
|
7
|
+
const formRef = ref<FormInstance | undefined>(undefined);
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
model: {
|
|
11
|
+
type: Object as PropType<JaFormModel>,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
inline: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
18
|
+
labelPosition: {
|
|
19
|
+
type: String as PropType<"left" | "top" | "right">,
|
|
20
|
+
default: "top",
|
|
21
|
+
},
|
|
22
|
+
labelWidth: {
|
|
23
|
+
type: [String, Number],
|
|
24
|
+
},
|
|
25
|
+
labelSuffix: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
hideRequiredAsterisk: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
showMessage: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true,
|
|
35
|
+
},
|
|
36
|
+
inlineMessage: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true,
|
|
39
|
+
},
|
|
40
|
+
statusIcon: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
validateOnRuleChange: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: true,
|
|
47
|
+
},
|
|
48
|
+
rules: {
|
|
49
|
+
type: Object as PropType<FormRules>,
|
|
50
|
+
default: {},
|
|
51
|
+
},
|
|
52
|
+
size: {
|
|
53
|
+
type: String as PropType<"small" | "default" | "large">,
|
|
54
|
+
default: "small",
|
|
55
|
+
},
|
|
56
|
+
disabled: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
scrollToError: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true,
|
|
63
|
+
},
|
|
64
|
+
validator: {
|
|
65
|
+
type: Object as PropType<ValidationInstance>,
|
|
66
|
+
required: true,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
defineEmits(["validate", "click"]);
|
|
71
|
+
provide("aceFormValidator", props.validator);
|
|
72
|
+
provide("aceFormModel", props.model);
|
|
73
|
+
provide("aceFormSize", props.size);
|
|
74
|
+
|
|
75
|
+
const rules = computed<FormRules>(() => {
|
|
76
|
+
return {
|
|
77
|
+
...props.rules,
|
|
78
|
+
...props.validator.rules,
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
defineExpose({
|
|
83
|
+
elForm: formRef,
|
|
84
|
+
validate: (submit: () => Promise<any>, onFail?: () => void) => {
|
|
85
|
+
formRef.value!.clearValidate();
|
|
86
|
+
return submit()
|
|
87
|
+
.then(() => {
|
|
88
|
+
props.validator?.clearFiledErrors();
|
|
89
|
+
})
|
|
90
|
+
.catch(() => {
|
|
91
|
+
formRef.value!.validate();
|
|
92
|
+
if (onFail) onFail();
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
watch(() => props.model.formData, () => {
|
|
98
|
+
props.validator?.clearFiledErrors();
|
|
99
|
+
})
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
<el-form
|
|
104
|
+
ref="formRef"
|
|
105
|
+
:model="model"
|
|
106
|
+
:rules="rules"
|
|
107
|
+
:inline="inline"
|
|
108
|
+
:label-position="labelPosition"
|
|
109
|
+
:label-width="labelWidth"
|
|
110
|
+
:label-suffix="labelSuffix"
|
|
111
|
+
:hide-required-asterisk="hideRequiredAsterisk"
|
|
112
|
+
:show-message="showMessage"
|
|
113
|
+
:inline-message="inlineMessage"
|
|
114
|
+
:status-icon="statusIcon"
|
|
115
|
+
:validate-on-rule-change="validateOnRuleChange"
|
|
116
|
+
:size="size"
|
|
117
|
+
:disabled="disabled"
|
|
118
|
+
:scroll-to-error="scrollToError"
|
|
119
|
+
@validate="(prop, isValid, message) => $emit('validate', prop, isValid)"
|
|
120
|
+
@click="() => $emit('click')"
|
|
121
|
+
>
|
|
122
|
+
<slot></slot>
|
|
123
|
+
</el-form>
|
|
124
|
+
</template>
|
|
125
|
+
|
|
126
|
+
<style scoped lang="scss"></style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {withInstall, type SFCWithInstall} from "../../utils/install";
|
|
2
|
-
import Form from "./JaForm.vue";
|
|
3
|
-
export const JaForm: SFCWithInstall<typeof Form> = withInstall(Form);
|
|
4
|
-
export * from "./types"
|
|
5
|
-
export default Form;
|
|
1
|
+
import {withInstall, type SFCWithInstall} from "../../utils/install";
|
|
2
|
+
import Form from "./JaForm.vue";
|
|
3
|
+
export const JaForm: SFCWithInstall<typeof Form> = withInstall(Form);
|
|
4
|
+
export * from "./types"
|
|
5
|
+
export default Form;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface JaFormModel {
|
|
2
|
-
formData: Record<string, any>,
|
|
3
|
-
[key: string | number | symbol]: any
|
|
4
|
-
}
|
|
1
|
+
export interface JaFormModel {
|
|
2
|
+
formData: Record<string, any>,
|
|
3
|
+
[key: string | number | symbol]: any
|
|
4
|
+
}
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import {provide, ref, withDefaults, defineProps, defineExpose} from 'vue'
|
|
3
|
-
import {ElFormItem, ElIcon, ElText, type FormItemRule, ElTooltip} from 'element-plus'
|
|
4
|
-
import {QuestionFilled} from "@element-plus/icons-vue";
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(defineProps<{
|
|
7
|
-
prop?: string | string[]
|
|
8
|
-
rules?: FormItemRule | FormItemRule[]
|
|
9
|
-
label?: string
|
|
10
|
-
labelWidth?: string | number
|
|
11
|
-
labelRemark?: string
|
|
12
|
-
required?: boolean
|
|
13
|
-
error?: string
|
|
14
|
-
showMessage?: boolean
|
|
15
|
-
inlineMessage?: boolean
|
|
16
|
-
size?: 'small' | 'default' | 'large'
|
|
17
|
-
}>(), {
|
|
18
|
-
required: false,
|
|
19
|
-
showMessage: true,
|
|
20
|
-
inlineMessage: true,
|
|
21
|
-
size: 'small'
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
provide('aceFormItemProp', props.prop)
|
|
25
|
-
|
|
26
|
-
const formItem = ref<typeof ElFormItem | null>(null)
|
|
27
|
-
defineExpose({
|
|
28
|
-
resetField: () => {
|
|
29
|
-
formItem.value!.resetField()
|
|
30
|
-
},
|
|
31
|
-
clearValidate: () => {
|
|
32
|
-
formItem.value!.clearValidate()
|
|
33
|
-
},
|
|
34
|
-
elFormItem: formItem
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<template>
|
|
40
|
-
<el-form-item ref="formItem"
|
|
41
|
-
:prop="prop"
|
|
42
|
-
:rules="rules"
|
|
43
|
-
:label-width="labelWidth"
|
|
44
|
-
:error="error"
|
|
45
|
-
:show-message="showMessage"
|
|
46
|
-
:inline-message="inlineMessage"
|
|
47
|
-
:size="size">
|
|
48
|
-
<template #label>
|
|
49
|
-
<el-text class="el-form-item__label">
|
|
50
|
-
{{ props.label }}
|
|
51
|
-
<span style="color:red" v-if="props.required">*</span>
|
|
52
|
-
<el-tooltip
|
|
53
|
-
v-if="labelRemark"
|
|
54
|
-
placement="top">
|
|
55
|
-
<el-icon>
|
|
56
|
-
<question-filled/>
|
|
57
|
-
</el-icon>
|
|
58
|
-
<template #content>
|
|
59
|
-
<div v-html="labelRemark"/>
|
|
60
|
-
</template>
|
|
61
|
-
</el-tooltip>
|
|
62
|
-
</el-text>
|
|
63
|
-
</template>
|
|
64
|
-
<slot></slot>
|
|
65
|
-
<slot name="error"></slot>
|
|
66
|
-
</el-form-item>
|
|
67
|
-
</template>
|
|
68
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {provide, ref, withDefaults, defineProps, defineExpose} from 'vue'
|
|
3
|
+
import {ElFormItem, ElIcon, ElText, type FormItemRule, ElTooltip} from 'element-plus'
|
|
4
|
+
import {QuestionFilled} from "@element-plus/icons-vue";
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<{
|
|
7
|
+
prop?: string | string[]
|
|
8
|
+
rules?: FormItemRule | FormItemRule[]
|
|
9
|
+
label?: string
|
|
10
|
+
labelWidth?: string | number
|
|
11
|
+
labelRemark?: string
|
|
12
|
+
required?: boolean
|
|
13
|
+
error?: string
|
|
14
|
+
showMessage?: boolean
|
|
15
|
+
inlineMessage?: boolean
|
|
16
|
+
size?: 'small' | 'default' | 'large'
|
|
17
|
+
}>(), {
|
|
18
|
+
required: false,
|
|
19
|
+
showMessage: true,
|
|
20
|
+
inlineMessage: true,
|
|
21
|
+
size: 'small'
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
provide('aceFormItemProp', props.prop)
|
|
25
|
+
|
|
26
|
+
const formItem = ref<typeof ElFormItem | null>(null)
|
|
27
|
+
defineExpose({
|
|
28
|
+
resetField: () => {
|
|
29
|
+
formItem.value!.resetField()
|
|
30
|
+
},
|
|
31
|
+
clearValidate: () => {
|
|
32
|
+
formItem.value!.clearValidate()
|
|
33
|
+
},
|
|
34
|
+
elFormItem: formItem
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<el-form-item ref="formItem"
|
|
41
|
+
:prop="prop"
|
|
42
|
+
:rules="rules"
|
|
43
|
+
:label-width="labelWidth"
|
|
44
|
+
:error="error"
|
|
45
|
+
:show-message="showMessage"
|
|
46
|
+
:inline-message="inlineMessage"
|
|
47
|
+
:size="size">
|
|
48
|
+
<template #label>
|
|
49
|
+
<el-text class="el-form-item__label">
|
|
50
|
+
{{ props.label }}
|
|
51
|
+
<span style="color:red" v-if="props.required">*</span>
|
|
52
|
+
<el-tooltip
|
|
53
|
+
v-if="labelRemark"
|
|
54
|
+
placement="top">
|
|
55
|
+
<el-icon>
|
|
56
|
+
<question-filled/>
|
|
57
|
+
</el-icon>
|
|
58
|
+
<template #content>
|
|
59
|
+
<div v-html="labelRemark"/>
|
|
60
|
+
</template>
|
|
61
|
+
</el-tooltip>
|
|
62
|
+
</el-text>
|
|
63
|
+
</template>
|
|
64
|
+
<slot></slot>
|
|
65
|
+
<slot name="error"></slot>
|
|
66
|
+
</el-form-item>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {type SFCWithInstall, withInstall} from "../../utils/install";
|
|
2
|
-
import FormItem from "./JaFormItem.vue";
|
|
3
|
-
export const JaFormItem: SFCWithInstall<typeof FormItem> = withInstall(FormItem);
|
|
4
|
-
export default FormItem;
|
|
1
|
+
import {type SFCWithInstall, withInstall} from "../../utils/install";
|
|
2
|
+
import FormItem from "./JaFormItem.vue";
|
|
3
|
+
export const JaFormItem: SFCWithInstall<typeof FormItem> = withInstall(FormItem);
|
|
4
|
+
export default FormItem;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
export * from "./upload";
|
|
2
|
-
export * from "./tip";
|
|
3
|
-
export * from "./form"
|
|
4
|
-
export * from "./formItem"
|
|
5
|
-
export * from "./input"
|
|
6
|
-
export * from "./checkbox"
|
|
7
|
-
export * from "./inputNumber"
|
|
8
|
-
export * from "./select"
|
|
9
|
-
export * from "./datePicker"
|
|
10
|
-
export * from "./button"
|
|
11
|
-
export * from "./dropdownButton"
|
|
12
|
-
export * from "./switch"
|
|
13
|
-
export * from "./stringList"
|
|
14
|
-
export * from "./numberList"
|
|
15
|
-
export * from "./enumList"
|
|
16
|
-
export * from "./mapItemList"
|
|
17
|
-
export * from "./departmentPicker"
|
|
18
|
-
export * from "./avatar"
|
|
19
|
-
export * from "./userTag"
|
|
20
|
-
export * from "./userPicker"
|
|
21
|
-
export * from "./departmentTree"
|
|
22
|
-
export * from "./userSelectDialog"
|
|
23
|
-
export * from "./timePicker"
|
|
24
|
-
export * from "./scrollbar"
|
|
25
|
-
export * from "./userGroupTree"
|
|
26
|
-
export * from "./userGroupPicker"
|
|
27
|
-
export * from "./autoComplete"
|
|
28
|
-
export * from "./radioGroup"
|
|
29
|
-
export * from "./rolePicker"
|
|
30
|
-
export * from "./channelPicker"
|
|
31
|
-
export * from "./properyPicker"
|
|
32
|
-
export * from "./inputI18n"
|
|
33
|
-
export * from "./checkboxGroup"
|
|
1
|
+
export * from "./upload";
|
|
2
|
+
export * from "./tip";
|
|
3
|
+
export * from "./form"
|
|
4
|
+
export * from "./formItem"
|
|
5
|
+
export * from "./input"
|
|
6
|
+
export * from "./checkbox"
|
|
7
|
+
export * from "./inputNumber"
|
|
8
|
+
export * from "./select"
|
|
9
|
+
export * from "./datePicker"
|
|
10
|
+
export * from "./button"
|
|
11
|
+
export * from "./dropdownButton"
|
|
12
|
+
export * from "./switch"
|
|
13
|
+
export * from "./stringList"
|
|
14
|
+
export * from "./numberList"
|
|
15
|
+
export * from "./enumList"
|
|
16
|
+
export * from "./mapItemList"
|
|
17
|
+
export * from "./departmentPicker"
|
|
18
|
+
export * from "./avatar"
|
|
19
|
+
export * from "./userTag"
|
|
20
|
+
export * from "./userPicker"
|
|
21
|
+
export * from "./departmentTree"
|
|
22
|
+
export * from "./userSelectDialog"
|
|
23
|
+
export * from "./timePicker"
|
|
24
|
+
export * from "./scrollbar"
|
|
25
|
+
export * from "./userGroupTree"
|
|
26
|
+
export * from "./userGroupPicker"
|
|
27
|
+
export * from "./autoComplete"
|
|
28
|
+
export * from "./radioGroup"
|
|
29
|
+
export * from "./rolePicker"
|
|
30
|
+
export * from "./channelPicker"
|
|
31
|
+
export * from "./properyPicker"
|
|
32
|
+
export * from "./inputI18n"
|
|
33
|
+
export * from "./checkboxGroup"
|