index.vue
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
<div class="tenant-class">
<CollapseContainer :title="t('tenant.config.form.tenantSetting')">
<BasicForm @register="registerForm" />
</CollapseContainer>
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
import { BasicForm, useForm } from '/@/components/Form';
import { formSchema } from './config';
import { CollapseContainer } from '/@/components/Container/index';
import { useI18n } from '/@/hooks/web/useI18n';
export default defineComponent({
name: 'Index',
components: { BasicForm, CollapseContainer },
emits: ['success', 'register', 'funcResetFields'],
setup() {
const { t } = useI18n();
const getValueData: any = ref({});
const [registerForm, { getFieldsValue, resetFields, setFieldsValue }] = useForm({
schemas: formSchema,
showActionButtonGroup: false,
});
const setFieldsValueFunc = (v) => {
setFieldsValue(v);
};
function getAllFields(getV) {
const values = getFieldsValue();
getValueData.value = values;
getV = getValueData.value;
return getV;
}
function funcResetFields() {
resetFields();
}
return {
setFieldsValueFunc,
funcResetFields,
getAllFields,
registerForm,
t,
};
},
});
</script>
<style lang="less" scoped>
.tenant-class {
:deep(.ant-input-number) {
width: 95% !important;
}
}
</style>