fix(model): fix several base model component bugs#1761
fix(model): fix several base model component bugs#1761hexqi merged 15 commits intoopentiny:developfrom
Conversation
WalkthroughThis PR refactors the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Failure to add the new IP will result in interrupted reviews. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/builtinComponent/src/components/BaseTable.vue (1)
197-213:⚠️ Potential issue | 🟠 MajorGuard against
queryApi()calls with no data to avoid runtime crash.
datais spread directly; if callers invokequeryApi()without arguments, this throws. SincequeryApiis exposed, this is a breaking runtime risk.✅ Suggested fix
-const queryApi = (data) => { +const queryApi = (data = {}) => { const apiInfo = props.modelApis.find((api) => api.nameEn === 'queryApi') if (!apiInfo) { return undefined } // 处理查询参数 const params = Object.fromEntries(tableModel.value.parameters.map((item) => [item.prop, null])) return getMetaApi(META_SERVICE.Http) .post(apiInfo.url, { currentPage: pagerState.currentPage || 1, pageSize: pagerState.pageSize || 10, nameEn: tableModel.value.nameEn, nameCn: tableModel.value.nameCn, params: { ...params, - ...data + ...(data || {}) } })
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
页面模板组件在分页和搜索的时候没有传递搜索表单的data内容
Issue Number: N/A
What is the new behavior?
页面模板在分页和搜索的时候使用搜索表单的数据,如果自己调用queryApi也可以传递数据作为参数
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit