无人机管理后台前端(已迁走)
罗广辉
2025-12-05 42e7814f816bedba1a0ef8e8f8fb3df1f495c9db
src/views/layerManagement/components/leftList.vue
@@ -59,6 +59,7 @@
        :expand-on-click-node="false"
         :check-on-click-node="false"
        :filter-node-method="filterNode"
        highlight-current
        @check="handleCheck"
        :props="{
          label: 'name',
@@ -126,6 +127,16 @@
    loading.value = true;
    const res = await treeDataApi({filterExpired:false});
    treeAllData.value = res.data.data;
    if(coverData.value.length===0){
       checkedKeys.value = [];
    checkedNodes.value = [];
    coverData.value = [];
     nextTick(() => {
      if (treeRef.value) {
        treeRef.value.setCheckedKeys([]);
      }
    });
    }
    setupWatch();
  } catch (error) {
@@ -193,6 +204,12 @@
};
// 定位按钮事件
const handleLocation = node => {
 const currentKey = treeRef.value.getCurrentKey();
      if (currentKey === node.data.id) {
        treeRef.value.setCurrentKey(null); // 取消高亮
      } else {
        treeRef.value.setCurrentKey(node.data.id); // 高亮当前节点
      }
  if (node.data.level === 2) {
    layerParams.value.isSingleLocating = false;
    // 新增:标记当前定位的文件夹ID
@@ -206,7 +223,6 @@
  const currentCheckedKeys = [...checkedKeys.value];
  const currentCheckedNodes = [...checkedNodes.value];
  EventBus.emit('focusOnNode', node.data);
  if (node.data.level === 2) {
    const folderChildren = node.data.children || [];
    const childrenIds = folderChildren.map(child => child.id);
@@ -260,6 +276,7 @@
// 删除按钮事件
const handleDelete = node => {
  let id = node.data.id;
  ElMessageBox.confirm('确定要删除该内容吗?', '提示', {
    confirmButtonText: '确定',
@@ -445,14 +462,17 @@
  overflow-y: scroll;
  height: 0;
  flex-grow: 1;
  padding-right: 12px;
  // padding-right: 12px;
  :deep(.el-tree-node__content) {
  height: 45px !important;
  line-height: 45px !important;
  // padding-left: 0 !important;
  border-bottom: 1px dotted  rgba(255,255,255,0.1);
  }
  // 定位选中节点的背景色样式
  ::v-deep(.el-tree-node.is-current > .el-tree-node__content) {
    background-color: rgba(64, 158, 255, 0.2) !important; // 浅蓝色半透明背景
  }
  .isTheTerritory {
    :deep() {
      .el-tree-node__expand-icon {
@@ -470,6 +490,7 @@
    display: flex;
    justify-content: space-between;
    align-items: center;
     padding-right: 12px;
    width: 100%;
       .nodeName {
    font-size: 12px !important;