105 lines
3.2 KiB
Vue
105 lines
3.2 KiB
Vue
<template>
|
|
<div class="AddBuildingBox">
|
|
<PageHeader title="新建楼栋"></PageHeader>
|
|
<div class="AddBuildingBody">
|
|
<div class="title">基本信息</div>
|
|
<div class="addBuildingFormBody">
|
|
<el-form class="formBody" ref="formRef" :model="form" :rules="rules" label-width="100px">
|
|
<el-form-item label="楼栋名称" prop="buildingName">
|
|
<el-input v-model="form.buildingName" placeholder="请输入楼栋名称" />
|
|
</el-form-item>
|
|
<el-form-item label="楼栋朝向" prop="buildingCode">
|
|
<el-input v-model="form.buildingCode" placeholder="请输入楼栋朝向" />
|
|
</el-form-item>
|
|
<el-form-item label="楼高(m)" prop="buildingType">
|
|
<el-input v-model="form.buildingType" placeholder="请输入楼高(m)" />
|
|
</el-form-item>
|
|
<el-form-item label="楼栋结构" prop="buildingArea">
|
|
<el-input v-model="form.buildingArea" placeholder="请输入楼栋结构" />
|
|
</el-form-item>
|
|
<el-form-item label="单元数" prop="buildingAddress">
|
|
<el-input-number :min="1" v-model="form.buildingAddress" placeholder="单元数" />
|
|
</el-form-item>
|
|
<el-form-item label="楼层" prop="buildingDescription">
|
|
<el-input-number :min="1" v-model="form.buildingDescription" placeholder="楼层数" />
|
|
</el-form-item>
|
|
<el-form-item style="margin-top: 30px">
|
|
<el-button type="primary" @click="submitForm">确定</el-button>
|
|
<el-button @click="cancelForm">取消</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref } from 'vue';
|
|
import PageHeader from '@/components/Pageheader/index.vue';
|
|
const formRef = ref();
|
|
const form = ref({
|
|
buildingName: '',
|
|
buildingCode: '',
|
|
buildingType: '',
|
|
buildingArea: '',
|
|
buildingAddress: null,
|
|
buildingDescription: null
|
|
});
|
|
const rules = ref({
|
|
buildingName: [{ required: true, message: '请输入楼栋名称', trigger: 'blur' }],
|
|
buildingAddress: [{ required: true, message: '请输入单元数', trigger: 'blur' }],
|
|
buildingDescription: [{ required: true, message: '请输入楼层', trigger: 'blur' }]
|
|
});
|
|
|
|
const submitForm = () => {
|
|
formRef.value?.validate(async (valid: boolean) => {
|
|
if (valid) {
|
|
console.log(form.value);
|
|
}
|
|
});
|
|
};
|
|
const cancelForm = () => {
|
|
console.log('取消');
|
|
};
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.AddBuildingBox {
|
|
padding: 15px;
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
.AddBuildingBody {
|
|
margin-top: 20px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
background-color: white;
|
|
padding: 15px;
|
|
.title {
|
|
height: 40px;
|
|
line-height: 40px;
|
|
padding-left: 20px;
|
|
background-color: rgba(255, 255, 255, 1);
|
|
color: rgba(16, 16, 16, 1);
|
|
border-bottom: 1px solid #bbbbbb;
|
|
margin-bottom: 60px;
|
|
}
|
|
.addBuildingFormBody {
|
|
.formBody {
|
|
width: 550px;
|
|
margin: 0 auto;
|
|
.el-form-item {
|
|
margin-bottom: 20px;
|
|
}
|
|
.el-button {
|
|
width: 80px;
|
|
height: 35px;
|
|
margin-right: 20px;
|
|
}
|
|
}
|
|
padding-bottom: 40px;
|
|
}
|
|
}
|
|
</style>
|