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,24 @@
|
|
1
|
+
<template>
|
2
|
+
<sc-position>
|
3
|
+
<template #left>
|
4
|
+
<el-button type="primary">左侧</el-button>
|
5
|
+
</template>
|
6
|
+
<template #right>
|
7
|
+
<el-button type="primary">右侧</el-button>
|
8
|
+
</template>
|
9
|
+
<template #top>
|
10
|
+
<el-button style="width: 100%;" type="primary">顶部</el-button>
|
11
|
+
</template>
|
12
|
+
<template #bottom>
|
13
|
+
<el-button style="width: 100%;" type="primary">底部</el-button>
|
14
|
+
</template>
|
15
|
+
<el-input v-model="value" placeholder="请输入内容" />
|
16
|
+
</sc-position>
|
17
|
+
</template>
|
18
|
+
<script>
|
19
|
+
export default {
|
20
|
+
data() {
|
21
|
+
return { value: "" };
|
22
|
+
},
|
23
|
+
};
|
24
|
+
</script>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<h3>表单</h3>
|
4
|
+
<sc-form v-model="form" :options="options">
|
5
|
+
<template #test-left>
|
6
|
+
<el-button>渲染单元格左侧</el-button>
|
7
|
+
</template>
|
8
|
+
<template #test-right>
|
9
|
+
<el-button>渲染单元格右侧</el-button>
|
10
|
+
</template>
|
11
|
+
<template #test-top="scope">
|
12
|
+
<el-button style="width: 100%;">{{
|
13
|
+
scope.row.test || "渲染单元格顶部"
|
14
|
+
}}</el-button>
|
15
|
+
</template>
|
16
|
+
<template #test-bottom>
|
17
|
+
<el-button style="width: 100%;">渲染单元格底部</el-button>
|
18
|
+
</template>
|
19
|
+
</sc-form>
|
20
|
+
<h3>表格</h3>
|
21
|
+
<sc-crud :options="options" :data="data"
|
22
|
+
><template #test-left>
|
23
|
+
<el-button>渲染单元格左侧 </el-button>
|
24
|
+
</template>
|
25
|
+
<template #test-right>
|
26
|
+
<el-button>渲染单元格右侧</el-button>
|
27
|
+
</template>
|
28
|
+
<template #test-top="scope">
|
29
|
+
<el-button style="width: 100%;">{{
|
30
|
+
scope.row.test || "渲染单元格顶部"
|
31
|
+
}}</el-button>
|
32
|
+
</template>
|
33
|
+
<template #test-bottom>
|
34
|
+
<el-button style="width: 100%;">渲染单元格底部</el-button>
|
35
|
+
</template>
|
36
|
+
</sc-crud>
|
37
|
+
</div>
|
38
|
+
</template>
|
39
|
+
|
40
|
+
<script>
|
41
|
+
export default {
|
42
|
+
data() {
|
43
|
+
return {
|
44
|
+
form: {},
|
45
|
+
data: [
|
46
|
+
{
|
47
|
+
test: "",
|
48
|
+
test2: "11111",
|
49
|
+
},
|
50
|
+
],
|
51
|
+
options: {
|
52
|
+
labelWidth: "160px",
|
53
|
+
renderColumns: [
|
54
|
+
{
|
55
|
+
label: "渲染单元格",
|
56
|
+
prop: "test",
|
57
|
+
position: true,
|
58
|
+
comp: {
|
59
|
+
name: "el-input",
|
60
|
+
},
|
61
|
+
},
|
62
|
+
{
|
63
|
+
label: "普通单元格",
|
64
|
+
prop: "test2",
|
65
|
+
},
|
66
|
+
],
|
67
|
+
},
|
68
|
+
};
|
69
|
+
},
|
70
|
+
};
|
71
|
+
</script>
|
@@ -0,0 +1,85 @@
|
|
1
|
+
<template>
|
2
|
+
<sc-crud
|
3
|
+
:loading.sync="loading"
|
4
|
+
:search.sync="search"
|
5
|
+
:options="options"
|
6
|
+
:data="data"
|
7
|
+
:total="total"
|
8
|
+
@getList="getList"
|
9
|
+
>
|
10
|
+
<template #handleRow>
|
11
|
+
<el-button>操作栏</el-button>
|
12
|
+
</template>
|
13
|
+
<template #handleRow-left>
|
14
|
+
<el-button type="primary">操作栏左侧</el-button>
|
15
|
+
</template>
|
16
|
+
<template #handleRow-right>
|
17
|
+
<el-button type="primary">操作栏右侧</el-button>
|
18
|
+
</template>
|
19
|
+
<template #handleRow-top>
|
20
|
+
<el-button type="primary" style="width: 100%;">操作栏顶部</el-button>
|
21
|
+
</template>
|
22
|
+
<template #handleRow-bottom>
|
23
|
+
<el-button type="primary" style="width: 100%;">操作栏底部</el-button>
|
24
|
+
</template>
|
25
|
+
<template #name-header-left>
|
26
|
+
<el-button type="primary">左侧</el-button>
|
27
|
+
</template>
|
28
|
+
<template #name-header-right>
|
29
|
+
<el-button type="primary">右侧</el-button>
|
30
|
+
</template>
|
31
|
+
<template #name-header-top>
|
32
|
+
<el-button type="primary" style="width: 100%;">顶部</el-button>
|
33
|
+
</template>
|
34
|
+
<template #name-header-bottom>
|
35
|
+
<el-button type="primary" style="width: 100%;">底部</el-button>
|
36
|
+
</template>
|
37
|
+
<template #pagination-left>
|
38
|
+
<el-button type="primary">左侧</el-button>
|
39
|
+
</template>
|
40
|
+
<template #pagination-right>
|
41
|
+
<el-button type="primary">右侧</el-button>
|
42
|
+
</template>
|
43
|
+
<template #pagination-top>
|
44
|
+
<el-button type="primary" style="width: 100%;">顶部</el-button>
|
45
|
+
</template>
|
46
|
+
<template #pagination-bottom>
|
47
|
+
<el-button type="primary" style="width: 100%;">底部</el-button>
|
48
|
+
</template>
|
49
|
+
</sc-crud>
|
50
|
+
</template>
|
51
|
+
|
52
|
+
<script>
|
53
|
+
import { mockApi } from "../mock";
|
54
|
+
export default {
|
55
|
+
data() {
|
56
|
+
return {
|
57
|
+
loading: false,
|
58
|
+
search: {
|
59
|
+
pageNum: 1,
|
60
|
+
pageSize: 2,
|
61
|
+
},
|
62
|
+
options: {
|
63
|
+
init: true,
|
64
|
+
renderColumns: [
|
65
|
+
{ prop: "name", label: "姓名" },
|
66
|
+
{ prop: "gender", label: "性别" },
|
67
|
+
{ prop: "age", label: "年龄" },
|
68
|
+
{ prop: "city", label: "城市" },
|
69
|
+
],
|
70
|
+
},
|
71
|
+
data: [],
|
72
|
+
total: 0,
|
73
|
+
};
|
74
|
+
},
|
75
|
+
methods: {
|
76
|
+
async getList() {
|
77
|
+
this.loading = true;
|
78
|
+
const { data, total } = await mockApi.getList(this.search);
|
79
|
+
this.data = data;
|
80
|
+
this.total = total;
|
81
|
+
this.loading = false;
|
82
|
+
},
|
83
|
+
},
|
84
|
+
};
|
85
|
+
</script>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<template>
|
2
|
+
<sc-tabs
|
3
|
+
v-model="activeTab"
|
4
|
+
:tab-list="tabList"
|
5
|
+
all
|
6
|
+
refresh
|
7
|
+
type="card"
|
8
|
+
@tab-click="handleTabClick"
|
9
|
+
>
|
10
|
+
<template #tab1>
|
11
|
+
<div>标签1的内容</div>
|
12
|
+
</template>
|
13
|
+
|
14
|
+
<template #tab2-label="scope">
|
15
|
+
<i class="el-icon-date"></i>
|
16
|
+
{{ scope.label }}
|
17
|
+
</template>
|
18
|
+
|
19
|
+
<template #tab2>
|
20
|
+
<div>标签2的内容</div>
|
21
|
+
</template>
|
22
|
+
</sc-tabs>
|
23
|
+
</template>
|
24
|
+
|
25
|
+
<script>
|
26
|
+
export default {
|
27
|
+
data() {
|
28
|
+
return {
|
29
|
+
activeTab: "tab1",
|
30
|
+
tabList: [
|
31
|
+
{
|
32
|
+
label: "标签1",
|
33
|
+
name: "tab1",
|
34
|
+
icon: "el-icon-date",
|
35
|
+
cache: true,
|
36
|
+
},
|
37
|
+
{
|
38
|
+
label: "标签2",
|
39
|
+
name: "tab2",
|
40
|
+
},
|
41
|
+
{
|
42
|
+
label: "标签3",
|
43
|
+
name: "tab3",
|
44
|
+
render: () => {
|
45
|
+
return <div>标签3的内容</div>;
|
46
|
+
},
|
47
|
+
},
|
48
|
+
],
|
49
|
+
};
|
50
|
+
},
|
51
|
+
methods: {
|
52
|
+
handleTabClick(tab, item) {
|
53
|
+
console.log("点击的标签:", tab, item);
|
54
|
+
},
|
55
|
+
},
|
56
|
+
};
|
57
|
+
</script>
|
@@ -0,0 +1,195 @@
|
|
1
|
+
const renderColumns = [
|
2
|
+
// 输入框类型
|
3
|
+
{
|
4
|
+
label: "用户名",
|
5
|
+
prop: "username",
|
6
|
+
},
|
7
|
+
{
|
8
|
+
label: "描述",
|
9
|
+
prop: "description",
|
10
|
+
comp: {
|
11
|
+
type: "textarea",
|
12
|
+
rows: 3,
|
13
|
+
},
|
14
|
+
},
|
15
|
+
|
16
|
+
// 数字输入框
|
17
|
+
{
|
18
|
+
label: "年龄",
|
19
|
+
prop: "age",
|
20
|
+
comp: {
|
21
|
+
name: "el-input-number",
|
22
|
+
min: 0,
|
23
|
+
max: 100,
|
24
|
+
},
|
25
|
+
},
|
26
|
+
|
27
|
+
// 选择器
|
28
|
+
{
|
29
|
+
label: "状态",
|
30
|
+
prop: "status1111",
|
31
|
+
comp: {
|
32
|
+
name: "el-select",
|
33
|
+
options: [
|
34
|
+
{ label: "启用", value: 1 },
|
35
|
+
{ label: "禁用", value: 0 },
|
36
|
+
],
|
37
|
+
},
|
38
|
+
},
|
39
|
+
|
40
|
+
// 日期选择器
|
41
|
+
{
|
42
|
+
label: "出生日期",
|
43
|
+
prop: "birthday",
|
44
|
+
comp: {
|
45
|
+
name: "el-date-picker",
|
46
|
+
type: "date",
|
47
|
+
valueFormat: "yyyy-MM-dd",
|
48
|
+
},
|
49
|
+
},
|
50
|
+
{
|
51
|
+
label: "时间范围",
|
52
|
+
prop: "timeRange",
|
53
|
+
comp: {
|
54
|
+
name: "el-date-picker",
|
55
|
+
type: "datetimerange",
|
56
|
+
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
57
|
+
},
|
58
|
+
},
|
59
|
+
|
60
|
+
// 时间选择器
|
61
|
+
{
|
62
|
+
label: "上班时间",
|
63
|
+
prop: "workTime",
|
64
|
+
comp: {
|
65
|
+
name: "el-time-picker",
|
66
|
+
isRange: false,
|
67
|
+
valueFormat: "HH:mm:ss",
|
68
|
+
},
|
69
|
+
},
|
70
|
+
|
71
|
+
// 单选框
|
72
|
+
{
|
73
|
+
label: "性别",
|
74
|
+
prop: "gender",
|
75
|
+
comp: {
|
76
|
+
name: "el-radio-group",
|
77
|
+
options: [
|
78
|
+
{ label: "男", value: 1 },
|
79
|
+
{ label: "女", value: 2 },
|
80
|
+
],
|
81
|
+
},
|
82
|
+
},
|
83
|
+
|
84
|
+
// 多选框
|
85
|
+
{
|
86
|
+
label: "爱好",
|
87
|
+
prop: "hobbies",
|
88
|
+
comp: {
|
89
|
+
name: "el-checkbox-group",
|
90
|
+
options: [
|
91
|
+
{ label: "阅读", value: "reading" },
|
92
|
+
{ label: "运动", value: "sports" },
|
93
|
+
{ label: "音乐", value: "music" },
|
94
|
+
],
|
95
|
+
},
|
96
|
+
},
|
97
|
+
|
98
|
+
// 开关
|
99
|
+
{
|
100
|
+
label: "是否启用",
|
101
|
+
prop: "enabled111",
|
102
|
+
comp: {
|
103
|
+
name: "el-switch",
|
104
|
+
activeValue: true,
|
105
|
+
inactiveValue: false,
|
106
|
+
},
|
107
|
+
},
|
108
|
+
|
109
|
+
// 滑块
|
110
|
+
{
|
111
|
+
label: "进度",
|
112
|
+
prop: "progress",
|
113
|
+
comp: {
|
114
|
+
name: "el-slider",
|
115
|
+
min: 0,
|
116
|
+
max: 100,
|
117
|
+
step: 10,
|
118
|
+
},
|
119
|
+
},
|
120
|
+
|
121
|
+
// 评分
|
122
|
+
{
|
123
|
+
label: "评分",
|
124
|
+
prop: "rate",
|
125
|
+
comp: {
|
126
|
+
name: "el-rate",
|
127
|
+
max: 5,
|
128
|
+
allowHalf: true,
|
129
|
+
},
|
130
|
+
},
|
131
|
+
|
132
|
+
// 级联选择器
|
133
|
+
{
|
134
|
+
label: "地区",
|
135
|
+
prop: "area",
|
136
|
+
comp: {
|
137
|
+
name: "el-cascader",
|
138
|
+
props: { checkStrictly: true, multiple: true },
|
139
|
+
options: [
|
140
|
+
{
|
141
|
+
value: "zhejiang",
|
142
|
+
label: "浙江",
|
143
|
+
children: [
|
144
|
+
{
|
145
|
+
value: "hangzhou",
|
146
|
+
label: "杭州",
|
147
|
+
},
|
148
|
+
{
|
149
|
+
value: "ningbo",
|
150
|
+
label: "宁波",
|
151
|
+
},
|
152
|
+
],
|
153
|
+
},
|
154
|
+
{
|
155
|
+
value: "jiangsu",
|
156
|
+
label: "江苏",
|
157
|
+
children: [
|
158
|
+
{
|
159
|
+
value: "nanjing",
|
160
|
+
label: "南京",
|
161
|
+
children: [
|
162
|
+
{
|
163
|
+
value: "nanjing",
|
164
|
+
label: "南京",
|
165
|
+
},
|
166
|
+
{
|
167
|
+
value: "suzhou",
|
168
|
+
label: "苏州",
|
169
|
+
},
|
170
|
+
],
|
171
|
+
},
|
172
|
+
{
|
173
|
+
value: "suzhou",
|
174
|
+
label: "苏州",
|
175
|
+
},
|
176
|
+
],
|
177
|
+
},
|
178
|
+
],
|
179
|
+
},
|
180
|
+
},
|
181
|
+
|
182
|
+
// 穿梭框
|
183
|
+
{
|
184
|
+
label: "权限",
|
185
|
+
prop: "permissions",
|
186
|
+
comp: {
|
187
|
+
name: "el-transfer",
|
188
|
+
data: [
|
189
|
+
{ key: 1, label: "查看" },
|
190
|
+
{ key: 2, label: "编辑" },
|
191
|
+
{ key: 3, label: "删除" },
|
192
|
+
],
|
193
|
+
},
|
194
|
+
},
|
195
|
+
];
|
@@ -0,0 +1,146 @@
|
|
1
|
+
const alias = require("../../build/alias");
|
2
|
+
|
3
|
+
module.exports = {
|
4
|
+
title: "VueSuperCrud",
|
5
|
+
description: "基于element-ui二次封装,快速开发CRUD业务组件库",
|
6
|
+
theme: "reco",
|
7
|
+
base: "/vue-super-crud/",
|
8
|
+
port: 1235,
|
9
|
+
head: [
|
10
|
+
[
|
11
|
+
"link",
|
12
|
+
{ rel: "shortcut icon", type: "image/x-icon", href: `/favicon.ico` },
|
13
|
+
],
|
14
|
+
],
|
15
|
+
markdown: {
|
16
|
+
// lineNumbers: true // 代码块显示行号
|
17
|
+
},
|
18
|
+
themeConfig: {
|
19
|
+
repo: "https://github.com/Blade-H1kar1/vue-super-crud.git",
|
20
|
+
// 自定义仓库链接文字。
|
21
|
+
repoLabel: "GitHub",
|
22
|
+
sidebarDepth: 3,
|
23
|
+
subSidebar: "auto",
|
24
|
+
searchMaxSuggestions: 10,
|
25
|
+
nav: [
|
26
|
+
{ text: "首页", link: "/" },
|
27
|
+
{ text: "指南", link: "/guide/start/base" },
|
28
|
+
],
|
29
|
+
sidebar: {
|
30
|
+
"/guide/": [
|
31
|
+
{
|
32
|
+
title: "指南",
|
33
|
+
collapsable: true,
|
34
|
+
children: [{ title: "快速使用", path: "start/base" }],
|
35
|
+
},
|
36
|
+
{
|
37
|
+
title: "渲染配置",
|
38
|
+
collapsable: true,
|
39
|
+
children: [
|
40
|
+
"commonConfig/renderType",
|
41
|
+
"commonConfig/jsx",
|
42
|
+
"commonConfig/presetCodeTemplate",
|
43
|
+
],
|
44
|
+
},
|
45
|
+
{
|
46
|
+
title: "字典管理",
|
47
|
+
collapsable: true,
|
48
|
+
children: ["dict/config", "dict/component", "dict/baseUse"],
|
49
|
+
},
|
50
|
+
{
|
51
|
+
title: "方位插槽",
|
52
|
+
collapsable: true,
|
53
|
+
children: ["positionSlot/base"],
|
54
|
+
},
|
55
|
+
{
|
56
|
+
title: "响应式数据格式化",
|
57
|
+
collapsable: true,
|
58
|
+
children: ["formatData/config", "formatData/baseUse"],
|
59
|
+
},
|
60
|
+
{
|
61
|
+
title: "数据模拟",
|
62
|
+
collapsable: true,
|
63
|
+
children: ["mockData/base"],
|
64
|
+
},
|
65
|
+
{
|
66
|
+
title: "crud组件",
|
67
|
+
collapsable: true,
|
68
|
+
children: [
|
69
|
+
"crud/config",
|
70
|
+
"crud/baseUse",
|
71
|
+
"crud/search",
|
72
|
+
"crud/tableEdit",
|
73
|
+
"crud/validate",
|
74
|
+
"crud/contextMenu",
|
75
|
+
"crud/buttons",
|
76
|
+
"crud/selection",
|
77
|
+
"crud/genDynamicColumns",
|
78
|
+
"crud/span",
|
79
|
+
"crud/dataSort",
|
80
|
+
"crud/summary",
|
81
|
+
],
|
82
|
+
},
|
83
|
+
{
|
84
|
+
title: "form组件",
|
85
|
+
collapsable: true,
|
86
|
+
children: ["form/baseUse", "form/detail"],
|
87
|
+
},
|
88
|
+
{
|
89
|
+
title: "dialog组件",
|
90
|
+
collapsable: true,
|
91
|
+
children: ["dialog/baseUse"],
|
92
|
+
},
|
93
|
+
{
|
94
|
+
title: "button组件",
|
95
|
+
collapsable: true,
|
96
|
+
children: ["button/base"],
|
97
|
+
},
|
98
|
+
{
|
99
|
+
title: "tabs组件",
|
100
|
+
collapsable: true,
|
101
|
+
children: ["tabs/base"],
|
102
|
+
},
|
103
|
+
{
|
104
|
+
title: "问题合集",
|
105
|
+
collapsable: true,
|
106
|
+
children: ["question/base"],
|
107
|
+
},
|
108
|
+
],
|
109
|
+
},
|
110
|
+
},
|
111
|
+
configureWebpack: {
|
112
|
+
output: {
|
113
|
+
publicPath: "/vue-super-crud/", // 修改为根路径
|
114
|
+
},
|
115
|
+
module: {
|
116
|
+
rules: [
|
117
|
+
{
|
118
|
+
test: /\.js$/,
|
119
|
+
exclude: /node_modules/,
|
120
|
+
use: {
|
121
|
+
loader: "babel-loader",
|
122
|
+
options: {
|
123
|
+
presets: [
|
124
|
+
"@vue/cli-plugin-babel/preset",
|
125
|
+
[
|
126
|
+
"@vue/babel-preset-jsx",
|
127
|
+
{
|
128
|
+
injectH: false,
|
129
|
+
},
|
130
|
+
],
|
131
|
+
],
|
132
|
+
plugins: ["./vue-jsx-sync"],
|
133
|
+
},
|
134
|
+
},
|
135
|
+
},
|
136
|
+
],
|
137
|
+
},
|
138
|
+
resolve: {
|
139
|
+
alias: {
|
140
|
+
"core-js/library/fn": "core-js/features",
|
141
|
+
...alias,
|
142
|
+
},
|
143
|
+
},
|
144
|
+
},
|
145
|
+
plugins: ["code-copy", "fulltext-search"],
|
146
|
+
};
|