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_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_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_URL = 'http://localhost:9000'
VITE_APP_NAME = 'sub-government-affairs-service'
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_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.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',
meta: { title: '基础信息维护', icon: 'DocumentRemove' },
children: [
// {
// path: '/sub-government-affairs-service/region',
// name: 'region',
// component: () => import('@/views/dict/component/region/index.vue'),
// meta: { title: '行政信息', icon: '' },
// },
{
path: '/sub-government-affairs-service/region',
name: 'region',
component: () => import('@/views/dict/component/region/index.vue'),
meta: { title: '行政信息', icon: '' },
},
{
path: '/sub-government-affairs-service/landCassification',
name: 'landCassification',

View File

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

View File

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

View File

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

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,
selection: false,
column: [
// {
// hide: true,
// label: '',
// prop: 'landType',
// search: true,
// type: 'cascader',
// dicData: landTreeDic,
// clearable: false,
// value: [],
// addDisplay: false,
// display: false,
// editDisplay: false,
// },
{
hide: true,
label: '用地分类',
prop: 'landType',
search: true,
type: 'cascader',
dicData: landTreeDic,
clearable: false,
value: [],
addDisplay: false,
display: false,
editDisplay: false,
},
{
label: '地块名',
label: '地块名称',
prop: 'landName',
search: true,
addDisplay: false,
display: false,
editDisplay: false,
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: '所属网格',
prop: 'gridName',
@ -167,16 +150,6 @@ const option = reactive({
display: false,
editDisplay: false,
},
{
label: '农用地分类',
prop: 'landClassificationType',
select: 'select',
dicData: landTreeDic,
addDisplay: false,
display: false,
editDisplay: false,
width: 300,
},
{
label: '面积',
prop: 'area',
@ -192,20 +165,39 @@ const option = reactive({
},
},
{
label: '坐标',
prop: 'coordinate',
label: '土地类型',
prop: 'landTypeName',
search: true,
addDisplay: false,
},
{
label: '所属行政区域',
prop: 'regionName',
search: true,
addDisplay: false,
},
{
label: '具体位置',
prop: 'address',
addDisplay: false,
display: false,
editDisplay: false,
width: 300,
},
{
label: '是否流转土地',
prop: 'landTransfer',
label: '产权人姓名',
prop: 'owner',
addDisplay: false,
display: false,
editDisplay: false,
width: 140,
},
{
label: '产权人联系方式',
prop: 'ownerPhone',
addDisplay: false,
display: false,
editDisplay: false,
width: 300,
},
{
label: '产权编号',
@ -215,18 +207,10 @@ const option = reactive({
editDisplay: false,
},
{
label: '土壤类型',
prop: 'soilTypeName',
addDisplay: false,
editDisplay: false,
},
{
label: '是否上传附件',
prop: 'isUpload',
label: '信息录入时间',
prop: 'createTime',
addDisplay: false,
display: false,
editDisplay: false,
width: 140,
},
],
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-del="rowDel"
>
<template #search="{ size }">
<AreaCascader v-model:value="state.query" placeholder="选择行政区域与网格" :width="400" />
</template>
<template #menu-left>
<el-button type="success" icon="download" @click="onExport">导出</el-button>
</template>
@ -25,6 +29,23 @@
<template #menu="scope">
<custom-table-operate :actions="state.options.actions" :data="scope" />
</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>
</div>
</template>
@ -46,31 +67,20 @@ const state = reactive({
query: {
current: 1,
size: 10,
gridName: '',
regionCode: '',
},
form: {},
selection: [],
options: {
...CRUD_OPTIONS,
// addBtnText: '',
addBtnText: '添加网格',
// detail: true,
// detailTitle: '',
column: [
// {
// label: '',
// prop: 'gridArea',
// search: true,
// width: 200,
// addDisplay: false,
// editDisplay: false,
// viewDisplay: true,
// rules: {
// required: true,
// message: '',
// trigger: 'blur',
// },
// },
{
label: '网格名称',
prop: 'gridName',
search: true,
rules: {
required: true,
message: '请输入',
@ -78,10 +88,10 @@ const state = reactive({
},
},
{
label: '网格区域',
label: '所属行政区域',
prop: 'gridAreaName',
// width: 300,
display: false,
addDisplay: false,
viewDisplay: true,
rules: {
required: true,
message: '请输入',
@ -89,18 +99,16 @@ const state = reactive({
},
},
{
label: '网格区域',
label: '所属行政区域',
prop: 'cities',
type: 'cascader',
hide: true,
span: 24,
width: 300,
addDisplay: true,
editDisplay: true,
viewDisplay: false,
// multiple: true,
// checkStrictly: true,
// collapseTags: true,
// emitPath: false,
// checkDescendants: false,
emitPath: false,
props: {
label: 'areaName',
value: 'areaCode',
@ -117,54 +125,31 @@ const state = reactive({
trigger: 'blur',
},
},
{
label: '网格地图',
prop: 'mapUrl',
type: 'upload',
hide: true,
// action: `${VITE_APP_BASE_API}/system/file/upload`,
},
// {
// label: '',
// prop: 'gridManager',
// rules: {
// required: true,
// message: '',
// trigger: 'blur',
// label: '',
// prop: 'gridName',
// type: 'select',
// addDisplay: false,
// hide: true,
// // search: true,
// searchLabelWidth: 100,
// dicUrl: `${VITE_APP_BASE_API}/land-resource/gridManage/page?regionCode={{key}}`,
// props: {
// label: 'gridName',
// value: 'gridName',
// },
// dicHeaders: {
// authorization: UserStore.token,
// },
// {
// label: '',
// prop: 'contactInfo',
// rules: {
// required: true,
// message: '',
// trigger: 'blur',
// dicFormatter: (res) => res.data?.records,
// },
// },
{
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: '备注',
prop: 'note',
@ -209,6 +194,32 @@ const state = reactive({
data: [],
currentRow: {},
});
const baseDetailOption = {
column: [
{
label: '网格名称',
prop: 'gridName',
},
{
label: '所属行政区域',
prop: 'gridAreaName',
},
{
label: '备注',
prop: 'note',
},
],
};
const otherDetailOption = {
column: [
{
label: '创建时间',
prop: 'createTime',
},
// ...
],
};
//
const loadData = () => {

View File

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

View File

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