Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GiTable拖拽时Fixed的列会变化位置且悬浮 #86

Open
3 tasks done
Damon-Liu-code opened this issue Sep 6, 2024 · 0 comments
Open
3 tasks done

GiTable拖拽时Fixed的列会变化位置且悬浮 #86

Damon-Liu-code opened this issue Sep 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Damon-Liu-code
Copy link

Damon-Liu-code commented Sep 6, 2024

Bug 描述

GiTable拖拽时,Fixed在左右的列也会变化位置,而且是悬浮的,形成了遮挡

复现步骤

  1. 列的属性设置为fixed:'left'
  2. 点击列表左上的设置
  3. 拖动带有固定属性的列
  4. 看到该列位置改变,且悬浮,拉进度条时会形成遮挡

预期结果

正确预期应为不允许拖拽固定在左右两侧的列,因为这种列往往是用户必看的核心信息

环境信息

ContiNew Admin version(s):3.0.1

额外补充

我已对该问题进行了修改:
修改\src\components\GiTable.vue的_columns方法
修改后如下:

// 排序和过滤可显示的列数据
const _columns = computed(() => {
  if (!attrs.columns) return []
  const arr = attrs.columns as TableColumnData[]
  // 显示的dataIndex
  const showDataIndexs = settingColumnList.value
      .filter((i) => i.show)
      .map((i) => i.key || (typeof i.title === 'string' ? i.title : ''))
  // 显示的columns数据
  const filterColumns = arr.filter((i) =>
      showDataIndexs.includes(i.dataIndex || (typeof i.title === 'string' ? i.title : ''))
  )
  const sortedColumns: TableColumnData[] = []
  filterColumns.forEach((j) => {
    if (j.fixed === 'left') {
      sortedColumns.push(j)
    }
  })
  settingColumnList.value.forEach((i) => {
    filterColumns.forEach((j) => {
      if (i.key === (j.dataIndex || j.title) && j.fixed === undefined) {
        sortedColumns.push(j)
      }
    })
  })
  filterColumns.forEach((j) => {
    if (j.fixed === 'right') {
      sortedColumns.push(j)
    }
  })
  return sortedColumns
})

确认

  • 阅读文档
  • 根据报错信息百度或 Google 一下
  • 搜索是否有其他人提交过类似的 issue,如果对应 issue 尚未解决,您可以先订阅关注该 issue(为了方便后来者查找问题解决方法,请尽量避免创建重复的 issue)
@Damon-Liu-code Damon-Liu-code added the bug Something isn't working label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant