vue-super-crud 1.7.1 → 1.7.4
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/README.md +42 -10
- package/lib/index.css +1 -1
- package/lib/super-crud.min.js +2 -2
- package/package.json +21 -16
- package/src/config/common.js +2 -1
- package/src/config/crud.js +3 -3
- package/src/index.js +4 -0
- package/src/template/formatData.js +75 -87
- package/.browserslistrc +0 -3
- package/.versionrc.json +0 -36
- package/CHANGELOG.md +0 -232
- package/babel.config.js +0 -12
- package/build/alias.js +0 -10
- package/build/build.js +0 -52
- package/build/config.js +0 -70
- package/deploy.bat +0 -14
- package/docs/.vuepress/components/button/base.vue +0 -88
- package/docs/.vuepress/components/common/code-format.vue +0 -331
- package/docs/.vuepress/components/commonConfig/presetCodeTemplate/base.vue +0 -68
- package/docs/.vuepress/components/commonConfig/presetCodeTemplate/customParams.vue +0 -73
- package/docs/.vuepress/components/commonConfig/renderType/component.vue +0 -160
- package/docs/.vuepress/components/commonConfig/renderType/formatter.vue +0 -49
- package/docs/.vuepress/components/commonConfig/renderType/render.vue +0 -91
- package/docs/.vuepress/components/commonConfig/renderType/slot.vue +0 -63
- package/docs/.vuepress/components/crud/baseUse/baseUse.vue +0 -98
- package/docs/.vuepress/components/crud/baseUse/columnAction.vue +0 -72
- package/docs/.vuepress/components/crud/baseUse/columnWidth.vue +0 -107
- package/docs/.vuepress/components/crud/baseUse/handleRow.vue +0 -65
- package/docs/.vuepress/components/crud/baseUse/height.vue +0 -82
- package/docs/.vuepress/components/crud/baseUse/index.vue +0 -54
- package/docs/.vuepress/components/crud/baseUse/loading.vue +0 -70
- package/docs/.vuepress/components/crud/baseUse/pagination.vue +0 -108
- package/docs/.vuepress/components/crud/baseUse/selection.vue +0 -114
- package/docs/.vuepress/components/crud/baseUse/summaryMethod.vue +0 -118
- package/docs/.vuepress/components/crud/baseUse/title.vue +0 -54
- package/docs/.vuepress/components/crud/baseUse/toolbar.vue +0 -69
- package/docs/.vuepress/components/crud/buttons/common.vue +0 -115
- package/docs/.vuepress/components/crud/buttons/fast.vue +0 -82
- package/docs/.vuepress/components/crud/contextMenu/base.vue +0 -72
- package/docs/.vuepress/components/crud/copy.vue +0 -52
- package/docs/.vuepress/components/crud/crudEvents/api.vue +0 -157
- package/docs/.vuepress/components/crud/crudEvents/deleteTip.vue +0 -93
- package/docs/.vuepress/components/crud/crudEvents/events.vue +0 -188
- package/docs/.vuepress/components/crud/dataSort/base.vue +0 -142
- package/docs/.vuepress/components/crud/genDynamicColumns/base.vue +0 -53
- package/docs/.vuepress/components/crud/genDynamicColumns/dynamicAndFixed.vue +0 -111
- package/docs/.vuepress/components/crud/genDynamicColumns/treeDynamic.vue +0 -68
- package/docs/.vuepress/components/crud/handleBar/handleRow.vue +0 -65
- package/docs/.vuepress/components/crud/handleBar/toolbar.vue +0 -69
- package/docs/.vuepress/components/crud/renderType/1.vue +0 -57
- package/docs/.vuepress/components/crud/renderType/2.vue +0 -63
- package/docs/.vuepress/components/crud/renderType/3.vue +0 -105
- package/docs/.vuepress/components/crud/renderType/5.vue +0 -91
- package/docs/.vuepress/components/crud/search/1.vue +0 -90
- package/docs/.vuepress/components/crud/search/2.vue +0 -78
- package/docs/.vuepress/components/crud/search/3.vue +0 -107
- package/docs/.vuepress/components/crud/search/base.vue +0 -123
- package/docs/.vuepress/components/crud/search/localSearch.vue +0 -124
- package/docs/.vuepress/components/crud/search/special.vue +0 -148
- package/docs/.vuepress/components/crud/selection/events.vue +0 -47
- package/docs/.vuepress/components/crud/selection/pagination.vue +0 -94
- package/docs/.vuepress/components/crud/selection/singleSelection.vue +0 -64
- package/docs/.vuepress/components/crud/span/base.vue +0 -69
- package/docs/.vuepress/components/crud/span/special.vue +0 -75
- package/docs/.vuepress/components/crud/summary/base.vue +0 -99
- package/docs/.vuepress/components/crud/tableEdit/addDeleteBtn.vue +0 -174
- package/docs/.vuepress/components/crud/tableEdit/cellEdit.vue +0 -194
- package/docs/.vuepress/components/crud/tableEdit/controlEdit.vue +0 -219
- package/docs/.vuepress/components/crud/tableEdit/dialog.vue +0 -172
- package/docs/.vuepress/components/crud/tableEdit/free.vue +0 -88
- package/docs/.vuepress/components/crud/tableEdit/freeColumn.vue +0 -82
- package/docs/.vuepress/components/crud/tableEdit/methods.vue +0 -154
- package/docs/.vuepress/components/crud/tableEdit/rowAction.vue +0 -107
- package/docs/.vuepress/components/crud/tableEdit/rowBatch.vue +0 -116
- package/docs/.vuepress/components/crud/tableEdit/rowClick.vue +0 -98
- package/docs/.vuepress/components/crud/validate/base.vue +0 -122
- package/docs/.vuepress/components/crud/validate/custom.vue +0 -82
- package/docs/.vuepress/components/crud/validate/regulars.vue +0 -88
- package/docs/.vuepress/components/crud/validate/relation.vue +0 -91
- package/docs/.vuepress/components/crud/validate/tree.vue +0 -82
- package/docs/.vuepress/components/dialog/baseUse/base.vue +0 -92
- package/docs/.vuepress/components/dialog/baseUse/beforeConfirm.vue +0 -78
- package/docs/.vuepress/components/dialog/baseUse/control.vue +0 -79
- package/docs/.vuepress/components/dialog/baseUse/drawer.vue +0 -59
- package/docs/.vuepress/components/dialog/baseUse/footer.vue +0 -87
- package/docs/.vuepress/components/dialog/baseUse/insertSlot.vue +0 -79
- package/docs/.vuepress/components/dict/DictLinkage.vue +0 -91
- package/docs/.vuepress/components/dict/baseUse.vue +0 -72
- package/docs/.vuepress/components/dict/component.vue +0 -82
- package/docs/.vuepress/components/dict/localDict.vue +0 -68
- package/docs/.vuepress/components/form/baseUse/base.vue +0 -48
- package/docs/.vuepress/components/form/baseUse/dataFormat.vue +0 -92
- package/docs/.vuepress/components/form/baseUse/deep.vue +0 -57
- package/docs/.vuepress/components/form/baseUse/gridLayout.vue +0 -47
- package/docs/.vuepress/components/form/baseUse/group.vue +0 -66
- package/docs/.vuepress/components/form/baseUse/hidden.vue +0 -40
- package/docs/.vuepress/components/form/baseUse/inlineLayout.vue +0 -48
- package/docs/.vuepress/components/form/baseUse/label.vue +0 -51
- package/docs/.vuepress/components/form/baseUse/tooltip.vue +0 -40
- package/docs/.vuepress/components/form/baseUse/validate.vue +0 -52
- package/docs/.vuepress/components/form/detail/base.vue +0 -78
- package/docs/.vuepress/components/form/detail/border.vue +0 -90
- package/docs/.vuepress/components/form/detail/singleDetail.vue +0 -72
- package/docs/.vuepress/components/formatData/baseUse.vue +0 -131
- package/docs/.vuepress/components/mock/index.js +0 -347
- package/docs/.vuepress/components/mockData/custom.vue +0 -69
- package/docs/.vuepress/components/mockData/example.vue +0 -290
- package/docs/.vuepress/components/positionSlot/base.vue +0 -24
- package/docs/.vuepress/components/positionSlot/form.vue +0 -71
- package/docs/.vuepress/components/positionSlot/table.vue +0 -85
- package/docs/.vuepress/components/tabs/base.vue +0 -57
- package/docs/.vuepress/components/temp.js +0 -195
- package/docs/.vuepress/config.js +0 -146
- package/docs/.vuepress/enhanceApp.js +0 -142
- package/docs/.vuepress/public/favicon.ico +0 -0
- package/docs/.vuepress/public/super.png +0 -0
- package/docs/.vuepress/styles/index.styl +0 -25
- package/docs/.vuepress/styles/palette.styl +0 -6
- package/docs/README.md +0 -14
- package/docs/guide/button/base.md +0 -31
- package/docs/guide/commonConfig/jsx.md +0 -166
- package/docs/guide/commonConfig/presetCodeTemplate.md +0 -68
- package/docs/guide/commonConfig/renderType.md +0 -181
- package/docs/guide/crud/baseUse.md +0 -120
- package/docs/guide/crud/buttons.md +0 -18
- package/docs/guide/crud/config.md +0 -217
- package/docs/guide/crud/contextMenu.md +0 -18
- package/docs/guide/crud/dataSort.md +0 -66
- package/docs/guide/crud/genDynamicColumns.md +0 -145
- package/docs/guide/crud/handleBar.md +0 -26
- package/docs/guide/crud/renderType.md +0 -4
- package/docs/guide/crud/search.md +0 -150
- package/docs/guide/crud/selection.md +0 -73
- package/docs/guide/crud/span.md +0 -98
- package/docs/guide/crud/summary.md +0 -167
- package/docs/guide/crud/tableEdit.md +0 -377
- package/docs/guide/crud/validate.md +0 -158
- package/docs/guide/dialog/baseUse.md +0 -81
- package/docs/guide/dict/baseUse.md +0 -174
- package/docs/guide/dict/component.md +0 -88
- package/docs/guide/dict/config.md +0 -44
- package/docs/guide/form/baseUse.md +0 -142
- package/docs/guide/form/detail.md +0 -38
- package/docs/guide/formatData/baseUse.md +0 -98
- package/docs/guide/formatData/config.md +0 -142
- package/docs/guide/mockData/base.md +0 -26
- package/docs/guide/positionSlot/base.md +0 -41
- package/docs/guide/question/base.md +0 -44
- package/docs/guide/start/base.md +0 -30
- package/docs/guide/tabs/base.md +0 -63
- package/examples/App.vue +0 -52
- package/examples/Layout/components/AppMain.vue +0 -40
- package/examples/Layout/components/Item.vue +0 -29
- package/examples/Layout/components/Link.vue +0 -44
- package/examples/Layout/components/SidebarItem.vue +0 -93
- package/examples/Layout/index.vue +0 -69
- package/examples/assets/logo.png +0 -0
- package/examples/favicon.ico +0 -0
- package/examples/index.html +0 -18
- package/examples/main.js +0 -54
- package/examples/router/index.js +0 -140
- package/examples/store/index.js +0 -0
- package/examples/styles/index.scss +0 -63
- package/examples/styles/sidebar.scss +0 -226
- package/examples/styles/transition.scss +0 -48
- package/examples/styles/variables.scss +0 -25
- package/examples/views/crud/base.vue +0 -68
- package/examples/views/crud/handleRow.vue +0 -84
- package/examples/views/crud/search.vue +0 -116
- package/examples/views/dashboard/index.vue +0 -244
- package/examples/views/dashboard/index1.vue +0 -234
- package/examples/views/dashboard/test.vue +0 -9
- package/examples/views/formTest/index.vue +0 -168
- package/examples/views/nested/menu1/index.vue +0 -7
- package/examples/views/nested/menu1/menu1-1/index.vue +0 -7
- package/examples/views/nested/menu1/menu1-2/index.vue +0 -7
- package/examples/views/nested/menu1/menu1-2/menu1-2-1/index.vue +0 -5
- package/examples/views/nested/menu1/menu1-2/menu1-2-2/index.vue +0 -5
- package/examples/views/nested/menu1/menu1-3/index.vue +0 -5
- package/examples/views/nested/menu2/index.vue +0 -5
- package/gulpfile.js +0 -84
- package/packages/button/index.vue +0 -189
- package/packages/core/components/comp.vue +0 -223
- package/packages/core/components/position.vue +0 -135
- package/packages/core/components/render.vue +0 -460
- package/packages/core/configManager.js +0 -302
- package/packages/core/create.js +0 -8
- package/packages/core/defaultRender.js +0 -64
- package/packages/core/dict/global.js +0 -10
- package/packages/core/dict/index.js +0 -432
- package/packages/core/dict/mixin.js +0 -94
- package/packages/core/event.js +0 -60
- package/packages/core/index.js +0 -6
- package/packages/core/init.js +0 -122
- package/packages/core/mock/genConfig.js +0 -228
- package/packages/core/mock/genData.js +0 -422
- package/packages/core/mock/index.js +0 -4
- package/packages/core/rules.js +0 -111
- package/packages/crud/column.vue +0 -205
- package/packages/crud/columnAction.vue +0 -207
- package/packages/crud/columnCell.vue +0 -146
- package/packages/crud/defaultColumn.vue +0 -130
- package/packages/crud/drawerColumn.vue +0 -225
- package/packages/crud/form.vue +0 -69
- package/packages/crud/index.vue +0 -564
- package/packages/crud/menuBar.vue +0 -298
- package/packages/crud/mixins/cacheHandler.js +0 -36
- package/packages/crud/mixins/calcColumnWidth.js +0 -79
- package/packages/crud/mixins/calcHeight.js +0 -105
- package/packages/crud/mixins/columnHandler.js +0 -128
- package/packages/crud/mixins/contextMenu.js +0 -98
- package/packages/crud/mixins/dataProcessor.js +0 -202
- package/packages/crud/mixins/dialog.js +0 -109
- package/packages/crud/mixins/excelHandler.js +0 -150
- package/packages/crud/mixins/exposeMethods.js +0 -107
- package/packages/crud/mixins/generateDynamicColumns.js +0 -250
- package/packages/crud/mixins/props.js +0 -38
- package/packages/crud/mixins/searchHandler.js +0 -151
- package/packages/crud/mixins/select.js +0 -359
- package/packages/crud/mixins/spanMethod.js +0 -288
- package/packages/crud/mixins/summary.js +0 -177
- package/packages/crud/mixins/tableEdit.js +0 -547
- package/packages/crud/mixins/validate.js +0 -219
- package/packages/crud/pagination.vue +0 -110
- package/packages/crud/search.vue +0 -119
- package/packages/crud/searchHeader.vue +0 -231
- package/packages/crud/selectBanner.vue +0 -138
- package/packages/crud/utils/EditState.js +0 -319
- package/packages/crud/utils/excelExport.js +0 -112
- package/packages/crud/utils/excelImport.js +0 -112
- package/packages/crud/utils/index.js +0 -98
- package/packages/dialog/dialog.js +0 -233
- package/packages/dialog/dialog.vue +0 -15
- package/packages/dialog/index.js +0 -22
- package/packages/dict/cascadeFormat.vue +0 -179
- package/packages/dict/dateFormat.vue +0 -40
- package/packages/dict/form/cascade.vue +0 -61
- package/packages/dict/form/checkbox.vue +0 -90
- package/packages/dict/form/extendMethod.js +0 -22
- package/packages/dict/form/input-base.js +0 -31
- package/packages/dict/form/input.js +0 -20
- package/packages/dict/form/radio.vue +0 -69
- package/packages/dict/form/select.vue +0 -118
- package/packages/dict/form/switch.vue +0 -75
- package/packages/dict/valueFormat.vue +0 -188
- package/packages/directive/dialog/drag.js +0 -86
- package/packages/directive/dialog/dragSize.js +0 -42
- package/packages/directive/index.js +0 -9
- package/packages/directive/insertSlot.js +0 -10
- package/packages/form/contextMenu.js +0 -192
- package/packages/form/draftDrawer.vue +0 -391
- package/packages/form/formAction.vue +0 -97
- package/packages/form/formItem.vue +0 -259
- package/packages/form/index.vue +0 -451
- package/packages/form/props.js +0 -15
- package/packages/grid/cell.vue +0 -65
- package/packages/grid/index.vue +0 -130
- package/packages/group/index.vue +0 -96
- package/packages/tabs/index.vue +0 -290
- package/packages/tooltip/index.js +0 -9
- package/packages/tooltip/tooltip.vue +0 -32
- package/packages/tooltip/tooltipComponent.js +0 -38
- package/packages/verifyInput/index.vue +0 -131
- package/styles/button.scss +0 -3
- package/styles/crud.scss +0 -425
- package/styles/dialog.scss +0 -95
- package/styles/form.scss +0 -532
- package/styles/group.scss +0 -78
- package/styles/index.scss +0 -94
- package/styles/tabs.scss +0 -139
- package/styles/verifyInput.scss +0 -56
- package/vue-jsx-sync.js +0 -90
- package/vue.config.js +0 -54
@@ -1,82 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<sc-crud :search.sync="searchForm" :options="options" :data="data">
|
4
|
-
</sc-crud>
|
5
|
-
</div>
|
6
|
-
</template>
|
7
|
-
|
8
|
-
<script>
|
9
|
-
export default {
|
10
|
-
data() {
|
11
|
-
return {
|
12
|
-
searchForm: {},
|
13
|
-
options: {
|
14
|
-
height: "300px", // 设置为`auto`,会自适应窗口高度,配合calcHeight参数去调节范围
|
15
|
-
calcHeight: 0, // 值为应减去的底部高度
|
16
|
-
renderColumns: [
|
17
|
-
{ prop: "name", label: "昵称", search: true },
|
18
|
-
{
|
19
|
-
label: "信息",
|
20
|
-
children: [
|
21
|
-
// 表头子级
|
22
|
-
{
|
23
|
-
prop: "username",
|
24
|
-
label: "姓名",
|
25
|
-
search: {
|
26
|
-
comp: {
|
27
|
-
name: "el-date-picker",
|
28
|
-
},
|
29
|
-
},
|
30
|
-
children: [
|
31
|
-
{
|
32
|
-
prop: "username",
|
33
|
-
label: "姓名",
|
34
|
-
search: {
|
35
|
-
comp: {
|
36
|
-
name: "el-date-picker",
|
37
|
-
},
|
38
|
-
},
|
39
|
-
},
|
40
|
-
{
|
41
|
-
prop: "gender",
|
42
|
-
label: "性别",
|
43
|
-
},
|
44
|
-
],
|
45
|
-
},
|
46
|
-
{
|
47
|
-
prop: "gender",
|
48
|
-
label: "性别",
|
49
|
-
},
|
50
|
-
],
|
51
|
-
},
|
52
|
-
],
|
53
|
-
},
|
54
|
-
data: [
|
55
|
-
{
|
56
|
-
createTime: "2018-06-02 12:28:47",
|
57
|
-
createUser: 94,
|
58
|
-
id: 56,
|
59
|
-
idNumber: "8",
|
60
|
-
name: "识间华中张认",
|
61
|
-
password: "sed laboris",
|
62
|
-
phone: "18157668675",
|
63
|
-
gender: "男",
|
64
|
-
age: 20,
|
65
|
-
status: 35,
|
66
|
-
updateTime: "2018-09-08 16:33:19",
|
67
|
-
updateUser: 58,
|
68
|
-
username: "石洋",
|
69
|
-
},
|
70
|
-
],
|
71
|
-
};
|
72
|
-
},
|
73
|
-
mounted() {
|
74
|
-
const dataRepeated = [];
|
75
|
-
for (let i = 0; i < 50; i++) {
|
76
|
-
dataRepeated.push(Object.assign({}, this.data[0]));
|
77
|
-
}
|
78
|
-
this.data = dataRepeated;
|
79
|
-
},
|
80
|
-
methods: {},
|
81
|
-
};
|
82
|
-
</script>
|
@@ -1,54 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<sc-crud :search.sync="searchForm" :options="options" :data="data">
|
4
|
-
</sc-crud>
|
5
|
-
</div>
|
6
|
-
</template>
|
7
|
-
|
8
|
-
<script>
|
9
|
-
export default {
|
10
|
-
data() {
|
11
|
-
return {
|
12
|
-
searchForm: {},
|
13
|
-
options: {
|
14
|
-
index: {
|
15
|
-
label: "序号",
|
16
|
-
},
|
17
|
-
expand: true,
|
18
|
-
renderColumns: [
|
19
|
-
{ prop: "name", label: "昵称", search: true },
|
20
|
-
{
|
21
|
-
prop: "username",
|
22
|
-
label: "姓名",
|
23
|
-
search: {
|
24
|
-
name: "el-date-picker",
|
25
|
-
},
|
26
|
-
},
|
27
|
-
{
|
28
|
-
prop: "gender",
|
29
|
-
label: "性别",
|
30
|
-
},
|
31
|
-
],
|
32
|
-
},
|
33
|
-
data: [
|
34
|
-
{
|
35
|
-
createTime: "2018-06-02 12:28:47",
|
36
|
-
createUser: 94,
|
37
|
-
id: 56,
|
38
|
-
idNumber: "8",
|
39
|
-
name: "识间华中张认",
|
40
|
-
password: "sed laboris",
|
41
|
-
phone: "18157668675",
|
42
|
-
gender: "男",
|
43
|
-
age: 20,
|
44
|
-
status: 35,
|
45
|
-
updateTime: "2018-09-08 16:33:19",
|
46
|
-
updateUser: 58,
|
47
|
-
username: "石洋",
|
48
|
-
},
|
49
|
-
],
|
50
|
-
};
|
51
|
-
},
|
52
|
-
methods: {},
|
53
|
-
};
|
54
|
-
</script>
|
@@ -1,70 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<el-button type="primary" @click="loading = !loading"
|
4
|
-
>切换loading</el-button
|
5
|
-
>
|
6
|
-
<sc-crud
|
7
|
-
:search.sync="searchForm"
|
8
|
-
:options="options"
|
9
|
-
:data="data"
|
10
|
-
:loading.sync="loading"
|
11
|
-
>
|
12
|
-
</sc-crud>
|
13
|
-
</div>
|
14
|
-
</template>
|
15
|
-
|
16
|
-
<script>
|
17
|
-
export default {
|
18
|
-
data() {
|
19
|
-
return {
|
20
|
-
loading: true,
|
21
|
-
searchForm: {},
|
22
|
-
options: {
|
23
|
-
loadingText: "拼命加载中...",
|
24
|
-
loadingSpinner: "el-icon-loading",
|
25
|
-
loadingBackground: "rgba(0, 0, 0, 0.8)",
|
26
|
-
disableLoading: true, //禁用组件内部控制加载状态
|
27
|
-
handleRow: [
|
28
|
-
{
|
29
|
-
label: "组件按钮",
|
30
|
-
type: "primary",
|
31
|
-
},
|
32
|
-
],
|
33
|
-
renderColumns: [
|
34
|
-
{ prop: "name", label: "昵称", search: true },
|
35
|
-
{
|
36
|
-
prop: "username",
|
37
|
-
label: "姓名",
|
38
|
-
search: {
|
39
|
-
name: "el-date-picker",
|
40
|
-
},
|
41
|
-
},
|
42
|
-
{
|
43
|
-
prop: "gender",
|
44
|
-
label: "性别",
|
45
|
-
},
|
46
|
-
],
|
47
|
-
},
|
48
|
-
data: [
|
49
|
-
{
|
50
|
-
createTime: "2018-06-02 12:28:47",
|
51
|
-
createUser: 94,
|
52
|
-
id: 56,
|
53
|
-
idNumber: "8",
|
54
|
-
name: "识间华中张认",
|
55
|
-
password: "sed laboris",
|
56
|
-
phone: "18157668675",
|
57
|
-
gender: "男",
|
58
|
-
age: 20,
|
59
|
-
status: 35,
|
60
|
-
updateTime: "2018-09-08 16:33:19",
|
61
|
-
updateUser: 58,
|
62
|
-
username: "石洋",
|
63
|
-
},
|
64
|
-
],
|
65
|
-
};
|
66
|
-
},
|
67
|
-
mounted() {},
|
68
|
-
methods: {},
|
69
|
-
};
|
70
|
-
</script>
|
@@ -1,108 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<sc-crud
|
4
|
-
:search.sync="searchForm"
|
5
|
-
:options="options"
|
6
|
-
:data.sync="data"
|
7
|
-
:total="total"
|
8
|
-
@getList="getList"
|
9
|
-
>
|
10
|
-
</sc-crud>
|
11
|
-
</div>
|
12
|
-
</template>
|
13
|
-
|
14
|
-
<script>
|
15
|
-
export default {
|
16
|
-
data() {
|
17
|
-
return {
|
18
|
-
searchForm: {
|
19
|
-
pageNum: 2, // 当前页码
|
20
|
-
pageSize: 20, // 每页条数
|
21
|
-
},
|
22
|
-
options: {
|
23
|
-
init: true,
|
24
|
-
pagination: {
|
25
|
-
// 自定义pagination
|
26
|
-
background: false,
|
27
|
-
on: {
|
28
|
-
"size-change": (v) => {
|
29
|
-
this.$message.success("size-change");
|
30
|
-
},
|
31
|
-
},
|
32
|
-
},
|
33
|
-
props: {
|
34
|
-
pageNum: "pageNum", // 分页参数
|
35
|
-
pageSize: "pageSize", // 分页参数
|
36
|
-
listResult: "data", // 列表数据
|
37
|
-
total: "total", // 列表条数
|
38
|
-
},
|
39
|
-
renderColumns: [
|
40
|
-
{ prop: "name", label: "昵称", search: true },
|
41
|
-
{
|
42
|
-
prop: "username",
|
43
|
-
label: "姓名",
|
44
|
-
search: true,
|
45
|
-
},
|
46
|
-
{
|
47
|
-
prop: "gender",
|
48
|
-
label: "性别",
|
49
|
-
search: true,
|
50
|
-
},
|
51
|
-
],
|
52
|
-
},
|
53
|
-
data: [],
|
54
|
-
total: 0,
|
55
|
-
};
|
56
|
-
},
|
57
|
-
methods: {
|
58
|
-
async getList() {
|
59
|
-
const { data, total } = await this.listApi(this.searchForm);
|
60
|
-
this.data = data;
|
61
|
-
this.total = total;
|
62
|
-
},
|
63
|
-
listApi() {
|
64
|
-
// 模拟请求api
|
65
|
-
return new Promise((resolve, reject) => {
|
66
|
-
setTimeout(() => {
|
67
|
-
resolve({
|
68
|
-
code: 200,
|
69
|
-
data: [
|
70
|
-
{
|
71
|
-
createTime: "2018-06-02 12:28:47",
|
72
|
-
createUser: 94,
|
73
|
-
id: 56,
|
74
|
-
idNumber: "8",
|
75
|
-
name: "识间华中张认",
|
76
|
-
password: "sed laboris",
|
77
|
-
phone: "18157668675",
|
78
|
-
gender: "男",
|
79
|
-
age: 20,
|
80
|
-
status: 35,
|
81
|
-
updateTime: "2018-09-08 16:33:19",
|
82
|
-
updateUser: 58,
|
83
|
-
username: "石洋",
|
84
|
-
},
|
85
|
-
{
|
86
|
-
createTime: "2018-06-02 12:28:47",
|
87
|
-
createUser: 94,
|
88
|
-
id: 57,
|
89
|
-
idNumber: "8",
|
90
|
-
name: "识间华中张认1",
|
91
|
-
password: "sed laboris",
|
92
|
-
phone: "18157668675",
|
93
|
-
gender: "男",
|
94
|
-
age: 20,
|
95
|
-
status: 35,
|
96
|
-
updateTime: "2018-09-08 16:33:19",
|
97
|
-
updateUser: 58,
|
98
|
-
username: "石洋11",
|
99
|
-
},
|
100
|
-
],
|
101
|
-
total: 100,
|
102
|
-
});
|
103
|
-
}, 1000);
|
104
|
-
});
|
105
|
-
},
|
106
|
-
},
|
107
|
-
};
|
108
|
-
</script>
|
@@ -1,114 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<sc-crud :search.sync="searchForm" :options="options" :data="data">
|
4
|
-
</sc-crud>
|
5
|
-
</div>
|
6
|
-
</template>
|
7
|
-
|
8
|
-
<script>
|
9
|
-
export default {
|
10
|
-
data() {
|
11
|
-
return {
|
12
|
-
searchForm: {},
|
13
|
-
options: {
|
14
|
-
selection: {
|
15
|
-
ctrlSelect: true, // 按下ctrl键点击整行选中
|
16
|
-
shiftSelect: true, // 按下shift键批量多选
|
17
|
-
},
|
18
|
-
renderColumns: [
|
19
|
-
{ prop: "name", label: "昵称", search: true },
|
20
|
-
{
|
21
|
-
prop: "username",
|
22
|
-
label: "姓名",
|
23
|
-
search: {
|
24
|
-
name: "el-date-picker",
|
25
|
-
},
|
26
|
-
},
|
27
|
-
{
|
28
|
-
prop: "gender",
|
29
|
-
label: "性别",
|
30
|
-
},
|
31
|
-
],
|
32
|
-
},
|
33
|
-
data: [
|
34
|
-
{
|
35
|
-
createTime: "2018-06-02 12:28:47",
|
36
|
-
createUser: 94,
|
37
|
-
id: 56,
|
38
|
-
idNumber: "8",
|
39
|
-
name: "识间华中张认",
|
40
|
-
password: "sed laboris",
|
41
|
-
phone: "18157668675",
|
42
|
-
gender: "男",
|
43
|
-
age: 20,
|
44
|
-
status: 35,
|
45
|
-
updateTime: "2018-09-08 16:33:19",
|
46
|
-
updateUser: 58,
|
47
|
-
username: "石洋",
|
48
|
-
},
|
49
|
-
{
|
50
|
-
createTime: "2018-06-02 12:28:47",
|
51
|
-
createUser: 94,
|
52
|
-
id: 66,
|
53
|
-
idNumber: "8",
|
54
|
-
name: "识间华中张认",
|
55
|
-
password: "sed laboris",
|
56
|
-
phone: "18157668675",
|
57
|
-
gender: "男",
|
58
|
-
age: 20,
|
59
|
-
status: 35,
|
60
|
-
updateTime: "2018-09-08 16:33:19",
|
61
|
-
updateUser: 58,
|
62
|
-
username: "石洋",
|
63
|
-
},
|
64
|
-
{
|
65
|
-
createTime: "2018-06-02 12:28:47",
|
66
|
-
createUser: 94,
|
67
|
-
id: 77,
|
68
|
-
idNumber: "8",
|
69
|
-
name: "识间华中张认",
|
70
|
-
password: "sed laboris",
|
71
|
-
phone: "18157668675",
|
72
|
-
gender: "男",
|
73
|
-
age: 20,
|
74
|
-
status: 35,
|
75
|
-
updateTime: "2018-09-08 16:33:19",
|
76
|
-
updateUser: 58,
|
77
|
-
username: "石洋",
|
78
|
-
},
|
79
|
-
{
|
80
|
-
createTime: "2018-06-02 12:28:47",
|
81
|
-
createUser: 94,
|
82
|
-
id: 88,
|
83
|
-
idNumber: "8",
|
84
|
-
name: "识间华中张认",
|
85
|
-
password: "sed laboris",
|
86
|
-
phone: "18157668675",
|
87
|
-
gender: "男",
|
88
|
-
age: 20,
|
89
|
-
status: 35,
|
90
|
-
updateTime: "2018-09-08 16:33:19",
|
91
|
-
updateUser: 58,
|
92
|
-
username: "石洋",
|
93
|
-
},
|
94
|
-
{
|
95
|
-
createTime: "2018-06-02 12:28:47",
|
96
|
-
createUser: 94,
|
97
|
-
id: 99,
|
98
|
-
idNumber: "8",
|
99
|
-
name: "识间华中张认",
|
100
|
-
password: "sed laboris",
|
101
|
-
phone: "18157668675",
|
102
|
-
gender: "男",
|
103
|
-
age: 20,
|
104
|
-
status: 35,
|
105
|
-
updateTime: "2018-09-08 16:33:19",
|
106
|
-
updateUser: 58,
|
107
|
-
username: "石洋",
|
108
|
-
},
|
109
|
-
],
|
110
|
-
};
|
111
|
-
},
|
112
|
-
methods: {},
|
113
|
-
};
|
114
|
-
</script>
|
@@ -1,118 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<sc-crud
|
4
|
-
:loading="loading"
|
5
|
-
:search.sync="searchForm"
|
6
|
-
:options="options"
|
7
|
-
:data="data"
|
8
|
-
:total="total"
|
9
|
-
:spanMethod="spanMethod"
|
10
|
-
@getList="getList"
|
11
|
-
>
|
12
|
-
</sc-crud>
|
13
|
-
</div>
|
14
|
-
</template>
|
15
|
-
|
16
|
-
<script>
|
17
|
-
export default {
|
18
|
-
data() {
|
19
|
-
return {
|
20
|
-
loading: false,
|
21
|
-
searchForm: {},
|
22
|
-
options: {
|
23
|
-
init: true,
|
24
|
-
border: true,
|
25
|
-
renderColumns: [
|
26
|
-
{
|
27
|
-
prop: "number",
|
28
|
-
label: "合计",
|
29
|
-
summary: "sum",
|
30
|
-
},
|
31
|
-
{
|
32
|
-
prop: "number",
|
33
|
-
label: "平均",
|
34
|
-
summary: "avg",
|
35
|
-
},
|
36
|
-
{
|
37
|
-
prop: "number",
|
38
|
-
label: "最大值",
|
39
|
-
summary: "max",
|
40
|
-
},
|
41
|
-
{
|
42
|
-
prop: "number",
|
43
|
-
label: "最小值",
|
44
|
-
summary: "min",
|
45
|
-
},
|
46
|
-
{
|
47
|
-
prop: "number",
|
48
|
-
label: "自定义summary",
|
49
|
-
summary: (values, data) => {
|
50
|
-
return values.reduce((acc, curr) => acc + curr, 0);
|
51
|
-
},
|
52
|
-
},
|
53
|
-
],
|
54
|
-
},
|
55
|
-
data: [],
|
56
|
-
total: 0,
|
57
|
-
};
|
58
|
-
},
|
59
|
-
methods: {
|
60
|
-
spanMethod({ row, column, rowIndex, columnIndex }) {
|
61
|
-
if (column.property === "gender") {
|
62
|
-
if (rowIndex === 0) {
|
63
|
-
return {
|
64
|
-
rowspan: 2,
|
65
|
-
colspan: 1,
|
66
|
-
};
|
67
|
-
}
|
68
|
-
if (rowIndex === 1) {
|
69
|
-
return {
|
70
|
-
rowspan: 0,
|
71
|
-
colspan: 0,
|
72
|
-
};
|
73
|
-
}
|
74
|
-
return {
|
75
|
-
rowspan: 1,
|
76
|
-
colspan: 1,
|
77
|
-
};
|
78
|
-
}
|
79
|
-
},
|
80
|
-
async getList() {
|
81
|
-
this.loading = true;
|
82
|
-
const { data, total } = await this.listApi(this.searchForm);
|
83
|
-
this.loading = false;
|
84
|
-
this.data = data;
|
85
|
-
this.total = total;
|
86
|
-
},
|
87
|
-
listApi() {
|
88
|
-
// 模拟请求api
|
89
|
-
return new Promise((resolve, reject) => {
|
90
|
-
setTimeout(() => {
|
91
|
-
resolve({
|
92
|
-
code: 200,
|
93
|
-
data: [
|
94
|
-
{
|
95
|
-
id: 56,
|
96
|
-
number: 1,
|
97
|
-
},
|
98
|
-
{
|
99
|
-
id: 56,
|
100
|
-
number: 2,
|
101
|
-
},
|
102
|
-
{
|
103
|
-
id: 56,
|
104
|
-
number: 3,
|
105
|
-
},
|
106
|
-
{
|
107
|
-
id: 56,
|
108
|
-
number: 4,
|
109
|
-
},
|
110
|
-
],
|
111
|
-
total: 2,
|
112
|
-
});
|
113
|
-
}, 1000);
|
114
|
-
});
|
115
|
-
},
|
116
|
-
},
|
117
|
-
};
|
118
|
-
</script>
|
@@ -1,54 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<sc-crud :search.sync="searchForm" :options="options" :data="data">
|
4
|
-
</sc-crud>
|
5
|
-
</div>
|
6
|
-
</template>
|
7
|
-
|
8
|
-
<script>
|
9
|
-
export default {
|
10
|
-
data() {
|
11
|
-
return {
|
12
|
-
searchForm: {},
|
13
|
-
options: {
|
14
|
-
title: "表格标题",
|
15
|
-
renderColumns: [
|
16
|
-
{
|
17
|
-
prop: "name",
|
18
|
-
label: "昵称",
|
19
|
-
search: true,
|
20
|
-
},
|
21
|
-
{
|
22
|
-
prop: "username",
|
23
|
-
label: "姓名",
|
24
|
-
search: true,
|
25
|
-
},
|
26
|
-
{
|
27
|
-
prop: "gender",
|
28
|
-
label: "性别",
|
29
|
-
search: true,
|
30
|
-
},
|
31
|
-
],
|
32
|
-
},
|
33
|
-
data: [
|
34
|
-
{
|
35
|
-
createTime: "2018-06-02 12:28:47",
|
36
|
-
createUser: 94,
|
37
|
-
id: 56,
|
38
|
-
idNumber: "8",
|
39
|
-
name: "识间华中张认",
|
40
|
-
password: "sed laboris",
|
41
|
-
phone: "18157668675",
|
42
|
-
gender: "男",
|
43
|
-
age: 20,
|
44
|
-
status: 35,
|
45
|
-
updateTime: "2018-09-08 16:33:19",
|
46
|
-
updateUser: 58,
|
47
|
-
username: "石洋",
|
48
|
-
},
|
49
|
-
],
|
50
|
-
};
|
51
|
-
},
|
52
|
-
methods: {},
|
53
|
-
};
|
54
|
-
</script>
|
@@ -1,69 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<sc-crud :search.sync="searchForm" :options="options" :data="data">
|
4
|
-
<template #toolbar-left="config">
|
5
|
-
<!-- ctx为crud组件实例 -->
|
6
|
-
<el-button :size="config.size">toolbar插槽</el-button>
|
7
|
-
</template>
|
8
|
-
</sc-crud>
|
9
|
-
</div>
|
10
|
-
</template>
|
11
|
-
|
12
|
-
<script>
|
13
|
-
export default {
|
14
|
-
data() {
|
15
|
-
return {
|
16
|
-
searchForm: {},
|
17
|
-
options: {
|
18
|
-
// 不需要自定义内置按钮时可以简写为数组 toolbar: [{label: "自定义按钮"...}]
|
19
|
-
toolbar: {
|
20
|
-
search: {
|
21
|
-
label: "自定义搜索显隐", // 自定义 hover 提示词
|
22
|
-
},
|
23
|
-
reset: {
|
24
|
-
label: "自定义重置", // 自定义 hover 提示词
|
25
|
-
},
|
26
|
-
zoom: {
|
27
|
-
label: "自定义最大化", // 自定义 hover 提示词
|
28
|
-
},
|
29
|
-
column: {
|
30
|
-
label: "自定义列设置", // 自定义 hover 提示词
|
31
|
-
},
|
32
|
-
},
|
33
|
-
renderColumns: [
|
34
|
-
{ prop: "name", label: "昵称", search: true },
|
35
|
-
{
|
36
|
-
prop: "username",
|
37
|
-
label: "姓名",
|
38
|
-
search: {
|
39
|
-
name: "el-date-picker",
|
40
|
-
},
|
41
|
-
},
|
42
|
-
{
|
43
|
-
prop: "gender",
|
44
|
-
label: "性别",
|
45
|
-
},
|
46
|
-
],
|
47
|
-
},
|
48
|
-
data: [
|
49
|
-
{
|
50
|
-
createTime: "2018-06-02 12:28:47",
|
51
|
-
createUser: 94,
|
52
|
-
id: 56,
|
53
|
-
idNumber: "8",
|
54
|
-
name: "识间华中张认",
|
55
|
-
password: "sed laboris",
|
56
|
-
phone: "18157668675",
|
57
|
-
gender: "男",
|
58
|
-
age: 20,
|
59
|
-
status: 35,
|
60
|
-
updateTime: "2018-09-08 16:33:19",
|
61
|
-
updateUser: 58,
|
62
|
-
username: "石洋",
|
63
|
-
},
|
64
|
-
],
|
65
|
-
};
|
66
|
-
},
|
67
|
-
methods: {},
|
68
|
-
};
|
69
|
-
</script>
|