Commit bb48e93ed2c8ccdd2b45ab05fe7333ba88c25818

Authored by xingyu4j
1 parent d5f95c2e

perf: top action slost

yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts
... ... @@ -18,7 +18,7 @@ export type VxeCrudSchema = {
18 18 primaryKey?: string // 主键ID
19 19 primaryTitle?: string // 主键标题 默认为序号
20 20 primaryType?: VxeColumnPropTypes.Type // 不填写为数据库编号 null为不显示 还支持 "seq" | "radio" | "checkbox" | "expand" | "html" | null
21   - action?: boolean // 是否开启操作栏插槽
  21 + action?: boolean // 是否开启表格内右侧操作栏插槽
22 22 actionTitle?: string // 操作栏标题 默认为操作
23 23 actionWidth?: string // 操作栏插槽宽度,一般2个字带图标 text 类型按钮 50-70
24 24 columns: VxeCrudColumns[]
... ...
yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts
... ... @@ -11,6 +11,7 @@ const message = useMessage() // 消息弹窗
11 11  
12 12 interface UseVxeGridConfig<T = any> {
13 13 allSchemas: VxeAllSchemas
  14 + topActionSlots?: boolean // 是否开启表格内顶部操作栏插槽
14 15 treeConfig?: VxeTablePropTypes.TreeConfig
15 16 getListApi: (option: any) => Promise<T>
16 17 deleteApi?: (option: any) => Promise<T>
... ... @@ -51,7 +52,10 @@ export const useVxeGrid = &lt;T = any&gt;(config?: UseVxeGridConfig&lt;T&gt;) =&gt; {
51 52 isHover: true // 当鼠标移到行时,是否要高亮当前行
52 53 },
53 54 toolbarConfig: {
54   - slots: { buttons: 'toolbar_buttons' }
  55 + slots:
  56 + !config?.topActionSlots && config?.topActionSlots != false
  57 + ? { buttons: 'toolbar_buttons' }
  58 + : {}
55 59 },
56 60 printConfig: {
57 61 columns: config?.allSchemas.printSchema
... ...
yudao-ui-admin-vue3/src/views/system/oauth2/token/index.vue
... ... @@ -41,6 +41,7 @@ const message = useMessage() // 消息弹窗
41 41 const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
42 42 const { gridOptions, getList } = useVxeGrid<TokenApi.OAuth2TokenVO>({
43 43 allSchemas: allSchemas,
  44 + topActionSlots: false,
44 45 getListApi: TokenApi.getAccessTokenPageApi
45 46 })
46 47  
... ...