feat:土地管理四个模块搭建

This commit is contained in:
李想 2025-02-25 17:30:50 +08:00
parent f5d43be8fc
commit 775a4b6ef6
10 changed files with 287 additions and 2 deletions

View File

@ -0,0 +1,8 @@
import request from '@/utils/axios';
export function getLandList(params = {}) {
return request('land-resource/gridManage/page', {
method: 'GET',
params,
});
}

View File

@ -0,0 +1,21 @@
<template>
<el-card body-class="custom_content_card_" shadow="props.shadow">
<slot></slot>
</el-card>
</template>
<script setup>
const props = defineProps({
shadow: {
type: String,
default: 'never',
},
});
</script>
<style lang="scss">
.el-card:has(.custom_content_card_) {
border-radius: 10px !important;
border: none !important;
}
</style>

View File

@ -0,0 +1,72 @@
<template>
<section :style="{ '--right': props.right ? 'flex-end' : 'unset' }">
<el-pagination
v-model:current-page="curPage"
v-model:page-size="curSize"
:page-sizes="[10, 20, 30, 40, 50, 100]"
background
layout="total, sizes, prev, pager, next, jumper"
:total="curTotal"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</section>
</template>
<script setup>
import { ref, watch } from 'vue';
const props = defineProps({
pageData: {
type: Object,
default: () => {
return {
page: 1,
size: 10,
total: 0,
};
},
},
pageSizes: {
type: Array,
default: () => {
return [10, 20, 30, 40, 50, 100];
},
},
right: {
type: Boolean,
default: true,
},
});
const emit = defineEmits(['pageChange', 'sizeChange']);
const curPage = ref(1);
const curSize = ref(10);
const curTotal = ref(0);
watch(
() => props.pageData,
() => {
curPage.value = props.pageData.page || 1;
curSize.value = props.pageData.size || 10;
curTotal.value = props.pageData.total || 0;
},
{
deep: true,
immediate: true,
}
);
function handleCurrentChange(val) {
emit('pageChange', val);
}
function handleSizeChange(val) {
emit('sizeChange', val);
}
</script>
<style lang="scss" scoped>
section {
display: flex;
justify-content: var(--right);
}
</style>

View File

@ -75,4 +75,37 @@ export default [
}, },
], ],
}, },
{
path: '/landManage',
name: 'landManage',
component: Layout,
redirect: '/plantPlan',
meta: { title: '土地管理', icon: 'Document' },
children: [
{
path: '/plantPlan',
name: 'plantPlan',
component: () => import('@/views/landManage/component/plantPlan/index.vue'),
meta: { title: '种植规划', icon: 'Document' },
},
{
path: '/landPartol',
name: 'landPartol',
component: () => import('@/views/landManage/component/landPartol/index.vue'),
meta: { title: '土地巡查', icon: 'Document' },
},
{
path: '/illegalHandle',
name: 'illegalHandle',
component: () => import('@/views/landManage/component/illegalHandle/index.vue'),
meta: { title: '土地违法处理', icon: 'Document' },
},
{
path: '/operationRecord',
name: 'operationRecord',
component: () => import('@/views/landManage/component/operationRecord/index.vue'),
meta: { title: '作业记录', icon: 'Document' },
},
],
},
]; ];

View File

@ -0,0 +1,19 @@
<template>
<section>违法处理</section>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
/* --------------- data --------------- */
// #region
// #endregion
/* --------------- methods --------------- */
// #region
// #endregion
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,19 @@
<template>
<section>土地巡查</section>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
/* --------------- data --------------- */
// #region
// #endregion
/* --------------- methods --------------- */
// #region
// #endregion
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,19 @@
<template>
<section>作业记录</section>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
/* --------------- data --------------- */
// #region
// #endregion
/* --------------- methods --------------- */
// #region
// #endregion
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,51 @@
<template>
<CustCard>
<el-row>
<el-col></el-col>
</el-row>
<Pagina :page-data="pageData" />
</CustCard>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue';
import Pagina from '@/components/pagina.vue';
import CustCard from '@/components/CustCard.vue';
import { getLandList } from '@/apis/land.js';
onMounted(() => {
getList();
});
/* --------------- data --------------- */
// #region
const searchCondition = reactive({
name: '',
person: '',
});
const pageData = reactive({
page: 1,
size: 10,
total: 0,
});
// #endregion
/* --------------- methods --------------- */
// #region
async function getList() {
const params = { current: pageData.page, size: pageData.size };
let res = await getLandList(params);
console.log('res ---------', res);
}
// #endregion
</script>
<style lang="scss" scoped>
.container {
background-color: #fff;
border-radius: 4px;
}
</style>

View File

@ -0,0 +1,19 @@
<template>
<router-view></router-view>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
/* --------------- data --------------- */
// #region
// #endregion
/* --------------- methods --------------- */
// #region
// #endregion
</script>
<style lang="scss" scoped></style>

View File

@ -23,14 +23,23 @@
<el-button type="success" icon="upload" @click="onUpload">导入</el-button> <el-button type="success" icon="upload" @click="onUpload">导入</el-button>
<el-button type="success" icon="download" @click="onExport">导出</el-button> <el-button type="success" icon="download" @click="onExport">导出</el-button>
</template> </template>
<template #productUrl-form="{ column }"> <template #productUrl-form="{ column }">
<el-upload class="custom-form__uploader" action="#" :show-file-list="false" accept="image/*" :limit="1" :http-request="rowUploadPicture"> <el-upload class="custom-form__uploader" action="#" :show-file-list="false" accept="image/*" :limit="1" :http-request="rowUploadPicture">
<img v-if="state.form.base64" :src="state.form.base64" class="custom-form__uploader__img" /> <img v-if="state.form.base64" :src="state.form.base64" class="custom-form__uploader__img" />
<el-icon v-else class="custom-form__uploader__icon"><Plus /></el-icon> <el-icon v-else class="custom-form__uploader__icon"><Plus /></el-icon>
</el-upload> </el-upload>
</template> </template>
<template #id="{ row }">
<!-- <span @click="handleShowQrcode(row.id)">{{ row.id }}</span> -->
<el-popover placement="top" trigger="click" :width="330">
<template #reference>
<span>{{ row.id }}</span>
</template>
<template #default>
<img :src="row.orCodeUrl" alt="" />
</template>
</el-popover>
</template>
<template #customInfo-form="{ column }"> <template #customInfo-form="{ column }">
<custom-info :row="state.currentRow" /> <custom-info :row="state.currentRow" />
</template> </template>
@ -49,6 +58,9 @@
<custom-quality-add ref="qualityAddRef" :row="state.currentRow" /> <custom-quality-add ref="qualityAddRef" :row="state.currentRow" />
</div> </div>
<!-- <el-dialog v-model="qrInfo.show" title="扫码溯源" width="500" :before-close="() => (qrInfo.show = false)">
<QrCode :value="qrInfo.url" :size="300" />
</el-dialog> -->
</template> </template>
<script setup> <script setup>
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
@ -607,4 +619,16 @@ const onExport = () => {
state.loading = false; state.loading = false;
}); });
}; };
const qrInfo = reactive({
url: '1111111111111111111111111111111111111111',
show: true,
});
function handleShowQrcode(id) {
// a.value = a.value + 1;
qrInfo.url = id;
qrInfo.show = true;
console.log('cell', qrInfo);
}
</script> </script>