ci-plus
Version:
ci组件库
78 lines (77 loc) • 2.21 kB
text/typescript
import { Component as ComponentIns, h } from 'vue'
import { TableColumnInstance, ColumnCls } from 'element-plus'
import { AxiosRequestConfig } from 'axios';
export type Props<T> = Partial<Omit<T, `$${string}` | `_${string}` | '$' | '_'>>
export interface Scope<T> {
row: T,
$index: number,
column: ColumnCls<T>
}
export interface AnyO {
[key: string]: any
}
export interface SelectColumn {
col: Props<TableColumnInstance>
scope?(props: any): string
component?: (createVNode: typeof h, data: Scope<any>) => ComponentIns
}
export interface SelectSuffix {
title?: string //弹出层标题
modelValue?: string | string[] //下拉框value
columns: SelectColumn[] // 表格列配置
mul?: boolean //多选
aim?: boolean
disabled?: boolean
size?: "" | "default" | "small" | "large"
prop: { //下拉框字段
label: string
value: string
}
where?: { //弹出层打开需要展示Label的请求的params
[key: string]: any
}
axiosConfig: AxiosRequestConfig //Axios请求配置
isExist?: boolean // 是否选中关闭,单选默认true,多选默认false
searchKey?: string // 模糊搜索字段,默认search,
onChange?: (value: string, row: AnyO) => void
// selectConfig?:Props<ISelectV2Props>
getData?: (params: any) => any[] // 获取数据的方法::getData="(data: any) => data.data"
}
export interface Basic {
page: number
limit: number
count: number
s_page: number
s_count: number
is_dialogTable: boolean
loading: boolean
footerShow: boolean
search: string
}
type FormListBase = {
name: string
label: string
col?: number
type?: string
hide?: { judgment: string, value: any }[]
mul?: boolean
range?: boolean
sub?: string[]
listen?: (val: any) => any
}
type no_select = { sign: 1 | 4 }
type is_select = {
sign: 3
select?: { url: string, pName: string, sign?: number, where?: object }
options?: {
label: string
value: number
[propName: string]: any
}[]
}
type is_suffix = {
sign: 2,
whereKey?: string
suffixConfig: SelectSuffix
}
export type FormList = FormListBase & (no_select | is_select | is_suffix)