Commit 794ad5d6 by golton_gao

update: first commit

parents
Showing with 10006 additions and 0 deletions
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": [
"transform-runtime"
],
"comments": false,
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": [ "istanbul" ]
}
}
}
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
build/*.js
build/config/*.js
src/libraries/packages/npms/
\ No newline at end of file
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
},
// required to lint *.vue files
plugins: [
'html'
],
// add your custom rules here
'rules': {
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
}
}
.DS_Store
node_modules/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
test/unit/coverage
test/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
// to edit target browsers: use "browserlist" field in package.json
"autoprefixer": {}
}
}
## 20210902
1.新增`党(团)派加入时间`字段 2.移除`职级`字段 3.`奖惩关系`修改为`奖惩信息`
## 20211026
1.调整授权提示
{
"name": "简历",
"identifier": "com.cnd.hr.resume",
"build": 3566,
"version": "3.5.66",
"releaseNote": "绩效弹窗更新"
}
# new-template
> 美信云轻量级 VueJS 移动开发框架
## Build Setup
```bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run e2e tests
npm run e2e
# run all tests
npm test
```
开发环境在 test.js 文件修改账号
注意:打正式包和测试包,需要修改 prod.js 的内容:
baseUrl: 'https://jffcvp.cndrealty.com:4433/',
appkey: '781d2ec4' // 正式
baseUrl: 'https://mxytest.cndrealty.com:4433/', //测试
appkey: 'd504275e' // 测试
require('./check-versions')()
process.env.NODE_ENV = 'production'
var ora = require('ora')
var rm = require('rimraf')
var path = require('path')
var chalk = require('chalk')
var webpack = require('webpack')
var config = require('./config')
var webpackConfig = require('./webpack.prod.conf')
var spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n')
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
var chalk = require('chalk')
var semver = require('semver')
var packageConfig = require('../package.json')
var shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
var versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
},
]
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}
module.exports = function () {
var warnings = []
for (var i = 0; i < versionRequirements.length; i++) {
var mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (var i = 0; i < warnings.length; i++) {
var warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '',
productionSourceMap: false,
appConfFile: 'CubeModule.json',
eslint: true,
autoRoutes: true,
autoImportStyle: true,
optimizeCss: true,
i18n: true,
friendlyErrorsPlugin: false,
packToZip: true,
vux: true,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
},
dev: {
env: require('./dev.env'),
port: 8080,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '',
proxyTable: {},
appConfFile: 'CubeModule.json',
eslint: true,
autoRoutes: true,
autoImportStyle: true,
optimizeCss: true,
i18n: true,
friendlyErrorsPlugin: true,
vux: true,
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
}
}
module.exports = {
NODE_ENV: '"production"'
}
var merge = require('webpack-merge')
var devEnv = require('./dev.env')
module.exports = merge(devEnv, {
NODE_ENV: '"testing"'
})
/* eslint-disable */
require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
}
})
require('./check-versions')()
var config = require('./config')
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
}
var opn = require('opn')
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = (process.env.NODE_ENV === 'testing' || process.env.NODE_ENV === 'production')
? require('./webpack.prod.conf')
: require('./webpack.dev.conf')
// default port where dev server listens for incoming traffic
var port = process.env.PORT || config.dev.port
var os = require('os')
var platform = os.platform()
var childProcess = require('child_process')
console.log(platform)
if (platform !== 'win32') {
// 杀掉占用端口的进程
childProcess.exec('kill -9 `lsof -t -i:' + port + ' >/dev/null 2>&1`',function (error, stdout, stderr) {
console.log('killing the occupied port: ' + port)
if (error !== null) {
// console.error('exec error: ' + error)
}
})
}
// automatically open browser, if not set will be false
var autoOpenBrowser = !!config.dev.autoOpenBrowser
// Define HTTP proxies to your custom API backend
// https://github.com/chimurai/http-proxy-middleware
var proxyTable = config.dev.proxyTable
var app = express()
var compiler = webpack(webpackConfig)
var devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath,
quiet: true
})
var hotMiddleware = require('webpack-hot-middleware')(compiler, {
log: () => {}
})
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
})
// proxy api requests
Object.keys(proxyTable).forEach(function (context) {
var options = proxyTable[context]
if (typeof options === 'string') {
options = { target: options }
}
app.use(proxyMiddleware(options.filter || context, options))
})
// handle fallback for HTML5 history API
app.use(require('connect-history-api-fallback')())
// serve webpack bundle output
app.use(devMiddleware)
// enable hot-reload and state-preserving
// compilation error display
app.use(hotMiddleware)
// serve pure static assets
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
app.use(staticPath, express.static('./static'))
var uri = 'http://localhost:' + port
var _resolve
var readyPromise = new Promise(resolve => {
_resolve = resolve
})
console.log('> Starting dev server...')
devMiddleware.waitUntilValid(() => {
console.log('> Listening at ' + uri + '\n')
// when env is testing, don't need open it
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
opn(uri)
}
_resolve()
})
var server = app.listen(port)
module.exports = {
ready: readyPromise,
close: () => {
server.close()
}
}
var path = require('path')
var config = require('./config')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var env = process.env.NODE_ENV
var isAutoImportStyle = env === 'development' ? config.dev.autoImportStyle : config.build.autoImportStyle
var LessInjectorLoader = path.resolve(__dirname, '../src/libraries/packages/loaders/less-injector-loader/index.js')
exports.assetsPath = function (_path) {
var assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
var cssLoader = {
loader: 'css-loader',
options: {
minimize: process.env.NODE_ENV === 'production',
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
var loaders = [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
function generateAutoImportStyleLessLoaders () {
return 'vue-style-loader!css-loader!less-loader!' + LessInjectorLoader + '?baseDir=shared&libDir=libraries&srcDir=src'
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
postcss: generateLoaders(),
less: isAutoImportStyle ? generateAutoImportStyleLessLoaders() : generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
var output = []
var loaders = exports.cssLoaders(options)
for (var extension in loaders) {
var loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
var utils = require('./utils')
var config = require('./config')
var isProduction = process.env.NODE_ENV === 'production'
module.exports = {
loaders: utils.cssLoaders({
sourceMap: isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap,
extract: isProduction
})
}
var path = require('path')
var utils = require('./utils')
var config = require('./config')
var merge = require('webpack-merge')
var env = process.env.NODE_ENV
var isEslint = env === 'development' ? config.dev.eslint : config.build.eslint
var isFriendlyErrorsPlugin = env === 'development' ? config.dev.friendlyErrorsPlugin : config.build.friendlyErrorsPlugin
var OptimizeCssAssetsWebpackPlugin = require('optimize-css-assets-webpack-plugin')
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
function resolve(dir) {
return path.join(__dirname, '..', dir)
}
function generateCSSLoader() {
if (process.env.NODE_ENV === 'production') {
return ExtractTextPlugin.extract({
use: 'css-loader',
fallback: 'style-loader'
})
} else {
return ['style-loader', 'css-loader']
}
}
var rules = utils.styleLoaders({
sourceMap: config.dev.cssSourceMap
})
rules = rules.concat([
{
test: /\.(png|jpe?g|gif)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 1000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
])
var baseWebpackConfig = {
entry: {
app: './src/js/index.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.json'],
alias: {
'@': resolve('src'),
'configuration': resolve(process.env.NODE_ENV === 'production'
? './src/config/prod'
: './src/config/test')
}
},
module: {
rules: rules.concat([
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src')],
exclude: /(node_modules)/
},
// {
// test: /\.less$/,
// use: [
// 'style-loader',
// { loader: 'css-loader', options: { importLoaders: 1 } },
// 'less-loader'
// ]
// }
{
test: /\.css$/,
use: generateCSSLoader()
},
{
test: /\.svg/,
use: {
loader: 'svg-url-loader'
}
}
])
}
}
// 集成eslint
if (isEslint) {
baseWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: [{
test: /\.(js)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src')],
options: {
formatter: require('eslint-friendly-formatter')
}
}]
}
})
}
// 集成友好错误提示插件
if (isFriendlyErrorsPlugin) {
baseWebpackConfig = merge(baseWebpackConfig, {
plugins: [
new FriendlyErrorsPlugin()
]
})
}
module.exports = baseWebpackConfig
var webpack = require('webpack')
var config = require('./config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var CopyWebpackPlugin = require('copy-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
// cheap-module-eval-source-map is faster for development
devtool: '#cheap-module-eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
})
]
})
var path = require('path')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('./config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var ZipPlugin = require('zip-webpack-plugin')
var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
var env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: config.build.env
var rules = utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
var webpackConfig = merge(baseWebpackConfig, {
module: {
rules: rules
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
}
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
},
{
from: path.resolve(path.join(__dirname, '../', config.build.appConfFile)),
to: path.resolve(path.join(config.build.assetsRoot, config.build.appConfFile)),
toType: 'file',
force: true,
flatten: true
}
])
]
})
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.packToZip){
webpackConfig.plugins.push(
new ZipPlugin({
path: config.build.assetsRoot,
filename: 'package.zip'
})
)
}
if (config.build.bundleAnalyzerReport) {
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
// This is the webpack config used for unit tests.
var utils = require('./utils')
var webpack = require('webpack')
var merge = require('webpack-merge')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var baseConfig = require('./webpack.base.conf')
var webpackConfig = merge(baseConfig, {
// use inline sourcemap for karma-sourcemap-loader
module: {
rules: utils.styleLoaders()
},
devtool: '#inline-source-map',
resolveLoader: {
alias: {
// necessary to to make lang="scss" work in test when using vue-loader's ?inject option
// see discussion at https://github.com/vuejs/vue-loader/issues/724
'scss-loader': 'sass-loader'
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('./config/test.env')
}),
new CopyWebpackPlugin([
{
from: './src/libraies/components/Pictrue/6.jpg',
to: 'images/6.jpg'
}
])
]
})
// no need for app entry during tests
delete webpackConfig.entry
module.exports = webpackConfig
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>简历</title>
</head>
<body>
<div class="header">
</div>
<a class="header__button" id="back"></a>
<div class="container">
<div class="banner">
<a class="banner__img loading" id="mainPhoto">
<img>
</a>
<div id="name">正在加载</div>
</div>
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--save">保存</button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
</div>
<div class="toast" id="toast">
<div class="toast-content"></div>
</div>
<!-- 自定义弹窗 -->
<div class="my__modal">
<div class="modal__content">
<!-- 头部 -->
<div class="modal__header">
</div>
<!-- 内容 -->
<div class="modal__body">
</div>
<!-- 尾部 -->
<div class="model__footer">
<div class="model__line"></div>
<span class="modal__close">&times;</span>
</div>
</div>
</div>
<div class="tips__modal">
<div class="tips__content">
<!-- 头部 -->
<div class="tips__header">
提示
</div>
<!-- 内容 -->
<div class="tips__body">
<div><span style="font-weight: 500;">年度绩效结果分为:</span>优秀、良好、合格、待改进</div>
<div><span style="font-weight: 500;">月度绩效结果分为:</span>A、B+、B、B-、C</div>
<div class="tips__title">1、出现如下情形之一,评价等级为A:</div>
<div>(1)工作成效显著,且时间较大幅度提前。</div>
<div>(2)员工独立思考,有创新方法,工作成效超出预期。</div>
<div class="tips__title">2.评价等级为B(±):</div>
<div> 评价B+:和过往比有较大进步或在工作难度/强度较大的情况下仍保质保量完成工作。</div>
<div> 评价B:按时保质完成工作。</div>
<div> 评价B-:工作出现偏差,无法按时保质完成。</div>
<div class="tips__title">3.出现如下情形之一,评价等级为C:</div>
<div>(1)工作出现重大失误,被公司通报批评。</div>
<div>(2)工作完成时间较计划存在较大幅度延后。</div>
<div>(3)工作成效差或远低于预期。</div>
</div>
<!-- 尾部 -->
<div class="tips__footer">
<div class="tips__line"></div>
<span class="tips__close">&times;</span>
</div>
</div>
</div>
</div>
<script defer src="cordova.js"></script>
</body>
</html>
This diff could not be displayed because it is too large.
{
"name": "h5-dev-resume",
"version": "1.0.1",
"description": "建发简历",
"author": "liyj31 <yujun2.li@meicloud.com>",
"private": true,
"scripts": {
"dev": "cross-env PACK_ENV=dev node build/dev-server.js",
"start": "npm run dev",
"build": "node build/build.js",
"build:prod": "cross-env PACK_ENV=product node build/build.js",
"build:report": "npm run build --report"
},
"dependencies": {
"axios": "^0.16.1",
"fastclick": "^1.0.6",
"iscroll": "^5.2.0",
"vconsole": "^3.9.4"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^7.1.1",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^1.1.3",
"cross-env": "^4.0.0",
"eslint": "^3.19.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-html": "^3.0.0",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"mocha": "^3.2.0",
"chai": "^3.5.0",
"sinon": "^2.1.0",
"sinon-chai": "^2.8.0",
"inject-loader": "^3.0.0",
"babel-plugin-istanbul": "^4.1.1",
"phantomjs-prebuilt": "^2.1.14",
"chromedriver": "^2.27.2",
"cross-spawn": "^5.0.1",
"nightwatch": "^0.9.12",
"selenium-server": "^3.0.1",
"less": "^2.7.2",
"opn": "^4.0.2",
"ora": "^1.2.0",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"style-loader": "^0.17.0",
"touch": "^1.0.0",
"url-loader": "^0.5.8",
"yaml-loader": "^0.4.0",
"css-loader": "^0.28.0",
"file-loader": "^0.11.1",
"json-loader": "^0.5.4",
"less-loader": "^4.0.4",
"loader-utils": "^1.1.0",
"webpack": "^2.3.3",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.18.0",
"webpack-merge": "^4.1.0",
"zip-webpack-plugin": "^1.1.0",
"html-webpack-plugin": "^2.28.0",
"compression-webpack-plugin": "^0.4.0",
"copy-webpack-plugin": "^4.0.1",
"extract-text-webpack-plugin": "^2.0.0",
"friendly-errors-webpack-plugin": "^1.1.3",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"connect-history-api-fallback": "^1.3.0",
"http-proxy-middleware": "^0.17.3",
"svg-url-loader": "^2.2.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
/*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */
/*
Contents:
1. Buttons
2. Share modal and links
3. Index indicator ("1 of X" counter)
4. Caption
5. Loading indicator
6. Additional styles (root element, top bar, idle state, hidden state, etc.)
*/
/*
1. Buttons
*/
/* <button> css reset */
.pswp__button {
width: 44px;
height: 44px;
position: relative;
background: none;
cursor: pointer;
overflow: visible;
-webkit-appearance: none;
display: block;
border: 0;
padding: 0;
margin: 0;
float: right;
opacity: 0.75;
-webkit-transition: opacity 0.2s;
transition: opacity 0.2s;
-webkit-box-shadow: none;
box-shadow: none; }
.pswp__button:focus, .pswp__button:hover {
opacity: 1; }
.pswp__button:active {
outline: none;
opacity: 0.9; }
.pswp__button::-moz-focus-inner {
padding: 0;
border: 0; }
/* pswp__ui--over-close class it added when mouse is over element that should close gallery */
.pswp__ui--over-close .pswp__button--close {
opacity: 1; }
.pswp__button,
.pswp__button--arrow--left:before,
.pswp__button--arrow--right:before {
background: url(default-skin.png) 0 0 no-repeat;
background-size: 264px 88px;
width: 44px;
height: 44px; }
@media (-webkit-min-device-pixel-ratio: 1.1), (-webkit-min-device-pixel-ratio: 1.09375), (min-resolution: 105dpi), (min-resolution: 1.1dppx) {
/* Serve SVG sprite if browser supports SVG and resolution is more than 105dpi */
.pswp--svg .pswp__button,
.pswp--svg .pswp__button--arrow--left:before,
.pswp--svg .pswp__button--arrow--right:before {
background-image: url(default-skin.svg); }
.pswp--svg .pswp__button--arrow--left,
.pswp--svg .pswp__button--arrow--right {
background: none; } }
.pswp__button--close {
background-position: 0 -44px; }
.pswp__button--share {
background-position: -44px -44px; }
.pswp__button--fs {
display: none; }
.pswp--supports-fs .pswp__button--fs {
display: block; }
.pswp--fs .pswp__button--fs {
background-position: -44px 0; }
.pswp__button--zoom {
display: none;
background-position: -88px 0; }
.pswp--zoom-allowed .pswp__button--zoom {
display: block; }
.pswp--zoomed-in .pswp__button--zoom {
background-position: -132px 0; }
/* no arrows on touch screens */
.pswp--touch .pswp__button--arrow--left,
.pswp--touch .pswp__button--arrow--right {
visibility: hidden; }
/*
Arrow buttons hit area
(icon is added to :before pseudo-element)
*/
.pswp__button--arrow--left,
.pswp__button--arrow--right {
background: none;
top: 50%;
margin-top: -50px;
width: 70px;
height: 100px;
position: absolute; }
.pswp__button--arrow--left {
left: 0; }
.pswp__button--arrow--right {
right: 0; }
.pswp__button--arrow--left:before,
.pswp__button--arrow--right:before {
content: '';
top: 35px;
background-color: rgba(0, 0, 0, 0.3);
height: 30px;
width: 32px;
position: absolute; }
.pswp__button--arrow--left:before {
left: 6px;
background-position: -138px -44px; }
.pswp__button--arrow--right:before {
right: 6px;
background-position: -94px -44px; }
/*
2. Share modal/popup and links
*/
.pswp__counter,
.pswp__share-modal {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.pswp__share-modal {
display: block;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
top: 0;
left: 0;
padding: 10px;
position: absolute;
z-index: 1600;
opacity: 0;
-webkit-transition: opacity 0.25s ease-out;
transition: opacity 0.25s ease-out;
-webkit-backface-visibility: hidden;
will-change: opacity; }
.pswp__share-modal--hidden {
display: none; }
.pswp__share-tooltip {
z-index: 1620;
position: absolute;
background: #FFF;
top: 56px;
border-radius: 2px;
display: block;
width: auto;
right: 44px;
-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
-webkit-transform: translateY(6px);
-ms-transform: translateY(6px);
transform: translateY(6px);
-webkit-transition: -webkit-transform 0.25s;
transition: transform 0.25s;
-webkit-backface-visibility: hidden;
will-change: transform; }
.pswp__share-tooltip a {
display: block;
padding: 8px 12px;
color: #000;
text-decoration: none;
font-size: 14px;
line-height: 18px; }
.pswp__share-tooltip a:hover {
text-decoration: none;
color: #000; }
.pswp__share-tooltip a:first-child {
/* round corners on the first/last list item */
border-radius: 2px 2px 0 0; }
.pswp__share-tooltip a:last-child {
border-radius: 0 0 2px 2px; }
.pswp__share-modal--fade-in {
opacity: 1; }
.pswp__share-modal--fade-in .pswp__share-tooltip {
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0); }
/* increase size of share links on touch devices */
.pswp--touch .pswp__share-tooltip a {
padding: 16px 12px; }
a.pswp__share--facebook:before {
content: '';
display: block;
width: 0;
height: 0;
position: absolute;
top: -12px;
right: 15px;
border: 6px solid transparent;
border-bottom-color: #FFF;
-webkit-pointer-events: none;
-moz-pointer-events: none;
pointer-events: none; }
a.pswp__share--facebook:hover {
background: #3E5C9A;
color: #FFF; }
a.pswp__share--facebook:hover:before {
border-bottom-color: #3E5C9A; }
a.pswp__share--twitter:hover {
background: #55ACEE;
color: #FFF; }
a.pswp__share--pinterest:hover {
background: #CCC;
color: #CE272D; }
a.pswp__share--download:hover {
background: #DDD; }
/*
3. Index indicator ("1 of X" counter)
*/
.pswp__counter {
position: absolute;
left: 0;
top: 0;
height: 44px;
font-size: 13px;
line-height: 44px;
color: #FFF;
opacity: 0.75;
padding: 0 10px; }
/*
4. Caption
*/
.pswp__caption {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
min-height: 44px; }
.pswp__caption small {
font-size: 11px;
color: #BBB; }
.pswp__caption__center {
text-align: left;
max-width: 420px;
margin: 0 auto;
font-size: 13px;
padding: 10px;
line-height: 20px;
color: #CCC; }
.pswp__caption--empty {
display: none; }
/* Fake caption element, used to calculate height of next/prev image */
.pswp__caption--fake {
visibility: hidden; }
/*
5. Loading indicator (preloader)
You can play with it here - http://codepen.io/dimsemenov/pen/yyBWoR
*/
.pswp__preloader {
width: 44px;
height: 44px;
position: absolute;
top: 0;
left: 50%;
margin-left: -22px;
opacity: 0;
-webkit-transition: opacity 0.25s ease-out;
transition: opacity 0.25s ease-out;
will-change: opacity;
direction: ltr; }
.pswp__preloader__icn {
width: 20px;
height: 20px;
margin: 12px; }
.pswp__preloader--active {
opacity: 1; }
.pswp__preloader--active .pswp__preloader__icn {
/* We use .gif in browsers that don't support CSS animation */
background: url(preloader.gif) 0 0 no-repeat; }
.pswp--css_animation .pswp__preloader--active {
opacity: 1; }
.pswp--css_animation .pswp__preloader--active .pswp__preloader__icn {
-webkit-animation: clockwise 500ms linear infinite;
animation: clockwise 500ms linear infinite; }
.pswp--css_animation .pswp__preloader--active .pswp__preloader__donut {
-webkit-animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite;
animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite; }
.pswp--css_animation .pswp__preloader__icn {
background: none;
opacity: 0.75;
width: 14px;
height: 14px;
position: absolute;
left: 15px;
top: 15px;
margin: 0; }
.pswp--css_animation .pswp__preloader__cut {
/*
The idea of animating inner circle is based on Polymer ("material") loading indicator
by Keanu Lee https://blog.keanulee.com/2014/10/20/the-tale-of-three-spinners.html
*/
position: relative;
width: 7px;
height: 14px;
overflow: hidden; }
.pswp--css_animation .pswp__preloader__donut {
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 14px;
height: 14px;
border: 2px solid #FFF;
border-radius: 50%;
border-left-color: transparent;
border-bottom-color: transparent;
position: absolute;
top: 0;
left: 0;
background: none;
margin: 0; }
@media screen and (max-width: 1024px) {
.pswp__preloader {
position: relative;
left: auto;
top: auto;
margin: 0;
float: right; } }
@-webkit-keyframes clockwise {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg); }
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg); } }
@keyframes clockwise {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg); }
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg); } }
@-webkit-keyframes donut-rotate {
0% {
-webkit-transform: rotate(0);
transform: rotate(0); }
50% {
-webkit-transform: rotate(-140deg);
transform: rotate(-140deg); }
100% {
-webkit-transform: rotate(0);
transform: rotate(0); } }
@keyframes donut-rotate {
0% {
-webkit-transform: rotate(0);
transform: rotate(0); }
50% {
-webkit-transform: rotate(-140deg);
transform: rotate(-140deg); }
100% {
-webkit-transform: rotate(0);
transform: rotate(0); } }
/*
6. Additional styles
*/
/* root element of UI */
.pswp__ui {
-webkit-font-smoothing: auto;
visibility: visible;
opacity: 1;
z-index: 1550; }
/* top black bar with buttons and "1 of X" indicator */
.pswp__top-bar {
position: absolute;
left: 0;
top: 0;
height: 44px;
width: 100%; }
.pswp__caption,
.pswp__top-bar,
.pswp--has_mouse .pswp__button--arrow--left,
.pswp--has_mouse .pswp__button--arrow--right {
-webkit-backface-visibility: hidden;
will-change: opacity;
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
/* pswp--has_mouse class is added only when two subsequent mousemove events occur */
.pswp--has_mouse .pswp__button--arrow--left,
.pswp--has_mouse .pswp__button--arrow--right {
visibility: visible; }
.pswp__top-bar,
.pswp__caption {
background-color: rgba(0, 0, 0, 0.5); }
/* pswp__ui--fit class is added when main image "fits" between top bar and bottom bar (caption) */
.pswp__ui--fit .pswp__top-bar,
.pswp__ui--fit .pswp__caption {
background-color: rgba(0, 0, 0, 0.3); }
/* pswp__ui--idle class is added when mouse isn't moving for several seconds (JS option timeToIdle) */
.pswp__ui--idle .pswp__top-bar {
opacity: 0; }
.pswp__ui--idle .pswp__button--arrow--left,
.pswp__ui--idle .pswp__button--arrow--right {
opacity: 0; }
/*
pswp__ui--hidden class is added when controls are hidden
e.g. when user taps to toggle visibility of controls
*/
.pswp__ui--hidden .pswp__top-bar,
.pswp__ui--hidden .pswp__caption,
.pswp__ui--hidden .pswp__button--arrow--left,
.pswp__ui--hidden .pswp__button--arrow--right {
/* Force paint & create composition layer for controls. */
opacity: 0.001; }
/* pswp__ui--one-slide class is added when there is just one item in gallery */
.pswp__ui--one-slide .pswp__button--arrow--left,
.pswp__ui--one-slide .pswp__button--arrow--right,
.pswp__ui--one-slide .pswp__counter {
display: none; }
.pswp__element--disabled {
display: none !important; }
.pswp--minimal--dark .pswp__top-bar {
background: none; }
<svg width="264" height="88" viewBox="0 0 264 88" xmlns="http://www.w3.org/2000/svg"><title>default-skin 2</title><g fill="none" fill-rule="evenodd"><g><path d="M67.002 59.5v3.768c-6.307.84-9.184 5.75-10.002 9.732 2.22-2.83 5.564-5.098 10.002-5.098V71.5L73 65.585 67.002 59.5z" id="Shape" fill="#fff"/><g fill="#fff"><path d="M13 29v-5h2v3h3v2h-5zM13 15h5v2h-3v3h-2v-5zM31 15v5h-2v-3h-3v-2h5zM31 29h-5v-2h3v-3h2v5z" id="Shape"/></g><g fill="#fff"><path d="M62 24v5h-2v-3h-3v-2h5zM62 20h-5v-2h3v-3h2v5zM70 20v-5h2v3h3v2h-5zM70 24h5v2h-3v3h-2v-5z"/></g><path d="M20.586 66l-5.656-5.656 1.414-1.414L22 64.586l5.656-5.656 1.414 1.414L23.414 66l5.656 5.656-1.414 1.414L22 67.414l-5.656 5.656-1.414-1.414L20.586 66z" fill="#fff"/><path d="M111.785 65.03L110 63.5l3-3.5h-10v-2h10l-3-3.5 1.785-1.468L117 59l-5.215 6.03z" fill="#fff"/><path d="M152.215 65.03L154 63.5l-3-3.5h10v-2h-10l3-3.5-1.785-1.468L147 59l5.215 6.03z" fill="#fff"/><g><path id="Rectangle-11" fill="#fff" d="M160.957 28.543l-3.25-3.25-1.413 1.414 3.25 3.25z"/><path d="M152.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" id="Oval-1" stroke="#fff" stroke-width="1.5"/><path fill="#fff" d="M150 21h5v1h-5z"/></g><g><path d="M116.957 28.543l-1.414 1.414-3.25-3.25 1.414-1.414 3.25 3.25z" fill="#fff"/><path d="M108.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" stroke="#fff" stroke-width="1.5"/><path fill="#fff" d="M106 21h5v1h-5z"/><path fill="#fff" d="M109.043 19.008l-.085 5-1-.017.085-5z"/></g></g></g></svg>
\ No newline at end of file
/*! PhotoSwipe main CSS by Dmitry Semenov | photoswipe.com | MIT license */
/*
Styles for basic PhotoSwipe functionality (sliding area, open/close transitions)
*/
/* pswp = photoswipe */
.pswp {
display: none;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
overflow: hidden;
-ms-touch-action: none;
touch-action: none;
z-index: 1500;
-webkit-text-size-adjust: 100%;
/* create separate layer, to avoid paint on window.onscroll in webkit/blink */
-webkit-backface-visibility: hidden;
outline: none; }
.pswp * {
-webkit-box-sizing: border-box;
box-sizing: border-box; }
.pswp img {
max-width: none; }
/* style is added when JS option showHideOpacity is set to true */
.pswp--animate_opacity {
/* 0.001, because opacity:0 doesn't trigger Paint action, which causes lag at start of transition */
opacity: 0.001;
will-change: opacity;
/* for open/close transition */
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp--open {
display: block; }
.pswp--zoom-allowed .pswp__img {
/* autoprefixer: off */
cursor: -webkit-zoom-in;
cursor: -moz-zoom-in;
cursor: zoom-in; }
.pswp--zoomed-in .pswp__img {
/* autoprefixer: off */
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab; }
.pswp--dragging .pswp__img {
/* autoprefixer: off */
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing; }
/*
Background is added as a separate element.
As animating opacity is much faster than animating rgba() background-color.
*/
.pswp__bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: #000;
opacity: 0;
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-backface-visibility: hidden;
will-change: opacity; }
.pswp__scroll-wrap {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden; }
.pswp__container,
.pswp__zoom-wrap {
-ms-touch-action: none;
touch-action: none;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0; }
/* Prevent selection and tap highlights */
.pswp__container,
.pswp__img {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none; }
.pswp__zoom-wrap {
position: absolute;
width: 100%;
-webkit-transform-origin: left top;
-ms-transform-origin: left top;
transform-origin: left top;
/* for open/close transition */
-webkit-transition: -webkit-transform 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp__bg {
will-change: opacity;
/* for open/close transition */
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp--animated-in .pswp__bg,
.pswp--animated-in .pswp__zoom-wrap {
-webkit-transition: none;
transition: none; }
.pswp__container,
.pswp__zoom-wrap {
-webkit-backface-visibility: hidden; }
.pswp__item {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden; }
.pswp__img {
position: absolute;
width: auto;
height: auto;
top: 0;
left: 0; }
/*
stretched thumbnail or div placeholder element (see below)
style is added to avoid flickering in webkit/blink when layers overlap
*/
.pswp__img--placeholder {
-webkit-backface-visibility: hidden; }
/*
div element that matches size of large image
large image loads on top of it
*/
.pswp__img--placeholder--blank {
background: #222; }
.pswp--ie .pswp__img {
width: 100% !important;
height: auto !important;
left: 0;
top: 0; }
/*
Error message appears when image is not loaded
(JS option errorMsg controls markup)
*/
.pswp__error-msg {
position: absolute;
left: 0;
top: 50%;
width: 100%;
text-align: center;
font-size: 14px;
line-height: 16px;
margin-top: -8px;
color: #CCC; }
.pswp__error-msg a {
color: #CCC;
text-decoration: underline; }
@import './photoswipe.css';
@import './default-skin/default-skin.css';
html,
body {
box-sizing: border-box;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
font-family: "Microsoft YaHei";
background-color: #f4f4f4;
}
div,
a,
span {
box-sizing: border-box;
}
.btd,
.bbd,
.brd,
.bld {
position: relative;
}
.deep {
color: #000000;
}
.light .item__content-title {
color: #9B9B9B;
}
.btd:before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
border-top: 1px solid #D9D9D9;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
.bbd:after {
content: " ";
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 1px;
border-bottom: 1px solid #D9D9D9;
color: #D9D9D9;
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
.brd:before {
content: " ";
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 1px;
border-right: 1px solid #D9D9D9;
color: #D9D9D9;
-webkit-transform-origin: 100% 0;
transform-origin: 100% 0;
-webkit-transform: scaleX(0.5);
transform: scaleX(0.5);
}
.bld:before {
content: " ";
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 1px;
border-left: 1px solid #D9D9D9;
color: #D9D9D9;
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
-webkit-transform: scaleX(0.5);
transform: scaleX(0.5);
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
height: 44px;
padding: 8px;
line-height: 33px;
color: #fff;
font-size: 18px;
text-align: center;
background-color: rgb(200, 22, 30);
overflow: visible;
vertical-align: middle;
visibility: hidden;
}
.header.show {
visibility: visible;
}
.header__button {
display: block;
position: absolute;
z-index: 999;
top: 0;
left: 0;
width: 44px;
height: 44px;
background: url(../images/back.png) no-repeat center;
background-size: 20px;
}
.activated {
opacity: .4;
}
.container {
width: 100%;
height: 100%;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow-x: hidden;
overflow-y: hidden;
}
.container__scrolling {
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.banner {
height: 174px;
padding-top: 30px;
font-size: 18px;
color: #fff;
text-align: center;
background-color: rgb(200, 22, 30);
}
.banner__img {
display: block;
position: relative;
z-index: 99;
width: 90px;
height: 90px;
margin: 0 auto 11px;
border-radius: 50%;
overflow: hidden;
transform: translateZ(0);
-webkit-transform: translateZ(0);
transform-origin: bottom;
-webkit-transform-origin: bottom;
}
.banner__img.loading {
background: url('../images/default-profile.png') no-repeat center;
background-size: cover;
}
.banner__img img {
width: 100%;
transform: translateZ(0);
-webkit-transform: translateZ(0);
}
.item__header {
height: 40px;
line-height: 40px;
vertical-align: middle;
font-size: 14px;
color: #000000;
background: #fff;
}
.item_header span {
vertical-align: middle;
}
.item_header-img {
display: inline-block;
width: 20px;
height: 20px;
line-height: 20px;
margin-right: 5px;
margin-left: 10px;
margin-top: -3px;
background-size: 20px;
vertical-align: middle
}
.item_header-img-base {
background: url('../images/base.svg') no-repeat;
}
.item_header-img-job {
background: url('../images/job.svg') no-repeat;
}
.item_header-img-jobhistory {
background: url('../images/jobhistory.svg') no-repeat;
}
.item_header-img-base {
background: url('../images/base.svg') no-repeat;
}
.item_header-img-assess {
background: url('../images/assess.svg') no-repeat;
}
.item_header-img-work {
background: url('../images/work.svg') no-repeat;
}
.item_header-img-edu {
background: url('../images/edu.svg') no-repeat;
}
.item_header-img-family {
background: url('../images/family.svg') no-repeat;
}
.item_header-img-reward {
background: url('../images/reward.svg') no-repeat;
}
.item__wrap+.item__header,
.item__content+.item__header {
margin-top: 10px;
}
.item_main {
background: #fff
}
.item__content {
display: -webkit-flex;
display: -webkit-box;
display: flex;
width: 100%;
background: #fff;
/* transition: all .2s;
-webkit-transition: all .2s; */
}
.item__content.work {
display: block;
padding-left: 35px;
padding-top: 11px;
}
.item__content.empty {
display: block;
height: 50px;
line-height: 50px;
text-align: center;
color: #9B9B9B;
font-weight: 400;
}
.item__content.hide {
pointer-events: none;
/* transform: translate3d(0, -100%, 0);
-webkit-transform: translate3d(0, -100%, 0); */
}
.item_main.hide {
opacity: 0;
height: 0;
pointer-events: none;
}
.item__content-title {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
margin-left: 35px;
padding: 8px 0;
line-height: 30px;
font-size: 16px;
color: #000000;
white-space: normal;
}
.item__content-sub-title {
margin: 3px 0;
font-size: 14px;
color: #9B9B9B;
line-height: 16px;
padding-right: 5px;
padding-bottom: 8px;
}
.company .item__content .item__content-value .item__content-note {
line-height: 16px;
display: inline
}
.item__content-value {
/* max-width: 60%; */
padding: 8px 16px;
line-height: 30px;
text-align: right;
font-size: 16px;
color: #000000;
white-space: nowrap;
}
.item__content.long-title .item__content-title {
max-width: 36%;
}
.item__content.long-title .item__content-value {
max-width: 55%;
}
.edu .item__content-title {
line-height: 36px
}
.edu .item__content-value {
display: none
}
.item__content.long-title.edu .item__content-title {
max-width: 100%;
}
.item__content-title.assyear {
padding-top: 2px;
}
.item__content-note {
right: 16px;
font-size: 14px;
color: #9B9B9B;
margin: 3px 0;
line-height: 16px
}
.wrap_content {
overflow: hidden;
transition: height 1s;
-webkit-transition: height 1s;
}
.wrap_content_shrink {
overflow: hidden;
transition: height 1s;
-webkit-transition: height 1s;
}
.expand .wrap_content .wrap_content_shrink {
height: auto
}
.item__wrap-control-icon {
display: block;
width: 50px;
height: 50px;
margin: auto;
background: url('../images/resume_more.png') no-repeat center;
background-size: 18px;
transition: transform .2s;
-webkit-transition: -webkit-transform .2s;
}
.item__wrap.expand .item__wrap-control-icon {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
}
.item__wrap.expand .item__content.hide {
opacity: 1;
height: auto;
transform: translate3d(0, 0, 0) !important;
-webkit-transform: translate3d(0, 0, 0) !important;
}
.item__wrap.expand .item_main.hide {
opacity: 1;
height: auto;
transform: translate3d(0, 0, 0) !important;
-webkit-transform: translate3d(0, 0, 0) !important;
}
.toast {
display: block;
position: fixed;
z-index: 1999;
top: 70%;
left: 0;
right: 0;
text-align: center;
pointer-events: none;
opacity: 0;
transition: opacity .3s;
-webkit-transition: opacity .3s;
}
.toast.toast_show {
opacity: 1;
}
.toast-content {
display: inline-block;
width: auto;
height: auto;
padding: 8px 16px;
color: #fff;
font-size: 13px;
background: rgba(0, 0, 0, .6);
border-radius: 4px;
}
.pswp__button--save {
color: #fff;
background-image: none !important;
}
.item__content.edu.hide {
height: 0px
}
.depart .item__content .item__content-title {
line-height: 16px;
}
.depart .item__content .item__content-value {
line-height: 16px;
padding: 11px 16px
}
.depart .item__content .item__content-value .item__content-note {
display: inline
}
.company .item__content .item__content-value {
line-height: 16px;
padding: 11px 16px
}
.company .item__content .item__content-title {
line-height: 16px;
padding: 11px 0px;
}
.company .item__content .item__content-title .item__content-sub-title {
margin: 0px 0px
}
.flex-start {
display: flex;
align-items: center;
justify-content: flex-start;
}
.flex-between {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-row {
display: flex;
align-items: center;
}
.frist-row {
display: flex;
align-items: center;
height: 50px;
background: #F2F2F2;
margin: 0 15px;
}
.title-text {
display: flex;
align-items: center;
}
.dot-icon {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: bold;
color: #333333;
margin-right: 5px;
}
.second-box {
display: none;
background: #fff;
}
.box-block {
display: block;
background: #fff;
}
.box-none {
display: none;
background: #fff;
}
.second-row {
display: flex;
align-items: center;
height: 50px;
padding: 0 15px 0 36px;
background: #FFFFFF;
border-bottom: 1px solid #F6F6F6;
}
.icon_img {
width: 16px;
height: 16px;
margin-right: 5px;
}
.icon_01_img {
width: 18px;
height: 16px;
background: url('../images/icon_01.png') no-repeat center;
background-size: 16px;
margin-right: 5px;
}
.icon_02_img {
width: 18px;
height: 16px;
background: url('../images/icon_02.png') no-repeat center;
background-size: 16px;
margin-right: 5px;
}
.third-row {
display: flex;
align-items: center;
height: 50px;
padding: 0 15px 0 36px;
background: #FFFFFF;
}
.ygjx_bg_box {
background: #FFFFFF;
padding: 10px 14px 20px;
}
.hint_more {
background: linear-gradient(270deg, rgba(200, 22, 30, 0) 0%, rgba(200, 22, 30, 0.1) 51%, rgba(200, 22, 30, 0) 100%);
display: flex;
justify-content: center;
align-items: center;
height: 26px;
color: #C8161E;
font-size: 10px;
}
.hint_more div:first-child {
width: 12px;
height: 12px;
background: url('../images/icon_left.png') no-repeat center;
background-size: 12px;
margin-right: 5px;
}
.hint_more div:last-child {
width: 12px;
height: 12px;
background: url('../images/icon_right.png') no-repeat center;
background-size: 12px;
margin-left: 5px;
}
/* 员工绩效表 */
.ygjx_table_box {
margin: 10px 0 0;
width: 100%;
overflow: hidden;
border: 1px solid #EEEEEE;
}
.ygjx_table tr th,
.ygjx_table tr td {
border: 1px solid #EEEEEE;
padding: 9px 10px;
font-size: 14px;
color: #595757;
/* word-break: break-all;/*
word-wrap: break-word; */
}
.ygjx_table tr td a {
text-decoration: none;
display: inline-block;
width: 100%;
}
.ygjx_table tr td a:link,
.ygjx_table tr td a:hover,
.ygjx_table tr td a:active,
.ygjx_table tr td a:visited{
color: inherit;
}
.ygjx_table {
width: 100%;
min-height: 20px;
line-height: 20px;
/* text-align: center; */
border-collapse: collapse;
/* border: 1px solid #EEEEEE; */
}
.ygjx_table tr:first-child {
white-space: nowrap;
font-size: 16px;
font-weight: 700;
color: #000000;
background: #F8F8F8;
/* background: #FF6034; */
}
.ygjx_table tr td:first-child {
white-space: nowrap;
font-size: 16px;
font-weight: 700;
color: #000000;
background: #FFFFFF;
/* padding: 9x 15px 9px 5px; */
/* text-align: center; */
}
.ygjx_table tr td:first-child>div {
margin-left: 5px;
}
.ygjx_table__grade {
font-size: 12px;
white-space: nowrap;
/* word-wrap: break-word;
word-break: break-all; */
}
.cols {
border: 1px solid #EEEEEE;
}
/* 弹窗 start */
/* 弹窗 (background) */
.my__modal {
display: none;
/* 默认隐藏 */
position: fixed;
/* 固定定位 */
z-index: 999;
/* 设置在顶层 */
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgb(0, 0, 0);
background-color: rgba(0, 0, 0, 0.4);
}
/* 弹窗内容 */
.modal__content {
margin: 15% auto;
width: 90%;
}
/* 弹窗头部 */
.modal__header {
background-color: #FFFFFF;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
padding: 15px;
display: flex;
flex-direction: column;
}
/* 弹窗中部 */
.modal__body {
background-color: #FFFFFF;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
padding: 0 15px 15px;
}
/* 弹窗底部 */
.model__footer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.model__line {
border-left: 1px dashed #fff;
display: inline-block;
height: 30px;
width: 1px;
}
/* 关闭按钮 */
.modal__close {
display: inline-block;
text-align: center;
line-height: 25px;
color: #fff;
font-size: 23px;
font-weight: 100;
border: 1px solid #fff;
width: 30px;
height: 30px;
border-radius: 15px;
}
/* 弹窗 end */
/* 弹窗头部自定义样式 */
.modal__tab__box ul {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
justify-content: space-around;
font-size: 18px;
color: #666666;
font-weight: 400;
}
.modal__tab__box ul li {
display: inline-block;
padding: 8px 0;
}
.modal__tab__active {
color: #333333;
font-weight: 500;
border-bottom: 2px solid #C8161E;
}
/* 弹窗内容自定义样式 */
.modal__tab__view ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.modal__tab__view ul li {
border-left: 1px solid #EEEEEE;
border-top: 1px solid #EEEEEE;
border-right: 1px solid #EEEEEE;
}
.modal__tab__view ul li ul li {
border-left: 0;
border-right: 0;
border-top: 1px solid #EEEEEE;
display: flex;
justify-content: space-between;
align-items: center;
padding: 17px 14px 17px 34px;
font-size: 14px;
color: #333333;
}
.modal__tab__view>ul li:last-child {
border-bottom: 1px solid #EEEEEE;
}
.section__title {
background: #DDDDDD;
display: flex;
justify-content: space-between;
align-items: center;
padding: 18px 15px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
}
.section__title_left {
display: flex;
align-items: center;
}
.section__title_left div:last-child {
white-space: nowrap;
}
.section__title_right {
margin-left: 10px;
word-break: break-all;
text-align: right;
}
.modal__jx__view {
max-height: 400px;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
/* 弹窗-评优-标签页 */
.modal__py__view {
max-height: 400px;
overflow: auto;
-webkit-overflow-scrolling: touch;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
display: none;
}
.modal__py__view ul li ul li {
padding: 12px 12px;
color: #000000;
font-weight: 500;
display: block;
font-family: PingFangSC-Medium, PingFang SC;
line-height: 24px
}
.modal__py__view ul li ul li div:last-child {
font-weight: 400;
color: #595757;
}
/* 弹窗-奖励-标签页 */
.modal__jl__view {
max-height: 400px;
overflow: auto;
-webkit-overflow-scrolling: touch;
display: none;
}
/* .modal__jl__view>ul>li:first-child {
font-size: 16px;
font-weight: 500;
color: #000000;
} */
.modal__jl__view ul li ul li {
display: block;
padding: 0;
color: #595757;
font-size: 14px;
font-weight: 400;
line-height: 22px;
}
.modal__jl__view ul li ul li :first-child {
font-weight: 500;
color: #000000;
font-family: PingFangSC-Medium, PingFang SC;
}
/* 弹窗-处罚-标签页 */
.modal__cf__view {
max-height: 400px;
overflow: auto;
-webkit-overflow-scrolling: touch;
display: none;
}
.modal__cf__view>ul>li:first-child {
font-size: 16px;
font-weight: 500;
color: #000000;
font-family: PingFangSC-Medium, PingFang SC;
}
.modal__cf__view ul li ul li {
display: block;
padding: 0;
color: #595757;
font-size: 14px;
font-weight: 400;
line-height: 22px;
}
.modal__cf__view ul li ul li :first-child {
font-weight: 500;
color: #000000;
font-family: PingFangSC-Medium, PingFang SC;
}
.year__box {
display: none;
width: 145px;
height: 38px;
background: #C8161E;
border-radius: 20px;
text-align: center;
line-height: 38px;
position: relative;
font-weight: 500;
color: #FFFFFF;
font-size: 15px;
margin: 0 auto;
margin-top: 10px;
font-family: PingFangSC-Medium, PingFang SC;
}
.year__box:active {
background: #99161e;
}
.year__down {
width: 12px;
height: 12px;
background: url('../images/icon_down.png') no-repeat center;
background-size: 12px;
margin-right: 5px;
position: absolute;
right: 22px;
top: 12px;
}
.dropdown__content {
display: none;
z-index: 9999;
position: absolute;
background-color: #f9f9f9;
width: 145px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
color: #333333;
max-height: 300px;
overflow: auto;
font-weight: 400;
}
.dropdown__content div {
color: black;
padding: 1px 8px;
border-bottom: 1px solid #EEEEEE;
}
.dropdown__content div:active {
background-color: #EEEEEE;
}
.flower {
width: 12px;
height: 12px;
background: url('../images/icon_flower.png') no-repeat center;
background-size: 12px;
margin-left: 5px;
}
.js__box {
position: relative;
}
.icon__help {
width: 40px;
height: 40px;
background: url('../images/icon_help.png') no-repeat center;
background-size: 14px;
position: absolute;
top: -10px;
right: -16px;
}
/* tips弹窗 start */
/* 弹窗 (background) */
.tips__modal {
display: none;
/* 默认隐藏 */
position: fixed;
/* 固定定位 */
z-index: 999;
/* 设置在顶层 */
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgb(0, 0, 0);
background-color: rgba(0, 0, 0, 0.4);
}
/* 弹窗内容 */
.tips__content {
margin: 15% auto;
width: 90%;
}
/* 弹窗头部 */
.tips__header {
background-color: #FFFFFF;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
padding: 15px;
display: flex;
flex-direction: column;
text-align: center;
font-weight: 500;
font-family: PingFangSC-Medium, PingFang SC;
}
/* 弹窗中部 */
.tips__body {
background-color: #FFFFFF;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
padding: 0 15px 15px;
max-height: 400px;
font-size: 12px;
overflow: auto;
webkit-overflow-scrolling: touch;
}
.tips__body div {
padding: 4px 0;
}
.tips__title {
font-weight: 500;
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
}
/* 弹窗底部 */
.tips__footer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.tips__line {
border-left: 1px dashed #fff;
display: inline-block;
height: 48px;
width: 1px;
}
/* 关闭按钮 */
.tips__close {
display: inline-block;
text-align: center;
line-height: 25px;
color: #fff;
font-size: 23px;
font-weight: 100;
border: 1px solid #fff;
width: 30px;
height: 30px;
border-radius: 15px;
}
/* 弹窗 end */
.grade__red {
/* color: #C8161E; */
}
.grade__greed {
/* color: #28BC41; */
}
.rewardpunish__section {
background: #F1F1F1;
display: flex;
align-items: center;
border-top: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
padding: 4px 8px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
font-size: 15px;
color: #000000;
}
.rewardpunish__tiem {
padding: 4px 8px;
display: flex;
flex-direction: column;
/* justify-content: space-between; */
color: #111111;
margin: 10px 0 6px 0;
}
.rewardpunish__tiem>div:last-child {
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #595757;
}
.rewardpunish__tiem>div:first-child {
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
flex-grow: 1;
margin-right: 10px;
}
.daily__mark2 {
display: inline-block;
height: 10px;
width: 3px;
background: #C8161E;
margin-right: 8px;
}
.daily__section {
display: flex;
align-items: center;
background: #F1F1F1;
border-bottom: 1px solid #FFFFFF;
padding: 4px 8px;
font-weight: 500;
font-size: 14px;
color: #000000;
}
.daily__item {
display: flex;
align-items: center;
justify-content: space-between;
overflow: hidden;
padding: 4px 8px;
font-size: 14px;
}
.daily__item div:first-child {
/* white-space: nowrap; */
color: #111111;
width: 60%;
}
.daily__item div:last-child {
/* white-space: nowrap; */
color: #595757;
width: 40%;
text-align: right;
}
.icon__liststyle {
width: 11px;
height: 10px;
background: url('../images/icon_liststyle.png') no-repeat center;
background-size: 10px;
margin-right: 6px;
}
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>绩效考核@2x</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="android" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="03个人简历-02更多" transform="translate(-10.000000, -1272.000000)" fill="#9B9B9B">
<g id="绩效考核" transform="translate(0.000000, 1262.000000)">
<g id="title">
<g id="绩效考核" transform="translate(10.000000, 10.000000)">
<path d="M12.4058178,8.6784436 L16.5321313,5.45461418 L15.9003808,4.64601043 L11.7740673,7.86983985 L8.55490973,3.74950609 L7.83255389,4.31387233 L3.8800274,7.29231467 L4.49756959,8.11182084 L8.3769765,5.18847804 L11.5993956,9.31298644 L12.4079994,8.68123595 L12.4058178,8.6784436 Z M13.7209747,17.4181263 L5.9562472,17.4181263 L3.58008338,19.7942901 C3.38482124,19.9895522 3.06823875,19.9895522 2.8729766,19.7942901 L2.85449786,19.7758113 C2.65923571,19.5805492 2.65923571,19.2639667 2.85449786,19.0687046 L4.50507615,17.4181263 L2,17.4181263 C1.44771525,17.4181263 1,16.970411 1,16.4181263 L1,2 L1,2 C1,1.44771525 1.44771525,1 2,1 L2,1 L18,1 C18.5522847,1 19,1.44771525 19,2 L19,16.4181263 C19,16.970411 18.5522847,17.4181263 18,17.4181263 L15.1721458,17.4181263 L16.8227241,19.0687046 C17.0179862,19.2639667 17.0179862,19.5805492 16.8227241,19.7758113 L16.8042453,19.7942901 C16.6089832,19.9895522 16.2924007,19.9895522 16.0971385,19.7942901 L13.7209747,17.4181263 Z M4,10 L4,15.3658605 L5,15.3658605 L5,10 L4,10 Z M7.66666667,8 L7.66666667,15.3658605 L8.66666667,15.3658605 L8.66666667,8 L7.66666667,8 Z M11.3333333,11.2613289 L11.3333333,15.3658605 L12.3333333,15.3658605 L12.3333333,11.2613289 L11.3333333,11.2613289 Z M15,9.20906313 L15,15.3658605 L16,15.3658605 L16,9.20906313 L15,9.20906313 Z" id="Combined-Shape"></path>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>基本信息@2x</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="android" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="03个人简历-02更多" transform="translate(-10.000000, -203.000000)" fill="#9B9B9B">
<g id="基本信息" transform="translate(0.000000, 193.000000)">
<g id="title">
<g id="基本" transform="translate(10.000000, 10.000000)">
<path d="M7.54500155,9.35681026 C6.02571618,8.49887367 5,6.86922126 5,5 C5,2.23857625 7.23857625,0 10,0 C12.7614237,0 15,2.23857625 15,5 C15,6.86922126 13.9742838,8.49887367 12.4549984,9.35681026 C16.3702103,10.5078168 19,14.1546402 19,16 C19,18.209139 15.0261826,20 10,20 C4.97381738,20 1,18.209139 1,16 C1,14.1546402 3.62978965,10.5078168 7.54500155,9.35681026 Z M10,8.50304114 C11.1045695,8.50304114 12,7.60761064 12,6.50304114 C11.4031677,6.49745642 8.6194458,6.50085913 8,6.50304114 C8,7.60761064 8.8954305,8.50304114 10,8.50304114 Z" id="Combined-Shape"></path>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>教育@2x</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="android" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="03个人简历-02更多" transform="translate(-10.000000, -1750.000000)" fill-rule="nonzero" fill="#9B9B9B">
<g id="教育" transform="translate(0.000000, 1740.000000)">
<g id="title">
<g id="教育" transform="translate(10.000000, 10.000000)">
<path d="M19.1423392,6.69816764 L19.1423392,10.0045224 L19.8383626,10.7006823 L18.3869786,12.2109747 L16.9178752,10.7452437 L17.9239376,9.83046784 L17.9239376,7.22013645 C13.6549318,8.98025341 12.2864327,9.52732943 11.3397856,9.95444444 C10.3930409,10.38154 9.71122807,10.3794542 8.77214425,10.0255361 C7.8331384,9.67173489 3.36311891,8.04038986 1.14358674,6.97807018 C-0.337563353,6.26929825 -0.432904483,5.81990253 1.16900585,5.21842105 C3.25955166,4.42423002 6.71500975,3.15224172 8.54664717,2.45810916 C9.63089669,2.01945419 10.2041326,1.78005848 11.1993567,2.28023392 C12.9763938,3.01405458 17.0369201,4.5377193 19.0559259,5.37134503 C20.8135867,6.13846004 19.6319688,6.39066277 19.1423392,6.69816764 Z M15.4877778,9.48274854 L15.4877778,14.7032943 C15.4877778,14.7032943 13.5247758,16.7915205 10.0740351,16.7915205 C6.35785575,16.7915205 4.35052632,14.7032943 4.35052632,14.7032943 L4.35052632,9.83048733 C5.52196881,10.3076803 6.83744639,10.7183041 8.42937622,11.2632943 C9.4105653,11.6123002 10.6555556,11.7330019 11.5457115,11.2632943 C12.5780312,10.837232 13.97,10.132924 15.4877778,9.48274854 Z" id="Shape"></path>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title></title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="群">
<path d="M11.8626735,10.0444564 C12.7182301,9.43334457 13.2071195,8.33334329 13.2071195,7.23334201 L13.2071195,7.11111964 C13.2071195,5.27778418 11.6182288,3.68889344 9.78489333,3.68889344 C7.95155786,3.68889344 6.36266713,5.27778418 6.36266713,7.11111964 C6.36266713,8.21112092 6.85155658,9.18889344 7.70711313,9.92223403 C5.62933294,10.7777906 4.16266457,12.7333484 4.28488693,15.0555733 C4.40710929,17.5000206 6.60711185,17.622243 9.66267097,17.622243 C12.7182301,17.622243 15.040455,17.622243 15.1626774,15.0555733 C15.4071221,12.8555708 13.8182314,10.9000129 11.8626735,10.0444564 L11.8626735,10.0444564 Z M6.1182224,9.80001166 C5.62933294,9.06667748 5.38488821,8.21112092 5.38488821,7.35556437 C5.38488821,6.13334073 5.7515553,5.03333945 6.60711185,4.1777829 C6.97377895,3.68889344 7.46266841,3.44444871 7.95155786,3.20000398 C7.34044604,2.4666698 6.48488949,2.1000027 5.50711057,2.1000027 C3.55155274,2.1000027 2.08488437,3.68889344 2.08488437,5.52222891 C2.08488437,6.62223019 2.57377383,7.6000027 3.42933038,8.33334329 C1.35155018,9.18889984 -0.11511819,11.26668 0.00710417493,13.4666826 C0.129326539,15.3000181 1.47377255,15.7889075 3.42933038,16.0333522 C3.42933038,15.7889075 3.30710801,15.5444628 3.30710801,15.3000181 C3.30710801,12.9777931 4.40710929,11.0222353 6.1182224,9.80001166 Z M16.1404563,8.33334329 C16.9960128,7.72223147 17.4849023,6.62223019 17.4849023,5.52222891 C17.4849023,3.56667108 16.0182339,2.1000027 14.0626761,2.1000027 C13.0848972,2.1000027 12.2293406,2.4666698 11.6182288,3.20000398 C13.2071195,3.93333817 14.1848985,5.40000654 14.3071208,7.23334201 L14.3071208,7.35556437 C14.3071208,8.21112092 14.0626761,9.18889984 13.5737866,9.92223403 C15.4071221,11.1444577 16.5071234,13.2222379 16.384901,15.4222404 C16.384901,15.6666852 16.384901,15.9111299 16.2626786,16.1555746 C18.2182365,16.0333522 19.4404601,15.5444628 19.5626825,13.588905 C19.6849049,11.1444577 18.2182365,9.18889984 16.1404563,8.33334329 Z" id="形状" fill="#9B9B9B" fill-rule="nonzero"></path>
<rect id="矩形" x="0" y="0" width="20" height="20" rx="1"></rect>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>当前任职@2x</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="android" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="03个人简历-02更多" transform="translate(-10.000000, -753.000000)" fill="#9B9B9B">
<g id="当前" transform="translate(0.000000, 743.000000)">
<g id="title">
<g id="当前任职" transform="translate(10.000000, 10.000000)">
<path d="M5.17250078,11.0784051 C3.21489483,11.6539084 1.9,13.4773201 1.9,14.4 C1.9,15.5045695 3.88690869,16.4 6.4,16.4 C8.91309131,16.4 10.9,15.5045695 10.9,14.4 C10.9,13.4773201 9.58510517,11.6539084 7.62749922,11.0784051 C8.38714191,10.6494368 8.9,9.83461063 8.9,8.9 C8.9,7.51928813 7.78071187,6.4 6.4,6.4 C5.01928813,6.4 3.9,7.51928813 3.9,8.9 C3.9,9.83461063 4.41285809,10.6494368 5.17250078,11.0784051 Z M5.5,2.8 L5.5,2 L5.5,2 C5.5,1.44771525 5.94771525,1 6.5,1 L13.5,1 C14.0522847,1 14.5,1.44771525 14.5,2 L14.5,2.8 L18,2.8 C18.5522847,2.8 19,3.24771525 19,3.8 L19,18 C19,18.5522847 18.5522847,19 18,19 L2,19 C1.44771525,19 1,18.5522847 1,18 L1,3.8 C1,3.24771525 1.44771525,2.8 2,2.8 L2,2.8 L5.5,2.8 Z M7.8,1.9 C7.52385763,1.9 7.3,2.12385763 7.3,2.4 L7.3,3.2 C7.3,3.47614237 7.52385763,3.7 7.8,3.7 L7.8,3.7 L12.2,3.7 C12.4761424,3.7 12.7,3.47614237 12.7,3.2 L12.7,3.2 L12.7,2.4 C12.7,2.12385763 12.4761424,1.9 12.2,1.9 L7.8,1.9 Z M6.4,10.6515206 C5.84771525,10.6515206 5.4,10.2038053 5.4,9.65152057 C5.7097229,9.65042956 7.10158386,9.64872821 7.4,9.65152057 C7.4,10.2038053 6.95228475,10.6515206 6.4,10.6515206 Z M11.35,8.2 C11.1014719,8.2 10.9,8.40147186 10.9,8.65 L10.9,8.65 L10.9,8.65 C10.9,8.89852814 11.1014719,9.1 11.35,9.1 L17.65,9.1 C17.8985281,9.1 18.1,8.89852814 18.1,8.65 C18.1,8.40147186 17.8985281,8.2 17.65,8.2 L11.35,8.2 Z M13.15,10.9 C12.9014719,10.9 12.7,11.1014719 12.7,11.35 L12.7,11.35 L12.7,11.35 C12.7,11.5985281 12.9014719,11.8 13.15,11.8 L17.65,11.8 C17.8985281,11.8 18.1,11.5985281 18.1,11.35 C18.1,11.1014719 17.8985281,10.9 17.65,10.9 L13.15,10.9 Z"></path>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>历史@2x</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="android" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="03个人简历-02更多" transform="translate(-10.000000, -879.000000)" fill="#9B9B9B">
<g id="历史" transform="translate(0.000000, 869.000000)">
<g id="title">
<g id="历史" transform="translate(10.000000, 10.000000)">
<path d="M10.8662178,10.5 L16,10.5 C16.2761424,10.5 16.5,10.2761424 16.5,10 C16.5,9.72385763 16.2761424,9.5 16,9.5 L10.8662178,9.5 C10.7783981,9.348186 10.651814,9.22160185 10.5,9.1337822 L10.5,3.5 C10.5,3.22385763 10.2761424,3 10,3 C9.72385763,3 9.5,3.22385763 9.5,3.5 L9.5,9.1337822 C9.20109931,9.30668691 9,9.62985882 9,10 C9,10.5522847 9.44771525,11 10,11 C10.3701412,11 10.6933131,10.7989007 10.8662178,10.5 Z M10,19 C5.02943725,19 1,14.9705627 1,10 C1,5.02943725 5.02943725,1 10,1 C14.9705627,1 19,5.02943725 19,10 C19,14.9705627 14.9705627,19 10,19 Z"></path>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>奖杯</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="奖杯">
<path d="M18.307073,4.27061049 L16.4346885,4.27061049 L16.4346885,1.69585553 C16.4346885,1.30796763 16.13023,1 15.7372182,1 L4.25771589,1 C3.87483597,1 3.56478887,1.30796763 3.56478887,1.69585553 L3.56478887,4.27061049 L1.68786108,4.27061049 C1.30948422,4.27061049 1,4.58358075 1,4.96646602 L1,8.83407898 C1,9.94279497 1.44232421,10.9618294 2.16440044,11.6974214 L2.16938596,11.6974214 C2.80347177,12.3388173 3.64835664,12.7760605 4.59182616,12.8804246 C5.63396073,14.5108187 7.37804852,15.6342579 9.30935466,15.8434539 L9.30935466,17.5981413 L6.29719576,17.5981413 C5.91885909,17.5981413 5.60424864,17.9111726 5.60424864,18.2991012 C5.60424864,18.6767804 5.91881889,19 6.29719576,19 L13.7028042,19 C14.0812213,19 14.4002544,18.6767804 14.4002544,18.2991012 C14.4002544,17.9111726 14.0812213,17.598121 13.7028042,17.598121 L10.6951685,17.598121 L10.6951685,15.8434539 C12.6214288,15.6342579 14.3710449,14.5108187 15.4126769,12.8804246 C16.3314801,12.7760402 17.1622729,12.3535608 17.7913129,11.7320332 L17.8305537,11.6974214 C18.55263,10.9618091 19,9.94279497 19,8.83407898 L19,4.96646602 C19,4.58362143 18.690556,4.27061049 18.307073,4.27061049 Z M3.15724269,10.7129174 C2.6756374,10.2160898 2.38581383,9.56507504 2.38581383,8.83407898 L2.38581383,5.66744621 L3.56478887,5.66744621 L3.56478887,9.48055883 C3.57992636,10.0721316 3.66797708,10.6483711 3.83054927,11.219974 C3.57488053,11.0911661 3.34894398,10.9170903 3.15724269,10.7129377 L3.15724269,10.7129174 Z M12.8409525,7.71257168 L11.3290935,8.81901005 L11.9124798,10.6213446 C11.9602443,10.7588156 11.8832099,10.9072681 11.7473545,10.9517021 C11.6629424,10.9777321 11.5712531,10.9609956 11.5051547,10.9072477 L10.0004121,9.79720991 L8.48481393,10.9127588 C8.37093098,10.9999593 8.20767529,10.9722008 8.1233034,10.8589499 C8.07364922,10.7865335 8.05905452,10.699272 8.08834445,10.6213446 L8.67195187,8.81901005 L7.1488151,7.70518973 C7.03517338,7.61979908 7.00769271,7.45654208 7.09397438,7.34327083 C7.14149764,7.27083418 7.22231132,7.23376174 7.30310489,7.23376174 L9.17647446,7.23567332 L9.75278453,5.43122382 C9.79861915,5.29761663 9.94537036,5.21773702 10.0812057,5.26245577 C10.1619993,5.29017367 10.2206394,5.35520804 10.2463912,5.43124415 L10.8225003,7.23567332 L12.6979003,7.23376174 C12.8409123,7.23376174 12.9566247,7.34878188 12.9566247,7.49361451 C12.9566849,7.58447554 12.9108503,7.66431448 12.8409525,7.71257168 L12.8409525,7.71257168 Z M17.6142063,8.83409932 C17.6142063,9.56507504 17.3193168,10.2161101 16.8478031,10.7129377 L16.8181715,10.7429129 C16.6219269,10.9318339 16.4055392,11.1008256 16.1695311,11.2199536 C16.3365662,10.6483508 16.420134,10.0721113 16.4346885,9.4805385 L16.4346885,5.66744621 L17.6142063,5.66744621 L17.6142063,8.83409932 Z" id="形状" fill="#9B9B9B" fill-rule="nonzero"></path>
<rect id="矩形" x="0" y="0" width="20" height="20" rx="1"></rect>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>工作经历@2x</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="android" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="03个人简历-02更多" transform="translate(-10.000000, -1472.000000)" fill-rule="nonzero" fill="#9B9B9B">
<g id="工作经历" transform="translate(0.000000, 1462.000000)">
<g id="title">
<g id="工作经历" transform="translate(10.000000, 10.000000)">
<path d="M16.5000047,4.03791343 C16.5000047,4.03791343 12.1297022,4.03791343 3.38909724,4.03791343 C3.38909724,4.03791343 2.45541582,4.03791343 2.45541582,5.05722531 L2.45541582,6.09240489 L17.541083,6.09240489 L17.541083,5.05722531 C17.541083,4.03791343 16.5000047,4.03791343 16.5000047,4.03791343 Z M5.93572384,2 C5.93572384,2 4.92104072,2.07238269 4.92104072,3.09240489 L15.0778267,3.09240489 C15.0778267,2.07238269 14.0602994,2 14.0610104,2 L5.93572384,2 Z M18.5385575,5.47418424 L18.5385575,7.09584906 L1.45888788,7.09584906 L1.45888788,5.47418424 L0.858041888,6.0772475 C0.257195893,6.68102109 -0.173706678,6.84297447 0.0687649006,8.1172919 C0.308392238,9.38592675 1.47524227,16.3477913 1.64731888,17.2896781 C1.83859411,18.3231964 2.8895413,18.30899 2.8895413,18.30899 L17.1100372,18.30899 C17.1100372,18.30899 18.1616955,18.3239068 18.3522597,17.2896781 C18.5257584,16.3477913 19.6911863,9.38592675 19.9315247,8.1172919 C20.1732852,6.84297447 19.7430937,6.68102109 19.1394035,6.0772475 L18.5385575,5.47418424 Z M13.0449052,12.6015538 L6.95182908,12.6015538 C5.9364349,12.6015538 5.9364349,11.582242 5.9364349,11.582242 L5.9364349,9.54290788 L7.00013674,9.54290788 L7.00013674,11.6024147 L13.0063746,11.6024147 L13.0063746,9.54290788 L14.0610104,9.54290788 L14.0610104,11.582242 C14.0610104,11.582242 14.0610104,12.6015538 13.0449052,12.6015538 Z" id="Shape"></path>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
import cube from '../../CubeModule.json';
const RENDER_TYPE = {
A: Symbol('A'),
B: Symbol('B'),
C: Symbol('C'),
D: Symbol('D'),
E: Symbol('E'),
F: Symbol('F'),
G: Symbol('G'),
H: Symbol('H'),
};
let config = {
identifier: cube.identifier,
ssoTokenPlaceholder: '___mideatoken___',
uidPlaceholder: '___uid___',
isMock: false,
mockPath: 'json/',
code: 'cnd-hr-res',
yjyCode: 'yjy-hr-res',
hjCode: 'hj-hr-res',
wyCode: 'cnd-wyhr-base',
methods: {
resume: '/hrInterface/resumeBaseV.do?',
yjyResume: '',
hjResume: '',
wyResume: '/hrInterface/resumeBaseV.do',
photo: 'imm-api/api/emp/getExtInfo',
},
renderType: RENDER_TYPE,
renderItem: {
resumeBaseVo: {
name: '基本信息',
type: RENDER_TYPE.A,
img: 'base',
list: {
gender: '性别',
birthday: '出生年月',
fnative: '籍贯',
marriage: '婚姻状况',
political: '政治面貌',
partyAccessionDate: '党(团)派加入时间',
highesttitle: '最高职称',
highestedu: '最高学历',
highdegree: '最高学位',
jobtime: '参加工作时间',
worktime: '入司时间',
idcardno: '身份证(护照)',
},
},
jobVoList: {
name: '当前任职',
type: RENDER_TYPE.B,
img: 'job',
list: {
title: 'depart',
subTitle: ['job'],
note: ['jobstarttime', 'jobendtime'],
},
},
jobHistoryVoList: {
name: '历史任职',
type: RENDER_TYPE.B,
img: 'jobhistory',
list: {
title: 'depart',
subTitle: ['job'],
note: ['jobstarttime', 'jobendtime'],
},
},
// assessVoList: {
// name: '绩效考核',
// type: RENDER_TYPE.D,
// img: 'assess',
// list: {
// title: 'assyear',
// note: 'assgrade',
// },
// },
workVoList: {
name: '工作经历',
type: RENDER_TYPE.B,
img: 'work',
list: {
title: 'company',
subTitle: ['job'],
note: ['jobstarttime', 'jobendtime'],
},
},
eduVoList: {
name: '教育经历',
type: RENDER_TYPE.C,
img: 'edu',
list: {
title: 'school',
subTitle: ['major', 'educational', 'degree'],
note: 'graduationtime',
},
},
familyVoList: {
name: '社会关系',
type: RENDER_TYPE.E,
img: 'family',
list: {
title: 'name',
title1: 'relation',
title2: 'phone',
subTitle: ['political', 'birthday', 'workUnit'],
subTitleName: ['政治面貌', '出生日期', '工作单位'],
},
},
assessVoList: {
name: '员工绩效',
type: RENDER_TYPE.D,
img: 'reward',
list: {
// 物业
title: 'assyear',
note: 'assgrade',
// 房产
yearShow: 'yearShow',
performance: 'performance',
appraise: 'appraise',
award: 'award',
punish: 'punish',
},
},
rewardPunishVoList: {
name: '奖惩信息',
type: RENDER_TYPE.F,
img: 'reward',
list: {
title: 'content',
title1: 'type',
subTitle: 'company',
subTitle1: 'year',
},
},
},
};
export default config;
import common from './common';
const config = {
product: true,
ssoToken: 'token',
// baseUrl: 'https://jffcvp.cndrealty.com:4433/',
// appkey: '781d2ec4', // 正式
baseUrl: 'https://mxytest.cndrealty.com:4433/', //测试
appkey: 'd504275e', // 测试
};
export default Object.assign(config, common);
import common from './common';
// const config = {
// product: false,
// ssoToken: 'token',
// userid: '10000487',
// appKey: 'd504275e',
// uid: 'liujing',
// token: 'T4769421750076416',
// baseUrl: 'https://mxytest.cndrealty.com:4433/',
// };
// const config = {
// product: false,
// ssoToken: 'token',
// userid: '46000011',
// appKey: 'd504275e',
// uid: 'hqhuang@cndrealty.com',
// token: 'T4769446611354624',
// baseUrl: 'https://mxytest.cndrealty.com:4433/',
// };
// const config = {
// product: false,
// ssoToken: 'token',
// userid: '10000717',
// appKey: 'd504275e',
// uid: 'xiewei',
// token: 'T4583667530875904',
// baseUrl: 'https://mxytest.cndrealty.com:4433/',
// };
// const config = {
// product: false,
// ssoToken: 'token',
// userid: '10015264',
// appKey: 'd504275e',
// uid: 'suyh@cndrealty.com',
// token: 'T4777933018317824',
// baseUrl: 'https://mxytest.cndrealty.com:4433/',
// };
const config = {
product: false,
ssoToken: 'token',
userid: '10001285',
appKey: 'd504275e',
uid: 'xycao@cndrealty.com',
token: 'T4777979921957888',
baseUrl: 'https://mxytest.cndrealty.com:4433/',
};
export default Object.assign(config, common);
{
"error": "",
"errorCode": 0,
"data": {
"jobVoList": [{
"id": "0000000000050191",
"username": "程冰",
"jobendtime": "9999-12-31",
"job": "集团副总经理",
"personid": "10000370",
"depart": "建发房地产集团有限公司",
"director": null,
"jobstarttime": "2014-02-01"
}],
"resumeBaseVo": {
"id": "0000000000000370",
"username": "程冰",
"birthday": "1973-12-28",
"personid": "10000370",
"fnative": "安徽巢湖市庐江县",
"gender": "女",
"highdegree": "无",
"highestedu": "本科",
"highesttitle": "助理会计师",
"jobtime": "1994-10-01",
"marriage": "已婚",
"political": "中共党员",
"worktime": "1997-02-01"
},
"assessVoList": [],
"jobHistoryVoList": [{
"id": "0000000000050191",
"username": "程冰",
"jobendtime": "9999-12-31",
"job": "集团副总经理",
"personid": "10000370",
"depart": "建发房地产集团有限公司",
"director": null,
"jobstarttime": "2014-02-01"
}, {
"id": "0000000000045935",
"username": "程冰",
"jobendtime": "2014-01-31",
"job": "集团副总经理",
"personid": "10000370",
"depart": "建发房地产集团有限公司",
"director": null,
"jobstarttime": "2013-02-01"
}, {
"id": "0000000000041315",
"username": "程冰",
"jobendtime": "2013-01-31",
"job": "集团副总经理",
"personid": "10000370",
"depart": "建发房地产集团有限公司",
"director": null,
"jobstarttime": "2012-02-01"
}, {
"id": "0000000000032035",
"username": "程冰",
"jobendtime": "2012-01-31",
"job": "集团副总经理",
"personid": "10000370",
"depart": "建发房地产集团有限公司",
"director": null,
"jobstarttime": "2011-02-01"
}, {
"id": "0000000000025456",
"username": "程冰",
"jobendtime": "2011-01-31",
"job": "集团副总经理",
"personid": "10000370",
"depart": "建发房地产集团有限公司",
"director": null,
"jobstarttime": "2010-06-01"
}, {
"id": "0000000000030600",
"username": "程冰",
"jobendtime": "2011-01-31",
"job": "总经理(兼)",
"personid": "10000370",
"depart": "房地产集团营销管理中心",
"director": null,
"jobstarttime": "2010-02-01"
}, {
"id": "0000000000030599",
"username": "程冰",
"jobendtime": "2010-01-31",
"job": "总经理(兼)",
"personid": "10000370",
"depart": "房地产集团营销管理中心",
"director": null,
"jobstarttime": "2009-02-01"
}, {
"id": "00006184",
"username": "程冰",
"jobendtime": "2009-01-31",
"job": "总经理(兼)",
"personid": "10000370",
"depart": "销售管理中心",
"director": null,
"jobstarttime": "2008-02-01"
}, {
"id": "00004103",
"username": "程冰",
"jobendtime": "2010-05-31",
"job": "集团副总经理",
"personid": "10000370",
"depart": "建发房地产集团有限公司",
"director": null,
"jobstarttime": "2008-02-01"
}, {
"id": "00006186",
"username": "程冰",
"jobendtime": "2009-01-31",
"job": "中心总经理(兼)",
"personid": "10000370",
"depart": "策划管理中心",
"director": null,
"jobstarttime": "2008-02-01"
}, {
"id": "00002772",
"username": "程冰",
"jobendtime": "2008-01-31",
"job": "集团总经理助理",
"personid": "10000370",
"depart": "建发房地产集团有限公司",
"director": null,
"jobstarttime": "2007-02-01"
}, {
"id": "00001811",
"username": "程冰",
"jobendtime": "2008-01-31",
"job": "总经理(兼)",
"personid": "10000370",
"depart": null,
"director": null,
"jobstarttime": "2007-02-01"
}, {
"id": "0000000000008308",
"username": "程冰",
"jobendtime": "2006-01-31",
"job": "总经理(兼)",
"personid": "10000370",
"depart": "房地产集团厦门事业部",
"director": null,
"jobstarttime": "2005-02-01"
}, {
"id": "0000000000008305",
"username": "程冰",
"jobendtime": "2007-01-31",
"job": "集团总经理助理",
"personid": "10000370",
"depart": "建发房地产集团有限公司",
"director": null,
"jobstarttime": "2005-02-01"
}, {
"id": "0000000000008304",
"username": "程冰",
"jobendtime": "2005-01-31",
"job": "经理(兼)",
"personid": "10000370",
"depart": "房地产集团营销部",
"director": null,
"jobstarttime": "2004-02-01"
}, {
"id": "0000000000008310",
"username": "程冰",
"jobendtime": "2004-05-31",
"job": "总经理",
"personid": "10000370",
"depart": "厦门品传置业顾问有限公司",
"director": null,
"jobstarttime": "2004-02-01"
}, {
"id": "0000000000008303",
"username": "程冰",
"jobendtime": "2004-01-31",
"job": "经理",
"personid": "10000370",
"depart": "房地产公司营销部",
"director": null,
"jobstarttime": "2003-02-01"
}, {
"id": "0000000000008302",
"username": "程冰",
"jobendtime": "2003-01-31",
"job": "经理",
"personid": "10000370",
"depart": "房地产公司销售部",
"director": null,
"jobstarttime": "2002-05-01"
}, {
"id": "0000000000008301",
"username": "程冰",
"jobendtime": "2000-02-28",
"job": "经理助理",
"personid": "10000370",
"depart": "厦门建发集团房地产有限公司",
"director": null,
"jobstarttime": "1999-02-01"
}],
"workVoList": [],
"eduVoList": [{
"id": "0000000000395939",
"username": "程冰",
"major": "工商管理",
"personid": "10000370",
"school": "厦门大学",
"graduationtime": "2004-09-01",
"educational": "本科",
"degree": "无"
}, {
"id": "0000000000395940",
"username": "程冰",
"major": "审计",
"personid": "10000370",
"school": "集美大学",
"graduationtime": "1995-07-01",
"educational": "",
"degree": "无"
}]
},
"userid": "10000370",
"success": true
}
import css from '../assets/css/style.css';
import configuration from 'configuration';
import app from './lib/app';
import MAS from './lib/mas';
import Vconsole from 'vconsole';
import IScroll from 'iscroll/build/iscroll-probe';
const PhotoSwipe = require('./lib/photoswipe.min').PhotoSwipe;
const PhotoSwipeUI_Default = require('./lib/photoswipe-ui-default.min')
.PhotoSwipeUI_Default;
const FastClick = require('fastclick')
// const IScroll = require('iscroll/build/iscroll-probe')
window.topHeight = 115;
let _uid = '';
let userid = '';
let token = '';
let appKey = '';
let photoUrl = '';
let items = [];
let url = configuration.methods.resume;
const $mas = new MAS().config({
baseUrl: configuration.baseUrl,
code: configuration.code,
});
const RENDER_TYPE = configuration.renderType;
const name = document.querySelector('#name');
const header = document.querySelector('.header');
const backButton = document.getElementById('back');
const container = document.querySelector('.container');
const photo = document.getElementById('mainPhoto');
// 弹窗
const tabModal = document.querySelector('.my__modal');
const tabModalClose = document.querySelector('.modal__close');
// tips弹窗
const tipsModal = document.querySelector('.tips__modal');
const tipsmMdalClose = document.querySelector('.tips__close');
app.ready(() => {
// new Vconsole(); // 注册Vconsole
initUser().then(() => {
$mas.token = token;
mount();
});
// 取消延迟响应
FastClick.attach(document.body);
}, configuration.product);
function initUser() {
return Promise.all([app.getUser(), app.getExtra(configuration.identifier)])
.then(([user, {
extra
}]) => {
userid = extra.employeenumber || user.employeenumber;
token = user.ssoToken;
_uid = extra.uid || user.uid;
appKey = extra.appkey || configuration.appkey;
let orgType;
if (!extra.extra) {
orgType = eval('(' + user.extra + ')').orgType;
} else {
orgType =
eval('(' + extra.extra + ')').orgType ||
eval('(' + user.extra + ')').orgType;
}
switch (orgType) {
// 房产
case 1:
break;
// 怡家园
case 2:
$mas.config({
baseUrl: configuration.baseUrl,
code: configuration.yjyCode,
});
url = configuration.methods.yjyResume;
userid = userid.replace('YJY', '');
_uid = _uid.replace('YJY', '');
break;
// 汇嘉
case 3:
$mas.config({
baseUrl: configuration.baseUrl,
code: configuration.hjCode,
});
url = configuration.methods.hjResume;
break;
// 物业
case 6:
$mas.config({
baseUrl: configuration.baseUrl,
code: configuration.wyCode,
});
url = configuration.methods.wyResume;
break;
default:
// alert('权限不足,无法查看简历');
// app.exit();
showToast('暂无数据,请联系管理员');
setTimeout(() => {
app.exit();
}, 2000);
}
})
.catch(e => {
if (!configuration.product) {
_uid = configuration.uid;
userid = configuration.userid;
token = configuration.token;
appKey = configuration.appKey;
} else {
alert(e);
alert('应用启动发生错误,请联系开发人员');
}
});
}
function mount() {
scrollBehavior();
attachAtivated(backButton);
attachAtivated(photo);
//TODO
// render(dataJson.data)
container.classList.add('container__scrolling')
backButton.addEventListener('click', () => {
app.exit();
});
document.addEventListener(
'backbutton',
() => {
app.exit();
},
false
);
document
.querySelector('.pswp__button--save')
.addEventListener('touchend', evt => {
evt.stopPropagation();
console.log('保存图片');
app.saveToGallery(photoUrl)
.then(() => {
showToast('保存成功');
})
.catch(() => {
showToast('保存失败');
});
});
photo.onclick = openPhoto;
// 关闭弹窗
tabModalClose.onclick = function() {
switchTabModal(false)
}
// 关闭tips弹窗
tipsModal.onclick = function() {
tipsModal.style.display = 'none'
}
$mas.restful(url, {
userid,
appKey,
})
.then(({
data
}) => {
console.log(555, data)
render(data);
return data;
})
.catch(e => {});
$mas.getData(configuration.baseUrl + configuration.methods.photo, {
uid: _uid,
appKey,
})
.then(data => {
if (data && data.code && data.data) {
photoUrl = data.data.headPhoto || data.data;
renderPhoto();
}
})
.catch(e => {
console.log('getData err', e);
});
}
function scrollBehavior() {
const per = window.topHeight / 100;
container.addEventListener('scroll', function() {
if (this.scrollTop < window.topHeight) {
let scale = (window.topHeight - this.scrollTop) / window.topHeight;
scale = scale > 1 ? 1 : scale;
let value = `scale(${scale}) translateZ(0)`;
photo.style['transform'] = value;
photo.style['-webkit-transform'] = value;
}
if (this.scrollTop > window.topHeight) {
header.classList.add('show');
} else {
header.classList.remove('show');
}
});
}
function openPhoto() {
if (!items.length) return;
var pswpElement = document.querySelectorAll('.pswp')[0];
// define options (if needed)
var options = {
// optionName: 'option value'
// for example:
index: 0, // start at first slide
};
// Initializes and opens PhotoSwipe
var gallery = new PhotoSwipe(
pswpElement,
PhotoSwipeUI_Default,
items,
options
);
gallery.init();
}
function render(data) {
var RENDER_ITEM = configuration.renderItem;
let resumeBaseVo = data.resumeBaseVo || [];
let jobGradeType = data.jobGradeType || '3'; //- 区分人员类别 1-物业C级人员 2-物业D级人员 3-房开人员
header.innerText = resumeBaseVo.username;
name.innerText = resumeBaseVo.username;
switch (jobGradeType) {
case '1':
// showToast('C级人员');
var RENDER_ITEM = {
// 基础信息
resumeBaseVo: configuration.renderItem.resumeBaseVo,
// 当前任职
jobVoList: configuration.renderItem.jobVoList,
// 历史任职
jobHistoryVoList: configuration.renderItem.jobHistoryVoList,
// 绩效信息
assessVoList: configuration.renderItem.assessVoList,
// 工作经历
workVoList: configuration.renderItem.workVoList,
// 教育经历
eduVoList: configuration.renderItem.eduVoList,
// 社会关系
familyVoList: configuration.renderItem.familyVoList,
// 奖惩信息
rewardPunishVoList: configuration.renderItem.rewardPunishVoList,
};
for (let r in RENDER_ITEM) {
if (data[r]) {
let dataArr = filter(r, data[r]);
if (!dataArr) {
continue;
}
propertyRenderer(RENDER_ITEM[r], dataArr);
}
}
break;
case '2':
// showToast('D级人员'); // 基础信息 当前任职 历史任职 绩效信息 奖惩信息
var RENDER_ITEM = {
resumeBaseVo: configuration.renderItem.resumeBaseVo,
jobVoList: configuration.renderItem.jobVoList,
jobHistoryVoList: configuration.renderItem.jobHistoryVoList,
assessVoList: configuration.renderItem.assessVoList,
rewardPunishVoList: configuration.renderItem.rewardPunishVoList,
};
for (let r in RENDER_ITEM) {
if (data[r]) {
let dataArr = filter(r, data[r]);
if (!dataArr) {
continue;
}
propertyRenderer(RENDER_ITEM[r], dataArr);
}
}
break;
case '3':
var RENDER_ITEM = {
// 基础信息
resumeBaseVo: configuration.renderItem.resumeBaseVo,
// 当前任职
jobVoList: configuration.renderItem.jobVoList,
// 历史任职
jobHistoryVoList: configuration.renderItem.jobHistoryVoList,
// 工作经历
workVoList: configuration.renderItem.workVoList,
// 教育经历
eduVoList: configuration.renderItem.eduVoList,
// 社会关系
familyVoList: configuration.renderItem.familyVoList,
// 绩效信息
assessVoList: configuration.renderItem.assessVoList,
};
// showToast('房开人员');
for (let r in RENDER_ITEM) {
if (data[r]) {
let dataArr = data[r];
if (r == 'assessVoList') {
dataArr = {
// 绩效
assessVoList: data['assessVoList'],
// 评优
rewardPunishVoList: data['rewardPunishVoList'],
// 奖励/处罚
specialtyRewadVoList: data['specialtyRewadVoList'],
// 营销小红花
sakeredFlowerVoList: data['sakeredFlowerVoList']
}
}
// let dataArr = filter(r, data[r]);
// if (!dataArr) {
// continue;
// }
// console.log(222222,dataArr,r)
renderer(RENDER_ITEM[r], dataArr);
}
}
break;
default:
showToast(`#jobGradeType = ${jobGradeType}; 不明人员`);
}
eleHide();
// eleHideShrink()
}
function renderer(renderTemp, data) {
let type = renderTemp.type;
// console.log('type',type)
container.appendChild(headerRenderer(renderTemp));
switch (type) {
case RENDER_TYPE.A:
container.appendChild(listARenderer(renderTemp.list, data));
break;
case RENDER_TYPE.B:
container.appendChild(listBRenderer(renderTemp.list, data));
break;
case RENDER_TYPE.C:
container.appendChild(listCRenderer(renderTemp.list, data));
break;
case RENDER_TYPE.D:
// container.appendChild(listDRenderer(renderTemp.list, data));
container.appendChild(listJXRenderer(renderTemp.list, data));
break;
case RENDER_TYPE.E:
container.appendChild(listERenderer(renderTemp.list, data));
break;
// case RENDER_TYPE.F:
// container.appendChild(listFRenderer(renderTemp.list, data));
// break;
}
}
function headerRenderer(data) {
let temp = document.createElement('div');
let img = document.createElement('span');
let name = document.createElement('span');
temp.classList.add('item__header');
temp.classList.add('bbd');
name.innerText = data.name;
img.classList.add(`item_header-img-${data.img}`);
img.classList.add('item_header-img');
temp.appendChild(img);
temp.appendChild(name);
return temp;
}
function itemRenderer(title, value, extra = '') {
return `<div class="item__content ${extra}">
<div class="item__content-title bbd">${title}</div>
<div class="item__content-value bbd">${value}</div>
</div>`;
}
function function_name() {
}
// 物业页面
function propertyRenderer(renderTemp, data) {
let type = renderTemp.type;
container.appendChild(propertyHeaderRenderer(renderTemp));
switch (type) {
case RENDER_TYPE.A:
container.appendChild(propertyListARenderer(renderTemp.list, data));
break;
case RENDER_TYPE.B:
container.appendChild(propertyListBRenderer(renderTemp.list, data));
break;
case RENDER_TYPE.C:
container.appendChild(propertyListCRenderer(renderTemp.list, data));
break;
case RENDER_TYPE.D:
container.appendChild(propertyListDRenderer(renderTemp.list, data));
break;
case RENDER_TYPE.E:
container.appendChild(propertyListERenderer(renderTemp.list, data));
break;
case RENDER_TYPE.F:
container.appendChild(propertyListFRenderer(renderTemp.list, data));
break;
}
}
function propertyHeaderRenderer(data) {
let temp = document.createElement('div');
let img = document.createElement('span');
let name = document.createElement('span');
temp.classList.add('item__header');
temp.classList.add('bbd');
name.innerText = data.name;
img.classList.add(`item_header-img-${data.img}`);
img.classList.add('item_header-img');
temp.appendChild(img);
temp.appendChild(name);
return temp;
}
function propertyItemRenderer(title, value, extra = '') {
return `<div class="item__content ${extra}">
<div class="item__content-title bbd">${title}</div>
<div class="item__content-value bbd">${value}</div>
</div>`;
}
/**
* 时间至今的逻辑
* 原来判断当前任职的结束时间如果是9999-12-31,就显示“至今”。现在由于当前任职的结束时间为2199-12-31,所以会把具体的时间显示出来。
* 建议逻辑修改为:判断大于目前的时间就显示“至今”
* @param val
* @return {string}
*/
function nowOrNot(val) {
if (val) {
return new Date(val.replace(/-/g, '/')).getTime() > new Date().getTime() ?
'今' :
val;
} else {
return '';
}
}
function listARenderer(list, data, extra = '') {
let temp = document.createElement('div');
temp.classList.add('item__wrap');
for (let name in list) {
let value;
let title;
if (list[name] instanceof Object) {
if (name.indexOf('&') !== -1) {
let names = name.split('&');
title = `${data[names[0]] || '未知'}-${
data[names[1]] || '未知'
}`;
} else {
title = data[name];
}
let t1 = data[list[name][0]];
let t2 = data[list[name][1]];
value = `${t1}${nowOrNot(t2)}`;
} else {
title = list[name];
value = data[name];
}
temp.innerHTML += itemRenderer(title || '未知', value || '无', 'light');
}
return temp;
}
function listBRenderer(list, data) {
let temp = ``;
if (data && data.length) {
data.forEach((item, index) => {
let sub = '';
let note = list.note;
if (list.subTitle) {
list.subTitle.forEach((s, i) => {
sub += (i && '|') || '';
sub += item[s] || '无';
});
}
if (note instanceof Object && note.length) {
let t1 = data[index][list.note[0]];
let t2 = data[index][list.note[1]];
//temp += itemRenderer(item[list[0]], item[list[1]], index > 2 && 'hide')
temp +=
`<div class="item_main"><div class="item__content work">${
item[list.title] || '无'
}</div>` +
itemRenderer(
`<p class="item__content-sub-title">${sub}</p>`,
`<p class="item__content-note">${t1}${nowOrNot(
t2
)}</p>`
) +
`</div>`;
} else {
temp += itemRenderer(
`${
item[list.title]
}<p class="item__content-sub-title">${sub}</p>`,
`<p class="item__content-note">${item[note]}</p>`
);
}
});
} else {
temp = noDataRenderer();
}
return renderWrap(temp, data.length > 3);
}
function listCRenderer(list, data) {
let temp = ``;
if (data && data.length) {
data.forEach((item, index) => {
let sub = '';
list.subTitle.forEach((s, i) => {
switch (i) {
case 1:
sub += (i && ' | ') || '';
if (item[s] === '无' || !item[s]) {
item[s] = '无学历';
}
sub += item[s];
break;
case 2:
sub += (i && ' | ') || '';
if (item[s] === '无' || !item[s]) {
sub += '无学位';
} else {
sub += item[s];
}
break;
default:
sub += (i && ' | ') || '';
sub += item[s] || '无';
break;
}
});
temp += itemRenderer(
`${item[list.title]}
<p class="item__content-sub-title">${sub}</p><p class="item__content-sub-title">毕业于${
item[list.note]
}</p>`,
'',
'edu long-title '
);
});
} else {
temp = noDataRenderer();
}
return renderWrap(temp, data.length > 3);
}
function listERenderer(list, data) {
let temp = ``;
if (data && data.length) {
data.forEach((item, index) => {
let sub = '';
list.subTitle.forEach((s, i) => {
sub += `<p class="item__content-sub-title">${list.subTitleName[i]}${item[s]}</p>`;
});
temp += itemRenderer(
`${item[list.title]} | ${
item[list.title1]
}<span style="float: right;padding-right:16px">${
item[list.title2]
}</span>
${sub}`,
'',
'edu long-title '
);
});
} else {
temp = noDataRenderer();
}
return renderWrap(temp, data.length > 3);
}
function listFRenderer(list, data) {
let temp = ``;
if (data && data.length) {
data.forEach((item, index) => {
temp += itemRenderer(
`${
item[list.title]
}<span style="float: right;padding-right:16px">${
item[list.title1]
}</span>
<p class="item__content-sub-title">${
item[list.subTitle]
}<span style="float: right;padding-right:12px">${
item[list.subTitle1]
}年度</span></p>`,
'',
'edu long-title '
);
});
} else {
temp = noDataRenderer();
}
return renderWrap(temp, data.length > 3);
}
// 绩效列表
let performanceArr = [],
performanceSelected = '';
// 评优列表
let appraiseArr = [],
appraiseMenu = ['全部'],
appraiseMenuSelected = '全部';
// 奖励列表
let awardArr = [],
awardMenu = ['全部'],
awardMenuSelected = '全部';
// 处罚列表
let punishArr = [],
punishMenu = ['全部'],
punishMenuSelected = '全部';
// 员工绩效表
let performanceTableArr = [];
/* 员工绩效 */
function listJXRenderer(list, data) {
// console.log('员工绩效', data)
performanceArr = performanceGroups(data.assessVoList)
appraiseArr = appraiseGroups(data.rewardPunishVoList)
// 评优测试数据
// appraiseArr = [{
// year: '2021',
// children: [{
// content: '2021年度专业技术突出一等奖',
// company: '华中区域公司'
// },{
// content: '2021年度专业技术突出一等奖',
// company: '华中区域公司'
// }]
// },{
// year: '2020',
// children: [{
// content: '2020年度专业技术突出一等奖',
// company: '华中区域公司'
// },{
// content: '2020年度专业技术突出一等奖',
// company: '华中区域公司'
// }]
// }]
let rewardpunishArr = rewardpunishGroups(data.specialtyRewadVoList)
console.log('rewardpunishArr-------', rewardpunishArr);
rewardpunishArr.forEach((item) => {
if (item.state === '奖励') {
awardArr = rewardGroups(item.children, data.sakeredFlowerVoList)
console.log('awardArr-------', awardArr);
} else {
punishArr = punishGroups(item.children)
}
})
console.log('绩效', performanceArr)
console.log('评优', appraiseArr)
console.log('奖励', awardArr);
console.log('处罚', punishArr);
let tmpYears = []
performanceArr.forEach((item, index) => {
tmpYears.push(item.year)
if (index === 0) {
performanceSelected = item.year
}
})
appraiseArr.forEach((item) => {
tmpYears.push(item.year)
appraiseMenu.push(item.year)
})
awardArr.forEach((item, index) => {
tmpYears.push(item.year)
if (index === 0) {
awardMenuSelected = item.year
}
awardMenu.push(item.year)
})
punishArr.forEach((item, index) => {
tmpYears.push(item.year)
if (index === 0) {
punishMenuSelected = item.year
}
punishMenu.push(item.year)
})
// 配置弹窗
setUpYGJXModal()
let tmpAllYears = [...new Set(tmpYears)]
let allYears = tmpAllYears.sort((a, b) => {
return b - a
})
if (allYears.length > 0) {
// 绩效显示到当前年份
let currentYear = new Date().getFullYear()
let firstYear = Number(allYears[0])
let count = currentYear - firstYear
for (var i = 1; i <= count; i++) {
allYears.unshift(`${firstYear+i}`)
}
}
let tableData = []
allYears.forEach((year) => {
// 设置空数据
let tableItem = {
year: year,
yearShow: `${year}年`,
performance: '/',
appraise: '/',
award: '/',
punish: '/',
}
// 分配绩效数据
performanceArr.forEach((item) => {
if (item.year == year) {
let itemStr = JSON.stringify(item)
let textColor = getGradeColor(item.assgrade)
tableItem.performance =
`<div data-item='${itemStr}' data-type="performance" class='${textColor}'>${item.assgrade||'/'}</div>
<div data-item='${itemStr}' data-type="performance" class='ygjx_table__grade ${textColor}'>${item.gradeNumStr||''}</div>`
}
})
appraiseArr.forEach((item) => {
if (item.year == year) {
tableItem.appraise = `${item.children.length}次`
}
})
awardArr.forEach((item) => {
if (item.year == year) {
if (item.children.length > 0) {
tableItem.award = `${item.children.length}次`
}
}
})
punishArr.forEach((item) => {
if (item.year == year) {
if (item.children.length > 0) {
tableItem.punish = `${item.children.length}次`
}
}
})
tableData.push(tableItem)
})
let bgBox = document.createElement('div')
bgBox.classList.add('ygjx_bg_box')
if (tableData && tableData.length) {
let hintMoreNode = document.createElement('div')
hintMoreNode.classList.add('hint_more')
hintMoreNode.innerHTML = `<div></div>
<div>左右滑动,查看更多数据</div>
<div></div>`
bgBox.appendChild(hintMoreNode)
let ygjxTableBox = document.createElement('div')
ygjxTableBox.classList.add('ygjx_table_box')
let ygjxTable = document.createElement('table')
ygjxTable.classList.add('ygjx_table')
// ygjxTable.border = '1'
//表格点击事件处理
ygjxTable.onclick = function(e) {
// console.log(e.target);
let dataset = e.target.dataset
if (dataset.tips) { // 提示弹窗显示
tipsModal.style.display = "block";
} else if (dataset.type) { //
let tabIndex = 0
if (dataset.item) {
let item = JSON.parse(dataset.item)
let text = item[dataset.type]
if (text === '/') {
return
} else {
if (dataset.type === 'performance') {
console.log('performanceSelected', performanceSelected);
performanceSelected = item.year
tabIndex = 0
performanceSelectedUpdate(true)
}
if (dataset.type === 'appraise') { // 评优
appraiseMenuSelected = '全部'
tabIndex = 1
modalPYTabView()
}
if (dataset.type === 'award') {
awardMenuSelected = '全部' //item.year
tabIndex = 2
modalJLTabView()
}
if (dataset.type === 'punish') {
punishMenuSelected = '全部' //item.year
tabIndex = 3
modalCFTabView()
}
}
}
switchTabModal(true)
modalDidSelectedIndex(tabIndex)
}
}
let colsWidth = 50
let tableWidth = document.body.clientWidth - colsWidth - 10 * 2 - 28
let itemWidth = tableWidth / 2 - 10 * 2
let tr1 = document.createElement('tr')
let tr2 = document.createElement('tr')
let tr3 = document.createElement('tr')
let tr4 = document.createElement('tr')
let tr5 = document.createElement('tr')
let colstd1 = document.createElement('td')
let colstd2 = document.createElement('td')
let colstd3 = document.createElement('td')
let colstd4 = document.createElement('td')
let colstd5 = document.createElement('td')
colstd1.classList.add('cols')
colstd2.classList.add('cols')
colstd3.classList.add('cols')
colstd4.classList.add('cols')
colstd5.classList.add('cols')
colstd1.style.minWidth = `${colsWidth}px`
colstd2.style.minWidth = `${colsWidth}px`
colstd3.style.minWidth = `${colsWidth}px`
colstd4.style.minWidth = `${colsWidth}px`
colstd5.style.minWidth = `${colsWidth}px`
colstd1.style.width = `${colsWidth}px`
colstd2.style.width = `${colsWidth}px`
colstd3.style.width = `${colsWidth}px`
colstd4.style.width = `${colsWidth}px`
colstd5.style.width = `${colsWidth}px`
colstd2.innerHTML = `
<div class="js__box">绩效
<div data-tips=${1} class="icon__help"></div>
</div>
`
colstd3.innerHTML = `<div>评优</div>`
colstd4.innerHTML = `<div>奖励</div>`
colstd5.innerHTML = `<div>处罚</div>`
tr1.appendChild(colstd1)
tr2.appendChild(colstd2)
tr3.appendChild(colstd3)
tr4.appendChild(colstd4)
tr5.appendChild(colstd5)
tableData.forEach((item, index) => {
// if (index >= 1) {
// return
// }
let td1 = document.createElement('td')
let td2 = document.createElement('td')
let td3 = document.createElement('td')
let td4 = document.createElement('td')
let td5 = document.createElement('td')
td1.style.minWidth = `${itemWidth}px`
td2.style.minWidth = `${itemWidth}px`
td3.style.minWidth = `${itemWidth}px`
td4.style.minWidth = `${itemWidth}px`
td5.style.minWidth = `${itemWidth}px`
// td1.style.width = `${itemWidth}px`
// td2.style.width = `${itemWidth}px`
// td3.style.width = `${itemWidth}px`
// td4.style.width = `${itemWidth}px`
// td5.style.width = `${itemWidth}px`
let a2 = document.createElement('a')
let a3 = document.createElement('a')
let a4 = document.createElement('a')
let a5 = document.createElement('a')
a2.dataset.item = JSON.stringify(item)
a2.dataset.type = 'performance'
a2.href = `#performance${item.year}`
a3.dataset.item = JSON.stringify(item)
a3.dataset.type = 'appraise'
a3.href = `#appraise${item.year}`
a4.dataset.item = JSON.stringify(item)
a4.dataset.type = 'award'
a4.href = `#award${item.year}`
a5.dataset.item = JSON.stringify(item)
a5.dataset.type = 'punish'
a5.href = `#punish${item.year}`
td1.innerHTML = `${item[list.yearShow]}`
a2.innerHTML = `${item[list.performance]}`
a3.innerHTML = `${item[list.appraise]}`
a4.innerHTML = `${item[list.award]}`
a5.innerHTML = `${item[list.punish]}`
td2.appendChild(a2)
td3.appendChild(a3)
td4.appendChild(a4)
td5.appendChild(a5)
tr1.appendChild(td1)
tr2.appendChild(td2)
tr3.appendChild(td3)
tr4.appendChild(td4)
tr5.appendChild(td5)
})
ygjxTable.appendChild(tr1)
// if (performanceArr.length > 0) {
ygjxTable.appendChild(tr2)
// }
// if (appraiseArr.length > 0) {
ygjxTable.appendChild(tr3)
// }
// if (awardArr.length > 0) {
ygjxTable.appendChild(tr4)
// }
// if (punishArr.length > 0) {
ygjxTable.appendChild(tr5)
// }
ygjxTableBox.appendChild(ygjxTable)
bgBox.appendChild(ygjxTableBox)
setTimeout(() => {
createIScroller()
}, 300)
} else {
bgBox.innerHTML = noDataRenderer();
}
return bgBox
}
function switchTabModal(on) {
if (on) {
tabModal.style.display = "block"
if (container.classList.contains('container__scrolling')) {
container.classList.remove('container__scrolling')
}
} else {
tabModal.style.display = 'none'
if (!container.classList.contains('container__scrolling')) {
container.classList.add('container__scrolling')
}
}
}
// 设置员工绩效弹窗
function setUpYGJXModal() {
let modalHeader = document.querySelector('.modal__header')
// 设置头部tab选择
let tabBox = document.createElement('div')
tabBox.classList.add('modal__tab__box')
let tabHTML = ''
// if (performanceArr.length > 0) {
tabHTML += '<li data-index="0" class="modal__tab__active">绩效</li>'
// }
// if (appraiseArr.length > 0) {
tabHTML += '<li data-index="1">评优</li>'
// }
// if (awardArr.length > 0) {
tabHTML += '<li data-index="2">奖励</li>'
// }
// if (punishArr.length > 0) {
tabHTML += '<li data-index="3">处罚</li>'
// }
tabBox.innerHTML = `<ul>${tabHTML}</ul>`
tabBox.onclick = function(e) {
let tabIndex = Number(e.target.dataset.index)
if (isNaN(tabIndex)) {
return
}
modalDidSelectedIndex(tabIndex)
}
modalHeader.appendChild(tabBox)
let yearBox = document.createElement('div')
yearBox.classList.add('year__box')
yearBox.onclick = function(e) {
// console.log('yearBox onclick', e.target.dataset);
let dropdownBox = document.querySelector('.dropdown__content')
if (dropdownBox.style.display == 'block') {
dropdownBox.style.display = 'none'
} else {
dropdownBox.style.display = 'block'
}
let dataset = e.target.dataset
if (dataset.type && dataset.item) {
let selecedMenu = document.querySelector('.seleced_menu')
selecedMenu.innerText = dataset.item
if (dataset.type === '1') {
appraiseMenuSelected = dataset.item
modalPYTabView()
}
if (dataset.type === '2') {
awardMenuSelected = dataset.item
modalJLTabView()
}
if (dataset.type === '3') {
punishMenuSelected = dataset.item
modalCFTabView()
}
}
}
modalHeader.appendChild(yearBox)
// 设置各个标签内容
modalJXTabView()
modalPYTabView()
modalJLTabView()
modalCFTabView()
}
// 弹窗标签选择
function modalDidSelectedIndex(index) {
let tabBox = document.querySelector('.modal__tab__box')
let lis = tabBox.getElementsByTagName('li')
for (var i = 0; i < lis.length; i++) {
lis[i].classList.remove("modal__tab__active")
if (Number(lis[i].dataset.index) === index) {
lis[i].classList.add("modal__tab__active")
}
}
// console.log('modalDidSelectedIndex', index)
let jxTabView = document.querySelector('.modal__jx__view')
let pyTabView = document.querySelector('.modal__py__view')
let jlTabView = document.querySelector('.modal__jl__view')
let cfTabView = document.querySelector('.modal__cf__view')
let yearBox = document.querySelector('.year__box')
// console.log('yearBox', yearBox);
yearBox.style.display = 'none';
jxTabView.style.display = 'none';
pyTabView.style.display = 'none';
jlTabView.style.display = 'none';
cfTabView.style.display = 'none';
if (0 === index) {
jxTabView.style.display = 'block';
jxTabView.scrollTop = 0
} else if (1 === index) {
pyTabView.style.display = 'block';
pyTabView.scrollTop = 0
// 设置下拉菜单
if (appraiseMenu.length > 1) {
let menus = ``
appraiseMenu.forEach((item) => {
menus += `<div data-type='${index}' data-item='${item}'>${item}</div>`
})
yearBox.innerHTML = `<div class="seleced_menu">${appraiseMenuSelected}</div><div class="year__down"></div>
<div class="dropdown__content">${menus}</div>`
yearBox.style.display = 'inline-block';
}
} else if (2 === index) {
jlTabView.style.display = 'block';
jlTabView.scrollTop = 0
// 设置下拉菜单
if (awardMenu.length > 1) {
let menus = ``
awardMenu.forEach((item) => {
menus += `<div data-type='${index}' data-item='${item}'>${item}</div>`
})
yearBox.innerHTML = `<div class="seleced_menu">${awardMenuSelected}</div><div class="year__down"></div>
<div class="dropdown__content">${menus}</div>`
yearBox.style.display = 'inline-block';
}
} else if (3 === index) {
cfTabView.style.display = 'block';
cfTabView.scrollTop = 0
// 设置下拉菜单
if (punishMenu.length > 1) {
let menus = ``
punishMenu.forEach((item) => {
menus += `<div data-type='${index}' data-item='${item}'>${item}</div>`
})
yearBox.innerHTML = `<div class="seleced_menu">${punishMenuSelected}</div><div class="year__down"></div>
<div class="dropdown__content">${menus}</div>`
yearBox.style.display = 'inline-block';
}
}
}
// 弹窗-绩效-标签页
function modalJXTabView() {
let jxTabView = document.querySelector('.modal__jx__view')
if (!jxTabView) {
jxTabView = document.createElement('div')
jxTabView.classList.add('modal__tab__view')
jxTabView.classList.add('modal__jx__view')
let modalBody = document.querySelector('.modal__body')
modalBody.appendChild(jxTabView)
// 设置选中状态
modalBody.onclick = function(e) {
let year = e.target.dataset.year
if (!year) {
return
}
performanceSelected = year
performanceSelectedUpdate()
}
}
let sectionHtml = ``
if (performanceArr && performanceArr.length) {
performanceArr.forEach((item, index) => {
let subSectionHtml = ``
item.children.forEach((childItem, childInde) => {
subSectionHtml += `<li>
<div class="section__content_month">
${childItem.asstype}
</div>
<div class='section__content_grade ${getGradeColor(childItem.assgrade)}'>
${childItem.assgrade}
</div>
</li>`
})
sectionHtml += `<li>
<div id=performance${item.assyear} class="section__title" data-year="${item.assyear}">
<div class="section__title_left" data-year="${item.assyear}">
<div data-year="${item.assyear}"></div>
<div data-year="${item.assyear}">
${item.assyear}
</div>
</div>
<div class='section__title_right ${getGradeColor(item.assgrade)}' data-year="${item.assyear}">
${item.assgrade}${item.gradeNumStr||''}
</div>
</div>
<ul>
${subSectionHtml}
</ul>
</li>`
})
jxTabView.innerHTML = `<ul>${sectionHtml}</ul>`
} else {
jxTabView.innerHTML = noDataRenderer()
}
}
function performanceSelectedUpdate(init) {
// console.log('performanceSelectedUpdate', init);
if (init) {
performanceArr.forEach((item, i) => {
let section = document.querySelector(`.modal__jx__view>ul>li:nth-child(${i+1})`)
let img = section.querySelector('.section__title .section__title_left div:first-child')
let subSection = section.querySelector('ul')
subSection.style.display = 'none'
if (img.classList.contains('icon_02_img')) {
img.classList.remove('icon_02_img')
}
if (img.classList.contains('icon_01_img')) {
img.classList.remove('icon_01_img')
}
if (item.children.length > 0) {
img.classList.add('icon_01_img')
if (item.year == performanceSelected) {
subSection.style.display = 'block'
img.classList.remove('icon_01_img')
img.classList.add('icon_02_img')
}
}
})
} else {
performanceArr.forEach((item, i) => {
if (item.year == performanceSelected) {
let section = document.querySelector(`.modal__jx__view>ul>li:nth-child(${i+1})`)
let img = section.querySelector('.section__title .section__title_left div:first-child')
// console.log('performanceArr', performanceArr);
if (item.children.length > 0) {
if (img.classList.contains('icon_02_img')) {
img.classList.remove('icon_02_img')
img.classList.add('icon_01_img')
} else {
img.classList.remove('icon_01_img')
img.classList.add('icon_02_img')
}
}
let subSection = section.querySelector('ul')
if (subSection.style.display == 'none') {
subSection.style.display = 'block'
} else {
subSection.style.display = 'none'
}
}
})
}
}
function getGradeColor(grade) {
let textColor = ''
if (grade &&
(grade.indexOf('良好') !== -1 ||
grade.indexOf('B') !== -1)) {
textColor = 'grade__greed'
} else if (grade &&
(grade.indexOf('优秀') !== -1 ||
grade.indexOf('A') !== -1)) {
textColor = 'grade__red'
}
return textColor
}
// 弹窗-评优-标签页
function modalPYTabView() {
let pyTabView = document.querySelector('.modal__py__view')
if (!pyTabView) {
pyTabView = document.createElement('div')
pyTabView.classList.add('modal__tab__view')
pyTabView.classList.add('modal__py__view')
let modalBody = document.querySelector('.modal__body')
modalBody.appendChild(pyTabView)
}
if (appraiseArr.length == 0) {
pyTabView.innerHTML = noDataRenderer()
return
}
let data = JSON.parse(JSON.stringify(appraiseArr))
if (appraiseMenuSelected != '全部') {
data = data.filter((item => item.year === appraiseMenuSelected))
}
let sectionHtml = ``
if (data && data.length) {
data.forEach((item, index) => {
let subSectionHtml = ``
item.children.forEach((childItem) => {
subSectionHtml += `<li>
<div> ${childItem.content} </div>
<div> ${childItem.company} </div>
</li>`
})
sectionHtml += `<li style="margin-bottom: 15px;">
<div id=appraise${item.year} class="section__title" data-index="${index}" style="padding: 9px 12px;">
${item.year}
</div>
<ul>
${subSectionHtml}
</ul>
</li>`
})
}
pyTabView.innerHTML = `<ul>${sectionHtml}</ul>`
}
// 弹窗-奖励-标签页
function modalJLTabView(index = 0) {
let jlTabView = document.querySelector('.modal__jl__view')
if (!jlTabView) {
jlTabView = document.createElement('div')
jlTabView.classList.add('modal__tab__view')
jlTabView.classList.add('modal__jl__view')
let modalBody = document.querySelector('.modal__body')
modalBody.appendChild(jlTabView)
}
if (awardArr.length == 0) {
jlTabView.innerHTML = noDataRenderer()
return
}
let data = JSON.parse(JSON.stringify(awardArr))
if (awardMenuSelected != '全部') {
data = data.filter((item => item.year === awardMenuSelected))
}
let sectionHtml = ``
if (data && data.length) {
data.forEach((itemData, index) => {
let subSectionHtml = ``
if (itemData.annualRanking.list.length > 0) {
let itemHtml = ``
itemData.annualRanking.list.forEach((item, index) => {
itemHtml += `<div style="padding:4px 8px"> ${item} </div>`
})
subSectionHtml += `<li>
<div class="rewardpunish__section"><div class="icon__liststyle"></div> ${itemData.annualRanking.title} </div>
${itemHtml}
</li>`
}
if (itemData.annualAward.list.length > 0) {
let itemHtml = ``
itemData.annualAward.list.forEach((item, index) => {
itemHtml += `<div class="rewardpunish__tiem">
<div >
<div>${itemData.year}${item.awards}</div>
<div>${item.project}</div>
</div>
<div>评定单位:${item.publish}</div>
</div>`
})
subSectionHtml += `<li>
<div class="rewardpunish__section"><div class="icon__liststyle"></div> ${itemData.annualAward.title} </div>
${itemHtml}
</li>`
}
if (itemData.dailyAward.list.length > 0) {
let itemHtml = ``
itemData.dailyAward.list.forEach((item, index) => {
itemHtml += `<div class="daily__section"><div class="daily__mark2"></div> ${item.title} </div>`
if (item.children) {
item.children.forEach((itemChild) => {
itemHtml += `<div class="daily__item">
<div>${itemChild.rewardpunish} </div>
<div>${itemChild.rewardunit||''} </div>
</div>`
})
}
})
subSectionHtml += `<li>
<div class="rewardpunish__section"><div class="icon__liststyle"></div> ${itemData.dailyAward.title} </div>
${itemHtml}
</li>`
}
sectionHtml += `<li style="margin-bottom: 15px;">
<div id="award${itemData.year}" class="section__title" style="padding: 9px 12px;">
${itemData.year}
</div>
<ul>
${subSectionHtml}
</ul>
</li>`
})
}
jlTabView.innerHTML = `<ul>${sectionHtml}</ul>`
}
// 弹窗-处罚-标签页
function modalCFTabView() {
let cfTabView = document.querySelector('.modal__cf__view')
if (!cfTabView) {
cfTabView = document.createElement('div')
cfTabView.classList.add('modal__tab__view')
cfTabView.classList.add('modal__cf__view')
let modalBody = document.querySelector('.modal__body')
modalBody.appendChild(cfTabView)
}
if (punishArr.length == 0) {
cfTabView.innerHTML = noDataRenderer()
return
}
let data = JSON.parse(JSON.stringify(punishArr))
if (punishMenuSelected != '全部') {
data = data.filter((item => item.year === punishMenuSelected))
}
let sectionHtml = ``
if (data && data.length) {
data.forEach((itemData, index) => {
let subSectionHtml = ``
if (itemData.annualPunish.list.length > 0) {
let itemHtml = ``
itemData.annualPunish.list.forEach((item, index) => {
itemHtml += `<div class="rewardpunish__tiem">
<div >
<div>${itemData.year}${item.awards}</div>
<div>${item.project}</div>
</div>
<div>评定单位:${item.publish}</div>
</div>`
})
subSectionHtml += `<li>
<div class="rewardpunish__section"><div class="icon__liststyle"></div> ${itemData.annualPunish.title} </div>
${itemHtml}
</li>`
}
if (itemData.dailyPunish.list.length > 0) {
let itemHtml = ``
itemData.dailyPunish.list.forEach((item, index) => {
itemHtml += `<div class="daily__section"><div class="daily__mark2"></div> ${item.title} </div>`
if (item.children) {
item.children.forEach((itemChild) => {
itemHtml += `<div class="daily__item">
<div>${itemChild.rewardpunish} </div>
<div>${itemChild.rewardunit||''} </div>
</div>`
})
}
})
subSectionHtml += `<li>
<div class="rewardpunish__section"><div class="icon__liststyle"></div> ${itemData.dailyPunish.title} </div>
${itemHtml}
</li>`
}
sectionHtml += `<li style="margin-bottom: 15px;">
<div id=punish${itemData.year} class="section__title" style="padding: 9px 12px;">
${itemData.year}
</div>
<ul>
${subSectionHtml}
</ul>
</li>`
})
}
cfTabView.innerHTML = `<ul>${sectionHtml}</ul>`
}
// 绩效数据分组
function performanceGroups(arr) {
let map = {},
dest = [];
for (var i = 0; i < arr.length; i++) {
var ai = arr[i];
if (!map[ai.assyear]) {
dest.push({
year: ai.assyear,
assyear: ai.assyear,
children: [ai],
});
map[ai.assyear] = ai;
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j];
if (dj.assyear == ai.assyear) {
dj.children.push(ai);
break;
}
}
}
}
dest = dest.sort((a, b) => {
return b.year - a.year
})
// 设置父级字段
dest.forEach((item) => {
item['assgrade'] = ''
item['gradeNumStr'] = ''
console.log(item.children)
let childrenList = [...item.children]
let tmpList = []
childrenList.forEach((childItem, index) => {
// console.log(childItem)
if (childItem.asstype == '年度') {
item['assgrade'] = childItem.assgrade
// 年度子项中不显示
return
}
let month = Number(childItem.assendtime.substr(5, 2))
if (childItem.asstype === "半年度") {
if (month <= 6) {
childItem.asstype = '上半年度'
} else {
childItem.asstype = '下半年度'
}
} else if (childItem.asstype === "季度") {
// console.log(childItem);
if (month <= 3) {
childItem.asstype = '第一季度'
} else if (month <= 6) {
childItem.asstype = '第二季度'
} else if (month <= 9) {
childItem.asstype = '第三季度'
} else {
childItem.asstype = '第四季度'
}
} else if (childItem.asstype === "月度") {
childItem.asstype = `${month}月`
}
tmpList.push(childItem)
})
item.children = tmpList
// 统计除年度等级
let childMap = {},
childDest = [];
for (var i = 0; i < tmpList.length; i++) {
var ai = childrenList[i];
if (!childMap[ai.assgrade]) {
childDest.push({
assgrade: ai.assgrade,
assgradenumber: Number(ai.assgradenumber),
children: [ai],
});
childMap[ai.assgrade] = ai;
} else {
for (var j = 0; j < childDest.length; j++) {
var dj = childDest[j];
if (dj.assgrade == ai.assgrade) {
dj.children.push(ai);
break;
}
}
}
}
// console.log('childDest', childDest);
if (childDest.length > 0) {
childDest = childDest.sort((a, b) => a.assgradenumber - b.assgradenumber)
let grades = [],
total = 0
childDest.forEach((item) => {
total = total + item.children.length
grades.push(`${item.children.length}${item.assgrade}`)
})
item['gradeNumStr'] = `(${grades.join('、')}/共${total}次)`
}
})
return dest
}
function appraiseGroups(arr) {
let map = {},
dest = [];
for (var i = 0; i < arr.length; i++) {
var ai = arr[i];
if (!map[ai.year]) {
dest.push({
year: ai.year,
children: [ai],
});
map[ai.year] = ai;
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j];
if (dj.year == ai.year) {
dj.children.push(ai);
break;
}
}
}
}
dest = dest.sort((a, b) => {
return b.year - a.year
})
return dest
}
// 区分:奖励、处罚
function rewardpunishGroups(arr) {
if (!arr || arr.length == 0) {
return []
}
arr.forEach(item => {
// item.spetype === '年度专业排名' || item.spetype === '营运类奖'
if (item.spetype.indexOf("排名") != -1 || item.spetype.indexOf("奖") != -1) {
item.state = '奖励'
} else {
item.state = '处罚'
}
})
let map = {},
dest = [];
for (var i = 0; i < arr.length; i++) {
var ai = arr[i];
if (!map[ai.state]) {
dest.push({
state: ai.state,
children: [ai],
});
map[ai.state] = ai;
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j];
if (dj.state == ai.state) {
dj.children.push(ai);
break;
}
}
}
}
return dest
}
// 奖励分组
function rewardGroups(arr, flowers) {
// 奖励分组
let map = {},
dest = [];
for (var i = 0; i < arr.length; i++) {
var ai = arr[i];
if (!map[ai.year]) {
dest.push({
year: ai.year,
children: [ai],
});
map[ai.year] = ai;
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j];
if (dj.year == ai.year) {
dj.children.push(ai);
break;
}
}
}
}
dest = dest.sort((a, b) => {
return b.year - a.year
})
// 营销小红花按年分组
/*
let flowerMap = {},
flowerDest = [];
for (var i = 0; i < flowers.length; i++) {
var ai = flowers[i];
if (!flowerMap[ai.year]) {
flowerDest.push({
year: ai.year,
children: [ai],
});
flowerMap[ai.year] = ai;
} else {
for (var j = 0; j < flowerDest.length; j++) {
var dj = flowerDest[j];
if (dj.year == ai.year) {
dj.children.push(ai);
break;
}
}
}
}
// console.log('flowerDest', flowerDest);
flowerDest.forEach((item) => {
item['amount'] = 0
item.children.forEach((childItem) => {
item['amount'] = item['amount'] + Number(childItem.amount)
})
})
*/
dest.forEach((item) => {
item['annualRanking'] = {
title: '年度专项排名:',
list: []
}
item['annualAward'] = {
title: '年度专项奖励:',
list: []
}
item['dailyAward'] = {
title: '日常专项奖励:',
list: []
}
let dailyArr = []
item.children.forEach((childItem) => {
// if (Number(childItem.month) == 1) { // 年度
if (childItem.spetype.indexOf("排名") != -1) {
item.annualRanking.list.push(${childItem.ranking}`)
}
if (childItem.spetype.indexOf("奖") != -1) {
// item.annualAward.list.push(`· ${childItem.rewardpunish}`)
item.annualAward.list.push({
awards: childItem.rewardpunish, //'奖项',
project: childItem.awardunit, // '获奖项目、获奖单位',
publish: childItem.unit //'颁奖单位'
})
}
// }
/*
else if (Number(childItem.month) == 2) { // 日常
if (childItem.rewardpunish) {
dailyArr.push(childItem)
}
}
*/
})
/*
flowerDest.forEach((flowerItem) => {
if (item.year == flowerItem.year) {
let flower = {
title: `营销小红花:${flowerItem.amount} 朵<div class="flower"></div>`,
}
item.dailyAward.list.push(flower)
}
})
item.dailyAward.list = item.dailyAward.list.concat(rewardtypeGroups(dailyArr))
*/
})
return dest
}
function rewardtypeGroups(arr) {
let map = {},
dest = [];
arr.forEach((item) => {
item['title'] = item.rewardtype
})
for (var i = 0; i < arr.length; i++) {
var ai = arr[i];
if (!map[ai.title]) {
dest.push({
title: ai.title,
rewardsort: Number(ai.rewardsort),
children: [ai],
});
map[ai.title] = ai;
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j];
if (dj.title == ai.title) {
dj.children.push(ai);
break;
}
}
}
}
dest = dest.sort((a, b) => a.rewardsort - b.rewardsort)
return dest
}
// 处罚分组
function punishGroups(arr) {
let map = {},
dest = [];
for (var i = 0; i < arr.length; i++) {
var ai = arr[i];
if (!map[ai.year]) {
dest.push({
year: ai.year,
children: [ai],
});
map[ai.year] = ai;
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j];
if (dj.year == ai.year) {
dj.children.push(ai);
break;
}
}
}
}
dest = dest.sort((a, b) => {
return b.year - a.year
})
dest.forEach((item) => {
item['annualPunish'] = {
title: '年度专项处罚:',
list: []
}
item['dailyPunish'] = {
title: '日常专项处罚:',
list: []
}
let dailyArr = []
item.children.forEach((childItem) => {
// if (Number(childItem.month) == 1) { // 年度
if (childItem.spetype.indexOf("罚") != -1) {
// item.annualPunish.list.push(`· ${childItem.rewardpunish}`)
item.annualPunish.list.push({
awards: childItem.rewardpunish, //'奖项',
project: childItem.awardunit, // '获奖项目、获奖单位',
publish: childItem.unit //'颁奖单位'
})
}
// }
/*
else if (Number(childItem.month) == 2) { // 日常
if (childItem.rewardpunish) {
dailyArr.push(childItem)
// item.dailyPunish.list.push(`· ${childItem.rewardpunish}`)
}
}
*/
})
item.dailyPunish.list = rewardtypeGroups(dailyArr)
})
return dest
}
function changeSelect() {
let icon_img = document.getElementsByClassName('icon_img');
for (let i = 0; i < icon_img.length; i++) {
let clickNode = icon_img[i].nextElementSibling;
listenerChange(icon_img[i], clickNode, i);
}
}
function listenerChange(target, clickNode, i) {
clickNode.addEventListener('click', () => {
let second_box = document.getElementsByClassName('second-box');
let sNode = second_box[i];
// let wrap_content = document.getElementsByClassName('wrap_content');
if (target.className.indexOf('icon_01_img') > -1) {
target.classList.remove('icon_01_img')
target.classList.add('icon_02_img')
sNode.style.display = 'block'
} else {
target.classList.remove('icon_02_img')
target.classList.add('icon_01_img')
sNode.style.display = 'none'
}
eleHideShrinkExtend()
});
}
function listDRenderer(list, data) {
console.log(111, data)
let temp = ``;
if (data && data.length) {
data.forEach((item, index) => {
temp +=
`<div>
<div class="frist-row flex-between">
<div class="flex-row">
${item.children.length>0? `<div class="icon_img ${index==0?'icon_02_img':'icon_01_img'}"></div>`:''}
<div>${item.assyear}</div>
</div>
<div>${item.assgrade}</div>
</div>`
temp += `<div class="second-box ${index==0?'box-block':'box-none'}">`
item.children && item.children.forEach((item1) => {
temp +=
`<div class="second-row flex-between">
<div class="flex-start">
<div class="title-text">${item1.asstype}</div>
</div>
<div>${item1.assgrade}</div>
</div>`
// item1.children&&item1.children.forEach((item2)=>{
// temp +=
// `<div class="third-row flex-between">
// <div class="flex-start">
// <div class="title-text"><span class="dot-icon">·</span>${item2[list.title]}</div>
// </div>
// <div>${item2[list.note]}</div>
// </div>`
// })
})
temp += `</div>`
temp += `</div>`
});
} else {
temp = noDataRenderer();
}
console.log(646)
return renderWrap(temp, data.length > 3);
}
// 物业
function propertyListARenderer(list, data, extra = '') {
let temp = document.createElement('div');
temp.classList.add('item__wrap');
for (let name in list) {
let value;
let title;
if (list[name] instanceof Object) {
if (name.indexOf('&') !== -1) {
let names = name.split('&');
title = `${data[names[0]] || '未知'}-${
data[names[1]] || '未知'
}`;
} else {
title = data[name];
}
let t1 = data[list[name][0]];
let t2 = data[list[name][1]];
value = `${t1}${nowOrNot(t2)}`;
} else {
title = list[name];
value = data[name];
}
temp.innerHTML += propertyItemRenderer(
title || '未知',
value || '无',
'light'
);
}
return temp;
}
function propertyListBRenderer(list, data) {
let temp = ``;
if (data && data.length) {
data.forEach((item, index) => {
let sub = '';
let note = list.note;
if (list.subTitle) {
list.subTitle.forEach((s, i) => {
sub += (i && '|') || '';
sub += item[s] || '无';
});
}
if (note instanceof Object && note.length) {
let t1 = data[index][list.note[0]];
let t2 = data[index][list.note[1]];
temp +=
`<div class="item_main"><div class="item__content work">${
item[list.title] || '无'
}</div>` +
propertyItemRenderer(
`<p class="item__content-sub-title">${sub}</p>`,
`<p class="item__content-note">${t1}${nowOrNot(
t2
)}</p>`
) +
`</div>`;
} else {
temp += propertyItemRenderer(
`${
item[list.title]
}<p class="item__content-sub-title">${sub}</p>`,
`<p class="item__content-note">${item[note]}</p>`
);
}
});
} else {
temp = noDataRenderer();
}
return renderWrap(temp, data.length > 3);
}
function propertyListCRenderer(list, data) {
let temp = ``;
if (data && data.length) {
data.forEach((item, index) => {
let sub = '';
list.subTitle.forEach((s, i) => {
switch (i) {
case 1:
sub += (i && ' | ') || '';
if (item[s] === '无' || !item[s]) {
item[s] = '无学历';
}
sub += item[s];
break;
case 2:
sub += (i && ' | ') || '';
if (item[s] === '无' || !item[s]) {
sub += '无学位';
} else {
sub += item[s];
}
break;
default:
sub += (i && ' | ') || '';
sub += item[s] || '无';
break;
}
});
temp += propertyItemRenderer(
`${item[list.title]}
<p class="item__content-sub-title">${sub}</p><p class="item__content-sub-title">毕业于${
item[list.note]
}</p>`,
'',
'edu long-title '
);
});
} else {
temp = noDataRenderer();
}
return renderWrap(temp, data.length > 3);
}
function propertyListDRenderer(list, data) {
let temp = ``;
if (data && data.length) {
data.forEach((item, index) => {
let sub = '';
let note = list.note;
// console.log(list);
if (list.subTitle) {
list.subTitle.forEach((s, i) => {
sub += (i && '|') || '';
sub += item[s] || '无';
});
}
if (note instanceof Object && note.length) {
let t1 = data[index][list.note[0]];
let t2 = data[index][list.note[1]];
temp += propertyItemRenderer(
`${
item[list.title]
}<p class="item__content-sub-title">${sub}</p>`,
`<span class="item__content-note">${t1}${nowOrNot(
t2
)}</span>`
);
} else {
temp += propertyItemRenderer(
`${item[list.title]}年`,
`<span class="item__content-note">${item[note]}</span>`
);
}
});
} else {
temp = noDataRenderer();
}
return renderWrap(temp, data.length > 3);
}
function propertyListERenderer(list, data) {
let temp = ``;
if (data && data.length) {
data.forEach((item, index) => {
let sub = '';
list.subTitle.forEach((s, i) => {
sub += `<p class="item__content-sub-title">${list.subTitleName[i]}${item[s]}</p>`;
});
temp += propertyItemRenderer(
`${item[list.title]} | ${
item[list.title1]
}<span style="float: right;padding-right:16px">${
item[list.title2]
}</span>
${sub}`,
'',
'edu long-title '
);
});
} else {
temp = noDataRenderer();
}
return renderWrap(temp, data.length > 3);
}
function propertyListFRenderer(list, data) {
let temp = ``;
if (data && data.length) {
data.forEach((item, index) => {
temp += propertyItemRenderer(
`${
item[list.title]
}<span style="float: right;padding-right:16px">${
item[list.title1]
}</span>
<p class="item__content-sub-title">${
item[list.subTitle]
}<span style="float: right;padding-right:12px">${
item[list.subTitle1]
}年度</span></p>`,
'',
'edu long-title '
);
});
} else {
temp = noDataRenderer();
}
return renderWrap(temp, data.length > 3);
}
function noDataRenderer() {
return `<div class="item__content empty">暂无数据</div>`;
}
function renderNoWrap(content, needExpand) {
console.log(23143214, needExpand)
let wrap = document.createElement('div');
let wrap_content = document.createElement('div');
wrap.classList.add('item__wrap');
wrap_content.classList.add('wrap_content_shrink');
wrap_content.innerHTML = content;
wrap.appendChild(wrap_content);
if (needExpand) {
let ctrl = document.createElement('div');
ctrl.id = Math.random();
ctrl.classList.add('item__content');
ctrl.classList.add('item__content-clickable');
ctrl.innerHTML = `<span class="item__wrap-control-icon">`;
wrap.appendChild(ctrl);
}
return wrap;
}
function renderWrap(content, needExpand) {
let wrap = document.createElement('div');
let wrap_content = document.createElement('div');
wrap.classList.add('item__wrap');
wrap_content.classList.add('wrap_content');
wrap_content.innerHTML = content;
wrap.appendChild(wrap_content);
if (needExpand) {
let ctrl = document.createElement('div');
ctrl.id = Math.random();
ctrl.classList.add('item__content');
ctrl.classList.add('item__content-clickable');
ctrl.innerHTML = `<span class="item__wrap-control-icon">`;
wrap.appendChild(ctrl);
}
return wrap;
}
function renderPhoto() {
items = [];
let img = photo.querySelector('img');
let item = {
src: photoUrl,
w: img.naturalWidth,
h: img.naturalHeight,
};
img.src = photoUrl;
img.onload = function() {
item.w = img.naturalWidth;
item.h = img.naturalHeight;
};
items.push(item);
}
const toast = document.getElementById('toast');
const toastContent = toast.querySelector('.toast-content');
let toastShow = false;
function showToast(txt) {
toastContent.innerHTML = txt;
toast.classList.add('toast_show');
if (toastShow) {
clearTimeout(toastShow);
}
toastShow = setTimeout(() => {
toast.classList.remove('toast_show');
}, 2000);
}
function attachAtivated(element) {
let els = (typeof element === 'string' &&
document.querySelectorAll(element)) || [element];
Array.from(els).forEach(el => {
el.addEventListener('touchstart', function() {
this.classList.add('activated');
});
el.addEventListener('touchmove', function() {
this.classList.remove('activated');
});
el.addEventListener('touchend', function() {
this.classList.remove('activated');
});
});
}
function getDateFormat(date) {
// let year = now.getFullYear(); // 得到年份
// let month = now.getMonth(); // 得到月份
// let date = now.getDate(); // 得到日期
}
function filter(item, data) {
let assessData = data;
// 处理绩效异常
if (item === 'assessVoList') {
if (data.length === 0) {
assessData = '';
} else {
for (let i = 0; i < assessData.length; i++) {
if (!assessData[i].assgrade) {
assessData = '';
break;
}
}
}
}
return assessData;
}
function eleHide() {
let wrap_content = document.getElementsByClassName('wrap_content');
for (let i = 0; i < wrap_content.length; i++) {
if (wrap_content[i].childNodes.length > 3) {
let clickNode = wrap_content[i].nextElementSibling;
wrapContent(wrap_content[i], clickNode);
}
}
}
function eleHideShrink(type) {
let wrap_content_shrink = document.getElementsByClassName('wrap_content_shrink');
for (let i = 0; i < wrap_content_shrink.length; i++) {
if (wrap_content_shrink[i].childNodes.length > 3) {
let clickNode = wrap_content_shrink[i].nextElementSibling;
wrapContentShrink(wrap_content_shrink[i], clickNode, type);
}
}
}
function wrapContent(target, clickNode, num = 3) {
console.log('wrapContent');
let item = target.childNodes;
let allHeight = target.offsetHeight + 'px';
let showEleHeight = 0;
for (let i = 0; i < num; i++) {
showEleHeight += item[i].offsetHeight;
if (i === num - 1) {
showEleHeight += 'px';
}
}
target.style.height = showEleHeight;
target.style.transitionDuration = target.offsetHeight / 150 + 's';
clickNode.addEventListener('click', () => {
if (target.style.height == showEleHeight) {
target.parentNode.classList.add('expand');
target.style.height = allHeight;
} else {
target.style.height = showEleHeight;
target.parentNode.classList.remove('expand');
}
});
attachAtivated(clickNode);
}
function wrapContentShrink(target, clickNode, type, num = 3) {
console.log(535656, )
let item = target.childNodes;
let showEleHeight = 0;
for (let i = 0; i < num; i++) {
showEleHeight += item[i].offsetHeight;
if (i === num - 1) {
showEleHeight += 'px';
}
}
if (target.parentNode.className.indexOf('expand') > -1) {
target.parentNode.classList.remove('expand');
target.style.height = showEleHeight;
} else {
target.style.height = showEleHeight;
}
target.style.transitionDuration = target.offsetHeight / 150 + 's';
clickNode.addEventListener('click', () => {
console.log(4555, target.style.height)
if (target.parentNode.className.indexOf('expand') === -1) {
target.parentNode.classList.toggle('expand');
target.style = '';
} else {
target.style.height = '150px';
target.parentNode.classList.toggle('expand');
}
});
attachAtivated(clickNode);
}
function eleHideShrinkExtend() {
let wrap_content_shrink = document.getElementsByClassName('wrap_content_shrink');
for (let i = 0; i < wrap_content_shrink.length; i++) {
if (wrap_content_shrink[i].childNodes.length > 3) {
let clickNode = wrap_content_shrink[i];
wrapContentExtend(wrap_content_shrink[i], clickNode);
}
}
}
function wrapContentExtend(target, clickNode, num = 3) {
let item = target.childNodes;
let allHeight = target.offsetHeight + 'px';
let showEleHeight = 0;
for (let i = 0; i < num; i++) {
showEleHeight += item[i].offsetHeight;
if (i === num - 1) {
showEleHeight += 'px';
}
}
console.log(555, target.style.height, showEleHeight, target.parentNode.className.indexOf('expand'))
if (target.parentNode.className.indexOf('expand') > -1) {
target.parentNode.classList.remove('expand');
target.style.height = showEleHeight;
} else {
target.style.height = showEleHeight;
}
target.style.transitionDuration = target.offsetHeight / 150 + 's';
}
let scroller = null;
let Selector = "";
function createIScroller() {
Selector = '.ygjx_table_box';
scroller = new IScroll(Selector, {
preventDefault: false, // 阻止浏览器滑动默认行为
probeType: 3, //需要使用 iscroll-probe.js 才能生效 probeType : 1 滚动不繁忙的时候触发 probeType : 2 滚动时每隔一定时间触发 probeType : 3 每滚动一像素触发一次
mouseWheel: true, //是否监听鼠标滚轮事件。
scrollX: true, // 启动x轴滑动
scrollY: true, // 启���y轴滑动
// momentum: false,
lockDirection: false,
snap: false, //自动分割容器,用于制作走马灯效果等。Options.snap:true// 根据容器尺寸自动分割
//snapSpeed: 400,
scrollbars: false, //是否显示默认滚动条
freeScroll: true, //主要在上下左右滚动都生效时使用,可以向任意方向滚动。
deceleration: 0.0001, //滚动动量减速越大越快,建议不大于 0.01,默认:0.0006
disableMouse: true, //是否关闭鼠标事件探测。如知道运行在哪个平台,可以开启它来加速。
disablePointer: true, //是否关闭指针事件探测。如知道运行在哪个平台,可以开启它来加速。
disableTouch: false, //是否关闭触摸事件探测。如知道运行在哪个平台,可以开启它来加速。
eventPassthrough: false, //使用 IScroll 的横轴滚动时,如想使用系统立轴滚动并在横轴上生效,请开启。
bounce: false //是否启用弹力动画效果,关掉可以加速
});
scroller.on('scroll', updatePosition);
scroller.on('scrollEnd', updatePosition);
scroller.on('beforeScrollStart', function() {
scroller.refresh();
});
function updatePosition() {
let frozenCols = document.querySelectorAll(Selector + ' table tr td.cols');
for (let i = 0; i < frozenCols.length; i++) {
frozenCols[i].style.transform = 'translate(' + -1 * this.x + 'px, 0px) translateZ(0px)';
}
}
// return scroller;
}
let ready = false
let config = window.config || {}
function doReady (fn) {
if (sessionStorage.getItem(config.appName)) {
app.exit().catch(err => {
console.error(err)
})
}
ready = true
sessionStorage.setItem(config.appName, ready)
fn.apply(window)
}
const MODULE_NAMES = {
MIDEA_COMMON: 'MideaCommon',
MIDEA_USER: 'MideaUser',
MIDEA_BARCODE: 'MideaBarcode',
MIDEA_MAP: 'MideaMap',
MIDEA_ANNTO: 'MideaAnnto',
MIDEA_SALE: 'MideaSale'
}
const app = {
/**
* 监听设备准备
* @param {any} fn 回调
*/
ready (fn, prod) {
if (!ready && prod) {
window.document.addEventListener('deviceready', () => {
doReady(fn)
}, false)
} else {
doReady(fn)
}
},
/**
* 调用cordova对象的exec方法
* @param module 所属模块
* @param method 方法名称
* @param params 附带参数
* @return {Promise}
*/
callApi (module, method, params) {
return new Promise((resolve, reject) => {
if (window.cordova) {
cordova.exec(function (msg) {
resolve(msg)
}, function (msg) {
reject(msg)
}, module, method, params || [])
} else {
reject('cordova is not exist.')
}
})
},
/**
* 从获取用户信息
* @returns {Promise}
*/
getUser () {
return app.callApi(MODULE_NAMES.MIDEA_USER, 'getUser')
},
/**
* 跳转到目标app
*/
jumpToView () {
let appHref = config.appHref
window.location.replace(appHref)
},
/**
* 退出应用
* @returns {Promise}
*/
exit () {
return app.callApi(MODULE_NAMES.MIDEA_COMMON, 'exit', [])
},
statusBarColor (r, g, b, a) {
return app.callApi(MODULE_NAMES.MIDEA_COMMON, 'statusBarColor', [r, g, b, a])
},
getExtra (id) {
return app.callApi(MODULE_NAMES.MIDEA_COMMON, 'getExtra', [id])
},
saveToGallery (url) {
return app.callApi(MODULE_NAMES.MIDEA_COMMON, 'saveToGallery', [url])
}
}
export default app
;(function () {
'use strict';
/**
* @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
*
* @codingstandard ftlabs-jsv2
* @copyright The Financial Times Limited [All Rights Reserved]
* @license MIT License (see LICENSE.txt)
*/
/*jslint browser:true, node:true*/
/*global define, Event, Node*/
/**
* Instantiate fast-clicking listeners on the specified layer.
*
* @constructor
* @param {Element} layer The layer to listen on
* @param {Object} [options={}] The options to override the defaults
*/
function FastClick(layer, options) {
var oldOnClick;
options = options || {};
/**
* Whether a click is currently being tracked.
*
* @type boolean
*/
this.trackingClick = false;
/**
* Timestamp for when click tracking started.
*
* @type number
*/
this.trackingClickStart = 0;
/**
* The element being tracked for a click.
*
* @type EventTarget
*/
this.targetElement = null;
/**
* X-coordinate of touch start event.
*
* @type number
*/
this.touchStartX = 0;
/**
* Y-coordinate of touch start event.
*
* @type number
*/
this.touchStartY = 0;
/**
* ID of the last touch, retrieved from Touch.identifier.
*
* @type number
*/
this.lastTouchIdentifier = 0;
/**
* Touchmove boundary, beyond which a click will be cancelled.
*
* @type number
*/
this.touchBoundary = options.touchBoundary || 10;
/**
* The FastClick layer.
*
* @type Element
*/
this.layer = layer;
/**
* The minimum time between tap(touchstart and touchend) events
*
* @type number
*/
this.tapDelay = options.tapDelay || 200;
/**
* The maximum time for a tap
*
* @type number
*/
this.tapTimeout = options.tapTimeout || 700;
if (FastClick.notNeeded(layer)) {
return;
}
// Some old versions of Android don't have Function.prototype.bind
function bind(method, context) {
return function() { return method.apply(context, arguments); };
}
var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
var context = this;
for (var i = 0, l = methods.length; i < l; i++) {
context[methods[i]] = bind(context[methods[i]], context);
}
// Set up event handlers as required
if (deviceIsAndroid) {
layer.addEventListener('mouseover', this.onMouse, true);
layer.addEventListener('mousedown', this.onMouse, true);
layer.addEventListener('mouseup', this.onMouse, true);
}
layer.addEventListener('click', this.onClick, true);
layer.addEventListener('touchstart', this.onTouchStart, false);
layer.addEventListener('touchmove', this.onTouchMove, false);
layer.addEventListener('touchend', this.onTouchEnd, false);
layer.addEventListener('touchcancel', this.onTouchCancel, false);
// Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
// which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
// layer when they are cancelled.
if (!Event.prototype.stopImmediatePropagation) {
layer.removeEventListener = function(type, callback, capture) {
var rmv = Node.prototype.removeEventListener;
if (type === 'click') {
rmv.call(layer, type, callback.hijacked || callback, capture);
} else {
rmv.call(layer, type, callback, capture);
}
};
layer.addEventListener = function(type, callback, capture) {
var adv = Node.prototype.addEventListener;
if (type === 'click') {
adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
if (!event.propagationStopped) {
callback(event);
}
}), capture);
} else {
adv.call(layer, type, callback, capture);
}
};
}
// If a handler is already declared in the element's onclick attribute, it will be fired before
// FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
// adding it as listener.
if (typeof layer.onclick === 'function') {
// Android browser on at least 3.2 requires a new reference to the function in layer.onclick
// - the old one won't work if passed to addEventListener directly.
oldOnClick = layer.onclick;
layer.addEventListener('click', function(event) {
oldOnClick(event);
}, false);
layer.onclick = null;
}
}
/**
* Windows Phone 8.1 fakes user agent string to look like Android and iPhone.
*
* @type boolean
*/
var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
/**
* Android requires exceptions.
*
* @type boolean
*/
var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;
/**
* iOS requires exceptions.
*
* @type boolean
*/
var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
/**
* iOS 4 requires an exception for select elements.
*
* @type boolean
*/
var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
/**
* iOS 6.0-7.* requires the target element to be manually derived
*
* @type boolean
*/
var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent);
/**
* BlackBerry requires exceptions.
*
* @type boolean
*/
var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
/**
* Determine whether a given element requires a native click.
*
* @param {EventTarget|Element} target Target DOM element
* @returns {boolean} Returns true if the element needs a native click
*/
FastClick.prototype.needsClick = function(target) {
switch (target.nodeName.toLowerCase()) {
// Don't send a synthetic click to disabled inputs (issue #62)
case 'button':
case 'select':
case 'textarea':
if (target.disabled) {
return true;
}
break;
case 'input':
// File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
if ((deviceIsIOS && target.type === 'file') || target.disabled) {
return true;
}
break;
case 'label':
case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames
case 'video':
return true;
}
return (/\bneedsclick\b/).test(target.className);
};
/**
* Determine whether a given element requires a call to focus to simulate click into element.
*
* @param {EventTarget|Element} target Target DOM element
* @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
*/
FastClick.prototype.needsFocus = function(target) {
switch (target.nodeName.toLowerCase()) {
case 'textarea':
return true;
case 'select':
return !deviceIsAndroid;
case 'input':
switch (target.type) {
case 'button':
case 'checkbox':
case 'file':
case 'image':
case 'radio':
case 'submit':
return false;
}
// No point in attempting to focus disabled inputs
return !target.disabled && !target.readOnly;
default:
return (/\bneedsfocus\b/).test(target.className);
}
};
/**
* Send a click event to the specified element.
*
* @param {EventTarget|Element} targetElement
* @param {Event} event
*/
FastClick.prototype.sendClick = function(targetElement, event) {
var clickEvent, touch;
// On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
if (document.activeElement && document.activeElement !== targetElement) {
document.activeElement.blur();
}
touch = event.changedTouches[0];
// Synthesise a click event, with an extra attribute so it can be tracked
clickEvent = document.createEvent('MouseEvents');
clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
clickEvent.forwardedTouchEvent = true;
targetElement.dispatchEvent(clickEvent);
};
FastClick.prototype.determineEventType = function(targetElement) {
//Issue #159: Android Chrome Select Box does not open with a synthetic click event
if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
return 'mousedown';
}
return 'click';
};
/**
* @param {EventTarget|Element} targetElement
*/
FastClick.prototype.focus = function(targetElement) {
var length;
// Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month' && targetElement.type !== 'email') {
length = targetElement.value.length;
targetElement.setSelectionRange(length, length);
} else {
targetElement.focus();
}
};
/**
* Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
*
* @param {EventTarget|Element} targetElement
*/
FastClick.prototype.updateScrollParent = function(targetElement) {
var scrollParent, parentElement;
scrollParent = targetElement.fastClickScrollParent;
// Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
// target element was moved to another parent.
if (!scrollParent || !scrollParent.contains(targetElement)) {
parentElement = targetElement;
do {
if (parentElement.scrollHeight > parentElement.offsetHeight) {
scrollParent = parentElement;
targetElement.fastClickScrollParent = parentElement;
break;
}
parentElement = parentElement.parentElement;
} while (parentElement);
}
// Always update the scroll top tracker if possible.
if (scrollParent) {
scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
}
};
/**
* @param {EventTarget} targetElement
* @returns {Element|EventTarget}
*/
FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
// On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
if (eventTarget.nodeType === Node.TEXT_NODE) {
return eventTarget.parentNode;
}
return eventTarget;
};
/**
* On touch start, record the position and scroll offset.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onTouchStart = function(event) {
var targetElement, touch, selection;
// Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
if (event.targetTouches.length > 1) {
return true;
}
targetElement = this.getTargetElementFromEventTarget(event.target);
touch = event.targetTouches[0];
if (deviceIsIOS) {
// Only trusted events will deselect text on iOS (issue #49)
selection = window.getSelection();
if (selection.rangeCount && !selection.isCollapsed) {
return true;
}
if (!deviceIsIOS4) {
// Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
// when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
// with the same identifier as the touch event that previously triggered the click that triggered the alert.
// Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
// immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
// Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string,
// which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long,
// random integers, it's safe to to continue if the identifier is 0 here.
if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
event.preventDefault();
return false;
}
this.lastTouchIdentifier = touch.identifier;
// If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
// 1) the user does a fling scroll on the scrollable layer
// 2) the user stops the fling scroll with another tap
// then the event.target of the last 'touchend' event will be the element that was under the user's finger
// when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
// is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
this.updateScrollParent(targetElement);
}
}
this.trackingClick = true;
this.trackingClickStart = event.timeStamp;
this.targetElement = targetElement;
this.touchStartX = touch.pageX;
this.touchStartY = touch.pageY;
// Prevent phantom clicks on fast double-tap (issue #36)
if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
event.preventDefault();
}
return true;
};
/**
* Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.touchHasMoved = function(event) {
var touch = event.changedTouches[0], boundary = this.touchBoundary;
if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
return true;
}
return false;
};
/**
* Update the last position.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onTouchMove = function(event) {
if (!this.trackingClick) {
return true;
}
// If the touch has moved, cancel the click tracking
if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
this.trackingClick = false;
this.targetElement = null;
}
return true;
};
/**
* Attempt to find the labelled control for the given label element.
*
* @param {EventTarget|HTMLLabelElement} labelElement
* @returns {Element|null}
*/
FastClick.prototype.findControl = function(labelElement) {
// Fast path for newer browsers supporting the HTML5 control attribute
if (labelElement.control !== undefined) {
return labelElement.control;
}
// All browsers under test that support touch events also support the HTML5 htmlFor attribute
if (labelElement.htmlFor) {
return document.getElementById(labelElement.htmlFor);
}
// If no for attribute exists, attempt to retrieve the first labellable descendant element
// the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
};
/**
* On touch end, determine whether to send a click event at once.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onTouchEnd = function(event) {
var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
if (!this.trackingClick) {
return true;
}
// Prevent phantom clicks on fast double-tap (issue #36)
if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
this.cancelNextClick = true;
return true;
}
if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) {
return true;
}
// Reset to prevent wrong click cancel on input (issue #156).
this.cancelNextClick = false;
this.lastClickTime = event.timeStamp;
trackingClickStart = this.trackingClickStart;
this.trackingClick = false;
this.trackingClickStart = 0;
// On some iOS devices, the targetElement supplied with the event is invalid if the layer
// is performing a transition or scroll, and has to be re-detected manually. Note that
// for this to function correctly, it must be called *after* the event target is checked!
// See issue #57; also filed as rdar://13048589 .
if (deviceIsIOSWithBadTarget) {
touch = event.changedTouches[0];
// In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
}
targetTagName = targetElement.tagName.toLowerCase();
if (targetTagName === 'label') {
forElement = this.findControl(targetElement);
if (forElement) {
this.focus(targetElement);
if (deviceIsAndroid) {
return false;
}
targetElement = forElement;
}
} else if (this.needsFocus(targetElement)) {
// Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
// Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
this.targetElement = null;
return false;
}
this.focus(targetElement);
this.sendClick(targetElement, event);
// Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
// Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
if (!deviceIsIOS || targetTagName !== 'select') {
this.targetElement = null;
event.preventDefault();
}
return false;
}
if (deviceIsIOS && !deviceIsIOS4) {
// Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
// and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
scrollParent = targetElement.fastClickScrollParent;
if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
return true;
}
}
// Prevent the actual click from going though - unless the target node is marked as requiring
// real clicks or if it is in the allowlist in which case only non-programmatic clicks are permitted.
if (!this.needsClick(targetElement)) {
event.preventDefault();
this.sendClick(targetElement, event);
}
return false;
};
/**
* On touch cancel, stop tracking the click.
*
* @returns {void}
*/
FastClick.prototype.onTouchCancel = function() {
this.trackingClick = false;
this.targetElement = null;
};
/**
* Determine mouse events which should be permitted.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onMouse = function(event) {
// If a target element was never set (because a touch event was never fired) allow the event
if (!this.targetElement) {
return true;
}
if (event.forwardedTouchEvent) {
return true;
}
// Programmatically generated events targeting a specific element should be permitted
if (!event.cancelable) {
return true;
}
// Derive and check the target element to see whether the mouse event needs to be permitted;
// unless explicitly enabled, prevent non-touch click events from triggering actions,
// to prevent ghost/doubleclicks.
if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
// Prevent any user-added listeners declared on FastClick element from being fired.
if (event.stopImmediatePropagation) {
event.stopImmediatePropagation();
} else {
// Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
event.propagationStopped = true;
}
// Cancel the event
event.stopPropagation();
event.preventDefault();
return false;
}
// If the mouse event is permitted, return true for the action to go through.
return true;
};
/**
* On actual clicks, determine whether this is a touch-generated click, a click action occurring
* naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
* an actual click which should be permitted.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onClick = function(event) {
var permitted;
// It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
if (this.trackingClick) {
this.targetElement = null;
this.trackingClick = false;
return true;
}
// Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
if (event.target.type === 'submit' && event.detail === 0) {
return true;
}
permitted = this.onMouse(event);
// Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
if (!permitted) {
this.targetElement = null;
}
// If clicks are permitted, return true for the action to go through.
return permitted;
};
/**
* Remove all FastClick's event listeners.
*
* @returns {void}
*/
FastClick.prototype.destroy = function() {
var layer = this.layer;
if (deviceIsAndroid) {
layer.removeEventListener('mouseover', this.onMouse, true);
layer.removeEventListener('mousedown', this.onMouse, true);
layer.removeEventListener('mouseup', this.onMouse, true);
}
layer.removeEventListener('click', this.onClick, true);
layer.removeEventListener('touchstart', this.onTouchStart, false);
layer.removeEventListener('touchmove', this.onTouchMove, false);
layer.removeEventListener('touchend', this.onTouchEnd, false);
layer.removeEventListener('touchcancel', this.onTouchCancel, false);
};
/**
* Check whether FastClick is needed.
*
* @param {Element} layer The layer to listen on
*/
FastClick.notNeeded = function(layer) {
var metaViewport;
var chromeVersion;
var blackberryVersion;
var firefoxVersion;
// Devices that don't support touch don't need FastClick
if (typeof window.ontouchstart === 'undefined') {
return true;
}
// Chrome version - zero for other browsers
chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
if (chromeVersion) {
if (deviceIsAndroid) {
metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport) {
// Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
return true;
}
// Chrome 32 and above with width=device-width or less don't need FastClick
if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
return true;
}
}
// Chrome desktop doesn't need FastClick (issue #15)
} else {
return true;
}
}
if (deviceIsBlackBerry10) {
blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
// BlackBerry 10.3+ does not require Fastclick library.
// https://github.com/ftlabs/fastclick/issues/251
if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport) {
// user-scalable=no eliminates click delay.
if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
return true;
}
// width=device-width (or less than device-width) eliminates click delay.
if (document.documentElement.scrollWidth <= window.outerWidth) {
return true;
}
}
}
}
// IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97)
if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
return true;
}
// Firefox version - zero for other browsers
firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
if (firefoxVersion >= 27) {
// Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896
metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
return true;
}
}
// IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
// http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
return true;
}
return false;
};
/**
* Factory method for creating a FastClick object
*
* @param {Element} layer The layer to listen on
* @param {Object} [options={}] The options to override the defaults
*/
FastClick.attach = function(layer, options) {
return new FastClick(layer, options);
};
if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// AMD. Register as an anonymous module.
define(function() {
return FastClick;
});
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = FastClick.attach;
module.exports.FastClick = FastClick;
} else {
window.FastClick = FastClick;
}
}());
import axios from 'axios';
/**
* MAS通用调用类
* @class MAS
*/
export default class MAS {
static getInstance() {
if (!MAS.__instance) {
MAS.__instance = new MAS();
}
return MAS.__instance;
}
/**
* 接口类型
* @readonly
* @static
* @memberof MAS
*/
static get TYPE() {
return {
PROXY: 'mas-api/proxy?alias=',
RESTFUL: 'mas-api/restful/',
};
}
/**
* 默认token的key
* @readonly
* @static
* @memberof MAS
*/
static get TOKEN_KEY() {
return 'access_token';
}
/**
* 回答器,包含结果认证,只限mas请求接口
* @param {{}} result 请求结果
* @returns {{}} 返回处理的结果
* @memberof MAS
*/
responser(result) {
if (result.status === 200) {
let data = result.data;
if (data instanceof Object) {
if (MAS.ERROR_CODE[data.code]) {
return Promise.reject(Object.assign(data, errorCode[data.code]));
}
}
return data;
} else {
throw new Error(result.statusText);
}
}
/**
* 通用请求接口
* @param {String} url 接口地址
* @param {{}} params 参数
* @param {{}} options 配置 {baseUrl: 指定根地址, method: 指定调用方法}
* @returns {Promise} Axios
* @memberof MAS
*/
getData(url, params, options = {}) {
let method = (options && options.method) || this.method || 'get';
// let baseUrl = (options && options.baseUrl) || this.baseUrl;
return axios({
// url: `${baseUrl}/${url}`,
url: url,
method,
params: method === 'get' && params,
data: method === 'post' && params,
...options,
}).then(result => this.responser(result));
}
/**
* Proxy方式调用,MAS配置接口
* @param {String} alias MAS配置接口代码
* @param {{}} params 参数
* @param {{}} options 配置 {baseUrl: 指定根地址, method: 指定调用方法}
* @returns {Promise} Axios
* @memberof MAS
*/
proxy(alias, params, options) {
params = Object.assign(
{
[this.tokenKey]: this.token,
},
params,
options
);
return this.getData(`${MAS.TYPE.PROXY}${alias}`, params, options);
}
/**
* Restful方式调用,MAS配置接口,如果是Restful方式,必须在初始化时指定restful code,否则必须每次在option只指定
* @param {String} url 请求地址,restful配置的后段
* @param {{}} params 参数
* @param {{}} options 配置 {code: restful code,baseUrl: 指定根地址, method: 指定调用方法}
* @returns {Promise} Axios
* @memberof MAS
*/
restful(url, params, options) {
let code = (options && options.code) || this.code;
params = Object.assign(
{
[this.tokenKey]: this.token,
},
params,
options
);
return this.getData(`${this.baseUrl}${MAS.TYPE.RESTFUL}${code}${url}`, params, options);
}
/**
* 配置
* @param {Object} { baseUrl, method, code, token, tokenKey } baseUrl-接口根地址,method:默认调用方法,默认get,code:默认restful代码,token:访问令牌,tokenKey:访问令牌的key
* @returns {MAS}
* @memberof MAS
*/
config({ baseUrl, method, code, token, tokenKey }) {
this.baseUrl = baseUrl;
this.method = method;
this.code = code;
this.token = token;
this.tokenKey = tokenKey;
return this;
}
/**
* 根地址
* @memberof MAS
*/
get baseUrl() {
return this._baseUrl;
}
/**
* 根地址
* @memberof MAS
*/
set baseUrl(baseUrl) {
this._baseUrl = baseUrl;
}
/**
* 调用方法
* @memberof MAS
*/
get method() {
return this._method;
}
/**
* 调用方法
* @memberof MAS
*/
set method(method) {
this._method = method;
}
/**
* restful代码
* @memberof MAS
*/
get code() {
return this._code;
}
/**
* restful代码
* @memberof MAS
*/
set code(code) {
this._code = code;
}
/**
* 访问令牌
* @memberof MAS
*/
get token() {
return this._token;
}
/**
* 访问令牌
* @memberof MAS
*/
set token(token) {
this._token = token;
}
/**
* 访问令牌key
* @memberof MAS
*/
get tokenKey() {
return this._tokenKey || MAS.TOKEN_KEY;
}
/**
* 访问令牌key
* @memberof MAS
*/
set tokenKey(tokenKey) {
this._tokenKey = tokenKey;
}
}
const errorCode = {
'40001': { errCode: '40001', errMsg: '找不到Map校验accessToken!', isReportErr: 'false' },
'40002': { errCode: '40002', errMsg: 'MAP校验不通过!', isReportErr: 'false' },
'40003': { errCode: '40003', errMsg: 'MAP校验出错!', isReportErr: 'false' },
'40011': { errCode: '40011', errMsg: 'MAS中对应的alias参数没有提供', isReportErr: 'false' },
'40021': { errCode: '40021', errMsg: 'MAS转接超时!', isReportErr: 'true' },
'40031': { errCode: '40031', errMsg: '后台服务器连接异常!', isReportErr: 'true' },
'40041': { errCode: '40041', errMsg: '请求参数错误!', isReportErr: 'false' },
'40101': { errCode: '40101', errMsg: 'MAS端没找到token值', isReportErr: 'false' },
'40102': { errCode: '40102', errMsg: 'MAS Token校验不通过!', isReportErr: 'false' },
'40110': { errCode: '40110', errMsg: 'MAS系统处理异常,请联系MAS管理员。', isReportErr: 'true' },
'40112': { errCode: '40112', errMsg: 'MAS服务器没有对应配置,请联系MAS管理员', isReportErr: 'false' },
'40113': { errCode: '40113', errMsg: 'MAS SOAP配置错误', isReportErr: 'true' },
'40120': { errCode: '40120', errMsg: 'MAS图片转换配置错误(图片替换表达式没填)', isReportErr: 'true' },
'40600': { errCode: '40600', errMsg: 'MAS调用返回错误', isReportErr: 'false' },
'40601': { errCode: '40601', errMsg: 'MAS调用URL错误', isReportErr: 'false' },
'40610': { errCode: '40610', errMsg: 'MAS调用数据库脚本失败', isReportErr: 'true' },
'40620': { errCode: '40620', errMsg: 'MAS调用流下载失败', isReportErr: 'true' },
'40631': { errCode: '40631', errMsg: 'MAS调用Webservice失败', isReportErr: 'true' },
'40640': { errCode: '40640', errMsg: 'MAS调用通用表单失败', isReportErr: 'true' },
'40650': { errCode: '40650', errMsg: 'MAS调用HTTP GET失败', isReportErr: 'true' },
'40670': { errCode: '40670', errMsg: 'MAS调用HTTP POST失败', isReportErr: 'true' },
'40690': { errCode: '40690', errMsg: 'MAS调用HTTP AUTO失败', isReportErr: 'true' },
'40691': { errCode: '40691', errMsg: 'MAS调用HTTP DELETE失败', isReportErr: 'true' },
'40692': { errCode: '40692', errMsg: 'MAS调用HTTP PUT失败', isReportErr: 'true' },
'40699': { errCode: '40699', errMsg: 'MAS转发失败', isReportErr: 'true' },
'40700': { errCode: '40700', errMsg: 'MAS不支持该配置服务', isReportErr: 'true' },
'40701': { errCode: '40701', errMsg: 'MAS接口配置错误', isReportErr: 'true' },
'40800': { errCode: '40800', errMsg: 'MAS全局配置参数没设置', isReportErr: 'true' },
'40801': { errCode: '40801', errMsg: 'MAS全局配置参数类型错误', isReportErr: 'true' },
'40810': { errCode: '40810', errMsg: 'MAS没找到相应的RESTFul配置', isReportErr: 'false' },
'40900': { errCode: '40900', errMsg: '账号映射出错', isReportErr: 'true' },
'41000': { errCode: '41000', errMsg: '清除缓存失败', isReportErr: 'true' },
'42000': { errCode: '42000', errMsg: '通用表单模板配置不存在', isReportErr: 'false' },
'42001': { errCode: '42001', errMsg: '通用表单服务不存在', isReportErr: 'false' },
'42002': { errCode: '42002', errMsg: '通用表单系统模块配置不存在', isReportErr: 'false' },
'42010': { errCode: '42010', errMsg: '通用表单调用返回错误', isReportErr: 'true' },
};
/**
* 错误代码
* @type {{}}
*/
MAS.ERROR_CODE = errorCode;
/*! PhotoSwipe Default UI - 4.1.2 - 2017-04-05
* http://photoswipe.com
* Copyright (c) 2017 Dmitry Semenov; */
!(function (a, b) {
'function' == typeof define && define.amd
? define(b)
: 'object' == typeof exports
? (module.exports = b())
: (a.PhotoSwipeUI_Default = b());
})(this, function () {
'use strict';
var a = function (a, b) {
var c,
d,
e,
f,
g,
h,
i,
j,
k,
l,
m,
n,
o,
p,
q,
r,
s,
t,
u,
v = this,
w = !1,
x = !0,
y = !0,
z = {
barsSize: { top: 44, bottom: 'auto' },
closeElClasses: [
'item',
'caption',
'zoom-wrap',
'ui',
'top-bar',
],
timeToIdle: 4e3,
timeToIdleOutside: 1e3,
loadingIndicatorDelay: 1e3,
addCaptionHTMLFn: function (a, b) {
return a.title
? ((b.children[0].innerHTML = a.title), !0)
: ((b.children[0].innerHTML = ''), !1);
},
closeEl: !0,
captionEl: !0,
fullscreenEl: !0,
zoomEl: !0,
shareEl: !0,
counterEl: !0,
arrowEl: !0,
preloaderEl: !0,
tapToClose: !1,
tapToToggleControls: !0,
clickToCloseNonZoomable: !0,
shareButtons: [
{
id: 'facebook',
label: 'Share on Facebook',
url:
'https://www.facebook.com/sharer/sharer.php?u={{url}}',
},
{
id: 'twitter',
label: 'Tweet',
url:
'https://twitter.com/intent/tweet?text={{text}}&url={{url}}',
},
{
id: 'pinterest',
label: 'Pin it',
url:
'http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}',
},
{
id: 'download',
label: 'Download image',
url: '{{raw_image_url}}',
download: !0,
},
],
getImageURLForShare: function () {
return a.currItem.src || '';
},
getPageURLForShare: function () {
return window.location.href;
},
getTextForShare: function () {
return a.currItem.title || '';
},
indexIndicatorSep: ' / ',
fitControlsWidth: 1200,
},
A = function (a) {
if (r) return !0;
(a = a || window.event),
q.timeToIdle && q.mouseUsed && !k && K();
for (
var c,
d,
e = a.target || a.srcElement,
f = e.getAttribute('class') || '',
g = 0;
g < S.length;
g++
)
(c = S[g]),
c.onTap &&
f.indexOf('pswp__' + c.name) > -1 &&
(c.onTap(), (d = !0));
if (d) {
a.stopPropagation && a.stopPropagation(), (r = !0);
var h = b.features.isOldAndroid ? 600 : 30;
s = setTimeout(function () {
r = !1;
}, h);
}
},
B = function () {
return (
!a.likelyTouchDevice ||
q.mouseUsed ||
screen.width > q.fitControlsWidth
);
},
C = function (a, c, d) {
b[(d ? 'add' : 'remove') + 'Class'](a, 'pswp__' + c);
},
D = function () {
var a = 1 === q.getNumItemsFn();
a !== p && (C(d, 'ui--one-slide', a), (p = a));
},
E = function () {
C(i, 'share-modal--hidden', y);
},
F = function () {
return (
(y = !y),
y
? (b.removeClass(i, 'pswp__share-modal--fade-in'),
setTimeout(function () {
y && E();
}, 300))
: (E(),
setTimeout(function () {
y || b.addClass(i, 'pswp__share-modal--fade-in');
}, 30)),
y || H(),
!1
);
},
G = function (b) {
b = b || window.event;
var c = b.target || b.srcElement;
return (
a.shout('shareLinkClick', b, c),
!!c.href &&
(!!c.hasAttribute('download') ||
(window.open(
c.href,
'pswp_share',
'scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left=' +
(window.screen
? Math.round(screen.width / 2 - 275)
: 100)
),
y || F(),
!1))
);
},
H = function () {
for (
var a, b, c, d, e, f = '', g = 0;
g < q.shareButtons.length;
g++
)
(a = q.shareButtons[g]),
(c = q.getImageURLForShare(a)),
(d = q.getPageURLForShare(a)),
(e = q.getTextForShare(a)),
(b = a.url
.replace('{{url}}', encodeURIComponent(d))
.replace('{{image_url}}', encodeURIComponent(c))
.replace('{{raw_image_url}}', c)
.replace('{{text}}', encodeURIComponent(e))),
(f +=
'<a href="' +
b +
'" target="_blank" class="pswp__share--' +
a.id +
'"' +
(a.download ? 'download' : '') +
'>' +
a.label +
'</a>'),
q.parseShareButtonOut &&
(f = q.parseShareButtonOut(a, f));
(i.children[0].innerHTML = f), (i.children[0].onclick = G);
},
I = function (a) {
for (var c = 0; c < q.closeElClasses.length; c++)
if (b.hasClass(a, 'pswp__' + q.closeElClasses[c]))
return !0;
},
J = 0,
K = function () {
clearTimeout(u), (J = 0), k && v.setIdle(!1);
},
L = function (a) {
a = a ? a : window.event;
var b = a.relatedTarget || a.toElement;
(b && 'HTML' !== b.nodeName) ||
(clearTimeout(u),
(u = setTimeout(function () {
v.setIdle(!0);
}, q.timeToIdleOutside)));
},
M = function () {
q.fullscreenEl &&
!b.features.isOldAndroid &&
(c || (c = v.getFullscreenAPI()),
c
? (b.bind(document, c.eventK, v.updateFullscreen),
v.updateFullscreen(),
b.addClass(a.template, 'pswp--supports-fs'))
: b.removeClass(a.template, 'pswp--supports-fs'));
},
N = function () {
q.preloaderEl &&
(O(!0),
l('beforeChange', function () {
clearTimeout(o),
(o = setTimeout(function () {
a.currItem && a.currItem.loading
? (!a.allowProgressiveImg() ||
(a.currItem.img &&
!a.currItem.img.naturalWidth)) &&
O(!1)
: O(!0);
}, q.loadingIndicatorDelay));
}),
l('imageLoadComplete', function (b, c) {
a.currItem === c && O(!0);
}));
},
O = function (a) {
n !== a && (C(m, 'preloader--active', !a), (n = a));
},
P = function (a) {
var c = a.vGap;
if (B()) {
var g = q.barsSize;
if (q.captionEl && 'auto' === g.bottom)
if (
(f ||
((f = b.createEl(
'pswp__caption pswp__caption--fake'
)),
f.appendChild(
b.createEl('pswp__caption__center')
),
d.insertBefore(f, e),
b.addClass(d, 'pswp__ui--fit')),
q.addCaptionHTMLFn(a, f, !0))
) {
var h = f.clientHeight;
c.bottom = parseInt(h, 10) || 44;
} else c.bottom = g.top;
else c.bottom = 'auto' === g.bottom ? 0 : g.bottom;
c.top = g.top;
} else c.top = c.bottom = 0;
},
Q = function () {
q.timeToIdle &&
l('mouseUsed', function () {
b.bind(document, 'mousemove', K),
b.bind(document, 'mouseout', L),
(t = setInterval(function () {
J++, 2 === J && v.setIdle(!0);
}, q.timeToIdle / 2));
});
},
R = function () {
l('onVerticalDrag', function (a) {
x && a < 0.95
? v.hideControls()
: !x && a >= 0.95 && v.showControls();
});
var a;
l('onPinchClose', function (b) {
x && b < 0.9
? (v.hideControls(), (a = !0))
: a && !x && b > 0.9 && v.showControls();
}),
l('zoomGestureEnded', function () {
(a = !1), a && !x && v.showControls();
});
},
S = [
{
name: 'caption',
option: 'captionEl',
onInit: function (a) {
e = a;
},
},
{
name: 'share-modal',
option: 'shareEl',
onInit: function (a) {
i = a;
},
onTap: function () {
F();
},
},
{
name: 'button--share',
option: 'shareEl',
onInit: function (a) {
h = a;
},
onTap: function () {
F();
},
},
{
name: 'button--zoom',
option: 'zoomEl',
onTap: a.toggleDesktopZoom,
},
{
name: 'counter',
option: 'counterEl',
onInit: function (a) {
g = a;
},
},
{ name: 'button--close', option: 'closeEl', onTap: a.close },
{
name: 'button--arrow--left',
option: 'arrowEl',
onTap: a.prev,
},
{
name: 'button--arrow--right',
option: 'arrowEl',
onTap: a.next,
},
{
name: 'button--fs',
option: 'fullscreenEl',
onTap: function () {
c.isFullscreen() ? c.exit() : c.enter();
},
},
{
name: 'preloader',
option: 'preloaderEl',
onInit: function (a) {
m = a;
},
},
],
T = function () {
var a,
c,
e,
f = function (d) {
if (d)
for (var f = d.length, g = 0; g < f; g++) {
(a = d[g]), (c = a.className);
for (var h = 0; h < S.length; h++)
(e = S[h]),
c.indexOf('pswp__' + e.name) > -1 &&
(q[e.option]
? (b.removeClass(
a,
'pswp__element--disabled'
),
e.onInit && e.onInit(a))
: b.addClass(
a,
'pswp__element--disabled'
));
}
};
f(d.children);
var g = b.getChildByClass(d, 'pswp__top-bar');
g && f(g.children);
};
(v.init = function () {
b.extend(a.options, z, !0),
(q = a.options),
(d = b.getChildByClass(a.scrollWrap, 'pswp__ui')),
(l = a.listen),
R(),
l('beforeChange', v.update),
l('doubleTap', function (b) {
var c = a.currItem.initialZoomLevel;
a.getZoomLevel() !== c
? a.zoomTo(c, b, 333)
: a.zoomTo(q.getDoubleTapZoom(!1, a.currItem), b, 333);
}),
l('preventDragEvent', function (a, b, c) {
var d = a.target || a.srcElement;
d &&
d.getAttribute('class') &&
a.type.indexOf('mouse') > -1 &&
(d.getAttribute('class').indexOf('__caption') > 0 ||
/(SMALL|STRONG|EM)/i.test(d.tagName)) &&
(c.prevent = !1);
}),
l('bindEvents', function () {
b.bind(d, 'pswpTap click', A),
b.bind(a.scrollWrap, 'pswpTap', v.onGlobalTap),
a.likelyTouchDevice ||
b.bind(a.scrollWrap, 'mouseover', v.onMouseOver);
}),
l('unbindEvents', function () {
y || F(),
t && clearInterval(t),
b.unbind(document, 'mouseout', L),
b.unbind(document, 'mousemove', K),
b.unbind(d, 'pswpTap click', A),
b.unbind(a.scrollWrap, 'pswpTap', v.onGlobalTap),
b.unbind(a.scrollWrap, 'mouseover', v.onMouseOver),
c &&
(b.unbind(document, c.eventK, v.updateFullscreen),
c.isFullscreen() &&
((q.hideAnimationDuration = 0), c.exit()),
(c = null));
}),
l('destroy', function () {
q.captionEl &&
(f && d.removeChild(f),
b.removeClass(e, 'pswp__caption--empty')),
i && (i.children[0].onclick = null),
b.removeClass(d, 'pswp__ui--over-close'),
b.addClass(d, 'pswp__ui--hidden'),
v.setIdle(!1);
}),
q.showAnimationDuration || b.removeClass(d, 'pswp__ui--hidden'),
l('initialZoomIn', function () {
q.showAnimationDuration &&
b.removeClass(d, 'pswp__ui--hidden');
}),
l('initialZoomOut', function () {
b.addClass(d, 'pswp__ui--hidden');
}),
l('parseVerticalMargin', P),
T(),
q.shareEl && h && i && (y = !0),
D(),
Q(),
M(),
N();
}),
(v.setIdle = function (a) {
(k = a), C(d, 'ui--idle', a);
}),
(v.update = function () {
x && a.currItem
? (v.updateIndexIndicator(),
q.captionEl &&
(q.addCaptionHTMLFn(a.currItem, e),
C(e, 'caption--empty', !a.currItem.title)),
(w = !0))
: (w = !1),
y || F(),
D();
}),
(v.updateFullscreen = function (d) {
d &&
setTimeout(function () {
a.setScrollOffset(0, b.getScrollY());
}, 50),
b[(c.isFullscreen() ? 'add' : 'remove') + 'Class'](
a.template,
'pswp--fs'
);
}),
(v.updateIndexIndicator = function () {
q.counterEl &&
(g.innerHTML =
a.getCurrentIndex() +
1 +
q.indexIndicatorSep +
q.getNumItemsFn());
}),
(v.onGlobalTap = function (c) {
c = c || window.event;
var d = c.target || c.srcElement;
if (!r)
if (c.detail && 'mouse' === c.detail.pointerType) {
if (I(d)) return void a.close();
b.hasClass(d, 'pswp__img') &&
(1 === a.getZoomLevel() &&
a.getZoomLevel() <= a.currItem.fitRatio
? q.clickToCloseNonZoomable && a.close()
: a.toggleDesktopZoom(c.detail.releasePoint));
} else if (
(q.tapToToggleControls &&
(x ? v.hideControls() : v.showControls()),
q.tapToClose && (b.hasClass(d, 'pswp__img') || I(d)))
)
return void a.close();
}),
(v.onMouseOver = function (a) {
a = a || window.event;
var b = a.target || a.srcElement;
C(d, 'ui--over-close', I(b));
}),
(v.hideControls = function () {
b.addClass(d, 'pswp__ui--hidden'), (x = !1);
}),
(v.showControls = function () {
(x = !0), w || v.update(), b.removeClass(d, 'pswp__ui--hidden');
}),
(v.supportsFullscreen = function () {
var a = document;
return !!(
a.exitFullscreen ||
a.mozCancelFullScreen ||
a.webkitExitFullscreen ||
a.msExitFullscreen
);
}),
(v.getFullscreenAPI = function () {
var b,
c = document.documentElement,
d = 'fullscreenchange';
return (
c.requestFullscreen
? (b = {
enterK: 'requestFullscreen',
exitK: 'exitFullscreen',
elementK: 'fullscreenElement',
eventK: d,
})
: c.mozRequestFullScreen
? (b = {
enterK: 'mozRequestFullScreen',
exitK: 'mozCancelFullScreen',
elementK: 'mozFullScreenElement',
eventK: 'moz' + d,
})
: c.webkitRequestFullscreen
? (b = {
enterK: 'webkitRequestFullscreen',
exitK: 'webkitExitFullscreen',
elementK: 'webkitFullscreenElement',
eventK: 'webkit' + d,
})
: c.msRequestFullscreen &&
(b = {
enterK: 'msRequestFullscreen',
exitK: 'msExitFullscreen',
elementK: 'msFullscreenElement',
eventK: 'MSFullscreenChange',
}),
b &&
((b.enter = function () {
return (
(j = q.closeOnScroll),
(q.closeOnScroll = !1),
'webkitRequestFullscreen' !== this.enterK
? a.template[this.enterK]()
: void a.template[this.enterK](
Element.ALLOW_KEYBOARD_INPUT
)
);
}),
(b.exit = function () {
return (
(q.closeOnScroll = j), document[this.exitK]()
);
}),
(b.isFullscreen = function () {
return document[this.elementK];
})),
b
);
});
};
return a;
});
/*! PhotoSwipe - v4.1.2 - 2017-04-05
* http://photoswipe.com
* Copyright (c) 2017 Dmitry Semenov; */
!(function (a, b) {
'function' == typeof define && define.amd
? define(b)
: 'object' == typeof exports
? (module.exports = b())
: (a.PhotoSwipe = b());
})(this, function () {
'use strict';
var a = function (a, b, c, d) {
var e = {
features: null,
bind: function (a, b, c, d) {
var e = (d ? 'remove' : 'add') + 'EventListener';
b = b.split(' ');
for (var f = 0; f < b.length; f++) b[f] && a[e](b[f], c, !1);
},
isArray: function (a) {
return a instanceof Array;
},
createEl: function (a, b) {
var c = document.createElement(b || 'div');
return a && (c.className = a), c;
},
getScrollY: function () {
var a = window.pageYOffset;
return void 0 !== a ? a : document.documentElement.scrollTop;
},
unbind: function (a, b, c) {
e.bind(a, b, c, !0);
},
removeClass: function (a, b) {
var c = new RegExp('(\\s|^)' + b + '(\\s|$)');
a.className = a.className
.replace(c, ' ')
.replace(/^\s\s*/, '')
.replace(/\s\s*$/, '');
},
addClass: function (a, b) {
e.hasClass(a, b) ||
(a.className += (a.className ? ' ' : '') + b);
},
hasClass: function (a, b) {
return (
a.className &&
new RegExp('(^|\\s)' + b + '(\\s|$)').test(a.className)
);
},
getChildByClass: function (a, b) {
for (var c = a.firstChild; c; ) {
if (e.hasClass(c, b)) return c;
c = c.nextSibling;
}
},
arraySearch: function (a, b, c) {
for (var d = a.length; d--; ) if (a[d][c] === b) return d;
return -1;
},
extend: function (a, b, c) {
for (var d in b)
if (b.hasOwnProperty(d)) {
if (c && a.hasOwnProperty(d)) continue;
a[d] = b[d];
}
},
easing: {
sine: {
out: function (a) {
return Math.sin(a * (Math.PI / 2));
},
inOut: function (a) {
return -(Math.cos(Math.PI * a) - 1) / 2;
},
},
cubic: {
out: function (a) {
return --a * a * a + 1;
},
},
},
detectFeatures: function () {
if (e.features) return e.features;
var a = e.createEl(),
b = a.style,
c = '',
d = {};
if (
((d.oldIE = document.all && !document.addEventListener),
(d.touch = 'ontouchstart' in window),
window.requestAnimationFrame &&
((d.raf = window.requestAnimationFrame),
(d.caf = window.cancelAnimationFrame)),
(d.pointerEvent =
navigator.pointerEnabled || navigator.msPointerEnabled),
!d.pointerEvent)
) {
var f = navigator.userAgent;
if (/iP(hone|od)/.test(navigator.platform)) {
var g = navigator.appVersion.match(
/OS (\d+)_(\d+)_?(\d+)?/
);
g &&
g.length > 0 &&
((g = parseInt(g[1], 10)),
g >= 1 && g < 8 && (d.isOldIOSPhone = !0));
}
var h = f.match(/Android\s([0-9\.]*)/),
i = h ? h[1] : 0;
(i = parseFloat(i)),
i >= 1 &&
(i < 4.4 && (d.isOldAndroid = !0),
(d.androidVersion = i)),
(d.isMobileOpera = /opera mini|opera mobi/i.test(f));
}
for (
var j,
k,
l = ['transform', 'perspective', 'animationName'],
m = ['', 'webkit', 'Moz', 'ms', 'O'],
n = 0;
n < 4;
n++
) {
c = m[n];
for (var o = 0; o < 3; o++)
(j = l[o]),
(k =
c +
(c
? j.charAt(0).toUpperCase() + j.slice(1)
: j)),
!d[j] && k in b && (d[j] = k);
c &&
!d.raf &&
((c = c.toLowerCase()),
(d.raf = window[c + 'RequestAnimationFrame']),
d.raf &&
(d.caf =
window[c + 'CancelAnimationFrame'] ||
window[c + 'CancelRequestAnimationFrame']));
}
if (!d.raf) {
var p = 0;
(d.raf = function (a) {
var b = new Date().getTime(),
c = Math.max(0, 16 - (b - p)),
d = window.setTimeout(function () {
a(b + c);
}, c);
return (p = b + c), d;
}),
(d.caf = function (a) {
clearTimeout(a);
});
}
return (
(d.svg =
!!document.createElementNS &&
!!document.createElementNS(
'http://www.w3.org/2000/svg',
'svg'
).createSVGRect),
(e.features = d),
d
);
},
};
e.detectFeatures(),
e.features.oldIE &&
(e.bind = function (a, b, c, d) {
b = b.split(' ');
for (
var e,
f = (d ? 'detach' : 'attach') + 'Event',
g = function () {
c.handleEvent.call(c);
},
h = 0;
h < b.length;
h++
)
if ((e = b[h]))
if ('object' == typeof c && c.handleEvent) {
if (d) {
if (!c['oldIE' + e]) return !1;
} else c['oldIE' + e] = g;
a[f]('on' + e, c['oldIE' + e]);
} else a[f]('on' + e, c);
});
var f = this,
g = 25,
h = 3,
i = {
allowPanToNext: !0,
spacing: 0.12,
bgOpacity: 1,
mouseUsed: !1,
loop: !0,
pinchToClose: !0,
closeOnScroll: !0,
closeOnVerticalDrag: !0,
verticalDragRange: 0.75,
hideAnimationDuration: 333,
showAnimationDuration: 333,
showHideOpacity: !1,
focus: !0,
escKey: !0,
arrowKeys: !0,
mainScrollEndFriction: 0.35,
panEndFriction: 0.35,
isClickableElement: function (a) {
return 'A' === a.tagName;
},
getDoubleTapZoom: function (a, b) {
return a ? 1 : b.initialZoomLevel < 0.7 ? 1 : 1.33;
},
maxSpreadZoom: 1.33,
modal: !0,
scaleMode: 'fit',
};
e.extend(i, d);
var j,
k,
l,
m,
n,
o,
p,
q,
r,
s,
t,
u,
v,
w,
x,
y,
z,
A,
B,
C,
D,
E,
F,
G,
H,
I,
J,
K,
L,
M,
N,
O,
P,
Q,
R,
S,
T,
U,
V,
W,
X,
Y,
Z,
$,
_,
aa,
ba,
ca,
da,
ea,
fa,
ga,
ha,
ia,
ja,
ka,
la,
ma = function () {
return { x: 0, y: 0 };
},
na = ma(),
oa = ma(),
pa = ma(),
qa = {},
ra = 0,
sa = {},
ta = ma(),
ua = 0,
va = !0,
wa = [],
xa = {},
ya = !1,
za = function (a, b) {
e.extend(f, b.publicMethods), wa.push(a);
},
Aa = function (a) {
var b = ac();
return a > b - 1 ? a - b : a < 0 ? b + a : a;
},
Ba = {},
Ca = function (a, b) {
return Ba[a] || (Ba[a] = []), Ba[a].push(b);
},
Da = function (a) {
var b = Ba[a];
if (b) {
var c = Array.prototype.slice.call(arguments);
c.shift();
for (var d = 0; d < b.length; d++) b[d].apply(f, c);
}
},
Ea = function () {
return new Date().getTime();
},
Fa = function (a) {
(ja = a), (f.bg.style.opacity = a * i.bgOpacity);
},
Ga = function (a, b, c, d, e) {
(!ya || (e && e !== f.currItem)) &&
(d /= e ? e.fitRatio : f.currItem.fitRatio),
(a[E] =
u + b + 'px, ' + c + 'px' + v + ' scale(' + d + ')');
},
Ha = function (a) {
ea &&
(a &&
(s > f.currItem.fitRatio
? ya || (mc(f.currItem, !1, !0), (ya = !0))
: ya && (mc(f.currItem), (ya = !1))),
Ga(ea, pa.x, pa.y, s));
},
Ia = function (a) {
a.container &&
Ga(
a.container.style,
a.initialPosition.x,
a.initialPosition.y,
a.initialZoomLevel,
a
);
},
Ja = function (a, b) {
b[E] = u + a + 'px, 0px' + v;
},
Ka = function (a, b) {
if (!i.loop && b) {
var c = m + (ta.x * ra - a) / ta.x,
d = Math.round(a - tb.x);
((c < 0 && d > 0) || (c >= ac() - 1 && d < 0)) &&
(a = tb.x + d * i.mainScrollEndFriction);
}
(tb.x = a), Ja(a, n);
},
La = function (a, b) {
var c = ub[a] - sa[a];
return oa[a] + na[a] + c - c * (b / t);
},
Ma = function (a, b) {
(a.x = b.x), (a.y = b.y), b.id && (a.id = b.id);
},
Na = function (a) {
(a.x = Math.round(a.x)), (a.y = Math.round(a.y));
},
Oa = null,
Pa = function () {
Oa &&
(e.unbind(document, 'mousemove', Pa),
e.addClass(a, 'pswp--has_mouse'),
(i.mouseUsed = !0),
Da('mouseUsed')),
(Oa = setTimeout(function () {
Oa = null;
}, 100));
},
Qa = function () {
e.bind(document, 'keydown', f),
N.transform && e.bind(f.scrollWrap, 'click', f),
i.mouseUsed || e.bind(document, 'mousemove', Pa),
e.bind(window, 'resize scroll orientationchange', f),
Da('bindEvents');
},
Ra = function () {
e.unbind(window, 'resize scroll orientationchange', f),
e.unbind(window, 'scroll', r.scroll),
e.unbind(document, 'keydown', f),
e.unbind(document, 'mousemove', Pa),
N.transform && e.unbind(f.scrollWrap, 'click', f),
V && e.unbind(window, p, f),
clearTimeout(O),
Da('unbindEvents');
},
Sa = function (a, b) {
var c = ic(f.currItem, qa, a);
return b && (da = c), c;
},
Ta = function (a) {
return a || (a = f.currItem), a.initialZoomLevel;
},
Ua = function (a) {
return a || (a = f.currItem), a.w > 0 ? i.maxSpreadZoom : 1;
},
Va = function (a, b, c, d) {
return d === f.currItem.initialZoomLevel
? ((c[a] = f.currItem.initialPosition[a]), !0)
: ((c[a] = La(a, d)),
c[a] > b.min[a]
? ((c[a] = b.min[a]), !0)
: c[a] < b.max[a] && ((c[a] = b.max[a]), !0));
},
Wa = function () {
if (E) {
var b = N.perspective && !G;
return (
(u = 'translate' + (b ? '3d(' : '(')),
void (v = N.perspective ? ', 0px)' : ')')
);
}
(E = 'left'),
e.addClass(a, 'pswp--ie'),
(Ja = function (a, b) {
b.left = a + 'px';
}),
(Ia = function (a) {
var b = a.fitRatio > 1 ? 1 : a.fitRatio,
c = a.container.style,
d = b * a.w,
e = b * a.h;
(c.width = d + 'px'),
(c.height = e + 'px'),
(c.left = a.initialPosition.x + 'px'),
(c.top = a.initialPosition.y + 'px');
}),
(Ha = function () {
if (ea) {
var a = ea,
b = f.currItem,
c = b.fitRatio > 1 ? 1 : b.fitRatio,
d = c * b.w,
e = c * b.h;
(a.width = d + 'px'),
(a.height = e + 'px'),
(a.left = pa.x + 'px'),
(a.top = pa.y + 'px');
}
});
},
Xa = function (a) {
var b = '';
i.escKey && 27 === a.keyCode
? (b = 'close')
: i.arrowKeys &&
(37 === a.keyCode
? (b = 'prev')
: 39 === a.keyCode && (b = 'next')),
b &&
(a.ctrlKey ||
a.altKey ||
a.shiftKey ||
a.metaKey ||
(a.preventDefault
? a.preventDefault()
: (a.returnValue = !1),
f[b]()));
},
Ya = function (a) {
a &&
(Y || X || fa || T) &&
(a.preventDefault(), a.stopPropagation());
},
Za = function () {
f.setScrollOffset(0, e.getScrollY());
},
$a = {},
_a = 0,
ab = function (a) {
$a[a] && ($a[a].raf && I($a[a].raf), _a--, delete $a[a]);
},
bb = function (a) {
$a[a] && ab(a), $a[a] || (_a++, ($a[a] = {}));
},
cb = function () {
for (var a in $a) $a.hasOwnProperty(a) && ab(a);
},
db = function (a, b, c, d, e, f, g) {
var h,
i = Ea();
bb(a);
var j = function () {
if ($a[a]) {
if (((h = Ea() - i), h >= d))
return ab(a), f(c), void (g && g());
f((c - b) * e(h / d) + b), ($a[a].raf = H(j));
}
};
j();
},
eb = {
shout: Da,
listen: Ca,
viewportSize: qa,
options: i,
isMainScrollAnimating: function () {
return fa;
},
getZoomLevel: function () {
return s;
},
getCurrentIndex: function () {
return m;
},
isDragging: function () {
return V;
},
isZooming: function () {
return aa;
},
setScrollOffset: function (a, b) {
(sa.x = a), (M = sa.y = b), Da('updateScrollOffset', sa);
},
applyZoomPan: function (a, b, c, d) {
(pa.x = b), (pa.y = c), (s = a), Ha(d);
},
init: function () {
if (!j && !k) {
var c;
(f.framework = e),
(f.template = a),
(f.bg = e.getChildByClass(a, 'pswp__bg')),
(J = a.className),
(j = !0),
(N = e.detectFeatures()),
(H = N.raf),
(I = N.caf),
(E = N.transform),
(L = N.oldIE),
(f.scrollWrap = e.getChildByClass(
a,
'pswp__scroll-wrap'
)),
(f.container = e.getChildByClass(
f.scrollWrap,
'pswp__container'
)),
(n = f.container.style),
(f.itemHolders = y = [
{
el: f.container.children[0],
wrap: 0,
index: -1,
},
{
el: f.container.children[1],
wrap: 0,
index: -1,
},
{
el: f.container.children[2],
wrap: 0,
index: -1,
},
]),
(y[0].el.style.display = y[2].el.style.display =
'none'),
Wa(),
(r = {
resize: f.updateSize,
orientationchange: function () {
clearTimeout(O),
(O = setTimeout(function () {
qa.x !== f.scrollWrap.clientWidth &&
f.updateSize();
}, 500));
},
scroll: Za,
keydown: Xa,
click: Ya,
});
var d =
N.isOldIOSPhone ||
N.isOldAndroid ||
N.isMobileOpera;
for (
(N.animationName && N.transform && !d) ||
(i.showAnimationDuration = i.hideAnimationDuration = 0),
c = 0;
c < wa.length;
c++
)
f['init' + wa[c]]();
if (b) {
var g = (f.ui = new b(f, e));
g.init();
}
Da('firstUpdate'),
(m = m || i.index || 0),
(isNaN(m) || m < 0 || m >= ac()) && (m = 0),
(f.currItem = _b(m)),
(N.isOldIOSPhone || N.isOldAndroid) && (va = !1),
a.setAttribute('aria-hidden', 'false'),
i.modal &&
(va
? (a.style.position = 'fixed')
: ((a.style.position = 'absolute'),
(a.style.top = e.getScrollY() + 'px'))),
void 0 === M &&
(Da('initialLayout'), (M = K = e.getScrollY()));
var l = 'pswp--open ';
for (
i.mainClass && (l += i.mainClass + ' '),
i.showHideOpacity &&
(l += 'pswp--animate_opacity '),
l += G ? 'pswp--touch' : 'pswp--notouch',
l += N.animationName
? ' pswp--css_animation'
: '',
l += N.svg ? ' pswp--svg' : '',
e.addClass(a, l),
f.updateSize(),
o = -1,
ua = null,
c = 0;
c < h;
c++
)
Ja((c + o) * ta.x, y[c].el.style);
L || e.bind(f.scrollWrap, q, f),
Ca('initialZoomInEnd', function () {
f.setContent(y[0], m - 1),
f.setContent(y[2], m + 1),
(y[0].el.style.display = y[2].el.style.display =
'block'),
i.focus && a.focus(),
Qa();
}),
f.setContent(y[1], m),
f.updateCurrItem(),
Da('afterInit'),
va ||
(w = setInterval(function () {
_a ||
V ||
aa ||
s !== f.currItem.initialZoomLevel ||
f.updateSize();
}, 1e3)),
e.addClass(a, 'pswp--visible');
}
},
close: function () {
j &&
((j = !1),
(k = !0),
Da('close'),
Ra(),
cc(f.currItem, null, !0, f.destroy));
},
destroy: function () {
Da('destroy'),
Xb && clearTimeout(Xb),
a.setAttribute('aria-hidden', 'true'),
(a.className = J),
w && clearInterval(w),
e.unbind(f.scrollWrap, q, f),
e.unbind(window, 'scroll', f),
zb(),
cb(),
(Ba = null);
},
panTo: function (a, b, c) {
c ||
(a > da.min.x
? (a = da.min.x)
: a < da.max.x && (a = da.max.x),
b > da.min.y
? (b = da.min.y)
: b < da.max.y && (b = da.max.y)),
(pa.x = a),
(pa.y = b),
Ha();
},
handleEvent: function (a) {
(a = a || window.event), r[a.type] && r[a.type](a);
},
goTo: function (a) {
a = Aa(a);
var b = a - m;
(ua = b),
(m = a),
(f.currItem = _b(m)),
(ra -= b),
Ka(ta.x * ra),
cb(),
(fa = !1),
f.updateCurrItem();
},
next: function () {
f.goTo(m + 1);
},
prev: function () {
f.goTo(m - 1);
},
updateCurrZoomItem: function (a) {
if ((a && Da('beforeChange', 0), y[1].el.children.length)) {
var b = y[1].el.children[0];
ea = e.hasClass(b, 'pswp__zoom-wrap') ? b.style : null;
} else ea = null;
(da = f.currItem.bounds),
(t = s = f.currItem.initialZoomLevel),
(pa.x = da.center.x),
(pa.y = da.center.y),
a && Da('afterChange');
},
invalidateCurrItems: function () {
x = !0;
for (var a = 0; a < h; a++)
y[a].item && (y[a].item.needsUpdate = !0);
},
updateCurrItem: function (a) {
if (0 !== ua) {
var b,
c = Math.abs(ua);
if (!(a && c < 2)) {
(f.currItem = _b(m)),
(ya = !1),
Da('beforeChange', ua),
c >= h &&
((o += ua + (ua > 0 ? -h : h)), (c = h));
for (var d = 0; d < c; d++)
ua > 0
? ((b = y.shift()),
(y[h - 1] = b),
o++,
Ja((o + 2) * ta.x, b.el.style),
f.setContent(b, m - c + d + 1 + 1))
: ((b = y.pop()),
y.unshift(b),
o--,
Ja(o * ta.x, b.el.style),
f.setContent(b, m + c - d - 1 - 1));
if (ea && 1 === Math.abs(ua)) {
var e = _b(z);
e.initialZoomLevel !== s &&
(ic(e, qa), mc(e), Ia(e));
}
(ua = 0),
f.updateCurrZoomItem(),
(z = m),
Da('afterChange');
}
}
},
updateSize: function (b) {
if (!va && i.modal) {
var c = e.getScrollY();
if (
(M !== c && ((a.style.top = c + 'px'), (M = c)),
!b &&
xa.x === window.innerWidth &&
xa.y === window.innerHeight)
)
return;
(xa.x = window.innerWidth),
(xa.y = window.innerHeight),
(a.style.height = xa.y + 'px');
}
if (
((qa.x = f.scrollWrap.clientWidth),
(qa.y = f.scrollWrap.clientHeight),
Za(),
(ta.x = qa.x + Math.round(qa.x * i.spacing)),
(ta.y = qa.y),
Ka(ta.x * ra),
Da('beforeResize'),
void 0 !== o)
) {
for (var d, g, j, k = 0; k < h; k++)
(d = y[k]),
Ja((k + o) * ta.x, d.el.style),
(j = m + k - 1),
i.loop && ac() > 2 && (j = Aa(j)),
(g = _b(j)),
g && (x || g.needsUpdate || !g.bounds)
? (f.cleanSlide(g),
f.setContent(d, j),
1 === k &&
((f.currItem = g),
f.updateCurrZoomItem(!0)),
(g.needsUpdate = !1))
: d.index === -1 &&
j >= 0 &&
f.setContent(d, j),
g && g.container && (ic(g, qa), mc(g), Ia(g));
x = !1;
}
(t = s = f.currItem.initialZoomLevel),
(da = f.currItem.bounds),
da &&
((pa.x = da.center.x),
(pa.y = da.center.y),
Ha(!0)),
Da('resize');
},
zoomTo: function (a, b, c, d, f) {
b &&
((t = s),
(ub.x = Math.abs(b.x) - pa.x),
(ub.y = Math.abs(b.y) - pa.y),
Ma(oa, pa));
var g = Sa(a, !1),
h = {};
Va('x', g, h, a), Va('y', g, h, a);
var i = s,
j = { x: pa.x, y: pa.y };
Na(h);
var k = function (b) {
1 === b
? ((s = a), (pa.x = h.x), (pa.y = h.y))
: ((s = (a - i) * b + i),
(pa.x = (h.x - j.x) * b + j.x),
(pa.y = (h.y - j.y) * b + j.y)),
f && f(b),
Ha(1 === b);
};
c
? db(
'customZoomTo',
0,
1,
c,
d || e.easing.sine.inOut,
k
)
: k(1);
},
},
fb = 30,
gb = 10,
hb = {},
ib = {},
jb = {},
kb = {},
lb = {},
mb = [],
nb = {},
ob = [],
pb = {},
qb = 0,
rb = ma(),
sb = 0,
tb = ma(),
ub = ma(),
vb = ma(),
wb = function (a, b) {
return a.x === b.x && a.y === b.y;
},
xb = function (a, b) {
return Math.abs(a.x - b.x) < g && Math.abs(a.y - b.y) < g;
},
yb = function (a, b) {
return (
(pb.x = Math.abs(a.x - b.x)),
(pb.y = Math.abs(a.y - b.y)),
Math.sqrt(pb.x * pb.x + pb.y * pb.y)
);
},
zb = function () {
Z && (I(Z), (Z = null));
},
Ab = function () {
V && ((Z = H(Ab)), Qb());
},
Bb = function () {
return !(
'fit' === i.scaleMode && s === f.currItem.initialZoomLevel
);
},
Cb = function (a, b) {
return (
!(!a || a === document) &&
!(
a.getAttribute('class') &&
a.getAttribute('class').indexOf('pswp__scroll-wrap') >
-1
) &&
(b(a) ? a : Cb(a.parentNode, b))
);
},
Db = {},
Eb = function (a, b) {
return (
(Db.prevent = !Cb(a.target, i.isClickableElement)),
Da('preventDragEvent', a, b, Db),
Db.prevent
);
},
Fb = function (a, b) {
return (
(b.x = a.pageX), (b.y = a.pageY), (b.id = a.identifier), b
);
},
Gb = function (a, b, c) {
(c.x = 0.5 * (a.x + b.x)), (c.y = 0.5 * (a.y + b.y));
},
Hb = function (a, b, c) {
if (a - Q > 50) {
var d = ob.length > 2 ? ob.shift() : {};
(d.x = b), (d.y = c), ob.push(d), (Q = a);
}
},
Ib = function () {
var a = pa.y - f.currItem.initialPosition.y;
return 1 - Math.abs(a / (qa.y / 2));
},
Jb = {},
Kb = {},
Lb = [],
Mb = function (a) {
for (; Lb.length > 0; ) Lb.pop();
return (
F
? ((la = 0),
mb.forEach(function (a) {
0 === la ? (Lb[0] = a) : 1 === la && (Lb[1] = a),
la++;
}))
: a.type.indexOf('touch') > -1
? a.touches &&
a.touches.length > 0 &&
((Lb[0] = Fb(a.touches[0], Jb)),
a.touches.length > 1 &&
(Lb[1] = Fb(a.touches[1], Kb)))
: ((Jb.x = a.pageX),
(Jb.y = a.pageY),
(Jb.id = ''),
(Lb[0] = Jb)),
Lb
);
},
Nb = function (a, b) {
var c,
d,
e,
g,
h = 0,
j = pa[a] + b[a],
k = b[a] > 0,
l = tb.x + b.x,
m = tb.x - nb.x;
return (
(c = j > da.min[a] || j < da.max[a] ? i.panEndFriction : 1),
(j = pa[a] + b[a] * c),
(!i.allowPanToNext && s !== f.currItem.initialZoomLevel) ||
(ea
? 'h' !== ga ||
'x' !== a ||
X ||
(k
? (j > da.min[a] &&
((c = i.panEndFriction),
(h = da.min[a] - j),
(d = da.min[a] - oa[a])),
(d <= 0 || m < 0) && ac() > 1
? ((g = l), m < 0 && l > nb.x && (g = nb.x))
: da.min.x !== da.max.x && (e = j))
: (j < da.max[a] &&
((c = i.panEndFriction),
(h = j - da.max[a]),
(d = oa[a] - da.max[a])),
(d <= 0 || m > 0) && ac() > 1
? ((g = l), m > 0 && l < nb.x && (g = nb.x))
: da.min.x !== da.max.x && (e = j)))
: (g = l),
'x' !== a)
? void (
fa ||
$ ||
(s > f.currItem.fitRatio && (pa[a] += b[a] * c))
)
: (void 0 !== g && (Ka(g, !0), ($ = g !== nb.x)),
da.min.x !== da.max.x &&
(void 0 !== e
? (pa.x = e)
: $ || (pa.x += b.x * c)),
void 0 !== g)
);
},
Ob = function (a) {
if (!('mousedown' === a.type && a.button > 0)) {
if ($b) return void a.preventDefault();
if (!U || 'mousedown' !== a.type) {
if (
(Eb(a, !0) && a.preventDefault(),
Da('pointerDown'),
F)
) {
var b = e.arraySearch(mb, a.pointerId, 'id');
b < 0 && (b = mb.length),
(mb[b] = {
x: a.pageX,
y: a.pageY,
id: a.pointerId,
});
}
var c = Mb(a),
d = c.length;
(_ = null),
cb(),
(V && 1 !== d) ||
((V = ha = !0),
e.bind(window, p, f),
(S = ka = ia = T = $ = Y = W = X = !1),
(ga = null),
Da('firstTouchStart', c),
Ma(oa, pa),
(na.x = na.y = 0),
Ma(kb, c[0]),
Ma(lb, kb),
(nb.x = ta.x * ra),
(ob = [{ x: kb.x, y: kb.y }]),
(Q = P = Ea()),
Sa(s, !0),
zb(),
Ab()),
!aa &&
d > 1 &&
!fa &&
!$ &&
((t = s),
(X = !1),
(aa = W = !0),
(na.y = na.x = 0),
Ma(oa, pa),
Ma(hb, c[0]),
Ma(ib, c[1]),
Gb(hb, ib, vb),
(ub.x = Math.abs(vb.x) - pa.x),
(ub.y = Math.abs(vb.y) - pa.y),
(ba = ca = yb(hb, ib)));
}
}
},
Pb = function (a) {
if ((a.preventDefault(), F)) {
var b = e.arraySearch(mb, a.pointerId, 'id');
if (b > -1) {
var c = mb[b];
(c.x = a.pageX), (c.y = a.pageY);
}
}
if (V) {
var d = Mb(a);
if (ga || Y || aa) _ = d;
else if (tb.x !== ta.x * ra) ga = 'h';
else {
var f =
Math.abs(d[0].x - kb.x) - Math.abs(d[0].y - kb.y);
Math.abs(f) >= gb &&
((ga = f > 0 ? 'h' : 'v'), (_ = d));
}
}
},
Qb = function () {
if (_) {
var a = _.length;
if (0 !== a)
if (
(Ma(hb, _[0]),
(jb.x = hb.x - kb.x),
(jb.y = hb.y - kb.y),
aa && a > 1)
) {
if (
((kb.x = hb.x),
(kb.y = hb.y),
!jb.x && !jb.y && wb(_[1], ib))
)
return;
Ma(ib, _[1]),
X || ((X = !0), Da('zoomGestureStarted'));
var b = yb(hb, ib),
c = Vb(b);
c >
f.currItem.initialZoomLevel +
f.currItem.initialZoomLevel / 15 &&
(ka = !0);
var d = 1,
e = Ta(),
g = Ua();
if (c < e)
if (
i.pinchToClose &&
!ka &&
t <= f.currItem.initialZoomLevel
) {
var h = e - c,
j = 1 - h / (e / 1.2);
Fa(j), Da('onPinchClose', j), (ia = !0);
} else
(d = (e - c) / e),
d > 1 && (d = 1),
(c = e - d * (e / 3));
else
c > g &&
((d = (c - g) / (6 * e)),
d > 1 && (d = 1),
(c = g + d * e));
d < 0 && (d = 0),
(ba = b),
Gb(hb, ib, rb),
(na.x += rb.x - vb.x),
(na.y += rb.y - vb.y),
Ma(vb, rb),
(pa.x = La('x', c)),
(pa.y = La('y', c)),
(S = c > s),
(s = c),
Ha();
} else {
if (!ga) return;
if (
(ha &&
((ha = !1),
Math.abs(jb.x) >= gb &&
(jb.x -= _[0].x - lb.x),
Math.abs(jb.y) >= gb &&
(jb.y -= _[0].y - lb.y)),
(kb.x = hb.x),
(kb.y = hb.y),
0 === jb.x && 0 === jb.y)
)
return;
if ('v' === ga && i.closeOnVerticalDrag && !Bb()) {
(na.y += jb.y), (pa.y += jb.y);
var k = Ib();
return (
(T = !0),
Da('onVerticalDrag', k),
Fa(k),
void Ha()
);
}
Hb(Ea(), hb.x, hb.y),
(Y = !0),
(da = f.currItem.bounds);
var l = Nb('x', jb);
l || (Nb('y', jb), Na(pa), Ha());
}
}
},
Rb = function (a) {
if (N.isOldAndroid) {
if (U && 'mouseup' === a.type) return;
a.type.indexOf('touch') > -1 &&
(clearTimeout(U),
(U = setTimeout(function () {
U = 0;
}, 600)));
}
Da('pointerUp'), Eb(a, !1) && a.preventDefault();
var b;
if (F) {
var c = e.arraySearch(mb, a.pointerId, 'id');
if (c > -1)
if (
((b = mb.splice(c, 1)[0]), navigator.pointerEnabled)
)
b.type = a.pointerType || 'mouse';
else {
var d = { 4: 'mouse', 2: 'touch', 3: 'pen' };
(b.type = d[a.pointerType]),
b.type || (b.type = a.pointerType || 'mouse');
}
}
var g,
h = Mb(a),
j = h.length;
if (('mouseup' === a.type && (j = 0), 2 === j))
return (_ = null), !0;
1 === j && Ma(lb, h[0]),
0 !== j ||
ga ||
fa ||
(b ||
('mouseup' === a.type
? (b = {
x: a.pageX,
y: a.pageY,
type: 'mouse',
})
: a.changedTouches &&
a.changedTouches[0] &&
(b = {
x: a.changedTouches[0].pageX,
y: a.changedTouches[0].pageY,
type: 'touch',
})),
Da('touchRelease', a, b));
var k = -1;
if (
(0 === j &&
((V = !1),
e.unbind(window, p, f),
zb(),
aa ? (k = 0) : sb !== -1 && (k = Ea() - sb)),
(sb = 1 === j ? Ea() : -1),
(g = k !== -1 && k < 150 ? 'zoom' : 'swipe'),
aa &&
j < 2 &&
((aa = !1),
1 === j && (g = 'zoomPointerUp'),
Da('zoomGestureEnded')),
(_ = null),
Y || X || fa || T)
)
if (
(cb(), R || (R = Sb()), R.calculateSwipeSpeed('x'), T)
) {
var l = Ib();
if (l < i.verticalDragRange) f.close();
else {
var m = pa.y,
n = ja;
db(
'verticalDrag',
0,
1,
300,
e.easing.cubic.out,
function (a) {
(pa.y =
(f.currItem.initialPosition.y - m) * a +
m),
Fa((1 - n) * a + n),
Ha();
}
),
Da('onVerticalDrag', 1);
}
} else {
if (($ || fa) && 0 === j) {
var o = Ub(g, R);
if (o) return;
g = 'zoomPointerUp';
}
if (!fa)
return 'swipe' !== g
? void Wb()
: void (!$ && s > f.currItem.fitRatio && Tb(R));
}
},
Sb = function () {
var a,
b,
c = {
lastFlickOffset: {},
lastFlickDist: {},
lastFlickSpeed: {},
slowDownRatio: {},
slowDownRatioReverse: {},
speedDecelerationRatio: {},
speedDecelerationRatioAbs: {},
distanceOffset: {},
backAnimDestination: {},
backAnimStarted: {},
calculateSwipeSpeed: function (d) {
ob.length > 1
? ((a = Ea() - Q + 50),
(b = ob[ob.length - 2][d]))
: ((a = Ea() - P), (b = lb[d])),
(c.lastFlickOffset[d] = kb[d] - b),
(c.lastFlickDist[d] = Math.abs(
c.lastFlickOffset[d]
)),
c.lastFlickDist[d] > 20
? (c.lastFlickSpeed[d] =
c.lastFlickOffset[d] / a)
: (c.lastFlickSpeed[d] = 0),
Math.abs(c.lastFlickSpeed[d]) < 0.1 &&
(c.lastFlickSpeed[d] = 0),
(c.slowDownRatio[d] = 0.95),
(c.slowDownRatioReverse[d] =
1 - c.slowDownRatio[d]),
(c.speedDecelerationRatio[d] = 1);
},
calculateOverBoundsAnimOffset: function (a, b) {
c.backAnimStarted[a] ||
(pa[a] > da.min[a]
? (c.backAnimDestination[a] = da.min[a])
: pa[a] < da.max[a] &&
(c.backAnimDestination[a] = da.max[a]),
void 0 !== c.backAnimDestination[a] &&
((c.slowDownRatio[a] = 0.7),
(c.slowDownRatioReverse[a] =
1 - c.slowDownRatio[a]),
c.speedDecelerationRatioAbs[a] < 0.05 &&
((c.lastFlickSpeed[a] = 0),
(c.backAnimStarted[a] = !0),
db(
'bounceZoomPan' + a,
pa[a],
c.backAnimDestination[a],
b || 300,
e.easing.sine.out,
function (b) {
(pa[a] = b), Ha();
}
))));
},
calculateAnimOffset: function (a) {
c.backAnimStarted[a] ||
((c.speedDecelerationRatio[a] =
c.speedDecelerationRatio[a] *
(c.slowDownRatio[a] +
c.slowDownRatioReverse[a] -
(c.slowDownRatioReverse[a] *
c.timeDiff) /
10)),
(c.speedDecelerationRatioAbs[a] = Math.abs(
c.lastFlickSpeed[a] *
c.speedDecelerationRatio[a]
)),
(c.distanceOffset[a] =
c.lastFlickSpeed[a] *
c.speedDecelerationRatio[a] *
c.timeDiff),
(pa[a] += c.distanceOffset[a]));
},
panAnimLoop: function () {
if (
$a.zoomPan &&
(($a.zoomPan.raf = H(c.panAnimLoop)),
(c.now = Ea()),
(c.timeDiff = c.now - c.lastNow),
(c.lastNow = c.now),
c.calculateAnimOffset('x'),
c.calculateAnimOffset('y'),
Ha(),
c.calculateOverBoundsAnimOffset('x'),
c.calculateOverBoundsAnimOffset('y'),
c.speedDecelerationRatioAbs.x < 0.05 &&
c.speedDecelerationRatioAbs.y < 0.05)
)
return (
(pa.x = Math.round(pa.x)),
(pa.y = Math.round(pa.y)),
Ha(),
void ab('zoomPan')
);
},
};
return c;
},
Tb = function (a) {
return (
a.calculateSwipeSpeed('y'),
(da = f.currItem.bounds),
(a.backAnimDestination = {}),
(a.backAnimStarted = {}),
Math.abs(a.lastFlickSpeed.x) <= 0.05 &&
Math.abs(a.lastFlickSpeed.y) <= 0.05
? ((a.speedDecelerationRatioAbs.x = a.speedDecelerationRatioAbs.y = 0),
a.calculateOverBoundsAnimOffset('x'),
a.calculateOverBoundsAnimOffset('y'),
!0)
: (bb('zoomPan'),
(a.lastNow = Ea()),
void a.panAnimLoop())
);
},
Ub = function (a, b) {
var c;
fa || (qb = m);
var d;
if ('swipe' === a) {
var g = kb.x - lb.x,
h = b.lastFlickDist.x < 10;
g > fb && (h || b.lastFlickOffset.x > 20)
? (d = -1)
: g < -fb &&
(h || b.lastFlickOffset.x < -20) &&
(d = 1);
}
var j;
d &&
((m += d),
m < 0
? ((m = i.loop ? ac() - 1 : 0), (j = !0))
: m >= ac() && ((m = i.loop ? 0 : ac() - 1), (j = !0)),
(j && !i.loop) || ((ua += d), (ra -= d), (c = !0)));
var k,
l = ta.x * ra,
n = Math.abs(l - tb.x);
return (
c || l > tb.x == b.lastFlickSpeed.x > 0
? ((k =
Math.abs(b.lastFlickSpeed.x) > 0
? n / Math.abs(b.lastFlickSpeed.x)
: 333),
(k = Math.min(k, 400)),
(k = Math.max(k, 250)))
: (k = 333),
qb === m && (c = !1),
(fa = !0),
Da('mainScrollAnimStart'),
db(
'mainScroll',
tb.x,
l,
k,
e.easing.cubic.out,
Ka,
function () {
cb(),
(fa = !1),
(qb = -1),
(c || qb !== m) && f.updateCurrItem(),
Da('mainScrollAnimComplete');
}
),
c && f.updateCurrItem(!0),
c
);
},
Vb = function (a) {
return (1 / ca) * a * t;
},
Wb = function () {
var a = s,
b = Ta(),
c = Ua();
s < b ? (a = b) : s > c && (a = c);
var d,
g = 1,
h = ja;
return ia && !S && !ka && s < b
? (f.close(), !0)
: (ia &&
(d = function (a) {
Fa((g - h) * a + h);
}),
f.zoomTo(a, 0, 200, e.easing.cubic.out, d),
!0);
};
za('Gestures', {
publicMethods: {
initGestures: function () {
var a = function (a, b, c, d, e) {
(A = a + b),
(B = a + c),
(C = a + d),
(D = e ? a + e : '');
};
(F = N.pointerEvent),
F && N.touch && (N.touch = !1),
F
? navigator.pointerEnabled
? a('pointer', 'down', 'move', 'up', 'cancel')
: a('MSPointer', 'Down', 'Move', 'Up', 'Cancel')
: N.touch
? (a('touch', 'start', 'move', 'end', 'cancel'),
(G = !0))
: a('mouse', 'down', 'move', 'up'),
(p = B + ' ' + C + ' ' + D),
(q = A),
F &&
!G &&
(G =
navigator.maxTouchPoints > 1 ||
navigator.msMaxTouchPoints > 1),
(f.likelyTouchDevice = G),
(r[A] = Ob),
(r[B] = Pb),
(r[C] = Rb),
D && (r[D] = r[C]),
N.touch &&
((q += ' mousedown'),
(p += ' mousemove mouseup'),
(r.mousedown = r[A]),
(r.mousemove = r[B]),
(r.mouseup = r[C])),
G || (i.allowPanToNext = !1);
},
},
});
var Xb,
Yb,
Zb,
$b,
_b,
ac,
bc,
cc = function (b, c, d, g) {
Xb && clearTimeout(Xb), ($b = !0), (Zb = !0);
var h;
b.initialLayout
? ((h = b.initialLayout), (b.initialLayout = null))
: (h = i.getThumbBoundsFn && i.getThumbBoundsFn(m));
var j = d ? i.hideAnimationDuration : i.showAnimationDuration,
k = function () {
ab('initialZoom'),
d
? (f.template.removeAttribute('style'),
f.bg.removeAttribute('style'))
: (Fa(1),
c && (c.style.display = 'block'),
e.addClass(a, 'pswp--animated-in'),
Da('initialZoom' + (d ? 'OutEnd' : 'InEnd'))),
g && g(),
($b = !1);
};
if (!j || !h || void 0 === h.x)
return (
Da('initialZoom' + (d ? 'Out' : 'In')),
(s = b.initialZoomLevel),
Ma(pa, b.initialPosition),
Ha(),
(a.style.opacity = d ? 0 : 1),
Fa(1),
void (j
? setTimeout(function () {
k();
}, j)
: k())
);
var n = function () {
var c = l,
g =
!f.currItem.src ||
f.currItem.loadError ||
i.showHideOpacity;
b.miniImg &&
(b.miniImg.style.webkitBackfaceVisibility = 'hidden'),
d ||
((s = h.w / b.w),
(pa.x = h.x),
(pa.y = h.y - K),
(f[g ? 'template' : 'bg'].style.opacity = 0.001),
Ha()),
bb('initialZoom'),
d && !c && e.removeClass(a, 'pswp--animated-in'),
g &&
(d
? e[(c ? 'remove' : 'add') + 'Class'](
a,
'pswp--animate_opacity'
)
: setTimeout(function () {
e.addClass(a, 'pswp--animate_opacity');
}, 30)),
(Xb = setTimeout(
function () {
if (
(Da('initialZoom' + (d ? 'Out' : 'In')), d)
) {
var f = h.w / b.w,
i = { x: pa.x, y: pa.y },
l = s,
m = ja,
n = function (b) {
1 === b
? ((s = f),
(pa.x = h.x),
(pa.y = h.y - M))
: ((s = (f - l) * b + l),
(pa.x =
(h.x - i.x) * b + i.x),
(pa.y =
(h.y - M - i.y) * b +
i.y)),
Ha(),
g
? (a.style.opacity = 1 - b)
: Fa(m - b * m);
};
c
? db(
'initialZoom',
0,
1,
j,
e.easing.cubic.out,
n,
k
)
: (n(1), (Xb = setTimeout(k, j + 20)));
} else
(s = b.initialZoomLevel),
Ma(pa, b.initialPosition),
Ha(),
Fa(1),
g ? (a.style.opacity = 1) : Fa(1),
(Xb = setTimeout(k, j + 20));
},
d ? 25 : 90
));
};
n();
},
dc = {},
ec = [],
fc = {
index: 0,
errorMsg:
'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',
forceProgressiveLoading: !1,
preload: [1, 1],
getNumItemsFn: function () {
return Yb.length;
},
},
gc = function () {
return {
center: { x: 0, y: 0 },
max: { x: 0, y: 0 },
min: { x: 0, y: 0 },
};
},
hc = function (a, b, c) {
var d = a.bounds;
(d.center.x = Math.round((dc.x - b) / 2)),
(d.center.y = Math.round((dc.y - c) / 2) + a.vGap.top),
(d.max.x = b > dc.x ? Math.round(dc.x - b) : d.center.x),
(d.max.y =
c > dc.y
? Math.round(dc.y - c) + a.vGap.top
: d.center.y),
(d.min.x = b > dc.x ? 0 : d.center.x),
(d.min.y = c > dc.y ? a.vGap.top : d.center.y);
},
ic = function (a, b, c) {
if (a.src && !a.loadError) {
var d = !c;
if (
(d &&
(a.vGap || (a.vGap = { top: 0, bottom: 0 }),
Da('parseVerticalMargin', a)),
(dc.x = b.x),
(dc.y = b.y - a.vGap.top - a.vGap.bottom),
d)
) {
var e = dc.x / a.w,
f = dc.y / a.h;
a.fitRatio = e < f ? e : f;
var g = i.scaleMode;
'orig' === g
? (c = 1)
: 'fit' === g && (c = a.fitRatio),
c > 1 && (c = 1),
(a.initialZoomLevel = c),
a.bounds || (a.bounds = gc());
}
if (!c) return;
return (
hc(a, a.w * c, a.h * c),
d &&
c === a.initialZoomLevel &&
(a.initialPosition = a.bounds.center),
a.bounds
);
}
return (
(a.w = a.h = 0),
(a.initialZoomLevel = a.fitRatio = 1),
(a.bounds = gc()),
(a.initialPosition = a.bounds.center),
a.bounds
);
},
jc = function (a, b, c, d, e, g) {
b.loadError ||
(d &&
((b.imageAppended = !0),
mc(b, d, b === f.currItem && ya),
c.appendChild(d),
g &&
setTimeout(function () {
b &&
b.loaded &&
b.placeholder &&
((b.placeholder.style.display = 'none'),
(b.placeholder = null));
}, 500)));
},
kc = function (a) {
(a.loading = !0), (a.loaded = !1);
var b = (a.img = e.createEl('pswp__img', 'img')),
c = function () {
(a.loading = !1),
(a.loaded = !0),
a.loadComplete ? a.loadComplete(a) : (a.img = null),
(b.onload = b.onerror = null),
(b = null);
};
return (
(b.onload = c),
(b.onerror = function () {
(a.loadError = !0), c();
}),
(b.src = a.src),
b
);
},
lc = function (a, b) {
if (a.src && a.loadError && a.container)
return (
b && (a.container.innerHTML = ''),
(a.container.innerHTML = i.errorMsg.replace(
'%url%',
a.src
)),
!0
);
},
mc = function (a, b, c) {
if (a.src) {
b || (b = a.container.lastChild);
var d = c ? a.w : Math.round(a.w * a.fitRatio),
e = c ? a.h : Math.round(a.h * a.fitRatio);
a.placeholder &&
!a.loaded &&
((a.placeholder.style.width = d + 'px'),
(a.placeholder.style.height = e + 'px')),
(b.style.width = d + 'px'),
(b.style.height = e + 'px');
}
},
nc = function () {
if (ec.length) {
for (var a, b = 0; b < ec.length; b++)
(a = ec[b]),
a.holder.index === a.index &&
jc(
a.index,
a.item,
a.baseDiv,
a.img,
!1,
a.clearPlaceholder
);
ec = [];
}
};
za('Controller', {
publicMethods: {
lazyLoadItem: function (a) {
a = Aa(a);
var b = _b(a);
b &&
((!b.loaded && !b.loading) || x) &&
(Da('gettingData', a, b), b.src && kc(b));
},
initController: function () {
e.extend(i, fc, !0),
(f.items = Yb = c),
(_b = f.getItemAt),
(ac = i.getNumItemsFn),
(bc = i.loop),
ac() < 3 && (i.loop = !1),
Ca('beforeChange', function (a) {
var b,
c = i.preload,
d = null === a || a >= 0,
e = Math.min(c[0], ac()),
g = Math.min(c[1], ac());
for (b = 1; b <= (d ? g : e); b++)
f.lazyLoadItem(m + b);
for (b = 1; b <= (d ? e : g); b++)
f.lazyLoadItem(m - b);
}),
Ca('initialLayout', function () {
f.currItem.initialLayout =
i.getThumbBoundsFn && i.getThumbBoundsFn(m);
}),
Ca('mainScrollAnimComplete', nc),
Ca('initialZoomInEnd', nc),
Ca('destroy', function () {
for (var a, b = 0; b < Yb.length; b++)
(a = Yb[b]),
a.container && (a.container = null),
a.placeholder && (a.placeholder = null),
a.img && (a.img = null),
a.preloader && (a.preloader = null),
a.loadError &&
(a.loaded = a.loadError = !1);
ec = null;
});
},
getItemAt: function (a) {
return a >= 0 && void 0 !== Yb[a] && Yb[a];
},
allowProgressiveImg: function () {
return (
i.forceProgressiveLoading ||
!G ||
i.mouseUsed ||
screen.width > 1200
);
},
setContent: function (a, b) {
i.loop && (b = Aa(b));
var c = f.getItemAt(a.index);
c && (c.container = null);
var d,
g = f.getItemAt(b);
if (!g) return void (a.el.innerHTML = '');
Da('gettingData', b, g), (a.index = b), (a.item = g);
var h = (g.container = e.createEl('pswp__zoom-wrap'));
if (
(!g.src &&
g.html &&
(g.html.tagName
? h.appendChild(g.html)
: (h.innerHTML = g.html)),
lc(g),
ic(g, qa),
!g.src || g.loadError || g.loaded)
)
g.src &&
!g.loadError &&
((d = e.createEl('pswp__img', 'img')),
(d.style.opacity = 1),
(d.src = g.src),
mc(g, d),
jc(b, g, h, d, !0));
else {
if (
((g.loadComplete = function (c) {
if (j) {
if (a && a.index === b) {
if (lc(c, !0))
return (
(c.loadComplete = c.img = null),
ic(c, qa),
Ia(c),
void (
a.index === m &&
f.updateCurrZoomItem()
)
);
c.imageAppended
? !$b &&
c.placeholder &&
((c.placeholder.style.display =
'none'),
(c.placeholder = null))
: N.transform && (fa || $b)
? ec.push({
item: c,
baseDiv: h,
img: c.img,
index: b,
holder: a,
clearPlaceholder: !0,
})
: jc(b, c, h, c.img, fa || $b, !0);
}
(c.loadComplete = null),
(c.img = null),
Da('imageLoadComplete', b, c);
}
}),
e.features.transform)
) {
var k = 'pswp__img pswp__img--placeholder';
k += g.msrc ? '' : ' pswp__img--placeholder--blank';
var l = e.createEl(k, g.msrc ? 'img' : '');
g.msrc && (l.src = g.msrc),
mc(g, l),
h.appendChild(l),
(g.placeholder = l);
}
g.loading || kc(g),
f.allowProgressiveImg() &&
(!Zb && N.transform
? ec.push({
item: g,
baseDiv: h,
img: g.img,
index: b,
holder: a,
})
: jc(b, g, h, g.img, !0, !0));
}
Zb || b !== m ? Ia(g) : ((ea = h.style), cc(g, d || g.img)),
(a.el.innerHTML = ''),
a.el.appendChild(h);
},
cleanSlide: function (a) {
a.img && (a.img.onload = a.img.onerror = null),
(a.loaded = a.loading = a.img = a.imageAppended = !1);
},
},
});
var oc,
pc = {},
qc = function (a, b, c) {
var d = document.createEvent('CustomEvent'),
e = {
origEvent: a,
target: a.target,
releasePoint: b,
pointerType: c || 'touch',
};
d.initCustomEvent('pswpTap', !0, !0, e),
a.target.dispatchEvent(d);
};
za('Tap', {
publicMethods: {
initTap: function () {
Ca('firstTouchStart', f.onTapStart),
Ca('touchRelease', f.onTapRelease),
Ca('destroy', function () {
(pc = {}), (oc = null);
});
},
onTapStart: function (a) {
a.length > 1 && (clearTimeout(oc), (oc = null));
},
onTapRelease: function (a, b) {
if (b && !Y && !W && !_a) {
var c = b;
if (oc && (clearTimeout(oc), (oc = null), xb(c, pc)))
return void Da('doubleTap', c);
if ('mouse' === b.type) return void qc(a, b, 'mouse');
var d = a.target.tagName.toUpperCase();
if (
'BUTTON' === d ||
e.hasClass(a.target, 'pswp__single-tap')
)
return void qc(a, b);
Ma(pc, c),
(oc = setTimeout(function () {
qc(a, b), (oc = null);
}, 300));
}
},
},
});
var rc;
za('DesktopZoom', {
publicMethods: {
initDesktopZoom: function () {
L ||
(G
? Ca('mouseUsed', function () {
f.setupDesktopZoom();
})
: f.setupDesktopZoom(!0));
},
setupDesktopZoom: function (b) {
rc = {};
var c = 'wheel mousewheel DOMMouseScroll';
Ca('bindEvents', function () {
e.bind(a, c, f.handleMouseWheel);
}),
Ca('unbindEvents', function () {
rc && e.unbind(a, c, f.handleMouseWheel);
}),
(f.mouseZoomedIn = !1);
var d,
g = function () {
f.mouseZoomedIn &&
(e.removeClass(a, 'pswp--zoomed-in'),
(f.mouseZoomedIn = !1)),
s < 1
? e.addClass(a, 'pswp--zoom-allowed')
: e.removeClass(a, 'pswp--zoom-allowed'),
h();
},
h = function () {
d && (e.removeClass(a, 'pswp--dragging'), (d = !1));
};
Ca('resize', g),
Ca('afterChange', g),
Ca('pointerDown', function () {
f.mouseZoomedIn &&
((d = !0), e.addClass(a, 'pswp--dragging'));
}),
Ca('pointerUp', h),
b || g();
},
handleMouseWheel: function (a) {
if (s <= f.currItem.fitRatio)
return (
i.modal &&
(!i.closeOnScroll || _a || V
? a.preventDefault()
: E &&
Math.abs(a.deltaY) > 2 &&
((l = !0), f.close())),
!0
);
if ((a.stopPropagation(), (rc.x = 0), 'deltaX' in a))
1 === a.deltaMode
? ((rc.x = 18 * a.deltaX), (rc.y = 18 * a.deltaY))
: ((rc.x = a.deltaX), (rc.y = a.deltaY));
else if ('wheelDelta' in a)
a.wheelDeltaX && (rc.x = -0.16 * a.wheelDeltaX),
a.wheelDeltaY
? (rc.y = -0.16 * a.wheelDeltaY)
: (rc.y = -0.16 * a.wheelDelta);
else {
if (!('detail' in a)) return;
rc.y = a.detail;
}
Sa(s, !0);
var b = pa.x - rc.x,
c = pa.y - rc.y;
(i.modal ||
(b <= da.min.x &&
b >= da.max.x &&
c <= da.min.y &&
c >= da.max.y)) &&
a.preventDefault(),
f.panTo(b, c);
},
toggleDesktopZoom: function (b) {
b = b || { x: qa.x / 2 + sa.x, y: qa.y / 2 + sa.y };
var c = i.getDoubleTapZoom(!0, f.currItem),
d = s === c;
(f.mouseZoomedIn = !d),
f.zoomTo(d ? f.currItem.initialZoomLevel : c, b, 333),
e[(d ? 'remove' : 'add') + 'Class'](
a,
'pswp--zoomed-in'
);
},
},
});
var sc,
tc,
uc,
vc,
wc,
xc,
yc,
zc,
Ac,
Bc,
Cc,
Dc,
Ec = { history: !0, galleryUID: 1 },
Fc = function () {
return Cc.hash.substring(1);
},
Gc = function () {
sc && clearTimeout(sc), uc && clearTimeout(uc);
},
Hc = function () {
var a = Fc(),
b = {};
if (a.length < 5) return b;
var c,
d = a.split('&');
for (c = 0; c < d.length; c++)
if (d[c]) {
var e = d[c].split('=');
e.length < 2 || (b[e[0]] = e[1]);
}
if (i.galleryPIDs) {
var f = b.pid;
for (b.pid = 0, c = 0; c < Yb.length; c++)
if (Yb[c].pid === f) {
b.pid = c;
break;
}
} else b.pid = parseInt(b.pid, 10) - 1;
return b.pid < 0 && (b.pid = 0), b;
},
Ic = function () {
if ((uc && clearTimeout(uc), _a || V))
return void (uc = setTimeout(Ic, 500));
vc ? clearTimeout(tc) : (vc = !0);
var a = m + 1,
b = _b(m);
b.hasOwnProperty('pid') && (a = b.pid);
var c = yc + '&gid=' + i.galleryUID + '&pid=' + a;
zc || (Cc.hash.indexOf(c) === -1 && (Bc = !0));
var d = Cc.href.split('#')[0] + '#' + c;
Dc
? '#' + c !== window.location.hash &&
history[zc ? 'replaceState' : 'pushState'](
'',
document.title,
d
)
: zc
? Cc.replace(d)
: (Cc.hash = c),
(zc = !0),
(tc = setTimeout(function () {
vc = !1;
}, 60));
};
za('History', {
publicMethods: {
initHistory: function () {
if ((e.extend(i, Ec, !0), i.history)) {
(Cc = window.location),
(Bc = !1),
(Ac = !1),
(zc = !1),
(yc = Fc()),
(Dc = 'pushState' in history),
yc.indexOf('gid=') > -1 &&
((yc = yc.split('&gid=')[0]),
(yc = yc.split('?gid=')[0])),
Ca('afterChange', f.updateURL),
Ca('unbindEvents', function () {
e.unbind(window, 'hashchange', f.onHashChange);
});
var a = function () {
(xc = !0),
Ac ||
(Bc
? history.back()
: yc
? (Cc.hash = yc)
: Dc
? history.pushState(
'',
document.title,
Cc.pathname + Cc.search
)
: (Cc.hash = '')),
Gc();
};
Ca('unbindEvents', function () {
l && a();
}),
Ca('destroy', function () {
xc || a();
}),
Ca('firstUpdate', function () {
m = Hc().pid;
});
var b = yc.indexOf('pid=');
b > -1 &&
((yc = yc.substring(0, b)),
'&' === yc.slice(-1) && (yc = yc.slice(0, -1))),
setTimeout(function () {
j &&
e.bind(
window,
'hashchange',
f.onHashChange
);
}, 40);
}
},
onHashChange: function () {
return Fc() === yc
? ((Ac = !0), void f.close())
: void (vc || ((wc = !0), f.goTo(Hc().pid), (wc = !1)));
},
updateURL: function () {
Gc(), wc || (zc ? (sc = setTimeout(Ic, 800)) : Ic());
},
},
}),
e.extend(f, eb);
};
return a;
});
File mode changed
// A custom Nightwatch assertion.
// the name of the method is the filename.
// can be used in tests like this:
//
// browser.assert.elementCount(selector, count)
//
// for how to write custom assertions see
// http://nightwatchjs.org/guide#writing-custom-assertions
exports.assertion = function (selector, count) {
this.message = 'Testing if element <' + selector + '> has count: ' + count
this.expected = count
this.pass = function (val) {
return val === this.expected
}
this.value = function (res) {
return res.value
}
this.command = function (cb) {
var self = this
return this.api.execute(function (selector) {
return document.querySelectorAll(selector).length
}, [selector], function (res) {
cb.call(self, res)
})
}
}
require('babel-register')
var config = require('../../build/config')
var requireContext = require('../../src/libraries/packages/npms/require-context')
var list = requireContext('../../src', true, /tests\/e2e\//)
console.log('============== --------- e2e test list ===============')
console.log(list)
// http://nightwatchjs.org/gettingstarted#settings-file
module.exports = {
src_folders: ['test/e2e/specs'],
// src_folders: list,
output_folder: 'test/e2e/reports',
custom_assertions_path: ['test/e2e/custom-assertions'],
selenium: {
start_process: true,
server_path: require('selenium-server').path,
host: '127.0.0.1',
port: 4444,
cli_args: {
'webdriver.chrome.driver': require('chromedriver').path
}
},
test_settings: {
default: {
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
globals: {
devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
}
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true
}
},
firefox: {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
}
}
}
}
// 1. start the dev server using production config
process.env.NODE_ENV = 'testing'
var server = require('../../build/dev-server.js')
server.ready.then(() => {
// 2. run the nightwatch test suite against it
// to run in additional browsers:
// 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings"
// 2. add it to the --env flag below
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
// For more information on Nightwatch's config file, see
// http://nightwatchjs.org/guide#settings-file
var opts = process.argv.slice(2)
if (opts.indexOf('--config') === -1) {
opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
}
if (opts.indexOf('--env') === -1) {
opts = opts.concat(['--env', 'chrome'])
}
var spawn = require('cross-spawn')
var runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
runner.on('exit', function (code) {
server.close()
process.exit(code)
})
runner.on('error', function (err) {
server.close()
throw err
})
})
// For authoring Nightwatch tests, see
// http://nightwatchjs.org/guide#usage
module.exports = {
'default e2e tests': function (browser) {
// automatically uses dev Server port from /config.index.js
// default: http://localhost:8080
// see nightwatch.conf.js
const devServer = browser.globals.devServerURL
browser
.url(devServer)
.waitForElementVisible('#app', 5000)
.assert.elementPresent('.hello')
.assert.containsText('h1', 'Welcome to Your Vue.js App')
.assert.elementCount('img', 1)
.end()
}
}
{
"env": {
"mocha": true
},
"globals": {
"expect": true,
"sinon": true
}
}
import Vue from 'vue'
Vue.config.productionTip = false
// require all test files (files that ends with .spec.js)
const testsContext = require.context('../../src', true, /tests\/unit\/.*\.spec$/)
testsContext.keys().forEach(testsContext)
// require all src files except main.js for coverage.
// you can also change this to match only the subset of files that
// you want coverage for.
// const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/)
// srcContext.keys().forEach(srcContext)
console.log('============== --------- unit test list ===============')
console.log(testsContext.keys())
// This is a karma config file. For more details see
// http://karma-runner.github.io/0.13/config/configuration-file.html
// we are also using it with karma-webpack
// https://github.com/webpack/karma-webpack
var webpackConfig = require('../../build/webpack.test.conf')
module.exports = function (config) {
config.set({
// to run in additional browsers:
// 1. install corresponding karma launcher
// http://karma-runner.github.io/0.13/config/browsers.html
// 2. add it to the `browsers` array below.
browsers: ['PhantomJS'],
frameworks: ['mocha', 'sinon-chai', 'phantomjs-shim'],
reporters: ['spec', 'coverage'],
files: ['./index.js'],
preprocessors: {
'./index.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true
},
coverageReporter: {
dir: './coverage',
reporters: [
{ type: 'lcov', subdir: '.' },
{ type: 'text-summary' }
]
}
})
}
import Vue from 'vue'
import Hello from '@/components/Hello'
describe('Hello.vue', () => {
it('should render correct contents', () => {
const Constructor = Vue.extend(Hello)
const vm = new Constructor().$mount()
expect(vm.$el.querySelector('.hello h1').textContent)
.to.equal('Welcome to Your Vue.js App')
})
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment