| | |
| | | </div> |
| | | </div> |
| | | <div class="btnGroups"> |
| | | <el-button class="ztzf-button" @click="addFence">{{ |
| | | <el-button v-if="activeName !== '国土空间规划'" class="ztzf-button" @click="addFence">{{ |
| | | props.activeName === '电子围栏' ? '新增围栏' : '新增禁飞区' |
| | | }}</el-button> |
| | | <el-button class="ztzf-button" @click="addFolder">新增文件夹</el-button> |
| | | <el-button v-if="activeName !== '国土空间规划'" class="ztzf-button" @click="addFolder">新增文件夹</el-button> |
| | | <el-upload |
| | | v-if="activeName === '国土空间规划'" |
| | | action="#" |
| | | :show-file-list="false" |
| | | :before-upload="e => uploadFlightFile(e, '1')" |
| | | accept=".zip" |
| | | > |
| | | <el-button class="ztzf-button"> 上传 </el-button> |
| | | </el-upload> |
| | | |
| | | <el-button class="ztzf-button" @click="selectAll">全选</el-button> |
| | | </div> |
| | | <div class="tableListBox"> |
| | |
| | | |
| | | <script setup> |
| | | import { ElMessage } from 'element-plus'; |
| | | import { treeDataApi, deleteFenceApi,deleteFolderApi } from '@/api/layer/index'; |
| | | import { treeDataApi, deleteFenceApi, deleteFolderApi, spatialPlanningApi } from '@/api/layer/index'; |
| | | import { inject, onMounted } from 'vue'; |
| | | const emit = defineEmits(['update:coverData', 'update:deitData', 'newFencesMethods']); |
| | | import EventBus from '@/utils/eventBus'; |
| | |
| | | type: 'success', |
| | | }); |
| | | } |
| | | gettreeDataApi(); |
| | | }); |
| | | |
| | | }else if(node.data.level === 3){ |
| | |
| | | type: 'success', |
| | | }); |
| | | } |
| | | gettreeDataApi(); |
| | | }); |
| | | } |
| | | gettreeDataApi(); |
| | | }; |
| | | // 新增围栏 |
| | | const addFence = () => { |
| | |
| | | layerParams.value.fileType = 2; |
| | | } |
| | | }; |
| | | |
| | | function uploadFlightFile(file, t) { |
| | | const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1); |
| | | if (!['zip'].includes(fileSuffix)) { |
| | | return ElMessage.error('请上传zip格式的文件'); |
| | | } |
| | | let data = new FormData(); |
| | | const params = { |
| | | file: file, |
| | | fileName: file.name, |
| | | }; |
| | | Object.keys(params).forEach(key => { |
| | | data.append(key, params[key]); |
| | | }); |
| | | spatialPlanningApi(data).then(res =>{ |
| | | ElMessage.success('上传成功'); |
| | | gettreeDataApi(); |
| | | }) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | gettreeDataApi(); |
| | |
| | | .btnGroups { |
| | | margin: 12px 0 14px 0; |
| | | display: flex; |
| | | gap: 0 10px; |
| | | |
| | | .el-button{ |
| | | margin: 0 !important; |
| | | } |
| | | } |
| | | .tableListBox { |
| | | //:deep(.el-tree-node__content) { |