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