Compare commits

...

2 Commits

3 changed files with 55 additions and 2 deletions

View File

@ -1,5 +1,12 @@
<template>
<BasicForm ref="myDataBaseFormRef" @register="registerForm" v-if="formModalVisible" />
<PageHeader title="返回" />
<div class="form-box">
<BasicForm ref="myDataBaseFormRef" @register="registerForm" v-if="formModalVisible" />
</div>
<div class="btn-box">
<a-button class="leftbtn" size="large" @click="closeModalClick"></a-button>
<a-button class="rightbtn" type="primary" size="large" @click="closeModalClick"></a-button>
</div>
</template>
<script lang="ts" setup>
import { unref, ref, onMounted } from 'vue';
@ -19,6 +26,7 @@
const { createMessage } = useMessage();
const formModalVisible = ref(false);
const isUpdate = ref(true);
const schemeId = ref();
const primaryQuery = ref();
const addQuery: any = ref([]);
const formColumns: FormSchema[] = [];
@ -36,6 +44,7 @@
const [registerForm, { setFieldsValue, validate }] = useForm({
labelWidth: 100,
labelAlign: 'right',
schemas: formColumns,
showActionButtonGroup: false,
baseColProps: { lg: 24, md: 24 },
@ -83,13 +92,52 @@
console.log('res', res);
let columnObj = JSON.parse(res.entity.scheme);
let formObj = JSON.parse(res.formScheme.scheme);
console.log('formObj', formObj);
formObj.formInfo.schemas.forEach((item) => {
formColumns.push(item);
});
formModalVisible.value = true;
schemeId.value = res.formScheme.id;
});
}
onMounted(() => {
getPublicForm();
});
</script>
<style scoped>
.form-box {
height: calc(100% - 90px);
padding: 20px 20px 40px 10px;
overflow: auto;
}
.btn-box {
display: flex;
position: fixed;
bottom: 0;
align-items: center;
justify-content: center;
width: 100%;
height: 80px;
border-top: 1px solid #eee;
}
.leftbtn {
width: 100px;
margin-right: 20px;
}
.rightbtn {
width: 100px;
}
::v-deep .ant-form-item-label {
flex: none !important;
padding-right: 10px !important;
text-align: right !important;
}
::v-deep .ant-form-item-control {
flex: none !important;
}
</style>

View File

@ -53,6 +53,9 @@
...data.record,
});
}, 100);
} else {
console.log('rrreeeeccc');
resetFields();
}
addQuery.value = [];
if (data.addParams) {
@ -76,7 +79,7 @@
}
const uniqueDigits = generateUniqueDigits(20);
const [registerForm, { setFieldsValue, validate }] = useForm({
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
labelWidth: 100,
schemas: formColumns,
showActionButtonGroup: false,

View File

@ -141,9 +141,11 @@
const query: any = ref({
id: paramsId.value,
key: designData.value.primaryKey,
// key: 'f_id',
keyValue: null,
});
const str: any = ref(addParamsArr.value[0].field);
// const str: any = ref('_input_guid_43');
addParamsArr.value.forEach((item) => {
if (item.type == 'main') {
str.value = item.field;