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,18 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
7
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
8
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
9
|
+
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<noscript>
|
13
|
+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
14
|
+
</noscript>
|
15
|
+
<div id="app"></div>
|
16
|
+
<!-- built files will be auto injected -->
|
17
|
+
</body>
|
18
|
+
</html>
|
package/examples/main.js
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
import Vue from "vue";
|
2
|
+
import App from "./App.vue";
|
3
|
+
import router from "./router";
|
4
|
+
import store from "./store";
|
5
|
+
|
6
|
+
import ElementUI from "element-ui";
|
7
|
+
import "element-ui/lib/theme-chalk/index.css";
|
8
|
+
import "#/styles/index.scss";
|
9
|
+
import "../styles/index.scss";
|
10
|
+
|
11
|
+
// import Package from "../lib/super-crud.min.js";
|
12
|
+
import Package from "../src/index";
|
13
|
+
|
14
|
+
Vue.use(ElementUI);
|
15
|
+
Vue.use(Package, {
|
16
|
+
dict: {
|
17
|
+
request: (key = "sys_notice_status", cb) => {
|
18
|
+
console.log("req");
|
19
|
+
axios({
|
20
|
+
url: "api/system/dict/data/type/" + key,
|
21
|
+
method: "get",
|
22
|
+
headers: {
|
23
|
+
Authorization:
|
24
|
+
"Bearer " +
|
25
|
+
"eyJhbGciOiJIUzUxMiJ9.eyJ0ZW5hbnRfaWQiOjEsInVzZXJfaWQiOjEsInVzZXJfa2V5IjoiNTA0N2JjNDctMjViMS00NDhhLWFlNTUtN2UxMzUwNDVhMDFlIiwidXNlcm5hbWUiOiJhZG1pbiJ9.EKQ4YAUjk0_TNcLNCM5WRU52gxAYQOEuhDQ7WotmgYfCPZvTbdgehs8KhJdfEU6casSR4FvGDi-q8TOG_HLJKQ",
|
26
|
+
},
|
27
|
+
}).then((res) => {
|
28
|
+
cb(res.data.data);
|
29
|
+
});
|
30
|
+
},
|
31
|
+
value: "dictValue",
|
32
|
+
label: "dictLabel",
|
33
|
+
color: "listClass",
|
34
|
+
},
|
35
|
+
template: {
|
36
|
+
render: {
|
37
|
+
test: (item) => {
|
38
|
+
return {
|
39
|
+
render: (h) => {
|
40
|
+
return h("div", "1111");
|
41
|
+
},
|
42
|
+
};
|
43
|
+
},
|
44
|
+
},
|
45
|
+
},
|
46
|
+
});
|
47
|
+
|
48
|
+
Vue.config.productionTip = false;
|
49
|
+
|
50
|
+
new Vue({
|
51
|
+
router,
|
52
|
+
store,
|
53
|
+
render: (h) => h(App),
|
54
|
+
}).$mount("#app");
|
@@ -0,0 +1,140 @@
|
|
1
|
+
import Vue from "vue";
|
2
|
+
import VueRouter from "vue-router";
|
3
|
+
import Layout from "../Layout";
|
4
|
+
|
5
|
+
Vue.use(VueRouter);
|
6
|
+
|
7
|
+
const routes = [
|
8
|
+
{
|
9
|
+
path: "/crud",
|
10
|
+
component: Layout,
|
11
|
+
redirect: "/crud/index",
|
12
|
+
children: [
|
13
|
+
{
|
14
|
+
path: "base",
|
15
|
+
name: "base",
|
16
|
+
component: () => import("#/views/crud/base"),
|
17
|
+
meta: { title: "基本使用" },
|
18
|
+
},
|
19
|
+
{
|
20
|
+
path: "search",
|
21
|
+
name: "search",
|
22
|
+
component: () => import("#/views/crud/search"),
|
23
|
+
meta: { title: "搜索" },
|
24
|
+
},
|
25
|
+
{
|
26
|
+
path: "handleRow",
|
27
|
+
name: "handleRow",
|
28
|
+
component: () => import("#/views/crud/handleRow"),
|
29
|
+
meta: { title: "表头操作栏" },
|
30
|
+
},
|
31
|
+
],
|
32
|
+
},
|
33
|
+
{
|
34
|
+
path: "/",
|
35
|
+
component: Layout,
|
36
|
+
redirect: "/dashboard",
|
37
|
+
children: [
|
38
|
+
{
|
39
|
+
path: "dashboard",
|
40
|
+
name: "Dashboard",
|
41
|
+
component: () => import("#/views/dashboard/index"),
|
42
|
+
meta: { title: "Dashboard", icon: "dashboard" },
|
43
|
+
},
|
44
|
+
{
|
45
|
+
path: "dashboard1",
|
46
|
+
name: "Dashboard1",
|
47
|
+
component: () => import("#/views/dashboard/index1"),
|
48
|
+
meta: { title: "Dashboard", icon: "dashboard" },
|
49
|
+
},
|
50
|
+
{
|
51
|
+
path: "formTest",
|
52
|
+
name: "formTest",
|
53
|
+
component: () => import("#/views/formTest/index"),
|
54
|
+
meta: { title: "formTest" },
|
55
|
+
},
|
56
|
+
],
|
57
|
+
},
|
58
|
+
|
59
|
+
{
|
60
|
+
path: "/nested",
|
61
|
+
component: Layout,
|
62
|
+
redirect: "/nested/menu1",
|
63
|
+
name: "Nested",
|
64
|
+
meta: {
|
65
|
+
title: "Nested",
|
66
|
+
icon: "nested",
|
67
|
+
},
|
68
|
+
children: [
|
69
|
+
{
|
70
|
+
path: "menu1",
|
71
|
+
component: () => import("#/views/nested/menu1/index"), // Parent router-view
|
72
|
+
name: "Menu1",
|
73
|
+
meta: { title: "Menu1" },
|
74
|
+
children: [
|
75
|
+
{
|
76
|
+
path: "menu1-1",
|
77
|
+
component: () => import("#/views/nested/menu1/menu1-1"),
|
78
|
+
name: "Menu1-1",
|
79
|
+
meta: { title: "Menu1-1" },
|
80
|
+
},
|
81
|
+
{
|
82
|
+
path: "menu1-2",
|
83
|
+
component: () => import("#/views/nested/menu1/menu1-2"),
|
84
|
+
name: "Menu1-2",
|
85
|
+
meta: { title: "Menu1-2" },
|
86
|
+
children: [
|
87
|
+
{
|
88
|
+
path: "menu1-2-1",
|
89
|
+
component: () =>
|
90
|
+
import("#/views/nested/menu1/menu1-2/menu1-2-1"),
|
91
|
+
name: "Menu1-2-1",
|
92
|
+
meta: { title: "Menu1-2-1" },
|
93
|
+
},
|
94
|
+
{
|
95
|
+
path: "menu1-2-2",
|
96
|
+
component: () =>
|
97
|
+
import("#/views/nested/menu1/menu1-2/menu1-2-2"),
|
98
|
+
name: "Menu1-2-2",
|
99
|
+
meta: { title: "Menu1-2-2" },
|
100
|
+
},
|
101
|
+
],
|
102
|
+
},
|
103
|
+
{
|
104
|
+
path: "menu1-3",
|
105
|
+
component: () => import("#/views/nested/menu1/menu1-3"),
|
106
|
+
name: "Menu1-3",
|
107
|
+
meta: { title: "Menu1-3" },
|
108
|
+
},
|
109
|
+
],
|
110
|
+
},
|
111
|
+
{
|
112
|
+
path: "menu2",
|
113
|
+
name: "Menu2",
|
114
|
+
meta: { title: "menu2" },
|
115
|
+
},
|
116
|
+
],
|
117
|
+
},
|
118
|
+
|
119
|
+
{
|
120
|
+
path: "external-link",
|
121
|
+
component: Layout,
|
122
|
+
children: [
|
123
|
+
{
|
124
|
+
path: "https://panjiachen.github.io/vue-element-admin-site/#/",
|
125
|
+
meta: { title: "External Link", icon: "link" },
|
126
|
+
},
|
127
|
+
],
|
128
|
+
},
|
129
|
+
|
130
|
+
// 404 page must be placed at the end !!!
|
131
|
+
{ path: "*", redirect: "/404", hidden: true },
|
132
|
+
];
|
133
|
+
|
134
|
+
const router = new VueRouter({
|
135
|
+
mode: "history",
|
136
|
+
base: process.env.BASE_URL,
|
137
|
+
routes,
|
138
|
+
});
|
139
|
+
|
140
|
+
export default router;
|
File without changes
|
@@ -0,0 +1,63 @@
|
|
1
|
+
@import './variables.scss';
|
2
|
+
@import './transition.scss';
|
3
|
+
@import './sidebar.scss';
|
4
|
+
|
5
|
+
body {
|
6
|
+
height: 100%;
|
7
|
+
-moz-osx-font-smoothing: grayscale;
|
8
|
+
-webkit-font-smoothing: antialiased;
|
9
|
+
text-rendering: optimizeLegibility;
|
10
|
+
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
|
11
|
+
}
|
12
|
+
|
13
|
+
label {
|
14
|
+
font-weight: 700;
|
15
|
+
}
|
16
|
+
|
17
|
+
html {
|
18
|
+
height: 100%;
|
19
|
+
box-sizing: border-box;
|
20
|
+
}
|
21
|
+
|
22
|
+
#app {
|
23
|
+
height: 100%;
|
24
|
+
}
|
25
|
+
|
26
|
+
*,
|
27
|
+
*:before,
|
28
|
+
*:after {
|
29
|
+
box-sizing: inherit;
|
30
|
+
}
|
31
|
+
|
32
|
+
a:focus,
|
33
|
+
a:active {
|
34
|
+
outline: none;
|
35
|
+
}
|
36
|
+
|
37
|
+
a,
|
38
|
+
a:focus,
|
39
|
+
a:hover {
|
40
|
+
cursor: pointer;
|
41
|
+
color: inherit;
|
42
|
+
text-decoration: none;
|
43
|
+
}
|
44
|
+
|
45
|
+
div:focus {
|
46
|
+
outline: none;
|
47
|
+
}
|
48
|
+
|
49
|
+
.clearfix {
|
50
|
+
&:after {
|
51
|
+
visibility: hidden;
|
52
|
+
display: block;
|
53
|
+
font-size: 0;
|
54
|
+
content: " ";
|
55
|
+
clear: both;
|
56
|
+
height: 0;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
// main-container global css
|
61
|
+
.app-container {
|
62
|
+
padding: 20px;
|
63
|
+
}
|
@@ -0,0 +1,226 @@
|
|
1
|
+
#app {
|
2
|
+
|
3
|
+
.main-container {
|
4
|
+
min-height: 100%;
|
5
|
+
transition: margin-left .28s;
|
6
|
+
margin-left: $sideBarWidth;
|
7
|
+
position: relative;
|
8
|
+
}
|
9
|
+
|
10
|
+
.sidebar-container {
|
11
|
+
transition: width 0.28s;
|
12
|
+
width: $sideBarWidth !important;
|
13
|
+
background-color: $menuBg;
|
14
|
+
height: 100%;
|
15
|
+
position: fixed;
|
16
|
+
font-size: 0px;
|
17
|
+
top: 0;
|
18
|
+
bottom: 0;
|
19
|
+
left: 0;
|
20
|
+
z-index: 1001;
|
21
|
+
overflow: hidden;
|
22
|
+
|
23
|
+
// reset element-ui css
|
24
|
+
.horizontal-collapse-transition {
|
25
|
+
transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
|
26
|
+
}
|
27
|
+
|
28
|
+
.scrollbar-wrapper {
|
29
|
+
overflow-x: hidden !important;
|
30
|
+
}
|
31
|
+
|
32
|
+
.el-scrollbar__bar.is-vertical {
|
33
|
+
right: 0px;
|
34
|
+
}
|
35
|
+
|
36
|
+
.el-scrollbar {
|
37
|
+
height: 100%;
|
38
|
+
}
|
39
|
+
|
40
|
+
&.has-logo {
|
41
|
+
.el-scrollbar {
|
42
|
+
height: calc(100% - 50px);
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
.is-horizontal {
|
47
|
+
display: none;
|
48
|
+
}
|
49
|
+
|
50
|
+
a {
|
51
|
+
display: inline-block;
|
52
|
+
width: 100%;
|
53
|
+
overflow: hidden;
|
54
|
+
}
|
55
|
+
|
56
|
+
.svg-icon {
|
57
|
+
margin-right: 16px;
|
58
|
+
}
|
59
|
+
|
60
|
+
.sub-el-icon {
|
61
|
+
margin-right: 12px;
|
62
|
+
margin-left: -2px;
|
63
|
+
}
|
64
|
+
|
65
|
+
.el-menu {
|
66
|
+
border: none;
|
67
|
+
height: 100%;
|
68
|
+
width: 100% !important;
|
69
|
+
}
|
70
|
+
|
71
|
+
// menu hover
|
72
|
+
.submenu-title-noDropdown,
|
73
|
+
.el-submenu__title {
|
74
|
+
&:hover {
|
75
|
+
background-color: $menuHover !important;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
.is-active>.el-submenu__title {
|
80
|
+
color: $subMenuActiveText !important;
|
81
|
+
}
|
82
|
+
|
83
|
+
& .nest-menu .el-submenu>.el-submenu__title,
|
84
|
+
& .el-submenu .el-menu-item {
|
85
|
+
min-width: $sideBarWidth !important;
|
86
|
+
background-color: $subMenuBg !important;
|
87
|
+
|
88
|
+
&:hover {
|
89
|
+
background-color: $subMenuHover !important;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
.hideSidebar {
|
95
|
+
.sidebar-container {
|
96
|
+
width: 54px !important;
|
97
|
+
}
|
98
|
+
|
99
|
+
.main-container {
|
100
|
+
margin-left: 54px;
|
101
|
+
}
|
102
|
+
|
103
|
+
.submenu-title-noDropdown {
|
104
|
+
padding: 0 !important;
|
105
|
+
position: relative;
|
106
|
+
|
107
|
+
.el-tooltip {
|
108
|
+
padding: 0 !important;
|
109
|
+
|
110
|
+
.svg-icon {
|
111
|
+
margin-left: 20px;
|
112
|
+
}
|
113
|
+
|
114
|
+
.sub-el-icon {
|
115
|
+
margin-left: 19px;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
.el-submenu {
|
121
|
+
overflow: hidden;
|
122
|
+
|
123
|
+
&>.el-submenu__title {
|
124
|
+
padding: 0 !important;
|
125
|
+
|
126
|
+
.svg-icon {
|
127
|
+
margin-left: 20px;
|
128
|
+
}
|
129
|
+
|
130
|
+
.sub-el-icon {
|
131
|
+
margin-left: 19px;
|
132
|
+
}
|
133
|
+
|
134
|
+
.el-submenu__icon-arrow {
|
135
|
+
display: none;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
.el-menu--collapse {
|
141
|
+
.el-submenu {
|
142
|
+
&>.el-submenu__title {
|
143
|
+
&>span {
|
144
|
+
height: 0;
|
145
|
+
width: 0;
|
146
|
+
overflow: hidden;
|
147
|
+
visibility: hidden;
|
148
|
+
display: inline-block;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
.el-menu--collapse .el-menu .el-submenu {
|
156
|
+
min-width: $sideBarWidth !important;
|
157
|
+
}
|
158
|
+
|
159
|
+
// mobile responsive
|
160
|
+
.mobile {
|
161
|
+
.main-container {
|
162
|
+
margin-left: 0px;
|
163
|
+
}
|
164
|
+
|
165
|
+
.sidebar-container {
|
166
|
+
transition: transform .28s;
|
167
|
+
width: $sideBarWidth !important;
|
168
|
+
}
|
169
|
+
|
170
|
+
&.hideSidebar {
|
171
|
+
.sidebar-container {
|
172
|
+
pointer-events: none;
|
173
|
+
transition-duration: 0.3s;
|
174
|
+
transform: translate3d(-$sideBarWidth, 0, 0);
|
175
|
+
}
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
.withoutAnimation {
|
180
|
+
|
181
|
+
.main-container,
|
182
|
+
.sidebar-container {
|
183
|
+
transition: none;
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
// when menu collapsed
|
189
|
+
.el-menu--vertical {
|
190
|
+
&>.el-menu {
|
191
|
+
.svg-icon {
|
192
|
+
margin-right: 16px;
|
193
|
+
}
|
194
|
+
.sub-el-icon {
|
195
|
+
margin-right: 12px;
|
196
|
+
margin-left: -2px;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
.nest-menu .el-submenu>.el-submenu__title,
|
201
|
+
.el-menu-item {
|
202
|
+
&:hover {
|
203
|
+
// you can use $subMenuHover
|
204
|
+
background-color: $menuHover !important;
|
205
|
+
}
|
206
|
+
}
|
207
|
+
|
208
|
+
// the scroll bar appears when the subMenu is too long
|
209
|
+
>.el-menu--popup {
|
210
|
+
max-height: 100vh;
|
211
|
+
overflow-y: auto;
|
212
|
+
|
213
|
+
&::-webkit-scrollbar-track-piece {
|
214
|
+
background: #d3dce6;
|
215
|
+
}
|
216
|
+
|
217
|
+
&::-webkit-scrollbar {
|
218
|
+
width: 6px;
|
219
|
+
}
|
220
|
+
|
221
|
+
&::-webkit-scrollbar-thumb {
|
222
|
+
background: #99a9bf;
|
223
|
+
border-radius: 20px;
|
224
|
+
}
|
225
|
+
}
|
226
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
// global transition css
|
2
|
+
|
3
|
+
/* fade */
|
4
|
+
.fade-enter-active,
|
5
|
+
.fade-leave-active {
|
6
|
+
transition: opacity 0.28s;
|
7
|
+
}
|
8
|
+
|
9
|
+
.fade-enter,
|
10
|
+
.fade-leave-active {
|
11
|
+
opacity: 0;
|
12
|
+
}
|
13
|
+
|
14
|
+
/* fade-transform */
|
15
|
+
.fade-transform-leave-active,
|
16
|
+
.fade-transform-enter-active {
|
17
|
+
transition: all .5s;
|
18
|
+
}
|
19
|
+
|
20
|
+
.fade-transform-enter {
|
21
|
+
opacity: 0;
|
22
|
+
transform: translateX(-30px);
|
23
|
+
}
|
24
|
+
|
25
|
+
.fade-transform-leave-to {
|
26
|
+
opacity: 0;
|
27
|
+
transform: translateX(30px);
|
28
|
+
}
|
29
|
+
|
30
|
+
/* breadcrumb transition */
|
31
|
+
.breadcrumb-enter-active,
|
32
|
+
.breadcrumb-leave-active {
|
33
|
+
transition: all .5s;
|
34
|
+
}
|
35
|
+
|
36
|
+
.breadcrumb-enter,
|
37
|
+
.breadcrumb-leave-active {
|
38
|
+
opacity: 0;
|
39
|
+
transform: translateX(20px);
|
40
|
+
}
|
41
|
+
|
42
|
+
.breadcrumb-move {
|
43
|
+
transition: all .5s;
|
44
|
+
}
|
45
|
+
|
46
|
+
.breadcrumb-leave-active {
|
47
|
+
position: absolute;
|
48
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// sidebar
|
2
|
+
$menuText:#bfcbd9;
|
3
|
+
$menuActiveText:#409EFF;
|
4
|
+
$subMenuActiveText:#f4f4f5; //https://github.com/ElemeFE/element/issues/12951
|
5
|
+
|
6
|
+
$menuBg:#304156;
|
7
|
+
$menuHover:#263445;
|
8
|
+
|
9
|
+
$subMenuBg:#1f2d3d;
|
10
|
+
$subMenuHover:#001528;
|
11
|
+
|
12
|
+
$sideBarWidth: 210px;
|
13
|
+
|
14
|
+
// the :export directive is the magic sauce for webpack
|
15
|
+
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
16
|
+
:export {
|
17
|
+
menuText: $menuText;
|
18
|
+
menuActiveText: $menuActiveText;
|
19
|
+
subMenuActiveText: $subMenuActiveText;
|
20
|
+
menuBg: $menuBg;
|
21
|
+
menuHover: $menuHover;
|
22
|
+
subMenuBg: $subMenuBg;
|
23
|
+
subMenuHover: $subMenuHover;
|
24
|
+
sideBarWidth: $sideBarWidth;
|
25
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<template>
|
2
|
+
<sc-crud :options="options" :data="data">
|
3
|
+
<template #slot="{row}">
|
4
|
+
<div>
|
5
|
+
{{ row.slot + "slot" }}
|
6
|
+
</div>
|
7
|
+
</template>
|
8
|
+
</sc-crud>
|
9
|
+
</template>
|
10
|
+
|
11
|
+
<script>
|
12
|
+
export default {
|
13
|
+
/**
|
14
|
+
* 1
|
15
|
+
*
|
16
|
+
* **/
|
17
|
+
data() {
|
18
|
+
return {
|
19
|
+
data: [
|
20
|
+
{
|
21
|
+
id: "1",
|
22
|
+
default: "默认渲染",
|
23
|
+
formatter: "formatter",
|
24
|
+
slot: "插槽渲染",
|
25
|
+
comp: "组件渲染",
|
26
|
+
render: "",
|
27
|
+
},
|
28
|
+
],
|
29
|
+
options: {
|
30
|
+
pagination: true,
|
31
|
+
action: [
|
32
|
+
{
|
33
|
+
label: "操作",
|
34
|
+
icon: "el-icon-edit",
|
35
|
+
onClick: () => {},
|
36
|
+
},
|
37
|
+
],
|
38
|
+
renderColumns: [
|
39
|
+
{ prop: "default", label: "默认渲染" },
|
40
|
+
{
|
41
|
+
prop: "formatter",
|
42
|
+
label: "展示数据格式化",
|
43
|
+
formatter: (row) => row.formatter + "111",
|
44
|
+
},
|
45
|
+
{
|
46
|
+
prop: "slot",
|
47
|
+
label: "插槽渲染",
|
48
|
+
},
|
49
|
+
{
|
50
|
+
prop: "comp",
|
51
|
+
label: "组件渲染",
|
52
|
+
comp: {
|
53
|
+
name: "el-input",
|
54
|
+
},
|
55
|
+
},
|
56
|
+
{
|
57
|
+
prop: "render",
|
58
|
+
label: "render函数渲染",
|
59
|
+
render: (h, { row }) => <div>render渲染</div>,
|
60
|
+
},
|
61
|
+
],
|
62
|
+
},
|
63
|
+
};
|
64
|
+
},
|
65
|
+
};
|
66
|
+
</script>
|
67
|
+
|
68
|
+
<style lang="scss" scoped></style>
|