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

question: 关于小程序展示表格的技术方案咨询 #1727

Open
doucheng opened this issue Apr 19, 2024 · 1 comment
Open

question: 关于小程序展示表格的技术方案咨询 #1727

doucheng opened this issue Apr 19, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@doucheng
Copy link

doucheng commented Apr 19, 2024

首先,十分感谢维格云可以开源这么优秀的产品 ~

背景:
在仪表盘中不只要展示图表,有时也要展示明细数据,并提供进一步操作,所以我想咨询如何在小程序中安全渲染表格。

社区有一个网址预览的小程序,原理是用 iframe 加载网址,可以在仪表盘展示表格数据,不过存在一些体验层面的缺点:

  首先、打开性能较慢,资源要重新加载;
  第二,使用展开行、插入行、筛选等功能受限于iframe的大小,操作很不方便。

所以我尝试了另一种方案,在小程序中直接渲染 DatasheetPane 组件(使用这里提到的方式),不过后期也遇到了问题,虽然小程序和主程序的Redux Store 存在隔离,不过 @apitable/core 中有很多地方使用了全局变量的方式访问 Store

/**
 * Static store for injection to external callers (web-side).
 * Before calling Field on the web side, inject the store instance first, then you don't need to pass in the store again every time you bindModel
 */
let storeCache: Store;
export const injectStore = (store: Store) => { storeCache = store; };

这就导致在仪表盘中渲染两个表格的时候,数据会相关干扰。

我的问题是,是否有其他技术方案可以实现Redux Store 安全隔离?或者有更好的方案实现我的需求。

感谢可以提供一些建议或思路 。

@doucheng doucheng added the question Further information is requested label Apr 19, 2024
@ranglang
Copy link
Collaborator

ranglang commented May 9, 2024

目前架构中 store 中包括多个datapack, 这是因为关联表和关联数据, 如果渲染两个表格数据有误,建议从业务逻辑本身处理。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants