el-plus-crud 0.0.2

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.
Files changed (86) hide show
  1. package/.eslintignore +18 -0
  2. package/.eslintrc.js +78 -0
  3. package/.lintstagedrc +3 -0
  4. package/.prettierrc.js +39 -0
  5. package/CHANGELOG.md +5 -0
  6. package/LICENSE +21 -0
  7. package/README.md +15 -0
  8. package/example/App.vue +79 -0
  9. package/example/assets/vue.svg +1 -0
  10. package/example/main.js +18 -0
  11. package/example/style.css +5 -0
  12. package/index.html +13 -0
  13. package/lib/components/el-plus-form/ElPlusForm.vue +744 -0
  14. package/lib/components/el-plus-form/ElPlusFormDialog.vue +107 -0
  15. package/lib/components/el-plus-form/components/ElPlusFormAutocomplete.vue +49 -0
  16. package/lib/components/el-plus-form/components/ElPlusFormBtn.vue +96 -0
  17. package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +133 -0
  18. package/lib/components/el-plus-form/components/ElPlusFormCascader.vue +38 -0
  19. package/lib/components/el-plus-form/components/ElPlusFormCascaderPanel.vue +51 -0
  20. package/lib/components/el-plus-form/components/ElPlusFormCheckbox.vue +42 -0
  21. package/lib/components/el-plus-form/components/ElPlusFormCheckboxButton.vue +42 -0
  22. package/lib/components/el-plus-form/components/ElPlusFormColor.vue +38 -0
  23. package/lib/components/el-plus-form/components/ElPlusFormDate.vue +37 -0
  24. package/lib/components/el-plus-form/components/ElPlusFormDaterange.vue +44 -0
  25. package/lib/components/el-plus-form/components/ElPlusFormDatetime.vue +38 -0
  26. package/lib/components/el-plus-form/components/ElPlusFormFile.vue +47 -0
  27. package/lib/components/el-plus-form/components/ElPlusFormImage.vue +113 -0
  28. package/lib/components/el-plus-form/components/ElPlusFormInput.vue +56 -0
  29. package/lib/components/el-plus-form/components/ElPlusFormLink.vue +271 -0
  30. package/lib/components/el-plus-form/components/ElPlusFormNbinput.vue +51 -0
  31. package/lib/components/el-plus-form/components/ElPlusFormNumber.vue +107 -0
  32. package/lib/components/el-plus-form/components/ElPlusFormPassword.vue +39 -0
  33. package/lib/components/el-plus-form/components/ElPlusFormRadio.vue +42 -0
  34. package/lib/components/el-plus-form/components/ElPlusFormRate.vue +38 -0
  35. package/lib/components/el-plus-form/components/ElPlusFormSelect.vue +149 -0
  36. package/lib/components/el-plus-form/components/ElPlusFormSlider.vue +38 -0
  37. package/lib/components/el-plus-form/components/ElPlusFormStatus.vue +67 -0
  38. package/lib/components/el-plus-form/components/ElPlusFormSwitch.vue +38 -0
  39. package/lib/components/el-plus-form/components/ElPlusFormTag.vue +78 -0
  40. package/lib/components/el-plus-form/components/ElPlusFormText.vue +115 -0
  41. package/lib/components/el-plus-form/components/ElPlusFormTextarea.vue +45 -0
  42. package/lib/components/el-plus-form/components/ElPlusFormTransfer.vue +44 -0
  43. package/lib/components/el-plus-form/components/ElPlusFormTree.vue +53 -0
  44. package/lib/components/el-plus-form/components/ElPlusFormTreeSelect.vue +36 -0
  45. package/lib/components/el-plus-form/components/components/IconSelectorList.vue +92 -0
  46. package/lib/components/el-plus-form/components/components/file-icons/FileIcons.vue +135 -0
  47. package/lib/components/el-plus-form/components/components/file-icons/data/index.ts +27 -0
  48. package/lib/components/el-plus-form/components/components/file-icons/images/doc.svg +13 -0
  49. package/lib/components/el-plus-form/components/components/file-icons/images/file.svg +19 -0
  50. package/lib/components/el-plus-form/components/components/file-icons/images/jpg.svg +14 -0
  51. package/lib/components/el-plus-form/components/components/file-icons/images/pdf.svg +13 -0
  52. package/lib/components/el-plus-form/components/components/file-icons/images/png.svg +13 -0
  53. package/lib/components/el-plus-form/components/components/file-icons/images/ppt.svg +13 -0
  54. package/lib/components/el-plus-form/components/components/file-icons/images/xls.svg +13 -0
  55. package/lib/components/el-plus-form/components/index.ts +17 -0
  56. package/lib/components/el-plus-form/data/file.ts +74 -0
  57. package/lib/components/el-plus-form/images/icon/excel.png +0 -0
  58. package/lib/components/el-plus-form/images/icon/file.png +0 -0
  59. package/lib/components/el-plus-form/images/icon/pdf.png +0 -0
  60. package/lib/components/el-plus-form/images/icon/ppt.png +0 -0
  61. package/lib/components/el-plus-form/images/icon/txt.png +0 -0
  62. package/lib/components/el-plus-form/images/icon/word.png +0 -0
  63. package/lib/components/el-plus-form/images/icon/zip.png +0 -0
  64. package/lib/components/el-plus-form/mixins/index.ts +113 -0
  65. package/lib/components/el-plus-form/util/index.ts +266 -0
  66. package/lib/components/el-plus-form/util/validate.ts +310 -0
  67. package/lib/components/el-plus-table/ElPlusTable.vue +723 -0
  68. package/lib/components/el-plus-table/components/columnItem.vue +185 -0
  69. package/lib/components/el-plus-table/components/header.vue +185 -0
  70. package/lib/components/el-plus-table/components/settingColumn.vue +168 -0
  71. package/lib/components/el-plus-table/components/statisticInfo.vue +47 -0
  72. package/lib/components/el-plus-table/util/index.ts +123 -0
  73. package/lib/config/form.ts +12 -0
  74. package/lib/config/index.ts +9 -0
  75. package/lib/index.ts +29 -0
  76. package/package.json +65 -0
  77. package/public/vite.svg +1 -0
  78. package/tsconfig.json +68 -0
  79. package/types/axios.d.ts +13 -0
  80. package/types/formList.d.ts +365 -0
  81. package/types/global.d.ts +145 -0
  82. package/types/layout.d.ts +57 -0
  83. package/types/mitt.d.ts +38 -0
  84. package/types/pinia.d.ts +149 -0
  85. package/types/views.d.ts +329 -0
  86. package/vite.config.ts +68 -0
@@ -0,0 +1,12 @@
1
+ // 表单全局配置
2
+
3
+ export const form_input_max_length = 20
4
+ export const form_input_small_max_length = 10
5
+ export const form_input_big_max_length = 100
6
+ export const form_input_three_max_length = 300
7
+ export const form_input_long_max_length = 500
8
+ export const form_textarea_max_length = 500
9
+ export const form_number_input_conf = { min: 0, max: 999999999, precision: 0, controlsPosition: 'right' }
10
+ export const form_number_input_price_conf = { min: 0, max: 99999999, precision: 2, controlsPosition: 'right' }
11
+ export const form_number_input_price4_conf = { min: 0, max: 99999999, precision: 4, controlsPosition: 'right' }
12
+ export const form_number_input_double_conf = { min: 0, max: 1, precision: 4, controlsPosition: 'right' }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 上传大小限制
3
+ * @type {string}
4
+ */
5
+ export const uploadImgMaxSize = 2 * 1024 * 1024
6
+ export const uploadFileMaxSize = 20 * 1024 * 1024
7
+
8
+ // form配置
9
+ export * from './form'
package/lib/index.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { App } from 'vue'
2
+ import ElPlusForm from './components/el-plus-form/ElPlusForm.vue'
3
+ import ElPlusFormDialog from './components/el-plus-form/ElPlusFormDialog.vue'
4
+ import { components } from './components/el-plus-form/components/index'
5
+ import ElPlusTable from './components/el-plus-table/ElPlusTable.vue'
6
+
7
+ export default {
8
+ install: (app: App, format?: { [key: string]: Function }) => {
9
+ // 这里注入format对象
10
+ app.provide('format', format)
11
+ app.provide('globalData', { aaa: [] })
12
+ // app.config.globalProperties.$epfFormat = { ...format }
13
+
14
+ // 循环注册表单组件
15
+ components.unshift(ElPlusForm)
16
+ components.unshift(ElPlusFormDialog)
17
+
18
+ // 注册列表组件
19
+ components.push(ElPlusTable)
20
+
21
+ console.log('components: ', components)
22
+
23
+ components.map((component: any) => {
24
+ app.component(component.name, component)
25
+ })
26
+
27
+ console.log('app: ', app)
28
+ }
29
+ }
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "el-plus-crud",
3
+ "description": "采用Vue3 + TS,封装的element-plus数据驱动表单、列表组件",
4
+ "author": "K.D.Jack",
5
+ "version": "0.0.2",
6
+ "license": "MIT",
7
+ "private": false,
8
+ "main": "dist/el-plus-crud.umd.cjs",
9
+ "scripts": {
10
+ "start": "vite",
11
+ "build": "vite build",
12
+ "lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue lib/",
13
+ "preview": "vite preview",
14
+ "release": "standard-version",
15
+ "prepare": "npx husky install && npx husky add .husky/pre-commit \"npx lint-staged\"",
16
+ "pub": "yarn build && yarn release && yarn publish"
17
+ },
18
+ "keywords": [
19
+ "element+",
20
+ "element plus",
21
+ "element plus form",
22
+ "element plus table",
23
+ "element plus crud",
24
+ "el-plus-form",
25
+ "el-plus-table",
26
+ "el-plus-crud"
27
+ ],
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/KDJack/el-plus-crud"
31
+ },
32
+ "dependencies": {
33
+ "@element-plus/icons-vue": "^2.1.0",
34
+ "element-plus": "^2.3.6",
35
+ "lodash": "^4.17.21",
36
+ "vue": "^3.2.47"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^20.3.1",
40
+ "@typescript-eslint/eslint-plugin": "^5.53.0",
41
+ "@typescript-eslint/parser": "^5.53.0",
42
+ "@vitejs/plugin-vue": "^4.1.0",
43
+ "@vue/eslint-config-standard": "^8.0.1",
44
+ "eslint": "^8.34.0",
45
+ "eslint-plugin-vue": "^9.9.0",
46
+ "husky": "^8.0.3",
47
+ "lint-staged": "^13.2.3",
48
+ "prettier": "^3.0.0",
49
+ "sass": "^1.58.3",
50
+ "standard-version": "^9.5.0",
51
+ "typescript": "^4.9.5",
52
+ "vite": "^4.3.9",
53
+ "vite-plugin-vue-setup-extend": "^0.4.0",
54
+ "vue-eslint-parser": "^9.1.0"
55
+ },
56
+ "browserslist": [
57
+ "> 1%",
58
+ "last 2 versions",
59
+ "not dead"
60
+ ],
61
+ "engines": {
62
+ "node": ">=16.0.0",
63
+ "npm": ">= 7.0.0"
64
+ }
65
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/tsconfig.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
+ /* Basic Options */
5
+ // "incremental": true, /* Enable incremental compilation */
6
+ "target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
7
+ "module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
8
+ "lib": ["esnext", "dom", "dom.iterable", "scripthost"] /* Specify library files to be included in the compilation. */,
9
+ // "allowJs": true, /* Allow javascript files to be compiled. */
10
+ // "checkJs": true, /* Report errors in .js files. */
11
+ "jsx": "preserve" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
12
+ // "declaration": true /* Generates corresponding '.d.ts' file. */,
13
+ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
14
+ // "sourceMap": true, /* Generates corresponding '.map' file. */
15
+ // "outFile": "./", /* Concatenate and emit output to single file. */
16
+ // "outDir": "./", /* Redirect output structure to the directory. */
17
+ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
18
+ // "composite": true, /* Enable project compilation */
19
+ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
20
+ // "removeComments": true, /* Do not emit comments to output. */
21
+ // "noEmit": true, /* Do not emit outputs. */
22
+ // "importHelpers": true /* Import emit helpers from 'tslib'. */,
23
+ // "downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */,
24
+ "isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,
25
+ /* Strict Type-Checking Options */
26
+ "strict": true /* Enable all strict type-checking options. */,
27
+ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
28
+ // "strictNullChecks": true, /* Enable strict null checks. */
29
+ // "strictFunctionTypes": true, /* Enable strict checking of function types. */
30
+ // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
31
+ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
32
+ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
33
+ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
34
+ /* Additional Checks */
35
+ // "noUnusedLocals": true, /* Report errors on unused locals. */
36
+ // "noUnusedParameters": true, /* Report errors on unused parameters. */
37
+ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
38
+ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
39
+ // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
40
+ /* Module Resolution Options */
41
+ "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
42
+ "baseUrl": "." /* Base directory to resolve non-absolute module names. */,
43
+ "paths": {
44
+ "@/*": ["exame/*"]
45
+ } /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
46
+ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
47
+ // "typeRoots": [], /* List of folders to include type definitions from. */
48
+ "types": ["vite/client"] /* Type declaration files to be included in compilation. */,
49
+ "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
50
+ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
51
+ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
52
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
53
+ /* Source Map Options */
54
+ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
55
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
56
+ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
57
+ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
58
+ /* Experimental Options */
59
+ "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */,
60
+ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
61
+ /* Advanced Options */
62
+ "skipLibCheck": true /* Skip type checking of declaration files. */,
63
+ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
64
+ "suppressImplicitAnyIndexErrors": true
65
+ },
66
+ "include": ["types/*.d.ts", "lib/**/*.ts", "lib/**/*.vue", "lib/**/*.tsx", "lib/**/*.d.ts", "lib/views/home/activeInfo/.vue.ts"], // **Represents any directory, and * represents any file. Indicates that all files in the src directory will be compiled
67
+ "exclude": ["node_modules", "dist"] // Indicates the file directory that does not need to be compiled
68
+ }
@@ -0,0 +1,13 @@
1
+ /* eslint-disable */
2
+ import * as axios from 'axios'
3
+
4
+ // 扩展 axios 数据返回类型,可自行扩展
5
+ declare module 'axios' {
6
+ export interface AxiosResponse<T = any> {
7
+ code: number
8
+ data: T
9
+ message: string
10
+ type?: string
11
+ [key: string]: T
12
+ }
13
+ }
@@ -0,0 +1,365 @@
1
+ /**
2
+ * 表单描述
3
+ */
4
+ declare interface IFormDesc {
5
+ [key: string]: IFormDescItem
6
+ }
7
+
8
+ /**
9
+ * 表单项描述
10
+ */
11
+ declare interface IFormDescItem {
12
+ type: string
13
+ field?: string
14
+ label?: string | Function
15
+ prop?: string | Function
16
+ disabled?: boolean | Function
17
+ width?: string
18
+ format?: string | Function
19
+ showLabel?: boolean
20
+ labelWidth?: string | number
21
+ vif?: Function
22
+ tip?: string | Function
23
+ size?: string
24
+ placeholder?: string
25
+ attrs?: { [key: string]: any } | Function
26
+ options?: Array<IFormDescItemOptionItem> | IFetch<Array<IFormDescItemOptionItem>> | string
27
+ default?: string | boolean | number
28
+ rules?: string | Array<any>
29
+ require?: boolean
30
+ required?: boolean
31
+ valueFormat?: Function
32
+ isBlank?: boolean
33
+ colspan?: number
34
+ upType?: string
35
+ multiple?: boolean
36
+ noTip?: boolean
37
+ limit?: number
38
+ maxSize?: number
39
+ remote?: Function
40
+ // 如果是列表
41
+ tableConfig?: ITableConfig
42
+ tableAttr?: { [key: string]: any }
43
+ tableEvent?: { [key: string]: any }
44
+ // 查看详情
45
+ linkId?: string | ((val: any, formData: any) => string)
46
+ linkType?: string | ((val: any, formData: any) => string)
47
+ linkLabel?: string | ((val: any, formData: any) => string)
48
+ // 内部接口
49
+ _type?: string
50
+ _vif?: boolean
51
+ _tip?: string
52
+ _disabled?: boolean
53
+ _attrs?: { [key: string]: any }
54
+ _label?: null
55
+ _prop?: { [key: string]: any }
56
+ _options?: Array<IFormDescItemOptionItem>
57
+ // 其他属性
58
+ // 级联下拉是否只选中最后一级
59
+ checkStrictly?: boolean
60
+ }
61
+
62
+ /**
63
+ * option描述
64
+ */
65
+ declare interface IFormDescItemOptionItem {
66
+ l?: string
67
+ v?: string | number
68
+ label?: string
69
+ value?: string | number
70
+ children?: Array<IFormDescItemOptionItem>
71
+ }
72
+
73
+ /**
74
+ * 按钮回调data
75
+ */
76
+ declare interface IBtnBack {
77
+ row: { [key: string]: any }
78
+ callBack?: Function
79
+ field: string
80
+ rowIndex: number
81
+ }
82
+
83
+ /**
84
+ * 表单配置
85
+ */
86
+ declare interface IFormConfig {
87
+ // 表单描述对象
88
+ formDesc: IFormDesc
89
+ // 表单里面item的顺序
90
+ order?: Array<string>
91
+ // 表单的列数,默认是1
92
+ column?: number
93
+ // 请求地址
94
+ beforeRequest?: Function
95
+ // 请求地址
96
+ requestFn?: Function
97
+ // 更新的函数
98
+ updateFn?: Function
99
+ // 请求成功时
100
+ success?: Function
101
+ // 成功时的提醒文本
102
+ successTip?: string
103
+ // 列表的ref
104
+ tableRef?: any
105
+ }
106
+
107
+ /**
108
+ * 表单回调
109
+ */
110
+ declare interface IFormBack {
111
+ response?: any
112
+ formData?: { [key: string]: any }
113
+ callback: Function
114
+ }
115
+
116
+ /************************************列表************************************ */
117
+
118
+ declare interface IFetch<T> {
119
+ // 查询数据的方法,入参和返回格式固定
120
+ (data?: any): Promise<T | null>
121
+ }
122
+
123
+ /**
124
+ * 表格项
125
+ */
126
+ declare interface IColumnItem {
127
+ label: string
128
+ prop?: string
129
+ type?: string | Array<string>
130
+ width?: string
131
+ minWidth?: string
132
+ format?: string | Array<string>
133
+ color?: string | Array<string>
134
+ align?: string
135
+ headerAlign?: string
136
+ btns?: Array<Object>
137
+ isBatch?: Boolean
138
+ style?: Object
139
+ fixed?: 'left' | 'right'
140
+ limit?: number
141
+ count?: number
142
+ nodes?: Array<any>
143
+ inline?: Boolean
144
+ text?: Boolean
145
+ parent?: string
146
+ vif?: boolean | 0 | 1 | Function
147
+ _vif?: boolean
148
+ vshow?: boolean | 0 | 1 | Function
149
+ scShow?: boolean
150
+ showOverflowTooltip?: boolean
151
+ }
152
+
153
+ /**
154
+ * 导出项
155
+ */
156
+ declare interface IExportConfig {
157
+ // 导出的URL接口地址
158
+ url: string
159
+ // 请求夹带的数据
160
+ data?: Object
161
+ // 文件名
162
+ name?: string
163
+ // 是否增加token权限
164
+ isAuth?: Boolean
165
+ }
166
+
167
+ /**
168
+ * 列表工具
169
+ */
170
+ declare interface ITableToolbar {
171
+ // 列表顶部的功能按钮
172
+ btns?: Array<any>
173
+ // btn靠右显示, 只有当formConfig为null,可设置改属性
174
+ btnRight?: boolean
175
+ // 顶部查询条件的form
176
+ formConfig?: IFormConfig
177
+ // 顶部导出excel配置
178
+ export?: IExportConfig
179
+ }
180
+
181
+ /**
182
+ * 表单数解析
183
+ */
184
+ declare interface ITreeProps {
185
+ // 子集的key字段
186
+ children: string
187
+ // 是否拥有子集的key
188
+ hasChildren?: string
189
+ }
190
+
191
+ /**
192
+ * 展开配置
193
+ */
194
+ declare interface IExpConfig {
195
+ // 是否自动展开
196
+ isAutoLoadData?: Boolean
197
+ // 展开自身的查询主键的Id名称
198
+ idName?: string
199
+ // 渲染嵌套数据的配置选项
200
+ treeProps?: ITreeProps
201
+ // 需要查询的父类ID-展开类型的列表时采用;;
202
+ queryId?: string
203
+ }
204
+
205
+ /**
206
+ * 统计项
207
+ */
208
+ declare interface IStatisticConfig {
209
+ // 数据库对应字段
210
+ dbKeys: Array<string>
211
+ // 需要统计的字段信息
212
+ keys: Array<Object>
213
+ }
214
+
215
+ /**
216
+ * 列表的选项卡配置
217
+ */
218
+ declare interface ITableTabConf {
219
+ prop: string
220
+ tabs: Array<ITableTabItem>
221
+ attrs?: { [key: string]: any } | Function
222
+ // 远程拉取数量信息
223
+ fetch?: IFetch<PageObject<any>>
224
+ // 查询条件
225
+ queryMap?: any
226
+ }
227
+
228
+ /**
229
+ * 列表的选项配置
230
+ */
231
+ declare interface ITableTabItem {
232
+ label: string | Function
233
+ value: string | number
234
+ key?: string
235
+ }
236
+
237
+ /**
238
+ * 尾行合计配置
239
+ */
240
+ declare interface ISummaryConf {
241
+ // 尾行合计的属性名, 多个用逗号分割
242
+ prop: string
243
+ // 尾行合计的显示名称, 多个用逗号分割
244
+ label?: string
245
+ // 格式化
246
+ format?: string
247
+ // 尾行合计的合并方法
248
+ sumFn?: (tableData: any[]) => string
249
+ }
250
+
251
+ /**
252
+ * 列表配置
253
+ */
254
+ declare interface ITableConfig {
255
+ // 列表的名称,全局唯一,且固定,方便存储列表设置
256
+ tbName?: string
257
+ tabConf?: ITableTabConf
258
+ // 调用接口
259
+ fetch?: IFetch<any>
260
+ // 列表配置,包含表头,每列信息等
261
+ column: Array<IColumnItem>
262
+ // 查询条件
263
+ queryMap?: any
264
+ // 列表顶部的工具栏
265
+ toolbar?: ITableToolbar
266
+ // 每行自身展开配置项
267
+ explan?: IExplanConfig
268
+ // 针对每行的class进行单独控制
269
+ formatRowClass?: Function
270
+ // 如果数据返回有多级,那么这里就是解析的地方 比如 ['res', 'data', 'list'] 这说明,要获取的是请求返回数据中,rea.data.list 这个数据
271
+ dataListModel?: Array<string>
272
+ // 统计信息
273
+ statistic?: IStatisticConfig
274
+ // 最大高度
275
+ maxHeight?: number
276
+ // 表格属性
277
+ tableAttr?: any
278
+ // 显示选中项的名称Key
279
+ showSelectNameKey?: String
280
+ // 配置通用的合计行
281
+ summaryConf?: ISummaryConf
282
+ }
283
+
284
+ /**
285
+ * 对象存储Info
286
+ */
287
+ declare interface IOssInfo {
288
+ id?: string
289
+ name?: string
290
+ furl?: string
291
+ mimeType?: string
292
+ fsize?: number
293
+ suffix?: string
294
+ busId?: string
295
+ busType?: number
296
+ // upload组件需要的字段
297
+ url?: string
298
+ uid?: number
299
+ previewUrl?: string
300
+ shareUrl?: string
301
+ uploadId?: string
302
+ }
303
+
304
+ /************************************表单详情************************************ */
305
+ declare interface IFInfoGroupItem {
306
+ title?: string
307
+ // 表单描述对象
308
+ formDesc: IFormDesc
309
+ // 表单的列数,默认是1
310
+ column?: number
311
+ // 最大宽度
312
+ maxWidth?: string
313
+ // 是否是表格
314
+ isTable?: boolean
315
+ // labelWidth
316
+ labelWidth?: string
317
+ }
318
+
319
+ /************************************批量下载************************************ */
320
+ /**
321
+ * 文件(夹)信息
322
+ */
323
+ declare interface IFiles {
324
+ id: string
325
+ // 是否是文件夹
326
+ folder?: 0 | 1
327
+ // 文件(夹)名称
328
+ name: string
329
+ // 文件地址
330
+ url?: string
331
+ // 文件夹中的文件列表
332
+ files?: Array<IFiles>
333
+ }
334
+
335
+ /**
336
+ * 下载信息
337
+ */
338
+ declare interface IDownInfo {
339
+ // 文件名
340
+ name: string
341
+ // 到期时间
342
+ endData?: string
343
+ // 来源
344
+ sc?: string
345
+ // 状态:1可下载;2已过期;3已删除;4无权限; 5无效
346
+ status: 1 | 2 | 3 | 4 | 5
347
+ // 是否zip压缩,如果不是压缩,则默认下载files[0]
348
+ zip: 0 | 1
349
+ // 文件列表
350
+ files: Array<IFiles>
351
+ }
352
+
353
+ /**
354
+ * 下载文件信息
355
+ */
356
+ declare interface IDownFile {
357
+ // 文件名
358
+ name: string
359
+ // 文件夹名
360
+ folder: string
361
+ // 文件地址
362
+ url: string
363
+ // 上传进度
364
+ percent?: number
365
+ }