Merge pull request #1 from lin-xin/master

update from oirgin
pull/38/head
isway 2017-05-15 16:46:03 +08:00 committed by GitHub
commit 1d4349a2b9
19 changed files with 1582 additions and 110 deletions

View File

@ -1,5 +1,5 @@
# manage-system # # manage-system #
基于Vue.js 2.x系列 + Element UI 的后台管理系统解决方案。[线上地址](http://work.fengdb.com/) 基于Vue.js 2.x系列 + Element UI 的后台管理系统解决方案。[线上地址](http://work.omwteam.com/)
[English document](https://github.com/lin-xin/manage-system/blob/master/README_EN.md) [English document](https://github.com/lin-xin/manage-system/blob/master/README_EN.md)

View File

@ -1,5 +1,5 @@
# manage-system # # manage-system #
The web management system solution based on Vue2 and Element-UI。[live demo](http://work.fengdb.com/) The web management system solution based on Vue2 and Element-UI。[live demo](http://work.omwteam.com/)
## Preface ## ## Preface ##

1314
build/vendor-manifest.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
var path = require('path') var path = require('path')
var utils = require('./utils') var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config') var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf') var vueLoaderConfig = require('./vue-loader.conf')
@ -9,7 +10,7 @@ function resolve (dir) {
module.exports = { module.exports = {
entry: { entry: {
app: './src/main.js' app: ['babel-polyfill','./src/main.js']
}, },
output: { output: {
path: config.build.assetsRoot, path: config.build.assetsRoot,
@ -59,5 +60,11 @@ module.exports = {
} }
} }
] ]
} },
// plugins: [
// new webpack.DllReferencePlugin({
// context: path.resolve(__dirname, '..'),
// manifest: require('./vendor-manifest.json')
// })
// ]
} }

29
build/webpack.dll.conf.js Normal file
View File

@ -0,0 +1,29 @@
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
vendor: ['vue/dist/vue.common.js','vue-router', 'babel-polyfill','axios','vue-echarts-v3']
},
output: {
path: path.join(__dirname, '../static/js'),
filename: '[name].dll.js',
library: '[name]_library'
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, '.', '[name]-manifest.json'),
name: '[name]_library'
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
})
]
};

View File

@ -9,6 +9,7 @@
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<!--<script src="./static/js/vendor.dll.js"></script>-->
<script> <script>
var _hmt = _hmt || []; var _hmt = _hmt || [];
(function() { (function() {

View File

@ -1,23 +1,26 @@
{ {
"name": "manage-system", "name": "manage-system",
"version": "1.0.0", "version": "2.0.0",
"description": "基于Vue.js 2.x系列 + element-ui 内容管理系统解决方案", "description": "基于Vue.js 2.x系列 + element-ui 内容管理系统解决方案",
"author": "lin-xin <2981207131@qq.com>", "author": "lin-xin <2981207131@qq.com>",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "node build/dev-server.js", "dev": "node build/dev-server.js",
"build": "node build/build.js" "build": "node build/build.js",
"build:dll": "webpack --config build/webpack.dll.conf.js"
}, },
"dependencies": { "dependencies": {
"axios": "^0.15.3", "axios": "^0.15.3",
"element-ui": "^1.2.2", "babel-polyfill": "^6.23.0",
"vue": "^2.1.10", "element-ui": "1.3.1",
"vue-core-image-upload": "^2.0.5", "mockjs": "^1.0.1-beta3",
"vue-datasource": "^1.0.4", "vue": "^2.3.2",
"vue-echarts-v3": "^1.0.3", "vue-core-image-upload": "2.1.5",
"vue-quill-editor": "^1.1.1", "vue-datasource": "1.0.9",
"vue-router": "^2.2.0", "vue-echarts-v3": "1.0.3",
"vue-simplemde": "^0.3.2" "vue-quill-editor": "2.1.6",
"vue-router": "^2.3.1",
"vue-simplemde": "0.3.8"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^6.7.2", "autoprefixer": "^6.7.2",
@ -29,31 +32,36 @@
"babel-register": "^6.22.0", "babel-register": "^6.22.0",
"chalk": "^1.1.3", "chalk": "^1.1.3",
"connect-history-api-fallback": "^1.3.0", "connect-history-api-fallback": "^1.3.0",
"css-loader": "^0.26.1", "css-loader": "^0.28.0",
"eventsource-polyfill": "^0.9.6", "eventsource-polyfill": "^0.9.6",
"express": "^4.14.1", "express": "^4.14.1",
"extract-text-webpack-plugin": "^2.0.0-rc.2", "extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.10.0", "file-loader": "^0.11.1",
"friendly-errors-webpack-plugin": "^1.1.3", "friendly-errors-webpack-plugin": "^1.1.3",
"function-bind": "^1.1.0", "function-bind": "^1.1.0",
"html-webpack-plugin": "^2.28.0", "html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3", "http-proxy-middleware": "^0.17.3",
"opn": "^4.0.2", "opn": "^4.0.2",
"ora": "^1.1.0", "ora": "^1.2.0",
"semver": "^5.3.0", "semver": "^5.3.0",
"shelljs": "^0.7.6", "shelljs": "^0.7.6",
"url-loader": "^0.5.7", "url-loader": "^0.5.8",
"vue-loader": "^10.3.0", "vue-loader": "^11.3.4",
"vue-style-loader": "^2.0.0", "vue-style-loader": "^2.0.5",
"vue-template-compiler": "^2.1.10", "vue-template-compiler": "^2.2.6",
"webpack": "^2.2.1", "webpack": "^2.3.3",
"webpack-bundle-analyzer": "^2.2.1", "webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0", "webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.16.1", "webpack-hot-middleware": "^2.18.0",
"webpack-merge": "^2.6.1" "webpack-merge": "^4.1.0"
}, },
"engines": { "engines": {
"node": ">= 4.0.0", "node": ">= 4.0.0",
"npm": ">= 3.0.0" "npm": ">= 3.0.0"
} },
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
} }

View File

@ -14,7 +14,6 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {

View File

@ -0,0 +1,115 @@
<template>
<div class="sidebar">
<el-menu :default-active="onRoutes" class="el-menu-vertical-demo" theme="dark" unique-opened router>
<template v-for="item in items">
<template v-if="item.subs">
<el-submenu :index="item.index">
<template slot="title"><i class="el-icon-menu"></i>{{ item.title }}</template>
<el-menu-item v-for="subItem in item.subs" :index="subItem.index">{{ subItem.title }}
</el-menu-item>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.index">
<i class="el-icon-setting"></i>{{ item.title }}
</el-menu-item>
</template>
</template>
</el-menu>
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
index: 'readme',
title: '自述'
},
{
index: '2',
title: '表格',
subs: [
{
index: 'basetable',
title: '基础表格'
},
{
index: 'vuetable',
title: 'Vue表格组件'
}
]
},
{
index: '3',
title: '表单',
subs: [
{
index: 'baseform',
title: '基本表单'
},
{
index: 'vueeditor',
title: '编辑器'
},
{
index: 'markdown',
title: 'markdown'
},
{
index: 'upload',
title: '文件上传'
}
]
},
{
index: '4',
title: '图表',
subs: [
{
index: 'basecharts',
title: '基础图表'
},
{
index: 'mixcharts',
title: '混合图表'
}
]
},
{
index: '5',
title: '系统管理',
subs: [
{
index: 'users',
title: '用户管理'
}
]
}
]
}
},
computed:{
onRoutes(){
return this.$route.path.replace('/','');
}
}
}
</script>
<style scoped>
.sidebar{
display: block;
position: absolute;
width: 250px;
left: 0;
top: 70px;
bottom:0;
background: #2E363F;
}
.sidebar > ul {
height:100%;
}
</style>

View File

@ -1,49 +0,0 @@
<template>
<div class="sidebar">
<el-menu :default-active="onRoutes" class="el-menu-vertical-demo" theme="dark" unique-opened router>
<el-menu-item index="readme">
<i class="el-icon-setting"></i>自述
</el-menu-item>
<el-submenu index="2">
<template slot="title"><i class="el-icon-menu"></i>表格</template>
<el-menu-item index="basetable">基础表格</el-menu-item>
<el-menu-item index="vuetable">Vue表格组件</el-menu-item>
</el-submenu>
<el-submenu index="3">
<template slot="title"><i class="el-icon-date"></i>表单</template>
<el-menu-item index="baseform">基本表单</el-menu-item>
<el-menu-item index="vueeditor">编辑器</el-menu-item>
<el-menu-item index="markdown">markdown</el-menu-item>
<el-menu-item index="upload">文件上传</el-menu-item>
</el-submenu>
<el-submenu index="4">
<template slot="title"><i class="el-icon-star-on"></i>图表</template>
<el-menu-item index="basecharts">基础图表</el-menu-item>
<el-menu-item index="mixcharts">混合图表</el-menu-item>
</el-submenu>
</el-menu>
</div>
</template>
<script>
export default {
computed:{
onRoutes(){
return this.$route.path.replace('/','');
}
}
}
</script>
<style scoped>
.sidebar{
display: block;
position: absolute;
width: 250px;
left: 0;
top: 70px;
bottom:0;
background: #2E363F;
}
.sidebar > ul {
height:100%;
}
</style>

View File

@ -13,9 +13,9 @@
</el-form-item> </el-form-item>
<el-form-item label="选择器"> <el-form-item label="选择器">
<el-select v-model="form.region" placeholder="请选择"> <el-select v-model="form.region" placeholder="请选择">
<el-option label="步步高" value="bbk"></el-option> <el-option key="bbk" label="步步高" value="bbk"></el-option>
<el-option label="小天才" value="xtc"></el-option> <el-option key="xtc" label="小天才" value="xtc"></el-option>
<el-option label="imoo" value="imoo"></el-option> <el-option key="imoo" label="imoo" value="imoo"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="日期时间"> <el-form-item label="日期时间">

View File

@ -14,13 +14,11 @@
</el-table-column> </el-table-column>
<el-table-column prop="address" label="地址" :formatter="formatter"> <el-table-column prop="address" label="地址" :formatter="formatter">
</el-table-column> </el-table-column>
<el-table-column prop="tag" label="标签" width="120" <el-table-column label="头像">
:filters="[{ text: '家', value: '家' }, { text: '公司', value: '公司' }]"
:filter-method="filterTag">
<template scope="scope"> <template scope="scope">
<el-tag :type="scope.row.tag === '家' ? 'primary' : 'success'" close-transition>{{scope.row.tag}} <img :src="scope.row.logo">
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="180"> <el-table-column label="操作" width="180">
<template scope="scope"> <template scope="scope">
@ -33,6 +31,7 @@
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
@current-change ="handleCurrentChange"
layout="prev, pager, next" layout="prev, pager, next"
:total="1000"> :total="1000">
</el-pagination> </el-pagination>
@ -44,30 +43,24 @@
export default { export default {
data() { data() {
return { return {
tableData: [{ tableData: [],
date: '2017-02-02', cur_page: 1
name: '小天才',
address: '东莞市长安镇步步高大道18号',
tag: '家'
}, {
date: '2017-02-04',
name: '小天才',
address: '东莞市长安镇步步高大道17号',
tag: '公司'
}, {
date: '2017-02-01',
name: '小天才',
address: '东莞市长安镇步步高大道19号',
tag: '家'
}, {
date: '2017-02-03',
name: '小天才',
address: '东莞市长安镇步步高大道16号',
tag: '公司'
}]
} }
}, },
created(){
this.getData();
},
methods: { methods: {
handleCurrentChange(val){
this.cur_page = val;
this.getData();
},
getData(){
let self = this;
this.$axios.post('/api/table',{page:self.cur_page}).then((res) => {
self.tableData = res.data.data;
})
},
formatter(row, column) { formatter(row, column) {
return row.address; return row.address;
}, },

View File

@ -42,8 +42,8 @@
key: 'email', key: 'email',
}, },
{ {
name: 'company', name: 'ip',
key: 'company', key: 'ip',
} }
], ],
actions: [ actions: [
@ -81,7 +81,7 @@
} }
}, },
beforeMount(){ beforeMount(){
axios.get('/static/data.json').then( (res) => { axios.get('/api/source').then( (res) => {
this.information = res.data; this.information = res.data;
}) })
} }

View File

@ -1,12 +1,15 @@
import Vue from 'vue'; import Vue from 'vue';
import App from './App'; import App from './App';
import router from './router'; import router from './router';
import axios from 'axios';
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import 'element-ui/lib/theme-default/index.css'; // 默认主题 import 'element-ui/lib/theme-default/index.css'; // 默认主题
// import '../static/css/theme-green/index.css'; // 浅绿色主题 // import '../static/css/theme-green/index.css'; // 浅绿色主题
import "babel-polyfill";
import './mock/index.js';
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.prototype.$axios = axios;
new Vue({ new Vue({
router, router,
render: h => h(App) render: h => h(App)
}).$mount('#app'); }).$mount('#app');

21
src/mock/datasource.js Normal file
View File

@ -0,0 +1,21 @@
export const datasource = [
{
path: '/api/source',
data: {
'data|10':[{
'id|+1':1,
'name':'@cname',
'email':'@email',
'ip':'@ip'
}],
"pagination": {
"total": 15,
"per_page": 15,
"current_page": 1,
"last_page": 1,
"from": 1,
"to": 15
}
}
}
]

11
src/mock/index.js Normal file
View File

@ -0,0 +1,11 @@
import Mock from 'mockjs';
import {vuetable} from './vuetable.js';
import {datasource} from './datasource.js';
let data = [].concat(vuetable,datasource);
data.forEach(function(res){
Mock.mock(res.path, res.data);
});
export default Mock;

13
src/mock/vuetable.js Normal file
View File

@ -0,0 +1,13 @@
export const vuetable = [
{
path: '/api/table',
data: {
'data|10':[{
'date':'@date',
'name':'@cname',
'address':'@county(ture)',
'logo':'@image("24x24",@color,@cfirst)'
}]
}
}
]

View File

@ -86,6 +86,7 @@
margin-bottom: 22px; margin-bottom: 22px;
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
text-align: center;
} }
.vue-datasource .table > thead > tr > th { .vue-datasource .table > thead > tr > th {
vertical-align: bottom; vertical-align: bottom;

6
static/js/vendor.dll.js Normal file

File diff suppressed because one or more lines are too long