From 5808f76456ca0d40de5074f132b73a5a488e3e13 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 09 Dec 2025 09:12:03 +0800
Subject: [PATCH] Merge branch 'refs/heads/feature/v9.0/9.0.1' into test
---
src/views/resource/patchManagement.vue | 101 +++++++++++++++++++++-----------------------------
1 files changed, 43 insertions(+), 58 deletions(-)
diff --git a/src/views/resource/patchManagement.vue b/src/views/resource/patchManagement.vue
index f18babe..1d73c99 100644
--- a/src/views/resource/patchManagement.vue
+++ b/src/views/resource/patchManagement.vue
@@ -35,13 +35,13 @@
<el-button type="primary" text icon="el-icon-edit" @click="uploadPatch(scope.row, 'edit')"
>编辑
</el-button>
- <el-button type="primary" text icon="el-icon-delete" @click="rowDel(scope.row)"
+ <el-button :disabled="scope.row.patches_type_desc==='综合类'" type="primary" text icon="el-icon-delete" @click="rowDel(scope.row)"
>删除
</el-button>
</template>
</avue-crud>
- <el-dialog title="上传图斑" append-to-body align-center v-model="box" width="550px">
+ <el-dialog title="上传图斑" class="ztzf-dialog-mange" append-to-body align-center v-model="box" width="550px">
<el-form
ref="ruleFormRef"
style="max-width: 600px"
@@ -84,10 +84,12 @@
:detailid="detailid"
:detailList="detailList"
:spotTypeOption="allspotTypeOption"
+ :regionalData="regionalData"
></SpotDetails>
</basic-container>
</template>
<script setup>
+import { findAreaName } from '@/utils/areaUtils';
import {
spotManagementTableApi,
searchManagementApi,
@@ -136,6 +138,7 @@
const query = ref({});
const loading = ref(true);
const box = ref(false);
+
const page = ref({
pageSize: 20,
currentPage: 1,
@@ -153,10 +156,13 @@
addBtn: false,
tip: false,
searchShow: true,
- searchMenuSpan: 8,
- searchMenuPosition: 'right',
+ searchGutter: 30,
+ searchMenuPosition: 'left',
+ searchMenuSpan: 4,
border: true,
index: true,
+ indexLabel: '序号',
+ indexWidth: 60,
selection: true,
grid: false,
menuWidth: 240,
@@ -187,7 +193,7 @@
label: '图斑类型',
prop: 'patches_type_desc',
span: 24,
- searchLabelWidth: 100,
+ // searchLabelWidth: 100,
search: true,
searchSpan: 4,
type: 'select',
@@ -215,7 +221,7 @@
prop: 'areaName',
span: 24,
width: 180,
- searchLabelWidth: 100,
+ // searchLabelWidth: 100,
search: true,
searchSpan: 4,
type: 'tree',
@@ -243,7 +249,7 @@
label: '创建人',
prop: 'user_name',
span: 24,
- searchLabelWidth: 100,
+ // searchLabelWidth: 100,
search: true,
searchSpan: 4,
type: 'select',
@@ -463,40 +469,13 @@
data.value = d.records.map(i => ({
...i,
dataFrom: i.date_from === 0 ? '本地上传' : '国土调查云',
- areaName: findAreaName(i.area_code),
+ areaName: findAreaName(i.area_code, regionalData.value, true),
}));
loading.value = false;
selectionClear();
});
};
-const findAreaName = areaCode => {
- const nodes = regionalData.value;
- if (!nodes || nodes.length === 0) return areaCode;
- const normalizeCode = code => {
- if (!code) return '';
- const strCode = String(code).replace(/0+$/, '');
- return strCode.length >= 6 ? strCode : '';
- };
- const targetCode = normalizeCode(areaCode);
- const findInTree = (treeNodes, needFullPath = false, parentPath = []) => {
- for (const node of treeNodes) {
- const currentPath = [...parentPath, node.name];
-
- if (normalizeCode(node.id) === targetCode) {
- return needFullPath ? currentPath.join('/') : node.name;
- }
-
- if (node.childrens?.length > 0) {
- const found = findInTree(node.childrens, needFullPath, currentPath);
- if (found) return found;
- }
- }
- return null;
- };
-
- return findInTree(nodes, true) || areaCode;
-};
// 图斑详情/编辑
const uploadPatch = (row, type = 'detail') => {
detailid.value = row.id;
@@ -531,42 +510,48 @@
});
};
// 图斑上传
-const uploadFlightFile = (file, t) => {
- const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1);
- if (!['kmz', 'kml', 'zip'].includes(fileSuffix)) {
- return ElMessage.error('请上传zip/kmz/kml格式的文件');
- }
+const uploadFlightFile = async (file, t) => {
+ loading.value = true;
+ try {
+ const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1);
+ if (!['kmz', 'kml', 'zip'].includes(fileSuffix)) {
+ ElMessage.error('请上传zip/kmz/kml格式的文件');
+ return;
+ }
+ box.value = false;
+ let data = new FormData();
+ let type = t === '3' ? '' : t;
+ const params = {
+ file: file,
+ fileName: ruleForm.name,
+ LotTypeId: ruleForm.region,
+ };
- let data = new FormData();
- let type = t === '3' ? '' : t;
- const params = {
- file: file,
- fileName: ruleForm.name,
- LotTypeId: ruleForm.region,
- };
+ Object.keys(params).forEach(key => {
+ data.append(key, params[key]);
+ });
- Object.keys(params).forEach(key => {
- data.append(key, params[key]);
- });
-
- uploadManagementApi(data).then(res => {
+ const res = await uploadManagementApi(data);
if (res.data.code !== 0) {
- return ElMessage.error('上传失败');
+ ElMessage.error('上传失败');
+ return;
}
ElMessage.success('上传成功');
-
- box.value = false;
-
+
+ // 重置表单
ruleForm.name = '';
ruleForm.region = '';
-
if (ruleFormRef.value) {
ruleFormRef.value.resetFields();
}
searchReset();
- });
+ } catch (error) {
+ loading.value = false;
+ } finally {
+ loading.value = false;
+ }
};
provide('searchReset', searchReset);
onMounted(() => {
--
Gitblit v1.9.3