b51fd0fe by liding

初始化

0 parents
Showing 276 changed files with 4718 additions and 0 deletions
{
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"],
"comments": false,
"env": {
"test": {
"plugins": [ "istanbul" ]
}
}
}
{
"directory" : "src/assets/",
"json" : "",
"endpoint" : "",
"searchpath" : "",
"shorthand_resolver" : ""
}
\ No newline at end of file
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
/node_modules
#TpAPI
// https://github.com/shelljs/shelljs
require('./check-versions')()
require('shelljs/global')
env.NODE_ENV = 'production'
var path = require('path')
var config = require('../config')
var ora = require('ora')
var webpack = require('webpack')
var webpackConfig = require('./webpack.prod.conf')
console.log(
' Tip:\n' +
' Built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
)
var spinner = ora('building for production...')
spinner.start()
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
rm('-rf', assetsPath)
mkdir('-p', assetsPath)
cp('-R', 'static/*', assetsPath)
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n')
})
var semver = require('semver')
var chalk = require('chalk')
var packageConfig = require('../package.json')
var exec = function (cmd) {
return require('child_process')
.execSync(cmd).toString().trim()
}
var versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
},
{
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
}
]
module.exports = function () {
var warnings = []
for (var i = 0; i < versionRequirements.length; i++) {
var mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (var i = 0; i < warnings.length; i++) {
var warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}
/* eslint-disable */
require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
}
})
require('./check-versions')()
var config = require('../config')
if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var opn = require('opn')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = require('./webpack.dev.conf')
// default port where dev server listens for incoming traffic
var port = process.env.PORT || config.dev.port
// Define HTTP proxies to your custom API backend
// https://github.com/chimurai/http-proxy-middleware
var proxyTable = config.dev.proxyTable
var app = express()
var compiler = webpack(webpackConfig)
var devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath,
quiet: true
})
var hotMiddleware = require('webpack-hot-middleware')(compiler, {
log: () => {}
})
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
})
// proxy api requests
Object.keys(proxyTable).forEach(function (context) {
var options = proxyTable[context]
if (typeof options === 'string') {
options = { target: options }
}
app.use(proxyMiddleware(context, options))
})
// handle fallback for HTML5 history API
app.use(require('connect-history-api-fallback')())
// serve webpack bundle output
app.use(devMiddleware)
// enable hot-reload and state-preserving
// compilation error display
app.use(hotMiddleware)
// serve pure static assets
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
app.use(staticPath, express.static('./static'))
var uri = 'http://localhost:' + port
devMiddleware.waitUntilValid(function () {
console.log('> Listening at ' + uri + '\n')
})
module.exports = app.listen(port, function (err) {
if (err) {
console.log(err)
return
}
// when env is testing, don't need open it
if (process.env.NODE_ENV !== 'testing') {
opn(uri)
}
})
var path = require('path')
var config = require('../config')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
exports.assetsPath = function (_path) {
var assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
// generate loader string to be used with extract text plugin
function generateLoaders (loaders) {
var sourceLoader = loaders.map(function (loader) {
var extraParamChar
if (/\?/.test(loader)) {
loader = loader.replace(/\?/, '-loader?')
extraParamChar = '&'
} else {
loader = loader + '-loader'
extraParamChar = '?'
}
return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '')
}).join('!')
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract('vue-style-loader', sourceLoader)
} else {
return ['vue-style-loader', sourceLoader].join('!')
}
}
// http://vuejs.github.io/vue-loader/en/configurations/extract-css.html
return {
css: generateLoaders(['css']),
postcss: generateLoaders(['css']),
less: generateLoaders(['css', 'less']),
sass: generateLoaders(['css', 'sass?indentedSyntax']),
scss: generateLoaders(['css', 'sass']),
stylus: generateLoaders(['css', 'stylus']),
styl: generateLoaders(['css', 'stylus'])
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
var output = []
var loaders = exports.cssLoaders(options)
for (var extension in loaders) {
var loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
loader: loader
})
}
return output
}
var path = require('path')
var config = require('../config')
var utils = require('./utils')
var projectRoot = path.resolve(__dirname, '../')
var env = process.env.NODE_ENV
// check env & config/index.js to decide whether to enable CSS source maps for the
// various preprocessor loaders added to vue-loader at the end of this file
var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap)
var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap)
var useCssSourceMap = cssSourceMapDev || cssSourceMapProd
module.exports = {
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
filename: '[name].js'
},
resolve: {
extensions: ['', '.js', '.vue', '.json'],
fallback: [path.join(__dirname, '../node_modules')],
alias: {
'vue$': 'vue/dist/vue.common.js',
'src': path.resolve(__dirname, '../src'),
'assets': path.resolve(__dirname, '../src/assets'),
'components': path.resolve(__dirname, '../src/components'),
'common': path.resolve(__dirname, '../src/components/Common'),
'modules': path.resolve(__dirname, '../src/components/Modules'),
'demo': path.resolve(__dirname, '../src/components/Modules/Demo'),
'function': path.resolve(__dirname, '../src/components/Modules/Function'),
'config': path.resolve(__dirname, '../src/config'),
'store': path.resolve(__dirname, '../src/store'),
'libs': path.resolve(__dirname, '../src/libs'),
'util': path.resolve(__dirname, '../src/util'),
'register': path.resolve(__dirname, '../src/register'),
'plugins': path.resolve(__dirname, '../src/plugins'),
'mixin': path.resolve(__dirname, '../src/mixin'),
}
},
resolveLoader: {
fallback: [path.join(__dirname, '../node_modules')]
},
module: {
loaders: [{
test: /\.vue$/,
loader: 'vue'
}, {
test: /\.js$/,
loader: 'babel',
include: [
path.join(projectRoot, 'src')
],
exclude: /node_modules/
}, {
test: /\.json$/,
loader: 'json'
}, {
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url',
query: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
}, {
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url',
query: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}]
},
vue: {
loaders: utils.cssLoaders({
sourceMap: useCssSourceMap
}),
postcss: [
require('autoprefixer')({
browsers: ['last 2 versions']
})
]
}
}
\ No newline at end of file
var config = require('../config')
var webpack = require('webpack')
var merge = require('webpack-merge')
var utils = require('./utils')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var FriendlyErrors = require('friendly-errors-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function(name) {
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
module: {
loaders: utils.styleLoaders({
sourceMap: config.dev.cssSourceMap
})
},
// eval-source-map is faster for development
devtool: '#eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
}),
new FriendlyErrors()
]
})
\ No newline at end of file
var path = require('path')
var config = require('../config')
var utils = require('./utils')
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var env = config.build.env
var webpackConfig = merge(baseWebpackConfig, {
module: {
loaders: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
vue: {
loaders: utils.cssLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.optimize.OccurrenceOrderPlugin(),
// extract css into its own file
new ExtractTextPlugin(utils.assetsPath('css/[name].[contenthash].css')),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function(module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
})
]
})
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
module.exports = webpackConfig
\ No newline at end of file
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path');
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
productionSourceMap: true,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css']
},
dev: {
env: require('./dev.env'),
port: 8090,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/vuedemo': {
target: 'http://127.0.0.1:8087',
changeOrigin: true,
pathRewrite: {
'^/vuedemo': '/vuedemo'
}
}
},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
}
}
\ No newline at end of file
module.exports = {
NODE_ENV: '"production"'
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="static/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="static/libs/wangeditor/css/wangEditor.min.css">
<link rel="stylesheet" href="static/libs/highlight/styles/github.css">
<title>API管理</title>
<style>
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0px;
padding: 0px;
}
</style>
</head>
<body>
<div id="app"></div>
<script src='static/libs/jquery/jquery.min.js'></script>
<script src='static/libs/wangeditor/js/wangEditor.js'></script>
<script src='static/libs/highlight/highlight.pack.min.js'></script>
<script src='static/libs/highlight/highlightjs-line-numbers.min.js'></script>
<script>
$(function() {
});
</script>
</body>
</html>
\ No newline at end of file
{
"name": "vuepro",
"version": "1.0.0",
"description": "vuepro",
"author": "test",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.15.3",
"css-loader": "^0.25.0",
"echarts": "^3.3.2",
"element-ui": "^1.1.2",
"font-awesome": "^4.7.0",
"iview": "^2.0.0-rc.10",
"less": "^2.7.2",
"less-loader": "^2.2.3",
"nprogress": "^0.2.0",
"vue": "^2.1.0",
"vue-axios": "^1.2.2",
"vue-bus": "^0.3.0",
"vue-router": "^2.1.1",
"vuex": "^2.1.1",
"wangeditor": "^2.1.22"
},
"devDependencies": {
"autoprefixer": "^6.4.0",
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-2": "^6.0.0",
"babel-register": "^6.0.0",
"chalk": "^1.1.3",
"connect-history-api-fallback": "^1.1.0",
"css-loader": "^0.25.0",
"eventsource-polyfill": "^0.9.6",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"friendly-errors-webpack-plugin": "^1.1.2",
"function-bind": "^1.0.2",
"html-webpack-plugin": "^2.8.1",
"http-proxy-middleware": "^0.17.2",
"json-loader": "^0.5.4",
"semver": "^5.3.0",
"opn": "^4.0.2",
"ora": "^0.3.0",
"shelljs": "^0.7.4",
"url-loader": "^0.5.7",
"vue-loader": "^10.0.0",
"vue-style-loader": "^1.0.0",
"vue-template-compiler": "^2.1.0",
"webpack": "^1.13.2",
"webpack-dev-middleware": "^1.8.3",
"webpack-hot-middleware": "^2.12.2",
"webpack-merge": "^0.14.1"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
}
}
<template>
<div id="app">
<head-nav></head-nav>
<transition >
<router-view></router-view>
</transition>
</div>
</template>
<script>
import Layout from './components/Layout/';
export default {
name: 'app',
components: Layout,
methods:{
},
mounted(){
},
watch:{
$route(to,from){
// console.log(to);
if (!to.matched.length) {
this.$router.push('/404');
}
}
}
}
</script>
<style scoped lang='less'>
.bounce-enter-active {
animation: bounce-in .5s;
-webkit-animation:bounce-in .5s;
}
.bounce-leave-active {
animation: bounce-out .2s;
-webkit-animation: bounce-out .2s;
}
@keyframes bounce-in {
0% {
transform: scale(0);
}
50% {
transform: scale(1.05);
}
100% {
transform: scale(1);
}
}
@keyframes bounce-out {
0% {
transform: scale(1);
}
50% {
transform: scale(0.95);
}
100% {
transform: scale(0);
}
}
</style>
html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
div,
dl,
dt,
dd,
ul,
ol,
li,
p,
blockquote,
pre,
hr,
figure,
table,
caption,
th,
td,
form,
fieldset,
legend,
input,
button,
textarea,
menu {
margin: 0;
padding: 0;
}
header,
footer,
section,
article,
aside,
nav,
hgroup,
address,
figure,
figcaption,
menu,
details {
display: block;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
caption,
th {
text-align: left;
font-weight: normal;
}
html,
body,
fieldset,
img,
iframe,
abbr {
border: 0;
}
i,
cite,
em,
var,
address,
dfn {
font-style: normal;
}
[hidefocus],
summary {
outline: 0;
}
li {
list-style: none;
}
h1,
h2,
h3,
h4,
h5,
h6,
small {
font-size: 100%;
}
q:before,
q:after {
content: none;
}
textarea {
overflow: auto;
resize: none;
}
label,
summary {
cursor: default;
}
a,
button {
cursor: pointer;
}
blockquote {
display: block;
-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
-webkit-margin-start: 40px;
-webkit-margin-end: 40px;
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eeeeee;
font-size: 12px;
color: #407aaa;
}
.clear {
clear: both;
height: 0;
line-height: 0;
font-size: 0;
}
.code {
font-size: 12px;
color: #595959;
border: 1px dashed #cecfcf;
background-color: #f5f6f7;
padding: 6px 12px;
margin-top: 10px;
margin-bottom: 10px;
}
.code pre {
border: 0px;
color: #595959;
font-family: Tahoma, "SimSun"!important;
font-weight: 100;
line-height: 24px;
font-size: 12px;
white-space: pre-wrap;
word-wrap: break-word;
}
.layout {
/*border: 1px solid #d7dde4;*/
background: #f5f7f9;
}
.layout-breadcrumb {
margin-bottom: 5px;
border: 1px solid #f5f7f9;
background: #fff;
}
.layout-assistant {
width: 100%;
margin: 0 auto;
height: 50px;
line-height: 50px;
background: #B0C4DE;
/*background: #657180;*/
}
.layout-assistant .layout-assistant-content {
width: 95%;
margin: 0 auto;
padding-top: 10px;
}
.ass-input {
width: 300px;
float: right;
}
.layout-content {
min-height: 500px;
margin: 15px auto;
width: 95%;
overflow: hidden;
border-radius: 6px;
background: #fff;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
}
.layout-content-main {
padding: 10px 10px 0 20px;
background: #fff;
}
.layout-content-main:after {
content: "";
display: block;
width: 1px;
background: #d7dde4;
position: absolute;
top: 0;
bottom: 0;
left: -1px;
}
.layout-copy {
text-align: center;
background: #fff;
padding: 10px 0 20px;
color: #9ea7b4;
}
\ No newline at end of file
<template>
<div class='bread'>
<strong>
{{strong}}
</strong>
<Breadcrumb separator="/" class='el-bread'>
<Breadcrumb-item href="{ path: '/' }">首页</Breadcrumb-item>
<Breadcrumb-item v-for='(item,index) in $route.matched'>{{item.name}}</Breadcrumb-item>
</Breadcrumb>
</div>
</template>
<script>
export default {
name: 'bread',
data () {
return {
strong:''
}
},
methods:{
getPageText(name){
return name=name.replace('编辑',this.$route.query.id ? '修改' : '添加');
}
},
mounted(){
},
created(){
if (this.$route.matched.length) {
var name=this.$route.matched[this.$route.matched.length-1].name;
this.strong=this.getPageText(name);
}
},
watch:{
$route(to,from){
this.strong=this.getPageText(to.name);
}
}
}
</script>
<style scoped lang='less'>
.bread{
height: 40px;
line-height: 26px;
.el-bread{
display: inline-block;
float: right;
text-align: right;
line-height: 26px;
}
}
</style>
module.exports = {
name: 'dialog-info',
data() {
return {
dialog: this.Dialog || {}
}
},
methods: {
onClose() {
this.dialog.show = false;
}
},
computed: {
show() {
return this.dialog.show;
}
},
mounted() {
// console.log(this.Show);
},
/**
* 接收参数
* @type {Object}
*/
props: {
Dialog: {
type: Object,
validator: (v) => {
return true;
}
}
},
/**
* 监控参数
* @type {Object}
*/
watch: {
}
}
\ No newline at end of file
<template>
<div class="">
<el-dialog size="tiny"
:title="dialog.title"
v-model="show"
@close='onClose'>
<el-form style="margin:20px;width:60%;min-width:100%"
label-width="100px">
<el-form-item class='edit-form'
v-for='field in dialog.fields'
:label='field.label'>
{{dialog.data[field.key]}}
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="onClose">关 闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import DialogInfoJs from './DialogInfo.js';
module.exports=DialogInfoJs;
</script>
<style scoped lang='less'>
.demo-form-inline{
display: inline-block;
float: right;
}
.btm-action{
margin-top: 20px;
text-align: center;
}
.actions-top{
height: 46px;
}
.pagination{
display: inline-block;
}
</style>
import DialogInfo from './DialogInfo.vue';
module.exports = DialogInfo;
\ No newline at end of file
import echarts from 'echarts';
module.exports = {
name: 'echarts',
data() {
return {
chartDom: null,
data: {
id: this.id,
title: this.title,
subtext: this.subtext,
hover_title: this.hoverTitle,
text_list: this.textList,
value_list: this.valueList
},
}
},
methods: {
init() {
//基于准备好的dom,初始化echarts实例
if (this.data.id) {
this.chartDom = echarts.init(document.getElementById(this.data.id));
}
return this;
},
update() {
if (this.chartDom === null) {
this.init();
}
if (this.chartDom) {
this.chartDom.setOption({
title: {
text: this.data.title,
subtext: this.data.subtext
},
tooltip: {},
xAxis: {
data: this.data.text_list
},
yAxis: {},
series: [{
name: this.data.hover_title,
type: 'bar',
data: this.data.value_list
}]
});
}
}
},
mounted: function() {
this.init()
.update(this.data);
},
props: {
id: [String],
title: [String, Number],
subtext: [String, Number],
hoverTitle: [String, Number],
textList: {
type: Array,
required: true
},
valueList: {
type: Array,
required: true
}
},
watch: {
valueList(v) {
this.data.value_list = v;
this.update();
},
textList(v) {
this.data.text_list = v;
this.update();
},
title(v) {
this.data.title = v;
this.update();
},
subtext(v) {
this.data.subtext = v;
this.update();
},
hoverTitle(v) {
this.data.hover_title = v;
this.update();
}
}
}
\ No newline at end of file
<template>
<section class="chart">
<el-row>
<el-col :span="24">
<div :id="data.id" style="width:100%; height:400px;"></div>
</el-col>
</el-row>
</section>
</template>
<script>
import DefaultJs from './Default.js';
module.exports=DefaultJs;
</script>
<style scoped>
</style>
import Default from './Default.vue';
module.exports = Default;
\ No newline at end of file
import echarts from 'echarts';
module.exports = {
name: 'echarts',
data() {
return {
chartDom: null,
data: {},
}
},
methods: {
init() {
//基于准备好的dom,初始化echarts实例
this.chartDom = echarts.init(document.getElementById('chartDom'));
return this;
},
update() {
if (this.chartDom === null) {
this.init();
}
this.chartDom.setOption({
title: {
text: 'Bar Chart',
subtext: '数据来自网络'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['2011年', '2012年']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
yAxis: {
type: 'category',
data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(万)']
},
series: [{
name: '2011年',
type: 'bar',
data: [18203, 23489, 29034, 104970, 131744, 630230]
}, {
name: '2012年',
type: 'bar',
data: [19325, 23438, 31000, 121594, 134141, 681807]
}]
});
}
},
mounted: function() {
this.init()
.update(this.data);
}
}
\ No newline at end of file
<template>
<section class="chart">
<el-row>
<el-col :span="24">
<div id="chartDom" style="width:100%; height:400px;"></div>
</el-col>
</el-row>
</section>
</template>
<script>
import HorizontalJs from './Horizontal.js';
module.exports=HorizontalJs;
</script>
<style scoped>
</style>
import Horizontal from './Horizontal.vue';
module.exports = Horizontal;
\ No newline at end of file
module.exports = {
Default: require('./Default/'),
Horizontal: require('./Horizontal/')
};
\ No newline at end of file
import echarts from 'echarts';
module.exports = {
name: 'echarts',
data() {
return {
chartDom: null,
data: {
title: '垂直方向柱状标题',
subtext: '子标题描述信息',
},
}
},
methods: {
init() {
//基于准备好的dom,初始化echarts实例
this.chartDom = echarts.init(document.getElementById('chartDom'));
return this;
},
update() {
if (this.chartDom === null) {
this.init();
}
this.chartDom.setOption({
title: {
text: 'Line Chart'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['邮件营销', '联盟广告', '搜索引擎']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
},
yAxis: {
type: 'value'
},
series: [{
name: '邮件营销',
type: 'line',
stack: '总量',
data: [120, 132, 101, 134, 90, 230, 210]
}, {
name: '联盟广告',
type: 'line',
stack: '总量',
data: [220, 182, 191, 234, 290, 330, 310]
}, {
name: '搜索引擎',
type: 'line',
stack: '总量',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}]
});
}
},
mounted: function() {
this.init()
.update();
}
}
\ No newline at end of file
<template>
<section class="chart">
<el-row>
<el-col :span="24">
<div id="chartDom" style="width:100%; height:400px;"></div>
</el-col>
</el-row>
</section>
</template>
<script>
import DefaultJs from './Default.js';
module.exports=DefaultJs;
</script>
<style scoped>
</style>
import Default from './Default.vue';
module.exports = Default;
\ No newline at end of file
module.exports = {
Default: require('./Default/')
};
\ No newline at end of file
import echarts from 'echarts';
module.exports = {
name: 'echarts',
data() {
return {
chartDom: null,
data: {
id: this.id,
title: this.title,
subtext: this.subtext,
hover_title: this.hoverTitle,
data_list: this.dataList,
text_list: []
},
}
},
methods: {
init() {
//基于准备好的dom,初始化echarts实例
if (this.data.id) {
this.chartDom = echarts.init(document.getElementById(this.data.id));
}
return this;
},
update() {
if (this.chartDom === null) {
this.init();
}
this.chartDom.setOption({
title: {
text: this.data.title,
subtext: this.data.subtext,
x: 'center'
},
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: 'vertical',
left: 'left',
data: this.data.text_list
},
series: [{
name: this.data.hover_title,
type: 'pie',
radius: '55%',
// center: ['50%', '60%'],
data: this.data.data_list,
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}]
});
},
updateTextList() {
var data = this.data.data_list;
this.data.text_list = [];
for (var i = 0; i < data.length; i++) {
this.data.text_list.push(data[i].name);
}
return this;
}
},
mounted: function() {
this.updateTextList()
.init()
.update();
},
props: {
id: {
type: String,
required: true
},
title: [String, Number],
subtext: [String, Number],
hoverTitle: [String, Number],
dataList: {
type: Array,
required: true
}
},
watch: {
dataList(v) {
this.data.value_list = v;
this.updateTextList().update();
},
title(v) {
this.data.title = v;
this.update();
},
subtext(v) {
this.data.subtext = v;
this.update();
},
hoverTitle(v) {
this.data.hover_title = v;
this.update();
}
}
}
\ No newline at end of file
<template>
<section class="chart">
<el-row>
<el-col :span="24">
<div :id="data.id" style="width:100%; height:400px;"></div>
</el-col>
</el-row>
</section>
</template>
<script>
import DefaultJs from './Default.js';
module.exports=DefaultJs;
</script>
<style scoped>
</style>
import Default from './Default.vue';
module.exports = Default;
\ No newline at end of file
module.exports = {
Default: require('./Default/')
};
\ No newline at end of file
module.exports = {
Bar: require('./Bar/'),
Pie: require('./Pie/'),
Line: require('./Line/')
};
\ No newline at end of file
<template>
<div class="form">
<el-form style=""
label-width="100px"
ref='form-data'
:rules='rules'
:model='submit_data'>
<el-form-item
class='edit-form'
v-for='field in fields'
:label="field.label"
:prop='field.key'
:style="field.item_style">
<!-- 单选CheckBox -->
<el-checkbox
v-if='field.type==="checkbox" && field.multiple!==true'
v-model="submit_data[field.key]">{{field.label}}</el-checkbox>
<!-- 复选CheckBox -->
<!-- 是否全选全不选 -->
<el-checkbox
v-if='field.checkall && typeof field.checkall==="object" && submit_data[field.key+checkall_temp]'
:indeterminate="submit_data[field.key+checkall_temp].indeterminate"
v-model="submit_data[field.key+checkall_temp].value"
@change='onCheckallChange(field.key)'>{{submit_data[field.key+checkall_temp].text}}</el-checkbox>
<!-- CheckBox选项列表 -->
<el-checkbox-group
v-if='(field.type==="checkbox" && field.multiple===true && !field.checkall) || (field.type==="checkbox" && field.multiple===true && field.checkall && submit_data[field.key+checkall_temp])'
v-model="submit_data[field.key+checkall_temp].checkbox_value"
@change='onCheckboxChange(field.key)'>
<el-checkbox
v-for='item in submit_data[field.key+checkall_temp].checkbox_list'
:label="item.value">{{item.text}}</el-checkbox>
</el-checkbox-group>
<!-- wangeditor -->
<div
v-if='field.type==="editor"'
:id="field.id"
:style="field.style"
v-html='submit_data[field.key]'></div>
<!--
input,textarea
-->
<el-input
v-if='!field.type || field.type==="input" || field.type==="textarea"'
:type='!field.type ? "input" : field.type'
v-model="submit_data[field.key]"
:placeholder='field.desc'></el-input>
<!--
radia,单选
-->
<el-radio-group
v-if='field.type==="radio"'
v-model="submit_data[field.key]">
<el-radio
v-for='item in field.value.list'
:label="item.value">{{item.text || item.value}}</el-radio>
</el-radio-group>
<!-- select,下拉框 -->
<el-select
v-if='field.type==="select" && submit_data[field.key]'
v-model="submit_data[field.key]"
:multiple='field.multiple ? true : false'
:placeholder="field.desc">
<el-option
v-for='item in field.value.list'
:value="item.value"
:label="item.text || item.value"></el-option>
</el-select>
<!--
switch,开关
-->
<el-switch
v-if='field.type==="switch"'
:on-text="field.value.on"
:off-text="field.value.off"
:disabled='field.disabled'
v-model="submit_data[field.key]"></el-switch>
</el-form-item>
<el-form-item>
<el-button type="primary" @click='onSubmit("form-data")'>提交</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import FormDataJs from './FormData.js';
module.exports=FormDataJs;
</script>
<style scoped lang='less'>
.demo-form-inline{
display: inline-block;
float: right;
}
.btm-action{
margin-top: 20px;
text-align: center;
}
.actions-top{
height: 46px;
}
.pagination{
display: inline-block;
}
</style>
import FormData from './FormData.vue';
module.exports = FormData;
\ No newline at end of file
import {
user as UserApi,
system as SystemApi
} from '../../../config/request.js';
module.exports = {
name: 'head-nav',
data() {
return {
dialog: {
show_set: false,
show_pass: false,
title: '修改密码',
user_info: this.$store.state.user.userinfo,
set_info: {
login_style: '',
disabled_update_pass: [],
select_users: []
},
user_info_rules: {
old_password: [{
required: true,
message: '旧密码不能为空!',
trigger: 'blur'
}],
password: [{
required: true,
message: '新密码不能为空!',
trigger: 'blur'
}, {
trigger: 'blur',
validator: (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
} else {
if ('' !== this.dialog.user_info.password) {
this.$refs.user_info.validateField('password_confirm');
}
callback();
}
}
}],
password_confirm: [{
required: true,
message: '确认密码不能为空!',
trigger: 'blur'
}, {
trigger: 'blur',
validator: (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== this.dialog.user_info.password) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
}
}],
}
}
}
},
mounted() {
// this.onGetSetting();
},
methods: {
/**
* 退出登录
*/
logout() {
this.$confirm('你确定退出登录么?', '确认退出', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.dispatch('remove_userinfo').then(() => {
this.$router.push('/login');
});
});
},
/**
* 弹出框-修改密码或者系统设置
* @param {string} cmditem 弹框类型
*/
setDialogInfo(cmditem) {
if (!cmditem) {
this.$message.error('菜单选项缺少command属性');
return;
}
switch (cmditem) {
case 'info':
this.$router.push({
path: '/demo/user/edit',
query: {
id: this.$store.state.user.userinfo.id
}
});
break;
case 'pass':
this.dialog.show_pass = true;
this.dialog.title = '修改密码';
break;
case 'set':
this.onGetSetting();
this.dialog.show_set = true;
this.dialog.title = '系统设置';
break;
}
},
/**
* 修改密码
* @param {object} userinfo 当前修改密码的表单信息
*/
updUserPass(userinfo) {
this.$refs[userinfo].validate((valid) => {
if (valid) {
UserApi.updPass.call(this, {
old_password: this.dialog[userinfo].old_password,
password: this.dialog[userinfo].password,
password_confirm: this.dialog[userinfo].password_confirm
}, (data) => {
this.dialog.show_pass = false;
// this.$nextTick(() => {
this.$message.success('修改成功!');
// });
});
}
});
},
/**
* 获取系统设置信息
*/
onGetSetting() {
//获取系统设置信息
if (this.$store.state.user.userinfo.pid == 0) {
SystemApi.getSetting.call(this, (data) => {
// console.log(data);
if (data.setting_info.disabled_update_pass) {
data.setting_info.disabled_update_pass = data.setting_info.disabled_update_pass.split(',');
} else {
data.setting_info.disabled_update_pass = [];
}
data.setting_info.login_style = data.setting_info.login_style + '';
this.dialog.set_info = data.setting_info;
});
} else {
this.$message.error('只有管理员才能操作!');
}
},
/**
* 修改系统设置信息
*/
onUpdateSetting() {
// console.log(this.dialog.set_info.login_style);
// console.log(this.dialog.set_info.disabled_update_pass);
// console.log(this.dialog.set_info.id);
SystemApi.updateSetting.call(this, {
id: this.dialog.set_info.id,
login_style: this.dialog.set_info.login_style,
disabled_update_pass: this.dialog.set_info.disabled_update_pass && this.dialog.set_info.disabled_update_pass.length ? this.dialog.set_info.disabled_update_pass.join(',') : ''
}, (data) => {
// console.log(data);
this.dialog.show_set = false;
});
}
}
}
\ No newline at end of file
<template>
<header class="head-nav">
<el-row>
<el-col :span="4" class='logo-container'>
<img src="../../../assets/logo-sm.png" class='logo' alt="">
</el-col>
<el-col :span="16">
<el-menu theme="dark" :default-active="$store.state.router.headerCurRouter" class="el-menu-demo" mode="horizontal" unique-opened router>
<!-- <el-submenu index="1">
<template slot="title">向导中心</template>
<el-menu-item index="1-1">快捷方式1</el-menu-item>
<el-menu-item index="1-2">快捷方式2</el-menu-item>
<el-menu-item index="1-3">快捷方式3</el-menu-item>
</el-submenu>
<el-submenu index="2">
<template slot="title">商城中心</template>
<el-menu-item index="2-1">订单统计</el-menu-item>
<el-menu-item index="2-2">其他</el-menu-item>
</el-submenu> -->
<!-- <el-menu-item index="2">商城中心</el-menu-item>
<el-menu-item index="3">系统设置</el-menu-item> -->
<!-- v-if='!item.hidden && $store.state.user.userinfo.access.indexOf(item.path)===-1' -->
<el-menu-item
:index="item.path"
v-for='(item,index) in $router.options.routes'
v-if='!item.hidden'>
{{item.name}}<!-- {{item.path}} -->
</el-menu-item>
</el-menu>
</el-col>
<el-col :span="4" class="userinfo">
<!-- <span class='username'><i class='fa fa-user'></i>{{this.$store.state.user.userinfo.username}}</span> -->
<span class='username'>
<el-dropdown
trigger="click"
@command='setDialogInfo'>
<span class="el-dropdown-link">
{{this.$store.state.user.userinfo.username}}<i class="el-icon-caret-bottom el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command='info'>修改信息</el-dropdown-item>
<el-dropdown-item
command='pass'
v-if='$store.state.user.userinfo.is_update_pass'>修改密码</el-dropdown-item>
<el-dropdown-item
command='set'
v-if='$store.state.user.userinfo.pid==0'>系统设置</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
<i class="fa fa-sign-out logout" @click='logout'></i>
</el-col>
</el-row>
<el-dialog size="tiny" :title="dialog.title"
v-model="dialog.show_pass">
<el-form style="margin:20px;width:80%;"
label-width="100px"
:model="dialog.user_info"
:rules="dialog.user_info_rules"
ref='user_info'>
<el-form-item class='edit-form'
label="邮箱"
prop='email'>
<el-input v-model="dialog.user_info.email" disabled placeholder='常用邮箱'></el-input>
</el-form-item>
<el-form-item class='edit-form'
label="用户名称"
prop='username'>
<el-input v-model="dialog.user_info.username" disabled placeholder='用户名'></el-input>
</el-form-item>
<el-form-item class='edit-form'
label="当前密码"
prop='old_password'>
<el-input
type='password'
placeholder='当前密码'
auto-complete='off'
v-model="dialog.user_info.old_password"></el-input>
</el-form-item>
<el-form-item class='edit-form'
label="新密码"
prop='password'>
<el-input
type='password'
placeholder='新密码'
auto-complete='off'
v-model="dialog.user_info.password"></el-input>
</el-form-item>
<el-form-item class='edit-form'
label="确认密码"
prop='password_confirm'>
<el-input
type='password'
placeholder='确认密码'
auto-complete='off'
v-model="dialog.user_info.password_confirm"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialog.show_pass = false">取 消</el-button>
<el-button type="primary" @click="updUserPass('user_info')">确 定</el-button>
</span>
</el-dialog>
<el-dialog size="small" :title="dialog.title"
v-model="dialog.show_set">
<el-form style="margin:20px;width:80%;"
label-width="100px"
v-model='dialog.set_info'
ref='set_info'>
<el-form-item label="登录方式">
<el-select placeholder="请选择登录方式"
v-model='dialog.set_info.login_style'>
<el-option label="单一登录" value="1"></el-option>
<el-option label="多点登录" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="禁止修改密码">
<el-select placeholder="请选择用户"
multiple
v-model='dialog.set_info.disabled_update_pass'>
<!-- value的值的ID是number,disabled_update_pass的元素中的是字符串,
所以在value上,需要拼装一个空串,来转化
因为elementUI内部用了===
-->
<el-option
v-for='user in dialog.set_info.select_users'
:label='user.username'
:value='user.id+""'></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialog.show_set = false">取 消</el-button>
<el-button type="primary" @click="onUpdateSetting">确 定</el-button>
</span>
</el-dialog>
</header>
</template>
<script>
import HeadNavJs from './HeadNav.js';
export default HeadNavJs;
</script>
<style scoped lang='less'>
.logo-container{
height: 60px;
}
.logo{
height: 50px;
width: auto;
margin-left: 10px;
margin-top: 5px;
}
.fa-user{
position: relative;
top:-2px;
margin-right: 4px;
}
.head-nav{
width:100%;
height: 60px;
background: #324057;
position: fixed;
top:0px;
left:0px;
z-index: 999;
color:#FFF;
border-bottom: 1px solid #1F2D3D;
.logout{
width:60px;
height: 60px;
line-height: 60px;
text-align: center;
float: right;
cursor: pointer;
}
}
.userinfo{
text-align: right;
}
.username{
height: 60px;
line-height: 60px;
cursor: pointer;
.el-dropdown{
color:#FFF;
}
}
</style>
<template>
<div class="left" :style="{'height':win_size.height,'width':$store.state.leftmenu.width}" id='admin-left'>
<div id='left-menu'>
<Row class='tac'
v-for="(route,index) in $router.options.routes"
v-if='!route.hidden && $route.matched.length && $route.matched[0].path===route.path'>
<Col :span="24">
<el-menu
class="el-menu-vertical-demo"
theme="dark"
:default-active="$route.path"
unique-opened
router>
<!-- v-if="!item.hidden && $store.state.user.userinfo.access.indexOf(route.path+'/'+item.path)===-1" -->
<template
v-for="(item,index) in route.children"
v-if="!item.hidden">
<el-submenu
:index="item.path">
<template
slot="title">
<el-tooltip
class="item"
effect="dark"
placement="right"
:disabled="$store.state.leftmenu.menu_flag"
:content="item.name">
<i :class="'fa fa-'+item.icon"></i>
</el-tooltip>
<span
class='menu-name'
v-if="$store.state.leftmenu.menu_flag">{{item.name}}<!-- {{route.path+'/'+item.path}} --></span>
</template>
<!-- v-if="!child.hidden && $store.state.user.userinfo.access.indexOf(route.path+'/'+item.path+'/'+child.path)===-1" -->
<el-menu-item
v-for='(child,cindex) in item.children'
v-if="!child.hidden"
:style="{'padding-left':$store.state.leftmenu.menu_flag? '40px' : '23px'}"
:index='$store.state.router.headerCurRouter+"/"+item.path+"/"+child.path'>
<el-tooltip
class="item"
effect="dark"
placement="right"
:disabled="$store.state.leftmenu.menu_flag"
:content="child.name">
<i :class="'fa fa-'+child.icon"></i>
</el-tooltip>
<span
class='menu-name'
v-if="$store.state.leftmenu.menu_flag">{{child.name}}<!-- {{route.path+'/'+item.path+'/'+child.path}} --></span>
</el-menu-item>
</el-submenu>
</template>
</el-menu>
</Col>
</Row>
<div class="toggle-menu" @click='toggleMenu'>
<i class='el-icon-arrow-left'></i>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'left-menu',
data () {
return {
menu_list:[],
win_size:{
height:'',
}
}
},
methods:{
setSize(){
this.win_size.height=$(window).height()+"px";
},
toggleMenu(){
this.$store.dispatch(this.$store.state.leftmenu.menu_flag?'set_menu_close':'set_menu_open');
},
updateCurMenu(route){
var route=route || this.$route;
if (route.matched.length) {
var rootPath=route.matched[0].path,
fullPath=route.path;
this.$store.dispatch('set_cur_route',{
rootPath,
fullPath
});
var routes=this.$router.options.routes;
for (var i = 0; i < routes.length; i++) {
if (routes[i].path===rootPath && !routes[i].hidden) {
this.menu_list=routes[i].children;
break;
}
}
}else{
this.$router.push('/404');
}
}
},
created(){
this.setSize();
$(window).resize(()=>{
this.setSize();
});
this.updateCurMenu();
},
mounted(){
// console.log(this.$store.state.user.userinfo.access);
},
watch:{
$route(to,from){
this.updateCurMenu(to);
}
}
}
</script>
<style scoped lang='less'>
.fa{
margin-right: 8px;
}
.left-fixed-right-auto{
padding-top: 60px;
}
.left{
position:fixed;
float:left;
/*width:190px;
margin-right:-190px;*/
top:60px;
}
.right-content{
float:right;
width:100%;
}
#left-menu{
height: 100%;
background: #324057;
position: relative;
overflow-x: hidden;
.toggle-menu{
width: 100%;
height: 50px;
background: #1f2f3d;
position: absolute;
bottom: 50px;
left: 0px;
z-index: 1000;
cursor: pointer;
line-height: 40px;
text-align: center;
color: #fff;
font-size: 14px;
}
}
</style>
module.exports = {
name: 'list-data',
data() {
return {
batch_flag: true, //符合批量删除为true,否则为false
batch_datas: [],
batch_ids: [],
list: this.List, //列表数组
fields: this.FieldList, //字段数组
selection: this.Selection, //是否需要批量选择
btn_info: this.BtnInfo,
pagination: this.Pagination,
}
},
methods: {
/**
* 表格列表触发CheckBox的事件
* @param {array} val 当前选中的用户信息数组,每个元素是用户信息对象
*/
onSelectionChange(val) {
this.batch_datas = val;
this.batch_ids = [];
if (val.length) {
this.batch_flag = false;
for (var i = 0; i < val.length; i++) {
this.batch_ids.push(val[i].id);
}
} else {
this.batch_flag = true;
}
/**
* 改变CheckBox事件,第一个参数是ID数组,第二个参数二维数组,每个数组是选中的对象
*/
this.$emit('onSelectionChange', this.batch_ids, this.batch_datas);
this.$emit('onSelectionChangeObj', {
ids: this.batch_ids,
datas: this.batch_datas
});
},
/**
* 删除事件
* @param {object || boolean} user 当前信息对象或者为布尔值,为布尔值时,代表是批量删除
* @param {number} index 当前列表索引
*/
onDelete(data, index) {
var opts = {};
if (data === true) {
opts.batch_ids = this.batch_ids;
opts.batch_datas = this.batch_datas;
} else {
opts.data = data;
opts.index = index;
}
/**
* 删除事件,参数为对象
* 分两种情况,一种是单个删除,一种是批量删除,属性分别如下
* 1:单个删除
* opts.data 当前要删除的数据对象
* opts.index 当前要删除的索引
* opts.list 当前列表数组
* 2:批量删除
* opts.batch_ids 一维数组,需要删除的ID数组
* opts.batch_datas 二维数组,每个元素为对象(需要删除的数据对象)
*/
this.$emit('onDelete', opts);
},
/**
* 获取行信息事件
* @param {object} row 当前行对象
* @param {number} index 当前行索引
* @param {array} list 当前列表数组
*/
onGetInfo(row, index, list, type) {
this.$emit('onGetInfo', {
row,
index,
list,
type
});
},
onUpdateBtn(data, index, list) {
if (this.btn_info.update && this.btn_info.update.path) {
var path = this.btn_info.update.path,
param_keys = this.btn_info.update.param_keys || [],
query_keys = this.btn_info.update.query_keys || [],
query = {};
for (var i = 0; i < param_keys.length; i++) {
path += '/' + data[param_keys[i]];
}
for (var i = 0; i < query_keys.length; i++) {
query[query_keys[i]] = data[query_keys[i]];
}
// console.log(path);
// console.log(query);
this.$router.push({
path: path,
query: query
});
} else {
this.onGetInfo(data, index, list, 'update');
}
},
/**
* 内置删除事件执行成功后,更新列表方法
* 分两种情况,一种是批量删除,一种是单个删除
* 1:单个删除
* row 当前需要删除行的索引
* 2:批量删除
* row 一维数组,需要删除的ID数组
*/
onUpdateList(row) {
if (!Array.isArray(row)) {
this.list.splice(row, 1);
} else {
this.list = this.list.filter(function(item, idx) {
return row.indexOf(item.id) === -1;
});
}
},
onChangeCurrentPage(page) {
this.$emit('onChangeCurrentPage', page);
},
onChangePageSize(page_size) {
this.$emit('onChangePageSize', page_size);
}
},
mounted() {
// console.log(this.list);
},
/**
* 接收参数
* @type {Object}
*/
props: {
List: {
type: Array,
required: true
},
FieldList: {
type: Array,
required: true
},
BtnInfo: {
type: Object,
default: {}
},
Selection: {
type: Boolean,
default: false
},
Pagination: {
type: Object,
default: {}
}
},
/**
* 监控参数
* @type {Object}
*/
watch: {
List(v) {
if (v) {
this.list = v;
}
},
FieldList(v) {
if (v) {
this.fields = v;
}
},
Selection(v) {
this.selection = v;
},
BtnInfo(v) {
this.btn_info = v;
},
Pagination(v) {
this.pagination = v;
}
}
}
\ No newline at end of file
<template>
<div class="list">
<el-col :span="24" class='actions-top'>
<el-button type='danger' icon='delete'
:disabled='batch_flag'
@click='onDelete(true)'>删除选中</el-button>
</el-col>
<el-table border style="width: 100%" align='center'
:data="list"
@selection-change='onSelectionChange'>
<el-table-column v-if='selection'
type="selection"
width="55">
</el-table-column>
<el-table-column v-for='field in fields'
:prop="field.key"
:label="field.label"
:align="field.align || 'center'"
:sortable="field.sort || false"
:formatter='field.formatter'
:filters='field.filter_list'
:filter-method="field.filter_method"
:filter-multiple="field.filter_multiple">
</el-table-column>
<el-table-column
v-if='btn_info.show!==false'
:label="btn_info.label || '操作'"
:width="btn_info.width || 160"
:context="_self">
<template scope='scope'>
<el-button
v-if='btn_info.select!==false'
type="info"
icon='view'
size="mini"
@click='onGetInfo(scope.row,scope.$index,list,"select")'></el-button>
<el-button
v-if='btn_info.update!==false'
type="info"
icon='edit'
size="mini"
@click='onUpdateBtn(scope.row,scope.$index,list)'></el-button>
<el-button
v-if='btn_info.delete!==false'
type="danger"
icon='delete'
size="mini"
@click='onDelete(scope.row,scope.$index)'></el-button>
<el-button
v-if='btn_info.list'
v-for='btn in btn_info.list'
:type="btn.type || 'info'"
size="mini"
@click='onGetInfo(scope.row,scope.$index,list,btn.fn_type || btn.text)'>{{btn.text}}</el-button>
</template>
</el-table-column>
</el-table>
<el-col :span="24" class='btm-action'>
<!--
-->
<el-pagination
v-if='pagination.total>0'
class='pagination'
:page-sizes="pagination.page_sizes"
:page-size="pagination.page_size"
:layout="pagination.layout"
:total="pagination.total"
:current-page='pagination.current_page'
@current-change='onChangeCurrentPage'
@size-change='onChangePageSize'>
</el-pagination>
</el-col>
</div>
</template>
<script>
import ListDataJs from './ListData.js';
module.exports=ListDataJs;
</script>
<style scoped lang='less'>
.demo-form-inline{
display: inline-block;
float: right;
}
.btm-action{
margin-top: 20px;
text-align: center;
}
.actions-top{
height: 46px;
}
.pagination{
display: inline-block;
}
</style>
import ListData from './ListData.vue';
module.exports = ListData;
\ No newline at end of file
module.exports = {
Bread: require('./Bread/Bread.vue'),
HeadNav: require('./HeadNav/HeadNav.vue'),
LeftMenu: require('./LeftMenu/LeftMenu.vue'),
Echarts: require('./Echarts/'),
ListData: require('./ListData/'),
FormData: require('./FormData/'),
DialogInfo: require('./DialogInfo/'),
};
\ No newline at end of file
<template>
<div class="layout-assistant">
<div class="layout-assistant-content">
<div class='bread'>
<Breadcrumb separator="/" class='el-bread'>
<!--<Breadcrumb-item href="{ path: '/' }">首页</Breadcrumb-item>-->
<Breadcrumb-item v-for='(item,index) in $route.matched' v-if="item.name">{{item.name}}</Breadcrumb-item>
</Breadcrumb>
</div>
<Input class="ass-input" placeholder="API搜索">
<Button slot="append" icon="ios-search"></Button>
</Input>
</div>
</div>
</template>
<script>
export default {
name: 'bread',
data() {
return {
strong: ''
}
},
methods: {
showStr(pa) {
console.log(pa);
},
// getPageText(name) {
// return name = name.replace('编辑', this.$route.query.id ? '修改' : '添加');
// }
},
mounted() {
},
created() {
// if (this.$route.matched.length) {
// var name = this.$route.matched[this.$route.matched.length - 1].name;
// this.strong = this.getPageText(name);
// }
},
watch: {
// $route(to, from) {
// this.strong = this.getPageText(to.name);
// }
}
}
</script>
<style scoped lang='less'>
.bread {
height: 30px;
line-height: 30px;
padding-left: 15px; // background: #f5f7f9;
float: left;
width: 500px;
.el-bread {
display: inline-block; // float: right;
text-align: right;
line-height: 30px;
color: #fff;
font-size: 12px;
}
}
.layout-assistant {
width: 100%;
margin: 0 auto;
height: 50px;
line-height: 50px;
background: #B0C4DE;
/*background: #657180;*/
}
.layout-assistant .layout-assistant-content {
width: 95%;
margin: 0 auto;
padding-top: 10px;
}
.ass-input{
width: 300px;
float: right;
}
//设置导航最后一个菜单的样式
.ivu-breadcrumb span:last-child {
// font-weight: 100;
// color: #fff
}
</style>
<style>
.layout-logo {
width: 100px;
height: 30px;
background: #5b6270;
border-radius: 3px;
float: left;
position: relative;
top: 15px;
left: 20px;
}
.layout-nav {
/*width: 620px;*/
float: left;
margin-left: 100px;
/*margin: 0 auto;*/
}
.layout-assistant {
width: 300px;
margin: 0 auto;
height: inherit;
}
.layout-ceiling-main {
float: right;
margin-right: 15px;
}
.layout-ceiling-main a {
color: #9ba7b5;
margin: 0 10px;
}
.layout-ceiling-main .down {
line-height: 10px;
}
</style>
<template>
<Menu mode="horizontal"
theme="dark"
@on-select="itemSelect"
active-name="1">
<div class="layout-logo"></div>
<div class="layout-nav">
<Menu-item name="/" >
<Icon type="home"></Icon>
首页
</Menu-item>
<Menu-item name="/interface" >
<Icon type="document"></Icon>
接口文档
</Menu-item>
<Menu-item name="/doc" >
<Icon type="information-circled"></Icon>
帮助文档
</Menu-item>
<Menu-item name="/support" >
<Icon type="ios-navigate"></Icon>
服务支持
</Menu-item>
</div>
<div class="layout-ceiling-main">
<Dropdown class="down" @on-click="clickDown">
<a href="javascript:void(0)">
admin
<Icon type="arrow-down-b"></Icon>
</a>
<Dropdown-menu slot="list">
<Dropdown-item name="1">修改密码</Dropdown-item>
<Dropdown-item name="2">帐号信息</Dropdown-item>
<Dropdown-item name="3">我的主页</Dropdown-item>
<Dropdown-item name="4" divided>退出登录</Dropdown-item>
</Dropdown-menu>
</Dropdown>|
<router-link to="/login">注册登录</router-link> |
<router-link to="/account">帐号中心</router-link>
</div>
</Menu>
</template>
<script>
module.exports = {
name: 'head-nav',
methods: {
itemSelect(name) {
this.$router.push(name)
},
clickDown(name){
this.$Modal.info({
title:"提示",
content: "你点击了:"+name,
onOk: () => {
this.$Message.info('点击了确定');
},
})
}
}
};
</script>
\ No newline at end of file
<template>
<div>
<Menu
width="auto"
active-name="1"
@on-select="itemSelect"
>
<Submenu name="/1">
<template slot="title">
<Icon type="ios-paper"></Icon>
医链云API
</template>
<Menu-group title="用户模块">
<Menu-item name="/111">
获取用户信息API
</Menu-item>
<Menu-item name="2">
获取用户名API
</Menu-item>
</Menu-group>
<Menu-group title="订单模块">
<Menu-item name="3">
获取订单信息API
</Menu-item>
<Menu-item name="4">
获取订单状态API
</Menu-item>
</Menu-group>
</Submenu>
<Submenu name="/2">
<template slot="title">
<Icon type="ios-paper"></Icon>
四方云API
</template>
<Menu-group title="用户模块">
<Menu-item name="1">
获取用户信息API
</Menu-item>
<Menu-item name="2">
获取用户名API
</Menu-item>
</Menu-group>
<Menu-group title="订单模块">
<Menu-item name="3">
获取订单信息API
</Menu-item>
<Menu-item name="4">
获取订单状态API
</Menu-item>
</Menu-group>
</Submenu>
</Menu>
<!--<Menu active-name="1"
width="auto"
:open-names="['1']"
@on-select="itemSelect"
v-for="(route,index) in $router.options.routes"
v-if='!route.hidden && $route.matched.length && $route.matched[0].path===route.path'>
<template v-for="(item,index) in route.children">
<template v-if="item.children">
<Submenu :name="route.path+'/'+item.path">
<template slot="title">
<Icon type="ios-navigate"></Icon>
{{item.name}}
</template>
<Menu-item v-for='(child,cindex) in item.children'
:name="route.path+'/'+item.path+'/'+child.path">
{{child.name}}
</Menu-item>
</Submenu>
</template>
<template v-else>
<Menu-item :name="route.path+'/'+item.path">
<Icon type="ios-navigate"></Icon>
{{item.name}}
</Menu-item>
</template>
</template>
</Menu>-->
</div>
</template>
<script>
module.exports = {
name: 'left-menu',
data() {
return {
strong: ''
}
},
methods: {
itemSelect(name) {
this.$router.push($route.path+name)
}
}
};
</script>
\ No newline at end of file
module.exports = {
HeadNav: require('./HeadNav.vue'),
Bread: require('./Bread.vue'),
LeftMenu: require('./LeftMenu.vue'),
};
\ No newline at end of file
// import {
// user as UserApi
// } from '../../config/request.js';
module.exports = {
name: 'login',
data() {
return {
winSize: {
width: '',
height: ''
},
formOffset: {
position: 'absolute',
left: '',
top: ''
},
remumber: this.$store.state.user.remumber,
login_actions: {
disabled: false
},
data: {
username: '',
password: '',
// token: ''
},
rule_data: {
username: [{
required: true,
message: '用户名不能为空!',
trigger: 'blur'
}],
password: [{
required: true,
message: '密码不能为空!',
trigger: 'blur'
}],
}
}
},
methods: {
setSize() {
this.winSize.width = $(window).width() + "px";
this.winSize.height = $(window).height() + "px";
this.formOffset.left = (parseInt(this.winSize.width) / 2 - 175) + 'px';
this.formOffset.top = (parseInt(this.winSize.height) / 2 - 178) + 'px';
},
// login(ref) {
// this.$refs[ref].validate((valid) => {
// if (valid) {
// this.login_actions.disabled = true;
// //如果记住密码,提交的信息包括真实token,密码则是假的
// //服务端登录验证优先级:用户名必须,其次先取token,不存在时再取密码
// UserApi.login.call(this, this[ref], data => {
// //登录成功之后,验证是否记住密码,如果记住密码,本地保存记住信息
// //如果没有记住,就初始化本地记住信息
// if (this.remumber.remumber_flag === true) {
// this.$store.dispatch('update_remumber', {
// remumber_flag: this.remumber.remumber_flag,
// remumber_login_info: {
// username: this[ref].username,
// token: data.userinfo.token
// }
// });
// } else {
// this.$store.dispatch('remove_remumber');
// }
// // this.$set(data.userinfo, 'access', ['/adv', '/demo/user', '/demo/user/list']);
// this.$store.dispatch('update_userinfo', {
// userinfo: data.userinfo
// }).then(() => {
// this.login_actions.disabled = false;
// this.$router.push('/demo/user/list');
// });
// }, () => {
// this.login_actions.disabled = false;
// }, () => {
// this.login_actions.disabled = false;
// });
// }
// });
// },
resetForm(ref) {
this.$refs[ref].resetFields();
}
},
created() {
this.setSize();
$(window).resize(() => {
this.setSize();
});
},
mounted() {
// console.log(this.remumber);
//如果上次登录选择的是记住密码并登录成功,则会保存状态,用户名以及token
// if (this.remumber.remumber_flag === true) {
// this.data.username = this.remumber.remumber_login_info.username;
// this.data.password = this.remumber.remumber_login_info.token.substring(0, 16);
// this.$set(this.data, 'token', this.remumber.remumber_login_info.token);
// }
}
}
\ No newline at end of file
<template>
<div class="login" :style="winSize">
<Row>
<Col span="24">
<div class="content">
<Form ref='data' :model="data" class="card-box loginform" :rules="rule_data" :style="formOffset">
<h3 class="title">系统登录</h3>
<Form-item prop="username">
<Input type="text" placeholder="用户名">
<Icon type="ios-person-outline" slot="prepend"></Icon>
</Input>
</Form-item>
<Form-item prop="password">
<Input type="password" placeholder="密码">
<Icon type="ios-locked-outline" slot="prepend"></Icon>
</Input>
</Form-item>
<Form-item label-width='0'>
<Button type="primary" long>登录</Button>
</Form-item>
<hr>
<div class="bottom">
<span>忘记密码</span>
<span><router-link to="/register">免费注册</router-link></span>
</div>
</Form>
</div>
</Col>
</Row>
</div>
</template>
<script>
import LoginJs from './Login.js';
module.exports = LoginJs;
</script>
<style scoped lang='less'>
.login {
background: #1F2D3D;
.ivu-form-item {
margin-bottom: 20px;
}
.bottom {
float: right;
margin-top: 10px; // color: red;
}
.bottom span {
margin-left: 20px;
}
.title {
// padding-left: 30px;
font-size: 20px;
}
.card-box {
box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02);
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
background-clip: padding-box;
margin-bottom: 100px;
background-color: #F9FAFC;
border: 2px solid #8492A6;
}
.title {
margin: 0px auto 20px auto;
text-align: center;
color: #505458;
}
.loginform {
width: 350px;
padding: 25px 35px 15px 35px;
}
}
</style>
// import {
// user as UserApi
// } from '../../config/request.js';
module.exports = {
name: 'login',
data() {
return {
winSize: {
width: '',
height: ''
},
formOffset: {
position: 'absolute',
left: '',
top: ''
},
remumber: this.$store.state.user.remumber,
login_actions: {
disabled: false
},
data: {
username: '',
password: '',
// token: ''
},
rule_data: {
username: [{
required: true,
message: '用户名不能为空!',
trigger: 'blur'
}],
password: [{
required: true,
message: '密码不能为空!',
trigger: 'blur'
}],
}
}
},
methods: {
setSize() {
this.winSize.width = $(window).width() + "px";
this.winSize.height = $(window).height() + "px";
this.formOffset.left = (parseInt(this.winSize.width) / 2 - 175) + 'px';
this.formOffset.top = (parseInt(this.winSize.height) / 2 - 220) + 'px';
},
// login(ref) {
// this.$refs[ref].validate((valid) => {
// if (valid) {
// this.login_actions.disabled = true;
// //如果记住密码,提交的信息包括真实token,密码则是假的
// //服务端登录验证优先级:用户名必须,其次先取token,不存在时再取密码
// UserApi.login.call(this, this[ref], data => {
// //登录成功之后,验证是否记住密码,如果记住密码,本地保存记住信息
// //如果没有记住,就初始化本地记住信息
// if (this.remumber.remumber_flag === true) {
// this.$store.dispatch('update_remumber', {
// remumber_flag: this.remumber.remumber_flag,
// remumber_login_info: {
// username: this[ref].username,
// token: data.userinfo.token
// }
// });
// } else {
// this.$store.dispatch('remove_remumber');
// }
// // this.$set(data.userinfo, 'access', ['/adv', '/demo/user', '/demo/user/list']);
// this.$store.dispatch('update_userinfo', {
// userinfo: data.userinfo
// }).then(() => {
// this.login_actions.disabled = false;
// this.$router.push('/demo/user/list');
// });
// }, () => {
// this.login_actions.disabled = false;
// }, () => {
// this.login_actions.disabled = false;
// });
// }
// });
// },
resetForm(ref) {
this.$refs[ref].resetFields();
}
},
created() {
this.setSize();
$(window).resize(() => {
this.setSize();
});
},
mounted() {
// console.log(this.remumber);
//如果上次登录选择的是记住密码并登录成功,则会保存状态,用户名以及token
// if (this.remumber.remumber_flag === true) {
// this.data.username = this.remumber.remumber_login_info.username;
// this.data.password = this.remumber.remumber_login_info.token.substring(0, 16);
// this.$set(this.data, 'token', this.remumber.remumber_login_info.token);
// }
}
}
\ No newline at end of file
<template>
<div class="login" :style="winSize">
<Row>
<Col span="24">
<div class="content">
<Form ref='data' :model="data" class="card-box loginform" :rules="rule_data" :style="formOffset">
<h3 class="title">用户注册</h3>
<Form-item prop="username">
<Input type="text" placeholder="手机号">
<Icon type="ios-person-outline" slot="prepend"></Icon>
</Input>
</Form-item>
<Form-item prop="password">
<Input type="password" placeholder="密码">
<Icon type="ios-locked-outline" slot="prepend"></Icon>
</Input>
</Form-item>
<Form-item prop="password">
<Input type="password" placeholder="密码确认">
<Icon type="ios-locked-outline" slot="prepend"></Icon>
</Input>
</Form-item>
<Form-item prop="password">
<Input type="password" placeholder="安全邮箱">
<Icon type="ios-email-outline" slot="prepend"></Icon>
</Input>
</Form-item>
<Form-item label-width='0'>
<Button type="success" long>注册</Button>
</Form-item>
<hr>
<div class="bottom">
<span><router-link to="/login">立即登录</router-link></span>
</div>
</Form>
</div>
</Col>
</Row>
</div>
</template>
<script>
import RegisterJS from './Register.js';
module.exports = RegisterJS;
</script>
<style scoped lang='less'>
.login {
background: #1F2D3D;
.ivu-form-item {
margin-bottom: 20px;
}
.bottom {
float: right;
margin-top: 10px; // color: red;
}
.bottom span {
margin-left: 20px;
}
.title {
// padding-left: 30px;
font-size: 20px;
}
.card-box {
box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02);
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
background-clip: padding-box;
margin-bottom: 100px;
background-color: #F9FAFC;
border: 2px solid #8492A6;
}
.title {
margin: 0px auto 20px auto;
text-align: center;
color: #505458;
}
.loginform {
width: 350px;
padding: 25px 35px 15px 35px;
}
}
</style>
module.exports = {
Login: require('./Login.vue'),
Register: require('./Register.vue'),
};
\ No newline at end of file
<template>
<Table border :columns="columns1" :data="data1"></Table>
</template>
<script>
export default {
data () {
return {
columns1: [
{
title: '帐号中心',
key: 'name',
width:300
},
{
title: '所属模块',
key: 'model',
width:200
},
{
title: '类型',
key: 'age',
width:100,
render (row, column, index) {
const color = index % 2 ==0 ? 'blue' : 'red';
const text = index % 2 ==0 ? '免费' : '收费';
return `<tag type="border" color="${color}">${text}</tag>`;
}
},
{
title: '描述',
key: 'address'
}
],
data1: [
{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},
{
name: '周小伟',
age: 26,
model:'订单管理',
address: '深圳市南山区深南大道'
},
{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},
]
}
}
}
</script>
\ No newline at end of file
<style scoped>
</style>
<template>
<div class="layout">
<bread></bread>
<div class="layout-content">
<Row>
<i-col span="5">
<Menu width="auto" @on-select="itemSelect">
<Menu-item name="/account/1">
帐号信息
</Menu-item>
<Menu-item name="/account/2">
调用统计
</Menu-item>
<Menu-item name="/account/3">
帐号安全
</Menu-item>
<Menu-item name="/account/4">
密钥管理
</Menu-item>
</Menu>
</i-col>
<i-col span="19">
<div class="layout-breadcrumb">
</div>
<div class="layout-content-main">
<router-view></router-view>
</div>
</i-col>
</Row>
</div>
<div class="layout-copy">
2011-2016 &copy;
</div>
</div>
</template>
<script>
export default {
name: 'home',
data() {
return {
// leftWidth:'5'
}
},
computed: {
},
methods: {
itemSelect(name) {
this.$router.push(name);
}
},
}
</script>
module.exports = {
AccountList: require('./AccountList.vue'),
AccountView: require('./AccountView.vue'),
};
\ No newline at end of file
<style scoped>
</style>
<template>
<div class="layout">
<bread></bread>
<div class="layout-content">
<Row>
<i-col span="5">
<Menu width="auto" @on-select="itemSelect">
<Menu-item name="/interface">
目录
</Menu-item>
<Submenu name="/interface/1">
<template slot="title">
<Icon type="ios-paper"></Icon>
医链云
</template>
<Menu-item name="/interface/detail/111">
获取用户信息API
</Menu-item>
<Menu-item name="/interface/pro/222">
获取用户名API
</Menu-item>
<Menu-item name="/interface/debug/222">
获取订单信息API
</Menu-item>
<Menu-item name="4">
获取订单状态API
</Menu-item>
</Submenu>
<Submenu name="/2">
<template slot="title">
<Icon type="ios-paper"></Icon>
四方云
</template>
<Menu-item name="1">
获取用户信息API
</Menu-item>
<Menu-item name="2">
获取用户名API
</Menu-item>
<Menu-item name="3">
获取订单信息API
</Menu-item>
<Menu-item name="5">
获取订单状态API
</Menu-item>
</Submenu>
</Menu>
</i-col>
<i-col span="19">
<div class="layout-breadcrumb">
</div>
<div class="layout-content-main">
<router-view></router-view>
</div>
</i-col>
</Row>
</div>
<div class="layout-copy">
2011-2016 &copy;
</div>
</div>
</template>
<script>
export default {
name: 'home',
data() {
return {
// leftWidth:'5'
}
},
computed: {
},
methods: {
itemSelect(name) {
this.$router.push(name);
}
},
}
</script>
<template>
<Table border :columns="columns1" :data="data1"></Table>
</template>
<script>
export default {
data () {
return {
columns1: [
{
title: 'API名称',
key: 'name',
width:300
},
{
title: '所属模块',
key: 'model',
width:200
},
{
title: '类型',
key: 'age',
width:100,
render (row, column, index) {
const color = index % 2 ==0 ? 'blue' : 'red';
const text = index % 2 ==0 ? '免费' : '收费';
return `<tag type="border" color="${color}">${text}</tag>`;
}
},
{
title: '描述',
key: 'address'
}
],
data1: [
{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},
{
name: '周小伟',
age: 26,
model:'订单管理',
address: '深圳市南山区深南大道'
},
{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},
]
}
}
}
</script>
\ No newline at end of file
<style>
.ivu-form-item{
margin-bottom: 10px;
}
</style>
<template>
<Card>
<p slot="title">
接口调试
</p>
<p slot="extra">
<Button type="info" icon="navicon-round">调试历史</Button>
</p>
<Alert show-icon >
消息提示文案
<template slot="desc">
系统分配AppKey只能调用基础API,增值API需要填入自己申请的AppKey
</template>
</Alert>
<Row :gutter="32">
<Col span="12">
<Form :model="formItem" :label-width="80">
<Form-item label="返回格式">
<Radio-group v-model="formItem.radio">
<Radio label="JSON">JSON</Radio>
<Radio label="XML">XML</Radio>
</Radio-group>
</Form-item>
<Form-item label="API模块">
<Select v-model="formItem.select" placeholder="请选择">
<Option value="beijing">商品模块</Option>
<Option value="shanghai">用户模块</Option>
</Select>
</Form-item>
<Form-item label="API名称">
<Select v-model="formItem.select" placeholder="请选择">
<Option value="beijing">获取用户信息</Option>
<Option value="shanghai">获取用户名</Option>
</Select>
</Form-item>
<Form-item label="提交方式">
<Radio-group v-model="formItem.radio">
<Radio label="POST">POST</Radio>
<Radio label="GET">GET</Radio>
</Radio-group>
</Form-item>
<Form-item label="AppKey">
<Input v-model="formItem.input" placeholder="请输入"></Input>
</Form-item>
<Form-item label="AppSecret">
<Input v-model="formItem.input" placeholder="请输入"></Input>
</Form-item>
<Form-item label="参数1">
<Input v-model="formItem.input" placeholder="请输入"></Input>
</Form-item>
<Form-item label="参数2">
<Input v-model="formItem.input" placeholder="请输入"></Input>
</Form-item>
<Form-item label="参数3">
<Input v-model="formItem.input" placeholder="请输入"></Input>
</Form-item>
<Form-item>
<Row :gutter="64">
<Col span="12">
<Button type="primary" long>提交</Button>
</Col>
<Col span="12">
<Button type="ghost" long>保存</Button>
</Col>
</Row>
</Form-item>
</Form>
</Col>
<Col span="12">
<Form label-position="top">
<Form-item label="API请求参数">
<Input v-model="formItem.textarea" type="textarea" :autosize="{minRows: 5}" ></Input>
</Form-item>
<Form-item label="API返回参数">
<Input v-model="formItem.textarea" type="textarea" :autosize="{minRows: 5}" ></Input>
</Form-item>
</Form>
</Col>
</Row>
</Card>
</template>
<script>
export default {
data () {
return {
formItem: {
input: '',
select: '',
radio: 'male',
checkbox: [],
switch: true,
date: '',
time: '',
slider: [20, 50],
textarea: ''
}
}
}
}
</script>
\ No newline at end of file
<style>
.apidetail blockquote {
margin: 10px 0;
}
.apidetail-title-name {
float: left;
}
.apidetail-title-btn {
float: right;
}
.apidetail-title-name-1 {
display: block;
font-size: 25px;
font-weight: 100;
}
.apidetail-title-name-2 {
display: block;
margin: 10px 0;
}
</style>
<template>
<div class="apidetail">
<Back-top></Back-top>
<div class="apidetail-title">
<div class="apidetail-title-name">
<span class="apidetail-title-name-1"> taobao.product.update </span>
<span class="apidetail-title-name-2"> (修改一个产品,可以修改主图,不能修改子图片)</span>
</div>
<div class="apidetail-title-btn">
<Button-group>
<Button type="ghost"
icon="information-circled">
1.0</Button>
<Button type="primary"
icon="gear-a">
调试</Button>
</Button-group>
</div>
<div class="clear"></div>
</div>
<Tag type="border"
color="yellow">免费</Tag>
<Tag type="border"
color="yellow">需授权</Tag>
<blockquote>
接口说明信息说明信息说明信息说明信息说明信息说明信息说明信息说明信息 说明信息说明信息说明信息说明信息说明信息说明信息说明信息说明信息说明信息说明信息说 说明信息说明信息说明信息
</blockquote>
<Collapse v-model="openPanel">
<Panel name="0">
接口地址
<p slot="content">
<Table border
:columns="columns2"
:data="data2"></Table>
</p>
</Panel>
<Panel name="1">
公共参数
<p slot="content">
<Table border
:columns="columns1"
:data="data1"></Table>
</p>
</Panel>
<Panel name="2">
请求参数
<p slot="content">斯蒂夫·盖瑞·沃兹尼亚克(Stephen Gary Wozniak),美国电脑工程师,曾与史蒂夫·乔布斯合伙创立苹果电脑(今之苹果公司)。斯蒂夫·盖瑞·沃兹尼亚克曾就读于美国科罗拉多大学,后转学入美国著名高等学府加州大学伯克利分校(UC Berkeley)并获得电机工程及计算机(EECS)本科学位(1987年)。</p>
</Panel>
<Panel name="3">
响应参数
<p slot="content">乔纳森·伊夫是一位工业设计师,现任Apple公司设计师兼资深副总裁,英国爵士。他曾参与设计了iPod,iMac,iPhone,iPad等众多苹果产品。除了乔布斯,他是对苹果那些著名的产品最有影响力的人。</p>
</Panel>
<Panel name="4">
请求示例
<p slot="content"
class="code">
<pre>
{
"nu":"1093590637819",
"message":"ok",
"companytype":"ems",
"ischeck":"1",
"com":"ems",
"updatetime":"2016-08-22 01:37:27",
"status":"200",
"condition":"F00",
"codenumber":"1093590637819",
"data":[
{
"time":"2016-08-17 10:57:02",
"context":"【北京市】 投递并签收,签收人:他人收 前台",
"ftime":"2016-08-17 10:57:02"
},
{
"time":"2016-08-17 07:51:00",
"context":"【北京市】 北京邮政速递朝阳路区域分公司呼家楼营投部安排投递,预计23:59:00前投递(投递员姓名:徐龙会18519361767;联系电话:18519361767)",
"ftime":"2016-08-17 07:51:00"
},
{
"time":"2016-08-16 17:11:34",
"context":"北京市已收件(揽投员姓名:白中位,联系电话:)",
"ftime":"2016-08-16 17:11:34"
}
],
"state":"3"
}
</pre>
</p>
</Panel>
<Panel name="5">
响应示例
<p slot="content">乔纳森·伊夫是一位工业设计师,现任Apple公司设计师兼资深副总裁,英国爵士。他曾参与设计了iPod,iMac,iPhone,iPad等众多苹果产品。除了乔布斯,他是对苹果那些著名的产品最有影响力的人。</p>
</Panel>
</Collapse>
</div>
</template>
<script>
export default {
data() {
return {
openPanel: [0,1, 2, 3, 4],
columns2:[{
title: '环境',
key: 'str1',
width: 200,
},{
title: '地址',
key: 'str2',
},
],
data2:[
{
str1: '正式环境',
str2: 'http://www.baidu.com',
},
{
str1: '沙箱环境',
str2: 'http://www.baidu.com',
},
],
columns1: [
{
title: '名称',
key: 'str1',
width: 200,
},
{
title: '类型',
key: 'str2',
width: 100,
},
{
title: '是否必填',
key: 'str3',
width: 100,
},
{
title: '描述',
key: 'str4'
}
],
data1: [
{
str1: 'method',
str2: 'String',
str3: '是',
str4: '描述信息'
},
{
str1: 'app_key',
str2: 'String',
str3: '是',
str4: '描述信息'
},
{
str1: 'target_app_key',
str2: 'String',
str3: '是',
str4: '描述信息'
},
{
str1: 'sign_method',
str2: 'String',
str3: '是',
str4: '描述信息'
},
{
str1: 'session',
str2: 'String',
str3: '是',
str4: '描述信息'
},
{
str1: 'sign',
str2: 'String',
str3: '是',
str4: '描述信息'
}
]
}
}
}
</script>
module.exports = {
ApiDetail: require('./ApiDetail.vue'),
ApiDebug: require('./ApiDebug.vue'),
};
\ No newline at end of file
<template>
<div>
<!--<div>11111</div>-->
<router-view></router-view>
</div>
</template>
\ No newline at end of file
module.exports = {
Detail: require('./Detail/'),
ApiList: require('./ApiList.vue'),
DetailView: require('./DetailView.vue'),
ApiDocView: require('./ApiDocView.vue'),
};
\ No newline at end of file
<template>
<Table border :columns="columns1" :data="data1"></Table>
</template>
<script>
export default {
data () {
return {
columns1: [
{
title: '文档名称',
key: 'name',
width:300
},
{
title: '所属模块',
key: 'model',
width:200
},
{
title: '类型',
key: 'age',
width:100,
render (row, column, index) {
const color = index % 2 ==0 ? 'blue' : 'red';
const text = index % 2 ==0 ? '免费' : '收费';
return `<tag type="border" color="${color}">${text}</tag>`;
}
},
{
title: '描述',
key: 'address'
}
],
data1: [
{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},
{
name: '周小伟',
age: 26,
model:'订单管理',
address: '深圳市南山区深南大道'
},
{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},
]
}
}
}
</script>
\ No newline at end of file
<style scoped>
</style>
<template>
<div class="layout">
<bread></bread>
<div class="layout-content">
<Row>
<i-col span="5">
<Menu width="auto" @on-select="itemSelect">
<Menu-item name="/interface">
开放平台
</Menu-item>
<Submenu name="/interface/1">
<template slot="title">
<Icon type="ios-paper"></Icon>
平台简介
</template>
<Menu-item name="/interface/detail/111">
业务接入
</Menu-item>
<Menu-item name="/interface/pro/222">
接口规范
</Menu-item>
<Menu-item name="/interface/debug/222">
调用说明
</Menu-item>
<Menu-item name="4">
错误编码
</Menu-item>
</Submenu>
<Submenu name="/2">
<template slot="title">
<Icon type="ios-paper"></Icon>
调用场景
</template>
<Menu-item name="1">
获取用户信息API
</Menu-item>
<Menu-item name="2">
获取用户名API
</Menu-item>
<Menu-item name="3">
获取订单信息API
</Menu-item>
<Menu-item name="5">
获取订单状态API
</Menu-item>
</Submenu>
</Menu>
</i-col>
<i-col span="19">
<div class="layout-breadcrumb">
</div>
<div class="layout-content-main">
<router-view></router-view>
</div>
</i-col>
</Row>
</div>
<div class="layout-copy">
2011-2016 &copy;
</div>
</div>
</template>
<script>
export default {
name: 'home',
data() {
return {
// leftWidth:'5'
}
},
computed: {
},
methods: {
itemSelect(name) {
this.$router.push(name);
}
},
}
</script>
module.exports = {
DocList: require('./DocList.vue'),
HelpDocView: require('./HelpDocView.vue'),
};
\ No newline at end of file
<style scoped>
.demo-carousel {
height: 400px;
line-height: 400px;
text-align: center;
color: #fff;
font-size: 20px;
background: #657180;
}
.bg1{
background: #9ea7b4;
}
.bg2{
background: #c3cbd6;
}
</style>
<template>
<div class="layout">
<!--<bread></bread>-->
<Carousel autoplay v-model="value2">
<Carousel-item>
<div class="demo-carousel">1</div>
</Carousel-item>
<Carousel-item>
<div class="demo-carousel bg1">2</div>
</Carousel-item>
<Carousel-item>
<div class="demo-carousel bg2">3</div>
</Carousel-item>
<Carousel-item>
<div class="demo-carousel">4</div>
</Carousel-item>
</Carousel>
<div class="layout-content">
<div class="layout-content-main">
<router-view></router-view>
</div>
</div>
<div class="layout-copy">
2011-2016 &copy;
</div>
</div>
</template>
<script>
import Layout from '../Layout';
export default {
name: 'home',
data() {
return {
value2: 0
}
},
computed: {
},
components: Layout
}
</script>
<style>
.demo-carousel {
height: 400px;
line-height: 400px;
text-align: center;
color: #fff;
font-size: 20px;
background: #506b9e;
}
</style>
<template>
<div>
<Alert show-icon
style="width:100%">
最新公告
<template slot="desc">消息提示的描述文案消息提示的描述文案消息提示的描述文案消息提示的描述文案消息提示的描述文案</template>
</Alert>
<Row :gutter="16">
<Col span="8">
<Card>
<p slot="title" style="font-size:15px">接入指南</p>
<ul class="maincon-cart-ul">
<li v-for="n in 4">这里是内容-------{{n}}</li>
<li>更多</li>
</ul>
</Card>
</Col>
<Col span="8">
<Card>
<p slot="title" style="font-size:15px">平台规则</p>
<ul class="maincon-cart-ul">
<li v-for="n in 4">这里是内容-------{{n}}</li>
<li>更多</li>
</ul>
</Card>
</Col>
<Col span="8">
<Card>
<p slot="title" style="font-size:15px">基础技术</p>
<ul class="maincon-cart-ul">
<li v-for="n in 4">这里是内容-------{{n}}</li>
<li>更多</li>
</ul>
</Card>
</Col>
</Row>
<Row style="margin-top:20px">
<Col span="24">
<Card>
<p slot="title" style="font-size:15px">常用工具</p>
<ul class="maincon-cart-ul">
<li v-for="n in 4">这里是内容-------{{n}}</li>
</ul>
</Card>
</Col>
</Row>
</div>
</template>
<style>
.maincon-cart-ul li{
padding: 15px 0 10px 0;
border-bottom: 1px #e3e8ee dashed;
}
</style>
\ No newline at end of file
module.exports = {
MainCon: require('./MainCon.vue')
};
\ No newline at end of file
<template>
<Table border :columns="columns1" :data="data1"></Table>
</template>
<script>
export default {
data () {
return {
columns1: [
{
title: '文档名称',
key: 'name',
width:300
},
{
title: '所属模块',
key: 'model',
width:200
},
{
title: '类型',
key: 'age',
width:100,
render (row, column, index) {
const color = index % 2 ==0 ? 'blue' : 'red';
const text = index % 2 ==0 ? '免费' : '收费';
return `<tag type="border" color="${color}">${text}</tag>`;
}
},
{
title: '描述',
key: 'address'
}
],
data1: [
{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},
{
name: '周小伟',
age: 26,
model:'订单管理',
address: '深圳市南山区深南大道'
},
{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},{
name: '王小明',
age: 18,
model:'用户管理',
address: '北京市朝阳区芍药居'
},
{
name: '张小刚',
age: 25,
model:'用户管理',
address: '北京市海淀区西二旗'
},
{
name: '李小红',
age: 30,
model:'用户管理',
address: '上海市浦东新区世纪大道'
},
]
}
}
}
</script>
\ No newline at end of file
<style scoped>
.top-bar {
height: 320px;
line-height: 320px;
background-color: #0182c1;
margin-bottom: 48px;
text-align: center;
color: #fff;
font-size: 16px;
background: #273e4d url(//img.alicdn.com/tps/TB18wHKJVXXXXX_XVXXXXXXXXXX-1700-350.jpg) no-repeat;
}
</style>
<template>
<div class="layout">
<div class="top-bar">
服务中心
</div>
<div class="layout-content">
<div class="layout-content-main">
<router-view></router-view>
</div>
</div>
<div class="layout-copy">
2011-2016 &copy;
</div>
</div>
</template>
<script>
export default {
name: 'home',
data() {
return {
value2: 0
}
},
computed: {
},
}
</script>
module.exports = {
SupportList: require('./SupportList.vue'),
SupportView: require('./SupportView.vue'),
};
\ No newline at end of file
module.exports = {
MainCon: require('./MainCon/'),
ApiDoc: require('./ApiDoc/'),
HelpDoc: require('./HelpDoc/'),
Support: require('./Support/'),
Account: require('./Account/'),
HomeView: require('./HomeView.vue'),
};
\ No newline at end of file
module.exports = {
testaxios: require('./testaxios.vue'),
testaxios2: require('./testaxios2.vue'),
};
\ No newline at end of file
<template>
<div>
<Row>
<Col span="24">
<div class="content">
<Form ref='data'
:model="data"
:label-width="80"
class="demo-ruleForm card-box loginform">
<h3 class="title">系统登录</h3>
<Form-item label="帐号"
prop="username">
<Input type="text"
v-model="data.username"></Input>
</Form-item>
<Form-item label="密码"
prop="password">
<Input type="password"
v-model="data.password"></Input>
</Form-item>
<Form-item>
<Button type="primary"
@click='login()'>提交</Button>
<Button type="primary"
@click='loginError()'>错误提交</Button>
<Button type="ghost"
style="margin-left: 8px">重置</Button>
</Form-item>
</Form>
</div>
</Col>
</Row>
</div>
</template>
<script>
export default {
name: 'content',
data() {
return {
data: {
username: '',
password: '',
// token: ''
},
}
},
methods: {
login() {
var self = this;
console.log(self.data.username);
this.axios.get("public/act/getAll").then((res) => {
console.log(JSON.stringify(error));
console.log("页面里面:" + res);
})
},
loginError(){
this.axios.get("test/axioserror").then((res) => {
console.log("页面里面:" + res);
}).catch((error)=>{
console.log(error);
})
}
},
created() {
},
mounted() {
}
}
</script>
\ No newline at end of file
<template>
<div>
<blockquote> 22222222222222222222222222</blockquote>
</div>
</template>
<script>
export default {
name: 'content',
data() {
return {
data: {
username: '',
password: '',
// token: ''
},
}
},
methods: {
login() {
var self = this;
console.log(self.data.username);
this.axios.get("public/act/getAll").then((res) => {
console.log(JSON.stringify(error));
console.log("页面里面:" + res);
})
},
loginError(){
this.axios.get("test/axioserror").then((res) => {
console.log("页面里面:" + res);
}).catch((error)=>{
console.log(error);
})
}
},
created() {
},
mounted() {
}
}
</script>
\ No newline at end of file
import Login from './Login/';
import Test from './TestPages/';
// import NotFound from './Routeview/NotFound.vue';
import Modules from './Modules/';
import Layout from './Layout/';
module.exports = {
Login,
// NotFound,
Test,
Layout,
Modules
};
\ No newline at end of file
This diff is collapsed. Click to expand it.
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
No preview for this file type
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!