Skip to content

修正 ScriptList 重绘、图标显示等问题 + 其他视觉元素修改 #559

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

Merged
merged 19 commits into from
Jul 21, 2025

Conversation

cyfung1031
Copy link
Contributor

@cyfung1031 cyfung1031 commented Jul 19, 2025

把代码改来改去终於处理掉重绘问题

之前有把 columns 的width拆出来不过还是算了。保持newColumns dealColumns


非React的改动很简单,把批次读icon的以icon取得顺序就好。失效的Icon不会卡死其他icon


React的部份最大的坑是,

因为用了Dragaable,所以ArcoTable裡 components的table/tbody/row 放了React自订元件
如果这个元件是放在 function ScriptList() { ... } 裡,就会在改column width时重绘整个table

只要把东西拉回顶层,ScriptList裡的变量改用Context形式传过去就好

  • 官方示例裡的drag 没有结合阔度改变,估计官方示例也有同样问题

另一个坑是,

getScriptListColumnWidth 那个是异步,所以render时会先render最初那个大小
render中途得到 getScriptListColumnWidth 后又再render一次
所以加了 canShowList 就可以保证 getScriptListColumnWidth 是完成后才 render


此外,因为我们用的是较高级的dnd-kit, 没有官方示例的那个简单易用,所以要自订 DragHandle, 也是要用Context传东西的


另外,拖拉改回把最左手边,配合正常用户习惯

加了 @dnd-kit/modifiers 是为了限制拖拉只有上下不会有左右


注意: 当开啟option page 时,因图标在读取,而popup弹不出来的问题还未有解决方法。不打算在这PR修正(仅最初,问题不大)


其他

闊度 step={5}
74f9b0e

apply_to_run_status word-wrap
c2cc52e

loading={loading}


调整padding 令 scriptlist 有更多空间显示资料
取消filter 打字栏动画效果 (共通)
修正fixed-layout 中 name 的最小阔最大阔 (col )

@cyfung1031 cyfung1031 changed the title 修正 ScriptList 重绘、图标显示等问题 修正 ScriptList 重绘、图标显示等问题 + 其他修改 Jul 19, 2025
@cyfung1031 cyfung1031 changed the title 修正 ScriptList 重绘、图标显示等问题 + 其他修改 修正 ScriptList 重绘、图标显示等问题 + 其他视觉元素修改 Jul 19, 2025
@CodFrm
Copy link
Member

CodFrm commented Jul 21, 2025

变化有点大,变成了紧凑的了,不过也挺好的,可以接受

不过在点击开启/运行启动的时候,页面会刷新一下,之前的做法应该是只在操作的按钮上loading,不会刷新页面(似乎是loading的原因),这个loading直接删除会有问题吗?

@CodFrm
Copy link
Member

CodFrm commented Jul 21, 2025

太棒了!除了上面的loading,一切都很好,现在popup打开也非常快

@cyfung1031
Copy link
Contributor Author

cyfung1031 commented Jul 21, 2025

不过在点击开启/运行启动的时候,页面会刷新一下,之前的做法应该是只在操作的按钮上loading,不会刷新页面(似乎是loading的原因),这个loading直接删除会有问题吗?

loading 只是做一個效果
等異步結果回來再設回 false
會有"處理感"

可以不加。沒影響

https://arco.design/react/components/table#%E8%A1%A8%E6%A0%BC%E5%B1%9E%E6%80%A7

沒實際刷新。只是一個視覺效果

@CodFrm CodFrm merged commit f9e6c44 into scriptscat:main Jul 21, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants