ソースを参照

项目初始化

seimin 3 年 前
コミット
303ccc6852
共有100 個のファイルを変更した7267 個の追加6002 個の削除を含む
  1. BIN
      .DS_Store
  2. 21 0
      .babelrc
  3. 1 1
      .editorconfig
  4. 14 0
      .gitignore
  5. 10 0
      .postcssrc.js
  6. 0 96
      PIE.htc
  7. 1 1
      README.md
  8. 0 12
      backgroundsize.min.htc
  9. 41 0
      build/build.js
  10. 54 0
      build/check-versions.js
  11. 9 0
      build/dev-client.js
  12. 89 0
      build/dev-server.js
  13. BIN
      build/logo.png
  14. 125 0
      build/utils.js
  15. 22 0
      build/vue-loader.conf.js
  16. 86 0
      build/webpack.base.conf.js
  17. 97 0
      build/webpack.dev.conf.js
  18. 150 0
      build/webpack.prod.conf.js
  19. 7 0
      config/dev.env.js
  20. 90 0
      config/index.js
  21. 4 0
      config/prod.env.js
  22. BIN
      css/.DS_Store
  23. 0 232
      css/base.css
  24. BIN
      css/iconfont/.DS_Store
  25. 0 385
      css/iconfont/iconfont.css
  26. 0 646
      css/iconfont/iconfont.json
  27. BIN
      css/iconfont/iconfont.woff2
  28. 0 1137
      css/index.css
  29. 0 117
      css/login.css
  30. BIN
      favicon-32x32.png
  31. BIN
      imgs/.DS_Store
  32. BIN
      imgs/6@3x-8.png
  33. BIN
      imgs/8@3x-8.png
  34. BIN
      imgs/BG_login.png
  35. BIN
      imgs/BG_web.png
  36. BIN
      imgs/icon_shangla.png
  37. BIN
      imgs/icon_xiala.png
  38. BIN
      imgs/image_litu.png
  39. BIN
      imgs/image_tiantjiatupian.png
  40. BIN
      imgs/img_wubaoxiu.png
  41. BIN
      imgs/img_wugonggao.png
  42. BIN
      imgs/loading.gif
  43. BIN
      imgs/logo.png
  44. BIN
      imgs/shadow_login.png
  45. 32 1149
      index.html
  46. 0 29
      js/base.js
  47. 0 1388
      js/index.js
  48. 0 6
      js/isLogin.js
  49. 0 105
      js/login.js
  50. 0 8
      libs/base64.min.js
  51. 0 7
      libs/es5-sham.min.js
  52. 0 7
      libs/es5-shim.min.js
  53. 0 8
      libs/html5shiv.js
  54. 0 5
      libs/jquery-1.9.1.min.js
  55. 0 313
      libs/jquery.nicescroll.min.js
  56. 0 281
      libs/jquery.placeholder.js
  57. 0 17
      libs/json3.min.js
  58. 0 3
      libs/template-web.min.js
  59. 0 1
      libs/uuid@latest.js
  60. 0 48
      login.html
  61. 4464 0
      package-lock.json
  62. 79 0
      package.json
  63. 152 0
      src/App.vue
  64. BIN
      src/assets/logo.png
  65. 7 0
      src/common/helpers/create-api.js
  66. 14 0
      src/common/helpers/debug.js
  67. 98 0
      src/common/helpers/dom.js
  68. 3 0
      src/common/helpers/ease.js
  69. 4 0
      src/common/helpers/env.js
  70. 4 0
      src/common/helpers/instantiate-component.js
  71. 43 0
      src/common/helpers/raf.js
  72. 50 0
      src/common/helpers/string-template.js
  73. 207 0
      src/common/helpers/util.js
  74. 3 0
      src/common/helpers/validator/index.js
  75. 44 0
      src/common/helpers/validator/language/chinese.js
  76. 44 0
      src/common/helpers/validator/language/english.js
  77. 18 0
      src/common/helpers/validator/messages.js
  78. 52 0
      src/common/helpers/validator/rules.js
  79. 31 0
      src/common/helpers/validator/types.js
  80. 208 0
      src/common/icon/cube-icon.styl
  81. BIN
      src/common/icon/cubeic.ttf
  82. BIN
      src/common/icon/cubeic.woff
  83. 23 0
      src/common/js/date.js
  84. 61 0
      src/common/js/util.js
  85. 109 0
      src/common/lang/date.js
  86. 12 0
      src/common/lang/string.js
  87. 51 0
      src/common/locale/index.js
  88. 44 0
      src/common/mixins/basic-picker.js
  89. 22 0
      src/common/mixins/deprecated.js
  90. 25 0
      src/common/mixins/locale.js
  91. 34 0
      src/common/mixins/picker.js
  92. 12 0
      src/common/mixins/popup.js
  93. 11 0
      src/common/mixins/scroll.js
  94. 45 0
      src/common/mixins/visibility.js
  95. 93 0
      src/common/stylus/base.styl
  96. 5 0
      src/common/stylus/index.styl
  97. 63 0
      src/common/stylus/mixin.styl
  98. 55 0
      src/common/stylus/reset.styl
  99. 224 0
      src/common/stylus/theme/default.styl
  100. 0 0
      src/common/stylus/var/box-shadow.styl

BIN
.DS_Store


+ 21 - 0
.babelrc

@@ -0,0 +1,21 @@
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": [
12
+    "transform-vue-jsx", 
13
+    ["transform-runtime"],
14
+    ["transform-modules", {
15
+      "cube-ui": {
16
+        "transform": "./node_modules/cube-ui/src/modules/${member}",
17
+        "kebabCase": true
18
+      }
19
+    }]
20
+  ]
21
+}

+ 1 - 1
.editorconfig

@@ -6,4 +6,4 @@ indent_style = space
6 6
 indent_size = 2
7 7
 end_of_line = lf
8 8
 insert_final_newline = true
9
-trim_trailing_whitespace = true
9
+trim_trailing_whitespace = true

+ 14 - 0
.gitignore

@@ -0,0 +1,14 @@
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

+ 10 - 0
.postcssrc.js

@@ -0,0 +1,10 @@
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
+}

File diff suppressed because it is too large
+ 0 - 96
PIE.htc


+ 1 - 1
README.md

@@ -1,2 +1,2 @@
1
-# ITSM3-PC-Repair
1
+# ITSM3-service-wechat
2 2
 

File diff suppressed because it is too large
+ 0 - 12
backgroundsize.min.htc


+ 41 - 0
build/build.js

@@ -0,0 +1,41 @@
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 spinner = ora('building for production...')
15
+spinner.start()
16
+
17
+rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18
+  if (err) throw err
19
+  webpack(webpackConfig, (err, stats) => {
20
+    spinner.stop()
21
+    if (err) throw err
22
+    process.stdout.write(stats.toString({
23
+      colors: true,
24
+      modules: false,
25
+      children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
26
+      chunks: false,
27
+      chunkModules: false
28
+    }) + '\n\n')
29
+
30
+    if (stats.hasErrors()) {
31
+      console.log(chalk.red('  Build failed with errors.\n'))
32
+      process.exit(1)
33
+    }
34
+
35
+    console.log(chalk.cyan('  Build complete.\n'))
36
+    console.log(chalk.yellow(
37
+      '  Tip: built files are meant to be served over an HTTP server.\n' +
38
+      '  Opening index.html over file:// won\'t work.\n'
39
+    ))
40
+  })
41
+})

+ 54 - 0
build/check-versions.js

@@ -0,0 +1,54 @@
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
+}

+ 9 - 0
build/dev-client.js

@@ -0,0 +1,9 @@
1
+/* eslint-disable */
2
+require('eventsource-polyfill')
3
+var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
4
+
5
+hotClient.subscribe(function (event) {
6
+  if (event.action === 'reload') {
7
+    window.location.reload()
8
+  }
9
+})

+ 89 - 0
build/dev-server.js

@@ -0,0 +1,89 @@
1
+require('./check-versions')()
2
+
3
+var config = require('../config')
4
+if (!process.env.NODE_ENV) {
5
+  process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
6
+}
7
+
8
+var opn = require('opn')
9
+var path = require('path')
10
+var express = require('express')
11
+var webpack = require('webpack')
12
+var proxyMiddleware = require('http-proxy-middleware')
13
+var webpackConfig = require('./webpack.dev.conf')
14
+
15
+// default port where dev server listens for incoming traffic
16
+var port = process.env.PORT || config.dev.port
17
+// automatically open browser, if not set will be false
18
+var autoOpenBrowser = !!config.dev.autoOpenBrowser
19
+// Define HTTP proxies to your custom API backend
20
+// https://github.com/chimurai/http-proxy-middleware
21
+var proxyTable = config.dev.proxyTable
22
+
23
+var app = express()
24
+var compiler = webpack(webpackConfig)
25
+
26
+var devMiddleware = require('webpack-dev-middleware')(compiler, {
27
+  publicPath: webpackConfig.output.publicPath,
28
+  quiet: true
29
+})
30
+
31
+var hotMiddleware = require('webpack-hot-middleware')(compiler, {
32
+  log: () => {}
33
+})
34
+// force page reload when html-webpack-plugin template changes
35
+compiler.plugin('compilation', function (compilation) {
36
+  compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
37
+    hotMiddleware.publish({ action: 'reload' })
38
+    cb()
39
+  })
40
+})
41
+
42
+// proxy api requests
43
+Object.keys(proxyTable).forEach(function (context) {
44
+  var options = proxyTable[context]
45
+  if (typeof options === 'string') {
46
+    options = { target: options }
47
+  }
48
+  app.use(proxyMiddleware(options.filter || context, options))
49
+})
50
+
51
+// handle fallback for HTML5 history API
52
+app.use(require('connect-history-api-fallback')())
53
+
54
+// serve webpack bundle output
55
+app.use(devMiddleware)
56
+
57
+// enable hot-reload and state-preserving
58
+// compilation error display
59
+app.use(hotMiddleware)
60
+
61
+// serve pure static assets
62
+var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
63
+app.use(staticPath, express.static('./static'))
64
+
65
+var uri = 'http://localhost:' + port
66
+
67
+var _resolve
68
+var readyPromise = new Promise(resolve => {
69
+  _resolve = resolve
70
+})
71
+
72
+console.log('> Starting dev server...')
73
+devMiddleware.waitUntilValid(() => {
74
+  console.log('> Listening at ' + uri + '\n')
75
+  // when env is testing, don't need open it
76
+  if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
77
+    opn(uri)
78
+  }
79
+  _resolve()
80
+})
81
+
82
+var server = app.listen(port)
83
+
84
+module.exports = {
85
+  ready: readyPromise,
86
+  close: () => {
87
+    server.close()
88
+  }
89
+}

BIN
build/logo.png


+ 125 - 0
build/utils.js

@@ -0,0 +1,125 @@
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
+// var cssLoader = {
7
+//   loader: 'css-loader',
8
+//     options: {
9
+//     sourceMap: options.sourceMap
10
+//   }
11
+// }
12
+// var px2remLoader = {
13
+//   loader: 'px2rem-loader',
14
+//     options: {
15
+//     remUnit: 75
16
+//   }
17
+// }
18
+
19
+exports.assetsPath = function (_path) {
20
+  const assetsSubDirectory = process.env.NODE_ENV === 'production'
21
+    ? config.build.assetsSubDirectory
22
+    : config.dev.assetsSubDirectory
23
+
24
+  return path.posix.join(assetsSubDirectory, _path)
25
+}
26
+
27
+exports.cssLoaders = function (options) {
28
+  options = options || {}
29
+
30
+  const cssLoader = {
31
+    loader: 'css-loader',
32
+    options: {
33
+      sourceMap: options.sourceMap
34
+    }
35
+  }
36
+
37
+  const postcssLoader = {
38
+    loader: 'postcss-loader',
39
+    options: {
40
+      sourceMap: options.sourceMap
41
+    }
42
+  }
43
+  const px2remLoader = {
44
+    loader: 'px2rem-loader',
45
+      options: {
46
+      remUnit: 60
47
+    }
48
+  }
49
+
50
+  const stylusOptions = {
51
+    'resolve url': true
52
+  }
53
+
54
+  // generate loader string to be used with extract text plugin
55
+  function generateLoaders (loader, loaderOptions) {
56
+    const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader];
57
+    // var loaders = [cssLoader, px2remLoader]
58
+
59
+    if (loader) {
60
+      loaders.push({
61
+        loader: loader + '-loader',
62
+        options: Object.assign({}, loaderOptions, {
63
+          sourceMap: options.sourceMap
64
+        })
65
+      })
66
+    }
67
+
68
+    // Extract CSS when that option is specified
69
+    // (which is the case during production build)
70
+    if (options.extract) {
71
+      return ExtractTextPlugin.extract({
72
+        use: loaders,
73
+        fallback: 'vue-style-loader',
74
+        publicPath:'../../'
75
+      })
76
+    } else {
77
+      return ['vue-style-loader'].concat(loaders)
78
+    }
79
+  }
80
+
81
+  // https://vue-loader.vuejs.org/en/configurations/extract-css.html
82
+  return {
83
+    css: generateLoaders(),
84
+    postcss: generateLoaders(),
85
+    less: generateLoaders('less'),
86
+    sass: generateLoaders('sass', { indentedSyntax: true }),
87
+    scss: generateLoaders('sass'),
88
+    stylus: generateLoaders('stylus', stylusOptions),
89
+    styl: generateLoaders('stylus', stylusOptions)
90
+  }
91
+}
92
+
93
+// Generate loaders for standalone style files (outside of .vue)
94
+exports.styleLoaders = function (options) {
95
+  const output = []
96
+  const loaders = exports.cssLoaders(options)
97
+
98
+  for (const extension in loaders) {
99
+    const loader = loaders[extension]
100
+    output.push({
101
+      test: new RegExp('\\.' + extension + '$'),
102
+      use: loader
103
+    })
104
+  }
105
+
106
+  return output
107
+}
108
+
109
+exports.createNotifierCallback = () => {
110
+  const notifier = require('node-notifier')
111
+
112
+  return (severity, errors) => {
113
+    if (severity !== 'error') return
114
+
115
+    const error = errors[0]
116
+    const filename = error.file && error.file.split('!').pop()
117
+
118
+    notifier.notify({
119
+      title: packageConfig.name,
120
+      message: severity + ': ' + error.name,
121
+      subtitle: filename || '',
122
+      icon: path.join(__dirname, 'logo.png')
123
+    })
124
+  }
125
+}

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

@@ -0,0 +1,22 @@
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
+}

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

@@ -0,0 +1,86 @@
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: 90000,
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: 90000,
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: 90000,
65
+          name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
66
+        }
67
+      },
68
+      {
69
+        test: /\.less$/,
70
+        loader: "style-loader!css-loader!less-loader"
71
+      }
72
+    ]
73
+  },
74
+  node: {
75
+    // prevent webpack from injecting useless setImmediate polyfill because Vue
76
+    // source contains it (although only uses it if it's native).
77
+    setImmediate: false,
78
+    // prevent webpack from injecting mocks to Node native modules
79
+    // that does not make sense for the client
80
+    dgram: 'empty',
81
+    fs: 'empty',
82
+    net: 'empty',
83
+    tls: 'empty',
84
+    child_process: 'empty'
85
+  }
86
+}

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

@@ -0,0 +1,97 @@
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
+const PostCompilePlugin = require('webpack-post-compile-plugin')
13
+
14
+const HOST = process.env.HOST
15
+const PORT = process.env.PORT && Number(process.env.PORT)
16
+
17
+const devWebpackConfig = merge(baseWebpackConfig, {
18
+  module: {
19
+    rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
20
+  },
21
+  // cheap-module-eval-source-map is faster for development
22
+  devtool: config.dev.devtool,
23
+
24
+  // these devServer options should be customized in /config/index.js
25
+  devServer: {
26
+    clientLogLevel: 'warning',
27
+    historyApiFallback: {
28
+      rewrites: [
29
+        { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
30
+      ],
31
+    },
32
+    hot: true,
33
+    contentBase: false, // since we use CopyWebpackPlugin.
34
+    compress: true,
35
+    host: HOST || config.dev.host,
36
+    port: PORT || config.dev.port,
37
+    open: config.dev.autoOpenBrowser,
38
+    overlay: config.dev.errorOverlay
39
+      ? { warnings: false, errors: true }
40
+      : false,
41
+    publicPath: config.dev.assetsPublicPath,
42
+    proxy: config.dev.proxyTable,
43
+    quiet: true, // necessary for FriendlyErrorsPlugin
44
+    watchOptions: {
45
+      poll: config.dev.poll,
46
+    }
47
+  },
48
+  plugins: [
49
+    new webpack.DefinePlugin({
50
+      'process.env': require('../config/dev.env')
51
+    }),
52
+    new webpack.HotModuleReplacementPlugin(),
53
+    new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
54
+    new webpack.NoEmitOnErrorsPlugin(),
55
+    // https://github.com/ampedandwired/html-webpack-plugin
56
+    new HtmlWebpackPlugin({
57
+      filename: 'index.html',
58
+      template: 'index.html',
59
+      inject: true
60
+    }),
61
+    // copy custom static assets
62
+    new CopyWebpackPlugin([
63
+      {
64
+        from: path.resolve(__dirname, '../static'),
65
+        to: config.dev.assetsSubDirectory,
66
+        ignore: ['.*']
67
+      }
68
+    ]),
69
+    new PostCompilePlugin()
70
+  ]
71
+})
72
+
73
+module.exports = new Promise((resolve, reject) => {
74
+  portfinder.basePort = process.env.PORT || config.dev.port
75
+  portfinder.getPort((err, port) => {
76
+    if (err) {
77
+      reject(err)
78
+    } else {
79
+      // publish the new Port, necessary for e2e tests
80
+      process.env.PORT = port
81
+      // add port to devServer config
82
+      devWebpackConfig.devServer.port = port
83
+
84
+      // Add FriendlyErrorsPlugin
85
+      devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
86
+        compilationSuccessInfo: {
87
+          messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
88
+        },
89
+        onErrors: config.dev.notifyOnErrors
90
+        ? utils.createNotifierCallback()
91
+        : undefined
92
+      }))
93
+
94
+      resolve(devWebpackConfig)
95
+    }
96
+  })
97
+})

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

@@ -0,0 +1,150 @@
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
+            // 以下两行配置,关闭 debug 和 console
40
+          drop_debugger: true,
41
+          drop_console: true
42
+        }
43
+      },
44
+      sourceMap: config.build.productionSourceMap,
45
+      parallel: true
46
+    }),
47
+    // extract css into its own file
48
+    new ExtractTextPlugin({
49
+      filename: utils.assetsPath('css/[name].[contenthash].css'),
50
+      // Setting the following option to `false` will not extract CSS from codesplit chunks.
51
+      // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
52
+      // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 
53
+      // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
54
+      allChunks: true,
55
+    }),
56
+    // Compress extracted CSS. We are using this plugin so that possible
57
+    // duplicated CSS from different components can be deduped.
58
+    new OptimizeCSSPlugin({
59
+      cssProcessorOptions: config.build.productionSourceMap
60
+        ? { safe: true, map: { inline: false } }
61
+        : { safe: true }
62
+    }),
63
+    // generate dist index.html with correct asset hash for caching.
64
+    // you can customize output by editing /index.html
65
+    // see https://github.com/ampedandwired/html-webpack-plugin
66
+    new HtmlWebpackPlugin({
67
+      filename: config.build.index,
68
+      template: 'index.html',
69
+      inject: true,
70
+      minify: {
71
+        removeComments: true,
72
+        collapseWhitespace: true,
73
+        removeAttributeQuotes: true
74
+        // more options:
75
+        // https://github.com/kangax/html-minifier#options-quick-reference
76
+      },
77
+      // necessary to consistently work with multiple chunks via CommonsChunkPlugin
78
+      chunksSortMode: 'dependency'
79
+    }),
80
+    // keep module.id stable when vendor modules does not change
81
+    new webpack.HashedModuleIdsPlugin(),
82
+    // enable scope hoisting
83
+    new webpack.optimize.ModuleConcatenationPlugin(),
84
+    // split vendor js into its own file
85
+    new webpack.optimize.CommonsChunkPlugin({
86
+      name: 'vendor',
87
+      minChunks (module) {
88
+        // any required modules inside node_modules are extracted to vendor
89
+        return (
90
+          module.resource &&
91
+          /\.js$/.test(module.resource) &&
92
+          module.resource.indexOf(
93
+            path.join(__dirname, '../node_modules')
94
+          ) === 0
95
+        )
96
+      }
97
+    }),
98
+    // extract webpack runtime and module manifest to its own file in order to
99
+    // prevent vendor hash from being updated whenever app bundle is updated
100
+    new webpack.optimize.CommonsChunkPlugin({
101
+      name: 'manifest',
102
+      minChunks: Infinity
103
+    }),
104
+    // This instance extracts shared chunks from code splitted chunks and bundles them
105
+    // in a separate chunk, similar to the vendor chunk
106
+    // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
107
+    new webpack.optimize.CommonsChunkPlugin({
108
+      name: 'app',
109
+      async: 'vendor-async',
110
+      children: true,
111
+      minChunks: 3
112
+    }),
113
+
114
+    // copy custom static assets
115
+    new CopyWebpackPlugin([
116
+      {
117
+        from: path.resolve(__dirname, '../static'),
118
+        to: config.build.assetsSubDirectory,
119
+        ignore: ['.*']
120
+      }
121
+    ])
122
+  ]
123
+})
124
+
125
+if (config.build.productionGzip) {
126
+  const CompressionWebpackPlugin = require('compression-webpack-plugin')
127
+
128
+  webpackConfig.plugins.push(
129
+    new CompressionWebpackPlugin({
130
+     asset: '[path].gz[query]',// 原配置报错:ValidationError: Compression Plugin Invalid Options
131
+    //  filename: '[path].gz[query]', // 将asset 修改为 filename 后又报错:TypeError: Cannot read property 'emit' of undefined,执行以下操作:npm install --save-dev compression-webpack-plugin@1.1.12
132
+     
133
+      algorithm: 'gzip',
134
+      test: new RegExp(
135
+        '\\.(' +
136
+        config.build.productionGzipExtensions.join('|') +
137
+        ')$'
138
+      ),
139
+      threshold: 10240,
140
+      minRatio: 0.8
141
+    })
142
+  )
143
+}
144
+
145
+if (config.build.bundleAnalyzerReport) {
146
+  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
147
+  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
148
+}
149
+
150
+module.exports = webpackConfig

+ 7 - 0
config/dev.env.js

@@ -0,0 +1,7 @@
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
+})

+ 90 - 0
config/index.js

@@ -0,0 +1,90 @@
1
+'use strict'
2
+// Template version: 1.3.1
3
+// see http://vuejs-templates.github.io/webpack for documentation.
4
+
5
+
6
+const path = require('path')
7
+const host=require('../src/request/host')
8
+module.exports = {
9
+  dev: {
10
+    // 新加的一行
11
+    env: require('./dev.env'),
12
+    // Paths
13
+    assetsSubDirectory: 'static',
14
+    assetsPublicPath: '/',
15
+    proxyTable: {
16
+      '/service': { //自定义名字,代表的是以下target中的内容
17
+        target: host.host+'/service/', //微信
18
+        // target: 'http://weixintest.ngser.dashitech.com/service/',//微信
19
+
20
+        // target: 'http://192.168.3.100:8080/service/',//微信
21
+        // target: 'http://localhost/service/',//微信
22
+        changeOrigin: true, //是否允许跨域
23
+        pathRewrite: {
24
+          '^/service': ''
25
+        }
26
+      }
27
+    },
28
+
29
+    // Various Dev Server settings
30
+    host: 'localhost', // can be overwritten by process.env.HOST
31
+    // host: '192.168.3.170', // can be overwritten by process.env.HOST
32
+    // host: '192.168.31.32', // can be overwritten by process.env.HOST
33
+    // host: '192.168.31.32', // can be overwritten by process.env.HOST
34
+    // host: '0.0.0.0', // can be overwritten by process.env.HOST
35
+    port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
36
+    // 住了的4行
37
+    autoOpenBrowser: true,
38
+    // errorOverlay: true,
39
+    // notifyOnErrors: true,
40
+    // poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
41
+
42
+
43
+    /**
44
+     * Source Maps
45
+     */
46
+
47
+    // https://webpack.js.org/configuration/devtool/#development
48
+    // 住了一行
49
+    // devtool: 'cheap-module-eval-source-map',
50
+
51
+    // If you have problems debugging vue-files in devtools,
52
+    // set this to false - it *may* help
53
+    // https://vue-loader.vuejs.org/en/options.html#cachebusting
54
+    // 住了的
55
+    // cacheBusting: true,
56
+
57
+    cssSourceMap: true
58
+  },
59
+
60
+  build: {
61
+    // Template for index.html
62
+    index: path.resolve(__dirname, '../dist/index.html'),
63
+
64
+    // Paths
65
+    assetsRoot: path.resolve(__dirname, '../dist'),
66
+    assetsSubDirectory: 'static',
67
+    assetsPublicPath: './',
68
+
69
+    /**
70
+     * Source Maps
71
+     */
72
+
73
+    productionSourceMap: false, // 把该项的配置修改为 false,关闭 source map
74
+    // https://webpack.js.org/configuration/devtool/#production
75
+    devtool: '#source-map',
76
+
77
+    // Gzip off by default as many popular static hosts such as
78
+    // Surge or Netlify already gzip all static assets for you.
79
+    // Before setting to `true`, make sure to:
80
+    // npm install --save-dev compression-webpack-plugin
81
+    productionGzip: true, // 开启 gzip 功能, 开启 GZIP 压缩,进一步压缩 js 和 css 文件的体积
82
+    productionGzipExtensions: ['js', 'css'],
83
+
84
+    // Run the build command with an extra argument to
85
+    // View the bundle analyzer report after build finishes:
86
+    // `npm run build --report`
87
+    // Set to `true` or `false` to always turn it on or off
88
+    bundleAnalyzerReport: process.env.npm_config_report
89
+  }
90
+}

+ 4 - 0
config/prod.env.js

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

BIN
css/.DS_Store


+ 0 - 232
css/base.css

@@ -1,232 +0,0 @@
1
-/*格式化样式*/
2
-
3
-body,
4
-div,
5
-dl,
6
-dt,
7
-dd,
8
-ul,
9
-ol,
10
-li,
11
-h1,
12
-h2,
13
-h3,
14
-h4,
15
-h5,
16
-h6,
17
-pre,
18
-form,
19
-fieldset,
20
-input,
21
-textarea,
22
-p,
23
-blockquote,
24
-th,
25
-td {
26
-    margin: 0;
27
-    padding: 0;
28
-}
29
-
30
-table {
31
-    border-collapse: collapse;
32
-    border-spacing: 0;
33
-}
34
-
35
-fieldset,
36
-img {
37
-    border: 0
38
-}
39
-
40
-address,
41
-caption,
42
-cite,
43
-code,
44
-dfn,
45
-em,
46
-strong,
47
-th,
48
-b,
49
-var {
50
-    font-style: normal;
51
-    font-weight: normal
52
-}
53
-
54
-ol,
55
-ul {
56
-    list-style: none
57
-}
58
-
59
-caption,
60
-th {
61
-    text-align: left
62
-}
63
-
64
-h1,
65
-h2,
66
-h3,
67
-h4,
68
-h5,
69
-h6 {
70
-    font-size: 100%;
71
-    font-weight: normal
72
-}
73
-
74
-q:before,
75
-q:after {
76
-    content: ''
77
-}
78
-
79
-abbr,
80
-acronym {
81
-    border: 0
82
-}
83
-
84
-* {
85
-    padding: 0px;
86
-    margin: 0px;
87
-    text-align: left;
88
-    font-family: 'PingFangSC-Regular', '微软雅黑', Arial, Verdana, Tahoma, "宋体", Helvetica, sans-serif;
89
-    line-height: 150%;
90
-    box-sizing: border-box;
91
-}
92
-
93
-html {
94
-    width: 100%;
95
-    height: 100%;
96
-    font-size: 14px;
97
-    color: #333;
98
-    overflow: hidden;
99
-}
100
-
101
-body {
102
-    width: 100%;
103
-    height: 100%;
104
-    font-size: 14px;
105
-    text-align: center;
106
-    color: #333;
107
-    overflow: hidden;
108
-}
109
-
110
-table {
111
-    border-collapse: collapse;
112
-}
113
-
114
-td {
115
-    padding: 3px;
116
-}
117
-
118
-img {
119
-    border: none;
120
-    vertical-align: middle;
121
-}
122
-
123
-input {
124
-    padding: 1px;
125
-    vertical-align: middle;
126
-    line-height: normal;
127
-}
128
-
129
-input:focus {
130
-    outline: none;
131
-}
132
-
133
-.main-box {
134
-    margin-right: auto;
135
-    margin-left: auto;
136
-    width: 960px;
137
-    clear: both;
138
-    zoom: 1;
139
-    overflow: hidden;
140
-    background-color: #CCCCCC;
141
-}
142
-
143
-.text-overflow-hidden {
144
-    white-space: nowrap;
145
-    word-spacing: normal;
146
-    letter-spacing: normal;
147
-    overflow: hidden;
148
-}
149
-
150
-.box-align-center {
151
-    margin-right: auto;
152
-    margin-left: auto;
153
-}
154
-
155
-
156
-/*css定义超链接四个状态也有顺序的。*/
157
-
158
-a:link,
159
-a:visited {
160
-    text-decoration: none;
161
-    color: #1F376D;
162
-}
163
-
164
-a:hover,
165
-a:active {
166
-    text-decoration: underline;
167
-    color: #BD0A01;
168
-    border: none;
169
-}
170
-
171
-.fl {
172
-    float: left;
173
-}
174
-
175
-.fr {
176
-    float: right;
177
-}
178
-
179
-.clearfix:after {
180
-    content: '';
181
-    display: block;
182
-    clear: both;
183
-    visibility: hidden;
184
-}
185
-
186
-.clearfix {
187
-    *zoom: 1;
188
-}
189
-
190
-.iconfont {
191
-    font-family: "iconfont";
192
-    font-style: normal;
193
-    -webkit-font-smoothing: antialiased;
194
-    -webkit-text-stroke-width: 0.2px;
195
-    -moz-osx-font-smoothing: grayscale;
196
-    color: #005395;
197
-    font-size: 18px;
198
-}
199
-
200
-.bolderFont {
201
-    font-weight: 600;
202
-}
203
-
204
-
205
-/* 超出部分隐藏 展示行数 */
206
-
207
-.firstLine {
208
-    -webkit-line-clamp: 1;
209
-}
210
-
211
-.secondLine {
212
-    -webkit-line-clamp: 2;
213
-}
214
-
215
-.required {
216
-    color: #fe2a44;
217
-    margin-right: 4px;
218
-}
219
-
220
-.oneline {
221
-    overflow: hidden;
222
-    text-overflow: ellipsis;
223
-    white-space: nowrap;
224
-}
225
-
226
-.twoline {
227
-    overflow: hidden;
228
-    text-overflow: ellipsis;
229
-    -webkit-line-clamp: 2;
230
-    -webkit-box-orient: vertical;
231
-    display: -webkit-box;
232
-}

BIN
css/iconfont/.DS_Store


File diff suppressed because it is too large
+ 0 - 385
css/iconfont/iconfont.css


+ 0 - 646
css/iconfont/iconfont.json

@@ -1,646 +0,0 @@
1
-{
2
-  "id": "460359",
3
-  "name": "华科项目微信端",
4
-  "font_family": "iconfont",
5
-  "css_prefix_text": "dsit-",
6
-  "description": "",
7
-  "glyphs": [
8
-    {
9
-      "icon_id": "51703",
10
-      "name": "编辑",
11
-      "font_class": "bianji2",
12
-      "unicode": "e69a",
13
-      "unicode_decimal": 59034
14
-    },
15
-    {
16
-      "icon_id": "402659",
17
-      "name": "维修保养",
18
-      "font_class": "weixiubaoyang",
19
-      "unicode": "e6d8",
20
-      "unicode_decimal": 59096
21
-    },
22
-    {
23
-      "icon_id": "553903",
24
-      "name": "公告",
25
-      "font_class": "gonggao",
26
-      "unicode": "e67c",
27
-      "unicode_decimal": 59004
28
-    },
29
-    {
30
-      "icon_id": "691081",
31
-      "name": "列表",
32
-      "font_class": "liebiao1",
33
-      "unicode": "e65b",
34
-      "unicode_decimal": 58971
35
-    },
36
-    {
37
-      "icon_id": "693129",
38
-      "name": "我要报修",
39
-      "font_class": "woyaobaoxiu",
40
-      "unicode": "e63d",
41
-      "unicode_decimal": 58941
42
-    },
43
-    {
44
-      "icon_id": "774369",
45
-      "name": "公告",
46
-      "font_class": "gonggao1",
47
-      "unicode": "e611",
48
-      "unicode_decimal": 58897
49
-    },
50
-    {
51
-      "icon_id": "777643",
52
-      "name": "问题",
53
-      "font_class": "question",
54
-      "unicode": "e60e",
55
-      "unicode_decimal": 58894
56
-    },
57
-    {
58
-      "icon_id": "786893",
59
-      "name": "添加",
60
-      "font_class": "tianjia",
61
-      "unicode": "e608",
62
-      "unicode_decimal": 58888
63
-    },
64
-    {
65
-      "icon_id": "919538",
66
-      "name": "新建",
67
-      "font_class": "xinjian",
68
-      "unicode": "e60f",
69
-      "unicode_decimal": 58895
70
-    },
71
-    {
72
-      "icon_id": "1027920",
73
-      "name": "向左",
74
-      "font_class": "xiangzuo",
75
-      "unicode": "e641",
76
-      "unicode_decimal": 58945
77
-    },
78
-    {
79
-      "icon_id": "1240786",
80
-      "name": "主题",
81
-      "font_class": "zhuti",
82
-      "unicode": "e61b",
83
-      "unicode_decimal": 58907
84
-    },
85
-    {
86
-      "icon_id": "1259918",
87
-      "name": "首页",
88
-      "font_class": "shouye",
89
-      "unicode": "e622",
90
-      "unicode_decimal": 58914
91
-    },
92
-    {
93
-      "icon_id": "1323503",
94
-      "name": "错",
95
-      "font_class": "false-circle",
96
-      "unicode": "e601",
97
-      "unicode_decimal": 58881
98
-    },
99
-    {
100
-      "icon_id": "1370534",
101
-      "name": "我的",
102
-      "font_class": "wode",
103
-      "unicode": "e632",
104
-      "unicode_decimal": 58930
105
-    },
106
-    {
107
-      "icon_id": "1377416",
108
-      "name": "录音_30",
109
-      "font_class": "luyin",
110
-      "unicode": "e638",
111
-      "unicode_decimal": 58936
112
-    },
113
-    {
114
-      "icon_id": "1586405",
115
-      "name": "更多",
116
-      "font_class": "gengduo",
117
-      "unicode": "e61d",
118
-      "unicode_decimal": 58909
119
-    },
120
-    {
121
-      "icon_id": "1615621",
122
-      "name": "新建",
123
-      "font_class": "icon-text-newlybuild",
124
-      "unicode": "e672",
125
-      "unicode_decimal": 58994
126
-    },
127
-    {
128
-      "icon_id": "1625721",
129
-      "name": "保修申请",
130
-      "font_class": "baoxiushenqing",
131
-      "unicode": "e613",
132
-      "unicode_decimal": 58899
133
-    },
134
-    {
135
-      "icon_id": "1630976",
136
-      "name": "巡检",
137
-      "font_class": "xunjian",
138
-      "unicode": "e603",
139
-      "unicode_decimal": 58883
140
-    },
141
-    {
142
-      "icon_id": "1646824",
143
-      "name": "待受理3",
144
-      "font_class": "daishouli",
145
-      "unicode": "e68d",
146
-      "unicode_decimal": 59021
147
-    },
148
-    {
149
-      "icon_id": "1728073",
150
-      "name": "受理中1",
151
-      "font_class": "shoulizhong",
152
-      "unicode": "e6a4",
153
-      "unicode_decimal": 59044
154
-    },
155
-    {
156
-      "icon_id": "1745077",
157
-      "name": "受理完成",
158
-      "font_class": "shouliwancheng",
159
-      "unicode": "e6a5",
160
-      "unicode_decimal": 59045
161
-    },
162
-    {
163
-      "icon_id": "1998573",
164
-      "name": "播放",
165
-      "font_class": "bofang",
166
-      "unicode": "e61a",
167
-      "unicode_decimal": 58906
168
-    },
169
-    {
170
-      "icon_id": "2097163",
171
-      "name": "查看",
172
-      "font_class": "chakan",
173
-      "unicode": "e692",
174
-      "unicode_decimal": 59026
175
-    },
176
-    {
177
-      "icon_id": "2133986",
178
-      "name": "审核",
179
-      "font_class": "shenhe",
180
-      "unicode": "e831",
181
-      "unicode_decimal": 59441
182
-    },
183
-    {
184
-      "icon_id": "2237405",
185
-      "name": "编辑",
186
-      "font_class": "bianji1",
187
-      "unicode": "e60a",
188
-      "unicode_decimal": 58890
189
-    },
190
-    {
191
-      "icon_id": "2437089",
192
-      "name": "待我处理的-工单",
193
-      "font_class": "daiwochulide",
194
-      "unicode": "e6cd",
195
-      "unicode_decimal": 59085
196
-    },
197
-    {
198
-      "icon_id": "2468749",
199
-      "name": "事件列表_睿松",
200
-      "font_class": "shijianliebiao_ruisong",
201
-      "unicode": "e60d",
202
-      "unicode_decimal": 58893
203
-    },
204
-    {
205
-      "icon_id": "2468751",
206
-      "name": "事件列表_睿松 (2)",
207
-      "font_class": "shijianliebiao_ruisong1",
208
-      "unicode": "e612",
209
-      "unicode_decimal": 58898
210
-    },
211
-    {
212
-      "icon_id": "2492912",
213
-      "name": "设备巡检",
214
-      "font_class": "shebeixunjian",
215
-      "unicode": "e609",
216
-      "unicode_decimal": 58889
217
-    },
218
-    {
219
-      "icon_id": "2587903",
220
-      "name": "新建工单",
221
-      "font_class": "xinjiangongdan",
222
-      "unicode": "e6f3",
223
-      "unicode_decimal": 59123
224
-    },
225
-    {
226
-      "icon_id": "2593815",
227
-      "name": "工单列表",
228
-      "font_class": "gongdanliebiao",
229
-      "unicode": "e644",
230
-      "unicode_decimal": 58948
231
-    },
232
-    {
233
-      "icon_id": "2616503",
234
-      "name": "问题",
235
-      "font_class": "wenti",
236
-      "unicode": "e643",
237
-      "unicode_decimal": 58947
238
-    },
239
-    {
240
-      "icon_id": "2675116",
241
-      "name": "搜索",
242
-      "font_class": "sousuo",
243
-      "unicode": "e633",
244
-      "unicode_decimal": 58931
245
-    },
246
-    {
247
-      "icon_id": "2768891",
248
-      "name": "我的",
249
-      "font_class": "wode3",
250
-      "unicode": "e602",
251
-      "unicode_decimal": 58882
252
-    },
253
-    {
254
-      "icon_id": "2786893",
255
-      "name": "默认头像",
256
-      "font_class": "morentouxiang",
257
-      "unicode": "e63e",
258
-      "unicode_decimal": 58942
259
-    },
260
-    {
261
-      "icon_id": "2797467",
262
-      "name": "返回",
263
-      "font_class": "fanhui",
264
-      "unicode": "e626",
265
-      "unicode_decimal": 58918
266
-    },
267
-    {
268
-      "icon_id": "2808233",
269
-      "name": "编辑",
270
-      "font_class": "bianji",
271
-      "unicode": "e627",
272
-      "unicode_decimal": 58919
273
-    },
274
-    {
275
-      "icon_id": "2838759",
276
-      "name": "我的",
277
-      "font_class": "wode1",
278
-      "unicode": "e6c0",
279
-      "unicode_decimal": 59072
280
-    },
281
-    {
282
-      "icon_id": "2856816",
283
-      "name": "对",
284
-      "font_class": "dui",
285
-      "unicode": "e647",
286
-      "unicode_decimal": 58951
287
-    },
288
-    {
289
-      "icon_id": "2923743",
290
-      "name": "故障报警",
291
-      "font_class": "guzhangbaojing",
292
-      "unicode": "e60c",
293
-      "unicode_decimal": 58892
294
-    },
295
-    {
296
-      "icon_id": "3122226",
297
-      "name": "一级-服务管理",
298
-      "font_class": "yiji-fuwuguanli",
299
-      "unicode": "eabd",
300
-      "unicode_decimal": 60093
301
-    },
302
-    {
303
-      "icon_id": "3176124",
304
-      "name": "知识库",
305
-      "font_class": "zhishiku2",
306
-      "unicode": "e76b",
307
-      "unicode_decimal": 59243
308
-    },
309
-    {
310
-      "icon_id": "3182520",
311
-      "name": "已逾期",
312
-      "font_class": "yiyuqi",
313
-      "unicode": "e61f",
314
-      "unicode_decimal": 58911
315
-    },
316
-    {
317
-      "icon_id": "3182521",
318
-      "name": "即将逾期",
319
-      "font_class": "jijiangyuqi",
320
-      "unicode": "e620",
321
-      "unicode_decimal": 58912
322
-    },
323
-    {
324
-      "icon_id": "3183889",
325
-      "name": "逾期",
326
-      "font_class": "yuqi",
327
-      "unicode": "e621",
328
-      "unicode_decimal": 58913
329
-    },
330
-    {
331
-      "icon_id": "3208382",
332
-      "name": "展开",
333
-      "font_class": "mulu",
334
-      "unicode": "e63a",
335
-      "unicode_decimal": 58938
336
-    },
337
-    {
338
-      "icon_id": "3223175",
339
-      "name": "向右",
340
-      "font_class": "xiangyou",
341
-      "unicode": "e6bd",
342
-      "unicode_decimal": 59069
343
-    },
344
-    {
345
-      "icon_id": "3262027",
346
-      "name": "C 拍照",
347
-      "font_class": "paizhao",
348
-      "unicode": "e697",
349
-      "unicode_decimal": 59031
350
-    },
351
-    {
352
-      "icon_id": "4207913",
353
-      "name": "我的",
354
-      "font_class": "wode2",
355
-      "unicode": "e607",
356
-      "unicode_decimal": 58887
357
-    },
358
-    {
359
-      "icon_id": "4341108",
360
-      "name": "评分",
361
-      "font_class": "pingfen-copy",
362
-      "unicode": "e600",
363
-      "unicode_decimal": 58880
364
-    },
365
-    {
366
-      "icon_id": "4510419",
367
-      "name": "主页",
368
-      "font_class": "zhuye",
369
-      "unicode": "e610",
370
-      "unicode_decimal": 58896
371
-    },
372
-    {
373
-      "icon_id": "4747741",
374
-      "name": "常见问题 (1)",
375
-      "font_class": "changjianwenti",
376
-      "unicode": "e62b",
377
-      "unicode_decimal": 58923
378
-    },
379
-    {
380
-      "icon_id": "4747742",
381
-      "name": "新建 (1)",
382
-      "font_class": "xinjian1",
383
-      "unicode": "e62c",
384
-      "unicode_decimal": 58924
385
-    },
386
-    {
387
-      "icon_id": "4747743",
388
-      "name": "首页-服务指南",
389
-      "font_class": "shouye-fuwuzhinan",
390
-      "unicode": "e62d",
391
-      "unicode_decimal": 58925
392
-    },
393
-    {
394
-      "icon_id": "4754426",
395
-      "name": "公告填充",
396
-      "font_class": "gonggaotianchong",
397
-      "unicode": "e62e",
398
-      "unicode_decimal": 58926
399
-    },
400
-    {
401
-      "icon_id": "4754427",
402
-      "name": "报修列表",
403
-      "font_class": "baoxiuliebiao",
404
-      "unicode": "e62f",
405
-      "unicode_decimal": 58927
406
-    },
407
-    {
408
-      "icon_id": "4754428",
409
-      "name": "手机",
410
-      "font_class": "shouji",
411
-      "unicode": "e630",
412
-      "unicode_decimal": 58928
413
-    },
414
-    {
415
-      "icon_id": "4754429",
416
-      "name": "常见问题",
417
-      "font_class": "changjianwenti1",
418
-      "unicode": "e631",
419
-      "unicode_decimal": 58929
420
-    },
421
-    {
422
-      "icon_id": "4844199",
423
-      "name": "首页",
424
-      "font_class": "ic",
425
-      "unicode": "e637",
426
-      "unicode_decimal": 58935
427
-    },
428
-    {
429
-      "icon_id": "4852580",
430
-      "name": "icon_liucheng",
431
-      "font_class": "icon_liucheng",
432
-      "unicode": "e634",
433
-      "unicode_decimal": 58932
434
-    },
435
-    {
436
-      "icon_id": "4852661",
437
-      "name": "icon_zhengzaijinx",
438
-      "font_class": "icon_zhengzaijinx",
439
-      "unicode": "e635",
440
-      "unicode_decimal": 58933
441
-    },
442
-    {
443
-      "icon_id": "4852700",
444
-      "name": "icon_weizuo",
445
-      "font_class": "icon_weizuo",
446
-      "unicode": "e636",
447
-      "unicode_decimal": 58934
448
-    },
449
-    {
450
-      "icon_id": "5667925",
451
-      "name": "8",
452
-      "font_class": "icon-test",
453
-      "unicode": "e646",
454
-      "unicode_decimal": 58950
455
-    },
456
-    {
457
-      "icon_id": "5667926",
458
-      "name": "9",
459
-      "font_class": "icon-test1",
460
-      "unicode": "e648",
461
-      "unicode_decimal": 58952
462
-    },
463
-    {
464
-      "icon_id": "5667931",
465
-      "name": "7",
466
-      "font_class": "icon-test2",
467
-      "unicode": "e649",
468
-      "unicode_decimal": 58953
469
-    },
470
-    {
471
-      "icon_id": "5667932",
472
-      "name": "8",
473
-      "font_class": "icon-test3",
474
-      "unicode": "e64a",
475
-      "unicode_decimal": 58954
476
-    },
477
-    {
478
-      "icon_id": "5667934",
479
-      "name": "4",
480
-      "font_class": "icon-test4",
481
-      "unicode": "e64b",
482
-      "unicode_decimal": 58955
483
-    },
484
-    {
485
-      "icon_id": "5667935",
486
-      "name": "6",
487
-      "font_class": "icon-test5",
488
-      "unicode": "e64c",
489
-      "unicode_decimal": 58956
490
-    },
491
-    {
492
-      "icon_id": "5667936",
493
-      "name": "5",
494
-      "font_class": "icon-test6",
495
-      "unicode": "e64d",
496
-      "unicode_decimal": 58957
497
-    },
498
-    {
499
-      "icon_id": "5667937",
500
-      "name": "2",
501
-      "font_class": "icon-test7",
502
-      "unicode": "e64e",
503
-      "unicode_decimal": 58958
504
-    },
505
-    {
506
-      "icon_id": "5667938",
507
-      "name": "3",
508
-      "font_class": "icon-test8",
509
-      "unicode": "e64f",
510
-      "unicode_decimal": 58959
511
-    },
512
-    {
513
-      "icon_id": "5667939",
514
-      "name": "Shape",
515
-      "font_class": "Shape",
516
-      "unicode": "e650",
517
-      "unicode_decimal": 58960
518
-    },
519
-    {
520
-      "icon_id": "5668766",
521
-      "name": "10",
522
-      "font_class": "icon-test9",
523
-      "unicode": "e651",
524
-      "unicode_decimal": 58961
525
-    },
526
-    {
527
-      "icon_id": "5796777",
528
-      "name": "报修",
529
-      "font_class": "baoxiu",
530
-      "unicode": "e604",
531
-      "unicode_decimal": 58884
532
-    },
533
-    {
534
-      "icon_id": "5826848",
535
-      "name": "voice-点击回放录音",
536
-      "font_class": "voice-dianjihuifangluyin",
537
-      "unicode": "e679",
538
-      "unicode_decimal": 59001
539
-    },
540
-    {
541
-      "icon_id": "6602932",
542
-      "name": "资源 1-wode",
543
-      "font_class": "ziyuan-wode",
544
-      "unicode": "e66c",
545
-      "unicode_decimal": 58988
546
-    },
547
-    {
548
-      "icon_id": "6602933",
549
-      "name": "资源 2-wode",
550
-      "font_class": "ziyuan-wode1",
551
-      "unicode": "e66d",
552
-      "unicode_decimal": 58989
553
-    },
554
-    {
555
-      "icon_id": "6602934",
556
-      "name": "资源 1-zhuye",
557
-      "font_class": "ziyuan-zhuye",
558
-      "unicode": "e66e",
559
-      "unicode_decimal": 58990
560
-    },
561
-    {
562
-      "icon_id": "6602935",
563
-      "name": "资源 2-baoxiu",
564
-      "font_class": "ziyuan-baoxiu",
565
-      "unicode": "e66f",
566
-      "unicode_decimal": 58991
567
-    },
568
-    {
569
-      "icon_id": "6602936",
570
-      "name": "资源 1-baoxiu",
571
-      "font_class": "ziyuan-baoxiu1",
572
-      "unicode": "e670",
573
-      "unicode_decimal": 58992
574
-    },
575
-    {
576
-      "icon_id": "6602937",
577
-      "name": "资源 2-zhuye",
578
-      "font_class": "ziyuan-zhuye1",
579
-      "unicode": "e671",
580
-      "unicode_decimal": 58993
581
-    },
582
-    {
583
-      "icon_id": "6796640",
584
-      "name": "新建 (1)",
585
-      "font_class": "xinjian2",
586
-      "unicode": "e673",
587
-      "unicode_decimal": 58995
588
-    },
589
-    {
590
-      "icon_id": "6796641",
591
-      "name": "我的报修",
592
-      "font_class": "wodebaoxiu",
593
-      "unicode": "e674",
594
-      "unicode_decimal": 58996
595
-    },
596
-    {
597
-      "icon_id": "6796642",
598
-      "name": "常见问题 (2)",
599
-      "font_class": "changjianwenti2",
600
-      "unicode": "e675",
601
-      "unicode_decimal": 58997
602
-    },
603
-    {
604
-      "icon_id": "6796643",
605
-      "name": "我的巡检",
606
-      "font_class": "wodexunjian",
607
-      "unicode": "e676",
608
-      "unicode_decimal": 58998
609
-    },
610
-    {
611
-      "icon_id": "6796644",
612
-      "name": "公告列表",
613
-      "font_class": "gonggaoliebiao",
614
-      "unicode": "e677",
615
-      "unicode_decimal": 58999
616
-    },
617
-    {
618
-      "icon_id": "6796645",
619
-      "name": "服务指南",
620
-      "font_class": "fuwuzhinan",
621
-      "unicode": "e678",
622
-      "unicode_decimal": 59000
623
-    },
624
-    {
625
-      "icon_id": "7123128",
626
-      "name": "回放",
627
-      "font_class": "huifang",
628
-      "unicode": "e663",
629
-      "unicode_decimal": 58979
630
-    },
631
-    {
632
-      "icon_id": "7533050",
633
-      "name": "回拨",
634
-      "font_class": "huibo",
635
-      "unicode": "e851",
636
-      "unicode_decimal": 59473
637
-    },
638
-    {
639
-      "icon_id": "9432433",
640
-      "name": "电话留言",
641
-      "font_class": "dianhualiuyan",
642
-      "unicode": "e680",
643
-      "unicode_decimal": 59008
644
-    }
645
-  ]
646
-}

BIN
css/iconfont/iconfont.woff2


File diff suppressed because it is too large
+ 0 - 1137
css/index.css


+ 0 - 117
css/login.css

@@ -1,117 +0,0 @@
1
-.container {
2
-    background-color: #f4f8fd;
3
-    position: absolute;
4
-    top: 0;
5
-    left: 0;
6
-    right: 0;
7
-    height: 480px;
8
-    background: url(./../imgs/BG_login.png) no-repeat center top;
9
-    background-size: cover;
10
-    behavior: url(PIE.htc);
11
-}
12
-
13
-.bg {
14
-    width: 100%;
15
-    position: absolute;
16
-    top: 0;
17
-    left: 0;
18
-    min-width: 1020px;
19
-}
20
-
21
-.content {
22
-    width: 480px;
23
-    height: 470px;
24
-    position: fixed;
25
-    left: 50%;
26
-    top: 50%;
27
-    margin-top: -235px;
28
-    margin-left: -240px;
29
-}
30
-
31
-.logo {
32
-    text-align: center;
33
-    font-size: 28px;
34
-    color: #fff;
35
-}
36
-
37
-.logo img {
38
-    height: 41px;
39
-    vertical-align: top;
40
-    margin-bottom: 20px;
41
-}
42
-
43
-.login {
44
-    width: 480px;
45
-    /* height: 400px; */
46
-    position: relative;
47
-    border-radius: 8px;
48
-    background: #fff;
49
-    border: 1px solid #e5e5e5;
50
-    padding: 38px 40px;
51
-}
52
-
53
-.login .title {
54
-    color: #68686b;
55
-    font-size: 24px;
56
-    text-align: center;
57
-    margin-bottom: 6px;
58
-}
59
-
60
-.login input {
61
-    width: 100%;
62
-    height: 56px;
63
-    font-size: 20px;
64
-    background-color: #ffffff;
65
-    border-radius: 8px;
66
-    border: 1px solid #d1d1d1;
67
-    padding: 15px;
68
-    margin-top: 18px;
69
-}
70
-
71
-.login button {
72
-    width: 100%;
73
-    height: 52px;
74
-    border-radius: 0;
75
-    background-color: #005395;
76
-    text-align: center;
77
-    line-height: 52px;
78
-    font-size: 20px;
79
-    color: #fff;
80
-    margin-top: 24px;
81
-    border: 0 none;
82
-    cursor: pointer;
83
-}
84
-
85
-.login button:hover {
86
-    background-color: #00437a;
87
-}
88
-
89
-.login p {
90
-    font-size: 12px;
91
-    color: #68686b;
92
-    text-align: left;
93
-    margin-top: 21px;
94
-}
95
-
96
-.shadow {
97
-    width: 480px;
98
-    margin-top: -20px;
99
-}
100
-
101
-.shadow img {
102
-    width: 100%;
103
-}
104
-
105
-.camp {
106
-    width: 100%;
107
-    position: fixed;
108
-    bottom: 16px;
109
-    text-align: center;
110
-    font-size: 14px;
111
-    color: #333;
112
-}
113
-
114
-.camp img {
115
-    height: 24px;
116
-    vertical-align: top;
117
-}

BIN
favicon-32x32.png


BIN
imgs/.DS_Store


BIN
imgs/6@3x-8.png


BIN
imgs/8@3x-8.png


BIN
imgs/BG_login.png


BIN
imgs/BG_web.png


BIN
imgs/icon_shangla.png


BIN
imgs/icon_xiala.png


BIN
imgs/image_litu.png


BIN
imgs/image_tiantjiatupian.png


BIN
imgs/img_wubaoxiu.png


BIN
imgs/img_wugonggao.png


BIN
imgs/loading.gif


BIN
imgs/logo.png


BIN
imgs/shadow_login.png


File diff suppressed because it is too large
+ 32 - 1149
index.html


+ 0 - 29
js/base.js

@@ -1,29 +0,0 @@
1
-// 接口地址
2
-// var baseUrl = 'http://localhost/service/'; //测试
3
-var domainName = document.domain;//域名
4
-var protocolName = document.location.protocol;//http协议
5
-var baseUrl = protocolName + '//' + domainName + '/service/';//线上
6
-function isLtIe10() {
7
-    var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
8
-    var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
9
-    var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
10
-    var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
11
-    if (isIE) {
12
-        var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
13
-        reIE.test(userAgent);
14
-        var fIEVersion = parseFloat(RegExp["$1"]);
15
-        if (fIEVersion == 7) {
16
-            return true;
17
-        } else if (fIEVersion == 8) {
18
-            return true;
19
-        } else if (fIEVersion == 9) {
20
-            return true;
21
-        } else if (fIEVersion == 10) {
22
-            return false;
23
-        } else {
24
-            return true; //IE版本<=7
25
-        }
26
-    } else {
27
-        return false;
28
-    }
29
-}

File diff suppressed because it is too large
+ 0 - 1388
js/index.js


+ 0 - 6
js/isLogin.js

@@ -1,6 +0,0 @@
1
-(function() {
2
-    var loginUser = JSON.parse(window.sessionStorage.getItem('loginUser'));
3
-    if (!(loginUser && loginUser.id)) {
4
-        window.location.href = "login.html";
5
-    }
6
-})()

+ 0 - 105
js/login.js

@@ -1,105 +0,0 @@
1
-$(function () {
2
-  var isSSo = location.search.length > 0;//是否单点登录
3
-  if (isSSo) {
4
-    $('.container').hide();
5
-    login();
6
-  }
7
-  var hasClick = false; //是否已经点击过登录按钮
8
-  // 兼容ie的placeholder
9
-  $('input, textarea').placeholder();
10
-  // 登录点击
11
-  $('#login').on('click', login);
12
-  // 登录方法
13
-  function login() {
14
-    if (hasClick) return;
15
-    hasClick = true;
16
-    var name = $('#name').val()
17
-    var pwd = $('#pwd').val()
18
-    var data = {
19
-      username: name,
20
-      password: pwd
21
-    }
22
-    // 单点登录 start
23
-    var ssoStr = '';
24
-    var ssoJson;
25
-    if (isSSo) {
26
-      ssoStr = location.search.replace('?', '').split('&')[0].split('=')[1];
27
-      ssoStr = Base64.decode(decodeURIComponent(ssoStr));
28
-      ssoJson = JSON.parse(ssoStr);
29
-    }
30
-    var postData = isSSo ? { username: ssoJson.a, password: ssoJson.r, t: false } : data;
31
-    // 单点登录 end
32
-    $.ajax({
33
-      type: "POST",
34
-      contentType: "application/json;charset=UTF-8",
35
-      url: baseUrl + "auth/reqlogin",
36
-      data: JSON.stringify(postData),
37
-      success: function (res) {
38
-        if (res.state == 200) {
39
-          sessionStorage.setItem('loginUser', JSON.stringify(res.data.requester));
40
-          //判断版本类别
41
-          $.ajax({
42
-            type: "POST",
43
-            contentType: "application/json;charset=UTF-8",
44
-            url: baseUrl + "sysinfo/data/fetchDataList/systemConfiguration",
45
-            data: JSON.stringify({ "idx": 0, "sum": 1000, "systemConfiguration": { "keyconfig": "repairMain" } }),
46
-            success: function (result) {
47
-              if (result.status == 200) {
48
-                sessionStorage.setItem("repair_main", JSON.stringify(result.list[0]));
49
-                // --------------
50
-                //判断是否自动建单
51
-                $.ajax({
52
-                  type: "POST",
53
-                  contentType: "application/json;charset=UTF-8",
54
-                  url: baseUrl + "sysinfo/data/fetchDataList/systemConfiguration",
55
-                  data: JSON.stringify({ "idx": 0, "sum": 1000, "systemConfiguration": { "keyconfig": "ifCreate" } }),
56
-                  success: function (result) {
57
-                    if (result.status == 200) {
58
-                      sessionStorage.setItem("ifCreate", JSON.stringify(result.list[0]));
59
-                      window.location.href = 'index.html';
60
-                    }
61
-                    hasClick = false;
62
-                  },
63
-                  //请求失败,包含具体的错误信息
64
-                  error: function (e) {
65
-                    console.log(e.status);
66
-                    console.log(e.responseText);
67
-                  }
68
-                });
69
-                // --------------
70
-              }
71
-              hasClick = false;
72
-            },
73
-            //请求失败,包含具体的错误信息
74
-            error: function (e) {
75
-              console.log(e.status);
76
-              console.log(e.responseText);
77
-            }
78
-          });
79
-        } else {
80
-          alert('用户名或密码错误,请重试!');
81
-          hasClick = false;
82
-        }
83
-      },
84
-      //请求失败,包含具体的错误信息
85
-      error: function (e) {
86
-        console.log(e.status);
87
-        console.log(e.responseText);
88
-      }
89
-    });
90
-  }
91
-  // enter登录
92
-  $(document).bind('keypress', function (e) {
93
-    var keyCode;
94
-    if (window.event) {
95
-      keyCode = e.keyCode
96
-    } else if (e.which) {
97
-      keycode = e.which;
98
-    }
99
-    if (e.keyCode != 13) {
100
-      return;
101
-    }
102
-    $("#login").trigger("click");
103
-    return false;
104
-  });
105
-})

File diff suppressed because it is too large
+ 0 - 8
libs/base64.min.js


File diff suppressed because it is too large
+ 0 - 7
libs/es5-sham.min.js


File diff suppressed because it is too large
+ 0 - 7
libs/es5-shim.min.js


File diff suppressed because it is too large
+ 0 - 8
libs/html5shiv.js


File diff suppressed because it is too large
+ 0 - 5
libs/jquery-1.9.1.min.js


File diff suppressed because it is too large
+ 0 - 313
libs/jquery.nicescroll.min.js


+ 0 - 281
libs/jquery.placeholder.js

@@ -1,281 +0,0 @@
1
-/*!
2
- * jQuery Placeholder Plugin v2.3.1
3
- * https://github.com/mathiasbynens/jquery-placeholder
4
- *
5
- * Copyright 2011, 2015 Mathias Bynens
6
- * Released under the MIT license
7
- */
8
-(function(factory) {
9
-    if (typeof define === 'function' && define.amd) {
10
-        // AMD
11
-        define(['jquery'], factory);
12
-    } else if (typeof module === 'object' && module.exports) {
13
-        factory(require('jquery'));
14
-    } else {
15
-        // Browser globals
16
-        factory(jQuery);
17
-    }
18
-}(function($) {
19
-
20
-    /****
21
-     * Allows plugin behavior simulation in modern browsers for easier debugging. 
22
-     * When setting to true, use attribute "placeholder-x" rather than the usual "placeholder" in your inputs/textareas 
23
-     * i.e. <input type="text" placeholder-x="my placeholder text" />
24
-     */
25
-    var debugMode = false; 
26
-
27
-    // Opera Mini v7 doesn't support placeholder although its DOM seems to indicate so
28
-    var isOperaMini = Object.prototype.toString.call(window.operamini) === '[object OperaMini]';
29
-    var isInputSupported = 'placeholder' in document.createElement('input') && !isOperaMini && !debugMode;
30
-    var isTextareaSupported = 'placeholder' in document.createElement('textarea') && !isOperaMini && !debugMode;
31
-    var valHooks = $.valHooks;
32
-    var propHooks = $.propHooks;
33
-    var hooks;
34
-    var placeholder;
35
-    var settings = {};
36
-
37
-    if (isInputSupported && isTextareaSupported) {
38
-
39
-        placeholder = $.fn.placeholder = function() {
40
-            return this;
41
-        };
42
-
43
-        placeholder.input = true;
44
-        placeholder.textarea = true;
45
-
46
-    } else {
47
-
48
-        placeholder = $.fn.placeholder = function(options) {
49
-
50
-            var defaults = {customClass: 'placeholder'};
51
-            settings = $.extend({}, defaults, options);
52
-
53
-            return this.filter((isInputSupported ? 'textarea' : ':input') + '[' + (debugMode ? 'placeholder-x' : 'placeholder') + ']')
54
-                .not('.'+settings.customClass)
55
-                .not(':radio, :checkbox, [type=hidden]')
56
-                .bind({
57
-                    'focus.placeholder': clearPlaceholder,
58
-                    'blur.placeholder': setPlaceholder
59
-                })
60
-                .data('placeholder-enabled', true)
61
-                .trigger('blur.placeholder');
62
-        };
63
-
64
-        placeholder.input = isInputSupported;
65
-        placeholder.textarea = isTextareaSupported;
66
-
67
-        hooks = {
68
-            'get': function(element) {
69
-
70
-                var $element = $(element);
71
-                var $passwordInput = $element.data('placeholder-password');
72
-
73
-                if ($passwordInput) {
74
-                    return $passwordInput[0].value;
75
-                }
76
-
77
-                return $element.data('placeholder-enabled') && $element.hasClass(settings.customClass) ? '' : element.value;
78
-            },
79
-            'set': function(element, value) {
80
-
81
-                var $element = $(element);
82
-                var $replacement;
83
-                var $passwordInput;
84
-
85
-                if (value !== '') {
86
-
87
-                    $replacement = $element.data('placeholder-textinput');
88
-                    $passwordInput = $element.data('placeholder-password');
89
-
90
-                    if ($replacement) {
91
-                        clearPlaceholder.call($replacement[0], true, value) || (element.value = value);
92
-                        $replacement[0].value = value;
93
-
94
-                    } else if ($passwordInput) {
95
-                        clearPlaceholder.call(element, true, value) || ($passwordInput[0].value = value);
96
-                        element.value = value;
97
-                    }
98
-                }
99
-
100
-                if (!$element.data('placeholder-enabled')) {
101
-                    element.value = value;
102
-                    return $element;
103
-                }
104
-
105
-                if (value === '') {
106
-                    
107
-                    element.value = value;
108
-                    
109
-                    // Setting the placeholder causes problems if the element continues to have focus.
110
-                    if (element != safeActiveElement()) {
111
-                        // We can't use `triggerHandler` here because of dummy text/password inputs :(
112
-                        setPlaceholder.call(element);
113
-                    }
114
-
115
-                } else {
116
-                    
117
-                    if ($element.hasClass(settings.customClass)) {
118
-                        clearPlaceholder.call(element);
119
-                    }
120
-
121
-                    element.value = value;
122
-                }
123
-                // `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363
124
-                return $element;
125
-            }
126
-        };
127
-
128
-        if (!isInputSupported) {
129
-            valHooks.input = hooks;
130
-            propHooks.value = hooks;
131
-        }
132
-
133
-        if (!isTextareaSupported) {
134
-            valHooks.textarea = hooks;
135
-            propHooks.value = hooks;
136
-        }
137
-
138
-        $(function() {
139
-            // Look for forms
140
-            $(document).delegate('form', 'submit.placeholder', function() {
141
-                
142
-                // Clear the placeholder values so they don't get submitted
143
-                var $inputs = $('.'+settings.customClass, this).each(function() {
144
-                    clearPlaceholder.call(this, true, '');
145
-                });
146
-
147
-                setTimeout(function() {
148
-                    $inputs.each(setPlaceholder);
149
-                }, 10);
150
-            });
151
-        });
152
-
153
-        // Clear placeholder values upon page reload
154
-        $(window).bind('beforeunload.placeholder', function() {
155
-
156
-            var clearPlaceholders = true;
157
-
158
-            try {
159
-                // Prevent IE javascript:void(0) anchors from causing cleared values
160
-                if (document.activeElement.toString() === 'javascript:void(0)') {
161
-                    clearPlaceholders = false;
162
-                }
163
-            } catch (exception) { }
164
-
165
-            if (clearPlaceholders) {
166
-                $('.'+settings.customClass).each(function() {
167
-                    this.value = '';
168
-                });
169
-            }
170
-        });
171
-    }
172
-
173
-    function args(elem) {
174
-        // Return an object of element attributes
175
-        var newAttrs = {};
176
-        var rinlinejQuery = /^jQuery\d+$/;
177
-
178
-        $.each(elem.attributes, function(i, attr) {
179
-            if (attr.specified && !rinlinejQuery.test(attr.name)) {
180
-                newAttrs[attr.name] = attr.value;
181
-            }
182
-        });
183
-
184
-        return newAttrs;
185
-    }
186
-
187
-    function clearPlaceholder(event, value) {
188
-        
189
-        var input = this;
190
-        var $input = $(this);
191
-        
192
-        if (input.value === $input.attr((debugMode ? 'placeholder-x' : 'placeholder')) && $input.hasClass(settings.customClass)) {
193
-            
194
-            input.value = '';
195
-            $input.removeClass(settings.customClass);
196
-
197
-            if ($input.data('placeholder-password')) {
198
-
199
-                $input = $input.hide().nextAll('input[type="password"]:first').show().attr('id', $input.removeAttr('id').data('placeholder-id'));
200
-                
201
-                // If `clearPlaceholder` was called from `$.valHooks.input.set`
202
-                if (event === true) {
203
-                    $input[0].value = value;
204
-
205
-                    return value;
206
-                }
207
-
208
-                $input.focus();
209
-
210
-            } else {
211
-                input == safeActiveElement() && input.select();
212
-            }
213
-        }
214
-    }
215
-
216
-    function setPlaceholder(event) {
217
-        var $replacement;
218
-        var input = this;
219
-        var $input = $(this);
220
-        var id = input.id;
221
-
222
-        // If the placeholder is activated, triggering blur event (`$input.trigger('blur')`) should do nothing.
223
-        if (event && event.type === 'blur' && $input.hasClass(settings.customClass)) {
224
-            return;
225
-        }
226
-
227
-        if (input.value === '') {
228
-            if (input.type === 'password') {
229
-                if (!$input.data('placeholder-textinput')) {
230
-                    
231
-                    try {
232
-                        $replacement = $input.clone().prop({ 'type': 'text' });
233
-                    } catch(e) {
234
-                        $replacement = $('<input>').attr($.extend(args(this), { 'type': 'text' }));
235
-                    }
236
-
237
-                    $replacement
238
-                        .removeAttr('name')
239
-                        .data({
240
-                            'placeholder-enabled': true,
241
-                            'placeholder-password': $input,
242
-                            'placeholder-id': id
243
-                        })
244
-                        .bind('focus.placeholder', clearPlaceholder);
245
-
246
-                    $input
247
-                        .data({
248
-                            'placeholder-textinput': $replacement,
249
-                            'placeholder-id': id
250
-                        })
251
-                        .before($replacement);
252
-                }
253
-
254
-                input.value = '';
255
-                $input = $input.removeAttr('id').hide().prevAll('input[type="text"]:first').attr('id', $input.data('placeholder-id')).show();
256
-
257
-            } else {
258
-                
259
-                var $passwordInput = $input.data('placeholder-password');
260
-
261
-                if ($passwordInput) {
262
-                    $passwordInput[0].value = '';
263
-                    $input.attr('id', $input.data('placeholder-id')).show().nextAll('input[type="password"]:last').hide().removeAttr('id');
264
-                }
265
-            }
266
-
267
-            $input.addClass(settings.customClass);
268
-            $input[0].value = $input.attr((debugMode ? 'placeholder-x' : 'placeholder'));
269
-
270
-        } else {
271
-            $input.removeClass(settings.customClass);
272
-        }
273
-    }
274
-
275
-    function safeActiveElement() {
276
-        // Avoid IE9 `document.activeElement` of death
277
-        try {
278
-            return document.activeElement;
279
-        } catch (exception) {}
280
-    }
281
-}));

File diff suppressed because it is too large
+ 0 - 17
libs/json3.min.js


File diff suppressed because it is too large
+ 0 - 3
libs/template-web.min.js


File diff suppressed because it is too large
+ 0 - 1
libs/uuid@latest.js


+ 0 - 48
login.html

@@ -1,48 +0,0 @@
1
-<!DOCTYPE html>
2
-<html lang="zh-cn">
3
-
4
-<head>
5
-    <meta charset="UTF-8">
6
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
-    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
8
-    <title>报修平台</title>
9
-    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
10
-    <link rel="stylesheet" href="./css/base.css">
11
-    <link rel="stylesheet" href="./css/login.css">
12
-    <script src="./libs/jquery-1.9.1.min.js"></script>
13
-    <script src="./libs/jquery.placeholder.js"></script>
14
-    <script src="./libs/base64.min.js"></script>
15
-    <!--[if lt IE 10]>
16
-        <script src="./libs/html5shiv.js"></script>
17
-    <![endif]-->
18
-</head>
19
-
20
-<body>
21
-    <div class="container">
22
-        <div class="content">
23
-            <div class="logo">
24
-                <img src="./imgs/8@3x-8.png" alt="">
25
-                <span>网络与信息运维报修平台</span>
26
-            </div>
27
-            <div class="login">
28
-                <div class="title">用户登录</div>
29
-                <input id="name" type="text" placeholder="请输入用户名">
30
-                <input id="pwd" type="password" placeholder="请输入密码">
31
-                <button id="login">登录</button>
32
-                <p>推荐使用Google浏览器,其他浏览器可能出现兼容性问题</p>
33
-                <p class="login_reset" style="color: #005395;">账号为您的学号(工号),初始密码为您的学号(工号)后4位</p>
34
-            </div>
35
-            <div class="shadow">
36
-                <img src="./imgs/shadow_login.png" alt="">
37
-            </div>
38
-        </div>
39
-        <div class="camp">
40
-            <img src="./imgs/logo.png" alt="">
41
-            <span>武汉大势恒通科技有限责任公司</span>
42
-        </div>
43
-    </div>
44
-</body>
45
-<script src="./js/base.js"></script>
46
-<script src="./js/login.js"></script>
47
-
48
-</html>

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


+ 79 - 0
package.json

@@ -0,0 +1,79 @@
1
+{
2
+  "name": "jry",
3
+  "version": "1.0.0",
4
+  "description": "jryVue",
5
+  "author": "jiang",
6
+  "private": true,
7
+  "scripts": {
8
+    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9
+    "start": "npm run dev",
10
+    "build": "node build/build.js"
11
+  },
12
+  "dependencies": {
13
+    "axios": "^0.18.0",
14
+    "cube-ui": "^1.12.10",
15
+    "less": "^3.9.0",
16
+    "less-loader": "^4.1.0",
17
+    "lib-flexible": "^0.3.2",
18
+    "vue": "^2.5.2",
19
+    "vue-axios": "^2.1.4",
20
+    "vue-router": "^3.0.1",
21
+    "vuex": "^3.1.1"
22
+  },
23
+  "compileDependencies": [
24
+    "cube-ui"
25
+  ],
26
+  "devDependencies": {
27
+    "autoprefixer": "^7.1.2",
28
+    "babel-cli": "^6.26.0",
29
+    "babel-core": "^6.22.1",
30
+    "babel-helper-vue-jsx-merge-props": "^2.0.3",
31
+    "babel-loader": "^7.1.1",
32
+    "babel-plugin-syntax-jsx": "^6.18.0",
33
+    "babel-plugin-transform-modules": "^0.0.2",
34
+    "babel-plugin-transform-runtime": "^6.22.0",
35
+    "babel-plugin-transform-vue-jsx": "^3.5.0",
36
+    "babel-preset-env": "^1.7.0",
37
+    "babel-preset-stage-2": "^6.22.0",
38
+    "chalk": "^2.0.1",
39
+    "compression-webpack-plugin": "^1.1.12",
40
+    "copy-webpack-plugin": "^4.0.1",
41
+    "css-loader": "^0.28.0",
42
+    "extract-text-webpack-plugin": "^3.0.0",
43
+    "file-loader": "^1.1.4",
44
+    "friendly-errors-webpack-plugin": "^1.6.1",
45
+    "html-webpack-plugin": "^2.30.1",
46
+    "node-notifier": "^5.1.2",
47
+    "optimize-css-assets-webpack-plugin": "^3.2.0",
48
+    "ora": "^1.2.0",
49
+    "portfinder": "^1.0.13",
50
+    "postcss-import": "^11.0.0",
51
+    "postcss-loader": "^2.0.8",
52
+    "postcss-url": "^7.2.1",
53
+    "px2rem-loader": "^0.1.9",
54
+    "rimraf": "^2.6.0",
55
+    "semver": "^5.3.0",
56
+    "shelljs": "^0.7.6",
57
+    "stylus": "^0.54.5",
58
+    "stylus-loader": "^2.1.1",
59
+    "uglifyjs-webpack-plugin": "^1.1.1",
60
+    "url-loader": "^0.5.8",
61
+    "vue-loader": "^13.3.0",
62
+    "vue-style-loader": "^3.0.1",
63
+    "vue-template-compiler": "^2.5.2",
64
+    "webpack": "^3.6.0",
65
+    "webpack-bundle-analyzer": "^2.9.0",
66
+    "webpack-dev-server": "^2.9.1",
67
+    "webpack-merge": "^4.1.0",
68
+    "webpack-post-compile-plugin": "^0.1.2"
69
+  },
70
+  "engines": {
71
+    "node": ">= 6.0.0",
72
+    "npm": ">= 3.0.0"
73
+  },
74
+  "browserslist": [
75
+    "> 1%",
76
+    "last 2 versions",
77
+    "not ie <= 8"
78
+  ]
79
+}

+ 152 - 0
src/App.vue

@@ -0,0 +1,152 @@
1
+<template>
2
+  <div id="app">
3
+    <router-view></router-view>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: "app",
10
+  components: {},
11
+  methods: {}
12
+};
13
+</script>
14
+
15
+<style lang='less'>
16
+body,#app{
17
+  height: 100%;
18
+}
19
+* {
20
+  font-family: "微软雅黑";
21
+}
22
+.fl {
23
+  float: left;
24
+}
25
+.fr {
26
+  float: right;
27
+}
28
+.overflowEllipsis2 {
29
+  overflow: hidden;
30
+  text-overflow: ellipsis;
31
+  display: -webkit-box;
32
+  -webkit-line-clamp: 2;
33
+  -webkit-box-orient: vertical !important;
34
+  text-overflow: -o-ellipsis-lastline;
35
+}
36
+.btn {
37
+  display: inline-block;
38
+  // width: 1.6rem;
39
+  height: 0.36rem;
40
+  line-height: 0.36rem;
41
+  font-size: 0.24rem;
42
+  text-align: center;
43
+  border-radius: 0.3rem;
44
+  border-width: 0.01rem;
45
+  border-style: solid;
46
+  padding: 0 0.16rem;
47
+  &.daipingjia {
48
+    border-color: #e0872c;
49
+    color: #e0872c;
50
+    background: #fbf3e9;
51
+  }
52
+  &.daiqiangdan {
53
+    border-color: #991f00;
54
+    color: #991f00;
55
+    background: #f4e8e5;
56
+  }
57
+  &.yiguanbi {
58
+    border-color: #333;
59
+    color: #333;
60
+    background: #eee;
61
+  }
62
+  &.daishenhe {
63
+    border-color: #fcb44c;
64
+    color: #fcb44c;
65
+    background: #fff;
66
+  }
67
+  &.chulizhong {
68
+    border-color: #003057;
69
+    color: #003057;
70
+    background: #e5eaee;
71
+  }
72
+  &.yijiejue {
73
+    border-color: #40a19c;
74
+    color: #40a19c;
75
+    background: #ebf5f5;
76
+  }
77
+  &.chongxinzhipai {
78
+    border-color: #48a843;
79
+    color: #48a843;
80
+    background: #ecf6ec;
81
+  }
82
+  &.daijiedan {
83
+    border-color: #c2654e;
84
+    color: #c2654e;
85
+    background: #faf4f2;
86
+  }
87
+  &.zhixingzhong {
88
+    border-color: #005395;
89
+    color: #005395;
90
+    background: #e5edf4;
91
+  }
92
+  &.yiwancheng {
93
+    border-color: #056b00;
94
+    color: #056b00;
95
+    background: #e6f0e5;
96
+  }
97
+  &.isValid{
98
+    border-color: #c21b1b;
99
+    color: #c21b1b;
100
+    background: #f8e7e7;
101
+  }
102
+  &.noValid{
103
+    border-color: #999;
104
+    color: #999;
105
+    background: #f4f4f4;
106
+  }
107
+  &.bushouli{
108
+    border-color: #999;
109
+    color: #999;
110
+    background: #f4f4f4;
111
+  }
112
+  &.yizhuanhuan{
113
+    border-color: #999;
114
+    color: #999;
115
+    background: #f4f4f4;
116
+  }
117
+  &.weizhuanhuan{
118
+    border-color: #01559d;
119
+    color: #01559d;
120
+    background: #e5eef5;
121
+  }
122
+}
123
+
124
+// 巡检详情按钮
125
+.inspedtionDetail {
126
+  .cube-switch .cube-switch-input:checked,
127
+  .cube-switch-ui {
128
+    border-color: #ccc !important;
129
+    background-color: #971e00 !important;
130
+  }
131
+}
132
+// 新建事件按钮
133
+.newIncident {
134
+  .cube-btn.cube-btn_active,
135
+  .cube-btn:active {
136
+    background-color: #fff !important;
137
+  }
138
+}
139
+
140
+// font-color 字体颜色
141
+i.iconfont {
142
+  &.icon-yiyuqi {
143
+    color: #991f00;
144
+  }
145
+  &.icon-jijiang {
146
+    color: #a37200;
147
+  }
148
+  &.icon-zhengchang {
149
+    color: #056a00;
150
+  }
151
+}
152
+</style>

BIN
src/assets/logo.png


+ 7 - 0
src/common/helpers/create-api.js

@@ -0,0 +1,7 @@
1
+import createAPIComponent from 'vue-create-api'
2
+
3
+export default function createAPI (Vue, Component, events, single) {
4
+  Vue.use(createAPIComponent, {componentPrefix: 'cube-'})
5
+  const api = Vue.createAPI(Component, events, single)
6
+  return api
7
+}

+ 14 - 0
src/common/helpers/debug.js

@@ -0,0 +1,14 @@
1
+export const warn = function (msg, componentName) {
2
+   /* istanbul ignore if */
3
+  if (process.env.NODE_ENV !== 'production') {
4
+    const component = componentName ? `<${componentName}> ` : ''
5
+    console.error(`[Cube warn]: ${component}${msg}`)
6
+  }
7
+}
8
+
9
+export const tip = function (msg, componentName) {
10
+  if (process.env.NODE_ENV !== 'production') {
11
+    const component = componentName ? `<${componentName}> ` : ''
12
+    console.warn(`[Cube tip]: ${component}${msg}`)
13
+  }
14
+}

+ 98 - 0
src/common/helpers/dom.js

@@ -0,0 +1,98 @@
1
+import { inBrowser } from './env'
2
+
3
+export function hasClass(el, className) {
4
+  const reg = new RegExp('(^|\\s)' + className + '(\\s|$)')
5
+  return reg.test(el.className)
6
+}
7
+
8
+export function addClass(el, className) {
9
+  /* istanbul ignore if */
10
+  if (hasClass(el, className)) {
11
+    return
12
+  }
13
+
14
+  const newClass = el.className.split(' ')
15
+  newClass.push(className)
16
+  el.className = newClass.join(' ')
17
+}
18
+
19
+export function removeClass(el, className) {
20
+  /* istanbul ignore if */
21
+  if (!hasClass(el, className)) {
22
+    return
23
+  }
24
+
25
+  const reg = new RegExp('(^|\\s)' + className + '(\\s|$)', 'g')
26
+  el.className = el.className.replace(reg, ' ')
27
+}
28
+
29
+export function getData(el, name) {
30
+  const prefix = 'data-'
31
+  return el.getAttribute(prefix + name)
32
+}
33
+
34
+export function getRect(el) {
35
+  return {
36
+    top: el.offsetTop,
37
+    left: el.offsetLeft,
38
+    width: el.offsetWidth,
39
+    height: el.offsetHeight
40
+  }
41
+}
42
+
43
+let vendor = (() => {
44
+  /* istanbul ignore if */
45
+  if (!inBrowser) {
46
+    return false
47
+  }
48
+  let elementStyle = document.createElement('div').style
49
+  let transformNames = {
50
+    standard: 'transform',
51
+    webkit: 'webkitTransform',
52
+    Moz: 'MozTransform',
53
+    O: 'OTransform',
54
+    ms: 'msTransform'
55
+  }
56
+
57
+  for (let key in transformNames) {
58
+    if (elementStyle[transformNames[key]] !== undefined) {
59
+      return key
60
+    }
61
+  }
62
+
63
+  /* istanbul ignore next */
64
+  return false
65
+})()
66
+
67
+export function prefixStyle(style) {
68
+  /* istanbul ignore if */
69
+  if (vendor === false) {
70
+    return false
71
+  }
72
+
73
+  if (vendor === 'standard') {
74
+    if (style === 'transitionEnd') {
75
+      return 'transitionend'
76
+    }
77
+    return style
78
+  }
79
+
80
+  return vendor + style.charAt(0).toUpperCase() + style.substr(1)
81
+}
82
+
83
+export function getMatchedTarget(e, targetClassName) {
84
+  let el = e.target
85
+
86
+  while (el && !hasClass(el, targetClassName)) {
87
+    if (el === e.currentTarget) return null
88
+    el = el.parentNode
89
+  }
90
+
91
+  return el
92
+}
93
+
94
+export function dispatchEvent(ele, name, { type = 'Event', bubbles = true, cancelable = true } = {}) {
95
+  const e = document.createEvent(type)
96
+  e.initEvent(name, bubbles, cancelable)
97
+  ele.dispatchEvent(e)
98
+}

+ 3 - 0
src/common/helpers/ease.js

@@ -0,0 +1,3 @@
1
+export const easeOutBack = 'cubic-bezier(0.18, 0.89, 0.32, 1.28)'
2
+export const easeOutQuart = 'cubic-bezier(0.165, 0.84, 0.44, 1)'
3
+export const easeOutCubic = 'cubic-bezier(0.22, 0.61, 0.36, 1)'

+ 4 - 0
src/common/helpers/env.js

@@ -0,0 +1,4 @@
1
+// ssr support
2
+export const inBrowser = typeof window !== 'undefined'
3
+export const ua = inBrowser && navigator.userAgent.toLowerCase()
4
+export const isAndroid = ua && ua.indexOf('android') > 0

+ 4 - 0
src/common/helpers/instantiate-component.js

@@ -0,0 +1,4 @@
1
+import createAPI from 'vue-create-api'
2
+const { instantiateComponent } = createAPI
3
+
4
+export default instantiateComponent

+ 43 - 0
src/common/helpers/raf.js

@@ -0,0 +1,43 @@
1
+import { inBrowser } from './env'
2
+
3
+const DEFAULT_INTERVAL = 100 / 60
4
+
5
+function noop() {
6
+}
7
+
8
+export const requestAnimationFrame = (() => {
9
+  /* istanbul ignore next */
10
+  if (!inBrowser) {
11
+    return noop
12
+  }
13
+  return window.requestAnimationFrame ||
14
+    /* istanbul ignore next */
15
+    window.webkitRequestAnimationFrame ||
16
+    /* istanbul ignore next */
17
+    window.mozRequestAnimationFrame ||
18
+    /* istanbul ignore next */
19
+    window.oRequestAnimationFrame ||
20
+    // if all else fails, use setTimeout
21
+    /* istanbul ignore next */
22
+    function (callback) {
23
+      return window.setTimeout(callback, (callback.interval || DEFAULT_INTERVAL) / 2) // make interval as precise as possible.
24
+    }
25
+})()
26
+
27
+export const cancelAnimationFrame = (() => {
28
+  /* istanbul ignore next */
29
+  if (!inBrowser) {
30
+    return noop
31
+  }
32
+  return window.cancelAnimationFrame ||
33
+    /* istanbul ignore next */
34
+    window.webkitCancelAnimationFrame ||
35
+    /* istanbul ignore next */
36
+    window.mozCancelAnimationFrame ||
37
+    /* istanbul ignore next */
38
+    window.oCancelAnimationFrame ||
39
+    /* istanbul ignore next */
40
+    function (id) {
41
+      window.clearTimeout(id)
42
+    }
43
+})()

+ 50 - 0
src/common/helpers/string-template.js

@@ -0,0 +1,50 @@
1
+import { isFunc } from './util'
2
+import { warn } from './debug'
3
+import Locale from '../../modules/locale'
4
+const stringRE = /\{\{((?:.|\n)+?)\}\}/g
5
+const quoteRe = /['"]/g
6
+const INVALID_INDEX = -1
7
+
8
+function format (string, config = '') {
9
+  return string.replace(stringRE, (match, group1, index) => {
10
+    const helpersArr = group1.split('|').slice(1).map(_ => _.trim())
11
+    const hasHelpers = helpersArr.length
12
+    let result = config
13
+
14
+    if (hasHelpers) {
15
+      helpersArr.forEach((helperString) => {
16
+        let { fnName, args } = resolveHelperFnString(helperString)
17
+        args.unshift(result)
18
+        /* istanbul ignore else */
19
+        if (isFunc(Locale.helpers[fnName])) {
20
+          result = Locale.helpers[fnName].apply(null, args)
21
+        } else {
22
+          warn(`A helper function named "${fnName}" is not registered, ` +
23
+               `please register it by Validator.addHelper()`)
24
+          result = ''
25
+        }
26
+      })
27
+    }
28
+
29
+    return result
30
+  })
31
+}
32
+
33
+function resolveHelperFnString (helperString) {
34
+  const leftBracketsIndex = helperString.indexOf('(')
35
+  const rightBracketsIndex = helperString.indexOf(')')
36
+  let fnName = ''
37
+  let args = []
38
+  /* istanbul ignore if */
39
+  if (leftBracketsIndex === INVALID_INDEX) {
40
+    args = []
41
+    fnName = helperString
42
+  } else if (leftBracketsIndex !== INVALID_INDEX && rightBracketsIndex !== INVALID_INDEX) {
43
+    const argsStr = helperString.slice(leftBracketsIndex + 1, rightBracketsIndex)
44
+    args = argsStr.split(',').map(_ => _.trim().replace(quoteRe, ''))
45
+    fnName = helperString.slice(0, leftBracketsIndex)
46
+  }
47
+  return { fnName, args }
48
+}
49
+
50
+export default format

+ 207 - 0
src/common/helpers/util.js

@@ -0,0 +1,207 @@
1
+import { camelize } from '../lang/string'
2
+
3
+function findIndex(ary, fn) {
4
+  if (ary.findIndex) {
5
+    return ary.findIndex(fn)
6
+  }
7
+  /* istanbul ignore next */
8
+  let index = -1
9
+  /* istanbul ignore next */
10
+  ary.some(function (item, i, ary) {
11
+    const ret = fn.call(this, item, i, ary)
12
+    if (ret) {
13
+      index = i
14
+      return ret
15
+    }
16
+  })
17
+  /* istanbul ignore next */
18
+  return index
19
+}
20
+
21
+function deepAssign(to, from) {
22
+  for (let key in from) {
23
+    if (!to[key] || typeof to[key] !== 'object') {
24
+      to[key] = from[key]
25
+    } else {
26
+      deepAssign(to[key], from[key])
27
+    }
28
+  }
29
+}
30
+
31
+function createAddAPI(baseObj) {
32
+  return function add(...args) {
33
+    if (typeof args[0] === 'string') {
34
+      args[0] = {
35
+        [args[0]]: args[1]
36
+      }
37
+    }
38
+    deepAssign(baseObj, args[0])
39
+  }
40
+}
41
+
42
+function judgeTypeFnCreator (type) {
43
+  const toString = Object.prototype.toString
44
+  return function isType (o) {
45
+    return toString.call(o) === `[object ${type}]`
46
+  }
47
+}
48
+
49
+const typesReset = {
50
+  _set(obj, key, value) {
51
+    obj[key] = value
52
+  },
53
+  string(obj, key) {
54
+    typesReset._set(obj, key, '')
55
+  },
56
+  number(obj, key) {
57
+    typesReset._set(obj, key, 0)
58
+  },
59
+  boolean(obj, key) {
60
+    typesReset._set(obj, key, false)
61
+  },
62
+  object(obj, key, value) {
63
+    if (Array.isArray(value)) {
64
+      typesReset._set(obj, key, [])
65
+    } else {
66
+      typesReset._set(obj, key, {})
67
+    }
68
+  }
69
+}
70
+function resetTypeValue(obj, key, defVal) {
71
+  if (defVal !== undefined) {
72
+    return typesReset._set(obj, key, defVal)
73
+  }
74
+  if (key) {
75
+    const value = obj[key]
76
+    const resetHandler = typesReset[typeof value]
77
+    resetHandler && resetHandler(obj, key, value)
78
+  } else {
79
+    Object.keys(obj).forEach((key) => {
80
+      resetTypeValue(obj, key)
81
+    })
82
+  }
83
+}
84
+
85
+function parallel(tasks, cb) {
86
+  let doneCount = 0
87
+  let results = []
88
+  const tasksLen = tasks.length
89
+  if (!tasksLen) {
90
+    return cb(results)
91
+  }
92
+  tasks.forEach((task, i) => {
93
+    task((ret) => {
94
+      doneCount += 1
95
+      results[i] = ret
96
+      if (doneCount === tasksLen) {
97
+        // all tasks done
98
+        cb(results)
99
+      }
100
+    })
101
+  })
102
+}
103
+
104
+function cb2PromiseWithResolve(cb) {
105
+  let promise
106
+  if (typeof window.Promise !== 'undefined') {
107
+    const _cb = cb
108
+    promise = new window.Promise((resolve) => {
109
+      cb = (data) => {
110
+        _cb && _cb(data)
111
+        resolve(data)
112
+      }
113
+    })
114
+    promise.resolve = cb
115
+  }
116
+  return promise
117
+}
118
+
119
+function debounce(func, wait, immediate, initValue) {
120
+  let timeout
121
+  let result = initValue
122
+
123
+  const later = function (context, args) {
124
+    timeout = null
125
+    if (args) {
126
+      result = func.apply(context, args)
127
+    }
128
+  }
129
+
130
+  const debounced = function (...args) {
131
+    if (timeout) {
132
+      clearTimeout(timeout)
133
+    }
134
+    if (immediate) {
135
+      const callNow = !timeout
136
+      timeout = setTimeout(later, wait)
137
+      if (callNow) {
138
+        result = func.apply(this, args)
139
+      }
140
+    } else {
141
+      timeout = setTimeout(() => {
142
+        later(this, args)
143
+      }, wait)
144
+    }
145
+
146
+    return result
147
+  }
148
+
149
+  debounced.cancel = function () {
150
+    clearTimeout(timeout)
151
+    timeout = null
152
+  }
153
+
154
+  return debounced
155
+}
156
+
157
+function processComponentName(Component, { prefix = '', firstUpperCase = false } = {}) {
158
+  const name = Component.name
159
+  const pureName = name.replace(/^cube-/i, '')
160
+  let camelizeName = `${camelize(`${prefix}${pureName}`)}`
161
+   /* istanbul ignore if */
162
+  if (firstUpperCase) {
163
+    camelizeName = camelizeName.charAt(0).toUpperCase() + camelizeName.slice(1)
164
+  }
165
+  return camelizeName
166
+}
167
+
168
+function parsePath (obj, path = '') {
169
+  const segments = path.split('.')
170
+  let result = obj
171
+  for (let i = 0; i < segments.length; i++) {
172
+    const key = segments[i]
173
+     /* istanbul ignore if */
174
+    if (isUndef(result[key])) {
175
+      result = ''
176
+      break
177
+    } else {
178
+      result = result[key]
179
+    }
180
+  }
181
+  return result
182
+}
183
+
184
+const isFunc = judgeTypeFnCreator('Function')
185
+const isUndef = judgeTypeFnCreator('Undefined')
186
+const isArray = judgeTypeFnCreator('Array')
187
+const isString = judgeTypeFnCreator('String')
188
+const isObject = judgeTypeFnCreator('Object')
189
+const isNumber = judgeTypeFnCreator('Number')
190
+
191
+export {
192
+  findIndex,
193
+  deepAssign,
194
+  createAddAPI,
195
+  resetTypeValue,
196
+  parallel,
197
+  cb2PromiseWithResolve,
198
+  debounce,
199
+  processComponentName,
200
+  parsePath,
201
+  isUndef,
202
+  isFunc,
203
+  isArray,
204
+  isString,
205
+  isObject,
206
+  isNumber
207
+}

+ 3 - 0
src/common/helpers/validator/index.js

@@ -0,0 +1,3 @@
1
+export { rules, addRule } from './rules'
2
+export { addMessage } from './messages'
3
+export { types, addType } from './types'

+ 44 - 0
src/common/helpers/validator/language/chinese.js

@@ -0,0 +1,44 @@
1
+import { toLocaleDateString } from '../../util'
2
+
3
+export default {
4
+  required: '此为必填项',
5
+  type: {
6
+    string: '请输入字符',
7
+    number: '请输入数字',
8
+    array: '数据类型应为数组',
9
+    date: '请选择有效日期',
10
+    email: '请输入有效邮箱',
11
+    tel: '请输入有效的手机号码',
12
+    url: '请输入有效网址'
13
+  },
14
+  min: {
15
+    string: /* istanbul ignore next */ (config) => `至少输入 ${config} 位字符`,
16
+    number: /* istanbul ignore next */ (config) => `不得小于 ${config}`,
17
+    array: /* istanbul ignore next */ (config) => `请选择至少 ${config} 项`,
18
+    date: /* istanbul ignore next */ (config) => `请选择 ${toLocaleDateString(config, 'zh')} 之后的时间`,
19
+    email: /* istanbul ignore next */ (config) => `至少输入 ${config} 位字符`,
20
+    tel: /* istanbul ignore next */ (config) => `至少输入 ${config} 位字符`,
21
+    url: /* istanbul ignore next */ (config) => `至少输入 ${config} 位字符`
22
+  },
23
+  max: {
24
+    string: /* istanbul ignore next */ (config) => `请勿超过 ${config} 位字符`,
25
+    number: /* istanbul ignore next */ (config) => `请勿大于 ${config}`,
26
+    array: /* istanbul ignore next */ (config) => `最多选择 ${config} 项`,
27
+    date: /* istanbul ignore next */ (config) => `请选择 ${toLocaleDateString(config, 'zh')} 之前的时间`,
28
+    email: /* istanbul ignore next */ (config) => `请勿超过 ${config} 位字符`,
29
+    tel: /* istanbul ignore next */ (config) => `请勿超过 ${config} 位字符`,
30
+    url: /* istanbul ignore next */ (config) => `请勿超过 ${config} 位字符`
31
+  },
32
+  len: {
33
+    string: /* istanbul ignore next */ (config) => `请输入 ${config} 位字符`,
34
+    number: /* istanbul ignore next */ (config) => `长度应等于 ${config}`,
35
+    array: /* istanbul ignore next */ (config) => `请选择 ${config} 项`,
36
+    date: /* istanbul ignore next */ (config) => `请选择 ${toLocaleDateString(config, 'zh')}`,
37
+    email: /* istanbul ignore next */ (config) => `请输入 ${config} 位字符`,
38
+    tel: /* istanbul ignore next */ (config) => `请输入 ${config} 位字符`,
39
+    url: /* istanbul ignore next */ (config) => `请输入 ${config} 位字符`
40
+  },
41
+  pattern: '格式错误',
42
+  custom: '未通过校验',
43
+  notWhitespace: '空白内容无效'
44
+}

+ 44 - 0
src/common/helpers/validator/language/english.js

@@ -0,0 +1,44 @@
1
+import { toLocaleDateString } from '../../util'
2
+
3
+export default {
4
+  required: 'Required.',
5
+  type: {
6
+    string: 'Please input characters.',
7
+    number: 'Please input numbers.',
8
+    array: 'The data type should be array.',
9
+    date: 'Please select a valid date.',
10
+    email: 'Please input a valid E-mail.',
11
+    tel: 'Please input a valid telphone number.',
12
+    url: 'Please input a valid web site.'
13
+  },
14
+  min: {
15
+    string: /* istanbul ignore next */ (config) => `Please input at least ${config} characters.`,
16
+    number: /* istanbul ignore next */ (config) => `The number could not smaller than ${config}.`,
17
+    array: /* istanbul ignore next */ (config) => `Please select at least ${config} items.`,
18
+    date: /* istanbul ignore next */ (config) => `Please select a date after ${toLocaleDateString(config, 'en')}`,
19
+    email: /* istanbul ignore next */ (config) => `Please input at least ${config} characters.`,
20
+    tel: /* istanbul ignore next */ (config) => `Please input at least ${config} characters.`,
21
+    url: /* istanbul ignore next */ (config) => `Please input at least ${config} characters.`
22
+  },
23
+  max: {
24
+    string: /* istanbul ignore next */ (config) => `Please input no more than ${config} characters.`,
25
+    number: /* istanbul ignore next */ (config) => `The number could not bigger than ${config}`,
26
+    array: /* istanbul ignore next */ (config) => `Please select no more than  ${config} items`,
27
+    date: /* istanbul ignore next */ (config) => `Please select a date before ${toLocaleDateString(config, 'en')}`,
28
+    email: /* istanbul ignore next */ (config) => `Please input no more than ${config} characters.`,
29
+    tel: /* istanbul ignore next */ (config) => `Please input no more than ${config} characters.`,
30
+    url: /* istanbul ignore next */ (config) => `Please input no more than ${config} characters.`
31
+  },
32
+  len: {
33
+    string: /* istanbul ignore next */ (config) => `Please input ${config} characters.`,
34
+    number: /* istanbul ignore next */ (config) => `The length should equal ${config}`,
35
+    array: /* istanbul ignore next */ (config) => `Please select ${config} items`,
36
+    date: /* istanbul ignore next */ (config) => `Please select ${toLocaleDateString(config, 'en')}`,
37
+    email: /* istanbul ignore next */ (config) => `Please input ${config} characters.`,
38
+    tel: /* istanbul ignore next */ (config) => `Please input ${config} characters.`,
39
+    url: /* istanbul ignore next */ (config) => `Please input ${config} characters.`
40
+  },
41
+  pattern: 'The input don"t match pattern.',
42
+  custom: 'Invalid.',
43
+  notWhitespace: 'Whitespace is invalid.'
44
+}

+ 18 - 0
src/common/helpers/validator/messages.js

@@ -0,0 +1,18 @@
1
+import { deepAssign } from '../util'
2
+
3
+function addMessage (...args) {
4
+  const NAMESPACE = 'validator'
5
+  const vueProto = this._base.prototype
6
+  const lang = vueProto.$cubeLang
7
+  const baseMessages = vueProto.$cubeMessages[lang][NAMESPACE]
8
+
9
+  if (typeof args[0] === 'string') {
10
+    args[0] = {
11
+      [args[0]]: args[1]
12
+    }
13
+  }
14
+
15
+  deepAssign(baseMessages, args[0])
16
+}
17
+
18
+export { addMessage }

+ 52 - 0
src/common/helpers/validator/rules.js

@@ -0,0 +1,52 @@
1
+import { createAddAPI } from '../util'
2
+import { types } from './types'
3
+
4
+const rules = {
5
+  required: (val, required, type) => {
6
+    type = type || (Array.isArray(val) ? 'array' : typeof val)
7
+    if (type === 'array' && Array.isArray(val)) {
8
+      return val.length > 0
9
+    }
10
+    return val !== '' && val !== undefined && val !== null
11
+  },
12
+  type: (val, type) => {
13
+    return !types[type] || types[type](val)
14
+  },
15
+  min: (val, min, type) => {
16
+    type = type || (typeof val)
17
+    if (type === 'number' || type === 'date') {
18
+      return Number(val) >= min
19
+    } else {
20
+      return val.length >= min
21
+    }
22
+  },
23
+  max: (val, max, type) => {
24
+    type = type || (typeof val)
25
+    if (type === 'number' || type === 'date') {
26
+      return Number(val) <= max
27
+    } else {
28
+      return val.length <= max
29
+    }
30
+  },
31
+  len: (val, len, type) => {
32
+    type = type || (typeof val)
33
+    let target = val
34
+    if (target.length === undefined) {
35
+      target = type === 'object' ? Object.keys(target) : String(target)
36
+    }
37
+    return target.length === len
38
+  },
39
+  notWhitespace: (val, config, type) => {
40
+    return !/^\s+$/.test(val)
41
+  },
42
+  pattern: (val, pattern, type) => {
43
+    return pattern.test(val)
44
+  },
45
+  custom: (val, custom, type) => {
46
+    return custom(val)
47
+  }
48
+}
49
+
50
+const addRule = createAddAPI(rules)
51
+
52
+export { rules, addRule }

+ 31 - 0
src/common/helpers/validator/types.js

@@ -0,0 +1,31 @@
1
+import { createAddAPI } from '../util'
2
+
3
+const DATE_RE = /^(1|2)\d{3}[.\-/]\d{1,2}[.\-/]\d{1,2}$/
4
+
5
+const types = {
6
+  string: (val) => {
7
+    return typeof val === 'string'
8
+  },
9
+  number: (val) => {
10
+    return !isNaN(Number(val))
11
+  },
12
+  array: (val) => {
13
+    return Array.isArray(val)
14
+  },
15
+  date: (val) => {
16
+    return !isNaN(Number(val)) || DATE_RE.test(val)
17
+  },
18
+  email: (val) => {
19
+    return typeof val === 'string' && /^[a-z0-9_-]+@[a-z0-9_-]+(\.[a-z0-9_-]+)+$/i.test(val)
20
+  },
21
+  tel: (val) => {
22
+    return typeof val === 'string' && /^(11|13|14|15|17|18|19)[0-9]{9}$/.test(val)
23
+  },
24
+  url: (val) => {
25
+    return typeof val === 'string' && /(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/.test(val)
26
+  }
27
+}
28
+
29
+const addType = createAddAPI(types)
30
+
31
+export { types, addType }

+ 208 - 0
src/common/icon/cube-icon.styl

@@ -0,0 +1,208 @@
1
+@font-face
2
+  font-family: "cube-icon"
3
+  src:
4
+    url("./cubeic.woff") format("woff"),
5
+    url("./cubeic.ttf") format("truetype")
6
+
7
+[class^="cubeic-"], [class*=" cubeic-"]
8
+  font-family: "cube-icon"!important
9
+  font-size: 100%
10
+  font-style: normal
11
+  -webkit-font-smoothing: antialiased
12
+  -webkit-text-stroke-width: 0.2px
13
+  -moz-osx-font-smoothing: grayscale
14
+
15
+.cubeic-eye-invisible::before
16
+  content: "\e624"
17
+
18
+.cubeic-eye-visible::before
19
+  content: "\e625"
20
+
21
+.cubeic-square-right::before
22
+  content: "\e67d"
23
+
24
+.cubeic-select::before
25
+  content: "\e609"
26
+
27
+.cubeic-pulldown::before
28
+  content: "\e603"
29
+
30
+.cubeic-pullup::before
31
+  content: "\e604"
32
+
33
+.cubeic-more::before
34
+  content: "\e607"
35
+
36
+.cubeic-back::before
37
+  content: "\e608"
38
+
39
+.cubeic-arrow::before
40
+  content: "\e60b"
41
+
42
+.cubeic-close::before
43
+  content: "\e60d"
44
+
45
+.cubeic-warn::before
46
+  content: "\e614"
47
+
48
+.cubeic-question::before
49
+  content: "\e616"
50
+
51
+.cubeic-right::before
52
+  content: "\e617"
53
+
54
+.cubeic-wrong::before
55
+  content: "\e618"
56
+
57
+.cubeic-info::before
58
+  content: "\e619"
59
+
60
+.cubeic-remove::before
61
+  content: "\e61a"
62
+
63
+.cubeic-add::before
64
+  content: "\e61c"
65
+
66
+.cubeic-share::before
67
+  content: "\e631"
68
+
69
+.cubeic-no-wifi::before
70
+  content: "\e632"
71
+
72
+.cubeic-smile::before
73
+  content: "\e634"
74
+
75
+.cubeic-sad::before
76
+  content: "\e636"
77
+
78
+.cubeic-email::before
79
+  content: "\e637"
80
+
81
+.cubeic-game::before
82
+  content: "\e638"
83
+
84
+.cubeic-wifi::before
85
+  content: "\e639"
86
+
87
+.cubeic-hot::before
88
+  content: "\e63b"
89
+
90
+.cubeic-notification::before
91
+  content: "\e63d"
92
+
93
+.cubeic-delete::before
94
+  content: "\e63e"
95
+
96
+.cubeic-vip::before
97
+  content: "\e63f"
98
+
99
+.cubeic-mute::before
100
+  content: "\e640"
101
+
102
+.cubeic-danger::before
103
+  content: "\e641"
104
+
105
+.cubeic-volume::before
106
+  content: "\e642"
107
+
108
+.cubeic-bad::before
109
+  content: "\e643"
110
+
111
+.cubeic-mobile-phone::before
112
+  content: "\e644"
113
+
114
+.cubeic-aim::before
115
+  content: "\e645"
116
+
117
+.cubeic-navigation::before
118
+  content: "\e64d"
119
+
120
+.cubeic-safe-pay::before
121
+  content: "\e64e"
122
+
123
+.cubeic-tag::before
124
+  content: "\e64f"
125
+
126
+.cubeic-lock::before
127
+  content: "\e651"
128
+
129
+.cubeic-unlock::before
130
+  content: "\e652"
131
+
132
+.cubeic-edit::before
133
+  content: "\e653"
134
+
135
+.cubeic-scan::before
136
+  content: "\e654"
137
+
138
+.cubeic-qr-code::before
139
+  content: "\e655"
140
+
141
+.cubeic-calendar::before
142
+  content: "\e659"
143
+
144
+.cubeic-time::before
145
+  content: "\e65f"
146
+
147
+.cubeic-red-packet::before
148
+  content: "\e664"
149
+
150
+.cubeic-star::before
151
+  content: "\e668"
152
+
153
+.cubeic-setting::before
154
+  content: "\e669"
155
+
156
+.cubeic-home::before
157
+  content: "\e66d"
158
+
159
+.cubeic-credit-card::before
160
+  content: "\e66e"
161
+
162
+.cubeic-mall::before
163
+  content: "\e670"
164
+
165
+.cubeic-microphone::before
166
+  content: "\e673"
167
+
168
+.cubeic-search::before
169
+  content: "\e674"
170
+
171
+.cubeic-good::before
172
+  content: "\e675"
173
+
174
+.cubeic-alert::before
175
+  content: "\e676"
176
+
177
+.cubeic-picture::before
178
+  content: "\e677"
179
+
180
+.cubeic-message::before
181
+  content: "\e678"
182
+
183
+.cubeic-phone::before
184
+  content: "\e67a"
185
+
186
+.cubeic-location::before
187
+  content: "\e67b"
188
+
189
+.cubeic-like::before
190
+  content: "\e67c"
191
+
192
+.cubeic-camera::before
193
+  content: "\e67e"
194
+
195
+.cubeic-person::before
196
+  content: "\e67f"
197
+
198
+.cubeic-round-border::before
199
+  content: "\e683"
200
+
201
+.cubeic-important::before
202
+  content: "\e68b"
203
+
204
+.cubeic-ok::before
205
+  content: "\e68c"
206
+
207
+.cubeic-square-border::before
208
+  content: "\e990"

BIN
src/common/icon/cubeic.ttf


BIN
src/common/icon/cubeic.woff


+ 23 - 0
src/common/js/date.js

@@ -0,0 +1,23 @@
1
+export function formatDate (date, fmt) {
2
+    if (/(y+)/.test(fmt)) {
3
+    fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
4
+    }
5
+    let o = {
6
+    'M+': date.getMonth() + 1,
7
+    'd+': date.getDate(),
8
+    'h+': date.getHours(),
9
+    'm+': date.getMinutes(),
10
+    's+': date.getSeconds()
11
+    };
12
+    for (let k in o) {
13
+    if (new RegExp(`(${k})`).test(fmt)) {
14
+    let str = o[k] + '';
15
+    fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
16
+    }
17
+    }
18
+    return fmt;
19
+    };
20
+    
21
+    function padLeftZero (str) {
22
+    return ('00' + str).substr(str.length);
23
+    };

+ 61 - 0
src/common/js/util.js

@@ -0,0 +1,61 @@
1
+var SIGN_REGEXP = /([yMdhsm])(\1*)/g;
2
+var DEFAULT_PATTERN = 'yyyy-MM-dd';
3
+function padding(s, len) {
4
+    var len = len - (s + '').length;
5
+    for (var i = 0; i < len; i++) { s = '0' + s; }
6
+    return s;
7
+};
8
+
9
+export default {
10
+    getQueryStringByName: function (name) {
11
+        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
12
+        var r = window.location.search.substr(1).match(reg);
13
+        var context = "";
14
+        if (r != null)
15
+            context = r[2];
16
+        reg = null;
17
+        r = null;
18
+        return context == null || context == "" || context == "undefined" ? "" : context;
19
+    },
20
+    formatDate: {
21
+
22
+
23
+        format: function (date, pattern) {
24
+            pattern = pattern || DEFAULT_PATTERN;
25
+            return pattern.replace(SIGN_REGEXP, function ($0) {
26
+                switch ($0.charAt(0)) {
27
+                    case 'y': return padding(date.getFullYear(), $0.length);
28
+                    case 'M': return padding(date.getMonth() + 1, $0.length);
29
+                    case 'd': return padding(date.getDate(), $0.length);
30
+                    case 'w': return date.getDay() + 1;
31
+                    case 'h': return padding(date.getHours(), $0.length);
32
+                    case 'm': return padding(date.getMinutes(), $0.length);
33
+                    case 's': return padding(date.getSeconds(), $0.length);
34
+                }
35
+            });
36
+        },
37
+        parse: function (dateString, pattern) {
38
+            var matchs1 = pattern.match(SIGN_REGEXP);
39
+            var matchs2 = dateString.match(/(\d)+/g);
40
+            if (matchs1.length == matchs2.length) {
41
+                var _date = new Date(1970, 0, 1);
42
+                for (var i = 0; i < matchs1.length; i++) {
43
+                    var _int = parseInt(matchs2[i]);
44
+                    var sign = matchs1[i];
45
+                    switch (sign.charAt(0)) {
46
+                        case 'y': _date.setFullYear(_int); break;
47
+                        case 'M': _date.setMonth(_int - 1); break;
48
+                        case 'd': _date.setDate(_int); break;
49
+                        case 'h': _date.setHours(_int); break;
50
+                        case 'm': _date.setMinutes(_int); break;
51
+                        case 's': _date.setSeconds(_int); break;
52
+                    }
53
+                }
54
+                return _date;
55
+            }
56
+            return null;
57
+        }
58
+
59
+    }
60
+
61
+};

+ 109 - 0
src/common/lang/date.js

@@ -0,0 +1,109 @@
1
+const DAY_TIMESTAMP = 60 * 60 * 24 * 1000
2
+const HOUR_TIMESTAMP = 60 * 60 * 1000
3
+const MINUTE_TIMESTAMP = 60 * 1000
4
+
5
+function formatType(type, format, value, regExpAttributes) {
6
+  const regExpMap = {
7
+    year: '(Y+)',
8
+    month: '(M+)',
9
+    date: '(D+)',
10
+    hour: '(h+)',
11
+    minute: '(m+)',
12
+    second: '(s+)',
13
+    quarter: '(q+)',
14
+    millisecond: '(S)'
15
+  }
16
+
17
+  if (new RegExp(regExpMap[type], regExpAttributes).test(format)) {
18
+    const replaceStr = type === 'year'
19
+                       ? value.toString().substr(4 - RegExp.$1.length)
20
+                       : (RegExp.$1.length === 1) ? value : pad(value)
21
+    format = format.replace(RegExp.$1, replaceStr)
22
+  }
23
+
24
+  return format
25
+}
26
+
27
+function pad(value) {
28
+  return ('00' + value).substr(('' + value).length)
29
+}
30
+
31
+function formatDate(date, format) {
32
+  const map = {
33
+    year: {
34
+      value: date.getFullYear(),
35
+      regExpAttributes: 'i'
36
+    },
37
+    month: {
38
+      value: date.getMonth() + 1
39
+    },
40
+    date: {
41
+      value: date.getDate(),
42
+      regExpAttributes: 'i'
43
+    },
44
+    hour: {
45
+      value: date.getHours(),
46
+      regExpAttributes: 'i'
47
+    },
48
+    minute: {
49
+      value: date.getMinutes()
50
+    },
51
+    second: {
52
+      value: date.getSeconds()
53
+    },
54
+    quarter: {
55
+      value: Math.floor((date.getMonth() + 3) / 3),
56
+      regExpAttributes: 'i'
57
+    },
58
+    millisecond: {
59
+      value: date.getMilliseconds()
60
+    }
61
+  }
62
+
63
+  for (const key in map) {
64
+    format = formatType(key, format, map[key].value, map[key].regExpAttributes)
65
+  }
66
+
67
+  return format
68
+}
69
+
70
+function getZeroStamp(date) {
71
+  const year = date.getFullYear()
72
+  const month = date.getMonth() + 1
73
+  const day = date.getDate()
74
+  return +new Date(year + '/' + month + '/' + day + ' 00:00:00')
75
+}
76
+
77
+function getDayDiff(date1, date2) {
78
+  return Math.floor((getZeroStamp(date1) - getZeroStamp(date2)) / DAY_TIMESTAMP)
79
+}
80
+
81
+function getNow() {
82
+  return window.performance && window.performance.now ? (window.performance.now() + window.performance.timing.navigationStart) : +new Date()
83
+}
84
+
85
+function computeNatureMaxDay(month, year) {
86
+  let natureMaxDay = 30
87
+  if ([1, 3, 5, 7, 8, 10, 12].indexOf(month) > -1) {
88
+    natureMaxDay = 31
89
+  } else {
90
+    if (month === 2) {
91
+      natureMaxDay = !year || (!(year % 400) || (!(year % 4) && year % 100)) ? 29 : 28
92
+    }
93
+  }
94
+
95
+  return natureMaxDay
96
+}
97
+
98
+export {
99
+  DAY_TIMESTAMP,
100
+  HOUR_TIMESTAMP,
101
+  MINUTE_TIMESTAMP,
102
+  pad,
103
+  formatType,
104
+  formatDate,
105
+  getZeroStamp,
106
+  getDayDiff,
107
+  getNow,
108
+  computeNatureMaxDay
109
+}

+ 12 - 0
src/common/lang/string.js

@@ -0,0 +1,12 @@
1
+const camelizeRE = /-(\w)/g
2
+export function camelize (str) {
3
+  str = String(str)
4
+  return str.replace(camelizeRE, function (m, c) {
5
+    return c ? c.toUpperCase() : ''
6
+  })
7
+}
8
+
9
+export function kebab (str) {
10
+  str = String(str)
11
+  return str.replace(/([A-Z])/g, '-$1').toLowerCase()
12
+}

+ 51 - 0
src/common/locale/index.js

@@ -0,0 +1,51 @@
1
+import defaultMessages from '../../locale/lang/zh-CN'
2
+import { warn } from '../helpers/debug'
3
+import { isUndef, isNumber } from '../helpers/util'
4
+import { formatDate } from '../lang/date'
5
+
6
+let proto
7
+
8
+const DEFAULT_LANG = 'zh-CN'
9
+
10
+const locale = {
11
+  name: 'locale',
12
+  install (Vue) {
13
+    if (locale.installed) return
14
+    proto = Vue.prototype
15
+    Vue.util.defineReactive(proto, '$cubeLang', DEFAULT_LANG)
16
+    proto['$cubeMessages'] = { [DEFAULT_LANG]: defaultMessages }
17
+    locale.installed = true
18
+  },
19
+  use (lang, messages) {
20
+    proto['$cubeLang'] = lang
21
+    const cubeMessages = proto['$cubeMessages']
22
+    // if messages have never been stored in vue.prototye
23
+    if (!(lang in cubeMessages)) {
24
+      cubeMessages[[lang]] = messages
25
+    }
26
+  },
27
+  helpers: {
28
+    toLocaleDateString (config, formatRules) {
29
+      /**
30
+       * Safari don't support formatRules like
31
+       * 'yyyy-MM-dd hh:mm:ss', so transfer it to 'yyyy/MM/dd hh:mm:ss'
32
+       */
33
+      const compatibleConfig = isNumber(config) ? config : config.replace(/-/g, '/')
34
+      const date = new Date(compatibleConfig)
35
+      /* istanbul ignore if */
36
+      if (isUndef(formatRules)) return date.toDateString()
37
+      return formatDate(date, formatRules)
38
+    }
39
+  },
40
+  addHelper (fnName, fn) {
41
+    // check existed helper fn
42
+    /* istanbul ignore if */
43
+    if (fnName in locale.helpers) {
44
+      warn(`${fnName} has already been registered on helpers function, please change another name`)
45
+      return
46
+    }
47
+    locale.helpers[fnName] = fn
48
+  }
49
+}
50
+
51
+export default locale

+ 44 - 0
src/common/mixins/basic-picker.js

@@ -0,0 +1,44 @@
1
+const DEFAULT_KEYS = {
2
+  value: 'value',
3
+  text: 'text'
4
+}
5
+
6
+export default {
7
+  props: {
8
+    data: {
9
+      type: Array,
10
+      default() {
11
+        return []
12
+      }
13
+    },
14
+    selectedIndex: {
15
+      type: Array,
16
+      default() {
17
+        return []
18
+      }
19
+    },
20
+    alias: {
21
+      type: Object,
22
+      default() {
23
+        return {}
24
+      }
25
+    }
26
+  },
27
+  computed: {
28
+    valueKey() {
29
+      return this.alias.value || DEFAULT_KEYS.value
30
+    },
31
+    textKey() {
32
+      return this.alias.text || DEFAULT_KEYS.text
33
+    },
34
+    merge() {
35
+      return [this.data, this.selectedIndex]
36
+    }
37
+  },
38
+  watch: {
39
+    // Merge the watch handlers of data and selectedIndex into one.
40
+    merge(newVal) {
41
+      this.setData(newVal[0], newVal[1])
42
+    }
43
+  }
44
+}

+ 22 - 0
src/common/mixins/deprecated.js

@@ -0,0 +1,22 @@
1
+import { tip } from '../../common/helpers/debug'
2
+import { kebab } from '../../common/lang/string'
3
+
4
+export default {
5
+  methods: {
6
+    _checkDeprecated() {
7
+      const props = this.$options.props
8
+      const componentName = this.$options.name
9
+
10
+      Object.entries(props).forEach(([key, prop]) => {
11
+        const deprecated = prop.deprecated
12
+
13
+        if (deprecated && this[key] !== undefined) {
14
+          tip(`The property "${kebab(key)}" is deprecated, please use the recommended property "${deprecated.replacedBy}" to replace it. Details could be found in https://didi.github.io/cube-ui/#/en-US/docs/${componentName.substr(5)}#cube-Propsconfiguration-anchor`, componentName)
15
+        }
16
+      })
17
+    }
18
+  },
19
+  mounted() {
20
+    this._checkDeprecated()
21
+  }
22
+}

+ 25 - 0
src/common/mixins/locale.js

@@ -0,0 +1,25 @@
1
+import locale from '../locale'
2
+import { parsePath, isUndef } from '../helpers/util'
3
+import { warn } from '../helpers/debug'
4
+
5
+const TRANSLATION_ABSENT = `Translation is not registered correctly, ` +
6
+                           `you can call Locale.use() to install it.`
7
+
8
+export default {
9
+  computed: {
10
+    $t () {
11
+      const lang = this.$cubeLang
12
+      const messages = this.$cubeMessages[lang]
13
+      if (isUndef(messages)) {
14
+        warn(TRANSLATION_ABSENT)
15
+        return ''
16
+      }
17
+      return (path) => {
18
+        return parsePath(messages, path)
19
+      }
20
+    }
21
+  },
22
+  beforeCreate() {
23
+    locale.install(this.$root.constructor)
24
+  }
25
+}

+ 34 - 0
src/common/mixins/picker.js

@@ -0,0 +1,34 @@
1
+export default {
2
+  props: {
3
+    title: {
4
+      type: String
5
+    },
6
+    subtitle: {
7
+      type: String
8
+    },
9
+    cancelTxt: {
10
+      type: String,
11
+      default: ''
12
+    },
13
+    confirmTxt: {
14
+      type: String,
15
+      default: ''
16
+    },
17
+    swipeTime: {
18
+      type: Number,
19
+      default: 2500
20
+    },
21
+    maskClosable: {
22
+      type: Boolean,
23
+      default: true
24
+    }
25
+  },
26
+  computed: {
27
+    _cancelTxt () {
28
+      return this.cancelTxt || this.$t('cancel')
29
+    },
30
+    _confirmTxt () {
31
+      return this.confirmTxt || this.$t('ok')
32
+    }
33
+  }
34
+}

+ 12 - 0
src/common/mixins/popup.js

@@ -0,0 +1,12 @@
1
+export default {
2
+  props: {
3
+    zIndex: {
4
+      type: Number,
5
+      default: 100
6
+    },
7
+    maskClosable: {
8
+      type: Boolean,
9
+      default: false
10
+    }
11
+  }
12
+}

+ 11 - 0
src/common/mixins/scroll.js

@@ -0,0 +1,11 @@
1
+export default {
2
+  props: {
3
+    // the options of BetterScroll
4
+    options: {
5
+      type: Object,
6
+      default() {
7
+        return {}
8
+      }
9
+    }
10
+  }
11
+}

+ 45 - 0
src/common/mixins/visibility.js

@@ -0,0 +1,45 @@
1
+const EVENT_TOGGLE = 'toggle'
2
+
3
+export default {
4
+  model: {
5
+    prop: 'visible',
6
+    event: EVENT_TOGGLE
7
+  },
8
+  props: {
9
+    visible: {
10
+      type: Boolean,
11
+      default: false
12
+    }
13
+  },
14
+  data() {
15
+    return {
16
+      // If use the prop visible directly, the toggle will failed when user haven't set v-model as a reactive property.
17
+      // So we use the data isVisible instead.
18
+      isVisible: false
19
+    }
20
+  },
21
+  watch: {
22
+    isVisible(newVal) {
23
+      this.$emit(EVENT_TOGGLE, newVal)
24
+    }
25
+  },
26
+  mounted() {
27
+    this.$watch('visible', (newVal, oldVal) => {
28
+      if (newVal) {
29
+        this.show()
30
+      } else if (oldVal && !this._createAPI_reuse) {
31
+        this.hide()
32
+      }
33
+    }, {
34
+      immediate: true
35
+    })
36
+  },
37
+  methods: {
38
+    show() {
39
+      this.isVisible = true
40
+    },
41
+    hide() {
42
+      this.isVisible = false
43
+    }
44
+  }
45
+}

+ 93 - 0
src/common/stylus/base.styl

@@ -0,0 +1,93 @@
1
+@require "./variable.styl"
2
+@require "./mixin.styl"
3
+
4
+body, html
5
+  line-height: 1
6
+  font-family: 'PingFang SC', 'STHeitiSC-Light', 'Helvetica-Light', arial, sans-serif, 'Droid Sans Fallback'
7
+  user-select: none
8
+  -webkit-tap-highlight-color: transparent
9
+
10
+.clear-fix
11
+  &::after
12
+    content: ""
13
+    display: table
14
+    clear: both
15
+
16
+.border-top-1px, .border-right-1px, .border-bottom-1px, .border-left-1px
17
+  position: relative
18
+  &::before, &::after
19
+    content: ""
20
+    display: block
21
+    position: absolute
22
+    transform-origin: 0 0
23
+
24
+.border-top-1px
25
+  &::before
26
+    border-top: 1PX solid $color-row-line
27
+    left: 0
28
+    top: 0
29
+    width: 100%
30
+    transform-origin: 0 top
31
+
32
+.border-right-1px
33
+  &::after
34
+    border-right: 1PX solid $color-col-line
35
+    top: 0
36
+    right: 0
37
+    height: 100%
38
+    transform-origin: right 0
39
+
40
+.border-bottom-1px
41
+  &::after
42
+    border-bottom: 1PX solid $color-row-line
43
+    left: 0
44
+    bottom: 0
45
+    width: 100%
46
+    transform-origin: 0 bottom
47
+
48
+.border-left-1px
49
+  &::before
50
+    border-left: 1PX solid $color-col-line
51
+    top: 0
52
+    left: 0
53
+    height: 100%
54
+    transform-origin: left 0
55
+
56
+.cube-safe-area-pb
57
+  safe-area-mixin(padding-bottom, bottom, true)
58
+
59
+@media (min-resolution: 2dppx)
60
+  .border-top-1px
61
+    &::before
62
+      width: 200%
63
+      transform: scale(.5)
64
+  .border-right-1px
65
+    &::after
66
+      height: 200%
67
+      transform: scale(.5)
68
+  .border-bottom-1px
69
+    &::after
70
+      width: 200%
71
+      transform: scale(.5)
72
+  .border-left-1px
73
+    &::before
74
+      height: 200%
75
+      transform: scale(.5)
76
+
77
+@media (min-resolution: 3dppx)
78
+  .border-top-1px
79
+    &::before
80
+      width: 300%
81
+      transform: scale(.333)
82
+  .border-right-1px
83
+    &::after
84
+      height: 300%
85
+      transform: scale(.333)
86
+  .border-bottom-1px
87
+    &::after
88
+      width: 300%
89
+      transform: scale(.333)
90
+  .border-left-1px
91
+    &::before
92
+      height: 300%
93
+      transform: scale(.333)

+ 5 - 0
src/common/stylus/index.styl

@@ -0,0 +1,5 @@
1
+@require "./variable.styl"
2
+@require "./mixin.styl"
3
+@require "./reset.styl"
4
+@require "./base.styl"
5
+@require "../icon/cube-icon.styl"

+ 63 - 0
src/common/stylus/mixin.styl

@@ -0,0 +1,63 @@
1
+border-1px($color = #ccc, $radius = 2PX, $style = solid)
2
+  position: relative
3
+  &::after
4
+    content: ""
5
+    pointer-events: none
6
+    display: block
7
+    position: absolute
8
+    left: 0
9
+    top: 0
10
+    transform-origin: 0 0
11
+    border: 1PX $style $color
12
+    border-radius: $radius
13
+    box-sizing border-box
14
+    width 100%
15
+    height 100%
16
+    @media (min-resolution: 2dppx)
17
+      width: 200%
18
+      height: 200%
19
+      border-radius: $radius * 2
20
+      transform: scale(.5)
21
+    @media (min-resolution: 3dppx)
22
+      width: 300%
23
+      height: 300%
24
+      border-radius: $radius * 3
25
+      transform: scale(.333)
26
+
27
+border-none()
28
+  &::before
29
+    display: none
30
+  &::after
31
+    display: none
32
+
33
+flex-fix()
34
+  flex: 1
35
+  flex-basis: 0.000000001px
36
+  width: 1%
37
+
38
+touch-active(type = orange)
39
+  if (type == orange)
40
+    &:active
41
+      color: #fcc1a6
42
+      background-color: rgba(250, 143, 84, .04)
43
+  else
44
+    &:active
45
+      color: #c6c6c6
46
+      background-color: rgba(0, 0, 0, .04)
47
+
48
+hide-scrollbar()
49
+  &::-webkit-scrollbar
50
+    width: 0
51
+    height: 0
52
+
53
+bg-image($url, $ext = ".png")
54
+  background-image: url($url + "@2x" + $ext)
55
+  @media (min-resolution: 3dppx)
56
+    background-image: url($url + "@3x" + $ext)
57
+
58
+functions = constant env
59
+safe-area-fn(fn, position)
60
+  s("%s(safe-area-inset-%s)", fn, position)
61
+safe-area-mixin(property, position, important = false)
62
+  for fn in functions
63
+    {property} safe-area-fn(fn, position) important == true ? !important : unquote("")

+ 55 - 0
src/common/stylus/reset.styl

@@ -0,0 +1,55 @@
1
+/**
2
+ * Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)
3
+ * http://cssreset.com
4
+ */
5
+html, body, div, span, applet, object, iframe,
6
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
7
+a, abbr, acronym, address, big, cite, code,
8
+del, dfn, em, img, ins, kbd, q, s, samp,
9
+small, strike, strong, sub, sup, tt, var,
10
+b, u, i, center,
11
+dl, dt, dd, ol, ul, li,
12
+fieldset, form, label, legend,
13
+table, caption, tbody, tfoot, thead, tr, th, td,
14
+article, aside, canvas, details, embed,
15
+figure, figcaption, footer, header,
16
+menu, nav, output, ruby, section, summary,
17
+time, mark, audio, video, input
18
+  margin: 0
19
+  padding: 0
20
+  border: 0
21
+  font-size: 100%
22
+  font-weight: normal
23
+  vertical-align: baseline
24
+
25
+/* HTML5 display-role reset for older browsers */
26
+article, aside, details, figcaption, figure,
27
+footer, header, menu, nav, section
28
+  display: block
29
+
30
+body
31
+  line-height: 1
32
+
33
+blockquote, q
34
+  quotes: none
35
+
36
+blockquote:before, blockquote:after,
37
+q:before, q:after
38
+  content: none
39
+
40
+table
41
+  border-collapse: collapse
42
+  border-spacing: 0
43
+
44
+/* custom */
45
+
46
+a
47
+  color: #999
48
+  text-decoration: none
49
+
50
+li
51
+  list-style: none
52
+
53
+body
54
+  -webkit-text-size-adjust: none
55
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0)

+ 224 - 0
src/common/stylus/theme/default.styl

@@ -0,0 +1,224 @@
1
+@require "../var/color.styl"
2
+
3
+// action-sheet
4
+$action-sheet-color := $color-grey
5
+$action-sheet-active-color := $color-orange
6
+$action-sheet-bgc := $color-white
7
+$action-sheet-active-bgc := $color-light-grey-opacity
8
+$action-sheet-title-color := $color-dark-grey
9
+$action-sheet-space-bgc := $color-mask-bg
10
+/// picker style
11
+$action-sheet-picker-cancel-color := $color-light-grey
12
+$action-sheet-picker-cancel-active-color := $color-light-grey-s
13
+
14
+// bubble
15
+
16
+// button
17
+$btn-color := $color-white
18
+$btn-bgc := $color-regular-blue
19
+$btn-active-bgc := $color-blue
20
+/// primary
21
+$btn-primary-color := $color-white
22
+$btn-primary-bgc := $color-orange
23
+$btn-primary-active-bgc := $color-dark-orange
24
+/// light
25
+$btn-light-color := $color-grey
26
+$btn-light-bgc := $color-light-grey-sss
27
+$btn-light-active-bgc := $color-active-grey
28
+/// outline
29
+$btn-outline-color := $color-grey
30
+$btn-outline-bgc := transparent
31
+$btn-outline-bdc := $color-grey
32
+$btn-outline-active-bgc := $color-grey-opacity
33
+$btn-outline-active-bdc := $color-grey
34
+/// outline-primary
35
+$btn-outline-primary-color := $color-orange
36
+$btn-outline-primary-bgc := transparent
37
+$btn-outline-primary-bdc := $color-orange
38
+$btn-outline-primary-active-bgc := $color-orange-opacity
39
+$btn-outline-primary-active-bdc := $color-dark-orange
40
+/// disabled
41
+$btn-disabled-color := $color-white
42
+$btn-disabled-bgc := $color-light-grey-s
43
+$btn-disabled-bdc := $color-light-grey-s
44
+
45
+// toolbar
46
+$toolbar-bgc := $color-light-grey-sss
47
+$toolbar-active-bgc := $color-active-grey
48
+
49
+// checkbox
50
+$checkbox-color := $color-grey
51
+$checkbox-icon-color := $color-light-grey-s
52
+/// checked
53
+$checkbox-checked-icon-color := $color-orange
54
+$checkbox-checked-icon-bgc := $color-white
55
+/// disabled
56
+$checkbox-disabled-icon-color := $color-light-grey-ss
57
+$checkbox-disabled-icon-bgc := $color-light-grey-ss
58
+// checkbox hollow
59
+$checkbox-hollow-checked-icon-color := $color-orange
60
+$checkbox-hollow-disabled-icon-color := $color-light-grey-ss
61
+// checkbox-group
62
+$checkbox-group-bgc := $color-white
63
+$checkbox-group-horizontal-bdc := $color-light-grey-s
64
+
65
+// radio
66
+$radio-group-bgc := $color-white
67
+$radio-group-horizontal-bdc := $color-light-grey-s
68
+$radio-color := $color-grey
69
+$radio-icon-color := $color-light-grey-s
70
+/// selected
71
+$radio-selected-icon-color := $color-white
72
+$radio-selected-icon-bgc := $color-orange
73
+/// disabled
74
+$radio-disabled-icon-bgc := $color-light-grey-ss
75
+// radio hollow
76
+$radio-hollow-selected-icon-color := $color-orange
77
+$radio-hollow-disabled-icon-color := $color-light-grey-ss
78
+
79
+//checker
80
+$checker-item-color := $color-grey
81
+$checker-item-bdc := $color-light-grey-sss
82
+$checker-item-bgc := $color-white
83
+$checker-item-active-color := $color-orange
84
+$checker-item-active-bdc := $color-orange
85
+$checker-item-active-bgc := $color-light-orange-opacity
86
+
87
+// dialog
88
+$dialog-color := $color-grey
89
+$dialog-bgc := $color-white
90
+$dialog-icon-color := $color-regular-blue
91
+$dialog-icon-bgc := $color-background
92
+$dialog-title-color := $color-dark-grey
93
+$dialog-close-color := $color-light-grey
94
+$dialog-btn-color := $color-light-grey
95
+$dialog-btn-bgc := $color-white
96
+$dialog-btn-active-bgc := $color-light-grey-opacity
97
+$dialog-btn-highlight-color := $color-orange
98
+$dialog-btn-highlight-active-bgc := $color-light-orange-opacity
99
+$dialog-btn-disabled-color := $color-light-grey
100
+$dialog-btn-disabled-active-bgc := transparent
101
+$dialog-btns-split-color := $color-row-line
102
+
103
+// index-list
104
+$index-list-bgc := $color-white
105
+$index-list-title-color := $color-dark-grey
106
+$index-list-anchor-color := $color-light-grey
107
+$index-list-anchor-bgc := #f7f7f7
108
+$index-list-item-color := $color-dark-grey
109
+$index-list-item-active-bgc := $color-light-grey-opacity
110
+$index-list-nav-color := $color-grey
111
+$index-list-nav-active-color := $color-orange
112
+
113
+// loading
114
+
115
+// picker
116
+$picker-bgc := $color-white
117
+$picker-title-color := $color-dark-grey
118
+$picker-subtitle-color := $color-light-grey
119
+$picker-confirm-btn-color := $color-orange
120
+$picker-confirm-btn-active-color := $color-light-orange
121
+$picker-cancel-btn-color := $color-light-grey
122
+$picker-cancel-btn-active-color := $color-light-grey-s
123
+$picker-item-color := $color-dark-grey
124
+
125
+// popup
126
+$popup-mask-bgc := rgb(37, 38, 45)
127
+$popup-mask-opacity := .4
128
+
129
+//scroll
130
+
131
+// slide
132
+$slide-dot-bgc := $color-light-grey-s
133
+$slide-dot-active-bgc := $color-orange
134
+
135
+// time-picker
136
+
137
+// tip
138
+$tip-color := $color-white
139
+$tip-bgc := $color-dark-grey-opacity
140
+
141
+// toast
142
+$toast-color := $color-light-grey-s
143
+$toast-bgc := rgba(37, 38, 45, 0.9)
144
+
145
+// upload
146
+$upload-btn-color := $color-grey
147
+$upload-btn-bgc := $color-white
148
+$upload-btn-active-bgc := $color-light-grey-opacity
149
+$upload-btn-box-shadow := 0 0 6px 2px $color-grey-opacity
150
+$upload-btn-border-color := #e5e5e5
151
+$upload-file-bgc := $color-white
152
+$upload-file-remove-color := rgba(0, 0, 0, .8)
153
+$upload-file-remove-bgc := $color-white
154
+$upload-file-state-bgc := $color-mask-bg
155
+$upload-file-success-color := $color-orange
156
+$upload-file-error-color := #f43530
157
+$upload-file-status-bgc := $color-white
158
+$upload-file-progress-color := $color-white
159
+
160
+// switch
161
+$switch-on-bgc := $color-orange
162
+$switch-off-bgc := $color-white
163
+$switch-off-border-color := #e4e4e4
164
+
165
+// input
166
+$input-color := $color-grey
167
+$input-bgc := $color-white
168
+$input-border-color := $color-row-line
169
+$input-focus-border-color := $color-orange
170
+$input-placeholder-color := $color-light-grey-s
171
+$input-clear-icon-color := $color-light-grey
172
+
173
+//textarea
174
+$textarea-color := $color-grey
175
+$textarea-bgc := $color-white
176
+$textarea-border-color := $color-row-line
177
+$textarea-focus-border-color := $color-orange
178
+$textarea-outline-color := $color-orange
179
+$textarea-placeholder-color := $color-light-grey-s
180
+$textarea-indicator-color := $color-light-grey-s
181
+
182
+// validator
183
+$validator-msg-def-color := #e64340
184
+
185
+// select
186
+$select-color := $color-grey
187
+$select-bgc := $color-white
188
+$select-disabled-color := #b8b8b8
189
+$select-disabled-bgc := $color-light-grey-opacity
190
+$select-border-color := $color-light-grey-s
191
+$select-border-active-color := $color-orange
192
+$select-icon-color := $color-light-grey
193
+$select-placeholder-color := $color-light-grey-s
194
+
195
+// swipe
196
+$swipe-btn-color := $color-white
197
+
198
+// form
199
+$form-color := $color-grey
200
+$form-bgc := $color-white
201
+$form-invalid-color := #e64340
202
+$form-group-legend-color := $color-light-grey
203
+$form-group-legend-bgc := $color-background
204
+$form-label-required-color := #e64340
205
+
206
+// drawer
207
+$drawer-color := $color-dark-grey
208
+$drawer-title-bdc := $color-light-grey-ss
209
+$drawer-title-bgc := $color-white
210
+$drawer-panel-bgc := $color-white
211
+$drawer-item-active-bgc := $color-light-grey-opacity
212
+
213
+// scroll-nav
214
+$scroll-nav-bgc := $color-white
215
+$scroll-nav-color := $color-grey
216
+$scroll-nav-active-color := $color-orange
217
+
218
+// image-preview
219
+$image-preview-counter-color := $color-white
220
+
221
+// tab-bar & tab-panel
222
+$tab-color := $color-grey
223
+$tab-active-color := $color-dark-orange
224
+$tab-slider-bgc := $color-dark-orange

+ 0 - 0
src/common/stylus/var/box-shadow.styl


Some files were not shown because too many files changed in this diff