├── .babelrc
├── .editorconfig
├── .gitignore
├── .postcssrc.js
├── README.md
├── build
├── build.js
├── check-versions.js
├── logo.png
├── utils.js
├── vue-loader.conf.js
├── webpack.base.conf-plug.js
├── webpack.base.conf.js
├── webpack.dev.conf.js
├── webpack.dist.prod.conf.js
└── webpack.prod.conf.js
├── config
├── dev.env.js
├── index.js
└── prod.env.js
├── index.html
├── package-lock.json
├── package.json
├── src
├── App.vue
├── assets
│ └── logo.png
├── components
│ └── HelloWorld.vue
├── lib
│ ├── components
│ │ ├── baseCmpts
│ │ │ ├── baseMethos.vue
│ │ │ └── baseTable.vue
│ │ ├── calculation
│ │ │ ├── calcul.vue
│ │ │ ├── checkCalc.vue
│ │ │ ├── index.js
│ │ │ ├── indicator.vue
│ │ │ ├── valculations.vue
│ │ │ └── validitor.vue
│ │ ├── design
│ │ │ ├── attrSet.vue
│ │ │ ├── bindIndicator
│ │ │ │ ├── index.vue
│ │ │ │ └── indicator.vue
│ │ │ ├── excelBorders.vue
│ │ │ ├── excelCellEditr.vue
│ │ │ ├── excelReport.vue
│ │ │ ├── excelResizer.vue
│ │ │ ├── excelToolBar.vue
│ │ │ ├── index.js
│ │ │ ├── inputContentType
│ │ │ │ └── index.vue
│ │ │ ├── inputType
│ │ │ │ ├── index.vue
│ │ │ │ ├── selectionConf.vue
│ │ │ │ └── treeConf.vue
│ │ │ ├── joinIndrs
│ │ │ │ └── index.vue
│ │ │ ├── renderCell.vue
│ │ │ ├── rightMenu.vue
│ │ │ └── setCalculation
│ │ │ │ ├── cellcalc.vue
│ │ │ │ └── index.vue
│ │ ├── edit
│ │ │ ├── editTable.vue
│ │ │ └── index.js
│ │ ├── icon
│ │ │ ├── demo.css
│ │ │ ├── demo_index.html
│ │ │ ├── iconfont.css
│ │ │ ├── iconfont.eot
│ │ │ ├── iconfont.js
│ │ │ ├── iconfont.svg
│ │ │ ├── iconfont.ttf
│ │ │ ├── iconfont.woff
│ │ │ └── iconfont.woff2
│ │ ├── show
│ │ │ ├── index.js
│ │ │ ├── json.js
│ │ │ └── showTable.vue
│ │ ├── test.js
│ │ └── utils
│ │ │ ├── event.js
│ │ │ ├── excel.js
│ │ │ └── toobarEvent.js
│ ├── index.js
│ └── test.json
└── main.js
└── static
├── .gitkeep
└── images
├── calc.png
├── design.png
├── fill.png
└── show.png
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /dist/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Editor directories and files
9 | .idea
10 | .vscode
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/build/build.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | require('./check-versions')()
3 |
4 | process.env.NODE_ENV = 'production'
5 |
6 | const ora = require('ora')
7 | const rm = require('rimraf')
8 | const path = require('path')
9 | const chalk = require('chalk')
10 | const webpack = require('webpack')
11 | const config = require('../config')
12 | // const webpackConfig = require('./webpack.prod.conf')
13 | //配置插件打包
14 | const webpackConfig = process.argv[2] === 'distbuild' ? require('./webpack.dist.prod.conf') : require('./webpack.prod.conf')
15 | const spinner = ora('building for production...')
16 | spinner.start()
17 |
18 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
19 | if (err) throw err
20 | webpack(webpackConfig, (err, stats) => {
21 | spinner.stop()
22 | if (err) throw err
23 | process.stdout.write(stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n')
30 |
31 | if (stats.hasErrors()) {
32 | console.log(chalk.red(' Build failed with errors.\n'))
33 | process.exit(1)
34 | }
35 |
36 | console.log(chalk.cyan(' Build complete.\n'))
37 | console.log(chalk.yellow(
38 | ' Tip: built files are meant to be served over an HTTP server.\n' +
39 | ' Opening index.html over file:// won\'t work.\n'
40 | ))
41 | })
42 | })
43 |
--------------------------------------------------------------------------------
/build/check-versions.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const chalk = require('chalk')
3 | const semver = require('semver')
4 | const packageConfig = require('../package.json')
5 | const shell = require('shelljs')
6 |
7 | function exec (cmd) {
8 | return require('child_process').execSync(cmd).toString().trim()
9 | }
10 |
11 | const versionRequirements = [
12 | {
13 | name: 'node',
14 | currentVersion: semver.clean(process.version),
15 | versionRequirement: packageConfig.engines.node
16 | }
17 | ]
18 |
19 | if (shell.which('npm')) {
20 | versionRequirements.push({
21 | name: 'npm',
22 | currentVersion: exec('npm --version'),
23 | versionRequirement: packageConfig.engines.npm
24 | })
25 | }
26 |
27 | module.exports = function () {
28 | const warnings = []
29 |
30 | for (let i = 0; i < versionRequirements.length; i++) {
31 | const mod = versionRequirements[i]
32 |
33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34 | warnings.push(mod.name + ': ' +
35 | chalk.red(mod.currentVersion) + ' should be ' +
36 | chalk.green(mod.versionRequirement)
37 | )
38 | }
39 | }
40 |
41 | if (warnings.length) {
42 | console.log('')
43 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
44 | console.log()
45 |
46 | for (let i = 0; i < warnings.length; i++) {
47 | const warning = warnings[i]
48 | console.log(' ' + warning)
49 | }
50 |
51 | console.log()
52 | process.exit(1)
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/build/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/build/logo.png
--------------------------------------------------------------------------------
/build/utils.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const config = require('../config')
4 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
5 | const packageConfig = require('../package.json')
6 |
7 | exports.assetsPath = function (_path) {
8 | const assetsSubDirectory = process.env.NODE_ENV === 'production'
9 | ? config.build.assetsSubDirectory
10 | : config.dev.assetsSubDirectory
11 |
12 | return path.posix.join(assetsSubDirectory, _path)
13 | }
14 |
15 | exports.cssLoaders = function (options) {
16 | options = options || {}
17 |
18 | const cssLoader = {
19 | loader: 'css-loader',
20 | options: {
21 | sourceMap: options.sourceMap
22 | }
23 | }
24 |
25 | const postcssLoader = {
26 | loader: 'postcss-loader',
27 | options: {
28 | sourceMap: options.sourceMap
29 | }
30 | }
31 |
32 | // generate loader string to be used with extract text plugin
33 | function generateLoaders (loader, loaderOptions) {
34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
35 |
36 | if (loader) {
37 | loaders.push({
38 | loader: loader + '-loader',
39 | options: Object.assign({}, loaderOptions, {
40 | sourceMap: options.sourceMap
41 | })
42 | })
43 | }
44 |
45 | // Extract CSS when that option is specified
46 | // (which is the case during production build)
47 | if (options.extract) {
48 | return ExtractTextPlugin.extract({
49 | use: loaders,
50 | fallback: 'vue-style-loader'
51 | })
52 | } else {
53 | return ['vue-style-loader'].concat(loaders)
54 | }
55 | }
56 |
57 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html
58 | return {
59 | css: generateLoaders(),
60 | postcss: generateLoaders(),
61 | less: generateLoaders('less'),
62 | sass: generateLoaders('sass', { indentedSyntax: true }),
63 | scss: generateLoaders('sass'),
64 | stylus: generateLoaders('stylus'),
65 | styl: generateLoaders('stylus')
66 | }
67 | }
68 |
69 | // Generate loaders for standalone style files (outside of .vue)
70 | exports.styleLoaders = function (options) {
71 | const output = []
72 | const loaders = exports.cssLoaders(options)
73 |
74 | for (const extension in loaders) {
75 | const loader = loaders[extension]
76 | output.push({
77 | test: new RegExp('\\.' + extension + '$'),
78 | use: loader
79 | })
80 | }
81 |
82 | return output
83 | }
84 |
85 | exports.createNotifierCallback = () => {
86 | const notifier = require('node-notifier')
87 |
88 | return (severity, errors) => {
89 | if (severity !== 'error') return
90 |
91 | const error = errors[0]
92 | const filename = error.file && error.file.split('!').pop()
93 |
94 | notifier.notify({
95 | title: packageConfig.name,
96 | message: severity + ': ' + error.name,
97 | subtitle: filename || '',
98 | icon: path.join(__dirname, 'logo.png')
99 | })
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const config = require('../config')
4 | const isProduction = process.env.NODE_ENV === 'production'
5 | const sourceMapEnabled = isProduction
6 | ? config.build.productionSourceMap
7 | : config.dev.cssSourceMap
8 |
9 | module.exports = {
10 | loaders: utils.cssLoaders({
11 | sourceMap: sourceMapEnabled,
12 | extract: isProduction
13 | }),
14 | cssSourceMap: sourceMapEnabled,
15 | cacheBusting: config.dev.cacheBusting,
16 | transformToRequire: {
17 | video: ['src', 'poster'],
18 | source: 'src',
19 | img: 'src',
20 | image: 'xlink:href'
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/build/webpack.base.conf-plug.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const utils = require('./utils')
4 | const config = require('../config')
5 | const vueLoaderConfig = require('./vue-loader.conf')
6 |
7 | function resolve (dir) {
8 | return path.join(__dirname, '..', dir)
9 | }
10 |
11 |
12 |
13 | module.exports = {
14 | context: path.resolve(__dirname, '../'),
15 | // entry: {
16 | // excel: './lib/index.js'
17 | // },
18 | // output: {
19 | // path: path.resolve(__dirname, '../dist'),
20 | // filename: '[name].js',
21 | // publicPath: process.env.NODE_ENV === 'production'
22 | // ? config.build.assetsPublicPath
23 | // : config.dev.assetsPublicPath
24 | // },
25 | // resolve: {
26 | // extensions: ['.js', '.vue', '.json'],
27 | // alias: {
28 | // 'vue$': 'vue/dist/vue.esm.js',
29 | // '@': resolve('src'),
30 | // }
31 | // },
32 | // module: {
33 | // rules: [
34 | // {
35 | // test: /\.vue$/,
36 | // loader: 'vue-loader',
37 | // options: vueLoaderConfig
38 | // },
39 | // {
40 | // test: /\.js$/,
41 | // loader: 'babel-loader',
42 | // include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
43 | // },
44 | // {
45 | // test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
46 | // loader: 'url-loader',
47 | // options: {
48 | // limit: 10000,
49 | // name: utils.assetsPath('img/[name].[hash:7].[ext]')
50 | // }
51 | // },
52 | // {
53 | // test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
54 | // loader: 'url-loader',
55 | // options: {
56 | // limit: 10000,
57 | // name: utils.assetsPath('media/[name].[hash:7].[ext]')
58 | // }
59 | // },
60 | // {
61 | // test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
62 | // loader: 'url-loader',
63 | // options: {
64 | // limit: 10000,
65 | // name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
66 | // }
67 | // }
68 | // ]
69 | // },
70 | node: {
71 | // prevent webpack from injecting useless setImmediate polyfill because Vue
72 | // source contains it (although only uses it if it's native).
73 | setImmediate: false,
74 | // prevent webpack from injecting mocks to Node native modules
75 | // that does not make sense for the client
76 | dgram: 'empty',
77 | fs: 'empty',
78 | net: 'empty',
79 | tls: 'empty',
80 | child_process: 'empty'
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/build/webpack.base.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const utils = require('./utils')
4 | const config = require('../config')
5 | const vueLoaderConfig = require('./vue-loader.conf')
6 |
7 | function resolve (dir) {
8 | return path.join(__dirname, '..', dir)
9 | }
10 |
11 |
12 |
13 | module.exports = {
14 | context: path.resolve(__dirname, '../'),
15 | entry: {
16 | app: './src/main.js'
17 | },
18 | output: {
19 | path: config.build.assetsRoot,
20 | filename: '[name].js',
21 | publicPath: process.env.NODE_ENV === 'production'
22 | ? config.build.assetsPublicPath
23 | : config.dev.assetsPublicPath
24 | },
25 | resolve: {
26 | extensions: ['.js', '.vue', '.json'],
27 | alias: {
28 | 'vue$': 'vue/dist/vue.esm.js',
29 | '@': resolve('src'),
30 | }
31 | },
32 | module: {
33 | rules: [
34 | {
35 | test: /\.vue$/,
36 | loader: 'vue-loader',
37 | options: vueLoaderConfig
38 | },
39 | {
40 | test: /\.js$/,
41 | loader: 'babel-loader',
42 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
43 | },
44 | {
45 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
46 | loader: 'url-loader',
47 | options: {
48 | limit: 10000,
49 | name: utils.assetsPath('img/[name].[hash:7].[ext]')
50 | }
51 | },
52 | {
53 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
54 | loader: 'url-loader',
55 | options: {
56 | limit: 10000,
57 | name: utils.assetsPath('media/[name].[hash:7].[ext]')
58 | }
59 | },
60 | {
61 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
62 | loader: 'url-loader',
63 | options: {
64 | limit: 10000,
65 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
66 | }
67 | }
68 | ]
69 | },
70 | node: {
71 | // prevent webpack from injecting useless setImmediate polyfill because Vue
72 | // source contains it (although only uses it if it's native).
73 | setImmediate: false,
74 | // prevent webpack from injecting mocks to Node native modules
75 | // that does not make sense for the client
76 | dgram: 'empty',
77 | fs: 'empty',
78 | net: 'empty',
79 | tls: 'empty',
80 | child_process: 'empty'
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/build/webpack.dev.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const webpack = require('webpack')
4 | const config = require('../config')
5 | const merge = require('webpack-merge')
6 | const path = require('path')
7 | const baseWebpackConfig = require('./webpack.base.conf')
8 | const CopyWebpackPlugin = require('copy-webpack-plugin')
9 | const HtmlWebpackPlugin = require('html-webpack-plugin')
10 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
11 | const portfinder = require('portfinder')
12 |
13 | const HOST = process.env.HOST
14 | const PORT = process.env.PORT && Number(process.env.PORT)
15 |
16 | const devWebpackConfig = merge(baseWebpackConfig, {
17 | module: {
18 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
19 | },
20 | // cheap-module-eval-source-map is faster for development
21 | devtool: config.dev.devtool,
22 |
23 | // these devServer options should be customized in /config/index.js
24 | devServer: {
25 | clientLogLevel: 'warning',
26 | historyApiFallback: {
27 | rewrites: [
28 | { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
29 | ],
30 | },
31 | hot: true,
32 | contentBase: false, // since we use CopyWebpackPlugin.
33 | compress: true,
34 | host: HOST || config.dev.host,
35 | port: PORT || config.dev.port,
36 | open: config.dev.autoOpenBrowser,
37 | overlay: config.dev.errorOverlay
38 | ? { warnings: false, errors: true }
39 | : false,
40 | publicPath: config.dev.assetsPublicPath,
41 | proxy: config.dev.proxyTable,
42 | quiet: true, // necessary for FriendlyErrorsPlugin
43 | watchOptions: {
44 | poll: config.dev.poll,
45 | }
46 | },
47 | plugins: [
48 | new webpack.DefinePlugin({
49 | 'process.env': require('../config/dev.env')
50 | }),
51 | new webpack.HotModuleReplacementPlugin(),
52 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
53 | new webpack.NoEmitOnErrorsPlugin(),
54 | // https://github.com/ampedandwired/html-webpack-plugin
55 | new HtmlWebpackPlugin({
56 | filename: 'index.html',
57 | template: 'index.html',
58 | inject: true
59 | }),
60 | // copy custom static assets
61 | new CopyWebpackPlugin([
62 | {
63 | from: path.resolve(__dirname, '../static'),
64 | to: config.dev.assetsSubDirectory,
65 | ignore: ['.*']
66 | }
67 | ])
68 | ]
69 | })
70 |
71 | module.exports = new Promise((resolve, reject) => {
72 | portfinder.basePort = process.env.PORT || config.dev.port
73 | portfinder.getPort((err, port) => {
74 | if (err) {
75 | reject(err)
76 | } else {
77 | // publish the new Port, necessary for e2e tests
78 | process.env.PORT = port
79 | // add port to devServer config
80 | devWebpackConfig.devServer.port = port
81 |
82 | // Add FriendlyErrorsPlugin
83 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
84 | compilationSuccessInfo: {
85 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
86 | },
87 | onErrors: config.dev.notifyOnErrors
88 | ? utils.createNotifierCallback()
89 | : undefined
90 | }))
91 |
92 | resolve(devWebpackConfig)
93 | }
94 | })
95 | })
96 |
--------------------------------------------------------------------------------
/build/webpack.dist.prod.conf.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 打包生成excel.min.js
3 | *(css内嵌在了js里面,没有分离出来)
4 | */
5 | 'use strict'
6 | const path = require('path')
7 | const config = require('../config')
8 | const merge = require('webpack-merge')
9 | const baseWebpackConfig = require('./webpack.base.conf-plug')
10 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
13 | // const CleanWebpackPlugin = require('clean-webpack-plugin')
14 | const vueLoaderConfig = require('./vue-loader.conf')
15 | const utils = require('./utils')
16 |
17 |
18 |
19 | function resolve (dir) {
20 | return path.join(__dirname, '..', dir)
21 | }
22 | const webpackConfig = merge(baseWebpackConfig, {
23 | // mode: 'production',
24 | entry: {
25 | excel: './src/lib'
26 | },
27 | output: {
28 | path: path.resolve(__dirname, '../dist'),
29 | // publicPath: '/dist/',
30 | publicPath: '/',
31 | filename: '[name].min.js',
32 | library: 'vueElementExcel', // library指定的就是你使用require时的模块名,这里便是require("toastPanel")
33 | libraryTarget: 'umd', //libraryTarget会生成不同umd的代码,可以只是commonjs标准的,也可以是指amd标准的,也可以只是通过script标签引入的。
34 | umdNamedDefine: true // 会对 UMD 的构建过程中的 AMD 模块进行命名。否则就使用匿名的 define。
35 | // library: {
36 | // root: 'Excel',
37 | // commonjs: 'excel-public-components',
38 | // },
39 | // libraryTarget: 'umd'
40 | },
41 | resolve: {
42 | extensions: ['.js', '.vue'],
43 | alias: {
44 | 'vue$': 'vue/dist/vue.esm.js'
45 | }
46 | },
47 | module: {
48 | rules: [
49 | {
50 | test: /\.vue$/,
51 | loader: 'vue-loader',
52 | // options: vueLoaderConfig,
53 | },
54 | {
55 | test: /\.(sa|sc|c)ss$/,
56 | use: [
57 | 'vue-style-loader',
58 | 'css-loader',
59 | 'postcss-loader',
60 | 'sass-loader',
61 | ]
62 | },
63 | {
64 | test: /\.less$/,
65 | use: [
66 | 'vue-style-loader',
67 | 'css-loader',
68 | 'postcss-loader',
69 | 'less-loader'
70 | ]
71 | },
72 | {
73 | test: /\.js$/,
74 | loader: 'babel-loader',
75 | include: [resolve('src/lib/components')],
76 | // exclude: /node_modules/
77 | },
78 | {
79 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
80 | loader: 'url-loader',
81 | options: {
82 | limit: 10000,
83 | name: utils.assetsPath('img/[name].[hash:7].[ext]')
84 | }
85 | },
86 | {
87 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
88 | loader: 'url-loader',
89 | options: {
90 | limit: 10000,
91 | name: utils.assetsPath('media/[name].[hash:7].[ext]')
92 | }
93 | },
94 | {
95 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
96 | loader: 'url-loader',
97 | options: {
98 | limit: 10000,
99 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
100 | }
101 | }
102 | ]
103 | },
104 |
105 | // 我们的library打包时不将vue和ElementUI打包进去,由引用library者提供,
106 | // externals: {
107 | // 'vue': 'Vue',
108 | // 'vue-router': 'VueRouter',
109 | // 'element-ui': 'ELEMENT',
110 | // },
111 | // externals: {
112 | // vue: {
113 | // root: 'Vue',
114 | // commonjs: 'vue',
115 | // commonjs2: 'vue',
116 | // amd: 'vue'
117 | // },
118 | // ElementUI: {
119 | // root: 'ElementUI',
120 | // commonjs: 'ElementUI',
121 | // commonjs2: 'ElementUI',
122 | // amd: 'ElementUI'
123 | // }
124 | // },
125 | plugins: [
126 | new UglifyJsPlugin({
127 | uglifyOptions: {
128 | compress: {
129 | warnings: false
130 | }
131 | },
132 | sourceMap: config.build.productionSourceMap,
133 | parallel: true
134 | }),
135 | // extract css into its own file
136 | new ExtractTextPlugin({
137 | filename: utils.assetsPath('css/[name].[contenthash].css'),
138 | // Setting the following option to `false` will not extract CSS from codesplit chunks.
139 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
140 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
141 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
142 | allChunks: true,
143 | }),
144 | // Compress extracted CSS. We are using this plugin so that possible
145 | // duplicated CSS from different components can be deduped.
146 | new OptimizeCSSPlugin({
147 | cssProcessorOptions: config.build.productionSourceMap
148 | ? { safe: true, map: { inline: false } }
149 | : { safe: true }
150 | }),
151 | // new CleanWebpackPlugin(
152 | // ['dist/excel.min.js'],
153 | // {
154 | // root: path.join(__dirname, '../'),
155 | // verbose: true,
156 | // dry: false
157 | // }
158 | // ),
159 | ]
160 | })
161 |
162 | module.exports = webpackConfig
--------------------------------------------------------------------------------
/build/webpack.prod.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const utils = require('./utils')
4 | const webpack = require('webpack')
5 | const config = require('../config')
6 | const merge = require('webpack-merge')
7 | const baseWebpackConfig = require('./webpack.base.conf')
8 | const CopyWebpackPlugin = require('copy-webpack-plugin')
9 | const HtmlWebpackPlugin = require('html-webpack-plugin')
10 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
13 |
14 | const env = require('../config/prod.env')
15 |
16 | const webpackConfig = merge(baseWebpackConfig, {
17 | module: {
18 | rules: utils.styleLoaders({
19 | sourceMap: config.build.productionSourceMap,
20 | extract: true,
21 | usePostCSS: true
22 | })
23 | },
24 | devtool: config.build.productionSourceMap ? config.build.devtool : false,
25 | output: {
26 | path: config.build.assetsRoot,
27 | filename: utils.assetsPath('js/[name].[chunkhash].js'),
28 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
29 | },
30 | plugins: [
31 | // http://vuejs.github.io/vue-loader/en/workflow/production.html
32 | new webpack.DefinePlugin({
33 | 'process.env': env
34 | }),
35 | new UglifyJsPlugin({
36 | uglifyOptions: {
37 | compress: {
38 | warnings: false
39 | }
40 | },
41 | sourceMap: config.build.productionSourceMap,
42 | parallel: true
43 | }),
44 | // extract css into its own file
45 | new ExtractTextPlugin({
46 | filename: utils.assetsPath('css/[name].[contenthash].css'),
47 | // Setting the following option to `false` will not extract CSS from codesplit chunks.
48 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
49 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
50 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
51 | allChunks: true,
52 | }),
53 | // Compress extracted CSS. We are using this plugin so that possible
54 | // duplicated CSS from different components can be deduped.
55 | new OptimizeCSSPlugin({
56 | cssProcessorOptions: config.build.productionSourceMap
57 | ? { safe: true, map: { inline: false } }
58 | : { safe: true }
59 | }),
60 | // generate dist index.html with correct asset hash for caching.
61 | // you can customize output by editing /index.html
62 | // see https://github.com/ampedandwired/html-webpack-plugin
63 | new HtmlWebpackPlugin({
64 | filename: config.build.index,
65 | template: 'index.html',
66 | inject: true,
67 | minify: {
68 | removeComments: true,
69 | collapseWhitespace: true,
70 | removeAttributeQuotes: true
71 | // more options:
72 | // https://github.com/kangax/html-minifier#options-quick-reference
73 | },
74 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin
75 | chunksSortMode: 'dependency'
76 | }),
77 | // keep module.id stable when vendor modules does not change
78 | new webpack.HashedModuleIdsPlugin(),
79 | // enable scope hoisting
80 | new webpack.optimize.ModuleConcatenationPlugin(),
81 | // split vendor js into its own file
82 | new webpack.optimize.CommonsChunkPlugin({
83 | name: 'vendor',
84 | minChunks (module) {
85 | // any required modules inside node_modules are extracted to vendor
86 | return (
87 | module.resource &&
88 | /\.js$/.test(module.resource) &&
89 | module.resource.indexOf(
90 | path.join(__dirname, '../node_modules')
91 | ) === 0
92 | )
93 | }
94 | }),
95 | // extract webpack runtime and module manifest to its own file in order to
96 | // prevent vendor hash from being updated whenever app bundle is updated
97 | new webpack.optimize.CommonsChunkPlugin({
98 | name: 'manifest',
99 | minChunks: Infinity
100 | }),
101 | // This instance extracts shared chunks from code splitted chunks and bundles them
102 | // in a separate chunk, similar to the vendor chunk
103 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
104 | new webpack.optimize.CommonsChunkPlugin({
105 | name: 'app',
106 | async: 'vendor-async',
107 | children: true,
108 | minChunks: 3
109 | }),
110 |
111 | // copy custom static assets
112 | new CopyWebpackPlugin([
113 | {
114 | from: path.resolve(__dirname, '../static'),
115 | to: config.build.assetsSubDirectory,
116 | ignore: ['.*']
117 | }
118 | ])
119 | ]
120 | })
121 |
122 | if (config.build.productionGzip) {
123 | const CompressionWebpackPlugin = require('compression-webpack-plugin')
124 |
125 | webpackConfig.plugins.push(
126 | new CompressionWebpackPlugin({
127 | asset: '[path].gz[query]',
128 | algorithm: 'gzip',
129 | test: new RegExp(
130 | '\\.(' +
131 | config.build.productionGzipExtensions.join('|') +
132 | ')$'
133 | ),
134 | threshold: 10240,
135 | minRatio: 0.8
136 | })
137 | )
138 | }
139 |
140 | if (config.build.bundleAnalyzerReport) {
141 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
142 | webpackConfig.plugins.push(new BundleAnalyzerPlugin())
143 | }
144 |
145 | module.exports = webpackConfig
146 |
--------------------------------------------------------------------------------
/config/dev.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const merge = require('webpack-merge')
3 | const prodEnv = require('./prod.env')
4 |
5 | module.exports = merge(prodEnv, {
6 | NODE_ENV: '"development"'
7 | })
8 |
--------------------------------------------------------------------------------
/config/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | // Template version: 1.3.1
3 | // see http://vuejs-templates.github.io/webpack for documentation.
4 |
5 | const path = require('path')
6 |
7 | module.exports = {
8 | dev: {
9 |
10 | // Paths
11 | assetsSubDirectory: 'static',
12 | assetsPublicPath: '/',
13 | proxyTable: {},
14 |
15 | // Various Dev Server settings
16 | host: '0.0.0.0', // can be overwritten by process.env.HOST
17 | port: 3600, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
18 | autoOpenBrowser: false,
19 | errorOverlay: true,
20 | notifyOnErrors: true,
21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
22 |
23 |
24 | /**
25 | * Source Maps
26 | */
27 |
28 | // https://webpack.js.org/configuration/devtool/#development
29 | devtool: 'cheap-module-eval-source-map',
30 |
31 | // If you have problems debugging vue-files in devtools,
32 | // set this to false - it *may* help
33 | // https://vue-loader.vuejs.org/en/options.html#cachebusting
34 | cacheBusting: true,
35 |
36 | cssSourceMap: true
37 | },
38 |
39 | build: {
40 | // Template for index.html
41 | index: path.resolve(__dirname, '../dist/index.html'),
42 |
43 | // Paths
44 | assetsRoot: path.resolve(__dirname, '../dist'),
45 | assetsSubDirectory: 'static',
46 | assetsPublicPath: '/',
47 |
48 | /**
49 | * Source Maps
50 | */
51 |
52 | productionSourceMap: true,
53 | // https://webpack.js.org/configuration/devtool/#production
54 | devtool: '#source-map',
55 |
56 | // Gzip off by default as many popular static hosts such as
57 | // Surge or Netlify already gzip all static assets for you.
58 | // Before setting to `true`, make sure to:
59 | // npm install --save-dev compression-webpack-plugin
60 | productionGzip: false,
61 | productionGzipExtensions: ['js', 'css'],
62 |
63 | // Run the build command with an extra argument to
64 | // View the bundle analyzer report after build finishes:
65 | // `npm run build --report`
66 | // Set to `true` or `false` to always turn it on or off
67 | bundleAnalyzerReport: process.env.npm_config_report
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | }
5 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | vue-element-excel
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-element-excel",
3 | "version": "1.2.0",
4 | "description": "vue element excel less",
5 | "author": "969739269@qq.com",
6 | "private": false,
7 | "main":"dist/excel.min.js",
8 | "scripts": {
9 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
10 | "plug_build": "node build/build.js distbuild",
11 | "start": "npm run dev",
12 | "build": "node build/build.js"
13 | },
14 | "repository": {
15 | "type": "git",
16 | "url": "https://github.com/HelloWoed/vue-report"
17 | },
18 | "dependencies": {
19 | "element-ui": "^2.8.2",
20 | "less": "^3.9.0",
21 | "sass-loader": "^7.1.0",
22 | "vue": "^2.5.2",
23 | "vue-router": "^3.0.1"
24 | },
25 | "devDependencies": {
26 | "autoprefixer": "^7.1.2",
27 | "babel-core": "^6.22.1",
28 | "babel-helper-vue-jsx-merge-props": "^2.0.3",
29 | "babel-loader": "^7.1.1",
30 | "babel-plugin-syntax-jsx": "^6.18.0",
31 | "babel-plugin-transform-runtime": "^6.22.0",
32 | "babel-plugin-transform-vue-jsx": "^3.5.0",
33 | "babel-preset-env": "^1.3.2",
34 | "babel-preset-stage-2": "^6.22.0",
35 | "chalk": "^2.0.1",
36 | "copy-webpack-plugin": "^4.0.1",
37 | "css-loader": "^0.28.11",
38 | "extract-text-webpack-plugin": "^3.0.0",
39 | "file-loader": "^1.1.4",
40 | "friendly-errors-webpack-plugin": "^1.6.1",
41 | "html-webpack-plugin": "^2.30.1",
42 | "less-loader": "^5.0.0",
43 | "node-notifier": "^5.1.2",
44 | "optimize-css-assets-webpack-plugin": "^3.2.0",
45 | "ora": "^1.2.0",
46 | "portfinder": "^1.0.13",
47 | "postcss-import": "^11.0.0",
48 | "postcss-loader": "^2.0.8",
49 | "postcss-url": "^7.2.1",
50 | "rimraf": "^2.6.0",
51 | "semver": "^5.3.0",
52 | "shelljs": "^0.7.6",
53 | "uglifyjs-webpack-plugin": "^1.1.1",
54 | "url-loader": "^0.5.9",
55 | "vue-loader": "^13.3.0",
56 | "vue-style-loader": "^3.1.2",
57 | "vue-template-compiler": "^2.5.2",
58 | "webpack": "^3.6.0",
59 | "webpack-bundle-analyzer": "^2.9.0",
60 | "webpack-dev-server": "^2.9.1",
61 | "webpack-merge": "^4.1.0"
62 | },
63 | "engines": {
64 | "node": ">= 6.0.0",
65 | "npm": ">= 3.0.0"
66 | },
67 | "browserslist": [
68 | "> 1%",
69 | "last 2 versions",
70 | "not ie <= 8"
71 | ]
72 | }
73 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
17 |
18 |
26 |
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/src/assets/logo.png
--------------------------------------------------------------------------------
/src/lib/components/baseCmpts/baseMethos.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
15 |
16 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/lib/components/calculation/calcul.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 选择指标
12 |
13 |
14 |
15 |
16 |
17 | -
18 | {{index + 1}}
19 | {{parseIndrListLabel(item)}}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
33 |
34 |
40 |
41 |
42 |
43 |
44 | 插入函数
45 |
46 |
47 | -
48 | {{parseExistFunLabel(item)}}
49 |
50 |
51 |
52 |
53 |
插入符号
54 |
55 |
{{ parseSymbolLabel(sym) }}
56 |
57 |
58 |
59 |
60 |
65 |
66 |
70 |
71 |
72 | 完 成
73 |
74 |
75 |
76 |
503 |
570 |
--------------------------------------------------------------------------------
/src/lib/components/calculation/checkCalc.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 核查公式
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/lib/components/calculation/index.js:
--------------------------------------------------------------------------------
1 | import Calculation from './calcul'
2 |
3 | Calculation.install = function(Vue){
4 | Vue.component(Calculation.name,Calculation);
5 | };
6 | export default Calculation
--------------------------------------------------------------------------------
/src/lib/components/calculation/indicator.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
{{dividerOption[0]}}
7 |
8 |
9 |
10 |
11 |
20 |
21 |
22 |
{{dividerOption[1]}}
23 |
24 |
30 |
31 |
32 | 全选
33 |
34 |
35 | {{parseDimensionLabel(item)}}
36 |
37 |
38 |
39 |
40 | 暂无数据
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
{{dividerOption[2]}}
50 |
56 |
57 |
58 |
59 |
60 | 全选
61 |
62 |
63 |
64 | {{parseIndrListLabel(item)}}
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | 暂无数据
73 |
74 |
75 |
76 |
77 |
78 |
79 |
{{dividerOption[3]}}
80 |
86 |
87 |
88 |
89 | {{parseIndrListLabel(indr)}}
90 |
91 |
92 |
93 |
94 |
95 |
96 | 暂无数据
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
304 |
342 |
--------------------------------------------------------------------------------
/src/lib/components/calculation/valculations.vue:
--------------------------------------------------------------------------------
1 |
2 |
29 |
30 |
86 |
116 |
--------------------------------------------------------------------------------
/src/lib/components/calculation/validitor.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 校验公式
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/lib/components/design/attrSet.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 设置
4 |
5 |
6 |
7 | 定义指标
8 |
9 |
10 |
11 |
12 |
13 | 输入内容类型
14 |
15 |
16 |
17 |
18 |
19 | 输入方式
20 |
21 |
22 |
23 |
24 |
25 | 参与计算的指标
26 |
27 |
28 |
29 |
30 |
31 | 设置计算公式
32 |
33 |
34 |
35 |
36 |
37 |
38 |
69 |
77 |
--------------------------------------------------------------------------------
/src/lib/components/design/bindIndicator/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 绑定指标
4 |
9 |
10 |
14 |
15 |
16 |
17 |
48 |
53 |
--------------------------------------------------------------------------------
/src/lib/components/design/bindIndicator/indicator.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
筛选指标
7 |
8 |
9 |
10 |
11 |
20 |
21 |
22 |
维度选择
23 |
24 |
30 |
31 |
32 | 全选
33 |
34 |
35 | {{parseDimensionLabel(item)}}
36 |
37 |
38 |
39 |
40 | 暂无数据
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
可选指标
50 |
56 |
57 |
58 |
59 |
60 |
61 | {{parseIndrListLabel(item)}}
62 |
63 |
64 |
65 |
66 |
67 | 暂无数据
68 |
69 |
70 |
71 |
72 |
73 |
74 |
已选中指标
75 |
76 |
77 | {{parseIndrListLabel(selctedIndictorData)}}
78 |
79 |
80 |
81 |
82 |
83 | 暂无数据
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
213 |
245 |
--------------------------------------------------------------------------------
/src/lib/components/design/excelBorders.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
18 |
19 |
20 |
21 |
306 |
340 |
--------------------------------------------------------------------------------
/src/lib/components/design/excelCellEditr.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
82 |
102 |
--------------------------------------------------------------------------------
/src/lib/components/design/excelResizer.vue:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
101 |
124 |
--------------------------------------------------------------------------------
/src/lib/components/design/excelToolBar.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | 提 交
22 |
23 |
24 |
25 |
26 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 | 确 定
39 |
40 |
41 |
42 |
43 |
44 |
45 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | 确 定
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
230 |
231 |
258 |
--------------------------------------------------------------------------------
/src/lib/components/design/index.js:
--------------------------------------------------------------------------------
1 | import DesignTable from './excelReport'
2 |
3 | DesignTable.install = function(Vue){
4 | Vue.component(DesignTable.name,DesignTable);
5 | }
6 |
7 | export default DesignTable
--------------------------------------------------------------------------------
/src/lib/components/design/inputContentType/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 文本
5 |
6 |
7 | 最少允许输入长度
8 |
9 |
10 |
11 | 个字符
12 |
13 |
14 | 最大允许输入长度
15 |
16 |
17 |
18 | 个字符
19 |
20 |
21 |
22 |
23 | 数字
24 |
25 |
26 |
29 | 是否允许小数
30 |
31 |
32 | 最小值:
33 |
34 |
35 |
36 |
37 |
38 | 最大值:
39 |
40 |
41 |
42 |
43 |
44 |
45 | 小数位:
46 |
47 |
48 |
49 |
50 |
51 | 是否自动补齐小数位数
52 |
53 |
54 |
55 |
56 |
57 | 保 存
58 |
59 |
60 |
61 |
146 |
154 |
--------------------------------------------------------------------------------
/src/lib/components/design/inputType/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
27 |
28 |
128 |
--------------------------------------------------------------------------------
/src/lib/components/design/inputType/selectionConf.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 选择列表
6 |
12 |
13 |
14 | {{parseSelectRadioLabel(item)}}
15 |
16 |
17 |
18 | 暂无数据
19 |
20 |
21 |
22 | 选择项
23 |
24 | 全选
25 |
26 |
27 | {{parseSelectCheckBoxLabel(option)}}
28 |
29 |
30 |
31 |
32 | 暂无数据
33 |
34 |
35 |
36 |
37 |
38 |
106 |
115 |
--------------------------------------------------------------------------------
/src/lib/components/design/inputType/treeConf.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.name}}
9 |
10 |
11 |
12 | 暂无数据
13 |
14 |
15 |
16 |
52 |
61 |
--------------------------------------------------------------------------------
/src/lib/components/design/joinIndrs/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 暂无数据,请设置计算公式
6 |
7 |
8 |
9 |
10 |
11 | {{i + 1 + ' '}}
12 | {{parseIndrListLabel(indr)}}
13 |
14 |
15 |
16 |
17 |
18 |
69 |
81 |
--------------------------------------------------------------------------------
/src/lib/components/design/renderCell.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{cellData.cell_type == 'cell' ? cellData.cell_value : rindex}}
5 |
6 |
7 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
23 |
24 |
25 |
26 |
27 |
33 |
34 |
41 |
42 |
43 | 确定
44 | 清空
45 |
46 |
47 |
48 |
49 |
50 | {{cellData.cell_options.name}}
51 |
52 |
53 |
54 | {{cellData.cell_value}}
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | 固定值单元格不可为空
63 |
64 |
65 | {{cellData.cell_type == 'cell' ? cellData.cell_value : rindex}}
66 |
67 |
68 |
69 |
70 | {{cellData.validRes.value}}
71 |
72 |
73 |
74 |
124 |
164 |
--------------------------------------------------------------------------------
/src/lib/components/design/rightMenu.vue:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
99 |
121 |
122 |
--------------------------------------------------------------------------------
/src/lib/components/design/setCalculation/cellcalc.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
21 |
68 |
--------------------------------------------------------------------------------
/src/lib/components/design/setCalculation/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
设置计算公式
4 |
5 |
6 |
7 |
10 | {{parseIndrListLabel(item)}}
11 |
12 |
13 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
70 |
78 |
--------------------------------------------------------------------------------
/src/lib/components/edit/index.js:
--------------------------------------------------------------------------------
1 | import EditTable from './editTable'
2 |
3 | EditTable.install = function(Vue){
4 | Vue.component(EditTable.name,EditTable)
5 | }
6 |
7 | export default EditTable
--------------------------------------------------------------------------------
/src/lib/components/icon/demo.css:
--------------------------------------------------------------------------------
1 | /* Logo 字体 */
2 | @font-face {
3 | font-family: "iconfont logo";
4 | src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
5 | src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
6 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
7 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
8 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
9 | }
10 |
11 | .logo {
12 | font-family: "iconfont logo";
13 | font-size: 160px;
14 | font-style: normal;
15 | -webkit-font-smoothing: antialiased;
16 | -moz-osx-font-smoothing: grayscale;
17 | }
18 |
19 | /* tabs */
20 | .nav-tabs {
21 | position: relative;
22 | }
23 |
24 | .nav-tabs .nav-more {
25 | position: absolute;
26 | right: 0;
27 | bottom: 0;
28 | height: 42px;
29 | line-height: 42px;
30 | color: #666;
31 | }
32 |
33 | #tabs {
34 | border-bottom: 1px solid #eee;
35 | }
36 |
37 | #tabs li {
38 | cursor: pointer;
39 | width: 100px;
40 | height: 40px;
41 | line-height: 40px;
42 | text-align: center;
43 | font-size: 16px;
44 | border-bottom: 2px solid transparent;
45 | position: relative;
46 | z-index: 1;
47 | margin-bottom: -1px;
48 | color: #666;
49 | }
50 |
51 |
52 | #tabs .active {
53 | border-bottom-color: #f00;
54 | color: #222;
55 | }
56 |
57 | .tab-container .content {
58 | display: none;
59 | }
60 |
61 | /* 页面布局 */
62 | .main {
63 | padding: 30px 100px;
64 | width: 960px;
65 | margin: 0 auto;
66 | }
67 |
68 | .main .logo {
69 | color: #333;
70 | text-align: left;
71 | margin-bottom: 30px;
72 | line-height: 1;
73 | height: 110px;
74 | margin-top: -50px;
75 | overflow: hidden;
76 | *zoom: 1;
77 | }
78 |
79 | .main .logo a {
80 | font-size: 160px;
81 | color: #333;
82 | }
83 |
84 | .helps {
85 | margin-top: 40px;
86 | }
87 |
88 | .helps pre {
89 | padding: 20px;
90 | margin: 10px 0;
91 | border: solid 1px #e7e1cd;
92 | background-color: #fffdef;
93 | overflow: auto;
94 | }
95 |
96 | .icon_lists {
97 | width: 100% !important;
98 | overflow: hidden;
99 | *zoom: 1;
100 | }
101 |
102 | .icon_lists li {
103 | width: 100px;
104 | margin-bottom: 10px;
105 | margin-right: 20px;
106 | text-align: center;
107 | list-style: none !important;
108 | cursor: default;
109 | }
110 |
111 | .icon_lists li .code-name {
112 | line-height: 1.2;
113 | }
114 |
115 | .icon_lists .icon {
116 | display: block;
117 | height: 100px;
118 | line-height: 100px;
119 | font-size: 42px;
120 | margin: 10px auto;
121 | color: #333;
122 | -webkit-transition: font-size 0.25s linear, width 0.25s linear;
123 | -moz-transition: font-size 0.25s linear, width 0.25s linear;
124 | transition: font-size 0.25s linear, width 0.25s linear;
125 | }
126 |
127 | .icon_lists .icon:hover {
128 | font-size: 100px;
129 | }
130 |
131 | .icon_lists .svg-icon {
132 | /* 通过设置 font-size 来改变图标大小 */
133 | width: 1em;
134 | /* 图标和文字相邻时,垂直对齐 */
135 | vertical-align: -0.15em;
136 | /* 通过设置 color 来改变 SVG 的颜色/fill */
137 | fill: currentColor;
138 | /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
139 | normalize.css 中也包含这行 */
140 | overflow: hidden;
141 | }
142 |
143 | .icon_lists li .name,
144 | .icon_lists li .code-name {
145 | color: #666;
146 | }
147 |
148 | /* markdown 样式 */
149 | .markdown {
150 | color: #666;
151 | font-size: 14px;
152 | line-height: 1.8;
153 | }
154 |
155 | .highlight {
156 | line-height: 1.5;
157 | }
158 |
159 | .markdown img {
160 | vertical-align: middle;
161 | max-width: 100%;
162 | }
163 |
164 | .markdown h1 {
165 | color: #404040;
166 | font-weight: 500;
167 | line-height: 40px;
168 | margin-bottom: 24px;
169 | }
170 |
171 | .markdown h2,
172 | .markdown h3,
173 | .markdown h4,
174 | .markdown h5,
175 | .markdown h6 {
176 | color: #404040;
177 | margin: 1.6em 0 0.6em 0;
178 | font-weight: 500;
179 | clear: both;
180 | }
181 |
182 | .markdown h1 {
183 | font-size: 28px;
184 | }
185 |
186 | .markdown h2 {
187 | font-size: 22px;
188 | }
189 |
190 | .markdown h3 {
191 | font-size: 16px;
192 | }
193 |
194 | .markdown h4 {
195 | font-size: 14px;
196 | }
197 |
198 | .markdown h5 {
199 | font-size: 12px;
200 | }
201 |
202 | .markdown h6 {
203 | font-size: 12px;
204 | }
205 |
206 | .markdown hr {
207 | height: 1px;
208 | border: 0;
209 | background: #e9e9e9;
210 | margin: 16px 0;
211 | clear: both;
212 | }
213 |
214 | .markdown p {
215 | margin: 1em 0;
216 | }
217 |
218 | .markdown>p,
219 | .markdown>blockquote,
220 | .markdown>.highlight,
221 | .markdown>ol,
222 | .markdown>ul {
223 | width: 80%;
224 | }
225 |
226 | .markdown ul>li {
227 | list-style: circle;
228 | }
229 |
230 | .markdown>ul li,
231 | .markdown blockquote ul>li {
232 | margin-left: 20px;
233 | padding-left: 4px;
234 | }
235 |
236 | .markdown>ul li p,
237 | .markdown>ol li p {
238 | margin: 0.6em 0;
239 | }
240 |
241 | .markdown ol>li {
242 | list-style: decimal;
243 | }
244 |
245 | .markdown>ol li,
246 | .markdown blockquote ol>li {
247 | margin-left: 20px;
248 | padding-left: 4px;
249 | }
250 |
251 | .markdown code {
252 | margin: 0 3px;
253 | padding: 0 5px;
254 | background: #eee;
255 | border-radius: 3px;
256 | }
257 |
258 | .markdown strong,
259 | .markdown b {
260 | font-weight: 600;
261 | }
262 |
263 | .markdown>table {
264 | border-collapse: collapse;
265 | border-spacing: 0px;
266 | empty-cells: show;
267 | border: 1px solid #e9e9e9;
268 | width: 95%;
269 | margin-bottom: 24px;
270 | }
271 |
272 | .markdown>table th {
273 | white-space: nowrap;
274 | color: #333;
275 | font-weight: 600;
276 | }
277 |
278 | .markdown>table th,
279 | .markdown>table td {
280 | border: 1px solid #e9e9e9;
281 | padding: 8px 16px;
282 | text-align: left;
283 | }
284 |
285 | .markdown>table th {
286 | background: #F7F7F7;
287 | }
288 |
289 | .markdown blockquote {
290 | font-size: 90%;
291 | color: #999;
292 | border-left: 4px solid #e9e9e9;
293 | padding-left: 0.8em;
294 | margin: 1em 0;
295 | }
296 |
297 | .markdown blockquote p {
298 | margin: 0;
299 | }
300 |
301 | .markdown .anchor {
302 | opacity: 0;
303 | transition: opacity 0.3s ease;
304 | margin-left: 8px;
305 | }
306 |
307 | .markdown .waiting {
308 | color: #ccc;
309 | }
310 |
311 | .markdown h1:hover .anchor,
312 | .markdown h2:hover .anchor,
313 | .markdown h3:hover .anchor,
314 | .markdown h4:hover .anchor,
315 | .markdown h5:hover .anchor,
316 | .markdown h6:hover .anchor {
317 | opacity: 1;
318 | display: inline-block;
319 | }
320 |
321 | .markdown>br,
322 | .markdown>p>br {
323 | clear: both;
324 | }
325 |
326 |
327 | .hljs {
328 | display: block;
329 | background: white;
330 | padding: 0.5em;
331 | color: #333333;
332 | overflow-x: auto;
333 | }
334 |
335 | .hljs-comment,
336 | .hljs-meta {
337 | color: #969896;
338 | }
339 |
340 | .hljs-string,
341 | .hljs-variable,
342 | .hljs-template-variable,
343 | .hljs-strong,
344 | .hljs-emphasis,
345 | .hljs-quote {
346 | color: #df5000;
347 | }
348 |
349 | .hljs-keyword,
350 | .hljs-selector-tag,
351 | .hljs-type {
352 | color: #a71d5d;
353 | }
354 |
355 | .hljs-literal,
356 | .hljs-symbol,
357 | .hljs-bullet,
358 | .hljs-attribute {
359 | color: #0086b3;
360 | }
361 |
362 | .hljs-section,
363 | .hljs-name {
364 | color: #63a35c;
365 | }
366 |
367 | .hljs-tag {
368 | color: #333333;
369 | }
370 |
371 | .hljs-title,
372 | .hljs-attr,
373 | .hljs-selector-id,
374 | .hljs-selector-class,
375 | .hljs-selector-attr,
376 | .hljs-selector-pseudo {
377 | color: #795da3;
378 | }
379 |
380 | .hljs-addition {
381 | color: #55a532;
382 | background-color: #eaffea;
383 | }
384 |
385 | .hljs-deletion {
386 | color: #bd2c00;
387 | background-color: #ffecec;
388 | }
389 |
390 | .hljs-link {
391 | text-decoration: underline;
392 | }
393 |
394 | /* 代码高亮 */
395 | /* PrismJS 1.15.0
396 | https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
397 | /**
398 | * prism.js default theme for JavaScript, CSS and HTML
399 | * Based on dabblet (http://dabblet.com)
400 | * @author Lea Verou
401 | */
402 | code[class*="language-"],
403 | pre[class*="language-"] {
404 | color: black;
405 | background: none;
406 | text-shadow: 0 1px white;
407 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
408 | text-align: left;
409 | white-space: pre;
410 | word-spacing: normal;
411 | word-break: normal;
412 | word-wrap: normal;
413 | line-height: 1.5;
414 |
415 | -moz-tab-size: 4;
416 | -o-tab-size: 4;
417 | tab-size: 4;
418 |
419 | -webkit-hyphens: none;
420 | -moz-hyphens: none;
421 | -ms-hyphens: none;
422 | hyphens: none;
423 | }
424 |
425 | pre[class*="language-"]::-moz-selection,
426 | pre[class*="language-"] ::-moz-selection,
427 | code[class*="language-"]::-moz-selection,
428 | code[class*="language-"] ::-moz-selection {
429 | text-shadow: none;
430 | background: #b3d4fc;
431 | }
432 |
433 | pre[class*="language-"]::selection,
434 | pre[class*="language-"] ::selection,
435 | code[class*="language-"]::selection,
436 | code[class*="language-"] ::selection {
437 | text-shadow: none;
438 | background: #b3d4fc;
439 | }
440 |
441 | @media print {
442 |
443 | code[class*="language-"],
444 | pre[class*="language-"] {
445 | text-shadow: none;
446 | }
447 | }
448 |
449 | /* Code blocks */
450 | pre[class*="language-"] {
451 | padding: 1em;
452 | margin: .5em 0;
453 | overflow: auto;
454 | }
455 |
456 | :not(pre)>code[class*="language-"],
457 | pre[class*="language-"] {
458 | background: #f5f2f0;
459 | }
460 |
461 | /* Inline code */
462 | :not(pre)>code[class*="language-"] {
463 | padding: .1em;
464 | border-radius: .3em;
465 | white-space: normal;
466 | }
467 |
468 | .token.comment,
469 | .token.prolog,
470 | .token.doctype,
471 | .token.cdata {
472 | color: slategray;
473 | }
474 |
475 | .token.punctuation {
476 | color: #999;
477 | }
478 |
479 | .namespace {
480 | opacity: .7;
481 | }
482 |
483 | .token.property,
484 | .token.tag,
485 | .token.boolean,
486 | .token.number,
487 | .token.constant,
488 | .token.symbol,
489 | .token.deleted {
490 | color: #905;
491 | }
492 |
493 | .token.selector,
494 | .token.attr-name,
495 | .token.string,
496 | .token.char,
497 | .token.builtin,
498 | .token.inserted {
499 | color: #690;
500 | }
501 |
502 | .token.operator,
503 | .token.entity,
504 | .token.url,
505 | .language-css .token.string,
506 | .style .token.string {
507 | color: #9a6e3a;
508 | background: hsla(0, 0%, 100%, .5);
509 | }
510 |
511 | .token.atrule,
512 | .token.attr-value,
513 | .token.keyword {
514 | color: #07a;
515 | }
516 |
517 | .token.function,
518 | .token.class-name {
519 | color: #DD4A68;
520 | }
521 |
522 | .token.regex,
523 | .token.important,
524 | .token.variable {
525 | color: #e90;
526 | }
527 |
528 | .token.important,
529 | .token.bold {
530 | font-weight: bold;
531 | }
532 |
533 | .token.italic {
534 | font-style: italic;
535 | }
536 |
537 | .token.entity {
538 | cursor: help;
539 | }
540 |
--------------------------------------------------------------------------------
/src/lib/components/icon/iconfont.css:
--------------------------------------------------------------------------------
1 | @font-face {font-family: "iconfont";
2 | src: url('iconfont.eot?t=1557381575077'); /* IE9 */
3 | src: url('iconfont.eot?t=1557381575077#iefix') format('embedded-opentype'), /* IE6-IE8 */
4 | url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABTQAAsAAAAANYAAABSCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCJDArRfL5lATYCJAOBMAtaAAQgBYRtB4UnG8YqRSThrOVEVGyqsv9vCeoYeuqgtk1RLLOspR2EtrbS0jFqGaMcyT2KJYTBu8Qf3PebUioj49172vltPNhpHPYdSsnDf/v9b89ceSLyTdtHbXVoRBKJRKI0CCUdNHT+wE3/JaGQ0CJak5lR87RQY0ZZQuvQdaJdaCdOJiLs/mfdHJgLM2fm3WDr5v2maQCjtMRTbVbdgUx2u5FkD4idigA9tmLKh/42d45E7jwKqxI5FyBVl+bn7M1+PvAfwQ3GeKiQ+1Pza9/aLwyLfUnGvD35c13vyViAfFhyQLj1AAHIyhwAEBq2jRgrotU9LIAA47lX9c/nGSBrnEg0iGNfxmUsW5OyLRSCUMEq0GCLVJQKe/9eZ9YaQuRskBTCotFmFKKmS1HqfZm+/ygGBQwhO6iwNuiksTbOzN/Mnx1SGOpUQFYI7QDBQdFeeRVg0V53RX3V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xv7ybHNH9ULXbHCDhRRJhbz8szldTMTSZbYC58Gn1OZrlIg8zqbD3ooaRqpkLdaWXNAd8NiOnLeeIYndVJMa7dFLhSmgP') format('woff2'),
5 | url('iconfont.woff?t=1557381575077') format('woff'),
6 | url('iconfont.ttf?t=1557381575077') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
7 | url('iconfont.svg?t=1557381575077#iconfont') format('svg'); /* iOS 4.1- */
8 | }
9 |
10 | .iconfont {
11 | font-family: "iconfont" !important;
12 | font-size: 16px;
13 | font-style: normal;
14 | -webkit-font-smoothing: antialiased;
15 | -moz-osx-font-smoothing: grayscale;
16 | }
17 |
18 | .iconzhongduiqi:before {
19 | content: "\e60c";
20 | }
21 |
22 | .icondongjiefene:before {
23 | content: "\e615";
24 | }
25 |
26 | .iconshu:before {
27 | content: "\e662";
28 | }
29 |
30 | .icongaodu:before {
31 | content: "\e65f";
32 | }
33 |
34 | .iconkuandu:before {
35 | content: "\e660";
36 | }
37 |
38 | .iconborder-all:before {
39 | content: "\e667";
40 | }
41 |
42 | .iconformat-horizontal-align-center:before {
43 | content: "\e75f";
44 | }
45 |
46 | .iconformat-vertical-align-center:before {
47 | content: "\e770";
48 | }
49 |
50 | .iconbiaoge:before {
51 | content: "\e600";
52 | }
53 |
54 | .iconzitibeijingse:before {
55 | content: "\e66d";
56 | }
57 |
58 | .iconbaocun:before {
59 | content: "\ec09";
60 | }
61 |
62 | .iconicon_xie:before {
63 | content: "\e636";
64 | }
65 |
66 | .iconborder-top:before {
67 | content: "\e7aa";
68 | }
69 |
70 | .iconborder-right:before {
71 | content: "\e7ab";
72 | }
73 |
74 | .iconborder-verticle:before {
75 | content: "\e7ac";
76 | }
77 |
78 | .iconborder-horizontal:before {
79 | content: "\e7ad";
80 | }
81 |
82 | .iconHdonghua-xiangzuozhankai:before {
83 | content: "\e697";
84 | }
85 |
86 | .iconHdonghua-xiangyouzhankai:before {
87 | content: "\e698";
88 | }
89 |
90 | .iconxieti:before {
91 | content: "\e613";
92 | }
93 |
94 | .iconyinyongziyuan:before {
95 | content: "\e699";
96 | }
97 |
98 | .iconyouduiqi:before {
99 | content: "\ec82";
100 | }
101 |
102 | .iconzitijiacu:before {
103 | content: "\ec83";
104 | }
105 |
106 | .iconzitixiahuaxian:before {
107 | content: "\ec85";
108 | }
109 |
110 | .iconzuoduiqi:before {
111 | content: "\ec86";
112 | }
113 |
114 | .iconzitiyulan:before {
115 | content: "\ec87";
116 | }
117 |
118 | .iconbiaotoushezhi_huabanfuben:before {
119 | content: "\e637";
120 | }
121 |
122 | .iconjisuanqi:before {
123 | content: "\e617";
124 | }
125 |
126 | .iconT-yanse:before {
127 | content: "\e720";
128 | }
129 |
130 | .iconalign-center:before {
131 | content: "\e714";
132 | }
133 |
134 | .iconborder-inner:before {
135 | content: "\e71b";
136 | }
137 |
138 | .iconborder:before {
139 | content: "\e71c";
140 | }
141 |
142 | .iconborder-bottom:before {
143 | content: "\e71d";
144 | }
145 |
146 | .iconsetting:before {
147 | content: "\e74f";
148 | }
149 |
150 | .iconborder-left:before {
151 | content: "\e606";
152 | }
153 |
154 | .iconicon_share:before {
155 | content: "\eb9e";
156 | }
157 |
158 | .iconshangchuan:before {
159 | content: "\e64c";
160 | }
161 |
162 | .iconwujianchaxun:before {
163 | content: "\e672";
164 | }
165 |
166 | .icon-jiesuo:before {
167 | content: "\e7e4";
168 | }
169 |
170 | .iconxitongguanli-jianchayiju:before {
171 | content: "\e601";
172 | }
173 |
174 | .iconshangduiqi:before {
175 | content: "\e671";
176 | }
177 |
178 | .iconxiaduiqi:before {
179 | content: "\e673";
180 | }
181 |
182 | .iconlock-line:before {
183 | content: "\e758";
184 | }
185 |
186 | .iconlock-unlock-line:before {
187 | content: "\e759";
188 | }
189 |
190 |
--------------------------------------------------------------------------------
/src/lib/components/icon/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/src/lib/components/icon/iconfont.eot
--------------------------------------------------------------------------------
/src/lib/components/icon/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/src/lib/components/icon/iconfont.ttf
--------------------------------------------------------------------------------
/src/lib/components/icon/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/src/lib/components/icon/iconfont.woff
--------------------------------------------------------------------------------
/src/lib/components/icon/iconfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/src/lib/components/icon/iconfont.woff2
--------------------------------------------------------------------------------
/src/lib/components/show/index.js:
--------------------------------------------------------------------------------
1 | import ShowTable from './showTable'
2 |
3 | ShowTable.install = function(Vue){
4 | Vue.component(ShowTable.name,ShowTable)
5 | }
6 |
7 | export default ShowTable
--------------------------------------------------------------------------------
/src/lib/components/show/json.js:
--------------------------------------------------------------------------------
1 | [[{ "value": "", "rowspan": 1, "colspan": 1, "type": "cell-col-row-header", "cell_id": "f5f0d77c28c44a12a64e76c9d898895c", "style": {} }, { "value": "A", "rowspan": 1, "colspan": 1, "type": "cell-col-header", "cell_id": "15b6ca3c9b6d4e9fad32e1bc15c06e23", "style": {} }, { "value": "B", "rowspan": 1, "colspan": 1, "type": "cell-col-header", "cell_id": "4b215281266a4d078c9194e67c55636d", "style": {} }, { "value": "C", "rowspan": 1, "colspan": 1, "type": "cell-col-header", "cell_id": "ec25f237500840a889e475b81fa7a253", "style": {} }, { "value": "D", "rowspan": 1, "colspan": 1, "type": "cell-col-header", "cell_id": "bcfaafecbe47406391d59ca1824c09aa", "style": {} }, { "value": "E", "rowspan": 1, "colspan": 1, "type": "cell-col-header", "cell_id": "3a15b86552694c39a098857edcde4fa9", "style": {} }], [{ "value": "", "rowspan": 1, "colspan": 1, "type": "cell-row-header", "cell_id": "022d0d5d31a04c42a6f4fbd9d47fe9a1", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "ffcbcf796a5648bcbaa40ac9ff4fe284", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "dc66ac67c96f4c60837a23f4331a7fe2", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "9d8fe719ef354a7198040e7effc12c29", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "95a160d058174700a875acd223b6c646", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "07dff3ad948b4fb2bfcc77f9e59da169", "style": {} }], [{ "value": "", "rowspan": 1, "colspan": 1, "type": "cell-row-header", "cell_id": "c8af74399c234815bb44a7de20a695f0", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "50d251ff3ca244beb1b32d4ea5acca42", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "4b343b58f8224cba86828016bacf4e2b", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "8f3e9f8ab3164dc2bd105976b7357f70", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "c4bc69487bdf44b896bafe22e4c19f26", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "53c5b0abd4264777b532031b4f68fcbc", "style": {} }], [{ "value": "", "rowspan": 1, "colspan": 1, "type": "cell-row-header", "cell_id": "d90d7662e7b6402993e1ff87d31126ae", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "0ae1a96c57f844c2bd31f410dcb094bb", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "cea93448a2b947ef92b7c965ba0523dc", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "3b4bc98dd155438786218e263c0786ce", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "f801b9c2c10f4acdaf3a896e11e69f08", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "fd2b3960ecfd45dbadf1b81fcfb5eeaa", "style": {} }], [{ "value": "", "rowspan": 1, "colspan": 1, "type": "cell-row-header", "cell_id": "42b61b17d6024d9e89ee0b5c7c80ee4d", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "c65499f8f9eb47f2a8ab0ef392f242e4", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "deb0448028334a85baf3a23cebd164ac", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "788583af4c3943bbb090aaa8617fa8c5", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "c7c949acb4774095abf8d3c65ab4ade8", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "411a6f1ef9ee4d379dfb8d906f6c409d", "style": {} }], [{ "value": "", "rowspan": 1, "colspan": 1, "type": "cell-row-header", "cell_id": "4ac33c63e7854f26aecd6b841f0ea392", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "b8f086a152564dcf9ea1c7776f3581d3", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "efd3fed89afa42758974d1c44c9b6c52", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "c36facb43dc543a08eb5294072020f7f", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "a67953575ee1420d892ce0c3072aeece", "style": {} }, { "value": "", "rowspan": 1, "colspan": 1, "type": "cell", "cell_id": "ce46cdeac4244b2498cff60a1ddb5bf5", "style": {} }]]
--------------------------------------------------------------------------------
/src/lib/components/test.js:
--------------------------------------------------------------------------------
1 | var a = {
2 | cancel(){
3 | this.dialogConf.dialogShow = false
4 | },
5 | onSubmit:function(){
6 | console.log('提交成功');
7 | },
8 | unSubmit:function(){
9 | console.log('取消提交');
10 | this.dialogConf.dialogShow = false
11 | },
12 | mounted:function(){
13 | this.rootStore = this.GetRoot(this);
14 | this.rootStore.页面名称 = {};
15 | }
16 | }
--------------------------------------------------------------------------------
/src/lib/components/utils/event.js:
--------------------------------------------------------------------------------
1 | const bind = (t, func) => {
2 | window.addEventListener(t, func);
3 | }
4 | const unbind = (t, func) => {
5 | window.removeEventListener(t, func)
6 | }
7 | const mouseMoveUp = (movefunc, upfunc) => {
8 | bind('mousemove', movefunc)
9 | const up = (evt) => {
10 | unbind('mousemove', movefunc)
11 | unbind('mouseup', up)
12 | upfunc(evt)
13 | }
14 | bind('mouseup', up)
15 | }
16 |
17 | export {
18 | bind,
19 | unbind,
20 | mouseMoveUp
21 | }
22 |
--------------------------------------------------------------------------------
/src/lib/components/utils/excel.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 生成列头名称
3 | */
4 | export function getBaseColTitle(count){
5 | const baseColTitle = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
6 | let title = [];
7 | baseColTitle.forEach(val=>{
8 | title.push({
9 | value:val,
10 | style:{}
11 | })
12 | })
13 | for(let i = 0;i<26;i++){
14 | for(let j = 0;j<26;j++){
15 | title.push({
16 | value:`${baseColTitle[i]}${baseColTitle[j]}`,
17 | style:{}
18 | })
19 | }
20 | }
21 | return title.splice(0,count);
22 | }
23 | /**
24 | * 获取行数据
25 | * @param {*} count
26 | */
27 | export function getRowData(count){
28 | let rowData = [];
29 | for(let i = 0; i < count;i++){
30 | rowData.push({
31 | value:i,
32 | style:{}
33 | })
34 | }
35 | return rowData;
36 | }
37 | const getId = function(){
38 | var d = new Date().getTime();
39 | var uid = 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
40 | var r = (d + Math.random()*16)%16 | 0;
41 | d = Math.floor(d/16);
42 | return (c=='x' ? r : (r&0x3|0x8)).toString(16);
43 | });
44 | return uid;
45 | }
46 | const getColTpl = function(type){
47 | if(!type)type = 'cell';
48 | return {
49 | cell_value:null,
50 | cell_rowspan:1,
51 | cell_colspan:1,
52 | cell_area_type:'inputArea',
53 | cell_render_type:'text',//单元格默认为text
54 | cell_type:type,
55 | // cell_id:getId(),
56 | // cell_id:'',
57 | cell_style:{width:'100px',background:'#fff'}
58 | }
59 | }
60 | export {getColTpl}
61 | /**
62 | * 初始化数据
63 | * @param {*} rowCount
64 | * @param {*} colCount
65 | */
66 | export function initTableData(rowCount,colCount){
67 | let tableData = [];
68 | let cllTitle = getBaseColTitle(colCount)
69 | for(let i=0;i<=rowCount;i++){
70 | let rowTpl = [];
71 | for(let j=0;j<=colCount;j++){
72 | let colTpl = null;
73 | if(i == 0 && j == 0){
74 | colTpl = getColTpl('cell-col-row-header');
75 | colTpl.cell_style.width = '60px';
76 | colTpl.cell_style.background = '#fff';
77 | }else{
78 | if(i == 0){
79 | colTpl = getColTpl('cell-col-header');
80 | }else if( j == 0){
81 | colTpl = getColTpl('cell-row-header');
82 | colTpl.cell_style.width = '60px'
83 | }else{
84 | colTpl = getColTpl();
85 | }
86 |
87 | }
88 | rowTpl.push(colTpl);
89 | }
90 | tableData.push(rowTpl);
91 | }
92 | return tableData;
93 | }
94 | /**
95 | * 生成插入行列数据
96 | * @param {*} row
97 | * @param {*} col
98 | */
99 | export function getInsertTableData(rowCount,colCount){
100 | let tableData = [];
101 | for(let i = 0;i < rowCount; i++){
102 | let rowTpl = [];
103 | for(let j=0;j<=colCount;j++){
104 | let colTpl = null;
105 | if( j == 0){
106 | colTpl = getColTpl('cell-row-header');
107 | }else{
108 | colTpl = getColTpl();
109 | }
110 | rowTpl.push(colTpl);
111 | }
112 | tableData.push(rowTpl);
113 | }
114 | return tableData;
115 | }
116 | /**
117 | * 获取单元格属性
118 | * @param {*} target
119 | */
120 | export function getAttrs(target){
121 | const { offsetTop, offsetLeft, offsetHeight, offsetWidth } = target;
122 | return {
123 | cellId: target.getAttribute('cell-id'),
124 | row: parseInt(target.getAttribute('row-index')),
125 | col: parseInt(target.getAttribute('col-index')),
126 | rowspan: parseInt(target.getAttribute('rowspan')),
127 | colspan: parseInt(target.getAttribute('colspan')),
128 | areatype: target.getAttribute('areatype'),
129 | left: offsetLeft,
130 | top: offsetTop,
131 | width: offsetWidth,
132 | height: offsetHeight
133 | }
134 | }
135 | /**
136 | * 删除行
137 | */
138 | export function deleteRow(){
139 | this.attrDataConf.rowCount -= 1;
140 | let target = this.borderConf.startTarget;
141 | let tarAttr = getAttrs(target);
142 | let {tableData} = this;
143 | tableData.splice(tarAttr.row,tarAttr.rowspan);
144 | this.$set(this,'tableData',tableData);
145 | }
146 | /**
147 | * 删除列
148 | */
149 | export function deleteCol(){
150 | this.attrDataConf.colCount -= 1;
151 | let target = this.borderConf.startTarget;
152 | let tarAttr = getAttrs(target);
153 | let {tableData} = this;
154 | tableData.forEach(row =>{
155 | row.splice(tarAttr.col,tarAttr.colspan);
156 | });
157 | this.$set(this,'tableData',tableData);
158 | }
159 | /**
160 | * 插入行
161 | * @param {*} num
162 | */
163 | export function insertRow(num){
164 | this.attrDataConf.rowCount = this.attrDataConf.rowCount - 0 + num - 0;
165 | let {tableData} = this;
166 | let target = this.borderConf.startTarget;
167 | let tarAttr = getAttrs(target);
168 | let insertData = getInsertTableData(num,this.attrDataConf.colCount);
169 | insertData.forEach(rowData => {
170 | tableData.splice(tarAttr.row,0,rowData);
171 | })
172 | this.setTableData(tableData);
173 | //触发保存事件
174 | this.toolbarEvent.save.bind(this)(tableData);
175 | }
176 | /**
177 | * 插入列
178 | * @param {*} num
179 | */
180 | export function insertCol(num){
181 | let {tableData} = this;
182 | let target = this.borderConf.startTarget;
183 | let tarAttr = getAttrs(target);
184 | this.attrDataConf.colCount = this.attrDataConf.colCount - 0 + num - 0;
185 | let tableHeaderData = getBaseColTitle(this.attrDataConf.colCount);
186 | this.$set(this,'tableHeaderData',tableHeaderData);
187 | tableData.forEach((row,r) => {
188 | for(let c = 0; c < num; c++){
189 | if(r == 0){
190 | row.splice(tarAttr.col,0,getColTpl('cell-col-header'))
191 | }else{
192 | row.splice(tarAttr.col,0,getColTpl())
193 | }
194 | }
195 | });
196 | this.setTableData(tableData);
197 | //触发保存事件
198 | this.toolbarEvent.save.bind(this)(tableData);
199 | }
200 | /**
201 | * 指标默认数据
202 | * @param {*} node
203 | * @param {*} resolve
204 | */
205 | export function defaultLoadIndr(node, resolve){
206 | if (node.level === 0) {
207 | return resolve([{id:Math.ceil(Math.random()*100000) + new Date().getTime(), name: 'region' }]);
208 | }
209 | if (node.level >= 1) setTimeout(() => {
210 | const data = [{
211 | id:Math.ceil(Math.random()*100000) + new Date().getTime(),
212 | name: 'leaf',
213 | leaf: true
214 | }, {
215 | id:Math.ceil(Math.random()*100000) + new Date().getTime(),
216 | name: 'zone'
217 | }];
218 | return resolve(data);
219 | }, 500);
220 | }
221 | /**
222 | * 数据异步处理方法
223 | */
224 | export function syncMethod(){
225 | let arg = [].slice.call(arguments);
226 | return new Promise((resolve,reject)=>{
227 | arg[0](resolve,...arg.slice(1))
228 | });
229 | }
230 | /**
231 | * 拆分单元格
232 | */
233 | export function splitCell(){
234 | if(this.borderConf.startTarget != this.borderConf.endTarget)return false;
235 | this.paint = this.paintDash.paintInfo;
236 | let attrs = getAttrs(this.borderConf.startTarget);
237 | let tableData = this.getTableData();
238 | delete tableData[attrs.row][attrs.col].cell_style.width
239 | for(let r = this.paint.minRow; r < this.paint.minRow + attrs.rowspan; r++){
240 | for(let c = this.paint.minCol; c < this.paint.minCol + attrs.colspan; c++){
241 | tableData[r][c].cell_colspan = 1;
242 | tableData[r][c].cell_rowspan = 1;
243 | delete tableData[r][c].cell_style.display;
244 | if(r == this.paint.minRow && c == this.paint.minCol)continue;
245 | tableData[r][c].cell_value = '';
246 | };
247 | };
248 | this.setTableData(tableData);
249 | this.$refs.eborder.$emit('updateBorder');
250 | this.$emit('hideMenuBox');
251 | }
252 | export function getRowColMaxSpan(tableData,minRow,maxRow,minCol,maxCol,tarSpan){
253 | let rSpan = []
254 | for(let r = minRow; r < maxRow + 1; r++){
255 | let rSpans = []
256 | for(let c = minCol; c < maxCol + 1; c++){
257 | rSpans.push(tableData[r][c][tarSpan])
258 | }
259 | rSpans = rSpans.sort();
260 | rSpan.push(rSpans[rSpans.length - 1]);
261 | }
262 | let rowSpanRes = 0;
263 | rSpan.forEach(val=>{rowSpanRes += val});
264 | return rowSpanRes;
265 | }
266 | /**
267 | * 合并单元格前先拆分每个单元格
268 | * @param {*} tableData
269 | * @param {*} r
270 | * @param {*} c
271 | * @param {*} $refs
272 | */
273 | export function splitCellItem(tableData,r,c,$refs){
274 | let item = $refs[`cell_${r}_${c}`][0];
275 | let itemAttr = getAttrs(item);
276 | for(let rIndex = itemAttr.row; rIndex < itemAttr.row + itemAttr.rowspan; rIndex++){
277 | for(let cIndex = itemAttr.col; cIndex < itemAttr.col + itemAttr.colspan; cIndex ++){
278 | tableData[rIndex][cIndex].cell_colspan = 1;
279 | tableData[rIndex][cIndex].cell_rowspan = 1;
280 | delete tableData[rIndex][cIndex].cell_style.display;
281 | }
282 | }
283 | }
284 | /**
285 | * 合并单元格
286 | */
287 | export function mergeCell(){
288 | if(this.borderConf.startTarget == this.borderConf.endTarget)return false;
289 | this.paint = this.paintDash.paintInfo;
290 | // let startTarAttr = getAttrs(this.borderConf.startTarget);
291 | // let endTarAttr = getAttrs(this.borderConf.endTarget);
292 | let tableData = this.getTableData();
293 | let mergeCellwidth = [];
294 | for(let r = this.paint.minRow; r <= this.paint.maxRow; r++){
295 | let width = 0;
296 | for(let c = this.paint.minCol; c <= this.paint.maxCol; c++){
297 | width += this.$refs[`cell_${r}_${c}`][0].offsetWidth
298 | if(tableData[r][c].cell_colspan > 1 || tableData[r][c].cell_rowspan > 1){
299 | splitCellItem(tableData,r,c,this.$refs);
300 | }
301 | if(r == this.paint.minRow && c == this.paint.minCol)continue;
302 | tableData[r][c].cell_style.display = 'none';
303 | tableData[r][c].cell_value = '';
304 | };
305 | mergeCellwidth.push(width);
306 | };
307 | mergeCellwidth.sort((a,b)=> b-a);
308 | let rowSpanCount = this.paint.maxRow - this.paint.minRow + 1;
309 | let colSpanCount = this.paint.maxCol - this.paint.minCol + 1;
310 | // let rowSpanCount = getRowColMaxSpan(tableData,this.paint.minRow,this.paint.maxRow,this.paint.minCol,this.paint.maxCol,'cell_rowspan');
311 | // let colSpanCount = getRowColMaxSpan(tableData,this.paint.minRow,this.paint.maxRow,this.paint.minCol,this.paint.maxRow,'cell_colspan');
312 | tableData[this.paint.minRow][this.paint.minCol].cell_rowspan = rowSpanCount;
313 | tableData[this.paint.minRow][this.paint.minCol].cell_colspan = colSpanCount;
314 | tableData[this.paint.minRow][this.paint.minCol].cell_style.width = mergeCellwidth[0] + 'px';
315 | this.setTableData(tableData);
316 | this.$refs.eborder.$emit('updateBorder');
317 | this.$emit('hideMenuBox');
318 | }
--------------------------------------------------------------------------------
/src/lib/components/utils/toobarEvent.js:
--------------------------------------------------------------------------------
1 | class toolbarEvent {
2 | constructor(){
3 |
4 | }
5 | locked(tableData){
6 | console.log('锁定');
7 | console.log(tableData)
8 | }
9 | unlock(tableData){
10 | console.log('解锁');
11 | console.log(tableData)
12 | }
13 | upload(tableData){
14 | console.log('上传');
15 | console.log(tableData)
16 | }
17 | save(tableData){
18 | console.log('保存');
19 | console.log(tableData)
20 | console.log(JSON.stringify(tableData))
21 | }
22 | preview(tableData){
23 | console.log('预览');
24 | console.log(JSON.stringify(tableData));
25 | }
26 | share(tableData){
27 | console.log('分享');
28 | console.log(tableData)
29 | }
30 | tablesetting(tableData){
31 | console.log('表格设置');
32 | console.log(tableData)
33 | }
34 | tableValidate(tableData){
35 | console.log('表格校验');
36 | console.log(tableData)
37 | }
38 | }
39 | export default new toolbarEvent
--------------------------------------------------------------------------------
/src/lib/index.js:
--------------------------------------------------------------------------------
1 | import DesignTable from './components/design'
2 | import EditTable from './components/edit'
3 | import ShowTable from './components/show'
4 | import Calculation from './components/calculation'
5 |
6 | const components = [
7 | DesignTable,
8 | EditTable,
9 | ShowTable,
10 | Calculation
11 | ]
12 | function install(Vue){
13 | components.forEach(component => {
14 | Vue.component(component.name,component)
15 | });
16 | };
17 |
18 | export {
19 | DesignTable,
20 | EditTable,
21 | ShowTable,
22 | Calculation,
23 | install
24 | }
25 |
26 | export default install
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | // The Vue build version to load with the `import` command
2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3 | import Vue from 'vue'
4 | import App from './App'
5 | import ElementUI from 'element-ui';
6 | import 'element-ui/lib/theme-chalk/index.css';
7 |
8 | // import Excel from '../dist/excel.min.js'
9 | // import {DesignTable, EditTable, ShowTable} from './lib'//按需引入
10 | import Excel from './lib'//全部引入
11 |
12 |
13 | Vue.config.productionTip = false
14 | Vue.use(ElementUI);
15 | Vue.use(Excel);
16 | /* eslint-disable no-new */
17 | new Vue({
18 | el: '#app',
19 | components: { App },
20 | template: ''
21 | })
22 |
--------------------------------------------------------------------------------
/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/static/.gitkeep
--------------------------------------------------------------------------------
/static/images/calc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/static/images/calc.png
--------------------------------------------------------------------------------
/static/images/design.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/static/images/design.png
--------------------------------------------------------------------------------
/static/images/fill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/static/images/fill.png
--------------------------------------------------------------------------------
/static/images/show.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HelloWoed/vue-report/3ac3087b2305ef36be780a17b2ae96e6a3836df0/static/images/show.png
--------------------------------------------------------------------------------