| | |
| | | <template> |
| | | <div class="rightContainer"> |
| | | <div class="rightContainer" > |
| | | <div class="contenttitle">{{ layerParams.fenceType === 1 ? '识别区' : '禁飞区' }}信息</div> |
| | | <div class="centerBox"> |
| | | <div class="itemRow"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="btnGroups"> |
| | | <img src="/src/assets/images/layerManagement/savebtn.svg" alt="" @click="submitHandle" /> |
| | | <img src="/src/assets/images/layerManagement/cancelbtn.svg" @click="cancelHandel" alt="" /> |
| | | <img v-if="!layerParams.editingIsProhibited" src="/src/assets/images/layerManagement/savebtn.svg" alt="" @click="submitHandle" /> |
| | | <img v-if="layerParams.editingIsProhibited" src="/src/assets/images/layerManagement/closeBtn.svg" @click="cancelHandel" alt="" /> |
| | | <img v-else src="/src/assets/images/layerManagement/cancelbtn.svg" @click="cancelHandel" alt="" /> |
| | | |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import dayjs from 'dayjs'; |
| | | import { deitFenceApi, addFenceApi } from '@/api/layer/index'; |
| | | import EventBus from '@/utils/eventBus'; |
| | | const emit = defineEmits(['callParentMethod']); |
| | | const emit = defineEmits(['callParentMethod','update:loading']); |
| | | const layerParams = inject('layerParams'); |
| | | const options = ref([]); |
| | | const timeValue = ref(''); |
| | |
| | | geo_data: '', |
| | | |
| | | }); |
| | | const loading = ref(false); |
| | | const detailData = ref(null); |
| | | const fenceArea = ref(0); |
| | | detailData.value = layerParams.value.editDetailData; |
| | |
| | | layerParams.value.editingIsProhibited = false; |
| | | }; |
| | | const cancelHandel = () => { |
| | | loading.value = false |
| | | emit('update:loading', false); |
| | | clearAllData(); |
| | | emit('callParentMethod'); |
| | | EventBus.emit('gettreeDataApi'); |
| | | }; |
| | | const submitHandle = () => { |
| | | if(layerParams.value.crossSurface){ |
| | | return ElMessage.warning('测区不支持交叉面') |
| | | } |
| | | if (!formData.value.folder_id) { |
| | | ElMessage.error('请选择文件夹'); |
| | | return; |
| | |
| | | ElMessage.error('请绘制区域'); |
| | | return; |
| | | } |
| | | loading.value = true |
| | | emit('update:loading', true); |
| | | const params = { |
| | | folder_id: formData.value.folder_id, |
| | | name: formData.value.name, |
| | |
| | | } |
| | | if (layerParams.value.decideWhetherToAddOrEdit === 1) { |
| | | //围栏新增 |
| | | addFenceApi(params).then(res => { |
| | | ElMessage.success('新增成功'); |
| | | EventBus.emit('gettreeDataApi'); |
| | | clearAllData(); |
| | | emit('callParentMethod'); |
| | | }); |
| | | addFenceApi(params) |
| | | .then(res => { |
| | | if(res.data.code ===0 ){ |
| | | ElMessage.success('新增成功'); |
| | | EventBus.emit('gettreeDataApi'); |
| | | loading.value = false; |
| | | emit('update:loading', false); |
| | | clearAllData(); |
| | | emit('callParentMethod'); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | ElMessage.error('新增失败,请重试'); |
| | | }) |
| | | .finally(() => { |
| | | loading.value = false; |
| | | emit('update:loading', false); |
| | | }); |
| | | } else if (layerParams.value.decideWhetherToAddOrEdit === 2) { |
| | | //围栏编辑 |
| | | deitFenceApi(params).then(res => { |
| | | ElMessage.success('编辑成功'); |
| | | EventBus.emit('gettreeDataApi'); |
| | | |
| | | clearAllData(); |
| | | emit('callParentMethod'); |
| | | }); |
| | | } |
| | | deitFenceApi(params) |
| | | .then(res => { |
| | | if(res.data.code === 0){ |
| | | ElMessage.success('编辑成功'); |
| | | EventBus.emit('gettreeDataApi'); |
| | | clearAllData(); |
| | | emit('callParentMethod'); |
| | | loading.value = false; |
| | | emit('update:loading', false); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | ElMessage.error('编辑失败,请重试'); |
| | | }) |
| | | .finally(() => { |
| | | loading.value = false; |
| | | emit('update:loading', false); |
| | | }); |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | // 获取判断状态(默认设为 1) |
| | |
| | | backdrop-filter: blur(4px); |
| | | border-radius: 8px 8px 8px 8px; |
| | | padding: 16px 12px; |
| | | |
| | | :deep(.el-select__wrapper.is-disabled .el-select__selected-item){ |
| | | color: rgba(255,255,255,0.37) !important; |
| | | } |
| | | :deep(.el-textarea__inner) { |
| | | background: transparent !important; |
| | | color: #ffffff !important; |
| | | color: #ffffff; |
| | | } |
| | | :deep(.el-textarea.is-disabled .el-textarea__inner){ |
| | | color: var(--el-disabled-text-color) !important; |
| | | |
| | | } |
| | | .contenttitle { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: bold; |
| | |
| | | height: 39px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | } |
| | | } |
| | | </style> |