| | |
| | | </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" |
| | |
| | | </basic-container> |
| | | </template> |
| | | <script setup> |
| | | import {findAreaName} from '@/utils/areaUtils' |
| | | import { findAreaName } from '@/utils/areaUtils'; |
| | | import { |
| | | spotManagementTableApi, |
| | | searchManagementApi, |
| | |
| | | addBtn: false, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 8, |
| | | searchMenuPosition: 'right', |
| | | searchGutter: 30, |
| | | searchMenuPosition: 'left', |
| | | searchMenuSpan: 4, |
| | | border: true, |
| | | index: true, |
| | | indexLabel: '序号', |
| | | indexWidth: 60, |
| | | indexWidth: 60, |
| | | selection: true, |
| | | grid: false, |
| | | menuWidth: 240, |
| | |
| | | label: '图斑类型', |
| | | prop: 'patches_type_desc', |
| | | span: 24, |
| | | searchLabelWidth: 100, |
| | | // searchLabelWidth: 100, |
| | | search: true, |
| | | searchSpan: 4, |
| | | type: 'select', |
| | |
| | | prop: 'areaName', |
| | | span: 24, |
| | | width: 180, |
| | | searchLabelWidth: 100, |
| | | // searchLabelWidth: 100, |
| | | search: true, |
| | | searchSpan: 4, |
| | | type: 'tree', |
| | |
| | | label: '创建人', |
| | | prop: 'user_name', |
| | | span: 24, |
| | | searchLabelWidth: 100, |
| | | // searchLabelWidth: 100, |
| | | search: true, |
| | | searchSpan: 4, |
| | | type: 'select', |
| | |
| | | data.value = d.records.map(i => ({ |
| | | ...i, |
| | | dataFrom: i.date_from === 0 ? '本地上传' : '国土调查云', |
| | | areaName: findAreaName(i.area_code, regionalData.value, true) |
| | | areaName: findAreaName(i.area_code, regionalData.value, true), |
| | | })); |
| | | loading.value = false; |
| | | selectionClear(); |
| | |
| | | }); |
| | | }; |
| | | // 图斑上传 |
| | | const uploadFlightFile = (file, t) => { |
| | | loading.value = true |
| | | 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(); |
| | | } |
| | | loading.value = true |
| | | |
| | | searchReset(); |
| | | }); |
| | | } catch (error) { |
| | | loading.value = false; |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | }; |
| | | provide('searchReset', searchReset); |
| | | onMounted(() => { |