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,61 +141,60 @@ 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',
name: 'record',
component: Views,
meta: { title: '种植档案', icon: 'Tickets' },
redirect: '/sub-government-affairs-service/record-base',
path: '/sub-government-affairs-service/trace',
name: 'trace-management',
meta: { title: '溯源管理', icon: 'Connection' },
redirect: '/sub-government-affairs-service/trace-search',
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/trace-search',
name: 'trace-search',
component: () => import('@/views/trace/search/index.vue'),
meta: { title: '溯源查询', icon: 'Files' },
},
{
path: '/sub-government-affairs-service/trace-info',
name: 'trace-info',
component: () => import('@/views/trace/search/info.vue'),
meta: { title: '溯源详情', icon: 'DocumentCopy' },
hidden: true,
},
{
path: '/sub-government-affairs-service/trace-statistic',
name: 'trace-statistic',
@ -204,4 +203,13 @@ export default [
},
],
},
{
path: '/sub-government-affairs-service/trace-info',
name: 'trace-info',
component: () => import('@/views/trace/search/info.vue'),
meta: { title: '溯源详情', icon: 'DocumentCopy' },
hidden: true,
},
],
},
];

View File

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

View File

@ -20,7 +20,13 @@
:show-sort="true"
style="height: calc(100vh - 320px)"
@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-tabs v-model="activeFormTab" class="tabs-wrapper">
<el-tab-pane label="土地基本信息" name="basic">
@ -40,7 +46,6 @@
clearable
check-strictly
:render-after-expand="false"
@change="handleLandTypeChange"
/>
</el-form-item>
<el-form-item label="具体位置" prop="address">
@ -157,7 +162,6 @@ const activeTab = ref('1');
const handleTabChange = ({ name }) => {
// activeTab.value = name;
console.log('切换tab', activeTab.value);
searchForm.value.landStatus = Number(activeTab.value);
getData();
};
@ -180,7 +184,7 @@ const columns = ref([
{ label: '土地承包经营人', prop: 'propertyName' },
{ label: '联系电话', prop: 'propertyPhone' },
{ label: '土地经营权证书编号', prop: 'landCode', width: 160 },
{ label: '是否土地流转', prop: 'isTransfer' },
{ label: '是否土地流转', prop: 'isTransfer', formatter: (row, column, cellValue) => (cellValue === 1 ? '是' : '否') },
{ label: '土地受让方', prop: 'transferName' },
{ label: '受让方联系电话', prop: 'transferPhone', width: 100 },
{ label: '流转合同', prop: 'transferContract' },
@ -190,8 +194,62 @@ const columns = ref([
// { label: '', prop: 'updateName' },
// { label: '', prop: 'updateGroup' },
{ 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 }) => {
pageData.value.currentPage = page;
pageData.value.pageSize = pageSize;
@ -218,18 +276,16 @@ import { mockData } from './landData';
import { createLand, deleteLand, editLand, fetchLandList, getLandById, approveLand } from '@/apis/landResourceManagement/landManagement';
import request from '@/utils/axios';
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;
//
await new Promise((resolve) => setTimeout(resolve, 300));
tableData.value = mockData
.filter((item) => item.status === activeTab.value)
.map((item) => ({
...item,
landTypeName: '林地',
}));
const requestData = {
...searchForm.value,
page: pageData.value.currentPage,
size: pageData.value.pageSize,
landStatus: activeTab.value,
landTypeName: '草地',
};
const response = await fetchLandList(requestData);
tableData.value = Array.isArray(response.data.records) ? response.data.records : [];
pageData.value.total = tableData.value.length;
loading.value = false;
};
@ -270,4 +326,51 @@ h1 {
font-size: 20px;
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>

View File

@ -31,7 +31,7 @@
@size-change="handleSizeChange"
>
<template #menu="scope">
<custom-table-operate :actions="crudOptions.actions" :show="false" :data="scope" />
<custom-table-operate :actions="crudOptions.actions" :data="scope" />
</template>
</avue-crud>
<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: 'propertyPhone' },
{ label: '土地经营权证书编号', prop: 'landCode', width: 160 },
{ label: '是否土地流转', prop: 'landTransfer' },
{ label: '是否土地流转', prop: 'landTransfer', formatter: (row, column, cellValue) => (cellValue === 1 ? '是' : '否') },
{ label: '土地受让方', prop: 'transferName' },
{ label: '受让方联系电话', prop: 'transferPhone', width: 100 },
{ label: '流转合同', prop: 'transferContract' },

View File

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

View File

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