无人机管理后台前端(已迁走)
张含笑
2025-09-02 38d20755f3c5e248aa1efda2dee0860c3e9a6bfd
src/views/resource/components/spotDetails.vue
@@ -58,7 +58,6 @@
          <div class="table-content">
            <div class="tabname">图斑列表</div>
            <el-table
              ref="polygonTableEle"
              highlight-current-row
              :row-class-name="tableRowClassName"
@@ -67,10 +66,12 @@
            >
              <el-table-column type="index" align="center" width="30" label="序号">
                <template #default="{ $index }">
                  {{ ($index + 1).toString().padStart(2, '0') }}
                  {{
                    ($index + 1 + (params.page - 1) * params.pageSize).toString().padStart(2, '0')
                  }}
                </template>
              </el-table-column>
              <el-table-column prop="dkbh" align="center" label="图斑名称" show-overflow-tooltip/>
              <el-table-column prop="dkbh" align="center" label="图斑名称" show-overflow-tooltip />
              <el-table-column prop="is_exception" align="center" label="图斑状态">
                <template #default="scope">
                  <span>{{ scope.row.is_exception === 2 ? '异常' : '正常' }}</span>
@@ -176,7 +177,7 @@
    if (newOptions) {
      spotTypeOptions.value = newOptions.map(opt => ({
        label: opt.label,
        value: String(opt.value),
        value: opt.value,
      }));
    }
  },
@@ -235,28 +236,26 @@
  const requestParams = {
    patchesInfoId: props.detailid,
    page: params.value.page,
    pageSize: params.value.pageSize
    pageSize: params.value.pageSize,
  };
  tableMapListApi(requestParams).then(res => {
    tableData.value = res.data.data.map(item => ({
    tableData.value = res.data.data.records?.map(item => ({
      ...item,
      dkfw: item.sdfw && item.is_exception == 1 ? item.sdfw : item.dkfw,
    }));
    total.value = res.data.total || res.data.data.length;
    total.value = res.data.data.total || res.data.data.length;
    tbJwdList = [];
    viewer?.entities.removeAll();
    entitiesAddSpot();
  });
};
const handleSizeChange = (val) => {
const handleSizeChange = val => {
  params.value.pageSize = val;
  params.value.page = 1; // 重置到第一页
  params.value.page = 1;
  getTableList();
};
const handleCurrentChange = (val) => {
const handleCurrentChange = val => {
  params.value.page = val;
  getTableList();
};
@@ -322,7 +321,10 @@
    if (tbJwdList.length > 0) {
      const positions = tbJwdList.flatMap(item => Cesium.Cartesian3.fromDegreesArray(item.grouped));
      homeViewer.value?.camera.flyToBoundingSphere(new Cesium.BoundingSphere.fromPoints(positions));
      const boundingSphere = Cesium.BoundingSphere.fromPoints(positions);
      homeViewer.value?.camera.flyToBoundingSphere(boundingSphere, {
        duration: 0,
      });
    }
    viewInstance.value?.removeLeftClickEvent('spotHighlighting');
    viewInstance.value?.addLeftClickEvent(null, spotHighlighting, 'spotHighlighting');
@@ -389,7 +391,7 @@
      lastentity.polygon.material = originalColor;
      lastentity.polygon.outlineColor = originalOutline;
      lastentity.polygon.outlineWidth = 2; // 恢复默认边框宽度
      lastentity.polygon.outlineWidth = 2;
    }
  }
@@ -402,7 +404,7 @@
    destination: Cesium.Cartesian3.fromDegrees(
      Number(polygonCenter.lng),
      Number(polygonCenter.lat),
      2000
      1500
    ),
    zIndex: 100,
  });
@@ -448,8 +450,8 @@
  const patchTypeItem = infoList.value.find(item => item.name === '图斑类型');
  const updateParams = {
    file_name: fileNameItem?.value || '',
    lot_type_id: patchTypeItem?.originalValue || patchTypeItem?.value || '',
    type: patchTypeItem?.originalValue || patchTypeItem?.value || '',
    lot_type_id: patchTypeItem?.value || '',
    type: patchTypeItem?.value || '',
    id: props.detailList.id,
  };
  patchEditApi(updateParams).then(res => {
@@ -493,21 +495,19 @@
  destroyMap();
});
</script>
<style lang="scss">
.spotDialog {
  .el-dialog.is-align-center .el-dialog__header .el-dialog__title {
    padding-left: 16px !important;
  }
}
</style>
<style scoped lang="scss">
// :deep(.el-dialog.is-align-center) {
//   :deep(.el-dialog__header) {
//     .el-dialog__title {
//       padding-left: 14px !important;
//     }
//   }
// }
:global(.spotDialog .el-dialog__header span) {
  padding-left: 16px !important;
  display: inline-block;
}
:global(.spotDialog .el-dialog__header) .el-dialog__title {
  font-family: "Source Han Sans CN" !important;
  font-weight: bold !important;
  font-size: 16px !important;
  color: #363636 !important;
}
.container {
  display: flex;
  flex-direction: column;
@@ -530,7 +530,7 @@
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    row-gap: 0;
    padding: 0; // 移除内边距,让边框贴合
    padding: 0;
    font-size: 14px;
  }
@@ -554,7 +554,7 @@
    height: 33px;
    padding: 0 10px;
    border-right: 1px solid #e8e8e8;
    border-bottom: none; // 由.itemCon控制底部边框
    border-bottom: none;
    .itemTitle {
      width: 202px;
@@ -567,7 +567,7 @@
      height: 100%;
      line-height: 33px;
      padding-right: 10px;
      margin: 0 -10px 0 -10px; // 拉伸背景色
      margin: 0 -10px 0 -10px;
    }
    .itemContent {