diff --git a/mayfly_go_web/src/common/config.ts b/mayfly_go_web/src/common/config.ts index 278d0a79..154df42c 100644 --- a/mayfly_go_web/src/common/config.ts +++ b/mayfly_go_web/src/common/config.ts @@ -15,7 +15,7 @@ const config = { baseWsUrl: `${(window as any).globalConfig.BaseWsUrl || `${location.protocol == 'https:' ? 'wss:' : 'ws:'}//${getBaseApiUrl()}`}/api`, // 系统版本 - version: 'v1.6.0', + version: 'v1.6.1', }; export default config; diff --git a/mayfly_go_web/src/components/Grid/components/GridItem.vue b/mayfly_go_web/src/components/Grid/components/GridItem.vue new file mode 100644 index 00000000..9502833d --- /dev/null +++ b/mayfly_go_web/src/components/Grid/components/GridItem.vue @@ -0,0 +1,66 @@ + + diff --git a/mayfly_go_web/src/components/Grid/index.vue b/mayfly_go_web/src/components/Grid/index.vue new file mode 100644 index 00000000..2e301419 --- /dev/null +++ b/mayfly_go_web/src/components/Grid/index.vue @@ -0,0 +1,159 @@ + + + diff --git a/mayfly_go_web/src/components/Grid/interface/index.ts b/mayfly_go_web/src/components/Grid/interface/index.ts new file mode 100644 index 00000000..a0beff2c --- /dev/null +++ b/mayfly_go_web/src/components/Grid/interface/index.ts @@ -0,0 +1,6 @@ +export type BreakPoint = "xs" | "sm" | "md" | "lg" | "xl"; + +export type Responsive = { + span?: number; + offset?: number; +}; diff --git a/mayfly_go_web/src/components/SearchForm/components/SearchFormItem.vue b/mayfly_go_web/src/components/SearchForm/components/SearchFormItem.vue new file mode 100644 index 00000000..3cd275df --- /dev/null +++ b/mayfly_go_web/src/components/SearchForm/components/SearchFormItem.vue @@ -0,0 +1,94 @@ + + + diff --git a/mayfly_go_web/src/components/SearchForm/index.ts b/mayfly_go_web/src/components/SearchForm/index.ts new file mode 100644 index 00000000..99a6a329 --- /dev/null +++ b/mayfly_go_web/src/components/SearchForm/index.ts @@ -0,0 +1,115 @@ +import { VNode } from 'vue'; + +export type FieldNamesProps = { + label: string; + value: string; + children?: string; +}; + +export type SearchItemType = + | 'input' + | 'input-number' + | 'select' + | 'select-v2' + | 'tree-select' + | 'cascader' + | 'date-picker' + | 'time-picker' + | 'time-select' + | 'switch' + | 'slider'; + +/** + * 搜索项 + */ +export class SearchItem { + /** + * 属性字段 + */ + prop: string; + + /** + * 当前项搜索框的 label + */ + label: string; + + /** + * 表单项类型,input、select、date等 + */ + type: SearchItemType; + + /** + * select等组件的可选值 + */ + options: any; + + /** + * 插槽名 + */ + slot: string; + + props?: any; // 搜索项参数,根据 element plus 官方文档来传递,该属性所有值会透传到组件 + + tooltip?: string; // 搜索提示 + + span?: number; // 搜索项所占用的列数,默认为 1 列 + + offset?: number; // 搜索字段左侧偏移列数 + + fieldNames: FieldNamesProps; // 指定 label && value && children 的 key 值,用于select等类型组件 + + render?: (scope: any) => VNode; // 自定义搜索内容渲染(tsx语法) + + constructor(prop: string, label: string) { + this.prop = prop; + this.label = label; + } + + static new(prop: string, label: string): SearchItem { + return new SearchItem(prop, label); + } + + static text(prop: string, label: string): SearchItem { + const tq = new SearchItem(prop, label); + tq.type = 'input'; + return tq; + } + + static select(prop: string, label: string): SearchItem { + const tq = new SearchItem(prop, label); + tq.type = 'select'; + return tq; + } + + static date(prop: string, label: string): SearchItem { + const tq = new SearchItem(prop, label); + tq.type = 'date-picker'; + return tq; + } + + static slot(prop: string, label: string, slotName: string): SearchItem { + const tq = new SearchItem(prop, label); + tq.slot = slotName; + return tq; + } + + withSpan(span: number): SearchItem { + this.span = span; + return this; + } + + /** + * 设置枚举值用于选择等 + * @param enumValues 枚举值对象 + * @returns + */ + withEnum(enumValues: any): SearchItem { + this.options = Object.values(enumValues); + return this; + } + + setOptions(options: any): SearchItem { + this.options = options; + return this; + } +} diff --git a/mayfly_go_web/src/components/SearchForm/index.vue b/mayfly_go_web/src/components/SearchForm/index.vue new file mode 100644 index 00000000..1edfd0a2 --- /dev/null +++ b/mayfly_go_web/src/components/SearchForm/index.vue @@ -0,0 +1,136 @@ + + + diff --git a/mayfly_go_web/src/components/pagetable/PageTable.vue b/mayfly_go_web/src/components/pagetable/PageTable.vue index b8a4fc47..dbecc0e2 100644 --- a/mayfly_go_web/src/components/pagetable/PageTable.vue +++ b/mayfly_go_web/src/components/pagetable/PageTable.vue @@ -1,170 +1,112 @@