Compare commits

..

3 Commits

13 changed files with 396 additions and 188 deletions

View File

@ -11,7 +11,10 @@ VITE_APP_SUB_GSS = '//localhost:9529/sub-government-screen-service/'
VITE_APP_SUB_GSR = '//localhost:9530/new-digital-agriculture-screen/' VITE_APP_SUB_GSR = '//localhost:9530/new-digital-agriculture-screen/'
# 接口 # 接口
VITE_APP_BASE_API = '/apis' VITE_APP_BASE_API = '/apis'
# VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
VITE_APP_BASE_URL = 'http://192.168.18.9:8080'
VITE_APP_UPLOAD_API = '/uploadApis' VITE_APP_UPLOAD_API = '/uploadApis'
VITE_APP_UPLOAD_URL = 'http://192.168.18.99:8080' # 阿里云接口地址
# VITE_APP_BASE_URL = 'http://47.109.205.240:8080'
# VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9300'
# 内网接口地址
VITE_APP_BASE_URL = 'http://192.168.18.9:8080'
VITE_APP_UPLOAD_URL = 'http://192.168.18.9:9300'

View File

@ -4,9 +4,14 @@ VITE_MODE = 'DEV'
VITE_APP_MIAN = 'daimp-front-main' VITE_APP_MIAN = 'daimp-front-main'
VITE_APP_MIAN_URL = 'http://localhost:9000' VITE_APP_MIAN_URL = 'http://localhost:9000'
VITE_APP_NAME = 'sub-government-affairs-service' VITE_APP_NAME = 'sub-government-affairs-service'
VITE_APP_BASE_API = '/apis' VITE_APP_BASE_API = '/apis'
# VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
VITE_APP_BASE_URL = 'http://192.168.18.9:8080'
VITE_APP_UPLOAD_API = '/uploadApis' VITE_APP_UPLOAD_API = '/uploadApis'
# 阿里云接口地址
# VITE_APP_BASE_URL = 'http://47.109.205.240:8080'
# VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9300'
# 内网接口地址
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
VITE_APP_UPLOAD_URL = 'http://192.168.18.99:9300' VITE_APP_UPLOAD_URL = 'http://192.168.18.99:9300'
# VITE_APP_UPLOAD_URL = 'http://192.168.18.14:8080'

View File

@ -0,0 +1,140 @@
<template>
<div class="area-cascader-container">
<div v-if="label" class="area-cascader-label">{{ label }}</div>
<div style="display: flex; gap: 8px" :style="{ width: width + 'px' }">
<el-cascader
v-model="selectedAreaCode"
:options="areaOptions"
:props="cascaderProps"
:placeholder="areaPlaceholder"
style="flex: 1"
clearable
/>
<el-select v-model="selectedGridName" :placeholder="gridPlaceholder" style="flex: 1" clearable :disabled="!selectedAreaCode">
<el-option v-for="item in gridOptions" :key="item.gridName" :label="item.gridName" :value="item.gridName" />
</el-select>
</div>
</div>
</template>
<script setup>
import { ref, watch, onMounted, computed } from 'vue';
import { ElCascader, ElSelect, ElOption } from 'element-plus';
import axios from 'axios';
import { useUserStore } from '@/store/modules/user';
const props = defineProps({
value: {
type: Object,
default: () => ({}),
},
label: {
type: String,
default: '所属行政区域-网格:',
},
placeholder: {
type: String,
default: '请选择区域',
},
width: {
type: [Number, String],
default: 300,
},
});
const emit = defineEmits(['update:value']);
const userStore = useUserStore();
const areaOptions = ref([]);
const gridOptions = ref([]);
const selectedAreaCode = ref('');
const selectedGridName = ref('');
//
const fetchAreaData = async () => {
try {
const res = await axios.get(`${import.meta.env.VITE_APP_BASE_API}/system/area/region?areaCode=530000`, {
headers: {
authorization: userStore.token,
},
});
areaOptions.value = res.data?.data ?? [];
} catch (err) {
console.error('区域数据加载失败', err);
}
};
//
const fetchGridList = async (regionCode) => {
if (!regionCode) return;
try {
const res = await axios.get(`${import.meta.env.VITE_APP_BASE_API}/land-resource/gridManage/page?regionCode=${regionCode}`, {
headers: {
authorization: userStore.token,
},
});
gridOptions.value = res.data?.data?.records ?? [];
} catch (err) {
console.error('网格数据加载失败', err);
}
};
//
watch(selectedAreaCode, (val) => {
selectedGridName.value = '';
fetchGridList(val);
updateValue();
});
//
watch(selectedGridName, () => {
updateValue();
});
//
watch(
() => props.value,
(val) => {
selectedAreaCode.value = val.regionCode ?? '';
selectedGridName.value = val.gridName ?? '';
},
{ immediate: true }
);
// v-model:value
const updateValue = () => {
emit('update:value', {
regionCode: selectedAreaCode.value,
gridName: selectedGridName.value,
});
};
onMounted(() => {
fetchAreaData();
});
//
const cascaderProps = computed(() => ({
label: 'areaName',
value: 'areaCode',
children: 'areaChildVOS',
emitPath: false,
expandTrigger: 'hover',
}));
</script>
<style scoped>
.area-cascader-container {
display: flex;
/* flex-direction: column; */
gap: 8px;
}
.area-cascader-label {
font-size: 14px;
color: #606266;
align-self: center;
}
</style>

View File

@ -9,12 +9,12 @@ const dictRoutes = [
redirect: '/sub-government-affairs-service/region', redirect: '/sub-government-affairs-service/region',
meta: { title: '基础信息维护', icon: 'DocumentRemove' }, meta: { title: '基础信息维护', icon: 'DocumentRemove' },
children: [ children: [
// { {
// path: '/sub-government-affairs-service/region', path: '/sub-government-affairs-service/region',
// name: 'region', name: 'region',
// component: () => import('@/views/dict/component/region/index.vue'), component: () => import('@/views/dict/component/region/index.vue'),
// meta: { title: '行政信息', icon: '' }, meta: { title: '行政信息', icon: '' },
// }, },
{ {
path: '/sub-government-affairs-service/landCassification', path: '/sub-government-affairs-service/landCassification',
name: 'landCassification', name: 'landCassification',

View File

@ -9,24 +9,24 @@ const landsRoutes = [
redirect: '/sub-government-affairs-service/plantPlan', redirect: '/sub-government-affairs-service/plantPlan',
meta: { title: '土地管理', icon: 'Grape' }, meta: { title: '土地管理', icon: 'Grape' },
children: [ children: [
// { {
// path: '/sub-government-affairs-service/landsManage', path: '/sub-government-affairs-service/landsManage',
// name: 'landsManage', name: 'landsManage',
// component: () => import('@/views/landManage/component/landsManage/index.vue'), component: () => import('@/views/landManage/component/landsManage/index.vue'),
// meta: { title: '土地信息登记', icon: '' }, meta: { title: '土地信息登记', icon: '' },
// }, },
// { {
// path: '/sub-government-affairs-service/plantPlan', path: '/sub-government-affairs-service/plantPlan',
// name: 'plantPlan', name: 'plantPlan',
// component: () => import('@/views/landManage/component/plantPlan/index.vue'), component: () => import('@/views/landManage/component/plantPlan/index.vue'),
// meta: { title: '种植计划', icon: '' }, meta: { title: '种植计划', icon: '' },
// }, },
// { {
// path: '/sub-government-affairs-service/operationRecord', path: '/sub-government-affairs-service/operationRecord',
// name: 'operationRecord', name: 'operationRecord',
// component: () => import('@/views/landManage/component/operationRecord/index.vue'), component: () => import('@/views/landManage/component/operationRecord/index.vue'),
// meta: { title: '作业记录', icon: '' }, meta: { title: '作业记录', icon: '' },
// }, },
{ {
path: '/sub-government-affairs-service/landPartol', path: '/sub-government-affairs-service/landPartol',
name: 'landPartol', name: 'landPartol',

View File

@ -31,12 +31,12 @@ export default [
name: 'member', name: 'member',
meta: { title: '新增网格员', icon: '' }, meta: { title: '新增网格员', icon: '' },
}, },
// { {
// path: '/sub-government-affairs-service/grid--management', path: '/sub-government-affairs-service/grid--management',
// component: () => import('@/views/resource/grid/GridManagement.vue'), component: () => import('@/views/resource/grid/GridManagement.vue'),
// name: 'management', name: 'management',
// meta: { title: '网格化管理', icon: '' }, meta: { title: '网格化管理', icon: '' },
// }, },
], ],
}, },
...annualplanRouters, ...annualplanRouters,

View File

@ -116,7 +116,7 @@ const state = reactive({
addBtnText: '', addBtnText: '',
addBtn: false, addBtn: false,
column: [ column: [
{ label: '计划编号', prop: 'id', width: '200px', showOverflowTooltip: true, addDisplay: false, editDisplay: false }, { label: '计划编号', prop: 'id', width: '200px', search: true, showOverflowTooltip: true, addDisplay: false, editDisplay: false },
{ {
label: '计划名称', label: '计划名称',
prop: 'planName', prop: 'planName',
@ -129,14 +129,18 @@ const state = reactive({
trigger: 'blur', trigger: 'blur',
}, },
}, },
{ label: '种植作物', prop: 'cropsName', width: '120px', search: true, editDisplay: false },
{ {
label: '种植面积(亩)', label: '种植面积',
prop: 'plantingArea', prop: 'plantingArea',
append: '亩',
rules: { rules: {
required: true, required: true,
message: '请输入', message: '请输入',
trigger: 'blur', trigger: 'blur',
}, },
// formatter: (value) => `${value} `,
formatter: (row, column, cellValue) => `${cellValue}`,
}, },
{ {
label: '种植月份', label: '种植月份',
@ -154,9 +158,10 @@ const state = reactive({
} }
}, },
}, },
formatter: (row, column, cellValue) => `${cellValue}`,
}, },
{ {
label: '生长周期(周)', label: '生长周期',
prop: 'growthCycle', prop: 'growthCycle',
width: '120px', width: '120px',
viewDisabled: true, viewDisabled: true,
@ -172,20 +177,33 @@ const state = reactive({
} }
}, },
}, },
}, formatter: (row, column, cellValue) => {
{ const unitMap = {
label: '备注', 1: '天',
prop: 'note', 2: '周',
width: '180px', 3: '月',
showOverflowTooltip: true, 4: '年',
rules: { };
required: true, const unit = unitMap[row.growthCycleUnit] || '';
message: '请输入', return `${cellValue} ${unit}`;
trigger: 'blur',
}, },
}, },
{ label: '计划进度', prop: 'planProgress', addDisplay: false, editDisplay: false }, { label: '所属行政区域', prop: 'regionName', width: '120px', search: true, searchLabelWidth: 100, addDisplay: false, editDisplay: false },
{ label: '状态', prop: 'planStatus', addDisplay: false, editDisplay: false }, { label: '所属网格', prop: 'gridName', width: '120px', search: true, addDisplay: false, editDisplay: false },
{ label: '当前进度', prop: 'currentProgress', width: '120px', addDisplay: false, editDisplay: false },
// {
// label: '',
// prop: 'note',
// width: '180px',
// showOverflowTooltip: true,
// rules: {
// required: true,
// message: '',
// trigger: 'blur',
// },
// },
// { label: '', prop: 'planProgress', addDisplay: false, editDisplay: false },
// { label: '', prop: 'planStatus', addDisplay: false, editDisplay: false },
], ],
actions: [ actions: [
{ {

View File

@ -0,0 +1,37 @@
<template>
<div class="grid-records"></div>
</template>
<script setup>
import { ref } from 'vue';
import { ElMessage } from 'element-plus';
const records = ref([
{
createTime: '2025-05-26 09:58:29',
createUser: '1',
updateTime: '2025-05-26T10:02:02.000+08:00',
updateUser: '1',
tenantId: 0,
id: '1926820200675004417', //
year: null,
regionCode: null, //
cropsId: null, // id
gridId: null, // id
planName: '大兴乡2025水稻种植计划', //
plantingArea: 120, //
plantingAreaActual: 335, //
plantingMonths: '1', //
growthCycle: '20', //
growthCycleUnit: '1', // 1 2 3 4
note: '暂无备注', //
deleteFlag: '0', // 0 1
cropsName: '', //
gridName: null, //
regionName: null, //
currentProgress: 279.17, //
actualFlag: '1', // 0: 1
},
]);
</script>
<style scoped></style>

View File

@ -120,44 +120,27 @@ const option = reactive({
menuWidth: 120, menuWidth: 120,
selection: false, selection: false,
column: [ column: [
// {
// hide: true,
// label: '',
// prop: 'landType',
// search: true,
// type: 'cascader',
// dicData: landTreeDic,
// clearable: false,
// value: [],
// addDisplay: false,
// display: false,
// editDisplay: false,
// },
{ {
hide: true, label: '地块名称',
label: '用地分类',
prop: 'landType',
search: true,
type: 'cascader',
dicData: landTreeDic,
clearable: false,
value: [],
addDisplay: false,
display: false,
editDisplay: false,
},
{
label: '地块名',
prop: 'landName', prop: 'landName',
search: true,
addDisplay: false, addDisplay: false,
display: false, display: false,
editDisplay: false, editDisplay: false,
width: 200, width: 200,
}, },
{
label: '地址',
prop: 'address',
addDisplay: false,
display: false,
editDisplay: false,
width: 300,
},
{
label: '产权人',
prop: 'owner',
search: true,
addDisplay: false,
display: false,
editDisplay: false,
},
{ {
label: '所属网格', label: '所属网格',
prop: 'gridName', prop: 'gridName',
@ -167,16 +150,6 @@ const option = reactive({
display: false, display: false,
editDisplay: false, editDisplay: false,
}, },
{
label: '农用地分类',
prop: 'landClassificationType',
select: 'select',
dicData: landTreeDic,
addDisplay: false,
display: false,
editDisplay: false,
width: 300,
},
{ {
label: '面积', label: '面积',
prop: 'area', prop: 'area',
@ -192,20 +165,39 @@ const option = reactive({
}, },
}, },
{ {
label: '坐标', label: '土地类型',
prop: 'coordinate', prop: 'landTypeName',
search: true,
addDisplay: false,
},
{
label: '所属行政区域',
prop: 'regionName',
search: true,
addDisplay: false,
},
{
label: '具体位置',
prop: 'address',
addDisplay: false, addDisplay: false,
display: false, display: false,
editDisplay: false, editDisplay: false,
width: 300, width: 300,
}, },
{ {
label: '是否流转土地', label: '产权人姓名',
prop: 'landTransfer', prop: 'owner',
addDisplay: false, addDisplay: false,
display: false, display: false,
editDisplay: false, editDisplay: false,
width: 140, },
{
label: '产权人联系方式',
prop: 'ownerPhone',
addDisplay: false,
display: false,
editDisplay: false,
width: 300,
}, },
{ {
label: '产权编号', label: '产权编号',
@ -215,18 +207,10 @@ const option = reactive({
editDisplay: false, editDisplay: false,
}, },
{ {
label: '土壤类型', label: '信息录入时间',
prop: 'soilTypeName', prop: 'createTime',
addDisplay: false,
editDisplay: false,
},
{
label: '是否上传附件',
prop: 'isUpload',
addDisplay: false, addDisplay: false,
display: false, display: false,
editDisplay: false,
width: 140,
}, },
], ],
group: [ group: [

View File

@ -0,0 +1,7 @@
<script setup></script>
<template>
<div>123</div>
</template>
<style scoped></style>

View File

@ -18,6 +18,10 @@
@row-update="rowUpdate" @row-update="rowUpdate"
@row-del="rowDel" @row-del="rowDel"
> >
<template #search="{ size }">
<AreaCascader v-model:value="state.query" placeholder="选择行政区域与网格" :width="400" />
</template>
<template #menu-left> <template #menu-left>
<el-button type="success" icon="download" @click="onExport">导出</el-button> <el-button type="success" icon="download" @click="onExport">导出</el-button>
</template> </template>
@ -25,6 +29,23 @@
<template #menu="scope"> <template #menu="scope">
<custom-table-operate :actions="state.options.actions" :data="scope" /> <custom-table-operate :actions="state.options.actions" :data="scope" />
</template> </template>
<template #detail="scope">
<el-tabs type="border-card">
<el-tab-pane label="基本信息">
<avue-detail :option="baseDetailOption" :data="scope.row"></avue-detail>
</el-tab-pane>
<el-tab-pane label="网格地图">
<div v-if="scope.row.mapUrl" style="height: 400px">
<img :src="scope.row.mapUrl" style="max-width: 100%; max-height: 100%" />
</div>
<el-empty v-else description="暂无地图数据"></el-empty>
</el-tab-pane>
<el-tab-pane label="其他信息">
<avue-detail :option="otherDetailOption" :data="scope.row"></avue-detail>
</el-tab-pane>
</el-tabs>
</template>
</avue-crud> </avue-crud>
</div> </div>
</template> </template>
@ -46,31 +67,20 @@ const state = reactive({
query: { query: {
current: 1, current: 1,
size: 10, size: 10,
gridName: '',
regionCode: '',
}, },
form: {}, form: {},
selection: [], selection: [],
options: { options: {
...CRUD_OPTIONS, ...CRUD_OPTIONS,
// addBtnText: '', addBtnText: '添加网格',
// detail: true,
// detailTitle: '',
column: [ column: [
// {
// label: '',
// prop: 'gridArea',
// search: true,
// width: 200,
// addDisplay: false,
// editDisplay: false,
// viewDisplay: true,
// rules: {
// required: true,
// message: '',
// trigger: 'blur',
// },
// },
{ {
label: '网格名称', label: '网格名称',
prop: 'gridName', prop: 'gridName',
search: true,
rules: { rules: {
required: true, required: true,
message: '请输入', message: '请输入',
@ -78,10 +88,10 @@ const state = reactive({
}, },
}, },
{ {
label: '网格区域', label: '所属行政区域',
prop: 'gridAreaName', prop: 'gridAreaName',
// width: 300, addDisplay: false,
display: false, viewDisplay: true,
rules: { rules: {
required: true, required: true,
message: '请输入', message: '请输入',
@ -89,18 +99,16 @@ const state = reactive({
}, },
}, },
{ {
label: '网格区域', label: '所属行政区域',
prop: 'cities', prop: 'cities',
type: 'cascader', type: 'cascader',
hide: true, hide: true,
span: 24,
width: 300,
addDisplay: true, addDisplay: true,
editDisplay: true, editDisplay: true,
viewDisplay: false, viewDisplay: false,
// multiple: true, emitPath: false,
// checkStrictly: true,
// collapseTags: true,
// emitPath: false,
// checkDescendants: false,
props: { props: {
label: 'areaName', label: 'areaName',
value: 'areaCode', value: 'areaCode',
@ -117,54 +125,31 @@ const state = reactive({
trigger: 'blur', trigger: 'blur',
}, },
}, },
{
label: '网格地图',
prop: 'mapUrl',
type: 'upload',
hide: true,
// action: `${VITE_APP_BASE_API}/system/file/upload`,
},
// { // {
// label: '', // label: '',
// prop: 'gridManager', // prop: 'gridName',
// rules: { // type: 'select',
// required: true, // addDisplay: false,
// message: '', // hide: true,
// trigger: 'blur', // // search: true,
// searchLabelWidth: 100,
// dicUrl: `${VITE_APP_BASE_API}/land-resource/gridManage/page?regionCode={{key}}`,
// props: {
// label: 'gridName',
// value: 'gridName',
// }, // },
// dicHeaders: {
// authorization: UserStore.token,
// }, // },
// { // dicFormatter: (res) => res.data?.records,
// label: '',
// prop: 'contactInfo',
// rules: {
// required: true,
// message: '',
// trigger: 'blur',
// }, // },
// },
{
label: '省',
prop: 'provinceCode',
hide: true,
display: false,
},
{
label: '市',
prop: 'cityCode',
hide: true,
display: false,
},
{
label: '县/区',
prop: 'gridAreaCode',
hide: true,
display: false,
},
{
label: '乡镇',
prop: 'townCode',
hide: true,
display: false,
},
{
label: '乡镇',
prop: 'village',
hide: true,
display: false,
},
{ {
label: '备注', label: '备注',
prop: 'note', prop: 'note',
@ -209,6 +194,32 @@ const state = reactive({
data: [], data: [],
currentRow: {}, currentRow: {},
}); });
const baseDetailOption = {
column: [
{
label: '网格名称',
prop: 'gridName',
},
{
label: '所属行政区域',
prop: 'gridAreaName',
},
{
label: '备注',
prop: 'note',
},
],
};
const otherDetailOption = {
column: [
{
label: '创建时间',
prop: 'createTime',
},
// ...
],
};
// //
const loadData = () => { const loadData = () => {

View File

@ -82,7 +82,7 @@ const state = reactive({
type: 'select', type: 'select',
width: 200, width: 200,
search: true, search: true,
dicData: [], // mounted dicData: [], // loadGridOptions
props: { props: {
label: 'gridName', label: 'gridName',
value: 'id', value: 'id',
@ -93,17 +93,17 @@ const state = reactive({
trigger: 'change', trigger: 'change',
}, },
}, },
{ // {
label: '管理员标识', // label: '',
prop: 'adminFlag', // prop: 'adminFlag',
type: 'radio', // type: 'radio',
dicData: [ // dicData: [
{ label: '是', value: '1' }, // { label: '', value: '1' },
{ label: '否', value: '0' }, // { label: '', value: '0' },
], // ],
valueDefault: '0', // valueDefault: '0',
hide: true, // false // hide: true, // false
}, // },
{ {
label: '电话号码', label: '电话号码',
prop: 'phone', prop: 'phone',

View File

@ -0,0 +1,3 @@
<template>计划</template>
<script></script>
<style></style>