crud参数传递添加类型

This commit is contained in:
qianlishi
2025-01-13 20:14:41 +08:00
parent 615a7503fc
commit fedade1924
4 changed files with 27 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
* @Author: qianlishi
* @Date: 2024-12-30 18:16:00
* @LastEditors: qianlishi
* @LastEditTime: 2025-01-13 19:55:57
* @LastEditTime: 2025-01-13 20:05:33
-->
<template>
<div class="view-container">
@@ -186,7 +186,7 @@
watch(() => unref(getApiOptions)?.queryApi,
() => {
unref(getTableOptions)?.autoLoad && toQuery()
unref(getBindValue)?.autoLoad && toQuery()
})
// 获取查询参数

View File

@@ -3,8 +3,12 @@
* @Author: qianlishi
* @Date: 2025-01-03 13:15:19
* @LastEditors: qianlishi
* @LastEditTime: 2025-01-13 19:55:18
* @LastEditTime: 2025-01-13 20:09:32
*/
import type { PropType } from 'vue'
import { JsqTreeProps } from '@/components/Base/Jsq-tree'
import { FormProps } from './components/Jsq-searchForm';
import { ApiProps } from './types'
export const basicProps = {
// 是否自动加载 (可手动调用toQuery方法)
@@ -12,4 +16,22 @@ export const basicProps = {
type: Boolean,
default: true,
},
treeOptions: {
type: Object as PropType<JsqTreeProps>
},
searchFormOption: {
type: Object as PropType<FormProps>
},
tableButtonsOptions: {
type: Object
},
dialogRecordingData: {
type: Object
},
tableOptions: {
type: Object
},
apiOptions: {
type: Object as PropType<ApiProps>
}
};

View File

@@ -15,6 +15,7 @@ export type ApiProps = {
// crud配置项
export type CurdProps = {
autoLoad: boolean;
treeOptions: JsqTreeProps; // tree配置
searchFormOption: FormProps; // 搜索表单配置项
tableButtonsOptions: any; // 批量操作按钮

View File

@@ -82,6 +82,7 @@
const { columns } = getTableColumns({ toCopyUrl, removeSingle, toDownLoad })
const [register, { toRemoveAll, toRemove, toQuery }] = useCrud({
autoLoad: false, // 表格是否自动请求
searchFormOption: {
schemas: getFormSchemas({}).value,
},
@@ -97,7 +98,6 @@
schemas: getDialogRecordingSchemas()
},
tableOptions: {
autoLoad: false,
// navie table配置
columns: columns, // 表格配置
},