Skip to content

fix(grid): fix custom setting style error at mobile-first #3524

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 2 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/sites/demos/apis/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ export default {
name: 'overflow-title',
type: 'boolean',
defaultValue: 'false',
meta: {
stable: '3.15.0'
},
desc: {
'zh-CN': '标签超长是否显示提示',
'en-US': 'Does the label display a prompt if it is too long'
Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/apis/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2008,10 +2008,10 @@ export default {
},
{
name: 'handleFetch',
type: '() => Promise',
type: '(code: "reload") => Promise<null>',
defaultValue: '',
desc: {
'zh-CN': '触发表格的 fetch-data ',
'zh-CN': '触发表格的 fetch-data,当 code="reload" 时会将分支重置为 1,且清除筛选、排序等条件',
'en-US': 'Trigger the fetch-data of the table'
Comment on lines +2014 to 2015
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix typo and improve description consistency.

Two issues identified in the description update:

  1. Typo: "分支重置为 1" should be "分页重置为 1" (reset page index to 1, not branch)
  2. Inconsistency: The Chinese description is now much more detailed than the English description. Consider updating the English description to match.

Apply this fix for the typo:

-            'zh-CN': '触发表格的 fetch-data,当 code="reload" 时会将分支重置为 1,且清除筛选、排序等条件',
+            'zh-CN': '触发表格的 fetch-data,当 code="reload" 时会将分页重置为 1,且清除筛选、排序等条件',

And consider enhancing the English description for consistency:

-            'en-US': 'Trigger the fetch-data of the table'
+            'en-US': 'Trigger the fetch-data of the table. When code="reload", resets page index to 1 and clears filters, sorting, and other conditions'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'zh-CN': '触发表格的 fetch-data,当 code="reload" 时会将分支重置为 1,且清除筛选、排序等条件',
'en-US': 'Trigger the fetch-data of the table'
'zh-CN': '触发表格的 fetch-data,当 code="reload" 时会将分页重置为 1,且清除筛选、排序等条件',
'en-US': 'Trigger the fetch-data of the table. When code="reload", resets page index to 1 and clears filters, sorting, and other conditions'
🤖 Prompt for AI Agents
In examples/sites/demos/apis/grid.js around lines 2014 to 2015, correct the typo
in the Chinese description by changing "分支重置为 1" to "分页重置为 1". Then, update the
English description to match the detail level of the Chinese one by explaining
that triggering fetch-data with code="reload" resets the page index to 1 and
clears filters and sorting conditions.

},
mode: ['pc', 'mobile-first'],
Expand Down
3 changes: 3 additions & 0 deletions packages/vue/src/grid-toolbar/src/custom-saas.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<!-- 同步勿删,此处custom适配不了多端,因此需要固定Modal为pc端 -->
<tiny-modal
width="800"
tiny_mode="pc"
tiny_mode_root
Comment on lines +5 to +6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix prop naming for <tiny-modal> and verify support
Vue component props should use kebab-case in templates. The underscores here may not map to the intended props (tinyMode, tinyModeRoot) on the tiny-modal component and can silently break your fix. Please confirm that these props exist and work as expected, or apply the following diff:

 <tiny-modal
     width="800"
-    tiny_mode="pc"
-    tiny_mode_root
+    tiny-mode="pc"
+    tiny-mode-root
     title=" "
     class="tiny-grid-toolbar-modal"
     v-model="visible"
     @input="handleInput"
     @close="handleClose"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tiny_mode="pc"
tiny_mode_root
<tiny-modal
width="800"
tiny-mode="pc"
tiny-mode-root
title=" "
class="tiny-grid-toolbar-modal"
v-model="visible"
@input="handleInput"
@close="handleClose"
>
🤖 Prompt for AI Agents
In packages/vue/src/grid-toolbar/src/custom-saas.vue at lines 5 to 6, the props
for the <tiny-modal> component are incorrectly named using underscores instead
of kebab-case. Rename the props from tiny_mode and tiny_mode_root to tiny-mode
and tiny-mode-root respectively to match Vue's kebab-case convention for props
in templates. Also verify that these props exist on the tiny-modal component and
function correctly after renaming.

title=" "
class="tiny-grid-toolbar-modal"
v-model="visible"
Expand Down
6 changes: 5 additions & 1 deletion packages/vue/src/grid/src/fetch-data/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export default {
return { api, dataset, fields, loading, isReloadFilter, isReloadScroll }
}
},
/* 第二个参数sortArg参数可以移除,fetchData.args可以传递更加灵活的参数
但为避免破坏性变更,暂保留
*/
handleFetch(code, sortArg) {
let { pager, sortData, filterData, pagerConfig, fetchOption, fetchData, dataset } = this as any
let { reloadConfig = {} } = fetchData
Expand All @@ -34,6 +37,7 @@ export default {
this.columnAnchor && this.clearActiveAnchor()
}

// 文档暂不暴露prefetch,这里只清空单选不清空多选状态有点奇怪
if (code !== 'prefetch') {
this.clearRadioRow()
!scroll && this.resetScrollTop()
Expand Down Expand Up @@ -84,7 +88,7 @@ export default {
}

if (fetchData && fetchData.api) {
search = fetchData.api.apply(this, [params])
search = fetchData.api(params)
} else {
search = getDataset({ dataset, service: this.$service }, params)
}
Expand Down
Loading