新增数据,开始安全巡检模块
This commit is contained in:
@@ -50,7 +50,6 @@ import { useRouter } from 'vue-router';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
|
||||
const houseStore = useHouseStore();
|
||||
const { currentVilageInfo } = storeToRefs(houseStore);
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_build_use } = toRefs<any>(proxy?.useDict('com_build_use'));
|
||||
@@ -100,7 +99,6 @@ const submitForm = () => {
|
||||
if (buildingId) {
|
||||
editBuildingApi({
|
||||
...form.value,
|
||||
villageId: currentVilageInfo.value.villageId,
|
||||
id: buildingId
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -113,8 +111,7 @@ const submitForm = () => {
|
||||
});
|
||||
} else {
|
||||
addBuildingApi({
|
||||
...form.value,
|
||||
villageId: currentVilageInfo.value.villageId
|
||||
...form.value
|
||||
})
|
||||
.then((res) => {
|
||||
ElMessage.success('添加成功');
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
<div class="AddBuildingBody">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="addBuildingFormBody">
|
||||
<el-form class="formBody" label-position="left" ref="formRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form class="formBody" label-position="right" ref="formRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="楼栋" prop="buildingId">
|
||||
<el-select @change="handlechangeBuild" v-model="form.buildingId" class="m-2" placeholder="请选择">
|
||||
<el-select @change="handlechangeBuild" v-model="form.buildingId" placeholder="请选择">
|
||||
<el-option v-for="item in houseStore.currentBuildingInfoList" :key="item.id" :label="item.buildingName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单元" prop="unit">
|
||||
<el-select v-model.number="form.unitNo" class="m-2" placeholder="请选择">
|
||||
<el-select v-model.number="form.unitNo" placeholder="请选择">
|
||||
<el-option v-for="item in units" :key="item.no" :label="item.name" :value="item.no" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="楼层" prop="floor">
|
||||
<el-select v-model.number="form.floorNo" class="m-2" placeholder="请选择">
|
||||
<el-select v-model.number="form.floorNo" placeholder="请选择">
|
||||
<el-option v-for="item in floors" :key="item.no" :label="item.name" :value="item.no" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
<div class="TableBox p-5 h-full" v-if="houseStore.currentHouseInfoList !== null">
|
||||
<el-checkbox-group @change="handleChangeCheckhouses" v-model="houseStore.checkoutHouses">
|
||||
<el-table border :data="houseStore.currentFloorInfoList">
|
||||
<el-table-column align="center" fixed label="楼层\单元" min-width="85">
|
||||
<el-table-column align="center" fixed label="楼层\单元" max-width="100">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row }}楼</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
min-width="160"
|
||||
class="column"
|
||||
align="center"
|
||||
:label="`${unit.unitNo}单元`"
|
||||
v-for="(unit, index) in houseStore.currentHouseInfoList?.units ?? []"
|
||||
@@ -74,11 +73,8 @@ function contextMenuFun(val: { type: string; value: string }) {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.TableBox {
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
.column {
|
||||
width: 200px;
|
||||
background-color: red;
|
||||
.el-table {
|
||||
height: calc(100% - 500px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -77,6 +77,8 @@ $primary_color: #1978fe;
|
||||
}
|
||||
.UnitBody {
|
||||
flex: 1;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user