优化
This commit is contained in:
@ -12,8 +12,9 @@
|
||||
<el-form-item label="流转台账状态" prop="transferStatus">
|
||||
<el-select v-model="queryParams.transferStatus" placeholder="请选择流转台账状态" clearable>
|
||||
<el-option label="待流转" :value="0"></el-option>
|
||||
<el-option label="已流转" :value="1"></el-option> </el-select
|
||||
></el-form-item>
|
||||
<el-option label="已流转" :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="责任人" prop="responsiblePerson">
|
||||
<el-input v-model="queryParams.responsiblePerson" placeholder="请输入责任人" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
@ -88,90 +89,107 @@
|
||||
<el-form-item label="对应地块" prop="landBlockId">
|
||||
<el-select v-model="form.landBlockId" clearable placeholder="请选择对应地块" @change="handleLandBlockChange">
|
||||
<el-option v-for="item in landBlockList" :key="item.id" :label="item.landName" :value="item.id" />
|
||||
</el-select> </el-form-item
|
||||
></el-col>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="进场道路" prop="enterRoadId">
|
||||
<el-select v-model="form.enterRoadId" clearable placeholder="请选择对应地块">
|
||||
<el-option v-for="item in enterRoadList" :key="item.id" :label="item.roadName" :value="item.id" />
|
||||
</el-select> </el-form-item
|
||||
></el-col>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="土地类型" prop="landType">
|
||||
<el-select v-model="form.landType" placeholder="请选择土地类型" clearable>
|
||||
<el-option v-for="dict in land_type" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select></el-form-item
|
||||
></el-col>
|
||||
<el-option v-for="dict in land_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="流转台账状态" prop="transferStatus">
|
||||
<el-select v-model="form.transferStatus" :disabled="!form.id" placeholder="请选择流转台账状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in land_transfer_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/> </el-select></el-form-item
|
||||
></el-col>
|
||||
<el-select v-model="form.transferStatus" :disabled="!form.id" placeholder="请选择流转台账状态" clearable @change="calcTransferRatio">
|
||||
<el-option v-for="dict in land_transfer_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设计面积(亩)" prop="designArea">
|
||||
<el-input type="number" v-model="form.designArea" placeholder="请输入设计面积" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12"
|
||||
><el-form-item label="责任人" prop="responsiblePerson">
|
||||
<el-input v-model="form.responsiblePerson" placeholder="请输入责任人" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col v-if="form.transferStatus != '2'" :span="12"
|
||||
><el-form-item label="预计完成日期" prop="expectedFinishDate">
|
||||
<el-input type="number" v-model="form.designArea" placeholder="请输入设计面积" @input="calcTransferRatio" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="责任人" prop="responsiblePerson">
|
||||
<el-input v-model="form.responsiblePerson" placeholder="请输入责任人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus != '2'" :span="12">
|
||||
<el-form-item label="预计完成日期" prop="expectedFinishDate">
|
||||
<el-date-picker clearable v-model="form.expectedFinishDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择预计完成时间">
|
||||
</el-date-picker> </el-form-item
|
||||
></el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="12"
|
||||
><el-form-item label="已流转面积(亩)" prop="transferAea">
|
||||
<el-input v-model="form.transferAea" type="number" placeholder="请输入已流转面积" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="12"
|
||||
><el-form-item label="流转比例(%)" prop="transferRatio">
|
||||
<el-input v-model="form.transferRatio" type="number" max="100" min="0" placeholder="请输入流转比例" /> </el-form-item
|
||||
></el-col>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="12">
|
||||
<el-form-item label="已流转面积(亩)" prop="transferAea">
|
||||
<el-input v-model="form.transferAea" type="number" placeholder="请输入已流转面积" @input="calcTransferRatio" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 流转比例:改为禁用输入,自动计算展示 -->
|
||||
<el-col v-if="form.transferStatus == '1'" :span="12">
|
||||
<el-form-item label="流转比例(%)" prop="transferRatio">
|
||||
<el-input v-model="form.transferRatio" type="text" :disabled="true" placeholder="自动计算中..." />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="12">
|
||||
<el-form-item label="土地租金(元)" prop="landRent">
|
||||
<el-input type="number" v-model="form.landRent" placeholder="请输入土地租金" /> </el-form-item
|
||||
></el-col>
|
||||
<el-input type="number" v-model="form.landRent" placeholder="请输入土地租金" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="12">
|
||||
<el-form-item label="青苗赔偿(元)" prop="seedlingCompensation">
|
||||
<el-input v-model="form.seedlingCompensation" type="number" placeholder="请输入青苗赔偿" /> </el-form-item
|
||||
></el-col>
|
||||
<el-input v-model="form.seedlingCompensation" type="number" placeholder="请输入青苗赔偿" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="12">
|
||||
<el-form-item label="总金额(元)" prop="totalAmount">
|
||||
<el-input type="number" v-model="form.totalAmount" placeholder="请输入总金额" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col v-if="form.transferStatus == '2'" :span="12"
|
||||
><el-form-item label="不签合同面积(亩)" prop="noContractArea">
|
||||
<el-input v-model="form.noContractArea" type="number" placeholder="请输入不签合同面积" /> </el-form-item
|
||||
></el-col>
|
||||
<el-input type="number" v-model="form.totalAmount" placeholder="请输入总金额" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '2'" :span="12">
|
||||
<el-form-item label="不签合同面积(亩)" prop="noContractArea">
|
||||
<el-input v-model="form.noContractArea" type="number" placeholder="请输入不签合同面积" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '2'" :span="12">
|
||||
<el-form-item label="不测量面积(亩)" prop="noSurveyArea">
|
||||
<el-input v-model="form.noSurveyArea" type="number" placeholder="请输入不测量面积" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col v-if="form.transferStatus == '2'" :span="24"
|
||||
><el-form-item label="不签合同原因" prop="noContractReason">
|
||||
<el-input v-model="form.noContractReason" type="textarea" placeholder="请输入内容" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col v-if="form.transferStatus == '2'" :span="24"
|
||||
><el-form-item label="不流转原因" prop="nonTransferReason">
|
||||
<el-input v-model="form.nonTransferReason" type="textarea" placeholder="请输入内容" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="24"
|
||||
><el-form-item label="状态说明" prop="statusDescription">
|
||||
<el-input v-model="form.statusDescription" type="textarea" placeholder="请输入内容" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="24"
|
||||
><el-form-item label="问题总结" prop="issueSummary">
|
||||
<el-input v-model="form.issueSummary" type="textarea" placeholder="请输入内容" /> </el-form-item
|
||||
></el-col>
|
||||
<el-input v-model="form.noSurveyArea" type="number" placeholder="请输入不测量面积" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '2'" :span="24">
|
||||
<el-form-item label="不签合同原因" prop="noContractReason">
|
||||
<el-input v-model="form.noContractReason" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '2'" :span="24">
|
||||
<el-form-item label="不流转原因" prop="nonTransferReason">
|
||||
<el-input v-model="form.nonTransferReason" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="24">
|
||||
<el-form-item label="状态说明" prop="statusDescription">
|
||||
<el-input v-model="form.statusDescription" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="24">
|
||||
<el-form-item label="问题总结" prop="issueSummary">
|
||||
<el-input v-model="form.issueSummary" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.transferStatus == '1'" :span="24">
|
||||
<el-form-item label="下一步策略" prop="nextStrategy">
|
||||
<el-input v-model="form.nextStrategy" type="textarea" placeholder="请输入内容" /> </el-form-item
|
||||
></el-col>
|
||||
<el-input v-model="form.nextStrategy" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@ -197,6 +215,20 @@ import { listEnterRoad } from '@/api/system/landTransfer/enterRoad';
|
||||
import { LandTransferLedgerVO, LandTransferLedgerQuery, LandTransferLedgerForm } from '@/api/system/landTransfer/landTransferLedger/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { listLandBlock } from '@/api/system/landTransfer/landBlock';
|
||||
import { getCurrentInstance, ComponentInternalInstance, watch, onUnmounted, onMounted } from 'vue';
|
||||
import { ElFormInstance } from 'element-plus';
|
||||
|
||||
// 类型定义补充
|
||||
interface DialogOption {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
}
|
||||
interface PageData<T, Q> {
|
||||
form: T;
|
||||
queryParams: Q;
|
||||
rules: Record<string, any[]>;
|
||||
}
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
@ -214,6 +246,7 @@ const landBlockList = ref([]);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const landTransferLedgerFormRef = ref<ElFormInstance>();
|
||||
const enterRoadList = ref([]);
|
||||
// 字典数据
|
||||
const { land_type, land_transfer_status } = toRefs<any>(proxy?.useDict('land_type', 'land_transfer_status'));
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
@ -221,7 +254,8 @@ const dialog = reactive<DialogOption>({
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData = {
|
||||
// 表单初始数据
|
||||
const initFormData: LandTransferLedgerForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
landType: undefined,
|
||||
@ -244,6 +278,8 @@ const initFormData = {
|
||||
noSurveyArea: undefined,
|
||||
nonTransferReason: undefined
|
||||
};
|
||||
|
||||
// 核心数据响应式对象
|
||||
const data = reactive<PageData<LandTransferLedgerForm, LandTransferLedgerQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
@ -273,21 +309,38 @@ const data = reactive<PageData<LandTransferLedgerForm, LandTransferLedgerQuery>>
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
landType: [{ required: true, message: '土地类型不能为空', trigger: 'change' }],
|
||||
transferRatio: [
|
||||
{ required: true, message: '流转比例不能为空', trigger: ['blur', 'change'] }, // 必填
|
||||
// 动态校验:仅已流转状态下必填
|
||||
{
|
||||
required: true,
|
||||
message: '流转比例不能为空',
|
||||
trigger: ['blur', 'change'],
|
||||
validator: (rule, value, callback) => {
|
||||
if (data.form.transferStatus !== '1') {
|
||||
callback(); // 非已流转状态跳过校验
|
||||
return;
|
||||
}
|
||||
if (value === undefined || value === null || value === '') {
|
||||
callback(new Error('流转比例不能为空'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
},
|
||||
// 比例范围校验(0-100)
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// 校验数值是否在 0-100 之间(包含0和100)
|
||||
if (value < 0 || value > 100) {
|
||||
callback(new Error('流转比例必须在 0-100 之间'));
|
||||
} else {
|
||||
callback(); // 校验通过
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: 'blur' // 失去焦点时触发校验
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const detailInfo = ref({
|
||||
transferAea: 0,
|
||||
transferRatio: 0,
|
||||
@ -295,18 +348,53 @@ const detailInfo = ref({
|
||||
});
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/**
|
||||
* 自动计算流转比例:(已流转面积 / 设计面积) × 100,保留2位小数,最大100%
|
||||
*/
|
||||
const calcTransferRatio = () => {
|
||||
// 仅已流转状态下计算
|
||||
if (form.value.transferStatus !== '1') {
|
||||
form.value.transferRatio = undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
// 转换为数字(避免字符串计算)
|
||||
const designArea = Number(form.value.designArea) || 0;
|
||||
const transferAea = Number(form.value.transferAea) || 0;
|
||||
|
||||
// 边界处理:设计面积为0时避免报错
|
||||
if (designArea === 0) {
|
||||
form.value.transferRatio = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// 核心计算:限制最大100%,保留2位小数
|
||||
const ratio = Math.min((transferAea / designArea) * 100, 100);
|
||||
form.value.transferRatio = Number(ratio.toFixed(2));
|
||||
};
|
||||
|
||||
/** 查询项目土地流转台账列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listLandTransferLedger(queryParams.value);
|
||||
landTransferLedgerList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
try {
|
||||
const res = await listLandTransferLedger(queryParams.value);
|
||||
landTransferLedgerList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 获取地块统计信息 */
|
||||
const getLandBlockList = async () => {
|
||||
let res = await landTransferLedgerCount(currentProject.value?.id);
|
||||
detailInfo.value = res.data;
|
||||
try {
|
||||
const res = await landTransferLedgerCount(currentProject.value?.id);
|
||||
detailInfo.value = res.data;
|
||||
} catch (error) {
|
||||
console.error('获取地块统计信息失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
dialog.visible = false;
|
||||
@ -334,92 +422,143 @@ const resetQuery = () => {
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: LandTransferLedgerVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = selection.length === 0;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
form.value.transferStatus = '0';
|
||||
dialog.visible = true;
|
||||
form.value.transferStatus = '0'; // 默认待流转
|
||||
enterRoadList.value = [];
|
||||
dialog.title = '添加项目土地流转台账';
|
||||
dialog.visible = true;
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: LandTransferLedgerVO) => {
|
||||
reset();
|
||||
form.value.landBlockId = row?.landBlockId;
|
||||
getListRoad();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getLandTransferLedger(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
console.log(form.value);
|
||||
if (!_id) return;
|
||||
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改项目土地流转台账';
|
||||
try {
|
||||
// 获取编辑数据
|
||||
const res = await getLandTransferLedger(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
// 回显地块对应的道路列表
|
||||
form.value.landBlockId = row?.landBlockId;
|
||||
await getListRoad();
|
||||
// 初始化计算流转比例
|
||||
calcTransferRatio();
|
||||
// 打开弹窗
|
||||
dialog.title = '修改项目土地流转台账';
|
||||
dialog.visible = true;
|
||||
} catch (error) {
|
||||
console.error('获取编辑数据失败:', error);
|
||||
proxy?.$modal.msgError('加载数据失败,请重试');
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
landTransferLedgerFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (!valid) return;
|
||||
|
||||
buttonLoading.value = true;
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateLandTransferLedger(form.value).finally(() => (buttonLoading.value = false));
|
||||
await updateLandTransferLedger(form.value);
|
||||
} else {
|
||||
await addLandTransferLedger(form.value).finally(() => (buttonLoading.value = false));
|
||||
await addLandTransferLedger(form.value);
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
await getLandBlockList(); // 刷新统计信息
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('操作失败,请重试');
|
||||
console.error('提交表单失败:', error);
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: LandTransferLedgerVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除项目土地流转台账编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delLandTransferLedger(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
if (!_ids.length) return;
|
||||
|
||||
try {
|
||||
await proxy?.$modal.confirm(`是否确认删除项目土地流转台账编号为"${_ids}"的数据项?`);
|
||||
await delLandTransferLedger(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
await getLandBlockList(); // 刷新统计信息
|
||||
} catch (error) {
|
||||
console.error('删除数据失败:', error);
|
||||
if (error !== 'cancel') {
|
||||
// 排除用户取消确认的情况
|
||||
proxy?.$modal.msgError('删除失败,请重试');
|
||||
}
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
// 选择地块
|
||||
const handleLandBlockChange = (val) => {
|
||||
getListRoad();
|
||||
|
||||
/** 选择地块后加载对应道路 */
|
||||
const handleLandBlockChange = async () => {
|
||||
await getListRoad();
|
||||
};
|
||||
/** 查询地块信息列表 */
|
||||
|
||||
/** 查询地块列表 */
|
||||
const getListLand = async () => {
|
||||
const res = await listLandBlock({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
landBlockList.value = res.rows;
|
||||
try {
|
||||
const res = await listLandBlock({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
landBlockList.value = res.rows;
|
||||
} catch (error) {
|
||||
console.error('获取地块列表失败:', error);
|
||||
}
|
||||
};
|
||||
/** 查询进场道路信息列表 */
|
||||
|
||||
/** 查询进场道路列表(按地块筛选) */
|
||||
const getListRoad = async () => {
|
||||
const res = await listEnterRoad({ pageNum: 1, pageSize: 10000, projectId: currentProject.value?.id, landBlockId: form.value.landBlockId });
|
||||
enterRoadList.value = res.rows;
|
||||
try {
|
||||
const res = await listEnterRoad({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value?.id,
|
||||
landBlockId: form.value.landBlockId
|
||||
});
|
||||
enterRoadList.value = res.rows;
|
||||
} catch (error) {
|
||||
console.error('获取进场道路列表失败:', error);
|
||||
}
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
|
||||
/** 监听项目切换,刷新数据 */
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getLandBlockList();
|
||||
getListLand();
|
||||
getList();
|
||||
}
|
||||
async (newId) => {
|
||||
if (newId) {
|
||||
queryParams.value.projectId = newId;
|
||||
await Promise.all([getLandBlockList(), getListLand(), getList()]);
|
||||
}
|
||||
},
|
||||
{ immediate: true } // 初始加载时触发
|
||||
);
|
||||
|
||||
/** 组件卸载时清理监听 */
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
/** 组件挂载时初始化数据 */
|
||||
onMounted(() => {
|
||||
getLandBlockList();
|
||||
getList();
|
||||
getListLand();
|
||||
Promise.all([getLandBlockList(), getListLand(), getList()]);
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user