easybill-ui 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,12 +2,14 @@ import { FormRules, FormItemRule, FormProps } from "element-plus"
2
2
  import { PropType } from "vue"
3
3
  import { OptionItem } from "../../ConstantStatus"
4
4
  import { defineComponent } from "vue"
5
- export interface FormSchema extends FormProps {
5
+ export interface FormSchema extends Partial<FormProps> {
6
6
  formItem: Array<FormItem>
7
7
  rules?: FormRules
8
+ labelPosition?: "left" | "right" | "top"
9
+ gutter?: number
8
10
  }
9
11
  export interface FormItem {
10
- prop?: string
12
+ prop: string
11
13
  label?: string
12
14
  type?: typeEmun | ReturnType<typeof defineComponent>
13
15
  value?: any
@@ -112,7 +112,7 @@ import STableDetail from "./STableDetail.vue"
112
112
  import STableSinglePage from "./STableSinglePage.vue"
113
113
  import { deepClone } from "../utils/common"
114
114
  import { Edit, Delete, Plus, ArrowDown, Document } from "@element-plus/icons-vue"
115
- import { ColumnItem, PropOption, TableAttr, FetchDataOpt } from "./types"
115
+ import { ColumnItem, PropOption, TableAttr, FetchDataOpt, MenuEventKey } from "./types"
116
116
  import TableFilter, { ListQuery } from "../../TableFilter"
117
117
  import FormDialog from "../../FormDialog"
118
118
  import { ElMessageBox, ElMessage, ElLoading, ElNotification, ElTable, dayjs } from "element-plus"
@@ -292,8 +292,11 @@ option.autoload && fetchData()
292
292
  // 组装columns
293
293
  const { columns, selectParams } = useColumnHook(props)
294
294
  // 菜单点击事件
295
- const onMenuOption = (option: string, val: string) => {
296
- switch (option) {
295
+ const onMenuOption = (optionKey: MenuEventKey, val: string) => {
296
+ if (option.menuEvent?.[optionKey]) {
297
+ return option.menuEvent?.[optionKey]()
298
+ }
299
+ switch (optionKey) {
297
300
  case "refresh":
298
301
  fetchData()
299
302
  break
@@ -437,6 +440,7 @@ defineExpose({
437
440
  setPageIndex,
438
441
  setTotal,
439
442
  search,
443
+ listQuery,
440
444
  getEl() {
441
445
  return instance?.proxy?.$el
442
446
  },
@@ -66,7 +66,9 @@ export interface PropOption {
66
66
  filterVisible?: boolean
67
67
  customActivatedFetch?: boolean // 自定义执行onActivated内部的fetch执行,完全交由父组件控制
68
68
  autoload?: boolean
69
+ menuEvent?: Record<MenuEventKey, () => void>
69
70
  }
71
+ export type MenuEventKey = "refresh" | "searchToggle" | "size" | "export" | "operation"
70
72
 
71
73
  export interface ColumnItemFilter {
72
74
  inner?: boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easybill-ui",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "A component library for easybill",
5
5
  "author": "tuchongyang <779311998@qq.com>",
6
6
  "private": false,
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "gitHead": "11c96dd414489bc4ed8746a58deeff7e3333ecb7"
17
+ "gitHead": "f41aee744b7b9a741e40e2558fdb7486438b8f7a"
18
18
  }