Commit c2997fed by 小明

调整代码格式

parent a1ffacac
......@@ -35,9 +35,9 @@ module.exports = (options) => ({
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
loader: ['css-loader?sourceMap', 'sass-loader?sourceMap']
loader: ['css-loader?sourceMap', 'sass-loader?sourceMap'],
// loader: ['css-loader?sourceMap', 'postcss-loader', 'sass-loader']
})
}),
// use: ['style-loader', 'css-loader?sourceMap', 'postcss-loader', 'sass-loader']
},
......@@ -67,7 +67,8 @@ module.exports = (options) => ({
{
test: /\.(mp4|webm)$/,
use: 'url-loader?limit=10000',
}],
},
],
},
plugins: options.plugins.concat([
new webpack.ProvidePlugin({
......
// Important modules this config uses
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const OfflinePlugin = require('offline-plugin');
module.exports = require('./webpack.base.babel')({
// In production, we skip all hot-reloading stuff
......@@ -17,8 +15,9 @@ module.exports = require('./webpack.base.babel')({
library: 'window',
libraryTarget: 'this',
},
externals: {
react: 'React'
react: 'React',
},
plugins: [
......
......@@ -12,10 +12,6 @@
import React, { PureComponent } from 'react';
export default class HomePage extends PureComponent { // eslint-disable-line react/prefer-stateless-function
constructor(props) {
super(props);
}
render() {
return (
<h1>
......
......@@ -238,7 +238,7 @@ class DashboardIndexAdmin extends Component { // eslint-disable-line react/prefe
{tab.title}
</p>
</Col>
});}
})}
</Row>
{outlet}
</Col>
......
......@@ -20,6 +20,44 @@ class DashboardIndexMember extends Component { // eslint-disable-line react/pref
{type: 'inventory', name: '库存查询', path: '/mobile/inventories'},
].chunk(4);
let outlet = null;
if (this.props.loading) {
if (this.props.logined) {
outlet = (<Icon type='loading' className='search-loading'/>);
}
} else {
if (this.props.documents.length > 0) {
outlet = (<Row>
<Col span='24'>
{props.documents.each((doc) =>{
let key = `${doc.type}_${doc.id}`;
<Document key={key} document={doc}></Document>
})}
</Col>
</Row>);
} else {
let column = (<div>
<p className='ik-title-font ik-margin-top-20 ik-title-color'>
还没有单据哦,快去新增吧
</p>
</div>);
if (!props.hasPermission) {
column = (<div>
<svg className='file-color'>
<use xlinkHref={props.icons.document}/>
</svg>
<p className='ik-title-font ik-margin-top-20 ik-title-color'> 亲,你没有权限操作此功能哦</p>
</div>);
}
outlet = (<Row type='flex' justify='center' className='document-list ik-padding-bottom-20'>
<Col span='16' className='ik-text-center'>
{column}
</Col>
</Row>);
}
}
return (<Row>
<Row id="action-sheet-button-container">
<Col span='6' offset='18' className='ik-padding-top-20'>
......@@ -71,41 +109,7 @@ class DashboardIndexMember extends Component { // eslint-disable-line react/pref
<p className='document-title'>最近的单据</p>
</Col>
<Col span='24'>
{ if (this.props.loading) {
if (this.props.logined) {
<Icon type='loading' className='search-loading'/>
}
} else {
if (this.props.documents.length > 0) {
<Row>
<Col span='24'>
{props.documents.each(doc){
<Document key=`${document.type}_${document.id}` document={doc}></Document>
}}
</Col>
</Row>
} else {
<Row type='flex' justify='center' className='document-list ik-padding-bottom-20'>
<Col span='16' className='ik-text-center'>
{if !(props.hasPermission) {
<div>
<svg className='file-color'>
<use xlinkHref={props.icons.document}/>
</svg>
</div>
<p className='ik-title-font ik-margin-top-20 ik-title-color'> 亲,你没有权限操作此功能哦</p>
} else {
<div>
<p className='ik-title-font ik-margin-top-20 ik-title-color'>
还没有单据哦,快去新增吧
</p>
</div>
}}
</Col>
</Row>
}
}
}
{outlet}
</Col>
</Row>
</Row>)
......
......@@ -33,6 +33,6 @@ export default function createRoutes(store) {
importModules.catch(errorLoading);
},
}
},
];
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment