Browse Source

first commit

ysy2018 5 years ago
commit
1ff85e3b7c

+ 12 - 0
.babelrc

@@ -0,0 +1,12 @@
+{
+  "presets": [
+    ["env", {
+      "modules": false,
+      "targets": {
+        "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
+      }
+    }],
+    "stage-2"
+  ],
+  "plugins": ["transform-vue-jsx", "transform-runtime"]
+}

+ 9 - 0
.editorconfig

@@ -0,0 +1,9 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true

+ 14 - 0
.gitignore

@@ -0,0 +1,14 @@
+.DS_Store
+node_modules/
+/dist/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln

+ 10 - 0
.postcssrc.js

@@ -0,0 +1,10 @@
+// https://github.com/michael-ciniawsky/postcss-load-config
+
+module.exports = {
+  "plugins": {
+    "postcss-import": {},
+    "postcss-url": {},
+    // to edit target browsers: use "browserslist" field in package.json
+    "autoprefixer": {}
+  }
+}

+ 41 - 0
build/build.js

@@ -0,0 +1,41 @@
+'use strict'
+require('./check-versions')()
+
+process.env.NODE_ENV = 'production'
+
+const ora = require('ora')
+const rm = require('rimraf')
+const path = require('path')
+const chalk = require('chalk')
+const webpack = require('webpack')
+const config = require('../config')
+const webpackConfig = require('./webpack.prod.conf')
+
+const spinner = ora('building for production...')
+spinner.start()
+
+rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
+  if (err) throw err
+  webpack(webpackConfig, (err, stats) => {
+    spinner.stop()
+    if (err) throw err
+    process.stdout.write(stats.toString({
+      colors: true,
+      modules: false,
+      children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
+      chunks: false,
+      chunkModules: false
+    }) + '\n\n')
+
+    if (stats.hasErrors()) {
+      console.log(chalk.red('  Build failed with errors.\n'))
+      process.exit(1)
+    }
+
+    console.log(chalk.cyan('  Build complete.\n'))
+    console.log(chalk.yellow(
+      '  Tip: built files are meant to be served over an HTTP server.\n' +
+      '  Opening index.html over file:// won\'t work.\n'
+    ))
+  })
+})

+ 54 - 0
build/check-versions.js

@@ -0,0 +1,54 @@
+'use strict'
+const chalk = require('chalk')
+const semver = require('semver')
+const packageConfig = require('../package.json')
+const shell = require('shelljs')
+
+function exec (cmd) {
+  return require('child_process').execSync(cmd).toString().trim()
+}
+
+const versionRequirements = [
+  {
+    name: 'node',
+    currentVersion: semver.clean(process.version),
+    versionRequirement: packageConfig.engines.node
+  }
+]
+
+if (shell.which('npm')) {
+  versionRequirements.push({
+    name: 'npm',
+    currentVersion: exec('npm --version'),
+    versionRequirement: packageConfig.engines.npm
+  })
+}
+
+module.exports = function () {
+  const warnings = []
+
+  for (let i = 0; i < versionRequirements.length; i++) {
+    const 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 (let i = 0; i < warnings.length; i++) {
+      const warning = warnings[i]
+      console.log('  ' + warning)
+    }
+
+    console.log()
+    process.exit(1)
+  }
+}

BIN
build/logo.png


+ 101 - 0
build/utils.js

@@ -0,0 +1,101 @@
+'use strict'
+const path = require('path')
+const config = require('../config')
+const ExtractTextPlugin = require('extract-text-webpack-plugin')
+const packageConfig = require('../package.json')
+
+exports.assetsPath = function (_path) {
+  const assetsSubDirectory = process.env.NODE_ENV === 'production'
+    ? config.build.assetsSubDirectory
+    : config.dev.assetsSubDirectory
+
+  return path.posix.join(assetsSubDirectory, _path)
+}
+
+exports.cssLoaders = function (options) {
+  options = options || {}
+
+  const cssLoader = {
+    loader: 'css-loader',
+    options: {
+      sourceMap: options.sourceMap
+    }
+  }
+
+  const postcssLoader = {
+    loader: 'postcss-loader',
+    options: {
+      sourceMap: options.sourceMap
+    }
+  }
+
+  // generate loader string to be used with extract text plugin
+  function generateLoaders (loader, loaderOptions) {
+    const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
+
+    if (loader) {
+      loaders.push({
+        loader: loader + '-loader',
+        options: Object.assign({}, loaderOptions, {
+          sourceMap: options.sourceMap
+        })
+      })
+    }
+
+    // Extract CSS when that option is specified
+    // (which is the case during production build)
+    if (options.extract) {
+      return ExtractTextPlugin.extract({
+        use: loaders,
+        fallback: 'vue-style-loader'
+      })
+    } else {
+      return ['vue-style-loader'].concat(loaders)
+    }
+  }
+
+  // https://vue-loader.vuejs.org/en/configurations/extract-css.html
+  return {
+    css: generateLoaders(),
+    postcss: generateLoaders(),
+    less: generateLoaders('less'),
+    sass: generateLoaders('sass', { indentedSyntax: true }),
+    scss: generateLoaders('sass'),
+    stylus: generateLoaders('stylus'),
+    styl: generateLoaders('stylus')
+  }
+}
+
+// Generate loaders for standalone style files (outside of .vue)
+exports.styleLoaders = function (options) {
+  const output = []
+  const loaders = exports.cssLoaders(options)
+
+  for (const extension in loaders) {
+    const loader = loaders[extension]
+    output.push({
+      test: new RegExp('\\.' + extension + '$'),
+      use: loader
+    })
+  }
+
+  return output
+}
+
+exports.createNotifierCallback = () => {
+  const notifier = require('node-notifier')
+
+  return (severity, errors) => {
+    if (severity !== 'error') return
+
+    const error = errors[0]
+    const filename = error.file && error.file.split('!').pop()
+
+    notifier.notify({
+      title: packageConfig.name,
+      message: severity + ': ' + error.name,
+      subtitle: filename || '',
+      icon: path.join(__dirname, 'logo.png')
+    })
+  }
+}

+ 22 - 0
build/vue-loader.conf.js

@@ -0,0 +1,22 @@
+'use strict'
+const utils = require('./utils')
+const config = require('../config')
+const isProduction = process.env.NODE_ENV === 'production'
+const sourceMapEnabled = isProduction
+  ? config.build.productionSourceMap
+  : config.dev.cssSourceMap
+
+module.exports = {
+  loaders: utils.cssLoaders({
+    sourceMap: sourceMapEnabled,
+    extract: isProduction
+  }),
+  cssSourceMap: sourceMapEnabled,
+  cacheBusting: config.dev.cacheBusting,
+  transformToRequire: {
+    video: ['src', 'poster'],
+    source: 'src',
+    img: 'src',
+    image: 'xlink:href'
+  }
+}

+ 82 - 0
build/webpack.base.conf.js

@@ -0,0 +1,82 @@
+'use strict'
+const path = require('path')
+const utils = require('./utils')
+const config = require('../config')
+const vueLoaderConfig = require('./vue-loader.conf')
+
+function resolve (dir) {
+  return path.join(__dirname, '..', dir)
+}
+
+
+
+module.exports = {
+  context: path.resolve(__dirname, '../'),
+  entry: {
+    app: './src/main.js'
+  },
+  output: {
+    path: config.build.assetsRoot,
+    filename: '[name].js',
+    publicPath: process.env.NODE_ENV === 'production'
+      ? config.build.assetsPublicPath
+      : config.dev.assetsPublicPath
+  },
+  resolve: {
+    extensions: ['.js', '.vue', '.json'],
+    alias: {
+      'vue$': 'vue/dist/vue.esm.js',
+      '@': resolve('src'),
+    }
+  },
+  module: {
+    rules: [
+      {
+        test: /\.vue$/,
+        loader: 'vue-loader',
+        options: vueLoaderConfig
+      },
+      {
+        test: /\.js$/,
+        loader: 'babel-loader',
+        include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
+      },
+      {
+        test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
+        loader: 'url-loader',
+        options: {
+          limit: 10000,
+          name: utils.assetsPath('img/[name].[hash:7].[ext]')
+        }
+      },
+      {
+        test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
+        loader: 'url-loader',
+        options: {
+          limit: 10000,
+          name: utils.assetsPath('media/[name].[hash:7].[ext]')
+        }
+      },
+      {
+        test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
+        loader: 'url-loader',
+        options: {
+          limit: 10000,
+          name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
+        }
+      }
+    ]
+  },
+  node: {
+    // prevent webpack from injecting useless setImmediate polyfill because Vue
+    // source contains it (although only uses it if it's native).
+    setImmediate: false,
+    // prevent webpack from injecting mocks to Node native modules
+    // that does not make sense for the client
+    dgram: 'empty',
+    fs: 'empty',
+    net: 'empty',
+    tls: 'empty',
+    child_process: 'empty'
+  }
+}

+ 95 - 0
build/webpack.dev.conf.js

@@ -0,0 +1,95 @@
+'use strict'
+const utils = require('./utils')
+const webpack = require('webpack')
+const config = require('../config')
+const merge = require('webpack-merge')
+const path = require('path')
+const baseWebpackConfig = require('./webpack.base.conf')
+const CopyWebpackPlugin = require('copy-webpack-plugin')
+const HtmlWebpackPlugin = require('html-webpack-plugin')
+const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
+const portfinder = require('portfinder')
+
+const HOST = process.env.HOST
+const PORT = process.env.PORT && Number(process.env.PORT)
+
+const devWebpackConfig = merge(baseWebpackConfig, {
+  module: {
+    rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
+  },
+  // cheap-module-eval-source-map is faster for development
+  devtool: config.dev.devtool,
+
+  // these devServer options should be customized in /config/index.js
+  devServer: {
+    clientLogLevel: 'warning',
+    historyApiFallback: {
+      rewrites: [
+        { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
+      ],
+    },
+    hot: true,
+    contentBase: false, // since we use CopyWebpackPlugin.
+    compress: true,
+    host: HOST || config.dev.host,
+    port: PORT || config.dev.port,
+    open: config.dev.autoOpenBrowser,
+    overlay: config.dev.errorOverlay
+      ? { warnings: false, errors: true }
+      : false,
+    publicPath: config.dev.assetsPublicPath,
+    proxy: config.dev.proxyTable,
+    quiet: true, // necessary for FriendlyErrorsPlugin
+    watchOptions: {
+      poll: config.dev.poll,
+    }
+  },
+  plugins: [
+    new webpack.DefinePlugin({
+      'process.env': require('../config/dev.env')
+    }),
+    new webpack.HotModuleReplacementPlugin(),
+    new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
+    new webpack.NoEmitOnErrorsPlugin(),
+    // https://github.com/ampedandwired/html-webpack-plugin
+    new HtmlWebpackPlugin({
+      filename: 'index.html',
+      template: 'index.html',
+      inject: true
+    }),
+    // copy custom static assets
+    new CopyWebpackPlugin([
+      {
+        from: path.resolve(__dirname, '../static'),
+        to: config.dev.assetsSubDirectory,
+        ignore: ['.*']
+      }
+    ])
+  ]
+})
+
+module.exports = new Promise((resolve, reject) => {
+  portfinder.basePort = process.env.PORT || config.dev.port
+  portfinder.getPort((err, port) => {
+    if (err) {
+      reject(err)
+    } else {
+      // publish the new Port, necessary for e2e tests
+      process.env.PORT = port
+      // add port to devServer config
+      devWebpackConfig.devServer.port = port
+
+      // Add FriendlyErrorsPlugin
+      devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
+        compilationSuccessInfo: {
+          messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
+        },
+        onErrors: config.dev.notifyOnErrors
+        ? utils.createNotifierCallback()
+        : undefined
+      }))
+
+      resolve(devWebpackConfig)
+    }
+  })
+})

+ 145 - 0
build/webpack.prod.conf.js

@@ -0,0 +1,145 @@
+'use strict'
+const path = require('path')
+const utils = require('./utils')
+const webpack = require('webpack')
+const config = require('../config')
+const merge = require('webpack-merge')
+const baseWebpackConfig = require('./webpack.base.conf')
+const CopyWebpackPlugin = require('copy-webpack-plugin')
+const HtmlWebpackPlugin = require('html-webpack-plugin')
+const ExtractTextPlugin = require('extract-text-webpack-plugin')
+const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
+const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
+
+const env = require('../config/prod.env')
+
+const webpackConfig = merge(baseWebpackConfig, {
+  module: {
+    rules: utils.styleLoaders({
+      sourceMap: config.build.productionSourceMap,
+      extract: true,
+      usePostCSS: true
+    })
+  },
+  devtool: config.build.productionSourceMap ? config.build.devtool : false,
+  output: {
+    path: config.build.assetsRoot,
+    filename: utils.assetsPath('js/[name].[chunkhash].js'),
+    chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
+  },
+  plugins: [
+    // http://vuejs.github.io/vue-loader/en/workflow/production.html
+    new webpack.DefinePlugin({
+      'process.env': env
+    }),
+    new UglifyJsPlugin({
+      uglifyOptions: {
+        compress: {
+          warnings: false
+        }
+      },
+      sourceMap: config.build.productionSourceMap,
+      parallel: true
+    }),
+    // extract css into its own file
+    new ExtractTextPlugin({
+      filename: utils.assetsPath('css/[name].[contenthash].css'),
+      // Setting the following option to `false` will not extract CSS from codesplit chunks.
+      // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
+      // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 
+      // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
+      allChunks: true,
+    }),
+    // Compress extracted CSS. We are using this plugin so that possible
+    // duplicated CSS from different components can be deduped.
+    new OptimizeCSSPlugin({
+      cssProcessorOptions: config.build.productionSourceMap
+        ? { safe: true, map: { inline: false } }
+        : { safe: true }
+    }),
+    // 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'
+    }),
+    // keep module.id stable when vendor modules does not change
+    new webpack.HashedModuleIdsPlugin(),
+    // enable scope hoisting
+    new webpack.optimize.ModuleConcatenationPlugin(),
+    // split vendor js into its own file
+    new webpack.optimize.CommonsChunkPlugin({
+      name: 'vendor',
+      minChunks (module) {
+        // 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',
+      minChunks: Infinity
+    }),
+    // This instance extracts shared chunks from code splitted chunks and bundles them
+    // in a separate chunk, similar to the vendor chunk
+    // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
+    new webpack.optimize.CommonsChunkPlugin({
+      name: 'app',
+      async: 'vendor-async',
+      children: true,
+      minChunks: 3
+    }),
+
+    // copy custom static assets
+    new CopyWebpackPlugin([
+      {
+        from: path.resolve(__dirname, '../static'),
+        to: config.build.assetsSubDirectory,
+        ignore: ['.*']
+      }
+    ])
+  ]
+})
+
+if (config.build.productionGzip) {
+  const 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
+    })
+  )
+}
+
+if (config.build.bundleAnalyzerReport) {
+  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
+  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
+}
+
+module.exports = webpackConfig

+ 7 - 0
config/dev.env.js

@@ -0,0 +1,7 @@
+'use strict'
+const merge = require('webpack-merge')
+const prodEnv = require('./prod.env')
+
+module.exports = merge(prodEnv, {
+  NODE_ENV: '"development"'
+})

+ 77 - 0
config/index.js

@@ -0,0 +1,77 @@
+'use strict'
+// Template version: 1.3.1
+// see http://vuejs-templates.github.io/webpack for documentation.
+
+const path = require('path')
+
+module.exports = {
+  dev: {
+
+    // Paths
+    assetsSubDirectory: 'static',
+    assetsPublicPath: '/',
+    proxyTable: {
+      '/api': {
+        target: 'http://localhost:8090/',
+        changeOrigin: true,
+        pathRewrite: {
+          '^/api': '/'
+        }
+      }
+    },
+
+    // Various Dev Server settings
+    host: 'localhost', // can be overwritten by process.env.HOST
+    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+    autoOpenBrowser: false,
+    errorOverlay: true,
+    notifyOnErrors: true,
+    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
+
+    
+    /**
+     * Source Maps
+     */
+
+    // https://webpack.js.org/configuration/devtool/#development
+    devtool: 'cheap-module-eval-source-map',
+
+    // If you have problems debugging vue-files in devtools,
+    // set this to false - it *may* help
+    // https://vue-loader.vuejs.org/en/options.html#cachebusting
+    cacheBusting: true,
+
+    cssSourceMap: true
+  },
+
+  build: {
+    // Template for index.html
+    index: path.resolve(__dirname, '../dist/index.html'),
+
+    // Paths
+    assetsRoot: path.resolve(__dirname, '../dist'),
+    assetsSubDirectory: 'static',
+    assetsPublicPath: '/',
+
+    /**
+     * Source Maps
+     */
+
+    productionSourceMap: true,
+    // https://webpack.js.org/configuration/devtool/#production
+    devtool: '#source-map',
+
+    // 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'],
+
+    // Run the build command with an extra argument to
+    // View the bundle analyzer report after build finishes:
+    // `npm run build --report`
+    // Set to `true` or `false` to always turn it on or off
+    bundleAnalyzerReport: process.env.npm_config_report
+  }
+}

+ 4 - 0
config/prod.env.js

@@ -0,0 +1,4 @@
+'use strict'
+module.exports = {
+  NODE_ENV: '"production"'
+}

+ 13 - 0
index.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <title>制表</title>
+  </head>
+  <body>
+    <div id="app"></div>
+    <!-- built files will be auto injected -->
+  </body>
+</html>

File diff suppressed because it is too large
+ 10096 - 0
package-lock.json


+ 63 - 0
package.json

@@ -0,0 +1,63 @@
+{
+  "name": "cr",
+  "version": "1.0.0",
+  "description": "A Vue.js project",
+  "author": "ysy",
+  "private": true,
+  "scripts": {
+    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
+    "start": "npm run dev",
+    "build": "node build/build.js"
+  },
+  "dependencies": {
+    "axios": "^0.18.0",
+    "vue": "^2.5.2",
+    "vue-router": "^3.0.1"
+  },
+  "devDependencies": {
+    "autoprefixer": "^7.1.2",
+    "babel-core": "^6.22.1",
+    "babel-helper-vue-jsx-merge-props": "^2.0.3",
+    "babel-loader": "^7.1.1",
+    "babel-plugin-syntax-jsx": "^6.18.0",
+    "babel-plugin-transform-runtime": "^6.22.0",
+    "babel-plugin-transform-vue-jsx": "^3.5.0",
+    "babel-preset-env": "^1.3.2",
+    "babel-preset-stage-2": "^6.22.0",
+    "chalk": "^2.0.1",
+    "copy-webpack-plugin": "^4.0.1",
+    "css-loader": "^0.28.0",
+    "extract-text-webpack-plugin": "^3.0.0",
+    "file-loader": "^1.1.4",
+    "friendly-errors-webpack-plugin": "^1.6.1",
+    "html-webpack-plugin": "^2.30.1",
+    "node-notifier": "^5.1.2",
+    "optimize-css-assets-webpack-plugin": "^3.2.0",
+    "ora": "^1.2.0",
+    "portfinder": "^1.0.13",
+    "postcss-import": "^11.0.0",
+    "postcss-loader": "^2.0.8",
+    "postcss-url": "^7.2.1",
+    "rimraf": "^2.6.0",
+    "semver": "^5.3.0",
+    "shelljs": "^0.7.6",
+    "uglifyjs-webpack-plugin": "^1.1.1",
+    "url-loader": "^0.5.8",
+    "vue-loader": "^13.3.0",
+    "vue-style-loader": "^3.0.1",
+    "vue-template-compiler": "^2.5.2",
+    "webpack": "^3.6.0",
+    "webpack-bundle-analyzer": "^2.9.0",
+    "webpack-dev-server": "^2.9.1",
+    "webpack-merge": "^4.1.0"
+  },
+  "engines": {
+    "node": ">= 6.0.0",
+    "npm": ">= 3.0.0"
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not ie <= 8"
+  ]
+}

+ 41 - 0
src/App.vue

@@ -0,0 +1,41 @@
+<template>
+<div id="app">
+  <transition name="fade" mode="out-in">
+    <router-view></router-view>
+  </transition>
+</div>
+</template>
+
+<script>
+export default {
+  name: 'app',
+  components: {}
+}
+</script>
+
+<style>
+body {
+    margin: 0;
+    padding: 0;
+    font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
+    font-size: 13px;
+    -webkit-font-smoothing: antialiased;
+}
+ 
+#app {
+    top: 0;
+    bottom: 0;
+    width: 100%;
+    min-width: 1320px;
+}
+ 
+.fade-enter-active,
+.fade-leave-active {
+    transition: all 0.2s ease;
+}
+ 
+.fade-enter,
+.fade-leave-active {
+    opacity: 0;
+}
+</style>

BIN
src/assets/logo.jpg


+ 133 - 0
src/assets/reset.css

@@ -0,0 +1,133 @@
+header {
+	height: 58px;
+	background: #befae0;
+	border-top:1px solid #00cd72;
+	border-bottom:1px solid #00cd72;
+}
+
+header div{
+	overflow: hidden;
+	width:1200px;
+	margin: 0 auto;
+}
+
+header div ul{
+	margin: 0 auto;
+	overflow: hidden;
+	padding: 0;
+	float: left;
+}
+
+header div img{
+	float: left;
+}
+
+header div ul li{
+	float: left;
+	list-style: none;
+	width: 80px;
+	text-align: center;
+	line-height: 58px;
+	font-size: 14px;
+	cursor: pointer;
+}
+
+header div ul li a{
+  text-decoration: none;
+  color: #000;
+}
+
+.active{
+	color: red;
+}
+
+header div ul li:nth-child(1){
+	width: 285px;
+}
+
+header div ul li:nth-child(8){
+	margin-left: 216px;
+}
+
+#child_menu{
+	overflow: hidden;
+	width: 1170px;
+	margin: 0 auto;
+}
+
+#child_menu ul {
+	margin: 20px auto 0px;
+	overflow: hidden;
+	padding: 0;
+	float: left;
+}
+
+#child_menu ul li{
+	float: left;
+	list-style: none;
+	text-align: center;
+	margin-left: 20px;
+	cursor: pointer;
+}
+
+#child_menu .left{
+	float: left;
+	padding-top: 20px;
+	padding-right: 60px;
+}
+
+#child_menu .right{
+	float: right;
+	padding-top: 20px;
+	padding-right: 20px;
+}
+
+
+#Attribute {
+    border: 1px solid #000;
+    padding: 34px 55px;
+    background: #f6fbfe;
+    width: 188px;
+  }
+  
+  #Attribute table{
+    width: 100%;
+    font-size: 12px;
+  }
+  
+  #Attribute table tr td:nth-child(odd) {
+    width: 30px;
+  }
+  
+  #Attribute table tr td {
+    height: 40px;
+    padding: 0;
+  }
+  
+  #Attribute table tr td input[type="text"] {
+    width: 100%;
+    border: #0342c5 1px solid;
+  }
+  
+  #setting {
+    overflow: hidden;
+    width: 1115px;
+    margin: 55px auto 10px;
+  }
+  
+  #setting > div {
+    float: right;
+    text-align: center;
+  }
+  #fitting {
+    width: 815px;
+    height: 300px;
+  }
+  #fitting_button {
+    width: 45px;
+    height: 23px;
+    border: 1px solid #000;
+    border-radius: 20%;
+    text-align: center;
+    margin-top: 70px;
+  }

+ 37 - 0
src/components/common/header.vue

@@ -0,0 +1,37 @@
+<template>
+<header>
+	<div>
+		<img src="@/assets/logo.jpg" />
+        <ul :collapse="collapsed">
+            <template v-for="item in menus">
+            <li :key="item.desc"><router-link :to="item.path">{{item.desc}}</router-link></li>
+            </template>
+        </ul>
+	</div>
+</header>
+</template>
+<script>
+let data = () => {
+    return {
+        collapsed: false,
+        menus: []
+    }
+}
+
+let initMenu = function() {
+	for (let i in this.$router.options.routes[0].children) {
+		let root = this.$router.options.routes[0].children[i]
+		this.menus.push(root)
+	}
+}
+
+export default {
+    data: data,
+    methods: {
+        initMenu
+    },
+    mounted: function() {
+        this.initMenu()
+    }
+}
+</script>

+ 54 - 0
src/components/common/list.vue

@@ -0,0 +1,54 @@
+<template>
+  <div class="list">
+    <table v-for="(item,index) in sum" :key="index">
+      <tr>
+        <td width="40">名称</td>
+        <td width="100">{{item.name}}</td>
+      </tr>
+      <tr>
+        <td>尺寸</td>
+        <td>{{item.width}}*{{item.height}}</td>
+      </tr>
+      <tr>
+        <td><input type="checkbox" /></td>
+        <td><label style="cursor: pointer">预览</label></td>
+      </tr>
+    </table>
+    <div style="clear: both;"></div>
+  </div>
+</template>
+<script>
+export default {
+    props:["sum"]
+}
+</script>
+<style scoped>
+.list {
+  margin: 8px auto;
+  width: 1270px;
+  position: relative;
+  border-bottom: 2px solid #00cd72;
+  padding-left: 20px;
+  padding-right: 20px;
+}
+
+.list table {
+  border: 1px solid #000;
+  text-align: center;
+  border-collapse: collapse;
+  float: left;
+  margin-right: 35px;
+  width: 128px;
+  margin-bottom: 20px;
+}
+
+.list table:nth-child(8n+0){
+  margin-right: 0px;
+}
+
+.list table td {
+  border: 1px solid #000;
+  height: 25px;
+  padding: 0;
+}
+</style>

+ 19 - 0
src/main.js

@@ -0,0 +1,19 @@
+// The Vue build version to load with the `import` command
+// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
+import Vue from 'vue'
+import App from './App'
+import router from './router'
+import axios from 'axios';  
+import '@/assets/reset.css'/*引入公共样式*/
+
+
+Vue.config.productionTip = false
+Vue.prototype.$axios = axios
+
+/* eslint-disable no-new */
+new Vue({
+  el: '#app',
+  router,
+  components: { App },
+  template: '<App/>'
+})

+ 41 - 0
src/router/index.js

@@ -0,0 +1,41 @@
+import Vue from 'vue'
+import Router from 'vue-router'
+
+import layout from '@/view/layout'
+import makeTable from '@/view/makeTable'
+import accessories from '@/view/accessories/accessories'
+import columns from '@/view/columns/columns'
+import tableHead from '@/view/tableHead'
+import navigationBar from '@/view/navigationBar'
+import outlyingRow from '@/view/outlyingRow/outlyingRow'
+import background from '@/view/background'
+import combination from '@/view/combination/'
+import archives from '@/view/archives/archives'
+
+
+Vue.use(Router)
+
+let _router = [
+  { path: '/', component: layout, 
+    children:[
+      { path: '/makeTable', component:makeTable, desc: '制表'},
+      { path: '/accessories', component:accessories, desc: '配件'},
+      { path: '/columns', component:columns, desc: '分列'},
+      { path: '/navigationBar', component:navigationBar, desc: '导航条'},
+      { path: '/tableHead', component:tableHead, desc: '抬头'},
+      { path: '/outlyingRow', component:outlyingRow , desc: '表外行'},
+      { path: '/background', component:background, desc: '背景图'},
+      { path: '/combination', component:combination, desc: '组合'},
+      { path: '/archives', component:archives, desc: '档案' }
+    ] 
+  }
+]
+
+
+const router = new Router({
+  linkActiveClass: 'active', //将激活的路由添加一个mui-active类名称
+  mode: 'hash',
+  routes: _router
+})
+
+export default router

+ 71 - 0
src/view/accessories/accessories.vue

@@ -0,0 +1,71 @@
+<template>
+    <div class="accessories_page">
+        <div id="child_menu">
+	        <div class="left">
+		        <label>行数</label>
+		        <input type="text" style="width: 40px" v-model="sum_copy"/>
+		        <label @click="changeSum" style="cursor: pointer">确认</label>
+	        </div>
+	        <ul>
+                <li  v-on:click="selectNav('按键')" v-bind:class="select_nav == '按键'? 'active' : ''">按键</li>
+                <li  v-on:click="selectNav('方框')" v-bind:class="select_nav == '方框'? 'active' : ''">方框</li>
+                <li  v-on:click="selectNav('页码')" v-bind:class="select_nav == '页码'? 'active' : ''">页码</li>
+                <li  v-on:click="selectNav('单号')" v-bind:class="select_nav == '单号'? 'active' : ''">单号</li>
+                <li  v-on:click="selectNav('小页面')" v-bind:class="select_nav == '小页面'? 'active' : ''">小页面</li>
+	        </ul>
+            <div class="right">
+                <label>设置</label> &nbsp;&nbsp;&nbsp; <label>删除</label>
+            </div>
+        </div>
+        <child v-bind:sum="this.sum"></child>
+        <div class="tab-container">
+            <div class="container">
+                <div class="tab-container-box" v-if="select_nav == '按键'"><abutton></abutton></div>
+                <div class="tab-container-box" v-if="select_nav == '方框'"><asquareFrame></asquareFrame></div>
+                <div class="tab-container-box" v-if="select_nav == '页码'"><apagination></apagination></div>
+                <div class="tab-container-box" v-if="select_nav == '单号'"><aorderNumber></aorderNumber></div>
+                <div class="tab-container-box" v-if="select_nav == '小页面'"></div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+import child from '@/components/common/list';
+import abutton from '@/view/accessories/button';
+import aorderNumber from '@/view/accessories/orderNumber';
+import apagination from '@/view/accessories/pagination';
+import asquareFrame from '@/view/accessories/squareFrame';
+
+let data = () => {
+  return {
+    collapsed: false,
+	sum:8,
+    sum_copy:1,
+    select_nav: '按键', //导航选中
+  }
+}
+
+let changeSum = function(){
+    this.sum = this.sum_copy * 8
+}
+
+//选择展示哪个容器
+let selectNav = function(str){
+    this.select_nav = str;
+}
+
+export default {
+    data: data,
+    methods: {
+      changeSum,
+      selectNav
+    },
+    components:{
+      child,
+      abutton,
+      aorderNumber,
+      apagination,
+      asquareFrame
+    }
+}
+</script>

+ 112 - 0
src/view/accessories/button.vue

@@ -0,0 +1,112 @@
+<template>
+<section>
+  <div id="setting" >
+    <div id="Attribute">
+      <div style="color: red;font-weight: bolder;text-align: center;font-size: 14px;">按 键</div>
+      <table :title="form && form.id ? '编辑' : '新增' "  :model="form">
+        <tr>
+          <td>名称</td>
+          <td colspan="3"><input type="text" v-model="form_copy.name"/></td>
+        </tr>
+        <tr>
+          <td>框长</td>
+          <td colspan="3">
+            <input type="text" style="width:50px;margin-right: 14px;" v-model="form_copy.width" />
+            框高
+            <input type="text" style="width:50px" v-model="form_copy.height"/></td>
+        </tr>
+        <tr>
+          <td>字体</td>
+          <td>
+            <select v-model="form_copy.fontFamily"  style="width:80px;border: #0342c5 1px solid;">
+              <option value="黑体">黑体</option>
+              <option value="楷体">楷体</option>
+              <option value="微软雅黑">微软雅黑</option>
+              <option value="宋体">宋体</option>
+            </select>
+          </td>
+          <td>字高</td>
+          <td><input type="text" v-model="form_copy.fontSize"/></td>
+        </tr>
+        <tr>
+          <td>字组</td>
+          <td colspan="3"><input type="text" v-model="form_copy.content" /></td>
+        </tr>
+        <tr>
+          <td colspan="4">
+           <label>着色 <input type="color"  v-model="form_copy.color" style="width: 40px;"/></label>
+            &nbsp;
+            <button type="primary"  @click="fittingPreview">预览</button>
+            &nbsp;
+            <button type="primary"  @click="fittingSave">提交</button>
+          </td>
+        </tr>
+      </table>
+    </div>
+    <div id="fitting">
+      <input type="button"  id="fitting_button" v-bind:style="{width:form.width+'px',height:form.height+'px',fontFamily:form.fontFamily,fontSize:form.fontSize+'px',background:form.color}" v-bind:value="form.content"/>
+    </div>
+  </div>
+</section>
+</template>
+ 
+
+<script>
+let findAll = function() {
+  this.$axios.get("/api/accessories/button/findAll").then(response => {
+      if (response.data.code == 0) {
+        this.rows = response.data.list;
+      }
+    })
+    .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+};
+
+let fittingSave = function(){
+   this.$axios.post('/api/accessories/button/saveOrUpdate', this.form).then(response => {
+     if (response.data.code == 0) {
+        this.findAll()
+        this.form = {}
+      }
+   })
+   .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+}
+
+let fittingEdit = function(index){
+  this.form = this.rows[index]
+}
+
+let settingShow = function(){
+  this.form = {}
+}
+
+let fittingPreview = function(){
+  this.form =  Object.assign({}, this.form_copy)
+}
+
+export default {
+  data() {
+    return {
+      rows: [],
+      form: {},
+      form_copy: {}
+    };
+  },
+  mounted: function() {
+    this.findAll();
+  },
+  methods: {
+    findAll,
+    fittingSave,
+    fittingEdit,
+    settingShow,
+    fittingPreview
+  }
+};
+</script>
+ 

+ 110 - 0
src/view/accessories/orderNumber.vue

@@ -0,0 +1,110 @@
+<template>
+<section>
+  
+  <div id="setting" >
+    <div id="Attribute">
+      <div style="color: red;font-weight: bolder;text-align: center;font-size: 14px;">单号</div>
+      <table :title="form && form.id ? '编辑' : '新增' "  :model="form">
+        <tr>
+          <td>名称</td>
+          <td colspan="3"><input type="text" v-model="form_copy.name"/></td>
+        </tr>
+        <tr>
+          <td>字体</td>
+          <td>
+            <select v-model="form_copy.fontFamily" style="width:80px;border: #0342c5 1px solid;">
+              <option value="黑体">黑体</option>
+              <option value="楷体">楷体</option>
+              <option value="微软雅黑">微软雅黑</option>
+              <option value="宋体">宋体</option>
+            </select>
+          </td>
+          <td>字高</td>
+          <td><input type="text" v-model="form_copy.fontSize"/></td>
+        </tr>
+        <tr>
+          <td>单号</td>
+          <td colspan="3"><input type="text" v-model="form_copy.content" /></td>
+        </tr>
+        <tr>
+          <td colspan="4">
+           <label>着色 <input type="color"  v-model="form_copy.color" style="width: 40px;"/></label>
+            &nbsp;
+            <button type="primary"  @click="fittingPreview">预览</button>
+            &nbsp;
+            <button type="primary"  @click="fittingSave">提交</button>
+          </td>
+        </tr>
+      </table>
+    </div>
+    <div id="fitting">
+        <div style="margin-top:70px" :style="{fontFamily:form.fontFamily,fontSize:form.fontSize+'px',color:form.color}">{{form.content}}</div>
+    </div>
+  </div>
+</section>
+</template>
+ 
+
+<script>
+let findAll = function() {
+  this.$axios.get("/api/accessories/orderNumber/findAll").then(response => {
+      if (response.data.code == 0) {
+        this.rows = response.data.list;
+      }
+    })
+    .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+};
+
+let fittingSave = function(){
+   this.$axios.post('/api/accessories/orderNumber/saveOrUpdate', this.form).then(response => {
+     if (response.data.code == 0) {
+        this.findAll()
+        this.form = {}
+      }
+   })
+   .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+}
+
+let fittingEdit = function(index){
+  this.form = this.rows[index]
+}
+
+let settingShow = function(){
+  this.form = {}
+}
+
+let fittingPreview = function(){
+  this.form =  Object.assign({}, this.form_copy)
+}
+
+export default {
+  data() {
+    return {
+      rows: [],
+      form: {},
+      form_copy: {}
+    };
+  },
+  mounted: function() {
+    this.findAll();
+  },
+  methods: {
+    findAll,
+    fittingSave,
+    fittingEdit,
+    settingShow,
+    fittingPreview
+  }
+};
+</script>
+<style scoped>
+#Attribute {
+    padding: 30px 55px;
+}
+</style>

+ 191 - 0
src/view/accessories/pagination.vue

@@ -0,0 +1,191 @@
+<template>
+<section>
+  
+  <div id="setting" >
+    <div id="Attribute">
+      <div style="color: red;font-weight: bolder;text-align: center;font-size: 14px;">页码</div>
+      <table :title="form && form.id ? '编辑' : '新增' "  :model="form">
+        <tr>
+          <td>名称 <input type="text" style="width: 108px"  v-model="form_copy.name"/></td>
+        </tr>
+        <tr>
+          <td>
+              字高 <input type="text" v-model="form_copy.fontSize"/>
+              三角形高 <input type="text" v-model="form_copy.graphicHeight"/>
+          </td>
+        </tr>
+        <tr>
+          <td>三角形与两边距离 <input type="text" v-model="form_copy.graphicMargin" /></td>
+        </tr>
+        <tr>
+          <td>方框与两边距离 <input type="text" v-model="form_copy.boxMargin" /></td>
+        </tr>
+        <tr>
+          <td>1与——距离 <input type="text" v-model="form_copy.hyphenLeftMargin" /></td>
+        </tr>
+        <tr>
+          <td>/与0距离 <input type="text" v-model="form_copy.slashRightMargin" /></td>
+        </tr>
+        <tr>
+          <td >
+           <label>着色 <input type="color"  v-model="form_copy.color" style="width: 40px;"/></label>
+            &nbsp;
+            <button type="primary"  @click="fittingPreview">预览</button>
+            &nbsp;
+            <button type="primary"  @click="fittingSave">提交</button>
+          </td>
+        </tr>
+      </table>
+    </div>
+    <div id="fitting" style="width:895px">
+        <div class="pagination_type" :style="{fontSize:form.fontSize+'px'}">
+            <input type="radio" name="pagination_type" value="1" :checked="form.type==1" v-model="form.type"/>
+            0
+            <label :style="{marginRight:form.slashRightMargin+'px'}">/</label>
+            0
+        </div>
+        <div class="pagination_type" :style="{fontSize:form.fontSize+'px'}">
+            <input type="radio" name="pagination_type" value="2" :checked="form.type==2"  v-model="form.type"/>
+            <div class="triangle-left"  :style="{borderTop:form.graphicHeight/2+'px solid transparent',
+            borderBottom:form.graphicHeight/2+'px solid transparent',borderRight:form.graphicHeight+'px solid '+form.color,
+            marginRight:form.graphicMargin+'px'}"></div>
+            1
+            <label :style="{marginLeft:form.hyphenLeftMargin+'px'}">-</label> 
+            <input type="text" v-model="form.content" :style="{marginLeft:form.boxMargin+'px',marginRight:form.boxMargin+'px'}" /> 
+            <label :style="{marginRight:form.slashRightMargin+'px'}">/</label>
+            00
+            <div class="triangle-right"  :style="{borderTop:form.graphicHeight/2+'px solid transparent',
+            borderBottom:form.graphicHeight/2+'px solid transparent',borderLeft:form.graphicHeight+'px solid '+form.color,
+            marginLeft:form.graphicMargin+'px'}"></div>
+        </div>
+        <div class="pagination_type" :style="{fontSize:form.fontSize+'px'}">
+            <input type="radio" name="pagination_type" value="3"  :checked="form.type==3" v-model="form.type" />
+            <div class="triangle-left"  :style="{borderTop:form.graphicHeight/2+'px solid transparent',
+            borderBottom:form.graphicHeight/2+'px solid transparent',borderRight:form.graphicHeight+'px solid '+form.color,
+            marginRight:form.graphicMargin+'px'}"></div>
+            1
+            <label :style="{marginLeft:form.hyphenLeftMargin+'px'}">-</label> 
+            <input type="text" v-model="form.content" :style="{marginLeft:form.boxMargin+'px',marginRight:form.boxMargin+'px'}" /> 
+            <label :style="{marginRight:form.slashRightMargin+'px'}">/</label>
+            000
+            <div class="triangle-right"  :style="{borderTop:form.graphicHeight/2+'px solid transparent',
+            borderBottom:form.graphicHeight/2+'px solid transparent',borderLeft:form.graphicHeight+'px solid '+form.color,
+            marginLeft:form.graphicMargin+'px'}"></div>
+        </div>
+    </div>
+  </div>
+</section>
+</template>
+ 
+
+<script>
+let findAll = function() {
+  this.$axios.get("/api/accessories/pagination/findAll").then(response => {
+      if (response.data.code == 0) {
+        this.rows = response.data.list;
+      }
+    })
+    .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+};
+
+let fittingSave = function(){
+   this.$axios.post('/api/accessories/pagination/saveOrUpdate', this.form).then(response => {
+     if (response.data.code == 0) {
+        this.findAll()
+        this.form = {}
+      }
+   })
+   .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+}
+
+let fittingEdit = function(index){
+  this.form = this.rows[index]
+}
+
+let settingShow = function(){
+  this.form = {}
+}
+
+let fittingPreview = function(){
+  this.form =  Object.assign({}, this.form_copy)
+}
+
+export default {
+  data() {
+    return {
+      rows: [],
+      form: {},
+      form_copy: {
+        color:'red'
+      }
+    };
+  },
+  mounted: function() {
+    this.findAll();
+  },
+  methods: {
+    findAll,
+    fittingSave,
+    fittingEdit,
+    settingShow,
+    fittingPreview
+  }
+};
+</script>
+
+<style scoped>
+
+#Attribute {
+    padding: 20px 15px 30px;
+}
+#Attribute table tr td {
+    height: 28px;
+    padding: 0;
+}
+
+#Attribute table tr td input[type="text"] {
+    width: 30px;
+}
+
+input[type="radio"] {
+    border-radius:0% 0%;
+}
+
+.triangle-left { 
+width: 0; 
+height: 0; 
+border-top: 7px solid transparent; 
+border-right: 14px solid red; 
+border-bottom: 7px solid transparent; 
+margin-bottom: -2px;
+} 
+
+.triangle-right { 
+width: 0; 
+height: 0; 
+border-top: 7px solid transparent; 
+border-left: 14px solid red; 
+border-bottom: 7px solid transparent; 
+margin-bottom: -2px;
+} 
+
+.pagination_type{
+  display: inline-block;
+  width: 295px;
+  margin-top: 50px;
+}
+
+.pagination_type >input,.pagination_type>div,.pagination_type>label{
+  display: inline-block;
+}
+
+.pagination_type input[type="text"]{
+  width: 30px;
+}
+</style>

+ 133 - 0
src/view/accessories/squareFrame.vue

@@ -0,0 +1,133 @@
+<template>
+<section>
+  <div id="setting" >
+    <div id="Attribute">
+      <div style="color: red;font-weight: bolder;text-align: center;font-size: 14px;">方框</div>
+      <table :title="form && form.id ? '编辑' : '新增' "  :model="form">
+        <tr>
+          <td>名称</td>
+          <td colspan="3"><input type="text" style="width: 108px"  v-model="form_copy.name"/></td>
+        </tr>
+        <tr>
+          <td>框长</td>
+          <td><input type="text" v-model="form_copy.width" /></td>
+          <td>框高</td>
+          <td><input type="text" v-model="form_copy.height"/></td>
+        </tr>
+        <tr>
+          <td>字体</td>
+          <td>
+            <select v-model="form_copy.fontFamily">
+              <option value="黑体">黑体</option>
+              <option value="楷体">楷体</option>
+              <option value="微软雅黑">微软雅黑</option>
+              <option value="宋体">宋体</option>
+            </select>
+          </td>
+          <td>字高</td>
+          <td><input type="text" v-model="form_copy.fontSize"/></td>
+        </tr>
+        <tr>
+          <td colspan="4" style="text-align:left">
+              <input type="radio" v-model="form_copy.textAlign" value="left"  :checked="form.type=='left'" name="textAlign"/>左
+              <input type="text" style="width: 50px" v-model="form_copy.marginLeft" />
+              <input type="radio" v-model="form_copy.textAlign" value="right"  :checked="form.type=='right'" name="textAlign"/>右
+              <input type="text" style="width: 50px" v-model="form_copy.marginRight" />
+          </td>
+        </tr>
+        <tr>
+          <td>字组</td>
+          <td colspan="3"><input type="text" style="width: 108px" v-model="form_copy.content" /></td>
+        </tr>
+        <tr>
+          <td colspan="4"  style="text-align:center">
+            <button type="primary" style="width:50px"   @click="fittingPreview">预览</button>
+            &nbsp;
+            <button type="primary" style="width:50px"  @click="fittingSave">提交</button>
+          </td>
+        </tr>
+      </table>
+    </div>
+    <div id="fitting">
+        <div id="squareFrame" :style="{width:form.width+'px',height:form.height+'px',fontFamily:form.fontFamily,fontSize:form.fontSize+'px',textAlign:form.textAlign,lineHeight:form.height+'px'}">{{form.content}}</div>
+    </div>
+  </div>
+</section>
+</template>
+ 
+
+<script>
+let findAll = function() {
+  this.$axios.get("/api/accessories/squareFrame/findAll").then(response => {
+      if (response.data.code == 0) {
+        this.rows = response.data.list;
+      }
+    })
+    .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+};
+
+let fittingSave = function(){
+   this.$axios.post('/api/accessories/squareFrame/saveOrUpdate', this.form).then(response => {
+     if (response.data.code == 0) {
+        this.findAll()
+        this.form = {}
+      }
+   })
+   .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+}
+
+let fittingEdit = function(index){
+  this.form = this.rows[index]
+}
+
+let settingShow = function(){
+  this.form = {}
+}
+
+let fittingPreview = function(){
+  this.form =  Object.assign({}, this.form_copy)
+}
+
+export default {
+  data() {
+    return {
+      rows: [],
+      form: {},
+      form_copy: {}
+    };
+  },
+  mounted: function() {
+    this.findAll();
+  },
+  methods: {
+    findAll,
+    fittingSave,
+    fittingEdit,
+    settingShow,
+    fittingPreview
+  }
+};
+</script>
+ 
+<style scoped>
+
+#squareFrame {
+  width: 100px;
+  height: 30px;
+  border: 1px solid #000;
+  text-align: center;
+  margin: auto;
+  margin-top: 70px;
+}
+
+#Attribute table tr td {
+    height: 33px;
+    padding: 0;
+}
+</style>

+ 61 - 0
src/view/archives/archives.vue

@@ -0,0 +1,61 @@
+<template>
+    <div class="accessories_page">
+        <div id="child_menu">
+	        <div class="left">
+		        <label>行数</label>
+		        <input type="text" style="width: 40px" v-model="sum_copy"/>
+		        <label @click="changeSum" style="cursor: pointer">确认</label>
+	        </div>
+	        <ul>
+                <li  v-on:click="selectNav('背景图')" v-bind:class="select_nav == '背景图'? 'active' : ''">背景图</li>
+                <li  v-on:click="selectNav('小页面')" v-bind:class="select_nav == '小页面'? 'active' : ''">小页面</li>
+                <li  v-on:click="selectNav('网页')" v-bind:class="select_nav == '网页'? 'active' : ''">网页</li>
+                <li  v-on:click="selectNav('组合')" v-bind:class="select_nav == '组合'? 'active' : ''">组合</li>
+	        </ul>
+            <div class="right">
+                <label>设置</label> &nbsp;&nbsp;&nbsp; <label>删除</label>
+            </div>
+        </div>
+        <child v-bind:sum="this.sum"></child>
+        <div class="tab-container">
+            <div class="container">
+                <div class="tab-container-box" v-if="select_nav == '背景图'"></div>
+                <div class="tab-container-box" v-if="select_nav == '小页面'"></div>
+                <div class="tab-container-box" v-if="select_nav == '网页'"></div>
+                <div class="tab-container-box" v-if="select_nav == '组合'"></div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+import child from '@/components/common/list';
+
+let data = () => {
+  return {
+    collapsed: false,
+	sum:1,
+    sum_copy:1,
+    select_nav: '', //导航选中
+  }
+}
+
+let changeSum = function(){
+    this.sum = this.sum_copy * 8
+}
+
+//选择展示哪个容器
+let selectNav = function(str){
+    this.select_nav = str;
+}
+
+export default {
+    data: data,
+    methods: {
+      changeSum,
+      selectNav
+    },
+    components:{
+      child,
+    }
+}
+</script>

+ 217 - 0
src/view/background.vue

@@ -0,0 +1,217 @@
+<template>
+<section>
+        <div id="child_menu">
+	        <div class="left">
+		        <label>行数</label>
+		        <input type="text" style="width: 40px" v-model="sum_copy"/>
+		        <label @click="changeSum" style="cursor: pointer">确认</label>
+	        </div>
+            <div class="right">
+                <label>设置</label> &nbsp;&nbsp;&nbsp; <label>删除</label>
+            </div>
+        </div>
+        <child v-bind:sum="this.sum"></child>
+  
+  <div id="setting" >
+    <div id="Attribute">
+      <div style="color: red;font-weight: bolder;text-align: center;font-size: 14px;">背景图</div>
+      <table :title="form && form.id ? '编辑' : '新增' "  :model="form">
+        <tr>
+          <td>名称</td>
+          <td colspan="3"><input type="text" style="width: 108px"  v-model="form_copy.name"/></td>
+        </tr>
+        <tr>
+          <td>图宽</td>
+          <td><input type="text" v-model="form_copy.width" /></td>
+          <td>图高</td>
+          <td><input type="text" v-model="form_copy.height"/></td>
+        </tr>
+        <tr>
+          <td colspan="4" style="text-align:left"> 
+            清晰度 <input type="text" v-model="form_copy.opacity" />%
+            &nbsp;
+            <button type="primary" @click="chooseType" style="float:right">上传</button>
+            <input @change="fileChange($event)" type="file" id="upload_file" multiple style="display: none"/>
+          </td>
+        </tr>
+        <tr>
+          <td colspan="4" style="text-align:center;width:156px;" >
+            <button type="primary" style="width:42px" @click="fittingPreview">预览</button>
+            &nbsp;
+           <button type="primary" style="width:42px;" @click="fileUpload">提交</button>
+            &nbsp;
+            <button type="primary" style="width:42px"  @click="fittingSave">删除</button>
+          </td>
+        </tr>
+      </table>
+    </div>
+    <div id="fitting">
+      <img v-bind:src="form.src" id="fitting_img" v-bind:style="{width:form.width+'px',height:form.height+'px',opacity:form.opacity/100}"/>
+    </div>
+  </div>
+</section>
+</template>
+ 
+
+<script>
+
+import child from '@/components/common/list';
+
+let findAll = function() {
+  this.$axios.get("/api/background/background/findAll").then(response => {
+      if (response.data.code == 0) {
+        this.rows = response.data.list;
+      }
+    })
+    .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+};
+
+let fittingSave = function(){
+   this.$axios.post("/api/background/background/saveOrUpdate", this.form).then(response => {
+     if (response.data.code == 0) {
+        this.findAll()
+        this.form = {}
+      }
+   })
+   .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+}
+
+let fittingEdit = function(index){
+  this.form = this.rows[index]
+}
+
+let settingShow = function(){
+  this.form = {}
+}
+
+let chooseType = function(){
+  document.getElementById('upload_file').click();
+}
+
+let fileChange = function(el){
+  if (!el.target.files[0].size) return;
+  this.fileAdd(el.target.files[0]);
+  el.target.value = ''
+}
+
+let fileAdd = function(file){
+  //总大小
+  if(file.size>3145728){
+    alert('请选择3M以内的图片!');
+    return false; 
+  }
+  //判断是否为图片文件
+  if (file.type.indexOf('image') == -1) {
+    this.$dialog.toast({mes: '请选择图片文件'});
+    return false; 
+  } else {
+    let reader = new FileReader();
+    let image = new Image();
+    let _this = this;
+    _this.file = file;
+    reader.readAsDataURL(file);
+    reader.onload = function () {
+      _this.form.src = this.result;
+    }
+  }
+}
+
+let fileUpload = function(){
+  let formData = new FormData();
+  formData.append("file", this.file);
+   this.$axios.post("/api/background/background/upload", formData).then(response => {
+     if (response.data.code == 0) {
+        this.form.src = response.data.url;
+        this.fittingSave()
+      }
+   })
+   .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+}
+
+let changeSum = function(){
+    this.sum = this.sum_copy * 8
+}
+
+let fittingPreview = function(){
+  this.form =  Object.assign({}, this.form_copy)
+}
+
+export default {
+  data() {
+    return {
+      rows: [],
+      form: {
+        src:"img.jpg"
+      },
+	  sum:1,
+      sum_copy:1,
+      file: '',
+      form_copy: {
+        src:"img.jpg"
+      }
+    };
+  },
+  mounted: function() {
+    this.findAll();
+  },
+  methods: {
+    findAll,
+    fittingSave,
+    fittingEdit,
+    settingShow,
+    chooseType,
+    fileChange,
+    fileAdd,
+    fileUpload,
+    changeSum,
+    fittingPreview
+  },
+    components:{
+      child
+    }
+};
+</script>
+ 
+<style scoped>
+
+#Attribute {
+  border: 1px solid #000;
+  padding: 35px 30px;
+  background: #f6fbfe;
+  width: 155px;
+}
+
+#Attribute table tr :nth-child(odd) {
+  text-align: right;
+  width: 30px;
+}
+
+#Attribute table tr td {
+  height: 37px;
+}
+
+#Attribute table tr td input {
+  width: 40px;
+}
+
+#setting > div {
+  float: right;
+  text-align: center;
+}
+
+#fitting img {
+  width: 350px;
+  height: 200px;
+  border: 1px solid #000;
+  text-align: center;
+}
+</style>

+ 61 - 0
src/view/columns/columns.vue

@@ -0,0 +1,61 @@
+<template>
+    <div class="accessories_page">
+        <div id="child_menu">
+	        <div class="left">
+		        <label>行数</label>
+		        <input type="text" style="width: 40px" v-model="sum_copy"/>
+		        <label @click="changeSum" style="cursor: pointer">确认</label>
+	        </div>
+	        <ul>
+                <li  v-on:click="selectNav('单列')" v-bind:class="select_nav == '单列'? 'active' : ''">单列</li>
+                <li  v-on:click="selectNav('多列')" v-bind:class="select_nav == '多列'? 'active' : ''">多列</li>
+	        </ul>
+            <div class="right">
+                <label>设置</label> &nbsp;&nbsp;&nbsp; <label>删除</label>
+            </div>
+        </div>
+        <child v-bind:sum="this.sum"></child>
+        <div class="tab-container">
+            <div class="container">
+                <div class="tab-container-box" v-if="select_nav == '单列'"><singleColumn></singleColumn></div>
+                <div class="tab-container-box" v-if="select_nav == '多列'"><multiColumn></multiColumn></div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+import child from '@/components/common/list';
+import singleColumn from '@/view/columns/singleColumn';
+import multiColumn from '@/view/columns/multiColumn';
+
+let data = () => {
+  return {
+    collapsed: false,
+	sum:1,
+    sum_copy:1,
+    select_nav: '', //导航选中
+  }
+}
+
+let changeSum = function(){
+    this.sum = this.sum_copy * 8
+}
+
+//选择展示哪个容器
+let selectNav = function(str){
+    this.select_nav = str;
+}
+
+export default {
+    data: data,
+    methods: {
+      changeSum,
+      selectNav
+    },
+    components:{
+      child,
+      singleColumn,
+      multiColumn
+    }
+}
+</script>

+ 162 - 0
src/view/columns/multiColumn.vue

@@ -0,0 +1,162 @@
+<template>
+<section>
+  <div id="setting" >
+    <div id="Attribute">
+      <div style="color: red;font-weight: bolder;text-align: center;font-size: 14px;">多 列</div>
+      <table :title="form && form.id ? '编辑' : '新增' "  :model="form">
+        <tr>
+          <td>名称</td>
+          <td colspan="3"><input type="text" v-model="form_copy.name"/></td>
+          <td>宽度</td>
+          <td ><input type="text" style="width:20px;" v-model="form_copy.width" /></td>
+        </tr>
+        <tr>
+          <td colspan="4">
+              高:一层<input type="text" style="width:30px;margin: 0 5px;" v-model="form_copy.heightOne" />
+              二层<input type="text" style="width:30px;margin: 0 5px;" v-model="form_copy.heightTwo" />
+          </td>
+          <td>列数</td>
+          <td ><input type="text" style="width:20px;" v-model="form_copy.columnCount" /></td>
+        </tr>
+        <tr>
+          <td colspan="4">
+              字体
+            <select v-model="form_copy.fontFamily"  style="width:50px;border: #0342c5 1px solid;">
+              <option value="黑体">黑体</option>
+              <option value="楷体">楷体</option>
+              <option value="微软雅黑">微软雅黑</option>
+              <option value="宋体">宋体</option>
+            </select>
+              字高<input type="text" style="width:30px;margin: 0 5px;" v-model="form_copy.fontSize" />
+          </td>
+          <td>字距</td>
+          <td ><input type="text" style="width:20px;" v-model="form_copy.letterSpacing" /></td>
+        </tr>
+        <tr>
+          <td colspan="4">
+              分列宽:1<input type="text" style="width:30px;margin: 0 5px;" v-model="form_copy.heightOne" />
+              2<input type="text" style="width:30px;margin: 0 5px;" v-model="form_copy.heightTwo" />
+          </td>
+          <td>3</td>
+          <td ><input type="text" style="width:20px;" v-model="form_copy.letterSpacing" /></td>
+        </tr>
+        <tr>
+          <td colspan="4">
+             4<input type="text" style="width:30px;margin: 0 5px;" v-model="form_copy.heightOne" />
+             5<input type="text" style="width:30px;margin: 0 5px;" v-model="form_copy.heightOne" />
+             6<input type="text" style="width:30px;margin: 0 5px;" v-model="form_copy.heightOne" />
+          </td>
+          <td>计宽</td>
+          <td ><input type="text" style="width:20px;" v-model="form_copy.letterSpacing" /></td>
+        </tr>
+        <tr>
+          <td>字组</td>
+          <td colspan="5"><input type="text" v-model="form_copy.content" /></td>
+        </tr>
+        <tr>
+          <td colspan="6">
+            <button type="primary"  @click="fittingPreview">键入</button>
+            &nbsp;
+            <button type="primary"  @click="fittingPreview">预览</button>
+            &nbsp;
+            <button type="primary"  @click="fittingSave">提交</button>
+          </td>
+        </tr>
+      </table>
+    </div>
+    <div id="fitting">
+        <table>
+            <tr><td :colspan="form.columnCount" :style="{width:form.width+'px',height:form.heightOne+'px'}"></td></tr>
+            <tr>
+                <td v-for="index in form.columnCount" v-bind:key="index" :style="{height:form.heightTwo+'px'}"></td>
+            </tr>
+            <tr>
+                <td v-for="index in form.columnCount" v-bind:key="index" ></td>
+            </tr>
+        </table>
+    </div>
+  </div>
+</section>
+</template>
+ 
+
+<script>
+let findAll = function() {
+  this.$axios.get("/api/columns/multiColumn/findAll").then(response => {
+      if (response.data.code == 0) {
+        this.rows = response.data.list;
+      }
+    })
+    .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+};
+
+let fittingSave = function(){
+   this.$axios.post('/api/columns/multiColumn/saveOrUpdate', this.form).then(response => {
+     if (response.data.code == 0) {
+        this.findAll()
+        this.form = {}
+      }
+   })
+   .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+}
+
+let fittingEdit = function(index){
+  this.form = this.rows[index]
+}
+
+let settingShow = function(){
+  this.form = {}
+}
+
+let fittingPreview = function(){
+  this.form =  Object.assign({}, this.form_copy)
+}
+
+export default {
+  data() {
+    return {
+      rows: [],
+      form: {
+          columnCount:3
+      },
+      form_copy: {}
+    };
+  },
+  mounted: function() {
+    this.findAll();
+  },
+  methods: {
+    findAll,
+    fittingSave,
+    fittingEdit,
+    settingShow,
+    fittingPreview
+  }
+};
+</script>
+ 
+
+<style scoped>
+#fitting table{
+    border: 1px solid #000;
+    border-collapse: collapse;
+    margin: auto;
+    margin-top: 70px;
+}
+#fitting table tr td{
+    width: 50px;
+    height: 30px;
+    border: 1px solid #000;
+}
+
+#Attribute {
+    padding: 34px 34px;
+    width: 230px;
+}
+</style>

+ 131 - 0
src/view/columns/singleColumn.vue

@@ -0,0 +1,131 @@
+<template>
+<section>
+  <div id="setting" >
+    <div id="Attribute">
+      <div style="color: red;font-weight: bolder;text-align: center;font-size: 14px;">单 列</div>
+      <table :title="form && form.id ? '编辑' : '新增' "  :model="form">
+        <tr>
+          <td>名称</td>
+          <td colspan="3"><input type="text" v-model="form_copy.name"/></td>
+        </tr>
+        <tr>
+          <td>长</td>
+          <td colspan="3">
+            <input type="text" style="width:50px;margin-right: 14px;" v-model="form_copy.width" />
+            高
+            <input type="text" style="width:50px" v-model="form_copy.height"/></td>
+        </tr>
+        <tr>
+          <td>字体</td>
+          <td>
+            <select v-model="form_copy.fontFamily"  style="width:80px;border: #0342c5 1px solid;">
+              <option value="黑体">黑体</option>
+              <option value="楷体">楷体</option>
+              <option value="微软雅黑">微软雅黑</option>
+              <option value="宋体">宋体</option>
+            </select>
+          </td>
+          <td>字高</td>
+          <td><input type="text" v-model="form_copy.fontSize"/></td>
+        </tr>
+        <tr>
+          <td>字距</td>
+          <td colspan="3"><input type="text" v-model="form_copy.letterSpacing" /></td>
+        </tr>
+        <tr>
+          <td>字组</td>
+          <td colspan="3"><input type="text" v-model="form_copy.content" /></td>
+        </tr>
+        <tr>
+          <td colspan="4">
+            <button type="primary"  @click="fittingPreview">预览</button>
+            &nbsp;
+            <button type="primary"  @click="fittingSave">提交</button>
+          </td>
+        </tr>
+      </table>
+    </div>
+    <div id="fitting">
+        <table>
+            <tr><td v-bind:style="{width:form.width+'px',height:form.height+'px',fontFamily:form.fontFamily,fontSize:form.fontSize+'px',letterSpacing:form.letterSpacing+'px'}">{{form.content}}</td></tr>
+            <tr><td></td></tr>
+        </table>
+    </div>
+  </div>
+</section>
+</template>
+ 
+
+<script>
+let findAll = function() {
+  this.$axios.get("/api/columns/singleColumn/findAll").then(response => {
+      if (response.data.code == 0) {
+        this.rows = response.data.list;
+      }
+    })
+    .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+};
+
+let fittingSave = function(){
+   this.$axios.post('/api/columns/singleColumn/saveOrUpdate', this.form).then(response => {
+     if (response.data.code == 0) {
+        this.findAll()
+        this.form = {}
+      }
+   })
+   .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+}
+
+let fittingEdit = function(index){
+  this.form = this.rows[index]
+}
+
+let settingShow = function(){
+  this.form = {}
+}
+
+let fittingPreview = function(){
+  this.form =  Object.assign({}, this.form_copy)
+}
+
+export default {
+  data() {
+    return {
+      rows: [],
+      form: {},
+      form_copy: {}
+    };
+  },
+  mounted: function() {
+    this.findAll();
+  },
+  methods: {
+    findAll,
+    fittingSave,
+    fittingEdit,
+    settingShow,
+    fittingPreview
+  }
+};
+</script>
+ 
+
+<style scoped>
+#fitting table{
+    border: 1px solid #000;
+    border-collapse: collapse;
+    margin: auto;
+    margin-top: 70px;
+}
+#fitting table tr td{
+    width: 50px;
+    height: 30px;
+    border: 1px solid #000;
+}
+</style>

+ 0 - 0
src/view/combination.vue


+ 21 - 0
src/view/layout.vue

@@ -0,0 +1,21 @@
+<template>
+<section>
+<headerBar></headerBar>
+<router-view>
+
+</router-view>
+</section>
+</template>
+<script>
+import headerBar from '@/components/common/header'
+
+export default {
+    name: 'layout',
+    components: {
+        headerBar
+    },
+    data() {
+        return {}
+    }
+}
+</script>

+ 0 - 0
src/view/makeTable.vue


+ 40 - 0
src/view/navigationBar.vue

@@ -0,0 +1,40 @@
+<template>
+<section>
+        <div id="child_menu">
+	        <div class="left">
+		        <label>行数</label>
+		        <input type="text" style="width: 40px" v-model="sum_copy"/>
+		        <label @click="changeSum" style="cursor: pointer">确认</label>
+	        </div>
+            <div class="right">
+                <label>设置</label> &nbsp;&nbsp;&nbsp; <label>删除</label>
+            </div>
+        </div>
+        <child v-bind:sum="this.sum"></child>
+</section>
+</template>
+<script>
+import child from '@/components/common/list';
+
+let data = () => {
+  return {
+    collapsed: false,
+	sum:1,
+    sum_copy:1,
+  }
+}
+
+let changeSum = function(){
+    this.sum = this.sum_copy * 8
+}
+
+export default {
+    data: data,
+    methods: {
+      changeSum
+    },
+    components:{
+      child
+    }
+}
+</script>

+ 0 - 0
src/view/outlyingRow/linkButtomRow.vue


+ 61 - 0
src/view/outlyingRow/outlyingRow.vue

@@ -0,0 +1,61 @@
+<template>
+    <div class="accessories_page">
+        <div id="child_menu">
+	        <div class="left">
+		        <label>行数</label>
+		        <input type="text" style="width: 40px" v-model="sum_copy"/>
+		        <label @click="changeSum" style="cursor: pointer">确认</label>
+	        </div>
+	        <ul>
+                <li  v-on:click="selectNav('线下行')" v-bind:class="select_nav == '线下行'? 'active' : ''">线下行</li>
+                <li  v-on:click="selectNav('表上行')" v-bind:class="select_nav == '表上行'? 'active' : ''">表上行</li>
+                <li  v-on:click="selectNav('表下行')" v-bind:class="select_nav == '表下行'? 'active' : ''">表下行</li>
+                <li  v-on:click="selectNav('框外行')" v-bind:class="select_nav == '框外行'? 'active' : ''">框外行</li>
+	        </ul>
+            <div class="right">
+                <label>设置</label> &nbsp;&nbsp;&nbsp; <label>删除</label>
+            </div>
+        </div>
+        <child v-bind:sum="this.sum"></child>
+        <div class="tab-container">
+            <div class="container">
+                <div class="tab-container-box" v-if="select_nav == '线下行'"></div>
+                <div class="tab-container-box" v-if="select_nav == '表上行'"></div>
+                <div class="tab-container-box" v-if="select_nav == '表下行'"></div>
+                <div class="tab-container-box" v-if="select_nav == '框外行'"></div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+import child from '@/components/common/list';
+
+let data = () => {
+  return {
+    collapsed: false,
+	sum:1,
+    sum_copy:1,
+    select_nav: '', //导航选中
+  }
+}
+
+let changeSum = function(){
+    this.sum = this.sum_copy * 8
+}
+
+//选择展示哪个容器
+let selectNav = function(str){
+    this.select_nav = str;
+}
+
+export default {
+    data: data,
+    methods: {
+      changeSum,
+      selectNav
+    },
+    components:{
+      child,
+    }
+}
+</script>

+ 158 - 0
src/view/tableHead.vue

@@ -0,0 +1,158 @@
+<template>
+<section>
+        <div id="child_menu">
+	        <div class="left">
+		        <label>行数</label>
+		        <input type="text" style="width: 40px" v-model="sum_copy"/>
+		        <label @click="changeSum" style="cursor: pointer">确认</label>
+	        </div>
+            <div class="right">
+                <label>设置</label> &nbsp;&nbsp;&nbsp; <label>删除</label>
+            </div>
+        </div>
+        <child v-bind:sum="this.sum"></child>
+        
+  
+  <div id="setting" >
+    <div id="Attribute">
+      <div style="color: red;font-weight: bolder;text-align: center;font-size: 14px;">抬 头</div>
+      <table :title="form && form.id ? '编辑' : '新增' "  :model="form">
+        <tr>
+          <td>名称</td>
+          <td colspan="3"><input type="text" v-model="form_copy.name"/></td>
+        </tr>
+        <tr>
+          <td>字体</td>
+          <td>
+            <select v-model="form_copy.fontFamily"  style="width:80px;border: #0342c5 1px solid;">
+              <option value="黑体">黑体</option>
+              <option value="楷体">楷体</option>
+              <option value="微软雅黑">微软雅黑</option>
+              <option value="宋体">宋体</option>
+            </select>
+          </td>
+          <td>字高</td>
+          <td><input type="text" v-model="form_copy.fontSize"/></td>
+        </tr>
+        <tr>
+          <td>字距</td>
+          <td colspan="3">
+            <input type="text" style="width:50px;margin-right: 14px;" v-model="form_copy.letterSpacing" />
+            线粗
+            <input type="text" style="width:50px" v-model="form_copy.thickness"/></td>
+        </tr>
+        <tr>
+          <td>长度</td>
+          <td colspan="3">
+            <input type="text" style="width:45px;margin-right: 14px;" v-model="form_copy.width" />
+            距抬头
+            <input type="text" style="width:45px" v-model="form_copy.marginTop"/></td>
+        </tr>
+        <tr>
+          <td>字组</td>
+          <td colspan="3"><input type="text" v-model="form_copy.content" /></td>
+        </tr>
+        <tr>
+          <td colspan="4">
+           <label>着色 <input type="color"  v-model="form_copy.color" style="width: 40px;"/></label>
+            &nbsp;
+            <button type="primary"  @click="fittingPreview">预览</button>
+            &nbsp;
+            <button type="primary"  @click="fittingSave">提交</button>
+          </td>
+        </tr>
+      </table>
+    </div>
+    <div id="fitting">
+      <div style="margin:70px auto 0" :style="{width:form.width+'px',letterSpacing:form.letterSpacing+'px'}">
+          <div>{{form.content}}</div>
+          <hr :style="{borderBottom:form.thickness+'px solid '+form.color,marginTop:form.marginTop+'px'}" />
+      </div>
+    </div>
+  </div>
+</section>
+</template>
+<script>
+import child from '@/components/common/list';
+
+let data = () => {
+  return {
+    collapsed: false,
+	sum:1,
+    sum_copy:1,
+    form_copy:{
+        width:250,
+        color:'red'
+    },
+    form:{
+        width:250,
+        color:'red'
+    }
+  }
+}
+
+let changeSum = function(){
+    this.sum = this.sum_copy * 8
+}
+let findAll = function() {
+  this.$axios.get("/api/columns/singleColumn/findAll").then(response => {
+      if (response.data.code == 0) {
+        this.rows = response.data.list;
+      }
+    })
+    .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+};
+
+let fittingSave = function(){
+   this.$axios.post('/api/columns/singleColumn/saveOrUpdate', this.form).then(response => {
+     if (response.data.code == 0) {
+        this.findAll()
+        this.form = {}
+      }
+   })
+   .catch(error => {
+      console.log(error);
+      this.message = error;
+    });
+}
+
+let fittingEdit = function(index){
+  this.form = this.rows[index]
+}
+
+let settingShow = function(){
+  this.form = {}
+}
+
+let fittingPreview = function(){
+  if(this.form_copy.width=="") this.form_copy.width=0
+  this.form =  Object.assign({}, this.form_copy)
+}
+
+export default {
+    data: data,
+    methods: {
+      findAll,
+      fittingSave,
+      fittingEdit,
+      settingShow,
+      changeSum,
+      fittingPreview
+    },
+    mounted: function() {
+      this.findAll();
+    },
+    components:{
+      child
+    }
+}
+</script>
+<style scoped>
+hr{
+    border: none;
+    border-bottom: red solid 1px;
+}
+</style>

+ 0 - 0
static/.gitkeep