feature-0627-土地资源库 #5

Merged
shenhong merged 6 commits from feature-0627-土地资源库 into dev 2025-07-01 13:47:45 +08:00
6 changed files with 177 additions and 69 deletions

View File

@ -141,54 +141,68 @@ export default [
}, },
], ],
}, },
// {
// path: '/sub-government-affairs-service/record',
// name: 'record',
// component: Views,
// meta: { title: '种植档案', icon: 'Tickets' },
// redirect: '/sub-government-affairs-service/record-base',
// children: [
// {
// path: '/sub-government-affairs-service/record-base',
// component: () => import('@/views/trace/record/base/index.vue'),
// name: 'record-base',
// meta: { title: '基地档案', icon: '' },
// },
// {
// path: '/sub-government-affairs-service/record-seed',
// component: () => import('@/views/trace/record/seed/index.vue'),
// name: 'record-seed',
// meta: { title: '种子档案', icon: '' },
// },
// ],
// },
// {
// path: '/sub-government-affairs-service/agricultural',
// name: 'agricultural',
// component: Views,
// meta: { title: '农事管理', icon: 'SetUp' },
// redirect: '/sub-government-affairs-service/agricultural-coding',
// children: [
// {
// path: '/sub-government-affairs-service/agricultural-coding',
// component: () => import('@/views/trace/agricultural/coding/index.vue'),
// name: 'agricultural-coding',
// meta: { title: '采收与赋码管理', icon: '' },
// },
// {
// path: '/sub-government-affairs-service/agricultural-quality',
// component: () => import('@/views/trace/agricultural/quality/index.vue'),
// name: 'agricultural-quality',
// meta: { title: '产品质检管理', icon: '' },
// },
// ],
// },
{ {
path: '/sub-government-affairs-service/record', path: '/sub-government-affairs-service/trace',
name: 'record', name: 'trace-management',
component: Views, meta: { title: '溯源管理', icon: 'Connection' },
meta: { title: '种植档案', icon: 'Tickets' }, redirect: '/sub-government-affairs-service/trace-search',
redirect: '/sub-government-affairs-service/record-base',
children: [ children: [
{ {
path: '/sub-government-affairs-service/record-base', path: '/sub-government-affairs-service/trace-search',
component: () => import('@/views/trace/record/base/index.vue'), name: 'trace-search',
name: 'record-base', component: () => import('@/views/trace/search/index.vue'),
meta: { title: '基地档案', icon: '' }, meta: { title: '溯源查询', icon: 'Files' },
}, },
{ {
path: '/sub-government-affairs-service/record-seed', path: '/sub-government-affairs-service/trace-statistic',
component: () => import('@/views/trace/record/seed/index.vue'), name: 'trace-statistic',
name: 'record-seed', component: () => import('@/views/trace/statistic/index.vue'),
meta: { title: '种子档案', icon: '' }, meta: { title: '溯源统计', icon: 'Filter' },
}, },
], ],
}, },
{
path: '/sub-government-affairs-service/agricultural',
name: 'agricultural',
component: Views,
meta: { title: '农事管理', icon: 'SetUp' },
redirect: '/sub-government-affairs-service/agricultural-coding',
children: [
{
path: '/sub-government-affairs-service/agricultural-coding',
component: () => import('@/views/trace/agricultural/coding/index.vue'),
name: 'agricultural-coding',
meta: { title: '采收与赋码管理', icon: '' },
},
{
path: '/sub-government-affairs-service/agricultural-quality',
component: () => import('@/views/trace/agricultural/quality/index.vue'),
name: 'agricultural-quality',
meta: { title: '产品质检管理', icon: '' },
},
],
},
{
path: '/sub-government-affairs-service/trace-search',
name: 'trace-search',
component: () => import('@/views/trace/search/index.vue'),
meta: { title: '溯源查询', icon: 'Files' },
},
{ {
path: '/sub-government-affairs-service/trace-info', path: '/sub-government-affairs-service/trace-info',
name: 'trace-info', name: 'trace-info',
@ -196,12 +210,6 @@ export default [
meta: { title: '溯源详情', icon: 'DocumentCopy' }, meta: { title: '溯源详情', icon: 'DocumentCopy' },
hidden: true, hidden: true,
}, },
{
path: '/sub-government-affairs-service/trace-statistic',
name: 'trace-statistic',
component: () => import('@/views/trace/statistic/index.vue'),
meta: { title: '溯源统计', icon: 'Filter' },
},
], ],
}, },
]; ];

View File

@ -185,7 +185,7 @@ const crudOptions = reactive({
{ label: '所属行政区划', prop: 'address' }, { label: '所属行政区划', prop: 'address' },
{ label: '所属网格', prop: 'gridCode' }, { label: '所属网格', prop: 'gridCode' },
{ label: '种植作物', prop: 'planCrop' }, { label: '种植作物', prop: 'planCrop' },
{ label: '账号(手机号)', prop: 'phone' }, // { label: '', prop: 'phone' },
{ label: '信息录入时间', prop: 'createTime' }, { label: '信息录入时间', prop: 'createTime' },
{ label: '信息更新时间', prop: 'updateTime' }, { label: '信息更新时间', prop: 'updateTime' },
], ],

View File

@ -20,7 +20,13 @@
:show-sort="true" :show-sort="true"
style="height: calc(100vh - 320px)" style="height: calc(100vh - 320px)"
@page-change="handlePageChange" @page-change="handlePageChange"
/> >
<template #action="scope">
<!-- <el-button size="small" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDelete(scope.row)">删除</el-button> -->
<custom-table-operate :actions="getActions(scope.row)" :data="scope" />
</template>
</TableComponent>
<el-dialog :key="dialogTitle" v-model="visible" :title="dialogTitle" width="60%" align-center :draggable="true"> <el-dialog :key="dialogTitle" v-model="visible" :title="dialogTitle" width="60%" align-center :draggable="true">
<el-tabs v-model="activeFormTab" class="tabs-wrapper"> <el-tabs v-model="activeFormTab" class="tabs-wrapper">
<el-tab-pane label="土地基本信息" name="basic"> <el-tab-pane label="土地基本信息" name="basic">
@ -40,7 +46,6 @@
clearable clearable
check-strictly check-strictly
:render-after-expand="false" :render-after-expand="false"
@change="handleLandTypeChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="具体位置" prop="address"> <el-form-item label="具体位置" prop="address">
@ -157,7 +162,6 @@ const activeTab = ref('1');
const handleTabChange = ({ name }) => { const handleTabChange = ({ name }) => {
// activeTab.value = name; // activeTab.value = name;
console.log('切换tab', activeTab.value); console.log('切换tab', activeTab.value);
searchForm.value.landStatus = Number(activeTab.value);
getData(); getData();
}; };
@ -180,7 +184,7 @@ const columns = ref([
{ label: '土地承包经营人', prop: 'propertyName' }, { label: '土地承包经营人', prop: 'propertyName' },
{ label: '联系电话', prop: 'propertyPhone' }, { label: '联系电话', prop: 'propertyPhone' },
{ label: '土地经营权证书编号', prop: 'landCode', width: 160 }, { label: '土地经营权证书编号', prop: 'landCode', width: 160 },
{ label: '是否土地流转', prop: 'isTransfer' }, { label: '是否土地流转', prop: 'isTransfer', formatter: (row, column, cellValue) => (cellValue === 1 ? '是' : '否') },
{ label: '土地受让方', prop: 'transferName' }, { label: '土地受让方', prop: 'transferName' },
{ label: '受让方联系电话', prop: 'transferPhone', width: 100 }, { label: '受让方联系电话', prop: 'transferPhone', width: 100 },
{ label: '流转合同', prop: 'transferContract' }, { label: '流转合同', prop: 'transferContract' },
@ -190,8 +194,62 @@ const columns = ref([
// { label: '', prop: 'updateName' }, // { label: '', prop: 'updateName' },
// { label: '', prop: 'updateGroup' }, // { label: '', prop: 'updateGroup' },
{ label: '信息更新时间', prop: 'updateTime' }, { label: '信息更新时间', prop: 'updateTime' },
{ label: '操作', prop: 'action', slotName: 'action', fixed: 'right' },
]); ]);
const actions = [
{
name: '查看',
icon: 'view',
event: ({ row }) => handleView(row),
},
{
name: '编辑',
icon: 'edit',
event: ({ row }) => handleEdit(row),
},
{
type: 'danger',
name: '删除',
icon: 'delete',
event: ({ row }) => handleDelete(row.id),
},
];
const handleView = async (row) => {
isReadonly.value = true;
formData.value = await getLandDetail(row.id);
dialogTitle.value = '查看网格';
visible.value = true;
};
const handleEdit = (row) => {
isReadonly.value = false;
formData.value = { ...row };
dialogTitle.value = '编辑网格';
visible.value = true;
};
const handleDelete = async (row) => {
console.log('删除', row);
// try {
// await ElMessageBox.confirm('', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning',
// });
// const response = await deleteGrid(row.id);
// ElMessage.success('');
// getData();
// } catch (error) {
// if (error === 'cancel') {
// ElMessage.info('');
// } else {
// ElMessage.error('');
// console.error(':', error);
// }
// }
};
const handlePageChange = ({ page, pageSize }) => { const handlePageChange = ({ page, pageSize }) => {
pageData.value.currentPage = page; pageData.value.currentPage = page;
pageData.value.pageSize = pageSize; pageData.value.pageSize = pageSize;
@ -218,18 +276,16 @@ import { mockData } from './landData';
import { createLand, deleteLand, editLand, fetchLandList, getLandById, approveLand } from '@/apis/landResourceManagement/landManagement'; import { createLand, deleteLand, editLand, fetchLandList, getLandById, approveLand } from '@/apis/landResourceManagement/landManagement';
import request from '@/utils/axios'; import request from '@/utils/axios';
const getData = async () => { const getData = async () => {
// const filteredParams = filterObject(searchForm.value);
// const response = await fetchGridList(filteredParams);
// crudData.value = Array.isArray(response.data.records) ? response.data.records : [];
loading.value = true; loading.value = true;
// const requestData = {
await new Promise((resolve) => setTimeout(resolve, 300)); ...searchForm.value,
tableData.value = mockData page: pageData.value.currentPage,
.filter((item) => item.status === activeTab.value) size: pageData.value.pageSize,
.map((item) => ({ landStatus: activeTab.value,
...item, landTypeName: '草地',
landTypeName: '林地', };
})); const response = await fetchLandList(requestData);
tableData.value = Array.isArray(response.data.records) ? response.data.records : [];
pageData.value.total = tableData.value.length; pageData.value.total = tableData.value.length;
loading.value = false; loading.value = false;
}; };
@ -270,4 +326,51 @@ h1 {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
} }
.tabs-wrapper {
width: 100%;
display: flex;
align-items: center;
// background-color: #7daaaa;
.el-tabs__header {
width: 100%;
.el-tabs__nav-scroll {
display: flex;
justify-content: center;
}
.el-tabs__item {
font-size: 16px;
color: #555555;
font-weight: 500;
}
}
:deep(.el-tabs__content) {
padding: 20px;
// background-color: #af8686;
border-radius: 4px;
width: 80%;
height: calc(100vh - 400px);
overflow-y: auto;
.el-tab-pane {
margin: 0 auto;
width: 100%;
// background-color: #555555;
}
}
}
.form-title {
font-size: 16px;
font-weight: 500;
margin: 30px 0;
color: #333333;
}
.dialog-footer {
display: block;
text-align: center;
}
</style> </style>

View File

@ -31,7 +31,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
> >
<template #menu="scope"> <template #menu="scope">
<custom-table-operate :actions="crudOptions.actions" :show="false" :data="scope" /> <custom-table-operate :actions="crudOptions.actions" :data="scope" />
</template> </template>
</avue-crud> </avue-crud>
<el-dialog :key="dialogTitle" v-model="visible" :title="dialogTitle" width="60%" align-center :draggable="true"> <el-dialog :key="dialogTitle" v-model="visible" :title="dialogTitle" width="60%" align-center :draggable="true">
@ -236,7 +236,7 @@ const crudOptions = reactive({
{ label: '土地承包经营人', prop: 'propertyName' }, { label: '土地承包经营人', prop: 'propertyName' },
{ label: '联系电话', prop: 'propertyPhone' }, { label: '联系电话', prop: 'propertyPhone' },
{ label: '土地经营权证书编号', prop: 'landCode', width: 160 }, { label: '土地经营权证书编号', prop: 'landCode', width: 160 },
{ label: '是否土地流转', prop: 'landTransfer' }, { label: '是否土地流转', prop: 'landTransfer', formatter: (row, column, cellValue) => (cellValue === 1 ? '是' : '否') },
{ label: '土地受让方', prop: 'transferName' }, { label: '土地受让方', prop: 'transferName' },
{ label: '受让方联系电话', prop: 'transferPhone', width: 100 }, { label: '受让方联系电话', prop: 'transferPhone', width: 100 },
{ label: '流转合同', prop: 'transferContract' }, { label: '流转合同', prop: 'transferContract' },

View File

@ -25,7 +25,7 @@
</template> </template>
<script setup> <script setup>
import { ref } from 'vue'; import { ref, computed } from 'vue';
const props = defineProps({ const props = defineProps({
search: { search: {

View File

@ -190,10 +190,7 @@ const resetForm = () => {
// ============================== // ==============================
const crudOptions = reactive({ const crudOptions = reactive({
...CRUD_OPTIONS, ...CRUD_OPTIONS,
addBtn: false, header: false,
searchBtn: false,
emptyBtn: false,
refreshBtn: false,
column: [ column: [
{ label: '主体编码', prop: 'id' }, { label: '主体编码', prop: 'id' },
{ label: '姓名', prop: 'name' }, { label: '姓名', prop: 'name' },