vue-super-crud 1.7.1
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/.browserslistrc +3 -0
- package/.versionrc.json +36 -0
- package/CHANGELOG.md +232 -0
- package/LICENSE +201 -0
- package/README.md +46 -0
- package/babel.config.js +12 -0
- package/build/alias.js +10 -0
- package/build/build.js +52 -0
- package/build/config.js +70 -0
- package/deploy.bat +14 -0
- package/docs/.vuepress/components/button/base.vue +88 -0
- package/docs/.vuepress/components/common/code-format.vue +331 -0
- package/docs/.vuepress/components/commonConfig/presetCodeTemplate/base.vue +68 -0
- package/docs/.vuepress/components/commonConfig/presetCodeTemplate/customParams.vue +73 -0
- package/docs/.vuepress/components/commonConfig/renderType/component.vue +160 -0
- package/docs/.vuepress/components/commonConfig/renderType/formatter.vue +49 -0
- package/docs/.vuepress/components/commonConfig/renderType/render.vue +91 -0
- package/docs/.vuepress/components/commonConfig/renderType/slot.vue +63 -0
- package/docs/.vuepress/components/crud/baseUse/baseUse.vue +98 -0
- package/docs/.vuepress/components/crud/baseUse/columnAction.vue +72 -0
- package/docs/.vuepress/components/crud/baseUse/columnWidth.vue +107 -0
- package/docs/.vuepress/components/crud/baseUse/handleRow.vue +65 -0
- package/docs/.vuepress/components/crud/baseUse/height.vue +82 -0
- package/docs/.vuepress/components/crud/baseUse/index.vue +54 -0
- package/docs/.vuepress/components/crud/baseUse/loading.vue +70 -0
- package/docs/.vuepress/components/crud/baseUse/pagination.vue +108 -0
- package/docs/.vuepress/components/crud/baseUse/selection.vue +114 -0
- package/docs/.vuepress/components/crud/baseUse/summaryMethod.vue +118 -0
- package/docs/.vuepress/components/crud/baseUse/title.vue +54 -0
- package/docs/.vuepress/components/crud/baseUse/toolbar.vue +69 -0
- package/docs/.vuepress/components/crud/buttons/common.vue +115 -0
- package/docs/.vuepress/components/crud/buttons/fast.vue +82 -0
- package/docs/.vuepress/components/crud/contextMenu/base.vue +72 -0
- package/docs/.vuepress/components/crud/copy.vue +52 -0
- package/docs/.vuepress/components/crud/crudEvents/api.vue +157 -0
- package/docs/.vuepress/components/crud/crudEvents/deleteTip.vue +93 -0
- package/docs/.vuepress/components/crud/crudEvents/events.vue +188 -0
- package/docs/.vuepress/components/crud/dataSort/base.vue +142 -0
- package/docs/.vuepress/components/crud/genDynamicColumns/base.vue +53 -0
- package/docs/.vuepress/components/crud/genDynamicColumns/dynamicAndFixed.vue +111 -0
- package/docs/.vuepress/components/crud/genDynamicColumns/treeDynamic.vue +68 -0
- package/docs/.vuepress/components/crud/handleBar/handleRow.vue +65 -0
- package/docs/.vuepress/components/crud/handleBar/toolbar.vue +69 -0
- package/docs/.vuepress/components/crud/renderType/1.vue +57 -0
- package/docs/.vuepress/components/crud/renderType/2.vue +63 -0
- package/docs/.vuepress/components/crud/renderType/3.vue +105 -0
- package/docs/.vuepress/components/crud/renderType/5.vue +91 -0
- package/docs/.vuepress/components/crud/search/1.vue +90 -0
- package/docs/.vuepress/components/crud/search/2.vue +78 -0
- package/docs/.vuepress/components/crud/search/3.vue +107 -0
- package/docs/.vuepress/components/crud/search/base.vue +123 -0
- package/docs/.vuepress/components/crud/search/localSearch.vue +124 -0
- package/docs/.vuepress/components/crud/search/special.vue +148 -0
- package/docs/.vuepress/components/crud/selection/events.vue +47 -0
- package/docs/.vuepress/components/crud/selection/pagination.vue +94 -0
- package/docs/.vuepress/components/crud/selection/singleSelection.vue +64 -0
- package/docs/.vuepress/components/crud/span/base.vue +69 -0
- package/docs/.vuepress/components/crud/span/special.vue +75 -0
- package/docs/.vuepress/components/crud/summary/base.vue +99 -0
- package/docs/.vuepress/components/crud/tableEdit/addDeleteBtn.vue +174 -0
- package/docs/.vuepress/components/crud/tableEdit/cellEdit.vue +194 -0
- package/docs/.vuepress/components/crud/tableEdit/controlEdit.vue +219 -0
- package/docs/.vuepress/components/crud/tableEdit/dialog.vue +172 -0
- package/docs/.vuepress/components/crud/tableEdit/free.vue +88 -0
- package/docs/.vuepress/components/crud/tableEdit/freeColumn.vue +82 -0
- package/docs/.vuepress/components/crud/tableEdit/methods.vue +154 -0
- package/docs/.vuepress/components/crud/tableEdit/rowAction.vue +107 -0
- package/docs/.vuepress/components/crud/tableEdit/rowBatch.vue +116 -0
- package/docs/.vuepress/components/crud/tableEdit/rowClick.vue +98 -0
- package/docs/.vuepress/components/crud/validate/base.vue +122 -0
- package/docs/.vuepress/components/crud/validate/custom.vue +82 -0
- package/docs/.vuepress/components/crud/validate/regulars.vue +88 -0
- package/docs/.vuepress/components/crud/validate/relation.vue +91 -0
- package/docs/.vuepress/components/crud/validate/tree.vue +82 -0
- package/docs/.vuepress/components/dialog/baseUse/base.vue +92 -0
- package/docs/.vuepress/components/dialog/baseUse/beforeConfirm.vue +78 -0
- package/docs/.vuepress/components/dialog/baseUse/control.vue +79 -0
- package/docs/.vuepress/components/dialog/baseUse/drawer.vue +59 -0
- package/docs/.vuepress/components/dialog/baseUse/footer.vue +87 -0
- package/docs/.vuepress/components/dialog/baseUse/insertSlot.vue +79 -0
- package/docs/.vuepress/components/dict/DictLinkage.vue +91 -0
- package/docs/.vuepress/components/dict/baseUse.vue +72 -0
- package/docs/.vuepress/components/dict/component.vue +82 -0
- package/docs/.vuepress/components/dict/localDict.vue +68 -0
- package/docs/.vuepress/components/form/baseUse/base.vue +48 -0
- package/docs/.vuepress/components/form/baseUse/dataFormat.vue +92 -0
- package/docs/.vuepress/components/form/baseUse/deep.vue +57 -0
- package/docs/.vuepress/components/form/baseUse/gridLayout.vue +47 -0
- package/docs/.vuepress/components/form/baseUse/group.vue +66 -0
- package/docs/.vuepress/components/form/baseUse/hidden.vue +40 -0
- package/docs/.vuepress/components/form/baseUse/inlineLayout.vue +48 -0
- package/docs/.vuepress/components/form/baseUse/label.vue +51 -0
- package/docs/.vuepress/components/form/baseUse/tooltip.vue +40 -0
- package/docs/.vuepress/components/form/baseUse/validate.vue +52 -0
- package/docs/.vuepress/components/form/detail/base.vue +78 -0
- package/docs/.vuepress/components/form/detail/border.vue +90 -0
- package/docs/.vuepress/components/form/detail/singleDetail.vue +72 -0
- package/docs/.vuepress/components/formatData/baseUse.vue +131 -0
- package/docs/.vuepress/components/mock/index.js +347 -0
- package/docs/.vuepress/components/mockData/custom.vue +69 -0
- package/docs/.vuepress/components/mockData/example.vue +290 -0
- package/docs/.vuepress/components/positionSlot/base.vue +24 -0
- package/docs/.vuepress/components/positionSlot/form.vue +71 -0
- package/docs/.vuepress/components/positionSlot/table.vue +85 -0
- package/docs/.vuepress/components/tabs/base.vue +57 -0
- package/docs/.vuepress/components/temp.js +195 -0
- package/docs/.vuepress/config.js +146 -0
- package/docs/.vuepress/enhanceApp.js +142 -0
- package/docs/.vuepress/public/favicon.ico +0 -0
- package/docs/.vuepress/public/super.png +0 -0
- package/docs/.vuepress/styles/index.styl +25 -0
- package/docs/.vuepress/styles/palette.styl +6 -0
- package/docs/README.md +14 -0
- package/docs/guide/button/base.md +31 -0
- package/docs/guide/commonConfig/jsx.md +166 -0
- package/docs/guide/commonConfig/presetCodeTemplate.md +68 -0
- package/docs/guide/commonConfig/renderType.md +181 -0
- package/docs/guide/crud/baseUse.md +120 -0
- package/docs/guide/crud/buttons.md +18 -0
- package/docs/guide/crud/config.md +217 -0
- package/docs/guide/crud/contextMenu.md +18 -0
- package/docs/guide/crud/dataSort.md +66 -0
- package/docs/guide/crud/genDynamicColumns.md +145 -0
- package/docs/guide/crud/handleBar.md +26 -0
- package/docs/guide/crud/renderType.md +4 -0
- package/docs/guide/crud/search.md +150 -0
- package/docs/guide/crud/selection.md +73 -0
- package/docs/guide/crud/span.md +98 -0
- package/docs/guide/crud/summary.md +167 -0
- package/docs/guide/crud/tableEdit.md +377 -0
- package/docs/guide/crud/validate.md +158 -0
- package/docs/guide/dialog/baseUse.md +81 -0
- package/docs/guide/dict/baseUse.md +174 -0
- package/docs/guide/dict/component.md +88 -0
- package/docs/guide/dict/config.md +44 -0
- package/docs/guide/form/baseUse.md +142 -0
- package/docs/guide/form/detail.md +38 -0
- package/docs/guide/formatData/baseUse.md +98 -0
- package/docs/guide/formatData/config.md +142 -0
- package/docs/guide/mockData/base.md +26 -0
- package/docs/guide/positionSlot/base.md +41 -0
- package/docs/guide/question/base.md +44 -0
- package/docs/guide/start/base.md +30 -0
- package/docs/guide/tabs/base.md +63 -0
- package/examples/App.vue +52 -0
- package/examples/Layout/components/AppMain.vue +40 -0
- package/examples/Layout/components/Item.vue +29 -0
- package/examples/Layout/components/Link.vue +44 -0
- package/examples/Layout/components/SidebarItem.vue +93 -0
- package/examples/Layout/index.vue +69 -0
- package/examples/assets/logo.png +0 -0
- package/examples/favicon.ico +0 -0
- package/examples/index.html +18 -0
- package/examples/main.js +54 -0
- package/examples/router/index.js +140 -0
- package/examples/store/index.js +0 -0
- package/examples/styles/index.scss +63 -0
- package/examples/styles/sidebar.scss +226 -0
- package/examples/styles/transition.scss +48 -0
- package/examples/styles/variables.scss +25 -0
- package/examples/views/crud/base.vue +68 -0
- package/examples/views/crud/handleRow.vue +84 -0
- package/examples/views/crud/search.vue +116 -0
- package/examples/views/dashboard/index.vue +244 -0
- package/examples/views/dashboard/index1.vue +234 -0
- package/examples/views/dashboard/test.vue +9 -0
- package/examples/views/formTest/index.vue +168 -0
- package/examples/views/nested/menu1/index.vue +7 -0
- package/examples/views/nested/menu1/menu1-1/index.vue +7 -0
- package/examples/views/nested/menu1/menu1-2/index.vue +7 -0
- package/examples/views/nested/menu1/menu1-2/menu1-2-1/index.vue +5 -0
- package/examples/views/nested/menu1/menu1-2/menu1-2-2/index.vue +5 -0
- package/examples/views/nested/menu1/menu1-3/index.vue +5 -0
- package/examples/views/nested/menu2/index.vue +5 -0
- package/gulpfile.js +84 -0
- package/lib/index.css +1 -0
- package/lib/super-crud.min.js +15 -0
- package/package.json +66 -0
- package/packages/button/index.vue +189 -0
- package/packages/core/components/comp.vue +223 -0
- package/packages/core/components/position.vue +135 -0
- package/packages/core/components/render.vue +460 -0
- package/packages/core/configManager.js +302 -0
- package/packages/core/create.js +8 -0
- package/packages/core/defaultRender.js +64 -0
- package/packages/core/dict/global.js +10 -0
- package/packages/core/dict/index.js +432 -0
- package/packages/core/dict/mixin.js +94 -0
- package/packages/core/event.js +60 -0
- package/packages/core/index.js +6 -0
- package/packages/core/init.js +122 -0
- package/packages/core/mock/genConfig.js +228 -0
- package/packages/core/mock/genData.js +422 -0
- package/packages/core/mock/index.js +4 -0
- package/packages/core/rules.js +111 -0
- package/packages/crud/column.vue +205 -0
- package/packages/crud/columnAction.vue +207 -0
- package/packages/crud/columnCell.vue +146 -0
- package/packages/crud/defaultColumn.vue +130 -0
- package/packages/crud/drawerColumn.vue +225 -0
- package/packages/crud/form.vue +69 -0
- package/packages/crud/index.vue +564 -0
- package/packages/crud/menuBar.vue +298 -0
- package/packages/crud/mixins/cacheHandler.js +36 -0
- package/packages/crud/mixins/calcColumnWidth.js +79 -0
- package/packages/crud/mixins/calcHeight.js +105 -0
- package/packages/crud/mixins/columnHandler.js +128 -0
- package/packages/crud/mixins/contextMenu.js +98 -0
- package/packages/crud/mixins/dataProcessor.js +202 -0
- package/packages/crud/mixins/dialog.js +109 -0
- package/packages/crud/mixins/excelHandler.js +150 -0
- package/packages/crud/mixins/exposeMethods.js +107 -0
- package/packages/crud/mixins/generateDynamicColumns.js +250 -0
- package/packages/crud/mixins/props.js +38 -0
- package/packages/crud/mixins/searchHandler.js +151 -0
- package/packages/crud/mixins/select.js +359 -0
- package/packages/crud/mixins/spanMethod.js +288 -0
- package/packages/crud/mixins/summary.js +177 -0
- package/packages/crud/mixins/tableEdit.js +547 -0
- package/packages/crud/mixins/validate.js +219 -0
- package/packages/crud/pagination.vue +110 -0
- package/packages/crud/search.vue +119 -0
- package/packages/crud/searchHeader.vue +231 -0
- package/packages/crud/selectBanner.vue +138 -0
- package/packages/crud/utils/EditState.js +319 -0
- package/packages/crud/utils/excelExport.js +112 -0
- package/packages/crud/utils/excelImport.js +112 -0
- package/packages/crud/utils/index.js +98 -0
- package/packages/dialog/dialog.js +233 -0
- package/packages/dialog/dialog.vue +15 -0
- package/packages/dialog/index.js +22 -0
- package/packages/dict/cascadeFormat.vue +179 -0
- package/packages/dict/dateFormat.vue +40 -0
- package/packages/dict/form/cascade.vue +61 -0
- package/packages/dict/form/checkbox.vue +90 -0
- package/packages/dict/form/extendMethod.js +22 -0
- package/packages/dict/form/input-base.js +31 -0
- package/packages/dict/form/input.js +20 -0
- package/packages/dict/form/radio.vue +69 -0
- package/packages/dict/form/select.vue +118 -0
- package/packages/dict/form/switch.vue +75 -0
- package/packages/dict/valueFormat.vue +188 -0
- package/packages/directive/dialog/drag.js +86 -0
- package/packages/directive/dialog/dragSize.js +42 -0
- package/packages/directive/index.js +9 -0
- package/packages/directive/insertSlot.js +10 -0
- package/packages/form/contextMenu.js +192 -0
- package/packages/form/draftDrawer.vue +391 -0
- package/packages/form/formAction.vue +97 -0
- package/packages/form/formItem.vue +259 -0
- package/packages/form/index.vue +451 -0
- package/packages/form/props.js +15 -0
- package/packages/grid/cell.vue +65 -0
- package/packages/grid/index.vue +130 -0
- package/packages/group/index.vue +96 -0
- package/packages/tabs/index.vue +290 -0
- package/packages/tooltip/index.js +9 -0
- package/packages/tooltip/tooltip.vue +32 -0
- package/packages/tooltip/tooltipComponent.js +38 -0
- package/packages/verifyInput/index.vue +131 -0
- package/src/config/common.js +88 -0
- package/src/config/crud.js +567 -0
- package/src/config/dialog.js +87 -0
- package/src/config/form.js +215 -0
- package/src/config/index.js +9 -0
- package/src/constants/index.js +72 -0
- package/src/index.js +67 -0
- package/src/template/btn/crud.js +6 -0
- package/src/template/btn/dialog.js +1 -0
- package/src/template/btn/form.js +3 -0
- package/src/template/btn/index.js +9 -0
- package/src/template/dicts.js +1 -0
- package/src/template/formatData.js +507 -0
- package/src/template/index.js +19 -0
- package/src/template/render.js +124 -0
- package/src/template/rules.js +53 -0
- package/src/utils/bem.js +49 -0
- package/src/utils/cache.js +77 -0
- package/src/utils/getType.js +34 -0
- package/src/utils/index.js +212 -0
- package/src/utils/mergeTemp.js +124 -0
- package/styles/button.scss +3 -0
- package/styles/crud.scss +425 -0
- package/styles/dialog.scss +95 -0
- package/styles/form.scss +532 -0
- package/styles/group.scss +78 -0
- package/styles/index.scss +94 -0
- package/styles/tabs.scss +139 -0
- package/styles/verifyInput.scss +56 -0
- package/vue-jsx-sync.js +90 -0
- package/vue.config.js +54 -0
@@ -0,0 +1,82 @@
|
|
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>
|
@@ -0,0 +1,54 @@
|
|
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>
|
@@ -0,0 +1,70 @@
|
|
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>
|
@@ -0,0 +1,108 @@
|
|
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>
|
@@ -0,0 +1,114 @@
|
|
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>
|
@@ -0,0 +1,118 @@
|
|
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>
|
@@ -0,0 +1,54 @@
|
|
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>
|
@@ -0,0 +1,69 @@
|
|
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>
|