zetan-cli-dev-template-vue-element-admin 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +8 -0
- package/template/.editorconfig +14 -0
- package/template/.env.development +5 -0
- package/template/.env.production +6 -0
- package/template/.env.staging +8 -0
- package/template/.eslintignore +4 -0
- package/template/.eslintrc.js +198 -0
- package/template/.travis.yml +5 -0
- package/template/LICENSE +21 -0
- package/template/README.es.md +228 -0
- package/template/README.ja.md +224 -0
- package/template/README.md +250 -0
- package/template/README.zh-CN.md +273 -0
- package/template/babel.config.js +14 -0
- package/template/build/index.js +35 -0
- package/template/jest.config.js +24 -0
- package/template/jsconfig.json +9 -0
- package/template/mock/article.js +116 -0
- package/template/mock/index.js +60 -0
- package/template/mock/mock-server.js +81 -0
- package/template/mock/remote-search.js +51 -0
- package/template/mock/role/index.js +98 -0
- package/template/mock/role/routes.js +530 -0
- package/template/mock/user.js +84 -0
- package/template/mock/utils.js +48 -0
- package/template/package.json +111 -0
- package/template/plop-templates/component/index.hbs +26 -0
- package/template/plop-templates/component/prompt.js +55 -0
- package/template/plop-templates/store/index.hbs +16 -0
- package/template/plop-templates/store/prompt.js +62 -0
- package/template/plop-templates/utils.js +2 -0
- package/template/plop-templates/view/index.hbs +26 -0
- package/template/plop-templates/view/prompt.js +55 -0
- package/template/plopfile.js +9 -0
- package/template/postcss.config.js +5 -0
- package/template/public/favicon.ico +0 -0
- package/template/public/index.html +15 -0
- package/template/src/App.vue +11 -0
- package/template/src/api/article.js +41 -0
- package/template/src/api/qiniu.js +8 -0
- package/template/src/api/remote-search.js +17 -0
- package/template/src/api/role.js +38 -0
- package/template/src/api/user.js +24 -0
- package/template/src/assets/401_images/401.gif +0 -0
- package/template/src/assets/404_images/404.png +0 -0
- package/template/src/assets/404_images/404_cloud.png +0 -0
- package/template/src/assets/custom-theme/fonts/element-icons.ttf +0 -0
- package/template/src/assets/custom-theme/fonts/element-icons.woff +0 -0
- package/template/src/assets/custom-theme/index.css +1 -0
- package/template/src/components/BackToTop/index.vue +111 -0
- package/template/src/components/Breadcrumb/index.vue +82 -0
- package/template/src/components/Charts/Keyboard.vue +155 -0
- package/template/src/components/Charts/LineMarker.vue +227 -0
- package/template/src/components/Charts/MixChart.vue +271 -0
- package/template/src/components/Charts/mixins/resize.js +56 -0
- package/template/src/components/DndList/index.vue +166 -0
- package/template/src/components/DragSelect/index.vue +65 -0
- package/template/src/components/Dropzone/index.vue +297 -0
- package/template/src/components/ErrorLog/index.vue +78 -0
- package/template/src/components/GithubCorner/index.vue +54 -0
- package/template/src/components/Hamburger/index.vue +44 -0
- package/template/src/components/HeaderSearch/index.vue +180 -0
- package/template/src/components/ImageCropper/index.vue +1779 -0
- package/template/src/components/ImageCropper/utils/data2blob.js +19 -0
- package/template/src/components/ImageCropper/utils/effectRipple.js +39 -0
- package/template/src/components/ImageCropper/utils/language.js +232 -0
- package/template/src/components/ImageCropper/utils/mimes.js +7 -0
- package/template/src/components/JsonEditor/index.vue +77 -0
- package/template/src/components/Kanban/index.vue +99 -0
- package/template/src/components/MDinput/index.vue +360 -0
- package/template/src/components/MarkdownEditor/default-options.js +31 -0
- package/template/src/components/MarkdownEditor/index.vue +118 -0
- package/template/src/components/Pagination/index.vue +101 -0
- package/template/src/components/PanThumb/index.vue +142 -0
- package/template/src/components/RightPanel/index.vue +145 -0
- package/template/src/components/Screenfull/index.vue +60 -0
- package/template/src/components/Share/DropdownMenu.vue +103 -0
- package/template/src/components/SizeSelect/index.vue +57 -0
- package/template/src/components/Sticky/index.vue +91 -0
- package/template/src/components/SvgIcon/index.vue +62 -0
- package/template/src/components/TextHoverEffect/Mallki.vue +113 -0
- package/template/src/components/ThemePicker/index.vue +175 -0
- package/template/src/components/Tinymce/components/EditorImage.vue +111 -0
- package/template/src/components/Tinymce/dynamicLoadScript.js +59 -0
- package/template/src/components/Tinymce/index.vue +247 -0
- package/template/src/components/Tinymce/plugins.js +7 -0
- package/template/src/components/Tinymce/toolbar.js +6 -0
- package/template/src/components/Upload/SingleImage.vue +134 -0
- package/template/src/components/Upload/SingleImage2.vue +130 -0
- package/template/src/components/Upload/SingleImage3.vue +157 -0
- package/template/src/components/UploadExcel/index.vue +138 -0
- package/template/src/directive/clipboard/clipboard.js +49 -0
- package/template/src/directive/clipboard/index.js +13 -0
- package/template/src/directive/el-drag-dialog/drag.js +77 -0
- package/template/src/directive/el-drag-dialog/index.js +13 -0
- package/template/src/directive/el-table/adaptive.js +41 -0
- package/template/src/directive/el-table/index.js +13 -0
- package/template/src/directive/permission/index.js +13 -0
- package/template/src/directive/permission/permission.js +31 -0
- package/template/src/directive/sticky.js +91 -0
- package/template/src/directive/waves/index.js +13 -0
- package/template/src/directive/waves/waves.css +26 -0
- package/template/src/directive/waves/waves.js +72 -0
- package/template/src/filters/index.js +68 -0
- package/template/src/icons/index.js +9 -0
- package/template/src/icons/svg/404.svg +1 -0
- package/template/src/icons/svg/bug.svg +1 -0
- package/template/src/icons/svg/chart.svg +1 -0
- package/template/src/icons/svg/clipboard.svg +1 -0
- package/template/src/icons/svg/component.svg +1 -0
- package/template/src/icons/svg/dashboard.svg +1 -0
- package/template/src/icons/svg/documentation.svg +1 -0
- package/template/src/icons/svg/drag.svg +1 -0
- package/template/src/icons/svg/edit.svg +1 -0
- package/template/src/icons/svg/education.svg +1 -0
- package/template/src/icons/svg/email.svg +1 -0
- package/template/src/icons/svg/example.svg +1 -0
- package/template/src/icons/svg/excel.svg +1 -0
- package/template/src/icons/svg/exit-fullscreen.svg +1 -0
- package/template/src/icons/svg/eye-open.svg +1 -0
- package/template/src/icons/svg/eye.svg +1 -0
- package/template/src/icons/svg/form.svg +1 -0
- package/template/src/icons/svg/fullscreen.svg +1 -0
- package/template/src/icons/svg/guide.svg +1 -0
- package/template/src/icons/svg/icon.svg +1 -0
- package/template/src/icons/svg/international.svg +1 -0
- package/template/src/icons/svg/language.svg +1 -0
- package/template/src/icons/svg/link.svg +1 -0
- package/template/src/icons/svg/list.svg +1 -0
- package/template/src/icons/svg/lock.svg +1 -0
- package/template/src/icons/svg/message.svg +1 -0
- package/template/src/icons/svg/money.svg +1 -0
- package/template/src/icons/svg/nested.svg +1 -0
- package/template/src/icons/svg/password.svg +1 -0
- package/template/src/icons/svg/pdf.svg +1 -0
- package/template/src/icons/svg/people.svg +1 -0
- package/template/src/icons/svg/peoples.svg +1 -0
- package/template/src/icons/svg/qq.svg +1 -0
- package/template/src/icons/svg/search.svg +1 -0
- package/template/src/icons/svg/shopping.svg +1 -0
- package/template/src/icons/svg/size.svg +1 -0
- package/template/src/icons/svg/skill.svg +1 -0
- package/template/src/icons/svg/star.svg +1 -0
- package/template/src/icons/svg/tab.svg +1 -0
- package/template/src/icons/svg/table.svg +1 -0
- package/template/src/icons/svg/theme.svg +1 -0
- package/template/src/icons/svg/tree-table.svg +1 -0
- package/template/src/icons/svg/tree.svg +1 -0
- package/template/src/icons/svg/user.svg +1 -0
- package/template/src/icons/svg/wechat.svg +1 -0
- package/template/src/icons/svg/zip.svg +1 -0
- package/template/src/icons/svgo.yml +22 -0
- package/template/src/layout/components/AppMain.vue +57 -0
- package/template/src/layout/components/Navbar.vue +167 -0
- package/template/src/layout/components/Settings/index.vue +108 -0
- package/template/src/layout/components/Sidebar/FixiOSBug.js +26 -0
- package/template/src/layout/components/Sidebar/Item.vue +41 -0
- package/template/src/layout/components/Sidebar/Link.vue +43 -0
- package/template/src/layout/components/Sidebar/Logo.vue +82 -0
- package/template/src/layout/components/Sidebar/SidebarItem.vue +95 -0
- package/template/src/layout/components/Sidebar/index.vue +54 -0
- package/template/src/layout/components/TagsView/ScrollPane.vue +94 -0
- package/template/src/layout/components/TagsView/index.vue +292 -0
- package/template/src/layout/components/index.js +5 -0
- package/template/src/layout/index.vue +102 -0
- package/template/src/layout/mixin/ResizeHandler.js +45 -0
- package/template/src/main.js +53 -0
- package/template/src/permission.js +74 -0
- package/template/src/router/index.js +404 -0
- package/template/src/router/modules/charts.js +36 -0
- package/template/src/router/modules/components.js +102 -0
- package/template/src/router/modules/nested.js +66 -0
- package/template/src/router/modules/table.js +41 -0
- package/template/src/settings.js +35 -0
- package/template/src/store/getters.js +15 -0
- package/template/src/store/index.js +25 -0
- package/template/src/store/modules/app.js +56 -0
- package/template/src/store/modules/errorLog.js +28 -0
- package/template/src/store/modules/permission.js +69 -0
- package/template/src/store/modules/settings.js +35 -0
- package/template/src/store/modules/tagsView.js +160 -0
- package/template/src/store/modules/user.js +131 -0
- package/template/src/styles/btn.scss +99 -0
- package/template/src/styles/element-ui.scss +84 -0
- package/template/src/styles/element-variables.scss +31 -0
- package/template/src/styles/index.scss +191 -0
- package/template/src/styles/mixin.scss +66 -0
- package/template/src/styles/sidebar.scss +226 -0
- package/template/src/styles/transition.scss +48 -0
- package/template/src/styles/variables.scss +35 -0
- package/template/src/utils/auth.js +15 -0
- package/template/src/utils/clipboard.js +32 -0
- package/template/src/utils/error-log.js +35 -0
- package/template/src/utils/get-page-title.js +10 -0
- package/template/src/utils/index.js +357 -0
- package/template/src/utils/open-window.js +25 -0
- package/template/src/utils/permission.js +21 -0
- package/template/src/utils/request.js +85 -0
- package/template/src/utils/scroll-to.js +58 -0
- package/template/src/utils/validate.js +87 -0
- package/template/src/vendor/Export2Excel.js +220 -0
- package/template/src/vendor/Export2Zip.js +24 -0
- package/template/src/views/charts/keyboard.vue +23 -0
- package/template/src/views/charts/line.vue +23 -0
- package/template/src/views/charts/mix-chart.vue +23 -0
- package/template/src/views/clipboard/index.vue +49 -0
- package/template/src/views/components-demo/avatar-upload.vue +61 -0
- package/template/src/views/components-demo/back-to-top.vue +154 -0
- package/template/src/views/components-demo/count-to.vue +218 -0
- package/template/src/views/components-demo/dnd-list.vue +39 -0
- package/template/src/views/components-demo/drag-dialog.vue +61 -0
- package/template/src/views/components-demo/drag-kanban.vue +66 -0
- package/template/src/views/components-demo/drag-select.vue +43 -0
- package/template/src/views/components-demo/dropzone.vue +31 -0
- package/template/src/views/components-demo/json-editor.vue +36 -0
- package/template/src/views/components-demo/markdown.vue +101 -0
- package/template/src/views/components-demo/mixin.vue +169 -0
- package/template/src/views/components-demo/split-pane.vue +67 -0
- package/template/src/views/components-demo/sticky.vue +135 -0
- package/template/src/views/components-demo/tinymce.vue +36 -0
- package/template/src/views/dashboard/admin/components/BarChart.vue +102 -0
- package/template/src/views/dashboard/admin/components/BoxCard.vue +118 -0
- package/template/src/views/dashboard/admin/components/LineChart.vue +135 -0
- package/template/src/views/dashboard/admin/components/PanelGroup.vue +181 -0
- package/template/src/views/dashboard/admin/components/PieChart.vue +79 -0
- package/template/src/views/dashboard/admin/components/RaddarChart.vue +116 -0
- package/template/src/views/dashboard/admin/components/TodoList/Todo.vue +81 -0
- package/template/src/views/dashboard/admin/components/TodoList/index.scss +320 -0
- package/template/src/views/dashboard/admin/components/TodoList/index.vue +127 -0
- package/template/src/views/dashboard/admin/components/TransactionTable.vue +55 -0
- package/template/src/views/dashboard/admin/components/mixins/resize.js +55 -0
- package/template/src/views/dashboard/admin/index.vue +124 -0
- package/template/src/views/dashboard/editor/index.vue +74 -0
- package/template/src/views/dashboard/index.vue +31 -0
- package/template/src/views/documentation/index.vue +57 -0
- package/template/src/views/error-log/components/ErrorTestA.vue +13 -0
- package/template/src/views/error-log/components/ErrorTestB.vue +11 -0
- package/template/src/views/error-log/index.vue +32 -0
- package/template/src/views/error-page/401.vue +99 -0
- package/template/src/views/error-page/404.vue +228 -0
- package/template/src/views/example/components/ArticleDetail.vue +289 -0
- package/template/src/views/example/components/Dropdown/Comment.vue +41 -0
- package/template/src/views/example/components/Dropdown/Platform.vue +46 -0
- package/template/src/views/example/components/Dropdown/SourceUrl.vue +38 -0
- package/template/src/views/example/components/Dropdown/index.js +3 -0
- package/template/src/views/example/components/Warning.vue +13 -0
- package/template/src/views/example/create.vue +13 -0
- package/template/src/views/example/edit.vue +13 -0
- package/template/src/views/example/list.vue +112 -0
- package/template/src/views/excel/components/AutoWidthOption.vue +34 -0
- package/template/src/views/excel/components/BookTypeOption.vue +39 -0
- package/template/src/views/excel/components/FilenameOption.vue +27 -0
- package/template/src/views/excel/export-excel.vue +116 -0
- package/template/src/views/excel/merge-header.vue +101 -0
- package/template/src/views/excel/select-excel.vue +107 -0
- package/template/src/views/excel/upload-excel.vue +42 -0
- package/template/src/views/guide/index.vue +36 -0
- package/template/src/views/guide/steps.js +53 -0
- package/template/src/views/icons/element-icons.js +3 -0
- package/template/src/views/icons/index.vue +101 -0
- package/template/src/views/icons/svg-icons.js +10 -0
- package/template/src/views/login/auth-redirect.vue +15 -0
- package/template/src/views/login/components/SocialSignin.vue +72 -0
- package/template/src/views/login/index.vue +324 -0
- package/template/src/views/nested/menu1/index.vue +7 -0
- package/template/src/views/nested/menu1/menu1-1/index.vue +7 -0
- package/template/src/views/nested/menu1/menu1-2/index.vue +7 -0
- package/template/src/views/nested/menu1/menu1-2/menu1-2-1/index.vue +5 -0
- package/template/src/views/nested/menu1/menu1-2/menu1-2-2/index.vue +5 -0
- package/template/src/views/nested/menu1/menu1-3/index.vue +5 -0
- package/template/src/views/nested/menu2/index.vue +5 -0
- package/template/src/views/pdf/content.js +58 -0
- package/template/src/views/pdf/download.vue +201 -0
- package/template/src/views/pdf/index.vue +13 -0
- package/template/src/views/permission/components/SwitchRoles.vue +32 -0
- package/template/src/views/permission/directive.vue +111 -0
- package/template/src/views/permission/page.vue +19 -0
- package/template/src/views/permission/role.vue +270 -0
- package/template/src/views/profile/components/Account.vue +38 -0
- package/template/src/views/profile/components/Activity.vue +185 -0
- package/template/src/views/profile/components/Timeline.vue +43 -0
- package/template/src/views/profile/components/UserCard.vue +134 -0
- package/template/src/views/profile/index.vue +68 -0
- package/template/src/views/qiniu/upload.vue +41 -0
- package/template/src/views/redirect/index.vue +12 -0
- package/template/src/views/tab/components/TabPane.vue +103 -0
- package/template/src/views/tab/index.vue +57 -0
- package/template/src/views/table/complex-table.vue +379 -0
- package/template/src/views/table/drag-table.vue +153 -0
- package/template/src/views/table/dynamic-table/components/FixedThead.vue +62 -0
- package/template/src/views/table/dynamic-table/components/UnfixedThead.vue +50 -0
- package/template/src/views/table/dynamic-table/index.vue +24 -0
- package/template/src/views/table/inline-edit-table.vue +149 -0
- package/template/src/views/theme/index.vue +120 -0
- package/template/src/views/zip/index.vue +77 -0
- package/template/tests/unit/.eslintrc.js +5 -0
- package/template/tests/unit/components/Hamburger.spec.js +18 -0
- package/template/tests/unit/components/SvgIcon.spec.js +22 -0
- package/template/tests/unit/utils/formatTime.spec.js +29 -0
- package/template/tests/unit/utils/param2Obj.spec.js +14 -0
- package/template/tests/unit/utils/parseTime.spec.js +37 -0
- package/template/tests/unit/utils/validate.spec.js +28 -0
- package/template/vue.config.js +124 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
/**
|
2
|
+
* @param {string} url
|
3
|
+
* @returns {Object}
|
4
|
+
*/
|
5
|
+
function param2Obj(url) {
|
6
|
+
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
|
7
|
+
if (!search) {
|
8
|
+
return {}
|
9
|
+
}
|
10
|
+
const obj = {}
|
11
|
+
const searchArr = search.split('&')
|
12
|
+
searchArr.forEach(v => {
|
13
|
+
const index = v.indexOf('=')
|
14
|
+
if (index !== -1) {
|
15
|
+
const name = v.substring(0, index)
|
16
|
+
const val = v.substring(index + 1, v.length)
|
17
|
+
obj[name] = val
|
18
|
+
}
|
19
|
+
})
|
20
|
+
return obj
|
21
|
+
}
|
22
|
+
|
23
|
+
/**
|
24
|
+
* This is just a simple version of deep copy
|
25
|
+
* Has a lot of edge cases bug
|
26
|
+
* If you want to use a perfect deep copy, use lodash's _.cloneDeep
|
27
|
+
* @param {Object} source
|
28
|
+
* @returns {Object}
|
29
|
+
*/
|
30
|
+
function deepClone(source) {
|
31
|
+
if (!source && typeof source !== 'object') {
|
32
|
+
throw new Error('error arguments', 'deepClone')
|
33
|
+
}
|
34
|
+
const targetObj = source.constructor === Array ? [] : {}
|
35
|
+
Object.keys(source).forEach(keys => {
|
36
|
+
if (source[keys] && typeof source[keys] === 'object') {
|
37
|
+
targetObj[keys] = deepClone(source[keys])
|
38
|
+
} else {
|
39
|
+
targetObj[keys] = source[keys]
|
40
|
+
}
|
41
|
+
})
|
42
|
+
return targetObj
|
43
|
+
}
|
44
|
+
|
45
|
+
module.exports = {
|
46
|
+
param2Obj,
|
47
|
+
deepClone
|
48
|
+
}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
{
|
2
|
+
"name": "vue-element-admin",
|
3
|
+
"version": "4.4.0",
|
4
|
+
"description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
|
5
|
+
"author": "Pan <panfree23@gmail.com>",
|
6
|
+
"scripts": {
|
7
|
+
"dev": "vue-cli-service serve",
|
8
|
+
"lint": "eslint --ext .js,.vue src",
|
9
|
+
"build:prod": "vue-cli-service build",
|
10
|
+
"build:stage": "vue-cli-service build --mode staging",
|
11
|
+
"preview": "node build/index.js --preview",
|
12
|
+
"new": "plop",
|
13
|
+
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
|
14
|
+
"test:unit": "jest --clearCache && vue-cli-service test:unit",
|
15
|
+
"test:ci": "npm run lint && npm run test:unit"
|
16
|
+
},
|
17
|
+
"dependencies": {
|
18
|
+
"axios": "0.18.1",
|
19
|
+
"clipboard": "2.0.4",
|
20
|
+
"codemirror": "5.45.0",
|
21
|
+
"core-js": "3.6.5",
|
22
|
+
"driver.js": "0.9.5",
|
23
|
+
"dropzone": "5.5.1",
|
24
|
+
"echarts": "4.2.1",
|
25
|
+
"element-ui": "2.13.2",
|
26
|
+
"file-saver": "2.0.1",
|
27
|
+
"fuse.js": "3.4.4",
|
28
|
+
"js-cookie": "2.2.0",
|
29
|
+
"jsonlint": "1.6.3",
|
30
|
+
"jszip": "3.2.1",
|
31
|
+
"normalize.css": "7.0.0",
|
32
|
+
"nprogress": "0.2.0",
|
33
|
+
"path-to-regexp": "2.4.0",
|
34
|
+
"screenfull": "4.2.0",
|
35
|
+
"script-loader": "0.7.2",
|
36
|
+
"sortablejs": "1.8.4",
|
37
|
+
"tui-editor": "1.3.3",
|
38
|
+
"vue": "2.6.10",
|
39
|
+
"vue-count-to": "1.0.13",
|
40
|
+
"vue-router": "3.0.2",
|
41
|
+
"vue-splitpane": "1.0.4",
|
42
|
+
"vuedraggable": "2.20.0",
|
43
|
+
"vuex": "3.1.0",
|
44
|
+
"xlsx": "0.14.1"
|
45
|
+
},
|
46
|
+
"devDependencies": {
|
47
|
+
"@vue/cli-plugin-babel": "4.4.4",
|
48
|
+
"@vue/cli-plugin-eslint": "4.4.4",
|
49
|
+
"@vue/cli-plugin-unit-jest": "4.4.4",
|
50
|
+
"@vue/cli-service": "4.4.4",
|
51
|
+
"@vue/test-utils": "1.0.0-beta.29",
|
52
|
+
"autoprefixer": "9.5.1",
|
53
|
+
"babel-eslint": "10.1.0",
|
54
|
+
"babel-jest": "23.6.0",
|
55
|
+
"babel-plugin-dynamic-import-node": "2.3.3",
|
56
|
+
"chalk": "2.4.2",
|
57
|
+
"chokidar": "2.1.5",
|
58
|
+
"connect": "3.6.6",
|
59
|
+
"eslint": "6.7.2",
|
60
|
+
"eslint-plugin-vue": "6.2.2",
|
61
|
+
"html-webpack-plugin": "3.2.0",
|
62
|
+
"husky": "1.3.1",
|
63
|
+
"lint-staged": "8.1.5",
|
64
|
+
"mockjs": "1.0.1-beta3",
|
65
|
+
"plop": "2.3.0",
|
66
|
+
"runjs": "4.3.2",
|
67
|
+
"sass": "1.26.2",
|
68
|
+
"sass-loader": "8.0.2",
|
69
|
+
"script-ext-html-webpack-plugin": "2.1.3",
|
70
|
+
"serve-static": "1.13.2",
|
71
|
+
"svg-sprite-loader": "4.1.3",
|
72
|
+
"svgo": "1.2.0",
|
73
|
+
"vue-template-compiler": "2.6.10"
|
74
|
+
},
|
75
|
+
"browserslist": [
|
76
|
+
"> 1%",
|
77
|
+
"last 2 versions"
|
78
|
+
],
|
79
|
+
"bugs": {
|
80
|
+
"url": "https://github.com/PanJiaChen/vue-element-admin/issues"
|
81
|
+
},
|
82
|
+
"engines": {
|
83
|
+
"node": ">=8.9",
|
84
|
+
"npm": ">= 3.0.0"
|
85
|
+
},
|
86
|
+
"keywords": [
|
87
|
+
"vue",
|
88
|
+
"admin",
|
89
|
+
"dashboard",
|
90
|
+
"element-ui",
|
91
|
+
"boilerplate",
|
92
|
+
"admin-template",
|
93
|
+
"management-system"
|
94
|
+
],
|
95
|
+
"license": "MIT",
|
96
|
+
"lint-staged": {
|
97
|
+
"src/**/*.{js,vue}": [
|
98
|
+
"eslint --fix",
|
99
|
+
"git add"
|
100
|
+
]
|
101
|
+
},
|
102
|
+
"husky": {
|
103
|
+
"hooks": {
|
104
|
+
"pre-commit": "lint-staged"
|
105
|
+
}
|
106
|
+
},
|
107
|
+
"repository": {
|
108
|
+
"type": "git",
|
109
|
+
"url": "git+https://github.com/PanJiaChen/vue-element-admin.git"
|
110
|
+
}
|
111
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{{#if template}}
|
2
|
+
<template>
|
3
|
+
<div />
|
4
|
+
</template>
|
5
|
+
{{/if}}
|
6
|
+
|
7
|
+
{{#if script}}
|
8
|
+
<script>
|
9
|
+
export default {
|
10
|
+
name: '{{ properCase name }}',
|
11
|
+
props: {},
|
12
|
+
data() {
|
13
|
+
return {}
|
14
|
+
},
|
15
|
+
created() {},
|
16
|
+
mounted() {},
|
17
|
+
methods: {}
|
18
|
+
}
|
19
|
+
</script>
|
20
|
+
{{/if}}
|
21
|
+
|
22
|
+
{{#if style}}
|
23
|
+
<style lang="scss" scoped>
|
24
|
+
|
25
|
+
</style>
|
26
|
+
{{/if}}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
const { notEmpty } = require('../utils.js')
|
2
|
+
|
3
|
+
module.exports = {
|
4
|
+
description: 'generate vue component',
|
5
|
+
prompts: [{
|
6
|
+
type: 'input',
|
7
|
+
name: 'name',
|
8
|
+
message: 'component name please',
|
9
|
+
validate: notEmpty('name')
|
10
|
+
},
|
11
|
+
{
|
12
|
+
type: 'checkbox',
|
13
|
+
name: 'blocks',
|
14
|
+
message: 'Blocks:',
|
15
|
+
choices: [{
|
16
|
+
name: '<template>',
|
17
|
+
value: 'template',
|
18
|
+
checked: true
|
19
|
+
},
|
20
|
+
{
|
21
|
+
name: '<script>',
|
22
|
+
value: 'script',
|
23
|
+
checked: true
|
24
|
+
},
|
25
|
+
{
|
26
|
+
name: 'style',
|
27
|
+
value: 'style',
|
28
|
+
checked: true
|
29
|
+
}
|
30
|
+
],
|
31
|
+
validate(value) {
|
32
|
+
if (value.indexOf('script') === -1 && value.indexOf('template') === -1) {
|
33
|
+
return 'Components require at least a <script> or <template> tag.'
|
34
|
+
}
|
35
|
+
return true
|
36
|
+
}
|
37
|
+
}
|
38
|
+
],
|
39
|
+
actions: data => {
|
40
|
+
const name = '{{properCase name}}'
|
41
|
+
const actions = [{
|
42
|
+
type: 'add',
|
43
|
+
path: `src/components/${name}/index.vue`,
|
44
|
+
templateFile: 'plop-templates/component/index.hbs',
|
45
|
+
data: {
|
46
|
+
name: name,
|
47
|
+
template: data.blocks.includes('template'),
|
48
|
+
script: data.blocks.includes('script'),
|
49
|
+
style: data.blocks.includes('style')
|
50
|
+
}
|
51
|
+
}]
|
52
|
+
|
53
|
+
return actions
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
const { notEmpty } = require('../utils.js')
|
2
|
+
|
3
|
+
module.exports = {
|
4
|
+
description: 'generate store',
|
5
|
+
prompts: [{
|
6
|
+
type: 'input',
|
7
|
+
name: 'name',
|
8
|
+
message: 'store name please',
|
9
|
+
validate: notEmpty('name')
|
10
|
+
},
|
11
|
+
{
|
12
|
+
type: 'checkbox',
|
13
|
+
name: 'blocks',
|
14
|
+
message: 'Blocks:',
|
15
|
+
choices: [{
|
16
|
+
name: 'state',
|
17
|
+
value: 'state',
|
18
|
+
checked: true
|
19
|
+
},
|
20
|
+
{
|
21
|
+
name: 'mutations',
|
22
|
+
value: 'mutations',
|
23
|
+
checked: true
|
24
|
+
},
|
25
|
+
{
|
26
|
+
name: 'actions',
|
27
|
+
value: 'actions',
|
28
|
+
checked: true
|
29
|
+
}
|
30
|
+
],
|
31
|
+
validate(value) {
|
32
|
+
if (!value.includes('state') || !value.includes('mutations')) {
|
33
|
+
return 'store require at least state and mutations'
|
34
|
+
}
|
35
|
+
return true
|
36
|
+
}
|
37
|
+
}
|
38
|
+
],
|
39
|
+
actions(data) {
|
40
|
+
const name = '{{name}}'
|
41
|
+
const { blocks } = data
|
42
|
+
const options = ['state', 'mutations']
|
43
|
+
const joinFlag = `,
|
44
|
+
`
|
45
|
+
if (blocks.length === 3) {
|
46
|
+
options.push('actions')
|
47
|
+
}
|
48
|
+
|
49
|
+
const actions = [{
|
50
|
+
type: 'add',
|
51
|
+
path: `src/store/modules/${name}.js`,
|
52
|
+
templateFile: 'plop-templates/store/index.hbs',
|
53
|
+
data: {
|
54
|
+
options: options.join(joinFlag),
|
55
|
+
state: blocks.includes('state'),
|
56
|
+
mutations: blocks.includes('mutations'),
|
57
|
+
actions: blocks.includes('actions')
|
58
|
+
}
|
59
|
+
}]
|
60
|
+
return actions
|
61
|
+
}
|
62
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{{#if template}}
|
2
|
+
<template>
|
3
|
+
<div />
|
4
|
+
</template>
|
5
|
+
{{/if}}
|
6
|
+
|
7
|
+
{{#if script}}
|
8
|
+
<script>
|
9
|
+
export default {
|
10
|
+
name: '{{ properCase name }}',
|
11
|
+
props: {},
|
12
|
+
data() {
|
13
|
+
return {}
|
14
|
+
},
|
15
|
+
created() {},
|
16
|
+
mounted() {},
|
17
|
+
methods: {}
|
18
|
+
}
|
19
|
+
</script>
|
20
|
+
{{/if}}
|
21
|
+
|
22
|
+
{{#if style}}
|
23
|
+
<style lang="scss" scoped>
|
24
|
+
|
25
|
+
</style>
|
26
|
+
{{/if}}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
const { notEmpty } = require('../utils.js')
|
2
|
+
|
3
|
+
module.exports = {
|
4
|
+
description: 'generate a view',
|
5
|
+
prompts: [{
|
6
|
+
type: 'input',
|
7
|
+
name: 'name',
|
8
|
+
message: 'view name please',
|
9
|
+
validate: notEmpty('name')
|
10
|
+
},
|
11
|
+
{
|
12
|
+
type: 'checkbox',
|
13
|
+
name: 'blocks',
|
14
|
+
message: 'Blocks:',
|
15
|
+
choices: [{
|
16
|
+
name: '<template>',
|
17
|
+
value: 'template',
|
18
|
+
checked: true
|
19
|
+
},
|
20
|
+
{
|
21
|
+
name: '<script>',
|
22
|
+
value: 'script',
|
23
|
+
checked: true
|
24
|
+
},
|
25
|
+
{
|
26
|
+
name: 'style',
|
27
|
+
value: 'style',
|
28
|
+
checked: true
|
29
|
+
}
|
30
|
+
],
|
31
|
+
validate(value) {
|
32
|
+
if (value.indexOf('script') === -1 && value.indexOf('template') === -1) {
|
33
|
+
return 'View require at least a <script> or <template> tag.'
|
34
|
+
}
|
35
|
+
return true
|
36
|
+
}
|
37
|
+
}
|
38
|
+
],
|
39
|
+
actions: data => {
|
40
|
+
const name = '{{name}}'
|
41
|
+
const actions = [{
|
42
|
+
type: 'add',
|
43
|
+
path: `src/views/${name}/index.vue`,
|
44
|
+
templateFile: 'plop-templates/view/index.hbs',
|
45
|
+
data: {
|
46
|
+
name: name,
|
47
|
+
template: data.blocks.includes('template'),
|
48
|
+
script: data.blocks.includes('script'),
|
49
|
+
style: data.blocks.includes('style')
|
50
|
+
}
|
51
|
+
}]
|
52
|
+
|
53
|
+
return actions
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
const viewGenerator = require('./plop-templates/view/prompt')
|
2
|
+
const componentGenerator = require('./plop-templates/component/prompt')
|
3
|
+
const storeGenerator = require('./plop-templates/store/prompt.js')
|
4
|
+
|
5
|
+
module.exports = function(plop) {
|
6
|
+
plop.setGenerator('view', viewGenerator)
|
7
|
+
plop.setGenerator('component', componentGenerator)
|
8
|
+
plop.setGenerator('store', storeGenerator)
|
9
|
+
}
|
Binary file
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
6
|
+
<meta name="renderer" content="webkit">
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
8
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
9
|
+
<title><%= webpackConfig.name %></title>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<div id="app"></div>
|
13
|
+
<!-- built files will be auto injected -->
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import request from '@/utils/request'
|
2
|
+
|
3
|
+
export function fetchList(query) {
|
4
|
+
return request({
|
5
|
+
url: '/vue-element-admin/article/list',
|
6
|
+
method: 'get',
|
7
|
+
params: query
|
8
|
+
})
|
9
|
+
}
|
10
|
+
|
11
|
+
export function fetchArticle(id) {
|
12
|
+
return request({
|
13
|
+
url: '/vue-element-admin/article/detail',
|
14
|
+
method: 'get',
|
15
|
+
params: { id }
|
16
|
+
})
|
17
|
+
}
|
18
|
+
|
19
|
+
export function fetchPv(pv) {
|
20
|
+
return request({
|
21
|
+
url: '/vue-element-admin/article/pv',
|
22
|
+
method: 'get',
|
23
|
+
params: { pv }
|
24
|
+
})
|
25
|
+
}
|
26
|
+
|
27
|
+
export function createArticle(data) {
|
28
|
+
return request({
|
29
|
+
url: '/vue-element-admin/article/create',
|
30
|
+
method: 'post',
|
31
|
+
data
|
32
|
+
})
|
33
|
+
}
|
34
|
+
|
35
|
+
export function updateArticle(data) {
|
36
|
+
return request({
|
37
|
+
url: '/vue-element-admin/article/update',
|
38
|
+
method: 'post',
|
39
|
+
data
|
40
|
+
})
|
41
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import request from '@/utils/request'
|
2
|
+
|
3
|
+
export function searchUser(name) {
|
4
|
+
return request({
|
5
|
+
url: '/vue-element-admin/search/user',
|
6
|
+
method: 'get',
|
7
|
+
params: { name }
|
8
|
+
})
|
9
|
+
}
|
10
|
+
|
11
|
+
export function transactionList(query) {
|
12
|
+
return request({
|
13
|
+
url: '/vue-element-admin/transaction/list',
|
14
|
+
method: 'get',
|
15
|
+
params: query
|
16
|
+
})
|
17
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import request from '@/utils/request'
|
2
|
+
|
3
|
+
export function getRoutes() {
|
4
|
+
return request({
|
5
|
+
url: '/vue-element-admin/routes',
|
6
|
+
method: 'get'
|
7
|
+
})
|
8
|
+
}
|
9
|
+
|
10
|
+
export function getRoles() {
|
11
|
+
return request({
|
12
|
+
url: '/vue-element-admin/roles',
|
13
|
+
method: 'get'
|
14
|
+
})
|
15
|
+
}
|
16
|
+
|
17
|
+
export function addRole(data) {
|
18
|
+
return request({
|
19
|
+
url: '/vue-element-admin/role',
|
20
|
+
method: 'post',
|
21
|
+
data
|
22
|
+
})
|
23
|
+
}
|
24
|
+
|
25
|
+
export function updateRole(id, data) {
|
26
|
+
return request({
|
27
|
+
url: `/vue-element-admin/role/${id}`,
|
28
|
+
method: 'put',
|
29
|
+
data
|
30
|
+
})
|
31
|
+
}
|
32
|
+
|
33
|
+
export function deleteRole(id) {
|
34
|
+
return request({
|
35
|
+
url: `/vue-element-admin/role/${id}`,
|
36
|
+
method: 'delete'
|
37
|
+
})
|
38
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import request from '@/utils/request'
|
2
|
+
|
3
|
+
export function login(data) {
|
4
|
+
return request({
|
5
|
+
url: '/vue-element-admin/user/login',
|
6
|
+
method: 'post',
|
7
|
+
data
|
8
|
+
})
|
9
|
+
}
|
10
|
+
|
11
|
+
export function getInfo(token) {
|
12
|
+
return request({
|
13
|
+
url: '/vue-element-admin/user/info',
|
14
|
+
method: 'get',
|
15
|
+
params: { token }
|
16
|
+
})
|
17
|
+
}
|
18
|
+
|
19
|
+
export function logout() {
|
20
|
+
return request({
|
21
|
+
url: '/vue-element-admin/user/logout',
|
22
|
+
method: 'post'
|
23
|
+
})
|
24
|
+
}
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|