Commit c2fd8974 authored by fanxuehui's avatar fanxuehui

feat: init

parents
Pipeline #272791 failed with stages
in 0 seconds
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
npm-debug.log
node_modules/
.idea/
.DS_Store
.vscode
registry = http://r.cnpmjs.org/
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"trailingComma": "none",
"jsxSingleQuote": false,
"singleQuote": true,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"requirePragma": false,
"insertPragma": false,
"endOfLine": "auto",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css"
}
# node
# Version v10.8
FROM harbor.dui88.com/library/node10:cat
MAINTAINER op@duiba.com.cn
ARG appname
ARG NODE_ENV
RUN echo "export LANG=en_US.UTF-8" && echo "Asia/Shanghai" > /etc/timezone
ENV LANG='en_US.UTF-8'
RUN mkdir /root/duiba-deploy/
ADD ./duiba-deploy /root/duiba-deploy/
WORKDIR /root/duiba-deploy/server/
#define entry point which will be run first when the container starts up
ENTRYPOINT node server.js
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": [
"last 2 versions",
"Firefox ESR",
"> 1%",
"ie >= 9",
"iOS >= 8",
"Android >= 4"
]
}
}
],
"@babel/preset-react"
],
"plugins": [
"react-hot-loader/babel",
"@babel/plugin-transform-runtime",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", {
"loose": true
}],
"@babel/plugin-proposal-json-strings",
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions"
],
"comments": false,
"compact": false
}
const NODE_ENV = process.env.NODE_ENV;
const isLocal = NODE_ENV === 'local' || NODE_ENV === undefined;
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: ['standard'],
// required to lint *.jsx files
plugins: ['react'],
// add your custom rules here
rules: {
'no-debugger': isLocal ? 0 : 2,
'no-new': 0,
'space-before-function-paren': [2, 'never'],
'react/no-multi-comp': 2,
'react/prefer-es6-class': 2,
'react/jsx-pascal-case': 2,
'react/jsx-closing-bracket-location': 2,
'react/jsx-closing-tag-location': 2,
'jsx-quotes': 2,
'no-multi-spaces': 2,
'react/jsx-tag-spacing': 2,
'react/jsx-curly-spacing': 2,
'react/jsx-boolean-value': 2,
'react/self-closing-comp': 2,
'react/jsx-closing-bracket-location': 2,
'react/jsx-no-bind': 2,
'react/require-render-return': 2,
'react/sort-comp': 2,
'react/no-is-mounted': 2,
'react/jsx-uses-vars': 2,
'react/jsx-no-bind': 'off',
'react/jsx-uses-react': 2,
'react/jsx-wrap-multilines': [
2,
{
declaration: 'parens-new-line',
assignment: 'parens-new-line',
return: 'parens-new-line',
arrow: 'parens-new-line',
condition: 'parens-new-line',
logical: 'parens-new-line',
prop: 'parens-new-line'
}
]
},
globals: {
$: true
},
settings: {
react: {
createClass: 'createReactClass', // Regex for Component Factory to use,
// default to "createReactClass"
pragma: 'React', // Pragma to use, default to "React"
version: 'detect', // React version. "detect" automatically picks the version you have installed.
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
// default to latest and warns if missing
// It will default to "detect" in the future
flowVersion: '0.53' // Flow version
}
}
};
# System
.DS_Store
# IDEA
.vscode
.idea
# packages
node_modules
bower_components
# build
dist
# tmp
uploads
# logs
logs
*.log
npm-debug.log
yarn-error.log
yarn-debug.log
## 项目简介
Webpack + React + Mobx + Antd
## 项目结构
<pre>
.
├── client /* 客户端代码 */
│ ├── build /* 构建脚本 */
│ │ ├── build.js // 生产环境打包入口
│ │ ├── config.js // 构建脚本配置
│ │ ├── entry.js // 构建入口配置
│ │ ├── utils.js // 构建通用工具库
│ │ ├── webpack.base.conf.js // 构建脚本基础层
│ │ ├── webpack.dev.conf.js // 构建脚本 - 开发环境
│ │ └── webpack.prod.conf.js // 构建脚本 - 生产环境
│ ├── html /* 入口HTML */
│ │ └── index.html /* 首页HTML */
│ ├── mock /* mock数据 */
│ │ ├── ...
│ │ └── upload // 本地模拟文件上传
│ ├── routes /* 本地开发服务路由 */
│ │ ├── mock.js // mock数据路由
│ │ └── proxy.js // 代理路由
│ ├── server-dev.js // 本地开发服务
│ └── src /* 业务代码 */
│ ├── components /* 通用组件 */
│ ├── containers /* 页面代码 */
│ ├── lib /* 工具库 */
│ ├── routes /* React路由 */
│ ├── stores /* Mobx Stores */
│ ├── styles /* 全局样式 */
│ ├── index.jsx /* 应用入口 */
│ └── App.jsx /* 应用主框架 */
├── server /* 服务端代码 */
│ ├── config /* 主要配置 */
│ │ └── index.js
│ ├── middleware /* Koa中间件 */
│ │ ├── logger.js // 日志中间件
│ │ └── x-respone-time.js // 统计接口响应时间
│ ├── routes /* Koa路由 */
│ │ ├── index.js // 主入口
│ │ ├── html-routes.js // HTML路由
│ │ └── interface-routes.js // 接口路由
│ └── static /* 一些与业务代码无关的纯静态文件,如favicon.ico, robots.txt */
│ └── favicon.ico // 网站小图标
├── jsconfig.json
├── package.json
├── postcss.config.js
├── server.js // 服务端入口
├── Dockerfile
└── README.md
</pre>
## 开发事项
> 认真看完上面项目结构列出的每一个文件夹及文件
- 服务端相关
1. 目前 Nginx 网关匹配.html 结尾的请求才会指向前端服务器,其他都指向后端服务器
2. 根目录 server.js 为 Dockerfile 启动入口
3. server/static 放一些与业务无关的文件,例如,favicon.ico, robots.txt
- 客户端相关
1. 在 src/styles/antd.less 中使用 less 变量修改默认样式,而不是直接用 css 覆盖
2. 全站使用 cssMoudle 语法,如果是公共样式,可使用:global{}进行全局申明,已默认排除 node_moduls 和 antd,如有特殊需要,可修改 webpack 配置
3. 尽可能多使用 mobx,特别是跨组件调用和复杂的页面
4. 页面目录结构,routes 定义结构均和左侧导航结构保持一致
5. 公共 store 数据可放顶层,页面 store 放在页面文件夹即可
6. 文件夹及文件名均以中划线命名
## 开发调试
```bash
npm run dev
```
## 打包生产
```bash
npm run build
```
> 一般用不着,线上部署打包报错可排查问题
## Mock 数据
以 client/mock/为根路径,请求路径和本地 Json 文件路径一致即可, 不区分 get、post,支持 JS,JSON,优先查找 JS
一般来说,POST 请求返回值是一样的,所以 Post 请求返回默认值,无需新建 json 文件,有特殊数据返回需求也可以创建 JSON 数据
 例如:
/a/b --> /mock/a/b.json
/c/d --> /mock/c/d.json
本地支持文件模拟上传,接口为/upload/index
## 联调代理
```bash
proxy=192.168.1.100:8000 npm run dev
```
启动命名带上参数 proxy=xxx,xxx 就是将要联调的后端服务地址
@import '~antd/dist/antd.less';
// @import '~antd/lib/style/index.less';
@import './theme.less';
@import './layout.less';
\ No newline at end of file
@import '~assets/styles/mixins.less';
@import './theme.less';
body,.ant-layout,.jimu-tools, .ant-layout-footer {
background-color: #EAEEF4;
}
.layout {
.ant-layout-header {
background-color: #fff;
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 99;
}
.ant-layout-content{
min-height: 100%;
}
.ant-layout-footer{
margin-top: -70px;
}
.logo {
font-size: 24px;
height: 100%;
color: @primary-color;
margin-right: 60px;
float: left;
cursor: pointer;
span{
color: #333;
}
}
.user {
float: right;
.headimg {
display: inline-block;
vertical-align: top;
}
.logOut {
position: relative;
display: inline-block;
margin: 16px 0 16px 0;
.size(30, 30);
border-radius: 50%;
i {
.middle();
}
}
}
}
.jimu-tools {
padding-top: 20px;
height: 80px;
}
.jimu-bars {
float: right;
button {
margin-left: 8px;
}
}
.jimu-container {
padding: 10px;
background-color: #fff;
box-shadow: 0 0 10px #eee;
overflow-y: scroll;
}
.ant-pagination{
.ant-pagination-total-text{
// float: left;
}
}
\ No newline at end of file
//设置宽高
.size(@width: 1, @height: 1) {
width: @width*1px;
height: @height*1px;
}
//设置背景图片
.bgi(@src) {
background-image: url(@src);
background-repeat: no-repeat;
background-size: contain;
}
//设置段落
.text(@fontsize, @height: @fontsize, @lineheight: @height) {
font-size: @fontsize*1px;
height: @height*1px;
line-height: @lineheight*1px;
}
//清除浮动
.clearfix {
&::after {
content: "";
display: table;
clear: both;
}
}
//垂直水平居中
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
//水平居中
.center{
margin-left: auto;
margin-right: auto;
}
//绝对定位
.pos(@left:1,@top:1){
position: absolute;
left: @left*1px;
top: @top*1px;
}
.posr(@right:1,@top:1){
position: absolute;
top: @top*1px;
right: @right*1px;
}
.gray {
filter: grayscale(100%);
filter: gray;
}
.tooltip {
@width: 300;
@height: 80;
@border: 2;
@borderSize: 10;
display: inline-block;
.size(@width,@height);
background: #fffae1;
border: @border*1px solid #8b572a;
border-radius: 10px;
.text(30,@height);
color: #8b572a;
text-align: center;
position: absolute;
&:after,
&:before {
content: " ";
.size(0,0);
}
&:after {
position: absolute;
top: (@height - 2*@border)*1px;
left: (@width - @borderSize*2)/2*1px;
display: inline-block;
border: solid @borderSize*1px;
border-color: #fffae1 transparent transparent transparent;
z-index: 2;
}
&:before {
position: absolute;
top: (@height - 1.5*@border)*1px;
left: (@width - @borderSize*2 - @border*2)/2*1px;
display: inline-block;
border: solid (@borderSize+@border)*1px;
border-color: #8b572a transparent transparent transparent;
z-index: 1;
}
}
//h5容器
.container{
width: 750px;
.center;
}
\ No newline at end of file
@blue-6: #2D9AFF;
@red-6: #DC2324;
@green-6: #7ED321;
@gold-6: #FF8200;
@primary-color : @blue-6;
@info-color : @blue-6;
@success-color : @green-6;
@processing-color : @blue-6;
@error-color : @red-6;
@highlight-color : @red-6;
@warning-color : @gold-6;
@normal-color : #eaeaea;
const chalk = require('chalk')
const webpack = require('webpack')
const TuiaAutoUpload = require('tuia-auto-upload')
const config = require('./config')
const webpackConfig = require('./webpack.prod.conf')
const pkg = require('../../package.json')
webpack(webpackConfig, function(err, stats) {
if (err) throw err
process.stdout.write(
stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n'
)
console.log(chalk.cyan(' Build complete.\n'));
(async() => {
const uploader = new TuiaAutoUpload({
dir: config.path,
originDir: `/tuia/${pkg.name}/dist/`
})
await uploader.start()
})()
})
const path = require('path')
const pkg = require('../../package.json')
module.exports = {
path: path.join(process.cwd(), '/dist/assets/'),
build: {
publicPath: `//yun.tuia.cn/tuia/${pkg.name}/dist/`,
sourceMap: false,
cssSourceMap: false
},
dev: {
publicPath: '/dist/',
sourceMap: true,
cssSourceMap: true
}
}
module.exports = [
{
name: 'basics',
path: '../src/containers/basics/index.js',
template: '../src/containers/basics/index.html'
},
{
name: 'layers',
path: '../src/containers/layers/index.js',
template: '../src/containers/layers/index.html'
}
]
/*
* @Author: 周成
* @Date: 2018-01-16 15:51:14
* @Last Modified by: 周成
* @Last Modified time: 2019-01-04 12:14:10
*/
const path = require('path')
const net = require('net')
const entry = require('./entry')
exports.computeEntry = function() {
let result = {}
for (let i = 0; i < entry.length; i++) {
const item = entry[i]
const name = item.name
result[name] = [path.join(__dirname, item.path)]
}
return result
}
exports.computeTemplate = function(options) {
let result = []
for (let i = 0; i < entry.length; i++) {
const item = entry[i]
let params = {
name: item.name,
filename: path.join(process.cwd(), '/dist/html/', `${item.name}.html`),
template: `html-loader?attrs[]=img:src&attrs[]=img:data-src!${path.join(
__dirname,
item.template
)}`,
favicon: path.join(__dirname, '../../server/static/favicon.ico'),
alwaysWriteToDisk: true
}
if (options.minify) {
params.minify = {
collapseWhitespace: true,
minifyJS: true,
minifyCSS: true,
removeComments: true
}
}
result.push(params)
}
return result
}
// 自动生成可用端口号
function getAvailablePort(port, cb) {
const server = net.createServer().listen(port)
server.on('listening', () => {
server.close()
cb(null, port)
})
server.on('error', err => {
if (err.code === 'EADDRINUSE') {
getAvailablePort(port + 1, cb)
} else {
cb(err)
}
})
}
exports.getAvailablePort = getAvailablePort
const path = require('path');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const utils = require('./utils');
module.exports = {
entry: utils.computeEntry(),
resolve: {
extensions: ['.js', '.jsx'],
alias: {
libs: path.join(__dirname, '../src/libs/'),
basics: path.join(__dirname, '../src/containers/basics/'),
components: path.join(__dirname, '../src/components/'),
render: path.join(__dirname, '../client/pages/pro/render/'),
root: path.join(__dirname, '../'),
layers: path.join(__dirname, '../src/containers/layers/'),
layersWp: path.join(__dirname, '../src/containers/layers/containers/workplace'),
assets: path.join(__dirname, '../assets/')
}
},
module: {
rules: [
{
test: /\.js[x]?$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
cacheDirectory: true
}
},
{
test: /\.(svg|png|jpg|gif|ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
loader: 'url-loader',
options: {
limit: 2 * 1024
}
}
]
},
node: {
fs: 'empty'
},
plugins: [new CaseSensitivePathsPlugin()]
};
const webpack = require('webpack')
const merge = require('webpack-merge')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin')
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin')
const utils = require('./utils')
const config = require('./config')
const webpackBaseConfig = require('./webpack.base.conf')
Object.keys(webpackBaseConfig.entry).forEach(function(name) {
webpackBaseConfig.entry[name] = webpackBaseConfig.entry[name].concat(
'webpack-hot-middleware/client?reload=true'
)
})
const { sourceMap, cssSourceMap } = config.dev
module.exports = merge(webpackBaseConfig, {
output: {
path: config.path,
filename: '[name].js',
publicPath: config.dev.publicPath,
chunkFilename: '[name].js'
},
mode: 'development',
devtool: sourceMap ? '#eval-source-map' : false,
module: {
rules: [
{
test: /\.less$/,
exclude: /node_modules|antd/,
use: [
{
loader: 'style-loader',
options: {
sourceMap: cssSourceMap
}
},
{
loader: 'css-loader',
options: {
sourceMap: cssSourceMap,
modules: true,
localIdentName: '[local]_[hash:base64:5]'
}
},
{
loader: 'postcss-loader',
options: {
sourceMap: cssSourceMap
}
},
{
loader: 'less-loader',
options: {
sourceMap: cssSourceMap,
javascriptEnabled: true
}
}
]
},
{
test: /(\.less|\.css)$/,
include: /node_modules|antd/,
use: [
{
loader: 'style-loader',
options: {
sourceMap: cssSourceMap
}
},
{
loader: 'css-loader',
options: {
sourceMap: cssSourceMap
}
},
{
loader: 'less-loader',
options: {
sourceMap: cssSourceMap,
javascriptEnabled: true
}
}
]
}
]
},
plugins: [
new FriendlyErrorsWebpackPlugin(),
new webpack.HotModuleReplacementPlugin(),
...utils
.computeTemplate({
minify: false
})
.map(el => {
return new HtmlWebpackPlugin(el)
}),
new HtmlWebpackHarddiskPlugin()
]
})
const webpack = require('webpack')
const merge = require('webpack-merge')
const TerserWebpackPlugin = require('terser-webpack-plugin')
const ProgressBarPlugin = require('progress-bar-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin')
const chalk = require('chalk')
const utils = require('./utils')
const config = require('./config')
const webpackBaseConfig = require('./webpack.base.conf')
const { sourceMap, cssSourceMap } = config.build
module.exports = merge(webpackBaseConfig, {
output: {
path: config.path,
filename: '[name].[chunkhash].js',
publicPath: config.build.publicPath,
chunkFilename: '[chunkhash].js'
},
mode: 'production',
devtool: sourceMap ? '#source-map' : false,
module: {
rules: [
{
test: /\.less$/,
exclude: /node_modules|antd/,
use: [
{
loader: MiniCssExtractPlugin.loader
},
{
loader: 'css-loader',
options: {
modules: true,
localIdentName: '[local]_[hash:base64:5]',
sourceMap: cssSourceMap
}
},
{
loader: 'postcss-loader',
options: {
sourceMap: cssSourceMap
}
},
{
loader: 'less-loader',
options: {
javascriptEnabled: true,
sourceMap: cssSourceMap
}
}
]
},
{
test: /(\.less|\.css)$/,
include: /node_modules|antd/,
use: [
{
loader: MiniCssExtractPlugin.loader
},
{
loader: 'css-loader',
options: {
sourceMap: cssSourceMap
}
},
{
loader: 'less-loader',
options: {
javascriptEnabled: true,
sourceMap: cssSourceMap
}
}
]
}
]
},
optimization: {
minimizer: [
new TerserWebpackPlugin({
terserOptions: {
compress: {
drop_console: true
}
},
cache: true,
parallel: true,
sourceMap
})
],
splitChunks: {
chunks: 'all',
automaticNameDelimiter: '-',
cacheGroups: {
styles: {
name: 'styles',
test: /\.(css|less)$/,
chunks: 'all',
enforce: true
}
}
}
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.HashedModuleIdsPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
new ProgressBarPlugin({
format: chalk.yellow('打包中 [:bar] :current/:total :percent :elapseds :msg'),
complete: '●',
incomplete: '○',
width: 20
}),
new MiniCssExtractPlugin({
filename: '[name].[contenthash].css'
}),
new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
}
}),
new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /zh-cn/),
...utils
.computeTemplate({
minify: true
})
.map(el => {
return new HtmlWebpackPlugin(el)
}),
new HtmlWebpackHarddiskPlugin()
]
})
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>推啊管理平台</title>
</head>
<body>
<div id="app"></div>
<!--[if lte IE 9]>
<img
style="width:600px; display:block; margin:250px auto 0;"
src="http://yun.duiba.com.cn/tuia/myimg/support.png"
alt="推荐使用Chrome最新版,火狐最新版来使用本网站,谢谢。"
/>
<script type="text/javascript">
document.getElementById('app').className = 'hide';
</script>
<![endif]-->
</body>
</html>
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"src": ["./src"]
},
"jsx": "react",
"experimentalDecorators": true
},
"exclude": ["node_modules"]
}
braft-editor in ./src/containers/layers/components/rich-editor/index.js
* braft-editor/dist/index.css in ./src/containers/layers/components/rich-editor/index.js
* braft-extensions/dist/color-picker in ./src/containers/layers/components/rich-editor/index.js
* braft-extensions/dist/color-picker.css in ./src/containers/layers/components/rich-editor/index.js
* codemirror/lib/codemirror.css in ./src/containers/layers/containers/workplace/parts/body/scene/code.jsx, ./src/containers/layers/containers/workplace/widgets/code/codeEditor.jsx and 1 other
* components/preview-h5 in ./src/containers/layers/containers/home/body/list-mode.jsx, ./src/containers/layers/containers/template-board/body/card.jsx and 1 other
* echarts-for-react/lib/core in ./src/containers/layers/containers/statistic/data-preview/bi/pv-chart.jsx
* echarts/lib/chart/line in ./src/containers/layers/containers/statistic/data-preview/bi/pv-chart.jsx
* echarts/lib/component/title in ./src/containers/layers/containers/statistic/data-preview/bi/pv-chart.jsx
* echarts/lib/component/tooltip in ./src/containers/layers/containers/statistic/data-preview/bi/pv-chart.jsx
* echarts/lib/echarts in ./src/containers/layers/containers/statistic/data-preview/bi/pv-chart.jsx
* immutability-helper in ./src/containers/layers/containers/statistic/data-preview/bi/index.jsx, ./src/containers/layers/containers/statistic/data-preview/bi/pv-table.jsx and 1 other
* loadjs in ./src/containers/layers/components/react-swiper/index.jsx
* lodash-es in ./src/containers/layers/containers/home/body/list-mode.jsx, ./src/containers/layers/containers/workplace/constructors/widget/index.jsx and 10 others
* nanoid in ./src/containers/layers/containers/statistic/data-preview/bi/pv-table.jsx, ./src/containers/layers/containers/statistic/data-preview/form/index.jsx
* pubsub-js in ./src/containers/layers/containers/statistic/data-preview/index.jsx, ./src/containers/layers/containers/statistic/data-preview/bi/extra-content.jsx and 4 others
* qrcode.react in ./src/containers/layers/containers/statistic/page-preview/index.jsx
* react-codemirror in ./src/containers/layers/containers/workplace/parts/body/scene/code.jsx, ./src/containers/layers/containers/workplace/widgets/code/codeEditor.jsx
* react-color in ./src/containers/layers/components/color-picker/index.jsx
* react-copy-to-clipboard in ./src/containers/layers/containers/statistic/data-preview/form/index.jsx
* react-dnd in ./src/containers/layers/containers/workplace/constructors/item/index.jsx, ./src/containers/layers/containers/workplace/parts/body/scene/inner.jsx and 2 others
* react-dnd-html5-backend in ./src/containers/layers/containers/workplace/utils/drag.jsx
* reactcss in ./src/containers/layers/containers/workplace/features/guide/steppable/perspector.jsx, ./src/containers/layers/containers/workplace/features/guide/steppable/intro.jsx and 2 others
{
"code": "0000000",
"desc": "成功",
"data": {
"email": false
},
"success": true
}
{
"code": "0000000",
"desc": "成功",
"data": {
"id": 5624,
"title": "华夏家博会",
"html": {
"version": "1.0.0",
"page": {
"name": "ds",
"title": "sd",
"backgroundColor": "#fff",
"backgroundImage": "",
"backgroundSize": "100% auto",
"backgroundRepeat": "no-repeat",
"width": "375px",
"height": "734px",
"dpr": 2,
"autoJump": {
"enable": 0,
"delay": 1,
"type": "link",
"android": "",
"ios": "",
"isCoversion": 0
},
"report": { "enable": 1, "url": "sd" }
},
"elements": [
{
"type": "button",
"style": {
"width": "240px",
"height": "38px",
"zIndex": 20,
"top": "315px",
"left": "67px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "4px",
"borderBottomRightRadius": "4px",
"borderTopLeftRadius": "4px",
"borderTopRightRadius": "4px",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent",
"backgroundColor": "#EA5422",
"color": "#fff",
"fontSize": "16px",
"textAlign": "center",
"whiteSpace": "nowrap",
"backgroundImage": "",
"backgroundPosition": "center",
"backgroundSize": "100% 100%"
},
"styleMode": 0,
"animation": { "duration": 0 },
"multiStyle": { "click": { "backgroundImage": "" } },
"name": "按钮1",
"fixed": 0,
"picValid": 0,
"text": "立即领取",
"jump": {
"type": "link",
"android": "sd",
"ios": "",
"popupId": "",
"isCoversion": 1,
"disableType": 1
},
"id": "6239e7cc"
}
]
},
"link": null,
"webPageName": null,
"landType": 2,
"autoDownload": 0,
"autoDownloadTime": null,
"downloadAndriod": null,
"downloadIos": null,
"autoDownloadType": 0,
"wxJump": 0
},
"success": true
}
{
"code": "0000000",
"desc": "成功",
"data": {},
"success": true
}
{
"success": true,
"nowVersion": 1522031458229,
"authList": [
"gameManager",
"gameManager/gameList",
"gameHallManager",
"gameHallManager/gameHallList"
],
"version": 1522031458229
}
{
"code": "0",
"desc": "success",
"data": {
"total": 30,
"list": [
{
"id": 1,
"name": "测试",
"note": "测试哈哈哈",
"skinId": 2,
"skinName": "皮肤名称哈哈哈",
"goldBudget": 2000,
"circulationBalance": 3000,
"exchangeOutflowBalance": 4000
},
{
"id": 1,
"name": "测试",
"note": "测试哈哈哈",
"skinId": 2,
"skinName": "皮肤名称哈哈哈",
"goldBudget": 2000,
"circulationBalance": 3000,
"exchangeOutflowBalance": 4000
},
{
"id": 1,
"name": "测试",
"note": "测试哈哈哈",
"skinId": 2,
"skinName": "皮肤名称哈哈哈",
"goldBudget": 2000,
"circulationBalance": 3000,
"exchangeOutflowBalance": 4000
},
{
"id": 1,
"name": "测试",
"note": "测试哈哈哈",
"skinId": 2,
"skinName": "皮肤名称哈哈哈",
"goldBudget": 2000,
"circulationBalance": 3000,
"exchangeOutflowBalance": 4000
},
{
"id": 1,
"name": "测试",
"note": "测试哈哈哈",
"skinId": 2,
"skinName": "皮肤名称哈哈哈",
"goldBudget": 2000,
"circulationBalance": 3000,
"exchangeOutflowBalance": 4000
},
{
"id": 1,
"name": "测试",
"note": "测试哈哈哈",
"skinId": 2,
"skinName": "皮肤名称哈哈哈",
"goldBudget": 2000,
"circulationBalance": 3000,
"exchangeOutflowBalance": 4000
},
{
"id": 1,
"name": "测试",
"note": "测试哈哈哈",
"skinId": 2,
"skinName": "皮肤名称哈哈哈",
"goldBudget": 2000,
"circulationBalance": 3000,
"exchangeOutflowBalance": 4000
},
{
"id": 1,
"name": "测试",
"note": "测试哈哈哈",
"skinId": 2,
"skinName": "皮肤名称哈哈哈",
"goldBudget": 2000,
"circulationBalance": 3000,
"exchangeOutflowBalance": 4000
},
{
"id": 1,
"name": "测试",
"note": "测试哈哈哈",
"skinId": 2,
"skinName": "皮肤名称哈哈哈",
"goldBudget": 2000,
"circulationBalance": 3000,
"exchangeOutflowBalance": 4000
},
{
"id": 1,
"name": "测试",
"note": "测试哈哈哈",
"skinId": 2,
"skinName": "皮肤名称哈哈哈",
"goldBudget": 2000,
"circulationBalance": 3000,
"exchangeOutflowBalance": 4000
}
]
}
}
{
"code": "0",
"desc": "success",
"data": {
"total": 30,
"list": [
{
"id": 1,
"name": "捕鱼哈哈哈",
"type": "捕鱼",
"note": "快快捕鱼"
},
{
"id": 1,
"name": "捕鱼哈哈哈",
"type": "捕鱼",
"note": "快快捕鱼"
},
{
"id": 1,
"name": "捕鱼哈哈哈",
"type": "捕鱼",
"note": "快快捕鱼"
},
{
"id": 1,
"name": "捕鱼哈哈哈",
"type": "捕鱼",
"note": "快快捕鱼"
},
{
"id": 1,
"name": "捕鱼哈哈哈",
"type": "捕鱼",
"note": "快快捕鱼"
},
{
"id": 1,
"name": "捕鱼哈哈哈",
"type": "捕鱼",
"note": "快快捕鱼"
},
{
"id": 1,
"name": "捕鱼哈哈哈",
"type": "捕鱼",
"note": "快快捕鱼"
},
{
"id": 1,
"name": "捕鱼哈哈哈",
"type": "捕鱼",
"note": "快快捕鱼"
},
{
"id": 1,
"name": "捕鱼哈哈哈",
"type": "捕鱼",
"note": "快快捕鱼"
},
{
"id": 1,
"name": "捕鱼哈哈哈",
"type": "捕鱼",
"note": "快快捕鱼"
}
]
}
}
{
"code": "0",
"desc": "成功",
"data": {
"total": 30,
"list": [
{
"id": 263,
"fundBodyId": 782,
"fundBodyType": 0,
"changeAmount": 153016,
"changeType": 0,
"changeMsg": "预设(徐恒飞)",
"flowAmount": 153016,
"totalAmount": 153016,
"changeAmountRmb": 124.0,
"flowAmountRmb": 124.0,
"totalAmountRmb": 124.0,
"gmtCreate": "2018-07-04 18:06:22",
"operator": "徐恒飞"
},
{
"id": 263,
"fundBodyId": 782,
"fundBodyType": 0,
"changeAmount": 153016,
"changeType": 0,
"changeMsg": "预设(徐恒飞)",
"flowAmount": 153016,
"totalAmount": 153016,
"changeAmountRmb": 124.0,
"flowAmountRmb": 124.0,
"totalAmountRmb": 124.0,
"gmtCreate": "2018-07-04 18:06:22",
"operator": "徐恒飞"
},
{
"id": 263,
"fundBodyId": 782,
"fundBodyType": 0,
"changeAmount": 153016,
"changeType": 0,
"changeMsg": "预设(徐恒飞)",
"flowAmount": 153016,
"totalAmount": 153016,
"changeAmountRmb": 124.0,
"flowAmountRmb": 124.0,
"totalAmountRmb": 124.0,
"gmtCreate": "2018-07-04 18:06:22",
"operator": "徐恒飞"
},
{
"id": 263,
"fundBodyId": 782,
"fundBodyType": 0,
"changeAmount": 153016,
"changeType": 0,
"changeMsg": "预设(徐恒飞)",
"flowAmount": 153016,
"totalAmount": 153016,
"changeAmountRmb": 124.0,
"flowAmountRmb": 124.0,
"totalAmountRmb": 124.0,
"gmtCreate": "2018-07-04 18:06:22",
"operator": "徐恒飞"
},
{
"id": 263,
"fundBodyId": 782,
"fundBodyType": 0,
"changeAmount": 153016,
"changeType": 0,
"changeMsg": "预设(徐恒飞)",
"flowAmount": 153016,
"totalAmount": 153016,
"changeAmountRmb": 124.0,
"flowAmountRmb": 124.0,
"totalAmountRmb": 124.0,
"gmtCreate": "2018-07-04 18:06:22",
"operator": "徐恒飞"
},
{
"id": 263,
"fundBodyId": 782,
"fundBodyType": 0,
"changeAmount": 153016,
"changeType": 0,
"changeMsg": "预设(徐恒飞)",
"flowAmount": 153016,
"totalAmount": 153016,
"changeAmountRmb": 124.0,
"flowAmountRmb": 124.0,
"totalAmountRmb": 124.0,
"gmtCreate": "2018-07-04 18:06:22",
"operator": "徐恒飞"
},
{
"id": 263,
"fundBodyId": 782,
"fundBodyType": 0,
"changeAmount": 153016,
"changeType": 0,
"changeMsg": "预设(徐恒飞)",
"flowAmount": 153016,
"totalAmount": 153016,
"changeAmountRmb": 124.0,
"flowAmountRmb": 124.0,
"totalAmountRmb": 124.0,
"gmtCreate": "2018-07-04 18:06:22",
"operator": "徐恒飞"
},
{
"id": 263,
"fundBodyId": 782,
"fundBodyType": 0,
"changeAmount": 153016,
"changeType": 0,
"changeMsg": "预设(徐恒飞)",
"flowAmount": 153016,
"totalAmount": 153016,
"changeAmountRmb": 124.0,
"flowAmountRmb": 124.0,
"totalAmountRmb": 124.0,
"gmtCreate": "2018-07-04 18:06:22",
"operator": "徐恒飞"
},
{
"id": 263,
"fundBodyId": 782,
"fundBodyType": 0,
"changeAmount": 153016,
"changeType": 0,
"changeMsg": "预设(徐恒飞)",
"flowAmount": 153016,
"totalAmount": 153016,
"changeAmountRmb": 124.0,
"flowAmountRmb": 124.0,
"totalAmountRmb": 124.0,
"gmtCreate": "2018-07-04 18:06:22",
"operator": "徐恒飞"
},
{
"id": 263,
"fundBodyId": 782,
"fundBodyType": 0,
"changeAmount": 153016,
"changeType": 0,
"changeMsg": "预设(徐恒飞)",
"flowAmount": 153016,
"totalAmount": 153016,
"changeAmountRmb": 124.0,
"flowAmountRmb": 124.0,
"totalAmountRmb": 124.0,
"gmtCreate": "2018-07-04 18:06:22",
"operator": "徐恒飞"
}
]
}
}
{
"code": "0",
"desc": "ok",
"data": [
{
"adminName": "hasd",
"adminId": 123
},
{
"adminName": "hasd3",
"adminId": 125
},
{
"adminName": "hasd2",
"adminId": 127
},
{
"adminName": "haasdsd2",
"adminId": 128
}
]
}
{
"success": true,
"authList": ["/advert/selectAdvertList","layer/template/preview","layer/template/use","layer/template/edit","layer/template/del","layer/preview","layer/edit","layer/copy","layer/del","layer/addPartner","layer/dataView","layer/setTemplate"],
"version": 1565579839409
}
{
"version": "1.0.0",
"page": {
"name": "kxf-test尚都教育-复制",
"title": "kxf-test尚都教育",
"backgroundColor": "#fff",
"backgroundImage": "url(\"//yun.tuisnake.com/jimu-web/93b48be9-curry.png\")",
"backgroundSize": "100% auto",
"backgroundRepeat": "no-repeat",
"width": "375px",
"height": "765px",
"dpr": 2,
"autoJump": {
"enable": 0,
"delay": 1,
"type": "link",
"android": "",
"ios": "",
"isCoversion": 0
}
},
"elements": [
{
"type": "popup",
"style": {
"width": "375px",
"height": "100%",
"zIndex": 200,
"top": "222px",
"left": "15.5px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "0",
"borderBottomRightRadius": "0",
"borderTopLeftRadius": "0",
"borderTopRightRadius": "0",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent"
},
"name": "弹层1",
"image": {
"width": "330px",
"height": "420px",
"url": "//yun.duiba.com.cn/jimu-web/df_popup_widget@1x.png",
"isDefault": true
},
"closeIcon": {
"enable": 1,
"top": "97px",
"right": "26px"
},
"form": {
"enable": 0,
"mobile": 1,
"verify": 0,
"top": "100px"
},
"jump": {
"type": "popup",
"android": "",
"ios": "",
"popupId": "626cd271",
"isCoversion": 1
},
"autoJump": {
"enable": 1,
"delay": 2
},
"elements": [
{
"type": "button",
"style": {
"width": "240px",
"height": "38px",
"zIndex": 20,
"top": "335.5px",
"left": "44.5px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "4px",
"borderBottomRightRadius": "4px",
"borderTopLeftRadius": "4px",
"borderTopRightRadius": "4px",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent",
"backgroundColor": "#EA5422",
"color": "#fff",
"fontSize": "16px",
"textAlign": "center",
"whiteSpace": "nowrap",
"backgroundImage": "",
"backgroundPosition": "center",
"backgroundSize": "100% 100%"
},
"styleMode": 0,
"animation": {
"duration": 0
},
"multiStyle": {
"click": {
"backgroundImage": ""
}
},
"name": "按钮1",
"fixed": 0,
"picValid": 0,
"text": "立即领取",
"jump": {
"type": "link",
"android": "",
"ios": "",
"popupId": "",
"isCoversion": 1,
"disableType": 1
},
"id": "66287e99",
"originalStyle": {
"width": "240px",
"height": "38px",
"zIndex": 20,
"top": "459px",
"left": "67px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "4px",
"borderBottomRightRadius": "4px",
"borderTopLeftRadius": "4px",
"borderTopRightRadius": "4px",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent",
"backgroundColor": "#EA5422",
"color": "#fff",
"fontSize": "16px",
"textAlign": "center",
"whiteSpace": "nowrap",
"backgroundImage": "",
"backgroundPosition": "center",
"backgroundSize": "100% 100%"
}
}
],
"id": "c9175100",
"elementsLength": 1
},
{
"type": "popup",
"style": {
"width": "375px",
"height": "100%",
"zIndex": 200,
"top": "254px",
"left": "-27.5px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "0",
"borderBottomRightRadius": "0",
"borderTopLeftRadius": "0",
"borderTopRightRadius": "0",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent"
},
"name": "弹层2",
"image": {
"width": "330px",
"height": "420px",
"url": "//yun.duiba.com.cn/jimu-web/df_popup_widget@1x.png",
"isDefault": true
},
"closeIcon": {
"enable": 1,
"top": "97px",
"right": "26px"
},
"form": {
"enable": 0,
"mobile": 1,
"verify": 0,
"top": "100px"
},
"jump": {
"type": "link",
"android": "",
"ios": "",
"popupId": "",
"isCoversion": 1
},
"elements": [
{
"type": "image",
"style": {
"width": "197px",
"height": "194px",
"zIndex": 20,
"top": "62.5px",
"left": "66.5px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "0",
"borderBottomRightRadius": "0",
"borderTopLeftRadius": "0",
"borderTopRightRadius": "0",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent",
"backgroundImage": "url(\"//yun.tuisnake.com/jimu-web/a802b987-20160912211252_vUHtw.jpeg\")",
"backgroundPosition": "center",
"backgroundSize": "100% 100%"
},
"name": "图片1",
"jump": {
"type": "none",
"android": "",
"ios": "",
"popupId": "",
"isCoversion": 1
},
"fixed": 0,
"id": "45a4103e",
"originalStyle": {
"width": "197px",
"height": "194px",
"zIndex": 20,
"top": "186px",
"left": "89px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "0",
"borderBottomRightRadius": "0",
"borderTopLeftRadius": "0",
"borderTopRightRadius": "0",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent",
"backgroundImage": "url(\"//yun.tuisnake.com/jimu-web/a802b987-20160912211252_vUHtw.jpeg\")",
"backgroundPosition": "center",
"backgroundSize": "100% 100%"
}
}
],
"id": "626cd271",
"elementsLength": 1
},
{
"type": "button",
"style": {
"width": "240px",
"height": "38px",
"zIndex": 20,
"top": "446px",
"left": "67px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "4px",
"borderBottomRightRadius": "4px",
"borderTopLeftRadius": "4px",
"borderTopRightRadius": "4px",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent",
"backgroundColor": "#EA5422",
"color": "#fff",
"fontSize": "16px",
"textAlign": "center",
"whiteSpace": "nowrap",
"backgroundImage": "",
"backgroundPosition": "center",
"backgroundSize": "100% 100%"
},
"styleMode": 0,
"animation": {
"duration": 0
},
"multiStyle": {
"click": {
"backgroundImage": ""
}
},
"name": "按钮2",
"fixed": 0,
"picValid": 0,
"text": "立即领取",
"jump": {
"type": "popup",
"android": "",
"ios": "",
"popupId": "c9175100",
"isCoversion": 1,
"disableType": 1
},
"id": "7e9b491e"
}
]
}
\ No newline at end of file
{
"code": "0",
"desc": "ok",
"data": [
{
"adminName": "hasd",
"adminId": 123
},
{
"adminName": "hasd3",
"adminId": 125
}
]
}
{
"code": "0",
"desc": "ok",
"data": [
{
"adminName": "hasd",
"adminId": 123
},
{
"adminName": "hasd3",
"adminId": 125
}
]
}
\ No newline at end of file
{
"code": "0",
"desc": "ok",
"data": {
"id": null,
"createrName": "康旭峰",
"title": "kxf-test尚都教育",
"html": "{\"version\":\"1.0.0\",\"page\":{\"name\":\"组件样式测试\",\"title\":\"组件样式测试\",\"backgroundColor\":\"#fff\",\"backgroundImage\":\"\",\"backgroundSize\":\"100% auto\",\"backgroundRepeat\":\"no-repeat\",\"width\":\"375px\",\"height\":\"734px\",\"dpr\":2,\"autoJump\":{\"enable\":0,\"delay\":1,\"type\":\"link\",\"android\":\"\",\"ios\":\"\",\"isCoversion\":0},\"report\":{\"enable\":0,\"url\":\"\"}},\"elements\":[{\"type\":\"text\",\"style\":{\"width\":\"175px\",\"height\":\"62px\",\"zIndex\":20,\"top\":\"301px\",\"left\":\"10px\",\"opacity\":1,\"transform\":\"rotate(0deg)\",\"borderBottomLeftRadius\":\"0\",\"borderBottomRightRadius\":\"0\",\"borderTopLeftRadius\":\"0\",\"borderTopRightRadius\":\"0\",\"borderStyle\":\"solid\",\"borderWidth\":\"0px\",\"borderColor\":\"transparent\",\"backgroundColor\":\"rgba(255,255,255,0)\",\"fontSize\":\"14px\",\"lineHeight\":\"21px\",\"letterSpacing\":\"2px\",\"color\":\"#333\",\"textAlign\":\"left\",\"overflow\":\"hidden\"},\"name\":\"文字1\",\"text\":\"左侧富文本编辑\",\"fixed\":0,\"jump\":{\"type\":\"none\",\"android\":\"\",\"ios\":\"\",\"popupId\":\"\",\"isCoversion\":0},\"id\":\"c5124da5\"},{\"type\":\"countdown\",\"style\":{\"width\":\"131px\",\"height\":\"74px\",\"zIndex\":20,\"top\":\"295px\",\"left\":\"244px\",\"opacity\":1,\"transform\":\"rotate(0deg)\",\"borderBottomLeftRadius\":\"0\",\"borderBottomRightRadius\":\"0\",\"borderTopLeftRadius\":\"0\",\"borderTopRightRadius\":\"0\",\"borderStyle\":\"solid\",\"borderWidth\":\"0px\",\"borderColor\":\"transparent\",\"backgroundColor\":\"rgba(245,166,35,1)\",\"fontSize\":\"14px\",\"lineHeight\":\"21px\",\"letterSpacing\":\"2px\",\"color\":\"rgba(65,117,5,1)\",\"textAlign\":\"center\",\"overflow\":\"hidden\",\"fontWeight\":\"bold\",\"fontStyle\":\"normal\",\"textDecoration\":\"unset\",\"verticalAlign\":\"middle\"},\"start\":\"23:09:02\",\"end\":\"00:00:00\",\"name\":\"倒计时1\",\"text\":\"100\",\"id\":\"d76d5545\"}]}",
"link": null,
"name": "fxh_test",
"landType": 2,
"autoDownload": 0,
"autoDownloadTime": null,
"downloadAndriod": null,
"downloadIos": null,
"ifBelongAe": null,
"autoDownloadType": 0,
"thumbnailUrl": null,
"promoteTag": ""
}
}
This diff is collapsed.
{
"code": "0",
"desc": "ok"
}
{
"code": "0",
"desc": "ok",
"data": {
"headers": [
{ "header": "button$2714840c-6038-4fcc-b074-33669e9da779", "desc": "" },
{ "header": "carousel$2d077e55-5119-4799-b5e5-5c6f6ef666d3", "desc": "" },
{ "header": "download$0bc01391-c57e-46de-af1d-7afa9dfa5e4c", "desc": "" },
{ "header": "form$09903eb9-392a-4673-b1b6-fa0f9e4901cb", "desc": "" },
{ "header": "form$957e7173-4500-4c2d-9248-20113a3b5215", "desc": "" },
{ "header": "image$a24b98c9-09cb-4bbc-acae-3038438ab8d6", "desc": "" },
{ "header": "mobile$a3f932b7-186d-40f2-a0be-09923f79b26a", "desc": "" },
{ "header": "page$1234567890", "desc": "" },
{ "header": "popup$6a6168e5-2de3-472a-9c55-c77cee06c650", "desc": "" },
{ "header": "text$68e0a967-16ff-480c-a18a-30adfb2d0766", "desc": "" },
{ "header": "wechat$5900e0c9-f5de-4fb7-8e29-ab586a37aed7", "desc": "" }
],
"dataList": {
"totalCount": 6,
"totalPage": 1,
"list": [
{
"curDate": "2018-12-24",
"visitPv": 1000000,
"visitUv": 9,
"effectPv": 4,
"effectUv": 3,
"buttonStaticDataDtos": [
{
"curDate": "2018-12-24",
"buttonId": "button$2714840c-6038-4fcc-b074-33669e9da779",
"buttonClickPv": 2,
"buttonClickUv": 1
},
{
"curDate": "2018-12-24",
"buttonId": "carousel$2d077e55-5119-4799-b5e5-5c6f6ef666d3",
"buttonClickPv": 2,
"buttonClickUv": 1
},
{
"curDate": "2018-12-24",
"buttonId": "download$0bc01391-c57e-46de-af1d-7afa9dfa5e4c",
"buttonClickPv": 2,
"buttonClickUv": 1
},
{
"curDate": "2018-12-24",
"buttonId": "form$09903eb9-392a-4673-b1b6-fa0f9e4901cb",
"buttonClickPv": 14,
"buttonClickUv": 13
},
{
"curDate": "2018-12-24",
"buttonId": "form$957e7173-4500-4c2d-9248-20113a3b5215",
"buttonClickPv": 4,
"buttonClickUv": 3
},
{
"curDate": "2018-12-24",
"buttonId": "image$a24b98c9-09cb-4bbc-acae-3038438ab8d6",
"buttonClickPv": 2,
"buttonClickUv": 1
},
{
"curDate": "2018-12-24",
"buttonId": "mobile$a3f932b7-186d-40f2-a0be-09923f79b26a",
"buttonClickPv": 2,
"buttonClickUv": 1
},
{
"curDate": "2018-12-24",
"buttonId": "page$1234567890",
"buttonClickPv": 2,
"buttonClickUv": 1
},
{
"curDate": "2018-12-24",
"buttonId": "popup$6a6168e5-2de3-472a-9c55-c77cee06c650",
"buttonClickPv": 2,
"buttonClickUv": 1
},
{
"curDate": "2018-12-24",
"buttonId": "text$68e0a967-16ff-480c-a18a-30adfb2d0766",
"buttonClickPv": 2,
"buttonClickUv": 1
},
{
"curDate": "2018-12-24",
"buttonId": "wechat$5900e0c9-f5de-4fb7-8e29-ab586a37aed7",
"buttonClickPv": 2,
"buttonClickUv": 1
}
]
},
{
"curDate": "2018-12-23",
"visitPv": 110,
"visitUv": 90,
"effectPv": 24,
"effectUv": 13,
"buttonStaticDataDtos": []
},
{
"curDate": "2018-12-22",
"visitPv": 100,
"visitUv": 80,
"effectPv": 24,
"effectUv": 13,
"buttonStaticDataDtos": []
},
{
"curDate": "2018-12-21",
"visitPv": 31,
"visitUv": 19,
"effectPv": 14,
"effectUv": 11,
"buttonStaticDataDtos": []
},
{
"curDate": "2018-12-20",
"visitPv": 30,
"visitUv": 18,
"effectPv": 14,
"effectUv": 11,
"buttonStaticDataDtos": []
},
{
"curDate": "2018-12-19",
"visitPv": 11,
"visitUv": 8,
"effectPv": 4,
"effectUv": 1,
"buttonStaticDataDtos": []
}
]
}
}
}
This diff is collapsed.
This diff is collapsed.
{
"code": "0",
"desc": "成功",
"data": {
"pageSize": "20",
"totalCount": "4100",
"totalPage": "205",
"currentPage": "1",
"offset": "0",
"max": "20",
"list": [
{
"skinName": "弹层名称",
"id": 12,
"skinType": 51,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"ssoName": "fxh",
"tagInfo": [
{
"tagId": 991,
"tagName": "翻牌子"
}
]
},
{
"skinName": "弹层名称",
"id": 11,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"ssoName": "fxh"
}
]
}
}
{
"code": "0",
"desc": "查询弹层皮肤成功",
"data": {
"id": 739,
"skinName": "王鹏飞",
"isDeleted": null,
"tagInfo": [],
"code": {"version":"1.0.0","page":{"name":"kxf-test","backgroundLight":1,"backgroundMask":85,"closePosition":"rightTop","closeAD":"no-repeat","dpr":2,"autoJump":{"enable":0,"delay":1,"type":"link","android":"","ios":"","isCoversion":0}},"layers":[{"name":"主场景","layerId":"0803ab4e-c4cf-4bf7-813f-dd6f26568d46","isMain":true,"autoJump":{"enable":0,"delay":1,"type":"link","android":"","ios":"","isCoversion":0},"elements":[{"type":"spiritAnimation","style":{"width":"93.75px","height":"91.5px","zIndex":20,"top":"104px","left":"81px","opacity":1,"transform":"rotate(0deg)","borderBottomLeftRadius":"0","borderBottomRightRadius":"0","borderTopLeftRadius":"0","borderTopRightRadius":"0","borderStyle":"solid","borderWidth":"0px","borderColor":"transparent","backgroundImage":"url(\"//yun.dui88.com/jimu-web/dff42656-boom_list_half.png\")","backgroundSize":"auto 100% ","backgroundPosition":"0% 0%"},"name":"精灵动画1","jump":{"type":"link","android":"","ios":"","popupId":"","isCoversion":1,"isBilling":1},"fixed":0,"spiritAnimation":{"isLoop":true,"frameNumber":8,"durationPerFrame":0.05,"imageOriginSize":{"width":1500,"height":183},"imageLoaded":true},"id":"f2e08f1b"},{"type":"spiritAnimation","style":{"width":"74.5px","height":"145px","zIndex":20,"top":"164px","left":"210px","opacity":1,"transform":"rotate(0deg)","borderBottomLeftRadius":"0","borderBottomRightRadius":"0","borderTopLeftRadius":"0","borderTopRightRadius":"0","borderStyle":"solid","borderWidth":"0px","borderColor":"transparent","backgroundImage":"url(\"//yun.dui88.com/jimu-web/5fb821d9-fire.png\")","backgroundSize":"auto 100% ","backgroundPosition":"0% 0%"},"name":"精灵动画2","jump":{"type":"link","android":"","ios":"","popupId":"","isCoversion":1,"isBilling":1},"fixed":0,"spiritAnimation":{"isLoop":true,"frameNumber":7,"durationPerFrame":0.1,"imageOriginSize":{"width":1043,"height":290},"imageLoaded":true},"id":"fd70aaa3"}]}]},
"image": "//yun.dui88.com/jimu-web/7cacb6ba-preview.jpg",
"ssoName": null,
"skinType": 51
}
}
{
"code": "0",
"desc": "成功",
"data": {}
}
{
"code": "0",
"desc": "成功",
"data": {
"pageSize": "20",
"totalCount": "4100",
"totalPage": "205",
"currentPage": "1",
"offset": "0",
"max": "20",
"list": [
{
"id": 1,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
},
{
"id": 2,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
},
{
"id": 3,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
},
{
"id": 4,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
},
{
"id": 5,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
},
{
"id": 1,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
},
{
"id": 2,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
},
{
"id": 3,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
},
{
"id": 4,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
},
{
"id": 5,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": "皮肤代码",
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
}
]
}
}
{
"code": "0",
"desc": "成功",
"data": {
"id": 1,
"skinName": "弹层名称",
"skinType": 4,
"isDeleted": 0,
"code": {
"version": "1.0.0",
"page": {
"name": "asda",
"backgroundLight": 1,
"backgroundMask": 70,
"closePosition": "rightTop",
"closeAD": "no-repeat",
"dpr": 2,
"autoJump": {
"enable": 0,
"delay": 1,
"type": "link",
"android": "",
"ios": "",
"isCoversion": 0
}
},
"layers": [
{
"elements": [
{
"type": "button",
"style": {
"width": "240px",
"height": "38px",
"zIndex": 20,
"top": "189px",
"left": "67px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "4px",
"borderBottomRightRadius": "4px",
"borderTopLeftRadius": "4px",
"borderTopRightRadius": "4px",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent",
"backgroundColor": "transparent",
"color": "#fff",
"fontSize": "16px",
"textAlign": "center",
"whiteSpace": "nowrap",
"backgroundImage": "url(\"//yun.dui88.com/jimu-web/5bfce0d91c9d448b647921b8.png\")",
"backgroundPosition": "center",
"backgroundSize": "100% 100%"
},
"styleMode": 3,
"animation": { "duration": 0, "type": "breathe" },
"multiStyle": { "click": { "backgroundImage": "" } },
"name": "按钮1",
"fixed": 0,
"picValid": 0,
"text": "",
"jump": {
"type": "link",
"android": "",
"ios": "",
"popupId": "",
"isCoversion": 1,
"disableType": 1,
"isBilling": 1
},
"id": "f11b1a83"
},
{
"type": "image",
"style": {
"width": "375px",
"height": "280px",
"zIndex": 20,
"top": "300px",
"left": "0px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "0",
"borderBottomRightRadius": "0",
"borderTopLeftRadius": "0",
"borderTopRightRadius": "0",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent",
"backgroundImage": "url(\"//yun.tuia.cn/tuia/jimo-web-pro/df_image_widget@1x.png\")",
"backgroundPosition": "center",
"backgroundSize": "100% 100%"
},
"name": "图片1",
"jump": {
"type": "none",
"android": "",
"ios": "",
"popupId": "",
"isCoversion": 1
},
"fixed": 0,
"animation": { "type": "breathe" },
"id": "1ec16ca8"
},
{
"type": "text",
"style": {
"width": "150px",
"height": "21px",
"zIndex": 20,
"top": "142px",
"left": "112px",
"opacity": 1,
"transform": "rotate(0deg)",
"borderBottomLeftRadius": "0",
"borderBottomRightRadius": "0",
"borderTopLeftRadius": "0",
"borderTopRightRadius": "0",
"borderStyle": "solid",
"borderWidth": "0px",
"borderColor": "transparent",
"backgroundColor": "rgba(255,255,255,0)",
"fontSize": "14px",
"lineHeight": "21px",
"letterSpacing": "2px",
"color": "#333",
"textAlign": "left",
"overflow": "hidden"
},
"name": "文字1",
"text": "左侧富文本编辑",
"fixed": 0,
"jump": {
"type": "none",
"android": "",
"ios": "",
"popupId": "",
"isCoversion": 0
},
"id": "c7ce6aac"
}
]
}
]
},
"image": "//via.placeholder.com/750x1206",
"skinDesc": "描述"
}
}
{
"code": "0",
"desc": "成功",
"data": {}
}
{
"code": "0",
"desc": "查询积木弹层标签集合",
"data": [
{
"tagId": 991,
"tagName": "翻牌子"
},
{
"tagId": 992,
"tagName": "刮刮卡"
},
{
"tagId": 993,
"tagName": "开礼盒"
},
{
"tagId": 994,
"tagName": "抽权益"
},
{
"tagId": 995,
"tagName": "问答"
},
{
"tagId": 996,
"tagName": "摇奖机"
},
{
"tagId": 997,
"tagName": "数字红包"
},
{
"tagId": 998,
"tagName": "猜红包"
},
{
"tagId": 999,
"tagName": "滑动换装"
},
{
"tagId": 1000,
"tagName": "视频"
},
{
"tagId": 1001,
"tagName": "多商品"
},
{
"tagId": 1002,
"tagName": "其他"
}
]
}
{
"code": "0",
"desc": "ok",
"data": {}
}
{
"code": "0",
"desc": "ok",
"data": {}
}
{
"code": "0",
"desc": "ok",
"data": {}
}
\ No newline at end of file
{
"adminName": "王鹏飞",
"success": true,
"adminId": 2645,
"email": "wangpengfei@duiba.com.cn"
}
This diff is collapsed.
{
"code": "0",
"desc": "成功",
"data": {
"250k": "url1",
"500k": "url2"
}
}
{
"adminName": "周成",
"success": true,
"adminId": 1,
"email": "zc@duiba.com.cn",
"code": "SSO:01001"
}
{
"system": {
"id": 24,
"appNameAlias": "tuia-news-manager",
"appName": "天天趣闻媒体管理平台",
"icon": null
},
"success": true,
"ssoHomeURL": "http://sso.duibadev.com.cn"
}
const fs = require('fs')
const path = require('path')
const crypto = require('crypto')
module.exports = async function(ctx, next) {
try {
// 创建上传文件夹
mkdir(path.join(__dirname, '../../uploads/'))
const file = ctx.request.files.file // 上传的文件在ctx.request.files.file
// 创建可读流
const reader = fs.createReadStream(file.path)
// 获取文件MD5
const md5 = await readFileMd5(file.path)
// 创建可写流
const fileName = md5 + '.' + file.name.split('.')[1]
const filePath = path.join(__dirname, '../../uploads/', fileName)
const stream = fs.createWriteStream(filePath)
reader.pipe(stream)
// 接口返回文件信息
ctx.body = {
code: '0',
desc: '上传文件成功',
data: {
name: file.name,
url: `/${fileName}`
}
}
} catch (error) {
console.error(error)
// 发生错误
ctx.body = {
code: '999999',
desc: error,
data: null
}
}
}
function mkdir(path, mode) {
const isDirExists = fs.existsSync || path.existsSync
if (typeof mode === 'undefined') {
// 511 === 0777
mode = 511 & ~process.umask()
}
if (isDirExists(path)) return
path
.replace(/\\/g, '/')
.split('/')
.reduce(function(prev, next) {
if (prev && !isDirExists(prev)) {
fs.mkdirSync(prev, mode)
}
return prev + '/' + next
})
if (!isDirExists(path)) {
fs.mkdirSync(path, mode)
}
}
const readFileMd5 = url => {
return new Promise(resolve => {
let md5sum = crypto.createHash('md5')
let stream = fs.createReadStream(url)
stream.on('data', function(chunk) {
md5sum.update(chunk)
})
stream.on('end', function() {
let fileMd5 = md5sum.digest('hex')
resolve(fileMd5)
})
})
}
{
"name": "tuia-react-template",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"dev": "yarn && node ./server-dev",
"build": "npm run clean:dist && yarn && node build/build.js && npm run clean:node_modules",
"clean:dist": "rm -rf dist",
"clean:node_modules": "rm -rf node_modules",
"lint": "eslint --fix --ext .js,.jsx ./"
},
"author": "",
"license": "ISC",
"dependencies": {
"@tuia/html2canvas": "^1.0.0",
"@tweenjs/tween.js": "^18.6.0",
"antd": "3.11.2",
"axios": "^0.19.2",
"braft-editor": "^2.3.9",
"braft-extensions": "^0.1.0",
"codemirror": "^5.55.0",
"copy-to-clipboard": "^3.3.1",
"echarts": "^4.8.0",
"echarts-for-react": "^2.0.16",
"immutability-helper": "^3.1.1",
"koa": "^2.6.2",
"koa-body": "^4.0.4",
"koa-compress": "^3.0.0",
"koa-conditional-get": "^2.0.0",
"koa-etag": "^3.0.0",
"koa-loggers": "^0.6.0",
"koa-mount": "^4.0.0",
"koa-router": "^7.4.0",
"koa-static": "^5.0.0",
"loadable-components": "^2.2.3",
"loadjs": "^4.2.0",
"lodash-es": "^4.17.15",
"mobx": "^5.15.4",
"mobx-react": "^6.2.2",
"moment": "^2.23.0",
"nanoid": "^3.1.10",
"pubsub-js": "^1.8.0",
"qrcode.react": "^1.0.0",
"react": "^16.8.0",
"react-codemirror": "^1.0.0",
"react-codemirror2": "^5.1.0",
"react-color": "^2.14.1",
"react-copy-to-clipboard": "^5.0.1",
"react-dnd": "^5.0.0",
"react-dnd-html5-backend": "^5.0.1",
"react-dom": "^16.4.2",
"react-hot-loader": "^4.3.4",
"react-router": "3.2.1",
"react-sortablejs": "^2.0.11",
"reactcss": "^1.2.3"
},
"devDependencies": {
"@babel/core": "^7.2.0",
"@babel/plugin-proposal-class-properties": "^7.2.1",
"@babel/plugin-proposal-decorators": "^7.2.0",
"@babel/plugin-proposal-do-expressions": "^7.2.0",
"@babel/plugin-proposal-export-default-from": "^7.2.0",
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
"@babel/plugin-proposal-function-sent": "^7.2.0",
"@babel/plugin-proposal-json-strings": "^7.2.0",
"@babel/plugin-proposal-logical-assignment-operators": "^7.2.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.2.0",
"@babel/plugin-proposal-numeric-separator": "^7.2.0",
"@babel/plugin-proposal-optional-chaining": "^7.2.0",
"@babel/plugin-proposal-pipeline-operator": "^7.2.0",
"@babel/plugin-proposal-throw-expressions": "^7.2.0",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-import-meta": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"@babel/preset-react": "^7.0.0",
"@babel/runtime": "^7.2.0",
"autoprefixer": "^9.4.2",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.4",
"case-sensitive-paths-webpack-plugin": "^2.1.2",
"chalk": "^2.4.1",
"cross-env": "^5.2.0",
"css-loader": "^2.0.0",
"cssnano": "^4.1.7",
"eslint": "^5.10.0",
"eslint-config-standard": "^12.0.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.1.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-standard": "^4.0.0",
"express-to-koa": "^1.0.6",
"file-loader": "^2.0.0",
"friendly-errors-webpack-plugin": "^1.7.0",
"html-loader": "^0.5.5",
"html-webpack-harddisk-plugin": "^1.0.1",
"html-webpack-plugin": "^3.2.0",
"jsx-loader": "^0.13.2",
"koa-connect": "^2.0.1",
"koa-server-http-proxy": "^0.1.0",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"mini-css-extract-plugin": "^0.5.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"postcss-loader": "^3.0.0",
"progress-bar-webpack-plugin": "^1.11.0",
"react-hot-loader": "4.3.12",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.1.0",
"tuia-auto-upload": "git+ssh://git@gitlab2.dui88.com:frontend/tuia-auto-upload.git#2.0.12",
"url-loader": "~1.1.2",
"webpack": "^4.27.1",
"webpack-dev-middleware": "^3.4.0",
"webpack-hot-middleware": "^2.24.3",
"webpack-merge": "^4.1.5"
},
"repository": {
"type": "git",
"url": "{{git}}"
},
"keywords": [
"Webpack",
"React",
"Antd",
"ES6"
]
}
module.exports = {
plugins: [
require('autoprefixer')({
overrideBrowserslist: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 9', 'iOS >= 8', 'Android >= 4']
}),
require('cssnano')({
preset: 'default',
zindex: false,
reduceIdents: false
})
]
}
/*
* @Author: 周成
* @Date: 2018-11-28 17:08:56
* @Last Modified by: 周成
* @Last Modified time: 2019-01-03 16:42:51
*/
/**
* 纯静态html路由
*/
const path = require('path')
const Router = require('koa-router')
const send = require('koa-send')
const router = new Router()
const root = path.join(process.cwd(), '/dist/html/')
router.get('/', async ctx => {
await send(ctx, 'basics.html', { root })
})
router.get('/basics', async ctx => {
await send(ctx, 'basics.html', { root })
})
router.get('/layers', async ctx => {
await send(ctx, 'layers.html', { root })
})
router.get(/index(\.html)?$/, (ctx, next) => {
ctx.redirect('/')
})
router.get(/\.html$/, async ctx => {
await send(ctx, ctx.path.replace('/', ''), { root })
})
module.exports = router
const fs = require('fs')
const path = require('path')
const Router = require('koa-router')
const router = new Router()
/**
* 模拟SSO跳转
*/
router.get('/sso/ssoIndex', ctx => {
ctx.cookies.set('sso_ticket', '6fb1f563995a2b60720567f4940b8844')
ctx.redirect(ctx.query.redirect)
})
// 本地上传接口模拟
router.post('/upload/index', require('../mock/upload'))
router.all('*', ctx => {
// mock路由,优先查找JS,其次是JSON,找不到返回默认值
const JSFilePath = path.join(__dirname, '../mock/', `${ctx.request.path}.js`)
const JSONFilePath = path.join(__dirname, '../mock/', `${ctx.request.path}.json`)
if (fs.existsSync(JSFilePath)) {
require(JSFilePath)(ctx)
} else if (fs.existsSync(JSONFilePath)) {
const file = fs.readFileSync(JSONFilePath)
ctx.body = JSON.parse(file)
} else {
ctx.body = {
code: '0',
desc: '成功',
data: '0'
}
}
})
module.exports = router
const proxy = require('koa-server-http-proxy')
const filter = function(pathname, req) {
return !(pathname.match('html') || pathname === '/')
}
module.exports = function() {
let target = process.env.proxy
if (!target.match(/^http/)) {
target = `http://${target}`
}
return proxy(filter, {
target,
changeOrigin: true,
headers: {
referer: target
},
logLevel: 'debug'
})
}
const Koa = require('koa')
const koaBody = require('koa-body')
const e2k = require('express-to-koa')
const c2k = require('koa-connect')
const webpack = require('webpack')
const webpackDevMiddleware = require('webpack-dev-middleware')
const webpackHotMiddleware = require('webpack-hot-middleware')
const router = require('./routes/index')
const utils = require('./build/utils')
const devConfig = require('./build/webpack.dev.conf')
const app = new Koa()
const compiler = webpack(devConfig)
// webpackDevMiddleware默认不支持koa,需要用express-to-koa和koa-connect解决
app.use(
c2k((req, res, next) => {
res.statusCode = 200
next()
})
)
app.use(
e2k(
webpackDevMiddleware(compiler, {
publicPath: devConfig.output.publicPath,
stats: 'errors-only',
headers: {
'Access-Control-Allow-Origin': '*'
}
})
)
)
app.use(e2k(webpackHotMiddleware(compiler)))
app.use(router.routes())
const mock = require('./routes/mock')
const proxy = require('./routes/proxy')
// npm命令中带有process.env.proxy参数,则开启代理到指定服务器
if (process.env.proxy) {
app.use(proxy())
} else {
app.use(
koaBody({
multipart: true
})
)
app.use(mock.routes())
}
// 获取一个可用的端口号,避免多工程之间端口占用
utils.getAvailablePort(4000, (err, port) => {
if (err) {
throw err
}
app.listen(port)
console.log(`Open <http://localhost:${port}> width chrome`)
})
import React from 'react'
import { inject, observer } from 'mobx-react'
import { Layout, LocaleProvider } from 'antd'
import zhCN from 'antd/lib/locale-provider/zh_CN'
import 'moment/locale/zh-cn'
import Header from 'src/components/Header'
import Menu from 'src/components/Menu'
import Footer from 'src/components/Footer'
import 'src/styles/antd.less'
import 'src/styles/index.less'
const { Content } = Layout
@inject('userStore')
@observer
class App extends React.Component {
componentDidMount() {
this.props.userStore.getUserInfo()
}
render() {
const { dataIsReady } = this.props.userStore
const { router, children, routes } = this.props
const { getCurrentLocation } = router
return (
<div>
{dataIsReady ? (
<LocaleProvider locale={zhCN}>
<Layout className="app-container">
<Header routes={routes} />
<Layout>
<Menu currentLocation={getCurrentLocation()} />
<Layout className="content">
<Content className="content-container">{children}</Content>
<Footer />
</Layout>
</Layout>
</Layout>
</LocaleProvider>
) : null}
</div>
)
}
}
export default App
import React from 'react'
import ReactDOM from 'react-dom'
import { configure } from 'mobx'
import { Provider } from 'mobx-react'
import { Router, hashHistory } from 'react-router'
import { AppContainer } from 'react-hot-loader'
import routes from './routes'
import stores from './stores'
configure({ enforceActions: 'observed' })
const App = () => {
return (
<Provider {...stores}>
<Router history={hashHistory} routes={routes} />
</Provider>
)
}
const render = Component => {
ReactDOM.render(
<AppContainer>
<Component />
</AppContainer>,
document.querySelector('#app')
)
}
render(App)
// webpack Hot Module Replacement API
if (module.hot) {
module.hot.accept(App, () => {
// if you are using harmony modules ({modules:false})
render(App)
// in all other cases - re-require App manually
// render(require('./containers/App'))
})
}
import React, { Component } from 'react'
import { Link } from 'react-router'
import { Breadcrumb as AntdBreadcrumb } from 'antd'
import style from './index.less'
export default class Breadcrumb extends Component {
componentWillReceiveProps(nextProps) {
let { routes } = nextProps
routes = routes.filter(route => {
return !!route.breadcrumbName
})
if (routes.length) {
const breadcrumbName = routes[routes.length - 1].breadcrumbName
document.title = `${breadcrumbName} - 推啊管理平台`
}
}
itemRender(route, params, routes, paths) {
const last = routes.indexOf(route) === routes.length - 1
return last ? (
<span>{route.breadcrumbName}</span>
) : route.breadcrumbName ? (
<Link to={paths.join('/') || '/'}>{route.breadcrumbName}</Link>
) : null
}
render() {
let { routes } = this.props
routes = routes.filter(el => el.path)
return (
<AntdBreadcrumb className={style.breadcrumb} itemRender={this.itemRender} routes={routes} />
)
}
}
.breadcrumb{
line-height: 64px !important;
float: left;
}
\ No newline at end of file
/**
* 目前因为没有footer需求,用于今后拓展
*/
import React from 'react'
import { Layout } from 'antd'
import styles from './index.less'
const { Footer: AntdFooter } = Layout
const Footer = () => {
return <AntdFooter className={styles.footer} />
}
export default Footer
.footer {
padding: 0!important;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
@import '~assets/styles/mixins.less';
@import '~assets/styles/theme.less';
.editImage {
max-width: 100%;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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