Merge branch 'dev' of http://47.109.205.240:3000/Web/daimp-front into dev
This commit is contained in:
commit
9d6493008c
@ -13,9 +13,9 @@ VITE_APP_SUB_GSR = '//localhost:9530/new-digital-agriculture-screen/'
|
||||
VITE_APP_BASE_API = '/apis'
|
||||
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://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_BASE_URL = 'http://192.168.18.99:8080'
|
||||
# VITE_APP_UPLOAD_URL = 'http://192.168.18.99:8080'
|
||||
# VITE_APP_VIST_URL = 'http://192.168.18.99'
|
||||
|
@ -12,7 +12,6 @@ declare module 'vue' {
|
||||
'CenterMap copy': typeof import('./src/components/centerMap copy.vue')['default']
|
||||
CodeDialog: typeof import('./src/components/code-dialog/index.vue')['default']
|
||||
Components: typeof import('./src/components/index.js')['default']
|
||||
copy: typeof import('./src/components/centerMap copy.vue')['default']
|
||||
CurrentTime: typeof import('./src/components/currentTime.vue')['default']
|
||||
CustomBack: typeof import('./src/components/customBack.vue')['default']
|
||||
CustomCarouselPicture: typeof import('./src/components/custom-carousel-picture/index.vue')['default']
|
||||
|
@ -9,11 +9,12 @@ VITE_APP_BASE_API = '/apis'
|
||||
VITE_APP_UPLOAD_API = '/uploadApis'
|
||||
|
||||
# 阿里云接口地址
|
||||
# VITE_APP_BASE_URL = 'http://47.109.205.240:8080'
|
||||
# VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9204'
|
||||
VITE_APP_BASE_URL = 'http://47.109.205.240:8080'
|
||||
VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9204'
|
||||
|
||||
# 内网测试库接口地址
|
||||
# VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
|
||||
# VITE_APP_UPLOAD_URL = 'http://192.168.18.99:8080'
|
||||
|
||||
# 本地开发接口地址
|
||||
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
|
||||
|
@ -50,6 +50,7 @@ module.exports = {
|
||||
defineEmits: 'readonly',
|
||||
defineExpose: 'readonly',
|
||||
withDefaults: 'readonly',
|
||||
T: 'readonly',
|
||||
},
|
||||
// 这里时配置规则的,自己看情况配置
|
||||
rules: {
|
||||
|
@ -34,7 +34,8 @@
|
||||
"screenfull": "^6.0.2",
|
||||
"splitpanes": "^4.0.3",
|
||||
"vue": "^3.3.11",
|
||||
"vue-router": "^4.2.5"
|
||||
"vue-router": "^4.2.5",
|
||||
"vue-tianditu": "^2.7.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.7",
|
||||
|
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/axios';
|
||||
//新增备案信息(POST)
|
||||
export function createRecord(data) {
|
||||
return request({
|
||||
url: '/inputGoods/cropPlantRegistration/save',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
// 删除备案信息(DELETE)
|
||||
export function deleteRecord(id) {
|
||||
return request({
|
||||
url: `/inputGoods/cropPlantRegistration/delete/${id}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
// 修改备案信息(PUT)
|
||||
export function updateRecord(data) {
|
||||
return request({
|
||||
url: `/inputGoods/cropPlantRegistration/uploadReport`,
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
// 查询备案信息(GET)
|
||||
export function getRecord(id) {
|
||||
return request({
|
||||
url: `/inputGoods/cropPlantRegistration/get/${id}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
// 查询备案信息列表(GET)
|
||||
export function fetchRecordList(params) {
|
||||
return request({
|
||||
url: '/inputGoods/cropPlantRegistration/page',
|
||||
method: 'get',
|
||||
params: params,
|
||||
});
|
||||
}
|
||||
// 备案审核(PUT)
|
||||
export function auditRecord(data) {
|
||||
return request({
|
||||
url: `/inputGoods/cropPlantRegistration/approval`,
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
@ -98,7 +98,14 @@ async function fetchGridList(regionCode) {
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(fetchAreaData);
|
||||
onMounted(async () => {
|
||||
await fetchAreaData();
|
||||
|
||||
// 初始化时如果有区域编码,加载对应网格
|
||||
if (props.regionCode) {
|
||||
await fetchGridList(props.regionCode);
|
||||
}
|
||||
});
|
||||
|
||||
// 样式计算
|
||||
const containerStyle = computed(() => ({
|
||||
|
55
sub-government-affairs-service/src/config/map.js
Normal file
55
sub-government-affairs-service/src/config/map.js
Normal file
@ -0,0 +1,55 @@
|
||||
export const map_config = {
|
||||
tianditu: {
|
||||
version: '4.0',
|
||||
token: '5e3204b9312c1d2618049d90a4ae917c',
|
||||
center: [100.088, 23.883],
|
||||
zoom: 13,
|
||||
},
|
||||
|
||||
baseMaps: [
|
||||
{
|
||||
label: 'OSM街道图',
|
||||
Url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
},
|
||||
{
|
||||
label: 'ArcGIS影像图',
|
||||
Url: 'https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
|
||||
},
|
||||
{
|
||||
label: 'ArcGIS街道图',
|
||||
Url: 'http://cache1.arcgisonline.cn/arcgis/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}',
|
||||
},
|
||||
{
|
||||
label: '天地图街道图',
|
||||
Url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=7786923a385369346d56b966bb6ad62f',
|
||||
},
|
||||
{
|
||||
label: '天地图影像图',
|
||||
Url: 'http://t{s}.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=7786923a385369346d56b966bb6ad62f',
|
||||
},
|
||||
{
|
||||
label: '谷歌街道图',
|
||||
Url: 'http://www.google.cn/maps/vt?lyrs=m@189&gl=cn&x={x}&y={y}&z={z}',
|
||||
},
|
||||
{
|
||||
label: '谷歌影像图',
|
||||
Url: 'http://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}',
|
||||
},
|
||||
{
|
||||
label: '高德街道图',
|
||||
Url: 'http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
|
||||
},
|
||||
{
|
||||
label: '高德影像图',
|
||||
Url: 'http://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
|
||||
},
|
||||
{
|
||||
label: '百度街道图',
|
||||
Url: 'http://online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&scaler=1&p=1',
|
||||
},
|
||||
{
|
||||
label: '百度影像图',
|
||||
Url: 'http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46',
|
||||
},
|
||||
],
|
||||
};
|
@ -14,9 +14,14 @@ import { registerGlobalComponents } from './plugins/globalComponents';
|
||||
import { registerElIcons } from './plugins/icon';
|
||||
import { registerMicroApps } from './plugins/micro';
|
||||
import { registerSplitpanes } from './plugins/splitpanes';
|
||||
import VueTianditu from 'vue-tianditu';
|
||||
import { map_config } from './config/map';
|
||||
|
||||
const app = createApp(App);
|
||||
app.use(pinia).use(router).use(ElementPlus).use(Avue);
|
||||
app.use(pinia).use(router).use(ElementPlus).use(Avue).use(VueTianditu, {
|
||||
v: map_config.tianditu.version,
|
||||
tk: map_config.tianditu.token,
|
||||
});
|
||||
registerGlobalComponents(app);
|
||||
registerElIcons(app);
|
||||
registerSplitpanes(app);
|
||||
|
@ -9,7 +9,6 @@ const inputSuppliesRoutes = [
|
||||
redirect: '/sub-government-affairs-service/material/pesticide',
|
||||
meta: { title: '农产品种植管理', icon: 'FullScreen' },
|
||||
children: [
|
||||
// 使用监管概况统计图表
|
||||
{
|
||||
path: '/sub-government-affairs-service/statistics',
|
||||
name: 'Statistics',
|
||||
@ -26,7 +25,7 @@ const inputSuppliesRoutes = [
|
||||
path: '/sub-government-affairs-service/material/annualPlans',
|
||||
name: 'annualPlans',
|
||||
component: () => import('@/views/inputSuppliesManage/material/annualPlan/index.vue'),
|
||||
meta: { title: '农产品种植进度管理', icon: 'Timer' },
|
||||
meta: { title: '农产品种植计划管理', icon: 'Timer' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/material/seed',
|
||||
|
@ -1,113 +0,0 @@
|
||||
<template>
|
||||
<el-dialog :v-model="visible" :title="dialogTitle" width="600px" destroy-on-close :close-on-click-modal="false">
|
||||
<el-form ref="formRef" :model="formModel" :rules="rules" :disabled="isView" label-width="100px">
|
||||
<el-form-item label="地块名称" prop="name">
|
||||
<el-input v-model="formModel.name" placeholder="请输入地块名称" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="所属区域" prop="areaCode">
|
||||
<AreaSelect v-model="formModel.areaCode" :emit-path="false" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="面积(亩)" prop="area">
|
||||
<el-input-number v-model="formModel.area" :min="0" placeholder="请输入面积" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="图像文件" prop="image">
|
||||
<FileUploader v-model="formModel.image" :limit="1" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formModel.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="close">取消</el-button>
|
||||
<el-button v-if="!isView" type="primary" :loading="submitting" @click="submit">保存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, computed } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
initialData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'create', // 'create' | 'edit' | 'view'
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: '', // 地块类型:grass / forest / field
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:visible', 'submit']);
|
||||
|
||||
const formRef = ref(null);
|
||||
const formModel = ref({});
|
||||
const submitting = ref(false);
|
||||
|
||||
const isView = computed(() => props.mode === 'view');
|
||||
const dialogTitle = computed(() => {
|
||||
switch (props.mode) {
|
||||
case 'create':
|
||||
return '新增地块';
|
||||
case 'edit':
|
||||
return '编辑地块';
|
||||
case 'view':
|
||||
return '查看地块';
|
||||
default:
|
||||
return '地块信息';
|
||||
}
|
||||
});
|
||||
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||
areaCode: [{ required: true, message: '请选择区域', trigger: 'change' }],
|
||||
area: [{ required: true, message: '请输入面积', trigger: 'blur' }],
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(val) => {
|
||||
if (val) {
|
||||
formModel.value = { ...props.initialData };
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function close() {
|
||||
emit('update:visible', false);
|
||||
}
|
||||
|
||||
async function submit() {
|
||||
if (!formRef.value) return;
|
||||
try {
|
||||
await formRef.value.validate();
|
||||
submitting.value = true;
|
||||
emit('submit', { ...formModel.value });
|
||||
} catch (err) {
|
||||
console.warn('表单校验失败', err);
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<el-form ref="formRef" :model="localFormModel" :rules="rules" :disabled="disabled" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地块编号" prop="id">
|
||||
<el-input v-model="localFormModel.id" placeholder="请输入地块编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="面积(亩)" prop="area">
|
||||
<el-input-number v-model="localFormModel.area" :min="0" placeholder="请输入面积" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属行政区域" prop="areaCode">
|
||||
<AreaSelect v-model="localFormModel.areaCode" :emit-path="false" label="" />
|
||||
</el-form-item>
|
||||
<el-form-item label="经营主体编码" prop="businessSubjectCode">
|
||||
<el-input v-model="localFormModel.businessSubjectCode" placeholder="请输入经营主体编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="种植开始时间" prop="plantingStartTime">
|
||||
<el-date-picker v-model="localFormModel.plantingStartTime" type="date" placeholder="请选择种植开始时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="账号(手机号)" prop="account">
|
||||
<el-input v-model="localFormModel.account" placeholder="请输入账号(手机号)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="信息审核时间" prop="auditTime">
|
||||
<el-date-picker v-model="localFormModel.auditTime" type="date" placeholder="请选择信息审核时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地块名称" prop="landName">
|
||||
<el-input v-model="localFormModel.landName" placeholder="请输入地块名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="具体位置" prop="address">
|
||||
<el-input v-model="localFormModel.address" placeholder="请输入具体位置" />
|
||||
</el-form-item>
|
||||
<el-form-item label="种植作物" prop="CropName">
|
||||
<el-input v-model="localFormModel.CropName" placeholder="请输入种植作物" />
|
||||
</el-form-item>
|
||||
<el-form-item label="作物品种" prop="CropVarietyName">
|
||||
<el-input v-model="localFormModel.CropVarietyName" placeholder="请输入作物品种" />
|
||||
</el-form-item>
|
||||
<el-form-item label="种植结束时间" prop="plantingEndTime">
|
||||
<el-date-picker v-model="localFormModel.plantingEndTime" type="date" placeholder="请选择种植结束时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="经营主体名称" prop="businessSubjectName">
|
||||
<el-input v-model="localFormModel.businessSubjectName" placeholder="请输入经营主体名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="信息填报时间" prop="fillTime">
|
||||
<el-date-picker v-model="localFormModel.fillTime" type="date" placeholder="请选择信息填报时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
const localFormModel = ref({ ...props.modelValue });
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
if (val) {
|
||||
localFormModel.value = { ...val };
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
localFormModel,
|
||||
(val) => {
|
||||
emit('update:modelValue', val);
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
const rules = {
|
||||
// id: [{ required: true, message: '地块编号不能为空', trigger: 'blur' }],
|
||||
// area: [{ type: 'number', min: 0, message: '面积必须大于等于0', trigger: 'change' }],
|
||||
};
|
||||
</script>
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="land-page">
|
||||
<div class="custom-body">
|
||||
<SearchBar v-model:search="searchForm" @search="handleSearch" @reset="handleReset" />
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
|
||||
<!-- <el-tab-pane label="待提交" name="-1" /> -->
|
||||
@ -17,26 +17,38 @@
|
||||
@size-change="handleSizeChange"
|
||||
>
|
||||
<template #menu="scope">
|
||||
<custom-table-operate :actions="crudOptions.actions" :data="scope" />
|
||||
<custom-table-operate :actions="getActions(scope.row)" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
<el-dialog v-model="visible" title="查看" width="60%" align-center :draggable="true">
|
||||
<RecordForm ref="formRef" v-model="formData" :disabled="mode === 'view'" />
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button v-if="mode !== 'view'" type="primary" @click="handleSubmit">提交</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, watch } from 'vue';
|
||||
import { ref, reactive, computed, watch, onMounted } from 'vue';
|
||||
import SearchBar from './SearchBar.vue';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import FormDialog from './FormDialog.vue';
|
||||
import RecordForm from './RecordForm.vue';
|
||||
|
||||
const loading = ref(false);
|
||||
const visible = ref(false);
|
||||
|
||||
const searchForm = ref({});
|
||||
const searchForm = ref({
|
||||
status: 1,
|
||||
keyword: '',
|
||||
regionCode: '',
|
||||
gridId: '',
|
||||
landTypeId: '',
|
||||
});
|
||||
|
||||
const activeTab = ref('1');
|
||||
const handleTabChange = ({ name }) => {
|
||||
// searchForm.value.landStatus = Number(activeTab.value);
|
||||
getData();
|
||||
};
|
||||
|
||||
@ -49,32 +61,77 @@ const crudData = ref([]);
|
||||
const crudOptions = reactive({
|
||||
...CRUD_OPTIONS,
|
||||
header: false,
|
||||
height: 'calc(100vh - 360px)',
|
||||
height: 'calc(100vh - 330px)',
|
||||
column: [
|
||||
{ label: '地块编号', prop: 'id', width: 160 },
|
||||
{ label: '地块编号', prop: 'landNumber', width: 160 },
|
||||
{ label: '地块名称', prop: 'landName', width: 170 },
|
||||
{ label: '面积', prop: 'area', formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩` },
|
||||
{ label: '所属行政区域', prop: 'fullRegionName', width: 160 },
|
||||
{ label: '所属网格', prop: 'gridName', width: 90 },
|
||||
{ label: '面积', prop: 'planArea', formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩` },
|
||||
{ label: '所属行政区域', prop: 'belongRegion', width: 160 },
|
||||
{ label: '所属网格', prop: 'belongGrid', width: 90 },
|
||||
{ label: '具体位置', prop: 'address', width: 160 },
|
||||
{ label: '种植作物', prop: 'CropName' },
|
||||
{ label: '作物品种', prop: 'CropVarietyName' },
|
||||
{ label: '种植开始时间', prop: 'plantingStartTime' },
|
||||
{ label: '种植结束时间', prop: 'plantingEndTime' },
|
||||
{ label: '经营主体名称', prop: 'businessSubjectName', width: 130 },
|
||||
{ label: '账号(手机号)', prop: ' account', width: 130 },
|
||||
{ label: '基地名称', prop: 'baseName' },
|
||||
{ label: '种植批次编码', prop: 'batchCode' },
|
||||
{ label: '种植批次名称', prop: 'batchName' },
|
||||
{ label: '种植作物', prop: 'crop' },
|
||||
{ label: '作物品种', prop: 'cropBrand' },
|
||||
{ label: '种植开始时间', prop: 'startDate' },
|
||||
{ label: '种植结束时间', prop: 'endDate' },
|
||||
{ label: '经营主体代码', prop: 'businessEntityCode', width: 130 },
|
||||
{ label: '经营主体类型', prop: 'businessEntityType', width: 130 },
|
||||
{ label: '经营主体名称', prop: 'businessEntityName', width: 130 },
|
||||
{ label: '账号(手机号)', prop: 'account', width: 130 },
|
||||
{ label: '信息填报时间', prop: 'fillTime', width: 110 },
|
||||
{ label: '信息审核时间', prop: 'auditTime', width: 110 },
|
||||
{ label: '信息审核时间', prop: 'approvalTime', width: 110 },
|
||||
],
|
||||
});
|
||||
const handleCurrentChange = (val) => {
|
||||
pagination.value.currentPage = val;
|
||||
};
|
||||
const handleSizeChange = (val) => {
|
||||
pagination.value.pageSize = val;
|
||||
};
|
||||
|
||||
const getActions = (row) => {
|
||||
return [{ name: '查看', icon: 'view', event: () => handleView(row) }];
|
||||
};
|
||||
const formRef = ref();
|
||||
const formData = ref({}); // 初始数据
|
||||
const mode = ref('view'); // 或 'edit' / 'create'
|
||||
const handleView = (row) => {
|
||||
formData.value = { ...row };
|
||||
mode.value = 'view';
|
||||
visible.value = true;
|
||||
};
|
||||
const handleSearch = () => {};
|
||||
const handleReset = () => {
|
||||
getData();
|
||||
};
|
||||
|
||||
const getData = () => {
|
||||
import { mockData } from '../mockData';
|
||||
import { createRecord, deleteRecord, updateRecord, getRecord, fetchRecordList } from '@/apis/inputSuppliesApi/record';
|
||||
const getData = async () => {
|
||||
loading.value = true;
|
||||
searchForm.value.status = Number(activeTab.value);
|
||||
// 调用接口获取数据
|
||||
// 处理数据
|
||||
// 更新 list 和 total
|
||||
const response = await fetchRecordList(searchForm.value);
|
||||
crudData.value = response.data.records;
|
||||
pagination.value.total = response.data.total;
|
||||
loading.value = false;
|
||||
// setTimeout(() => {
|
||||
// crudData.value = mockData.filter((item) => item.landStatus === Number(activeTab.value));
|
||||
// pagination.value.total = crudData.value.length;
|
||||
// loading.value = false;
|
||||
// }, 200);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
:deep(.el-dialog__body) {
|
||||
padding: 20px;
|
||||
height: calc(100vh - 300px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -5,9 +5,9 @@
|
||||
<el-input v-model="search.keyword" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="" label-width="0px">
|
||||
<AreaCascader v-model:region-code="search.regionCode" v-model:grid-id="search.id" />
|
||||
<AreaCascader v-model:region-code="search.regionCode" v-model:grid-id="search.gridId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="种植作物" prop="planCrop">
|
||||
<!-- <el-form-item label="种植作物" prop="planCrop">
|
||||
<url-select
|
||||
v-model="search.planCrop"
|
||||
url="/land-resource/crops/page"
|
||||
@ -17,7 +17,7 @@
|
||||
placeholder="请选择种植作物"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSearch">搜索</el-button>
|
||||
@ -61,9 +61,3 @@ const onReset = () => {
|
||||
emit('reset');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.custom-page-search {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
</style>
|
||||
|
@ -0,0 +1,87 @@
|
||||
export const mockData = [
|
||||
{
|
||||
id: 'LD20230001',
|
||||
landName: '阳光农场1号地',
|
||||
area: 120.5,
|
||||
fullRegionName: '浙江省杭州市余杭区',
|
||||
gridName: '网格A',
|
||||
address: '余杭区五常街道阳光路1号',
|
||||
CropName: '水稻',
|
||||
CropVarietyName: '超级稻',
|
||||
plantingStartTime: '2023-04-10',
|
||||
plantingEndTime: '2023-09-20',
|
||||
businessSubjectName: '杭州阳光农业有限公司',
|
||||
account: '13800138001',
|
||||
fillTime: '2023-04-05 10:30',
|
||||
auditTime: '', // 待审核状态没有审核时间
|
||||
landStatus: 0, // 0=待审核
|
||||
},
|
||||
{
|
||||
id: 'LD20230002',
|
||||
landName: '绿洲农场2号地',
|
||||
area: 85.2,
|
||||
fullRegionName: '浙江省杭州市西湖区',
|
||||
gridName: '网格B',
|
||||
address: '西湖区转塘街道绿洲路2号',
|
||||
CropName: '小麦',
|
||||
CropVarietyName: '冬小麦',
|
||||
plantingStartTime: '2023-03-15',
|
||||
plantingEndTime: '2023-07-25',
|
||||
businessSubjectName: '杭州绿洲农业合作社',
|
||||
account: '13900139002',
|
||||
fillTime: '2023-03-10 14:20',
|
||||
auditTime: '2023-03-12 09:15', // 已通过有审核时间
|
||||
landStatus: 1, // 1=已通过
|
||||
},
|
||||
{
|
||||
id: 'LD20230003',
|
||||
landName: '丰收农场3号地',
|
||||
area: 200.0,
|
||||
fullRegionName: '浙江省杭州市萧山区',
|
||||
gridName: '网格C',
|
||||
address: '萧山区宁围街道丰收路3号',
|
||||
CropName: '玉米',
|
||||
CropVarietyName: '甜玉米',
|
||||
plantingStartTime: '2023-05-01',
|
||||
plantingEndTime: '2023-10-30',
|
||||
businessSubjectName: '萧山丰收农业有限公司',
|
||||
account: '13700137003',
|
||||
fillTime: '2023-04-28 16:45',
|
||||
auditTime: '2023-04-30 11:00', // 已驳回有审核时间
|
||||
landStatus: 2, // 2=已驳回
|
||||
},
|
||||
{
|
||||
id: 'LD20230004',
|
||||
landName: '试验田4号地',
|
||||
area: 50.8,
|
||||
fullRegionName: '浙江省杭州市滨江区',
|
||||
gridName: '网格D',
|
||||
address: '滨江区长河街道试验田路4号',
|
||||
CropName: '大豆',
|
||||
CropVarietyName: '转基因大豆',
|
||||
plantingStartTime: '2023-06-01',
|
||||
plantingEndTime: '2023-11-15',
|
||||
businessSubjectName: '滨江农业研究所',
|
||||
account: '13600136004',
|
||||
fillTime: '2023-05-25 09:10',
|
||||
auditTime: '', // 待审核状态没有审核时间
|
||||
landStatus: 0, // 0=待审核
|
||||
},
|
||||
{
|
||||
id: 'LD20230005',
|
||||
landName: '有机农场5号地',
|
||||
area: 180.3,
|
||||
fullRegionName: '浙江省杭州市临安区',
|
||||
gridName: '网格E',
|
||||
address: '临安区青山湖街道有机路5号',
|
||||
CropName: '蔬菜',
|
||||
CropVarietyName: '有机菠菜',
|
||||
plantingStartTime: '2023-02-20',
|
||||
plantingEndTime: '2023-12-31',
|
||||
businessSubjectName: '临安有机农业有限公司',
|
||||
account: '13500135005',
|
||||
fillTime: '2023-02-15 13:25',
|
||||
auditTime: '2023-02-18 10:30', // 已通过有审核时间
|
||||
landStatus: 1, // 1=已通过
|
||||
},
|
||||
];
|
@ -2,7 +2,7 @@
|
||||
<section class="custom-page">
|
||||
<!-- 四个固定 Tabs -->
|
||||
<el-tabs v-model="activeCrudTab" @tab-click="handleTabChange">
|
||||
<el-tab-pane label="待提交" name="0" />
|
||||
<!-- <el-tab-pane label="待提交" name="0" /> -->
|
||||
<el-tab-pane label="待审核" name="1" />
|
||||
<el-tab-pane label="已通过" name="2" />
|
||||
<el-tab-pane label="已驳回" name="3" />
|
||||
@ -60,7 +60,7 @@ import { getEnterList, getEnterById, addEnter, updateEnter, approvalEnter, delet
|
||||
|
||||
// 控制弹窗显示
|
||||
const visible = ref(false);
|
||||
const activeCrudTab = ref('0');
|
||||
const activeCrudTab = ref('1');
|
||||
const activeTab = ref('basic');
|
||||
const dialogTitle = ref('新增');
|
||||
const isReadonly = ref(false);
|
||||
@ -173,13 +173,19 @@ const crudOptions = reactive({
|
||||
searchBtn: false,
|
||||
emptyBtn: false,
|
||||
column: [
|
||||
{ label: '生产经营主体编码', prop: 'id' },
|
||||
{ label: '企业名称', prop: 'businessName' },
|
||||
{ label: '所属行政区划', prop: 'address' },
|
||||
{ label: '企业负责人', prop: 'contactPerson' },
|
||||
{ label: '联系方式', prop: 'phone' },
|
||||
{ label: '企业地址', prop: 'address' },
|
||||
{ label: '地块数量', prop: 'villageCount' },
|
||||
{ label: '地块编号', prop: 'villageCode' },
|
||||
{ label: '地块名称', prop: 'villageName' },
|
||||
{ label: '面积', prop: 'area', formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩` },
|
||||
{ label: '经营产品', prop: 'businessScope' },
|
||||
{ label: '联系人', prop: 'contactPerson' },
|
||||
{ label: '联系电话', prop: 'phone' },
|
||||
// { label: '聘工人数', prop: 'villageCount' },
|
||||
{ label: '所属行政区划', prop: 'address' },
|
||||
{ label: '所属网格', prop: 'gridCode' },
|
||||
{ label: '种植作物', prop: 'primaryProduct' },
|
||||
{ label: '账号(手机号)', prop: 'account' },
|
||||
{ label: '信息录入时间', prop: 'createTime' },
|
||||
{ label: '信息更新时间', prop: 'updateTime' },
|
||||
],
|
||||
|
@ -1,712 +0,0 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<avue-crud ref="crudRef" v-model:page="pageData" :data="filteredData" :option="crudOptions" :table-loading="loading">
|
||||
<template #menu-left>
|
||||
<!-- <el-button type="primary" icon="Upload" @click="onImport">导入</el-button> -->
|
||||
<el-button type="danger" icon="Delete" @click="onBatchDel">批量删除</el-button>
|
||||
</template>
|
||||
|
||||
<template #menu="scope">
|
||||
<custom-table-operate :actions="state.options.actions" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, h } from 'vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { isEmpty, downloadFile } from '@/utils';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import {
|
||||
getOperationRecord,
|
||||
saveOperationRecord,
|
||||
editOperationRecord,
|
||||
delOperationRecord,
|
||||
exportOperationRecord,
|
||||
getAddrCropByLand,
|
||||
importOperationRecord,
|
||||
} from '@/apis/land';
|
||||
import uploadImg from '../components/uploadImg.vue';
|
||||
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
const app = useApp();
|
||||
const UserStore = useUserStore();
|
||||
const crudRef = ref(null);
|
||||
const handleLandChange = async (value, form, done) => {
|
||||
if (!value || !value.item || !value.item.id) return; // 如果没有选择任何地块,则直接返回
|
||||
let val = {};
|
||||
getAddrCropByLand(value.item?.id || '')
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
val = res.data || {};
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
val = {};
|
||||
})
|
||||
.finally(() => {});
|
||||
state.form.crop = val?.crop || value.item?.crop;
|
||||
state.form.address = val?.county + val?.town + val?.village || value.item?.address;
|
||||
};
|
||||
|
||||
const productTypeOptions = reactive([
|
||||
{ label: '蔬菜', value: '0' },
|
||||
{ label: '水果', value: '1' },
|
||||
{ label: '畜产品', value: '2' },
|
||||
{ label: '水产品', value: '3' },
|
||||
{ label: '谷物', value: '4' },
|
||||
{ label: '农资', value: '5' },
|
||||
{ label: '种源', value: '6' },
|
||||
{ label: '农产品加工', value: '7' },
|
||||
{ label: '其他', value: '8' },
|
||||
]);
|
||||
|
||||
const bTypeOptions = reactive([
|
||||
{ label: '农户', value: '0' },
|
||||
// { label: '种植', value: '1' },
|
||||
{ label: '合作社', value: '2' },
|
||||
]);
|
||||
|
||||
let timeVal = ref([]);
|
||||
const licenseImg = ref('');
|
||||
const permitImg = ref('');
|
||||
const data = reactive([
|
||||
{
|
||||
crop1: '100001',
|
||||
crop2: '耿马佑氏种植专业合作社',
|
||||
crop3: '蔬菜',
|
||||
crop4: '>20人',
|
||||
crop5: '云南省临沧市耿马县耿马镇城区甘东村允楞芒抗山',
|
||||
crop6: '何仙义',
|
||||
crop7: '18008834114',
|
||||
crop8: '93530926MA6K3M3K5U',
|
||||
crop9: '图片',
|
||||
crop10: '无固定期限',
|
||||
crop11: '已通过',
|
||||
crop12: '暂无',
|
||||
crop13: '2025-03-01',
|
||||
},
|
||||
{
|
||||
crop1: '100002',
|
||||
crop2: '耿马金田园种植专业合作社',
|
||||
crop3: '蔬菜',
|
||||
crop4: '>20人',
|
||||
crop5: '云南省临沧市耿马县四排山公路6公里处',
|
||||
crop6: '董福良',
|
||||
crop7: '13578302599',
|
||||
crop8: '93530926MA6N6C4N8U',
|
||||
crop9: '图片',
|
||||
crop10: '无固定期限',
|
||||
crop11: '已通过',
|
||||
crop12: '暂无',
|
||||
crop13: '2025-01-01',
|
||||
},
|
||||
{
|
||||
crop1: '100003',
|
||||
crop2: '耿马原生茶叶种植专业合作社',
|
||||
crop3: '蔬菜',
|
||||
crop4: '>20人',
|
||||
crop5: '云南省临沧市耿马县四排山公路20公里处',
|
||||
crop6: '李伟荣',
|
||||
crop7: '13529623147',
|
||||
crop8: '935309260752901376',
|
||||
crop9: '图片',
|
||||
crop10: '无固定期限',
|
||||
crop11: '已通过',
|
||||
crop12: '暂无',
|
||||
crop13: '2025-02-11',
|
||||
},
|
||||
{
|
||||
crop1: '100004',
|
||||
crop2: '耿马华侨金果源农业专业合作社',
|
||||
crop3: '蔬菜',
|
||||
crop4: '>20人',
|
||||
crop5: '云南省临沧市耿马县华侨管理区第五居民小组',
|
||||
crop6: '严共洪',
|
||||
crop7: '13987011022',
|
||||
crop8: '93530926MA6L3A7F8T',
|
||||
crop9: '图片',
|
||||
crop10: '无固定期限',
|
||||
crop11: '已通过',
|
||||
crop12: '暂无',
|
||||
crop13: '2025-03-01',
|
||||
},
|
||||
{
|
||||
crop1: '100005',
|
||||
crop2: '耿马尖山沿边魔芋种植农民专业合作社',
|
||||
crop3: '蔬菜',
|
||||
crop4: '>20人',
|
||||
crop5: '云南省临沧市耿马傣族佤族自治县孟定镇尖山村沿线9公里处',
|
||||
crop6: '商德伟',
|
||||
crop7: '13888526321',
|
||||
crop8: '93530926MA6KR6E41C',
|
||||
crop9: '图片',
|
||||
crop10: '无固定期限',
|
||||
crop11: '已通过',
|
||||
crop12: '暂无',
|
||||
crop13: '2025-04-25',
|
||||
},
|
||||
]);
|
||||
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
form: {},
|
||||
selection: [],
|
||||
options: {
|
||||
...CRUD_OPTIONS,
|
||||
addBtnText: '添加',
|
||||
searchLabelWidth: '120px',
|
||||
searchSpan: 8,
|
||||
searchGutter: 100,
|
||||
searchMenuPosition: 'center',
|
||||
column: [
|
||||
{
|
||||
label: '主体代码',
|
||||
prop: 'crop1',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
search: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '主体名称',
|
||||
prop: 'crop2',
|
||||
search: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '经营产品种类',
|
||||
prop: 'crop3',
|
||||
type: 'select',
|
||||
remote: false,
|
||||
search: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
props: {
|
||||
label: 'landName',
|
||||
value: 'id',
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/land-resource/landManage/page?current=1&size=9999&draftsSaveType=0&landName=&gridName=&owner=`,
|
||||
dicFormatter: (res) => res.data.records ?? [],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择地块',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
change: handleLandChange,
|
||||
},
|
||||
// {
|
||||
// label: '主要经营产品',
|
||||
// showOverflowTooltip: true,
|
||||
// search: false,
|
||||
// addDisplay: false,
|
||||
// editDisplay: false,
|
||||
// rules: {
|
||||
// required: true,
|
||||
// message: '请输入',
|
||||
// trigger: 'blur',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '合作社规模',
|
||||
prop: 'crop4',
|
||||
search: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '网格区域',
|
||||
// prop: 'cities',
|
||||
// type: 'cascader',
|
||||
// hide: true,
|
||||
// addDisplay: true,
|
||||
// editDisplay: true,
|
||||
// viewDisplay: false,
|
||||
// // multiple: true,
|
||||
// // checkStrictly: true,
|
||||
// // collapseTags: true,
|
||||
// // emitPath: false,
|
||||
// // checkDescendants: false,
|
||||
// props: {
|
||||
// label: 'areaName',
|
||||
// value: 'areaCode',
|
||||
// children: 'areaChildVOS',
|
||||
// },
|
||||
// dicUrl: `${VITE_APP_BASE_API}/system/area/region?areaCode=530000`,
|
||||
// dicHeaders: {
|
||||
// authorization: UserStore.token,
|
||||
// },
|
||||
// dicFormatter: (res) => res.data ?? [],
|
||||
// rules: {
|
||||
// required: true,
|
||||
// message: '请选择',
|
||||
// trigger: 'blur',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '合作社地址',
|
||||
prop: 'crop5',
|
||||
type: 'cascader',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
checkStrictly: false,
|
||||
search: false,
|
||||
props: {
|
||||
label: 'areaName',
|
||||
value: 'areaCode',
|
||||
children: 'areaChildVOS',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/area/region?areaCode=530000`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data ?? [],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '负责人',
|
||||
prop: 'crop6',
|
||||
search: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '负责人电话',
|
||||
prop: 'crop7',
|
||||
search: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '企业信用代码',
|
||||
prop: 'crop8',
|
||||
search: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '经营许可证',
|
||||
// prop: 'crop9',
|
||||
// search: false,
|
||||
// addDisplay: false,
|
||||
// editDisplay: false,
|
||||
// rules: {
|
||||
// required: true,
|
||||
// message: '请输入',
|
||||
// trigger: 'blur',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '经营有效期',
|
||||
prop: 'crop10',
|
||||
search: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '审核状态',
|
||||
prop: 'crop11',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
search: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '审核意见',
|
||||
prop: 'crop12',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{ label: '创建时间', prop: 'crop13', addDisplay: false, editDisplay: false, search: false },
|
||||
],
|
||||
group: [
|
||||
{
|
||||
label: '基本信息>',
|
||||
prop: 'caseInfo',
|
||||
column: [
|
||||
{
|
||||
label: '主体名称',
|
||||
prop: 'businessName',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '合作社类型',
|
||||
prop: 'bType',
|
||||
type: 'select',
|
||||
dicData: bTypeOptions,
|
||||
rules: { required: true, message: '请选择', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '经营产品种类',
|
||||
type: 'select',
|
||||
dicData: productTypeOptions,
|
||||
rules: { required: true, message: '请选择', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '主要产品',
|
||||
prop: 'primaryProduct',
|
||||
rules: { required: false, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '合作社规模',
|
||||
prop: 'inspectionType',
|
||||
rules: { required: false, message: '请选择', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '负责人',
|
||||
prop: 'inspectionTarget',
|
||||
rules: { required: false, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '负责人电话',
|
||||
prop: 'inspectionTarget',
|
||||
rules: { required: false, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '合作社地址',
|
||||
prop: 'villageCode',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
type: 'cascader',
|
||||
props: {
|
||||
label: 'areaName',
|
||||
value: 'areaCode',
|
||||
children: 'areaChildVOS',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/area/region?areaCode=530000`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data ?? [],
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'notes',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '营业执照>',
|
||||
prop: 'caseInfo',
|
||||
column: [
|
||||
{
|
||||
label: '统一社会信用代码',
|
||||
prop: 'notes',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '营业执照',
|
||||
prop: 'license',
|
||||
},
|
||||
{
|
||||
label: '有效期至',
|
||||
prop: 'operationDate',
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
width: 200,
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '经营项目',
|
||||
prop: 'inspectionSituation',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '经营许可证>',
|
||||
prop: 'caseInfo',
|
||||
column: [
|
||||
{
|
||||
label: '经营许可证编号',
|
||||
prop: 'operationType',
|
||||
rules: { required: false, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '经营许可证',
|
||||
prop: 'permit',
|
||||
rules: { required: false, message: '请选择', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '有效期至',
|
||||
prop: 'operationDate',
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
width: 200,
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
searchColumn: [
|
||||
{ label: '主体代码', prop: 'landName', search: true },
|
||||
{ label: '主体名称', prop: 'crop', search: true },
|
||||
{
|
||||
label: '经营产品种类',
|
||||
prop: 'operationType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
dicData: productTypeOptions,
|
||||
},
|
||||
{
|
||||
label: '创建日期',
|
||||
prop: 'operationDate',
|
||||
type: 'daterange',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
width: 200,
|
||||
search: true,
|
||||
},
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
name: '详情',
|
||||
icon: 'View',
|
||||
event: ({ row }) => doDetail(row),
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: ({ row }) => rowEdit(row),
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
icon: 'delete',
|
||||
event: ({ row }) => rowDel(row),
|
||||
},
|
||||
],
|
||||
},
|
||||
pageData: {
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
data: [],
|
||||
currentRow: {},
|
||||
});
|
||||
|
||||
// 加载
|
||||
const loadData = () => {
|
||||
// state.loading = true;
|
||||
// getOperationRecord(state.query)
|
||||
// .then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// const { current, size, total, records } = res.data;
|
||||
// state.data = records;
|
||||
// state.pageData = {
|
||||
// currentPage: current || 1,
|
||||
// pageSize: size || 10,
|
||||
// total: total,
|
||||
// };
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error(err.msg);
|
||||
// state.data = [];
|
||||
// })
|
||||
// .finally(() => {
|
||||
// state.loading = false;
|
||||
// });
|
||||
};
|
||||
|
||||
loadData();
|
||||
|
||||
// 页数
|
||||
const currentChange = (current) => {
|
||||
state.query.current = current;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 条数
|
||||
const sizeChange = (size) => {
|
||||
state.query.size = size;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const searchChange = (params, done) => {
|
||||
if (done) done();
|
||||
state.query = params;
|
||||
state.query.current = 1;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 刷新
|
||||
const refreshChange = () => {
|
||||
loadData();
|
||||
app.$message.success('刷新成功');
|
||||
};
|
||||
|
||||
// 选择
|
||||
const selectionChange = (rows) => {
|
||||
state.selection = rows;
|
||||
};
|
||||
|
||||
const handleIds = () => {
|
||||
let datalist = state.selection.map((m) => {
|
||||
return { landId: m.landId, landName: m.landName };
|
||||
});
|
||||
|
||||
let selectIdlist = uniqueObjects(datalist, 'landId');
|
||||
let selectIdsVal = selectIdlist.map((n) => {
|
||||
return n.landId;
|
||||
});
|
||||
|
||||
return selectIdsVal.toString() || '';
|
||||
};
|
||||
|
||||
function uniqueObjects(arr, key) {
|
||||
return arr.reduce((acc, current) => {
|
||||
const duplicate = acc.find((element) => element[key] === current[key]);
|
||||
if (!duplicate) {
|
||||
acc.push(current);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
// 新增
|
||||
const rowSave = (row, done, loading) => {
|
||||
// console.info('新增', row);
|
||||
saveOperationRecord(row)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('添加成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const rowEdit = (row) => {
|
||||
console.info('编辑', row);
|
||||
crudRef.value.rowEdit(row);
|
||||
};
|
||||
|
||||
const doDetail = (row) => {
|
||||
crudRef.value.rowView(row);
|
||||
};
|
||||
const rowUpdate = (row, index, done, loading) => {
|
||||
console.info('更新');
|
||||
editOperationRecord(row)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('更新成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const rowDel = (row, index, done) => {
|
||||
if (isEmpty(row)) return;
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
console.info('删除', row.recordId);
|
||||
delOperationRecord(row.recordId || '')
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('删除成功!');
|
||||
loadData();
|
||||
done();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
const onBatchDel = () => {
|
||||
let ids = handleIds();
|
||||
if (!ids.length || ids.length <= 0) {
|
||||
return app.$message.error('请先选择要删除的数据');
|
||||
}
|
||||
};
|
||||
|
||||
const fileChange = (name, list) => {
|
||||
console.info('父组件', list);
|
||||
};
|
||||
</script>
|
@ -13,7 +13,7 @@
|
||||
|
||||
<!-- 四个固定 Tabs -->
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
|
||||
<el-tab-pane label="待提交" name="0" />
|
||||
<!-- <el-tab-pane label="待提交" name="0" /> -->
|
||||
<el-tab-pane label="待审核" name="1" />
|
||||
<el-tab-pane label="已通过" name="2" />
|
||||
<el-tab-pane label="已驳回" name="3" />
|
||||
@ -141,7 +141,7 @@ const isAuditor = computed(() => role.value === 'auditor');
|
||||
// ---------------------------------------------------------------------
|
||||
// 2. Tab 与数据的状态控制
|
||||
// ---------------------------------------------------------------------
|
||||
const activeTab = ref('0');
|
||||
const activeTab = ref('1');
|
||||
const dialogTitle = ref('新增');
|
||||
const isReadonly = ref(false);
|
||||
// 搜索表单模型
|
||||
@ -203,26 +203,19 @@ const crudOptions = reactive({
|
||||
emptyBtn: false,
|
||||
refreshBtn: false,
|
||||
column: [
|
||||
{ label: '生产经营主体编码', prop: 'id' },
|
||||
{ label: '姓名', prop: 'name' },
|
||||
{
|
||||
label: '证件类型',
|
||||
prop: 'idType',
|
||||
formatter: (row, column, cellValue) => {
|
||||
return cellValue === '101' ? '身份证' : cellValue === '2' ? '护照' : cellValue === '3' ? '港澳身份证' : '';
|
||||
},
|
||||
},
|
||||
{ label: '证件号码', prop: 'idCardEncrypt' },
|
||||
{
|
||||
label: '性别',
|
||||
prop: 'sex',
|
||||
formatter: (row, column, cellValue) => {
|
||||
return cellValue === '1' ? '男' : cellValue === '0' ? '女' : '';
|
||||
},
|
||||
},
|
||||
{ label: '年龄', prop: 'age' },
|
||||
{ label: '联系方式', prop: 'phone' },
|
||||
{ label: '居住地行政区划', prop: 'address' },
|
||||
// 地址
|
||||
{ label: '地址', prop: 'address', width: '300px' },
|
||||
{ label: '地块数量', prop: 'villageCount' },
|
||||
{ label: '地块编号', prop: 'villageCode' },
|
||||
{ label: '地块名称', prop: 'villageName' },
|
||||
{ label: '面积', prop: 'area', formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩` },
|
||||
{ label: '所属行政区划', prop: 'address' },
|
||||
{ label: '所属网格', prop: 'gridCode' },
|
||||
{ label: '种植作物', prop: 'planCropName' },
|
||||
{ label: '账号(手机号)', prop: 'account' },
|
||||
{ label: '创建时间', prop: 'createTime' },
|
||||
{ label: '更新时间', prop: 'updateTime' },
|
||||
],
|
||||
|
@ -1,20 +1,401 @@
|
||||
<template>
|
||||
<div class="custom-page" :style="`background-image: url(${getAssetsFile('images/landBase/land1.png')})`">
|
||||
<!-- <h1>统计数据</h1>
|
||||
<div class="content"></div> -->
|
||||
<div class="field-management">
|
||||
<!-- 左侧面板 -->
|
||||
<div class="panel left">
|
||||
<el-input v-model="searchTerm" placeholder="搜索地块名称" clearable style="margin-bottom: 15px"></el-input>
|
||||
|
||||
<el-table :data="filteredFields" highlight-current-row style="width: 100%" height="calc(100vh - 300px)" @row-click="selectField">
|
||||
<el-table-column prop="name" label="名称"></el-table-column>
|
||||
<el-table-column prop="area" label="面积(㎡)">
|
||||
<template #default="{ row }">
|
||||
{{ row.area.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="stats">总面积: {{ totalArea.toFixed(2) }} ㎡</div>
|
||||
|
||||
<div class="button-group">
|
||||
<el-button type="primary" @click="startDrawing">新增地块</el-button>
|
||||
<el-button type="danger" :disabled="!selectedField" @click="removeField">删除地块</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧地图区域 -->
|
||||
<div class="panel right">
|
||||
<tdt-map class="map" :center="mapCenter" :zoom="mapZoom" @init="onMapInit"> </tdt-map>
|
||||
|
||||
<div class="layer-switch">
|
||||
<el-radio-group v-model="layerType" size="small" @change="changeBaseLayer">
|
||||
<el-radio-button label="vector">矢量</el-radio-button>
|
||||
<el-radio-button label="image">影像</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
<div class="field-layer-switch">
|
||||
<el-switch v-model="showFieldLayer" active-text="显示地块"></el-switch>
|
||||
</div>
|
||||
|
||||
<div class="zoom-scale">缩放级别: {{ mapZoom }}, 比例尺: 1:{{ scale.toLocaleString() }}</div>
|
||||
|
||||
<el-dialog v-model="drawDialogVisible" title="新增地块">
|
||||
<el-form>
|
||||
<el-form-item label="地块名称">
|
||||
<el-input v-model="newFieldName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="地块面积">
|
||||
<el-input :value="newFieldArea.toFixed(2) + ' ㎡'" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="cancelDrawing">取消</el-button>
|
||||
<el-button type="primary" @click="saveNewField">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, computed } from 'vue';
|
||||
import { getAssetsFile } from '@/utils';
|
||||
import { ref, computed, onMounted, watch } from 'vue';
|
||||
import { TdtMap } from 'vue-tianditu';
|
||||
import { ElMessage } from 'element-plus';
|
||||
// import { map_config } from '../../config/map';
|
||||
|
||||
// 模拟接口服务(使用localStorage)
|
||||
const fieldService = {
|
||||
getFields() {
|
||||
const fields = localStorage.getItem('fields');
|
||||
return Promise.resolve(fields ? JSON.parse(fields) : []);
|
||||
},
|
||||
createField(field) {
|
||||
return this.getFields().then((fields) => {
|
||||
field.id = Date.now();
|
||||
fields.push(field);
|
||||
localStorage.setItem('fields', JSON.stringify(fields));
|
||||
return field;
|
||||
});
|
||||
},
|
||||
deleteField(id) {
|
||||
return this.getFields().then((fields) => {
|
||||
const newFields = fields.filter((f) => f.id !== id);
|
||||
localStorage.setItem('fields', JSON.stringify(newFields));
|
||||
return newFields;
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
// 响应式状态
|
||||
const fields = ref([]);
|
||||
const selectedField = ref(null);
|
||||
const searchTerm = ref('');
|
||||
const newFieldName = ref('');
|
||||
const drawDialogVisible = ref(false);
|
||||
const newFieldCoords = ref([]);
|
||||
const newFieldArea = ref(0);
|
||||
const layerType = ref('vector');
|
||||
const showFieldLayer = ref(true);
|
||||
const map = ref(null);
|
||||
const mapCenter = ref([100.088, 23.883]);
|
||||
const mapZoom = ref(12);
|
||||
const scale = ref(0);
|
||||
|
||||
// 天地图图层
|
||||
const baseLayers = {
|
||||
vector: null,
|
||||
vectorLabel: null,
|
||||
image: null,
|
||||
imageLabel: null,
|
||||
};
|
||||
|
||||
// 覆盖物图层
|
||||
const overlayLayer = ref(null);
|
||||
|
||||
// 计算属性
|
||||
const filteredFields = computed(() => {
|
||||
const term = searchTerm.value.toLowerCase();
|
||||
return term ? fields.value.filter((f) => f.name.toLowerCase().includes(term)) : fields.value;
|
||||
});
|
||||
|
||||
const totalArea = computed(() => {
|
||||
return fields.value.reduce((sum, field) => sum + field.area, 0);
|
||||
});
|
||||
|
||||
// 地图初始化
|
||||
const onMapInit = (mapInstance) => {
|
||||
map.value = mapInstance;
|
||||
|
||||
// 创建图层
|
||||
baseLayers.vector = new T.TileLayer('vec');
|
||||
baseLayers.vectorLabel = new T.TileLayer('cva');
|
||||
baseLayers.image = new T.TileLayer('img');
|
||||
baseLayers.imageLabel = new T.TileLayer('cia');
|
||||
|
||||
// 添加默认图层
|
||||
map.value.addLayer(baseLayers.image);
|
||||
map.value.addLayer(baseLayers.imageLabel);
|
||||
|
||||
// 创建覆盖物图层
|
||||
overlayLayer.value = new T.Map.OverlayLayer();
|
||||
map.value.addLayer(overlayLayer.value);
|
||||
|
||||
// 添加控件
|
||||
map.value.addControl(new T.Control.Zoom());
|
||||
map.value.addControl(new T.Control.Scale());
|
||||
|
||||
// 事件监听
|
||||
map.value.addEventListener('zoomend', updateScale);
|
||||
map.value.addEventListener('moveend', updateScale);
|
||||
|
||||
// 初始加载数据
|
||||
loadFields();
|
||||
};
|
||||
|
||||
// 更新比例尺
|
||||
const updateScale = () => {
|
||||
if (map.value) {
|
||||
mapZoom.value = map.value.getZoom();
|
||||
scale.value = Math.round(map.value.getScale());
|
||||
}
|
||||
};
|
||||
|
||||
// 切换底图
|
||||
const changeBaseLayer = () => {
|
||||
if (!map.value) return;
|
||||
|
||||
// 移除当前底图
|
||||
map.value.removeLayer(baseLayers.vector);
|
||||
map.value.removeLayer(baseLayers.vectorLabel);
|
||||
map.value.removeLayer(baseLayers.image);
|
||||
map.value.removeLayer(baseLayers.imageLabel);
|
||||
|
||||
// 添加新底图
|
||||
if (layerType.value === 'vector') {
|
||||
map.value.addLayer(baseLayers.vector);
|
||||
map.value.addLayer(baseLayers.vectorLabel);
|
||||
} else {
|
||||
map.value.addLayer(baseLayers.image);
|
||||
map.value.addLayer(baseLayers.imageLabel);
|
||||
}
|
||||
};
|
||||
|
||||
// 加载地块数据
|
||||
const loadFields = () => {
|
||||
fieldService.getFields().then((data) => {
|
||||
fields.value = data;
|
||||
refreshOverlays();
|
||||
});
|
||||
};
|
||||
|
||||
// 刷新覆盖物
|
||||
const refreshOverlays = () => {
|
||||
if (!map.value || !overlayLayer.value) return;
|
||||
|
||||
// 清除所有覆盖物
|
||||
overlayLayer.value.clearOverLays();
|
||||
|
||||
// 如果不显示地块图层则跳过绘制
|
||||
if (!showFieldLayer.value) return;
|
||||
|
||||
// 绘制所有地块
|
||||
fields.value.forEach((field) => {
|
||||
const isSelected = selectedField.value?.id === field.id;
|
||||
const polygon = createPolygon(field, isSelected);
|
||||
overlayLayer.value.addOverLay(polygon);
|
||||
});
|
||||
};
|
||||
|
||||
// 创建多边形
|
||||
const createPolygon = (field, isSelected = false) => {
|
||||
const coords = field.geometry.coordinates[0].map((c) => new T.LngLat(c[0], c[1]));
|
||||
return new T.Polygon(coords, {
|
||||
color: isSelected ? '#ff0000' : '#1890ff',
|
||||
weight: isSelected ? 3 : 2,
|
||||
opacity: 0.8,
|
||||
fillColor: isSelected ? '#ffa39e' : '#e6f7ff',
|
||||
fillOpacity: 0.5,
|
||||
});
|
||||
};
|
||||
|
||||
// 选择地块
|
||||
const selectField = (field) => {
|
||||
selectedField.value = field;
|
||||
refreshOverlays();
|
||||
|
||||
// 居中显示选中地块
|
||||
if (map.value) {
|
||||
const coords = field.geometry.coordinates[0];
|
||||
const center = coords.reduce(
|
||||
(acc, coord) => {
|
||||
acc[0] += coord[0];
|
||||
acc[1] += coord[1];
|
||||
return acc;
|
||||
},
|
||||
[0, 0]
|
||||
);
|
||||
|
||||
center[0] /= coords.length;
|
||||
center[1] /= coords.length;
|
||||
|
||||
map.value.panTo(new T.LngLat(center[0], center[1]));
|
||||
}
|
||||
};
|
||||
|
||||
// 开始绘制
|
||||
const startDrawing = () => {
|
||||
if (!map.value) return;
|
||||
|
||||
// 清除当前覆盖物
|
||||
refreshOverlays();
|
||||
|
||||
// 创建绘制工具
|
||||
const polygonTool = new T.PolygonTool(map.value, {
|
||||
showLabel: true,
|
||||
color: '#fa541c',
|
||||
weight: 3,
|
||||
opacity: 0.6,
|
||||
fillColor: '#ffbb96',
|
||||
fillOpacity: 0.4,
|
||||
});
|
||||
|
||||
polygonTool.open();
|
||||
|
||||
// 绘制完成事件
|
||||
polygonTool.addEventListener('draw', (e) => {
|
||||
newFieldCoords.value = e.currentLnglats.map((lnglat) => [lnglat.lng, lnglat.lat]);
|
||||
newFieldArea.value = e.currentArea;
|
||||
drawDialogVisible.value = true;
|
||||
|
||||
// 清除临时图形
|
||||
polygonTool.close();
|
||||
});
|
||||
};
|
||||
|
||||
// 保存新地块
|
||||
const saveNewField = () => {
|
||||
if (!newFieldName.value.trim()) {
|
||||
ElMessage.error('请输入地块名称');
|
||||
return;
|
||||
}
|
||||
|
||||
const newField = {
|
||||
id: Date.now(),
|
||||
name: newFieldName.value,
|
||||
area: newFieldArea.value,
|
||||
geometry: {
|
||||
type: 'Polygon',
|
||||
coordinates: [newFieldCoords.value],
|
||||
},
|
||||
};
|
||||
|
||||
fieldService.createField(newField).then(() => {
|
||||
ElMessage.success('地块创建成功');
|
||||
drawDialogVisible.value = false;
|
||||
newFieldName.value = '';
|
||||
loadFields();
|
||||
});
|
||||
};
|
||||
|
||||
// 取消绘制
|
||||
const cancelDrawing = () => {
|
||||
drawDialogVisible.value = false;
|
||||
refreshOverlays();
|
||||
};
|
||||
|
||||
// 删除地块
|
||||
const removeField = () => {
|
||||
if (!selectedField.value) return;
|
||||
|
||||
fieldService.deleteField(selectedField.value.id).then(() => {
|
||||
ElMessage.success('地块已删除');
|
||||
selectedField.value = null;
|
||||
loadFields();
|
||||
});
|
||||
};
|
||||
|
||||
// 监听地块图层显示状态
|
||||
watch(showFieldLayer, refreshOverlays);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.custom-page {
|
||||
height: calc(100vh - 150px);
|
||||
background-size: cover;
|
||||
// background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
<style scoped>
|
||||
.field-management {
|
||||
display: flex;
|
||||
height: calc(100vh - 160px);
|
||||
}
|
||||
|
||||
.panel.left {
|
||||
width: 320px;
|
||||
padding: 15px;
|
||||
border-right: 1px solid #e4e7ed;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.panel.right {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.map {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.layer-switch {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 15px;
|
||||
background: white;
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.field-layer-switch {
|
||||
position: absolute;
|
||||
top: 60px;
|
||||
right: 15px;
|
||||
background: white;
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.zoom-scale {
|
||||
position: absolute;
|
||||
bottom: 15px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
padding: 6px 12px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.stats {
|
||||
padding: 12px;
|
||||
margin: 10px 0;
|
||||
background: #edf2ff;
|
||||
border-radius: 4px;
|
||||
font-weight: 500;
|
||||
color: #364fc7;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.button-group > * {
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
||||
|
@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="mapDiv">
|
||||
<tdt-map ref="tdtMapRef" :center="state.center" :zoom="state.zoom" :style="{ height: mapHeight }">
|
||||
<!-- <tdt-tile-layer :layer-type="'img_w'"></tdt-tile-layer> -->
|
||||
<!-- <tdt-tile-layer :layer-type="'cia_w'" :z-index="2"></tdt-tile-layer> -->
|
||||
<tdt-tilelayer :url="state.img_w_url" :z-index="1"></tdt-tilelayer>
|
||||
<tdt-tilelayer :url="state.cia_w_url" :z-index="2"></tdt-tilelayer>
|
||||
</tdt-map>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, onMounted, ref } from 'vue';
|
||||
import { TdtMap, TdtTileLayer } from 'vue-tianditu';
|
||||
import { map_config } from '@/config/map';
|
||||
|
||||
const key = map_config.tianditu.token;
|
||||
|
||||
const state = reactive({
|
||||
center: [100.088, 23.883],
|
||||
zoom: 14,
|
||||
img_w_url: `http://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${key}`,
|
||||
cia_w_url: `http://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${key}`,
|
||||
// 添加其他地图层URL
|
||||
// ...
|
||||
});
|
||||
|
||||
// 确保地图有明确的高度
|
||||
const mapHeight = ref('100vh');
|
||||
|
||||
onMounted(() => {
|
||||
console.log('地图组件已挂载');
|
||||
// 检查天地图API是否加载成功
|
||||
if (window.T) {
|
||||
console.log('天地图API已加载:', window.T);
|
||||
} else {
|
||||
console.error('天地图API未加载');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.mapDiv {
|
||||
width: 100%;
|
||||
height: 100vh; /* 确保容器有明确高度 */
|
||||
}
|
||||
</style>
|
@ -4183,6 +4183,11 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6:
|
||||
resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
|
||||
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
|
||||
|
||||
mitt@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz#ea36cf0cc30403601ae074c8f77b7092cdab36d1"
|
||||
integrity sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==
|
||||
|
||||
mixin-deep@^1.2.0:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.npmmirror.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566"
|
||||
@ -6516,6 +6521,11 @@ vue-demi@*, vue-demi@^0.14.10:
|
||||
resolved "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz#afc78de3d6f9e11bf78c55e8510ee12814522f04"
|
||||
integrity sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==
|
||||
|
||||
vue-demi@^0.12.1:
|
||||
version "0.12.5"
|
||||
resolved "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.12.5.tgz#8eeed566a7d86eb090209a11723f887d28aeb2d1"
|
||||
integrity sha512-BREuTgTYlUr0zw0EZn3hnhC3I6gPWv+Kwh4MCih6QcAeaTlaIX0DwOVN0wHej7hSvDPecz4jygy/idsgKfW58Q==
|
||||
|
||||
vue-eslint-parser@^9.4.3:
|
||||
version "9.4.3"
|
||||
resolved "https://registry.npmmirror.com/vue-eslint-parser/-/vue-eslint-parser-9.4.3.tgz#9b04b22c71401f1e8bca9be7c3e3416a4bde76a8"
|
||||
@ -6536,6 +6546,14 @@ vue-router@^4.2.5:
|
||||
dependencies:
|
||||
"@vue/devtools-api" "^6.6.4"
|
||||
|
||||
vue-tianditu@^2.7.6:
|
||||
version "2.7.6"
|
||||
resolved "https://registry.npmmirror.com/vue-tianditu/-/vue-tianditu-2.7.6.tgz#c48425c49306300cae9664182dd170c626a38371"
|
||||
integrity sha512-Yvcxg0IAgGB3ZY8zlC5ayjo9f85fa8PFTaifguTNpri76g67GO9toaRWMjBKi39yYHMBADaT3P6bEkJx87X8MQ==
|
||||
dependencies:
|
||||
mitt "^3.0.0"
|
||||
vue-demi "^0.12.1"
|
||||
|
||||
vue@^3.3.11:
|
||||
version "3.5.13"
|
||||
resolved "https://registry.npmmirror.com/vue/-/vue-3.5.13.tgz#9f760a1a982b09c0c04a867903fc339c9f29ec0a"
|
||||
|
19
sub-operation-service/src/apis/farmingService.js
Normal file
19
sub-operation-service/src/apis/farmingService.js
Normal file
@ -0,0 +1,19 @@
|
||||
import request from '@/utils/axios';
|
||||
|
||||
// 农事服务
|
||||
|
||||
// 获取农事政策分类查询数据
|
||||
export function informationList(params = {}) {
|
||||
return request('contentManage/information/informationPage', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取农资分类查询数据
|
||||
export function informationDetail(id, params = {}) {
|
||||
return request(`contentManage/information/informationInfo/${id}`, {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
@ -6,12 +6,12 @@
|
||||
<el-card shadow="hover" style="border-radius: 16px">
|
||||
<h2 style="text-align: left">农业政策</h2>
|
||||
<div v-for="(item, index) in tableData" :key="index" class="card-item">
|
||||
<div style="width: 49%"><img :src="getAssetsFile(item.imgPath)" alt="" width="100%" /></div>
|
||||
<div style="width: 49%; background-color: white"><img :src="item.coverUrl" alt="" width="100%" style="height: 250px" /></div>
|
||||
<div style="width: 49%; display: flex; flex-direction: column; justify-content: space-between">
|
||||
<div>
|
||||
<div style="font-size: 20px; font-weight: bold">{{ item.title }}</div>
|
||||
<div style="font-size: 14px; margin-top: 20px">
|
||||
{{ item.desc }}
|
||||
{{ item.content }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@ -29,10 +29,11 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, onMounted } from 'vue';
|
||||
import common from '../components/common.vue';
|
||||
import { getAssetsFile } from '@/utils/index.js';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { informationList } from '@/apis/farmingService.js';
|
||||
const router = useRouter();
|
||||
|
||||
/* --------------- data --------------- */
|
||||
@ -59,10 +60,43 @@ const tableData = ref([
|
||||
},
|
||||
]);
|
||||
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
page: 1,
|
||||
size: 10,
|
||||
});
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
onMounted(() => {
|
||||
queryList();
|
||||
});
|
||||
|
||||
const extractText = (htmlText, maxChars = 80) => {
|
||||
// 去除 HTML 标签
|
||||
const cleanText = htmlText.replace(/<[^>]+>/g, '');
|
||||
// 去除多余空格和换行
|
||||
const trimmedText = cleanText.replace(/\s+/g, ' ').trim();
|
||||
// 取前 20 个字
|
||||
return trimmedText.substring(0, maxChars);
|
||||
};
|
||||
|
||||
const queryList = () => {
|
||||
informationList({ current: pagination.value.page, size: pagination.value.size }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
tableData.value = res.data.records;
|
||||
for (let i in res.data.records) {
|
||||
tableData.value[i].content = extractText(res.data.records[i].content);
|
||||
if (tableData.value[i].content.length > 80) {
|
||||
tableData.value[i].content += '...';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const goDetail = (id) => {
|
||||
router.push('/sub-operation-service/farmService/consult/policy/detail?id=' + id);
|
||||
};
|
||||
|
File diff suppressed because one or more lines are too long
@ -145,10 +145,6 @@ const mockData = ref([
|
||||
content:
|
||||
'适用对象:农户。<p>授信额度:单户贷款最高1000万元。</p><p>贷款期限:最长10年。</p><p>担保方式:信用、保证、抵押、质押。</p><p>利率:以各地实际利率为准。</p>',
|
||||
},
|
||||
{
|
||||
title: '三、办理渠道',
|
||||
content: '邮储银行各大开办信贷业务的网点。客户服务热线:95580。',
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user