el-plus-crud 0.0.95 → 0.0.96
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.
- package/.eslintignore +18 -17
- package/.eslintrc.js +78 -78
- package/.lintstagedrc +3 -3
- package/.prettierrc.js +39 -39
- package/CHANGELOG.md +111 -109
- package/LICENSE +21 -21
- package/README.md +127 -127
- package/build.js +31 -31
- package/dist/el-plus-crud.mjs +2633 -6283
- package/example/App.vue +252 -252
- package/example/main.js +18 -18
- package/example/style.css +4 -4
- package/index.html +13 -13
- package/lib/components/el-plus-form/ElPlusForm.vue +1 -3
- package/lib/components/el-plus-form/ElPlusFormGroup.vue +1 -1
- package/lib/components/el-plus-form/components/ElPlusFormArea.vue +60 -62
- package/lib/components/el-plus-form/components/ElPlusFormAutocomplete.vue +48 -49
- package/lib/components/el-plus-form/components/ElPlusFormBtn.vue +22 -22
- package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +8 -8
- package/lib/components/el-plus-form/components/ElPlusFormCascader.vue +63 -64
- package/lib/components/el-plus-form/components/ElPlusFormCascaderPanel.vue +70 -71
- package/lib/components/el-plus-form/components/ElPlusFormCheckbox.vue +5 -6
- package/lib/components/el-plus-form/components/ElPlusFormCheckboxButton.vue +44 -45
- package/lib/components/el-plus-form/components/ElPlusFormColor.vue +37 -39
- package/lib/components/el-plus-form/components/ElPlusFormDate.vue +39 -40
- package/lib/components/el-plus-form/components/ElPlusFormDaterange.vue +46 -47
- package/lib/components/el-plus-form/components/ElPlusFormDatetime.vue +40 -41
- package/lib/components/el-plus-form/components/ElPlusFormDatetimerange.vue +46 -47
- package/lib/components/el-plus-form/components/ElPlusFormFile.vue +2 -2
- package/lib/components/el-plus-form/components/ElPlusFormImage.vue +117 -117
- package/lib/components/el-plus-form/components/ElPlusFormInput.vue +3 -4
- package/lib/components/el-plus-form/components/ElPlusFormLink.vue +6 -6
- package/lib/components/el-plus-form/components/ElPlusFormLkuser.vue +6 -6
- package/lib/components/el-plus-form/components/ElPlusFormNbinput.vue +53 -54
- package/lib/components/el-plus-form/components/ElPlusFormNumber.vue +19 -12
- package/lib/components/el-plus-form/components/ElPlusFormPassword.vue +3 -4
- package/lib/components/el-plus-form/components/ElPlusFormQuickInput.vue +6 -7
- package/lib/components/el-plus-form/components/ElPlusFormRadio.vue +67 -68
- package/lib/components/el-plus-form/components/ElPlusFormRate.vue +53 -54
- package/lib/components/el-plus-form/components/ElPlusFormSelect.vue +31 -19
- package/lib/components/el-plus-form/components/ElPlusFormSlider.vue +38 -39
- package/lib/components/el-plus-form/components/ElPlusFormStatus.vue +7 -7
- package/lib/components/el-plus-form/components/ElPlusFormSwitch.vue +4 -5
- package/lib/components/el-plus-form/components/ElPlusFormTag.vue +6 -6
- package/lib/components/el-plus-form/components/ElPlusFormText.vue +109 -99
- package/lib/components/el-plus-form/components/ElPlusFormTextarea.vue +3 -4
- package/lib/components/el-plus-form/components/ElPlusFormTime.vue +3 -4
- package/lib/components/el-plus-form/components/ElPlusFormTimerange.vue +3 -4
- package/lib/components/el-plus-form/components/ElPlusFormTransfer.vue +44 -45
- package/lib/components/el-plus-form/components/ElPlusFormTree.vue +76 -77
- package/lib/components/el-plus-form/components/ElPlusFormTreeSelect.vue +59 -60
- package/lib/components/el-plus-form/components/ElPlusFormUpbtn.vue +6 -6
- package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +4 -5
- package/lib/components/el-plus-form/components/components/file-icons/data/index.ts +27 -27
- package/lib/components/el-plus-form/components/components/file-icons/images/doc.svg +12 -12
- package/lib/components/el-plus-form/components/components/file-icons/images/file.svg +18 -18
- package/lib/components/el-plus-form/components/components/file-icons/images/jpg.svg +13 -13
- package/lib/components/el-plus-form/components/components/file-icons/images/pdf.svg +12 -12
- package/lib/components/el-plus-form/components/components/file-icons/images/png.svg +12 -12
- package/lib/components/el-plus-form/components/components/file-icons/images/ppt.svg +12 -12
- package/lib/components/el-plus-form/components/components/file-icons/images/xls.svg +12 -12
- package/lib/components/el-plus-form/components/index.ts +17 -17
- package/lib/components/el-plus-form/data/file.ts +74 -74
- package/lib/components/el-plus-form/mixins/index.ts +6 -3
- package/lib/components/el-plus-form/util/index.ts +51 -0
- package/lib/components/el-plus-table/ElPlusTable.vue +899 -897
- package/lib/components/el-plus-table/ElPlusTableColumn.vue +1 -1
- package/lib/components/el-plus-table/components/columnItem.vue +4 -2
- package/lib/components/el-plus-table/components/settingColumn.vue +172 -172
- package/lib/components/el-plus-table/components/statisticInfo.vue +47 -47
- package/lib/components/el-plus-table/util/index.ts +21 -1
- package/lib/config/index.ts +22 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.ts +2 -2
- package/package-lock.json +8101 -8101
- package/package.json +70 -71
- package/tsconfig.json +78 -78
- package/types/index.d.ts +30 -5
- package/vite.config.ts +78 -78
package/README.md
CHANGED
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
# El-Plus-Curd 采用Vue3 + TS,封装的element-plus数据驱动表单、列表组件
|
|
2
|
-
|
|
3
|
-
# By K.D.Jack
|
|
4
|
-
|
|
5
|
-
# 项目环境要求
|
|
6
|
-
|
|
7
|
-
-NodeJs 版本:16.18.1
|
|
8
|
-
|
|
9
|
-
-代码格式化插件:prettier
|
|
10
|
-
|
|
11
|
-
# demo运行
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
yarn && yarn start
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
# 使用
|
|
18
|
-
|
|
19
|
-
## 1.安装依赖
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
npm i el-plus-crud -S
|
|
23
|
-
(or)
|
|
24
|
-
yarn add el-plus-crud -S
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## 2.全局引入 (main.js)
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
...
|
|
31
|
-
import ElPlusCrud from 'el-plus-crud'
|
|
32
|
-
...
|
|
33
|
-
|
|
34
|
-
const crudConfig = {
|
|
35
|
-
// 全局配置...
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// 全局Data数据
|
|
39
|
-
const globalData = reactive({
|
|
40
|
-
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
const formatData = reactive({
|
|
44
|
-
// 全局format
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
...
|
|
48
|
-
app.use(ElPlusCrud, crudConfig, readonly(formatData), readonly(globalData))
|
|
49
|
-
...
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## 3.vue引用
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
...
|
|
56
|
-
<ElPlusTable ref="listTableRef" :tableConfig="tableConfig"></ElPlusTable>
|
|
57
|
-
...
|
|
58
|
-
|
|
59
|
-
...
|
|
60
|
-
const listTableRef = ref()
|
|
61
|
-
const tableConfig = ref({
|
|
62
|
-
// 远程列表查询
|
|
63
|
-
fetch: () => {},
|
|
64
|
-
// 列表-列配置
|
|
65
|
-
column: [
|
|
66
|
-
{ prop: 'username', label: '账号' },
|
|
67
|
-
{ prop: 'nickname', label: '名称' },
|
|
68
|
-
{ prop: 'phone', label: '联系电话' },
|
|
69
|
-
{ prop: 'deptName', label: '所属部门' },
|
|
70
|
-
{ prop: 'remark', label: '备注' },
|
|
71
|
-
{ prop: 'createTime', label: '创建时间' },
|
|
72
|
-
{ prop: 'createBy', label: '创建人' },
|
|
73
|
-
{
|
|
74
|
-
label: '操作',
|
|
75
|
-
fixed: 'right',
|
|
76
|
-
type: 'btns',
|
|
77
|
-
btns: [
|
|
78
|
-
{ label: '查看详情', on: {} },
|
|
79
|
-
{ label: '编辑', on: {} },
|
|
80
|
-
{
|
|
81
|
-
label: '删除',
|
|
82
|
-
confirm: '确定要删除?',
|
|
83
|
-
btnType: 'danger',
|
|
84
|
-
on: {}
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
// 固定查询条件
|
|
90
|
-
queryMap: {},
|
|
91
|
-
// 顶部工具栏
|
|
92
|
-
toolbar: {
|
|
93
|
-
// 功能按钮列表
|
|
94
|
-
btns: [
|
|
95
|
-
{
|
|
96
|
-
label: '新增人员',
|
|
97
|
-
type: 'add',
|
|
98
|
-
on: {}
|
|
99
|
-
}
|
|
100
|
-
],
|
|
101
|
-
// 顶部查询表单
|
|
102
|
-
formConfig: {
|
|
103
|
-
beforeRequest: (data: any) => {
|
|
104
|
-
if (data.deptId) {
|
|
105
|
-
data.deptId = data.deptId[data.deptId.length - 1]
|
|
106
|
-
}
|
|
107
|
-
return data
|
|
108
|
-
},
|
|
109
|
-
formDesc: {
|
|
110
|
-
nickname: { type: 'input', label: '输入查询', placeholder: '人员名称' },
|
|
111
|
-
deptId: { type: 'cascader', label: '所属部门', options: deptOptions, attrs: { props: { value: 'id', label: 'name', children: 'children', checkStrictly: true } } },
|
|
112
|
-
enabled: {
|
|
113
|
-
type: 'select',
|
|
114
|
-
label: '状态',
|
|
115
|
-
options: [
|
|
116
|
-
{ label: '已禁用', value: 0 },
|
|
117
|
-
{ label: '已启用', value: 1 }
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
})
|
|
124
|
-
...
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
# TODO 接口文档
|
|
1
|
+
# El-Plus-Curd 采用Vue3 + TS,封装的element-plus数据驱动表单、列表组件
|
|
2
|
+
|
|
3
|
+
# By K.D.Jack
|
|
4
|
+
|
|
5
|
+
# 项目环境要求
|
|
6
|
+
|
|
7
|
+
-NodeJs 版本:16.18.1
|
|
8
|
+
|
|
9
|
+
-代码格式化插件:prettier
|
|
10
|
+
|
|
11
|
+
# demo运行
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
yarn && yarn start
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
# 使用
|
|
18
|
+
|
|
19
|
+
## 1.安装依赖
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
npm i el-plus-crud -S
|
|
23
|
+
(or)
|
|
24
|
+
yarn add el-plus-crud -S
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 2.全局引入 (main.js)
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
...
|
|
31
|
+
import ElPlusCrud from 'el-plus-crud'
|
|
32
|
+
...
|
|
33
|
+
|
|
34
|
+
const crudConfig = {
|
|
35
|
+
// 全局配置...
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// 全局Data数据
|
|
39
|
+
const globalData = reactive({
|
|
40
|
+
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const formatData = reactive({
|
|
44
|
+
// 全局format
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
...
|
|
48
|
+
app.use(ElPlusCrud, crudConfig, readonly(formatData), readonly(globalData))
|
|
49
|
+
...
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 3.vue引用
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
...
|
|
56
|
+
<ElPlusTable ref="listTableRef" :tableConfig="tableConfig"></ElPlusTable>
|
|
57
|
+
...
|
|
58
|
+
|
|
59
|
+
...
|
|
60
|
+
const listTableRef = ref()
|
|
61
|
+
const tableConfig = ref({
|
|
62
|
+
// 远程列表查询
|
|
63
|
+
fetch: () => {},
|
|
64
|
+
// 列表-列配置
|
|
65
|
+
column: [
|
|
66
|
+
{ prop: 'username', label: '账号' },
|
|
67
|
+
{ prop: 'nickname', label: '名称' },
|
|
68
|
+
{ prop: 'phone', label: '联系电话' },
|
|
69
|
+
{ prop: 'deptName', label: '所属部门' },
|
|
70
|
+
{ prop: 'remark', label: '备注' },
|
|
71
|
+
{ prop: 'createTime', label: '创建时间' },
|
|
72
|
+
{ prop: 'createBy', label: '创建人' },
|
|
73
|
+
{
|
|
74
|
+
label: '操作',
|
|
75
|
+
fixed: 'right',
|
|
76
|
+
type: 'btns',
|
|
77
|
+
btns: [
|
|
78
|
+
{ label: '查看详情', on: {} },
|
|
79
|
+
{ label: '编辑', on: {} },
|
|
80
|
+
{
|
|
81
|
+
label: '删除',
|
|
82
|
+
confirm: '确定要删除?',
|
|
83
|
+
btnType: 'danger',
|
|
84
|
+
on: {}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
// 固定查询条件
|
|
90
|
+
queryMap: {},
|
|
91
|
+
// 顶部工具栏
|
|
92
|
+
toolbar: {
|
|
93
|
+
// 功能按钮列表
|
|
94
|
+
btns: [
|
|
95
|
+
{
|
|
96
|
+
label: '新增人员',
|
|
97
|
+
type: 'add',
|
|
98
|
+
on: {}
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
// 顶部查询表单
|
|
102
|
+
formConfig: {
|
|
103
|
+
beforeRequest: (data: any) => {
|
|
104
|
+
if (data.deptId) {
|
|
105
|
+
data.deptId = data.deptId[data.deptId.length - 1]
|
|
106
|
+
}
|
|
107
|
+
return data
|
|
108
|
+
},
|
|
109
|
+
formDesc: {
|
|
110
|
+
nickname: { type: 'input', label: '输入查询', placeholder: '人员名称' },
|
|
111
|
+
deptId: { type: 'cascader', label: '所属部门', options: deptOptions, attrs: { props: { value: 'id', label: 'name', children: 'children', checkStrictly: true } } },
|
|
112
|
+
enabled: {
|
|
113
|
+
type: 'select',
|
|
114
|
+
label: '状态',
|
|
115
|
+
options: [
|
|
116
|
+
{ label: '已禁用', value: 0 },
|
|
117
|
+
{ label: '已启用', value: 1 }
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
...
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
# TODO 接口文档
|
package/build.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
var fs = require('fs')
|
|
2
|
-
const { join } = require('path')
|
|
3
|
-
|
|
4
|
-
var tempStr = "import ${name} from './components/el-plus-form/components/${name}.vue'\n"
|
|
5
|
-
var componentsPath = './lib/components/el-plus-form/components'
|
|
6
|
-
|
|
7
|
-
var fileStr = ''
|
|
8
|
-
|
|
9
|
-
let files = fs.readdirSync(componentsPath)
|
|
10
|
-
const compList = []
|
|
11
|
-
|
|
12
|
-
files.forEach(function (item) {
|
|
13
|
-
let stat = fs.statSync(join(componentsPath, item))
|
|
14
|
-
if (stat.isFile() === true && item.indexOf('.vue') >= 0) {
|
|
15
|
-
compList.push(item.replace('.vue', ''))
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
compList.map((name) => {
|
|
20
|
-
fileStr += tempStr.replaceAll('${name}', name)
|
|
21
|
-
})
|
|
22
|
-
fileStr += '\nexport default [\n'
|
|
23
|
-
compList.map((name) => {
|
|
24
|
-
fileStr += ` ${name},\n`
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
fileStr += '] as any[]'
|
|
28
|
-
|
|
29
|
-
// eslint-disable-next-line no-console
|
|
30
|
-
console.log(`写入components-list......`)
|
|
31
|
-
fs.writeFileSync('./lib/components-list.ts', fileStr)
|
|
1
|
+
var fs = require('fs')
|
|
2
|
+
const { join } = require('path')
|
|
3
|
+
|
|
4
|
+
var tempStr = "import ${name} from './components/el-plus-form/components/${name}.vue'\n"
|
|
5
|
+
var componentsPath = './lib/components/el-plus-form/components'
|
|
6
|
+
|
|
7
|
+
var fileStr = ''
|
|
8
|
+
|
|
9
|
+
let files = fs.readdirSync(componentsPath)
|
|
10
|
+
const compList = []
|
|
11
|
+
|
|
12
|
+
files.forEach(function (item) {
|
|
13
|
+
let stat = fs.statSync(join(componentsPath, item))
|
|
14
|
+
if (stat.isFile() === true && item.indexOf('.vue') >= 0) {
|
|
15
|
+
compList.push(item.replace('.vue', ''))
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
compList.map((name) => {
|
|
20
|
+
fileStr += tempStr.replaceAll('${name}', name)
|
|
21
|
+
})
|
|
22
|
+
fileStr += '\nexport default [\n'
|
|
23
|
+
compList.map((name) => {
|
|
24
|
+
fileStr += ` ${name},\n`
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
fileStr += '] as any[]'
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line no-console
|
|
30
|
+
console.log(`写入components-list......`)
|
|
31
|
+
fs.writeFileSync('./lib/components-list.ts', fileStr)
|