Commit 35860001 by 郑艺斌

Initial commit

parents
Showing with 4886 additions and 0 deletions
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"]
}
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:vue/essential"
],
"settings": {
"html/html-extensions": [".html", ".vue"]
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"vue",
"html"
],
"rules": {
"no-dupe-keys": "error",
"no-useless-computed-key": "error",
"no-unused-vars": ["error", { "vars": "all", "args": "all" }],
"vue/no-dupe-keys": ["error", {
"groups": []
}]
}
}
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
dist.zip
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
# coordination
> A Vue.js project
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev sudo docker login --username= registry.cn-hangzhou.aliyuncs.com
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
```
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
'use strict'
require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
const spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}
module.exports = function () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}
export default "development";
\ No newline at end of file
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')
exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}
'use strict'
const utils = require('./utils')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'
const sourceMapEnabled = isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap
module.exports = {
loaders: utils.cssLoaders({
sourceMap: sourceMapEnabled,
extract: isProduction
}),
cssSourceMap: sourceMapEnabled,
cacheBusting: config.dev.cacheBusting,
transformToRequire: {
video: ['src', 'poster'],
source: 'src',
img: 'src',
image: 'xlink:href'
}
}
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: ['babel-polyfill','./src/main.js']
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
},
{
test: /\.less$/,
loader: "style-loader!css-loader!less-loader"
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
const devWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
: undefined
}))
resolve(devWebpackConfig)
}
})
})
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const env = require('../config/prod.env')
const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vendor modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks (module) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
// '/apiHost': {
// // target: 'http://rap2api.taobao.org/app/mock/20325',
// //target: 'http://128.21.2.4:8080',
// // target: 'http://128.9.4.121:8063',
// target: 'https://emaint.ahjarzeng.com',
// changeOrigin: true,
// pathRewrite: {
// '^/apiHost': ''
// }
// },
},
// Various Dev Server settings
//host: 'localhost', // can be overwritten by process.env.HOST
host: '0.0.0.0',
port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
/**
* Source Maps
*/
productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}
'use strict'
module.exports = {
NODE_ENV: '"production"'
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>特房E运维管理系统</title>
<style>
span.ivu-spin-dot{
margin: 10px auto !important;
}
</style>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
This diff could not be displayed because it is too large.
{
"name": "coordination",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "ywx <youwx@xmmakeit.com>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.18.0",
"iview": "^2.14.3",
"js-cookie": "^2.2.1",
"less": "^3.9.0",
"less-loader": "^5.0.0",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuex": "^3.6.2"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"eslint": "^6.5.1",
"eslint-plugin-html": "^6.0.0",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^5.2.3",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>
import Bus from './bus.js';
import './assets/css/login.css'; // 使用 CSS
export default {
name: 'App',
data() {
return {
ws: '',
isok: false,
lockReconnect: false, //是否真正建立连接
timeout: 28 * 1000, //30秒一次心跳
timeoutObj: null, //心跳心跳倒计时
serverTimeoutObj: null, //心跳倒计时
timeoutnum: null //断开 重连倒计时
};
},
created() {
if (sessionStorage.getItem('token') != null) {
this.webConnect();
}
Bus.$on('changeUserToken', value => {
if(value != undefined && value != null && value != ''){
this.webConnect();
}
});
},
beforeMount() {
Bus.$on('webConnect', msg => {
if (msg == 'connect') {
this.webConnect();
} else if (msg == 'close') {
this.ws.close();
}
});
},
destroyed: function () {
//页面销毁时关闭长连接
this.onclose();
},
methods: {
webConnect() {
// 创建ws实例
if (window.WebSocket != null) {
this.ws = new WebSocket(
// 'ws://localhost:8063/api/websocket/' + sessionStorage.getItem('userID')
'wss://emaint.xmtf.com/v2/api/websocket/' + sessionStorage.getItem('userID')
);
this.ws.onopen = this.onopen; // 连接成功后执行的方法
this.ws.onerror = this.onerror; // 连接出错后执行的方法
this.ws.onclose = this.onclose; // 连接关闭后执行的方法
this.ws.onmessage = this.message; // 监听接收到的消息
} else if (window.WebSocket == null) {
this.$Message.error('您的浏览器不支持websocket');
}
},
message(e) {
if (e.data == 'heartCheck') {
return;
}
var data = JSON.parse(e.data)
console.log(data)
this.reset(); //收到消息重置心跳
// e.data是收到的消息内容,会以json字符串的形式传过来
// 收到消息后弹窗
if (data.type == 2 && e.data != 'heartCheck') {
this.$Notice.warning({
title: '来电通知',
duration: 0,
name: data.message,
render: h => {
return h('span', [
data.source + " : " + data.message,
h('br'),
h(
'Button',
{
props: {
type: 'primary',
size: 'small',
},
style: {
marginTop: '10px',
float: 'right'
},
on: {
click: () => {
if (this.isok)
return;
else this.isok = true;
Bus.$emit('changephone', data.message)
this.$router.push({
name: 'transfer',
query: {
callID: data.message,
}
});
this.isok = false;
this.$Notice.close(data.message)
}
}
},
'去新增工单'
),
])
}
});
} else if (data.type == 1 && e.data != 'heartCheck') {
this.$Notice.warning({
title: '小程序报修',
duration: 0,
name: data.repairProblemId,
render: h => {
return h('span', [
data.message,
h('br'),
h(
'Button',
{
props: {
type: 'primary',
size: 'small',
},
style: {
marginTop: '10px',
float: 'right'
},
on: {
click: () => {
if (this.isok)
return;
else this.isok = true;
sessionStorage.setItem('orderId4Edit', data.repairProblemId)
if (this.$route.name == 'workOrderEdit') {
Bus.$emit('changeOrderId4Edit', data.repairProblemId)
this.isok = false;
}
else {
this.$router.push({
name: 'workOrderEdit',
params: {
id: data.repairProblemId
}
});
this.isok = false;
}
this.$Notice.close(data.repairProblemId)
}
}
},
'立即处理'
),
])
}
});
}
},
send() {
this.ws.send('要发送的内容,要用字符串格式');
},
onopen() {
console.log('websocket已连接');
this.start();
},
onerror() {
this.$Message.error('websocket连接失败');
this.reconnect();
},
onclose() {
console.log('websocket已关闭');
this.reconnect();
},
reconnect() {
//重新连接
var that = this;
if (that.lockReconnect) {
//如果正在连接了就退出重连。
return;
}
that.lockReconnect = true;
//没连接上会一直重连,设置延迟避免请求过多
that.timeoutnum && clearTimeout(that.timeoutnum); //如果在计时期间。就先清空计时器
/*that.timeoutnum = setTimeout(function () {
//5秒后开启新连接
//新连接
that.webConnect();
that.lockReconnect = false;
}, 5000);*/
that.timeoutnum = setTimeout(function () {
//1秒后开启新连接
//新连接
that.webConnect();
that.lockReconnect = false;
}, 1000);
},
reset() {
//重置心跳
var that = this;
//清除时间
clearTimeout(that.timeoutObj);
clearTimeout(that.serverTimeoutObj);
//重启心跳
that.start();
},
start() {
//开启心跳
var self = this;
self.timeoutObj && clearTimeout(self.timeoutObj); //如果心跳已经在倒计时就停止倒计时
self.serverTimeoutObj && clearTimeout(self.serverTimeoutObj); //心跳超时计时
self.timeoutObj = setTimeout(function () {
//这里发送一个心跳,后端收到后,返回一个心跳消息,
if (self.ws.readyState == 1) {
//如果连接正常readyState为1 表示连接状态正常
self.ws.send('heartCheck');
} else {
//否则重连
self.reconnect();
}
self.serverTimeoutObj = setTimeout(function () {
//超时关闭
self.ws.close();
}, self.timeout);
}, self.timeout);
}
}
};
</script>
<style>
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/*text-align: center;*/
color: #2c3e50;
margin-top: 60px;
}
.buttoninput input {
cursor: pointer !important;
}
.ivu-select-dropdown {
max-height: 200px;
overflow-y: auto;
}
.ivu-tree-title {
font-size: 14px !important;
}
.ivu-input[disabled], fieldset[disabled] .ivu-input {
border: none !important;
background-color: unset !important;
color: black !important;
cursor: default !important;
}
.ivu-table-border td, .ivu-table-border th {
text-align: center !important;
}
.ivu-tabs-bar {
margin-bottom: 0px !important;
}
.mt10 div.ivu-card-body {
padding-top: 10px !important;
}
#workDetailtooltip .ivu-tooltip-rel {
max-width: 100% !important;
}
.ivu-notice {
width: 200px !important;
}
/* .ivu-table-cell{
white-space: nowrap;
} */
</style>
#app{
margin-top: 0;
}
.app-main {
height: 100vh;
}
.login {
width: 100%;
height: 100%;
background-image: url('./../img/login_bg.jpg');
background-size:100% 100%;
background-position: center;
background-repeat: no-repeat;
position: relative;
}
.login-con {
position: absolute;
right: 160px;
top: 50%;
transform: translateY(-60%);
width: 300px;
}
.login-con-header {
font-size: 16px;
font-weight: 300;
text-align: center;
padding: 30px 0;
}
.login-con .form-con {
padding: 10px 0 0;
}
.login-con .login-tip {
font-size: 10px;
text-align: center;
color: #c3c3c3;
}
.img_wrap {
cursor: pointer;
}
.codeL {
float: left;
margin-right: 10px;
width: 40%;
}
.codeR {
float: left;
width: 50%;
}
.padding_b {
height: 34px;
padding-bottom: 2px;
}
.lock-screen-back {
border-radius: 50%;
z-index: -1;
box-shadow: 0 0 0 0 #667aa6 inset;
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
transition: all 3s;
}
.main {
position: absolute;
width: 100%;
height: 100%;
}
.main .unlock-con {
width: 0px;
height: 0px;
position: absolute;
left: 50%;
top: 50%;
z-index: 11000;
}
.main .sidebar-menu-con {
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 21;
transition: width .3s;
}
.main .layout-text {
display: inline-block;
white-space: nowrap;
position: absolute;
}
.main .main-hide-text .layout-text {
display: none;
}
.main-content-container {
position: relative;
}
.main-header-con {
box-sizing: border-box;
position: fixed;
display: block;
padding-left: 200px;
width: 100%;
height: 100px;
z-index: 20;
box-shadow: 0 2px 1px 1px rgba(100, 100, 100, 0.1);
transition: padding .3s;
}
.main-breadcrumb {
padding: 8px 15px 0;
}
.main-menu-left {
background: #464c5b;
height: 100%;
}
.main .tags-con {
height: 40px;
z-index: -1;
background: #f0f0f0;
}
.main .tags-con .tags-outer-scroll-con {
position: relative;
box-sizing: border-box;
padding-right: 120px;
width: 100%;
height: 100%;
}
.main .tags-con .tags-outer-scroll-con .tags-inner-scroll-body {
position: absolute;
padding: 2px 10px;
overflow: visible;
white-space: nowrap;
transition: left .3s ease;
}
.main .tags-con .tags-outer-scroll-con .close-all-tag-con {
position: absolute;
right: 0;
top: 0;
box-sizing: border-box;
padding-top: 8px;
text-align: center;
width: 110px;
height: 100%;
background: white;
box-shadow: -3px 0 15px 3px rgba(0, 0, 0, 0.1);
z-index: 10;
}
.main-header {
height: 60px;
background: #fff;
box-shadow: 0 2px 1px 1px rgba(100, 100, 100, 0.1);
position: relative;
z-index: 11;
}
.main-header .navicon-con {
margin: 6px;
display: inline-block;
}
.main-header .header-middle-con {
position: absolute;
left: 60px;
top: 0;
right: 340px;
bottom: 0;
padding: 10px;
overflow: hidden;
}
.main-header .header-avator-con {
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 600px;
}
.main-header .header-avator-con .switch-theme-con {
display: inline-block;
width: 40px;
height: 100%;
}
.main-header .header-avator-con .message-con {
display: inline-block;
width: 30px;
padding: 18px 0;
text-align: center;
cursor: pointer;
}
.main-header .header-avator-con .message-con i {
vertical-align: middle;
}
.main-header .header-avator-con .change-skin {
font-size: 14px;
font-weight: 500;
padding-right: 5px;
}
.main-header .header-avator-con .switch-theme {
height: 100%;
}
.main-header .header-avator-con .user-dropdown-menu-con {
position: absolute;
right: 0;
top: 0;
width: 150px;
height: 100%;
}
.main-header .header-avator-con .user-dropdown-menu-con .main-user-name {
display: inline-block;
width: 80px;
word-break: keep-all;
white-space: nowrap;
vertical-align: middle;
overflow: hidden;
text-overflow: ellipsis;
text-align: right;
}
.main-header .header-avator-con .user-dropdown-innercon {
height: 100%;
padding-right: 14px;
}
.main-header .header-avator-con .full-screen-btn-con {
display: inline-block;
width: 30px;
padding: 18px 0;
text-align: center;
cursor: pointer;
}
.main-header .header-avator-con .full-screen-btn-con i {
vertical-align: middle;
}
.main-header .header-avator-con .lock-screen-btn-con {
display: inline-block;
width: 30px;
padding: 18px 0;
text-align: center;
cursor: pointer;
}
.main-header .header-avator-con .lock-screen-btn-con i {
vertical-align: middle;
}
.main .single-page-con {
position: absolute;
top: 100px;
right: 0;
bottom: 0;
overflow: auto;
background-color: #F0F0F0;
z-index: 1;
transition: left .3s;
}
.main .single-page-con .single-page {
margin: 10px;
}
.main-copy {
text-align: center;
padding: 10px 0 20px;
color: #9ea7b4;
}
.taglist-moving-animation-move {
transition: transform .3s;
}
.logo-con {
padding: 8px;
text-align: center;
}
.logo-con img {
height: 44px;
width: auto;
}
.ivu-shrinkable-menu {
height: 100%;
width: 100%;
}
li.ivu-menu-item{
text-align: left;
}
div.ivu-menu-submenu-title{
text-align: left;
}
\ No newline at end of file
#app{
margin-top: 0!important;
}
.main-header{
text-align: left;
}
.main-header-con {
box-sizing: border-box;
position: fixed;
display: block;
padding-left: 200px;
width: 100%;
height: 100px;
z-index: 20;
box-shadow: 0 2px 1px 1px rgba(100, 100, 100, 0.1);
transition: padding .3s;
}
.main .single-page-con {
position: absolute;
top: 100px;
right: 0;
bottom: 0;
overflow: auto;
background-color: #F0F0F0;
z-index: 1;
transition: left .3s;
}
.ivu-tag{
margin-top: 0;
}
.ivu-card-head{
text-align: left;
}
.search-form .ivu-form-item{
margin-bottom: 16px;
}
.search-row{
display: flex;
justify-content: space-between;
}
table{
min-width: 100%;
}
.searchable-table-con{
margin-top: 16px;
}
.form-required .ivu-form-item-label:before {
content: '*';
display: inline-block;
margin-right: 4px;
line-height: 1;
font-family: SimSun;
font-size: 12px;
color: #ed3f14;
}
.modal-form .ivu-form-item{
margin-bottom: 10px;
}
.search-icon{
position: absolute;
right: 16px;
}
.text-left{
text-align: left;
}
.text-right{
text-align: right;
}
.logo-img{
height: 44px;
color: white;
font-size: 22px;
line-height: 44px;
border-radius: 2px;
}
.bold-label{
display: inline-block;
width: 100px;
text-align: right;
font-weight: bold;
padding-right: 12px;
font-size: 14px;
padding-bottom: 10px;
}
.light-label{
display: inline-block;
width: 100px;
text-align: right;
padding-right: 12px;
font-size: 12px;
padding-bottom: 10px;
font-weight: bold;
}
.fs18{font-size: 18px;}
.widthp100{width:100%;}
.wauto{width: auto;}
.w200{width: 200px;}
.ml20{margin-left: 20px;}
.ml10{margin-left: 10px;}
.mr10{margin-right:10px}
.mt10{margin-top: 10px;}
.mt15{margin-top: 15px;}
.mt25{margin-top: 25px;}
.mb16{margin-bottom: 16px;}
.mb0{margin-bottom: 0!important;}
.mb10{margin-bottom: 10px!important;}
.pr0{padding-right: 0}
.pl0{padding-left: 0!important}
.h140{height: 140px;}
.h152{height: 152px;}
.h252{height: 252px;}
.red{color: red;}
.grey{color:grey;}
.border-wrap{border:1px solid #ddd;}
.mh1{min-height: 1px;}
.box{
margin-top: 10px;
position: relative;
}
.box i{
position: absolute;
right: 2px;
top: 0;
}
.setModal .ivu-form-item{
margin-bottom: 0;
}
.setModal .light-label{
height: 32px;
line-height: 32px;
padding-bottom: 0;
font-weight: bold;
}
.setModal .bold-label{
line-height: 32px;
padding-bottom: 0;
}
.divide-line{
height: 1px;
background:#e9eaec;
margin-top: 10px;
margin-bottom: 10px;
}
@media (max-width: 768px){
.ivu-modal {
width:270px!important;
margin: 0 auto!important;
}
}
.alert-modal .ivu-modal{
/*top:250px!important;*/
position: absolute;
top: 50%;
margin-top: -75px!important;
left: 50%;
margin-left: -135px!important;
}
.alert-modal .ivu-modal-content{
/*height: 150px;*/
}
.alert-button{
position: relative;
display: inline-block;
font-size: 0.7rem;
font-weight: 400;
font-family: inherit;
text-decoration: none;
text-align: center;
margin: 0;
background: #dddddd;
padding: 0 0.6rem;
height: 1.5rem;
line-height: 1.5rem;
border-radius: 0.2rem;
white-space: nowrap;
text-overflow: ellipsis;
vertical-align: middle;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.l-alert-btn{
position: relative;
display: inline-block;
font-weight: 400;
font-family: inherit;
text-decoration: none;
text-align: center;
margin: 0;
padding: 0 0.6rem;
height: 2rem;
line-height: 1.5rem;
border-radius: 0.2rem;
white-space: nowrap;
text-overflow: ellipsis;
vertical-align: middle;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background:#d61518!important;
color:white;
font-size: 18px!important;
}
.large-modal .ivu-modal{
top:160px;
}
.validModal .modal-form .ivu-form-item{
margin-bottom: 15px;
}
.l-validModal .modal-form .ivu-form-item{
margin-bottom: 22px;
}
.card-note{
font-size: 35px;
line-height: 252px;
text-align: center;
font-weight: bold;
}
.ivu-menu-vertical i{
width:12px;
height:12px;
}
/*新增*/
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="1361px" height="609px" viewBox="0 0 1361 609" 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>Group 21</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Ant-Design-Pro-3.0" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="账户密码登录-校验" transform="translate(-79.000000, -82.000000)">
<g id="Group-21" transform="translate(77.000000, 73.000000)">
<g id="Group-18" opacity="0.8" transform="translate(74.901416, 569.699158) rotate(-7.000000) translate(-74.901416, -569.699158) translate(4.901416, 525.199158)">
<ellipse id="Oval-11" fill="#CFDAE6" opacity="0.25" cx="63.5748792" cy="32.468367" rx="21.7830479" ry="21.766008"></ellipse>
<ellipse id="Oval-3" fill="#CFDAE6" opacity="0.599999964" cx="5.98746479" cy="13.8668601" rx="5.2173913" ry="5.21330997"></ellipse>
<path d="M38.1354514,88.3520215 C43.8984227,88.3520215 48.570234,83.6838647 48.570234,77.9254015 C48.570234,72.1669383 43.8984227,67.4987816 38.1354514,67.4987816 C32.3724801,67.4987816 27.7006688,72.1669383 27.7006688,77.9254015 C27.7006688,83.6838647 32.3724801,88.3520215 38.1354514,88.3520215 Z" id="Oval-3-Copy" fill="#CFDAE6" opacity="0.45"></path>
<path d="M64.2775582,33.1704963 L119.185836,16.5654915" id="Path-12" stroke="#CFDAE6" stroke-width="1.73913043" stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M42.1431708,26.5002681 L7.71190162,14.5640702" id="Path-16" stroke="#E0B4B7" stroke-width="0.702678964" opacity="0.7" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="1.405357899873153,2.108036953469981"></path>
<path d="M63.9262187,33.521561 L43.6721326,69.3250951" id="Path-15" stroke="#BACAD9" stroke-width="0.702678964" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="1.405357899873153,2.108036953469981"></path>
<g id="Group-17" transform="translate(126.850922, 13.543654) rotate(30.000000) translate(-126.850922, -13.543654) translate(117.285705, 4.381889)" fill="#CFDAE6">
<ellipse id="Oval-4" opacity="0.45" cx="9.13482653" cy="9.12768076" rx="9.13482653" ry="9.12768076"></ellipse>
<path d="M18.2696531,18.2553615 C18.2696531,13.2142826 14.1798519,9.12768076 9.13482653,9.12768076 C4.08980114,9.12768076 0,13.2142826 0,18.2553615 L18.2696531,18.2553615 Z" id="Oval-4" transform="translate(9.134827, 13.691521) scale(-1, -1) translate(-9.134827, -13.691521) "></path>
</g>
</g>
<g id="Group-14" transform="translate(216.294700, 123.725600) rotate(-5.000000) translate(-216.294700, -123.725600) translate(106.294700, 35.225600)">
<ellipse id="Oval-2" fill="#CFDAE6" opacity="0.25" cx="29.1176471" cy="29.1402439" rx="29.1176471" ry="29.1402439"></ellipse>
<ellipse id="Oval-2" fill="#CFDAE6" opacity="0.3" cx="29.1176471" cy="29.1402439" rx="21.5686275" ry="21.5853659"></ellipse>
<ellipse id="Oval-2-Copy" stroke="#CFDAE6" opacity="0.4" cx="179.019608" cy="138.146341" rx="23.7254902" ry="23.7439024"></ellipse>
<ellipse id="Oval-2" fill="#BACAD9" opacity="0.5" cx="29.1176471" cy="29.1402439" rx="10.7843137" ry="10.7926829"></ellipse>
<path d="M29.1176471,39.9329268 L29.1176471,18.347561 C23.1616351,18.347561 18.3333333,23.1796097 18.3333333,29.1402439 C18.3333333,35.1008781 23.1616351,39.9329268 29.1176471,39.9329268 Z" id="Oval-2" fill="#BACAD9"></path>
<g id="Group-9" opacity="0.45" transform="translate(172.000000, 131.000000)" fill="#E6A1A6">
<ellipse id="Oval-2-Copy-2" cx="7.01960784" cy="7.14634146" rx="6.47058824" ry="6.47560976"></ellipse>
<path d="M0.549019608,13.6219512 C4.12262681,13.6219512 7.01960784,10.722722 7.01960784,7.14634146 C7.01960784,3.56996095 4.12262681,0.670731707 0.549019608,0.670731707 L0.549019608,13.6219512 Z" id="Oval-2-Copy-2" transform="translate(3.784314, 7.146341) scale(-1, 1) translate(-3.784314, -7.146341) "></path>
</g>
<ellipse id="Oval-10" fill="#CFDAE6" cx="218.382353" cy="138.685976" rx="1.61764706" ry="1.61890244"></ellipse>
<ellipse id="Oval-10-Copy-2" fill="#E0B4B7" opacity="0.35" cx="179.558824" cy="175.381098" rx="1.61764706" ry="1.61890244"></ellipse>
<ellipse id="Oval-10-Copy" fill="#E0B4B7" opacity="0.35" cx="180.098039" cy="102.530488" rx="2.15686275" ry="2.15853659"></ellipse>
<path d="M28.9985381,29.9671598 L171.151018,132.876024" id="Path-11" stroke="#CFDAE6" opacity="0.8"></path>
</g>
<g id="Group-10" opacity="0.799999952" transform="translate(1054.100635, 36.659317) rotate(-11.000000) translate(-1054.100635, -36.659317) translate(1026.600635, 4.659317)">
<ellipse id="Oval-7" stroke="#CFDAE6" stroke-width="0.941176471" cx="43.8135593" cy="32" rx="11.1864407" ry="11.2941176"></ellipse>
<g id="Group-12" transform="translate(34.596774, 23.111111)" fill="#BACAD9">
<ellipse id="Oval-7" opacity="0.45" cx="9.18534718" cy="8.88888889" rx="8.47457627" ry="8.55614973"></ellipse>
<path d="M9.18534718,17.4450386 C13.8657264,17.4450386 17.6599235,13.6143199 17.6599235,8.88888889 C17.6599235,4.16345787 13.8657264,0.332739156 9.18534718,0.332739156 L9.18534718,17.4450386 Z" id="Oval-7"></path>
</g>
<path d="M34.6597385,24.809694 L5.71666084,4.76878945" id="Path-2" stroke="#CFDAE6" stroke-width="0.941176471"></path>
<ellipse id="Oval" stroke="#CFDAE6" stroke-width="0.941176471" cx="3.26271186" cy="3.29411765" rx="3.26271186" ry="3.29411765"></ellipse>
<ellipse id="Oval-Copy" fill="#F7E1AD" cx="2.79661017" cy="61.1764706" rx="2.79661017" ry="2.82352941"></ellipse>
<path d="M34.6312443,39.2922712 L5.06366663,59.785082" id="Path-10" stroke="#CFDAE6" stroke-width="0.941176471"></path>
</g>
<g id="Group-19" opacity="0.33" transform="translate(1282.537219, 446.502867) rotate(-10.000000) translate(-1282.537219, -446.502867) translate(1142.537219, 327.502867)">
<g id="Group-17" transform="translate(141.333539, 104.502742) rotate(275.000000) translate(-141.333539, -104.502742) translate(129.333539, 92.502742)" fill="#BACAD9">
<circle id="Oval-4" opacity="0.45" cx="11.6666667" cy="11.6666667" r="11.6666667"></circle>
<path d="M23.3333333,23.3333333 C23.3333333,16.8900113 18.1099887,11.6666667 11.6666667,11.6666667 C5.22334459,11.6666667 0,16.8900113 0,23.3333333 L23.3333333,23.3333333 Z" id="Oval-4" transform="translate(11.666667, 17.500000) scale(-1, -1) translate(-11.666667, -17.500000) "></path>
</g>
<circle id="Oval-5-Copy-6" fill="#CFDAE6" cx="201.833333" cy="87.5" r="5.83333333"></circle>
<path d="M143.5,88.8126685 L155.070501,17.6038544" id="Path-17" stroke="#BACAD9" stroke-width="1.16666667"></path>
<path d="M17.5,37.3333333 L127.466252,97.6449735" id="Path-18" stroke="#BACAD9" stroke-width="1.16666667"></path>
<polyline id="Path-19" stroke="#CFDAE6" stroke-width="1.16666667" points="143.902597 120.302281 174.935455 231.571342 38.5 147.510847 126.366941 110.833333"></polyline>
<path d="M159.833333,99.7453842 L195.416667,89.25" id="Path-20" stroke="#E0B4B7" stroke-width="1.16666667" opacity="0.6"></path>
<path d="M205.333333,82.1372105 L238.719406,36.1666667" id="Path-24" stroke="#BACAD9" stroke-width="1.16666667"></path>
<path d="M266.723424,132.231988 L207.083333,90.4166667" id="Path-25" stroke="#CFDAE6" stroke-width="1.16666667"></path>
<circle id="Oval-5" fill="#C1D1E0" cx="156.916667" cy="8.75" r="8.75"></circle>
<circle id="Oval-5-Copy-3" fill="#C1D1E0" cx="39.0833333" cy="148.75" r="5.25"></circle>
<circle id="Oval-5-Copy-2" fill-opacity="0.6" fill="#D1DEED" cx="8.75" cy="33.25" r="8.75"></circle>
<circle id="Oval-5-Copy-4" fill-opacity="0.6" fill="#D1DEED" cx="243.833333" cy="30.3333333" r="5.83333333"></circle>
<circle id="Oval-5-Copy-5" fill="#E0B4B7" cx="175.583333" cy="232.75" r="5.25"></circle>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
var CreatedOKLodop7766=null;
// alert(2222);
//====判断是否需要安装CLodop云打印服务器:====
function needCLodop(){
try{
var ua=navigator.userAgent;
if (ua.match(/Windows\sPhone/i) !=null) return true;
if (ua.match(/iPhone|iPod/i) != null) return true;
if (ua.match(/Android/i) != null) return true;
if (ua.match(/Edge\D?\d+/i) != null) return true;
var verTrident=ua.match(/Trident\D?\d+/i);
var verIE=ua.match(/MSIE\D?\d+/i);
var verOPR=ua.match(/OPR\D?\d+/i);
var verFF=ua.match(/Firefox\D?\d+/i);
var x64=ua.match(/x64/i);
if ((verTrident==null)&&(verIE==null)&&(x64!==null))
return true; else
if ( verFF !== null) {
verFF = verFF[0].match(/\d+/);
if ((verFF[0]>= 42)||(x64!==null)) return true;
} else
if ( verOPR !== null) {
verOPR = verOPR[0].match(/\d+/);
if ( verOPR[0] >= 32 ) return true;
} else
if ((verTrident==null)&&(verIE==null)) {
var verChrome=ua.match(/Chrome\D?\d+/i);
if ( verChrome !== null ) {
verChrome = verChrome[0].match(/\d+/);
if (verChrome[0]>=42) return true;
};
};
return false;
} catch(err) {return true;};
};
//====页面引用CLodop云打印必须的JS文件:====
if (needCLodop()) {
var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
var oscript = document.createElement("script");
oscript.src ="http://localhost:8000/CLodopfuncs.js?priority=1";
head.insertBefore( oscript,head.firstChild );
//引用双端口(8000和18000)避免其中某个被占用:
oscript = document.createElement("script");
oscript.src ="http://localhost:18000/CLodopfuncs.js?priority=0";
head.insertBefore( oscript,head.firstChild );
};
//====获取LODOP对象的主过程:====
function getLodop(oOBJECT,oEMBED){
var strHtmInstall="<br><font color='#FF00FF'>打印控件未安装!点击这里<a href='install_lodop32.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。</font>";
var strHtmUpdate="<br><font color='#FF00FF'>打印控件需要升级!点击这里<a href='install_lodop32.exe' target='_self'>执行升级</a>,升级后请重新进入。</font>";
var strHtm64_Install="<br><font color='#FF00FF'>打印控件未安装!点击这里<a href='install_lodop64.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。</font>";
var strHtm64_Update="<br><font color='#FF00FF'>打印控件需要升级!点击这里<a href='install_lodop64.exe' target='_self'>执行升级</a>,升级后请重新进入。</font>";
var strHtmFireFox="<br><br><font color='#FF00FF'>(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)</font>";
var strHtmChrome="<br><br><font color='#FF00FF'>(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)</font>";
var strCLodopInstall="<br><font color='#FF00FF'>CLodop云打印服务(localhost本地)未安装启动!点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>执行安装</a>,安装后请刷新页面。</font>";
var strCLodopUpdate="<br><font color='#FF00FF'>CLodop云打印服务需升级!点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>,升级后请刷新页面。</font>";
var LODOP;
try{
var isIE = (navigator.userAgent.indexOf('MSIE')>=0) || (navigator.userAgent.indexOf('Trident')>=0);
if (needCLodop()) {
try{ LODOP=getCLodop();} catch(err) {};
if (!LODOP && document.readyState!=="complete") {alert("C-Lodop没准备好,请稍后再试!"); return;};
if (!LODOP) {
if (isIE) document.write(strCLodopInstall); else
document.documentElement.innerHTML=strCLodopInstall+document.documentElement.innerHTML;
return;
} else {
if (CLODOP.CVERSION<"2.1.0.2") {
if (isIE) document.write(strCLodopUpdate); else
document.documentElement.innerHTML=strCLodopUpdate+document.documentElement.innerHTML;
};
if (oEMBED && oEMBED.parentNode) oEMBED.parentNode.removeChild(oEMBED);
if (oOBJECT && oOBJECT.parentNode) oOBJECT.parentNode.removeChild(oOBJECT);
};
} else {
var is64IE = isIE && (navigator.userAgent.indexOf('x64')>=0);
//=====如果页面有Lodop就直接使用,没有则新建:==========
if (oOBJECT!=undefined || oEMBED!=undefined) {
if (isIE) LODOP=oOBJECT; else LODOP=oEMBED;
} else if (CreatedOKLodop7766==null){
LODOP=document.createElement("object");
LODOP.setAttribute("width",0);
LODOP.setAttribute("height",0);
LODOP.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;");
if (isIE) LODOP.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA");
else LODOP.setAttribute("type","application/x-print-lodop");
document.documentElement.appendChild(LODOP);
CreatedOKLodop7766=LODOP;
} else LODOP=CreatedOKLodop7766;
//=====Lodop插件未安装时提示下载地址:==========
if ((LODOP==null)||(typeof(LODOP.VERSION)=="undefined")) {
if (navigator.userAgent.indexOf('Chrome')>=0)
document.documentElement.innerHTML=strHtmChrome+document.documentElement.innerHTML;
if (navigator.userAgent.indexOf('Firefox')>=0)
document.documentElement.innerHTML=strHtmFireFox+document.documentElement.innerHTML;
if (is64IE) document.write(strHtm64_Install); else
if (isIE) document.write(strHtmInstall); else
document.documentElement.innerHTML=strHtmInstall+document.documentElement.innerHTML;
return LODOP;
};
};
if (LODOP.VERSION<"6.2.1.7") {
if (needCLodop())
document.documentElement.innerHTML=strCLodopUpdate+document.documentElement.innerHTML; else
if (is64IE) document.write(strHtm64_Update); else
if (isIE) document.write(strHtmUpdate); else
document.documentElement.innerHTML=strHtmUpdate+document.documentElement.innerHTML;
return LODOP;
};
//===如下空白位置适合调用统一功能(如注册语句、语言选择等):===
LODOP.SET_LICENSES("","21D73C2039BECA88D752909E73778516","A8805E092641CD667BE7F6D439617B50","75922499F2C839D0ED7FF44D23942B48");
//===========================================================
return LODOP;
} catch(err) {alert("getLodop出错:"+err);};
};
import axios from 'axios'
// http request 拦截器
axios.interceptors.request.use(
config => {
if (sessionStorage.token) {
if (new Date().getTime() - sessionStorage.startTime > sessionStorage.expTime) {
window.location.href = '/#/login'
alert('对不起,账户已过期,请重新登录!')
return false
} else {
sessionStorage.setItem('startTime', new Date().getTime())
config.headers.accessToken= `${sessionStorage.token}`
config.headers.storeId = `${sessionStorage.storeId}`
}
} else {
window.location.href = '/#/login'
}
return config
},
err => {
return Promise.reject(err)
})
// http response 拦截器
axios.interceptors.response.use(
response => {
if (response.data.code === 101) {
window.location.href = "/#/login"
alert("对不起,您尚未登录,请先登录!")
}
return response
},
error => {
console.log("error")
if (error.response) {
}
return Promise.reject(error.response.data) // 返回接口返回的错误信息
})
// axios.defaults.headers.post['Content-Type'] = 'application/json'
export default axios
import axios from "axios";
import qs from "qs";
import { Message } from "iview";
axios.defaults.baseURL = "https://emaint.meiqicloud.com";
// axios.defaults.baseURL='http://localhost:8063'
export function qsdata(data) {
return qs.parse(qs.stringify(data));
}
export default {
post(url, data, success_call, fail_callback) {
return axios
.post(url, data)
.then(function(response) {
if (response.data && response.data.statusCode !== 200) {
Message.error({
title: "操作失败",
content: response.data.responseResult
});
console.log(response.data.responseResult);
if (fail_callback) {
fail_callback(response.data);
}
} else {
if (success_call) success_call(response.data);
}
})
.catch(function(error) {
console.log(error);
});
},
get(url, params, success_callback, fail_callback) {
// params['token'] = localStorage.token;
return axios
.get(url, {
params: params
})
.then(function(response) {
let result = response.data;
if (result.code == 200 || result.statusCode == 200) {
if (success_callback) {
success_callback(result);
}
} else if (fail_callback) {
fail_callback(result);
}
})
.catch(function(error) {
console.log(error);
});
},
async asyncGet(url, dataJson) {
if (!dataJson) {
dataJson = {};
}
try {
const response = await axios.get(url, { params: dataJson });
return response.data;
} catch (error) {
console.log(error);
}
},
async asyncPost(url, dataJson) {
if (!dataJson) {
dataJson = {};
}
try {
const response = await axios.get(url, { params: dataJson });
return response.data;
} catch (error) {
console.log(error);
}
}
};
var compare = function (prop) {
return function (obj1, obj2) {
var val1 = obj1[prop];
var val2 = obj2[prop];
if(prop=='gmtModified')
{
val1=new Date(val1).getTime();
val2=new Date(val2).getTime();
}
if (val1 > val2) {
return -1;
} else if (val1 < val2) {
return 1;
} else {
return 0;
}
}
}
var compare1 = function (prop) {
return function (obj1, obj2) {
var val1 = obj1[prop];
var val2 = obj2[prop];
if(prop=='gmtModified')
{
val1=new Date(val1).getTime();
val2=new Date(val2).getTime();
}
if (val1 < val2) {
return -1;
} else if (val1 > val2) {
return 1;
} else {
return 0;
}
}
}
// 处理检索时间
function getcreatedTime(createdTime,beginTime,endTime) {
// Array [ "2019-07-20", "2019-08-14" ]
beginTime=createdTime[0]
endTime=createdTime[1]
var a='00:00:00'
var b='23:59:59'
beginTime=beginTime+" "+a
endTime=endTime+" "+b
return{
beginTime,
endTime
}
}
export default{
compare,
compare1,
getcreatedTime
}
\ No newline at end of file
/**
* 密码格式验证
* @param rule 验证规则(不少于6位)
* @param value 需要验证的值
* @param callback 回调函数
*/
export const validatePassword = (rule, value, callback) => {
if (value.length < 6) {
callback(new Error('密码长度不得小于6位'));
} else {
callback();
}
};
/**
* 手机号码格式验证
* @param value 需要验证的值
*/
export const validateMobile = (value) => {
var reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
if (!reg.test(value)) {
return false;
} else {
return true;
}
};
export const validateNumber = (value) => {
var reg = /^\d+$/;
if (!reg.test(value)) {
return false;
} else {
return value;
}
};
/**
* 身份证号码格式验证
* @param rule 验证规则(是否满足18位)
* @param value 需要验证的值
* @param callback 回调函数
*/
export const validateIDCard = (rule, value, callback) => {
const reg = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (!reg.test(value)) {
callback(new Error('身份证号码格式错误'));
} else {
callback();
}
};
export function validateBlankStr(str) {
if (!str)
return true
else if (str == "null" || str == "undefined")
return true
else if (str.trim() == "")
return true
else
return false
}
import Vue from 'vue'
var Bus=new Vue()
export default Bus
\ No newline at end of file
<template>
<Breadcrumb>
<BreadcrumbItem
v-for="item in currentPath"
:href="item.path"
:key="item.name"
>{{item.title}}</BreadcrumbItem>
</Breadcrumb>
</template>
<script>
export default {
name: 'breadcrumbNav',
props: {
currentPath: Array
},
methods: {
}
};
</script>
<template>
<Icon :type="collapseType" @click.native="changeCollapse($event)" class="search-icon"></Icon>
</template>
<script type="text/javascript">
export default{
props:['foldPart','initFold'],
data(){
return {
collapseType:"chevron-down",
hasborder:true,
noborder:false,
}
},
mounted(){
if (this.initFold) {
document.getElementsByClassName("initFold")[0].parentNode.style.display="none";
this.collapseType="chevron-up"
}
},
methods:{
changeCollapse(param){
// console.log(param.target.parentNode.parentNode.nextElementSibling);
if (this.collapseType=="chevron-down") {
this.collapseType="chevron-up";
// this.hasborder=false;
// this.bordernone=true;
param.target.parentNode.parentNode.nextElementSibling.style.display="none"
// document.getElementsByClassName("ivu-card-body")[0].style.display="none";
// document.getElementById(this.foldPart).style.display="none";
return;
}
if (this.collapseType=="chevron-up") {
this.collapseType="chevron-down";
// this.hasborder=true;
// this.bordernone=false;
// document.getElementById(this.foldPart).style.display="block";
param.target.parentNode.parentNode.nextElementSibling.style.display="block"
// document.getElementsByClassName("ivu-card-body")[0].style.display="block";
return;
}
}
}
}
</script>
\ No newline at end of file
<template>
<div>
<Button
:countTime="countTime"
:loading="loading"
:type="type"
:size="size"
:ghost="ghost"
:disabled="disabled||clicked"
:icon="icon"
:shape="shape"
:long="long"
@click="handleClick"
>{{buttonText}}</Button>
</div>
</template>
<script>
import { validateMobile } from "@/assets/js/validate";
export default {
name: "iconChoose",
props: {
text: {
type: String,
default: "提交"
},
autoCountDown: {
type: Boolean,
default: true
},
mobile: {
type: String,
default: ''
},
countTime: {
type: [Number, String],
default: 60
},
suffixText: {
type: String,
default: "后重试"
},
type: String,
size: String,
loading: {
type: Boolean,
default: false
},
ghost: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
icon: String,
shape: String,
long: {
type: Boolean,
default: false
}
},
data() {
return {
buttonText: this.text,
count: Number(this.countTime),
clicked: false
};
},
methods: {
init() {},
handleClick() {
if (this.autoCountDown && validateMobile(this.mobile)) {
this.clicked = true;
this.countDown();
}
this.$emit("on-click", true);
},
startCountDown() {
this.clicked = true;
this.countDown();
},
countDown() {
let that = this;
if (this.count == 0) {
this.clicked = false;
this.count = this.countTime;
this.buttonText = this.text;
return;
} else {
this.buttonText = this.count + " 秒" + this.suffixText;
this.count--;
}
setTimeout(function() {
that.countDown();
}, 1000);
},
setText(value) {
if (value === this.buttonText) {
return;
}
this.buttonText = value;
},
},
watch: {
text(val) {
this.setText(val);
}
},
mounted() {
this.init();
}
};
</script>
<style>
</style>
<template>
<div>
<Menu ref="sideMenu" :active-name="$route.name" theme="dark" width="auto" @on-select="changeMenu">
<template v-for="(item,index) in menuList">
<!-- <span>aaaaaa{{item.title}}</span>-->
<!-- &&(auths.indexOf(item.code)!=-1) -->
<MenuItem v-if="item.children.length<=1" :name="item.children[0].name" :key="'menuitem' + item.name">
<Icon :type="item.children[0].icon || item.icon" :size="iconSize" :key="'menuicon' + item.name"></Icon>
<span class="layout-text" :key="'title' + item.name">{{ item.children[0].meta.title }}</span>
</MenuItem>
<Submenu v-if="item.children.length > 1" :name="item.name" :key="item.name">
<template slot="title">
<Icon :type="item.icon" :size="iconSize"></Icon>
<span class="layout-text">{{ item.meta.title }}</span>
</template>
<template v-for="child in item.children">
<MenuItem :name="child.name" :key="'menuitem' + child.name">
<Icon :type="child.icon" :size="iconSize" :key="'icon' + child.name"></Icon>
<span class="layout-text" :key="'title' + child.name">{{ child.meta.title }}</span>
</MenuItem>
</template>
</Submenu>
</template>
</Menu>
</div>
</template>
<script>
import './../../assets/css/menu.css' // 使用 CSS
export default {
name: 'sidebarMenu',
props: {
menuList: Array,
iconSize: Number,
},
data:function(){
return{
auths:[],
}
},
methods: {
changeMenu (active) {
this.$emit('on-change', active);
},
routeTo(url){
if(url=='/order_list')
sessionStorage.removeItem('paramsstatus')
for(let value of document.getElementsByClassName("ivu-menu-vertical")[0].querySelectorAll('.ivu-menu-item')){
if (value.classList.contains("ivu-menu-item-active")) {
value.classList.remove('ivu-menu-item-active');
value.classList.remove('ivu-menu-item-selected');
};
};
document.getElementById("scrollOuter")
/*const outerWidth = this.$refs.scrollOuter.offsetWidth;
const bodyWidth = this.$refs.scrollBody.offsetWidth;
if (offset > 0) {
this.tagBodyLeft = Math.min(0, this.tagBodyLeft + offset);
} else {
if (outerWidth < bodyWidth) {
if (this.tagBodyLeft < -(bodyWidth - outerWidth)) {
this.tagBodyLeft = this.tagBodyLeft;
} else {
this.tagBodyLeft = Math.max(
this.tagBodyLeft + offset,
outerWidth - bodyWidth
);
}
} else {
this.tagBodyLeft = 0;
}
}*/
if (document.getElementById(url.split("?")[0])!=null) {
let element = document.getElementById(url.split("?")[0]);
document.getElementById(url.split("?")[0]).classList.add("ivu-menu-item-selected");
document.getElementById(url.split("?")[0]).classList.add("ivu-menu-item-active");
console.log(element.scrollLeft)
}
this.$router.push(url)
},
},
created(){
var auths=JSON.parse(sessionStorage.getItem('auth'));
for(var i in auths){
this.auths.push(i);
}
console.log(this.menuList);
},
};
</script>
<template>
<div>
<template v-for="(item, index) in menuList">
<div style="text-align: center;" :key="index">
<Dropdown transfer v-if="item.children.length !== 1" placement="right-start" :key="index" @on-click="changeMenu">
<Button style="width: 70px;margin-left: -5px;padding:10px 0;" type="text">
<Icon :size="20" :color="iconColor" :type="item.icon"></Icon>
</Button>
<DropdownMenu style="width: 200px;" slot="list">
<template v-for="(child, i) in item.children">
<DropdownItem :name="child.name" :key="i"><Icon :type="child.icon"></Icon><span style="padding-left:10px;">{{ child.meta.title }}</span></DropdownItem>
</template>
</DropdownMenu>
</Dropdown>
<Dropdown transfer v-else placement="right-start" :key="index" @on-click="changeMenu">
<Button @click="changeMenu(item.children[0].name)" style="width: 70px;margin-left: -5px;padding:10px 0;" type="text">
<Icon :size="20" :color="iconColor" :type="item.children[0].icon || item.icon"></Icon>
</Button>
<DropdownMenu style="width: 200px;" slot="list">
<DropdownItem :name="item.children[0].name" :key="'d' + index"><Icon :type="item.children[0].icon || item.icon"></Icon><span style="padding-left:10px;">{{ item.children[0].meta.title }}</span></DropdownItem>
</DropdownMenu>
</Dropdown>
</div>
</template>
</div>
</template>
<script>
export default {
name: 'sidebarMenuShrink',
props: {
menuList: {
type: Array
},
iconColor: {
type: String,
default: 'white'
},
menuTheme: {
type: String,
default: 'darck'
}
},
methods: {
changeMenu (active) {
this.$emit('on-change', active);
}
}
};
</script>
<template>
<div style="background:#495060" class="ivu-shrinkable-menu">
<slot name="top"></slot>
<sidebar-menu
v-show="!shrink"
:menu-list="menuList"
@on-change="handleChange"
></sidebar-menu>
<sidebar-menu-shrink
v-show="shrink"
:menu-list="menuList"
icon-color="#fff"
@on-change="handleChange"
></sidebar-menu-shrink>
</div>
</template>
<script>
import './../assets/css/menu.css' // 使用 CSS
import sidebarMenu from './menu-component/sidebarMenu.vue';
import sidebarMenuShrink from './menu-component/sidebarMenuShrink.vue';
export default {
components: {
sidebarMenu,
sidebarMenuShrink
},
props: {
shrink: {
type: Boolean,
default: false
},
menuList: {
type: Array,
required: true
},
beforePush: {
type: Function
},
},
methods: {
handleChange (name) {
let willpush = true;
if (this.beforePush !== undefined) {
if (!this.beforePush(name)) {
willpush = false;
}
}
if (willpush) {
this.$router.push({
name: name
});
}
this.$emit('on-change', name);
}
}
}
</script>
<template>
<div style="height: 100%;">
<!-- :loading="loading" -->
<Table border stripe :columns="config.columns" :data="tableData" @on-selection-change="select"></Table>
<div class="page-tool" v-if="!config.notPage">
<Page :total="total" :current="currentPage" :page-size="limit" show-total @on-change="pageChange"></Page>
</div>
</div>
</template>
<script>
import qs from "qs";
import util from '@/assets/js/util'
export default {
props: ['config', 'searchParams', 'isFirst'],
created () {
this.init()
},
data () {
return {
tableData: [
],
selection: [],
total: 0,
currentPage: 1,
limit: 10,
allChecked: false,
loading: true,
}
},
computed: {
selected_count () {
let count = 0
this.tableData.forEach(function (item) {//调用数组的每个元素,并将元素传递给回调函数
if (item._checked) {
count++
}
})
return count
}
},
methods: {
init () {
let params = this.searchParams ? this.searchParams : {}
let arr = {}
for (var key of Object.keys(params)) {
if (params[key] === '' || params[key] === 'null') {
params[key] = null
}
arr[key] = params[key]
}
params = arr
if(!this.config.unParam){
params.page = this.isFirst === true ? 1 : this.currentPage
params.pageNo=this.isFirst === true ? 1 : this.currentPage
params.limit = this.config.limit != undefined?this.config.limit :this.limit
this.limit = params.limit;
}
// params.projectId = sessionStorage.getItem("curProjectId")
// params.orgId = sessionStorage.getItem("orgId")
// params.t = Math.random()
if(this.config.url!=""){
this.$request.post(this.config.url, qs.stringify(params), data => {
// 成功的回调
let list=[]
if(data.responseResult.list){
list = data.responseResult.list
}else{
list = data.responseResult
}
list.map((item) => {
item._checked = this.allChecked
})
list.map((item, index) => {
list[index].series = index + 1 + (this.currentPage - 1) * (this.limit)
})
// .sort(util.compare('gmtModified'))
this.tableData = list
this.total = data.responseResult.total || data.responseResult.length
this.currentPage = data.responseResult.pageNum === 0 ? 1 : data.responseResult.pageNum
},data=>{
})
}
},
select (selection) {
this.tableData.forEach((item, index) => {
this.tableData[index]._checked = false
selection.forEach((sitem) => {
if (item.id === sitem.id) {
this.tableData[index]._checked = true
}
})
})
this.selection = selection
},
// rowclick(row,index){
// console.log(row)
// console.log(index)
// },
pageChange (page) {
this.currentPage = page
// console.log(this.currentPage)
this.init()
},
},
watch:{
 searchParams: {
    handler(newValue, oldValue) {
if(oldValue.watch){
this.init();
}
    },
    deep: true
  }
}
}
</script>
<style scoped>
.page-tool{
height: 30px;
margin-top: 20px;
text-align: right;
}
</style>
<style scoped>
.expand-row{
margin-bottom: 16px;
}
</style>
<template>
<div>
<Row class="expand-row">
<Col span="8">
1
</Col>
<Col span="8">
2
</Col>
</Row>
<Row>
<Col span="8">
3
</Col>
<Col span="8">
4
</Col>
</Row>
</div>
</template>
<script>
export default {
};
</script>
\ No newline at end of file
var idTmr;
function getExplorer () {
var explorer = window.navigator.userAgent;
if (explorer.indexOf('MSIE') >= 0) {
// ie
return 'ie';
} else if (explorer.indexOf('Firefox') >= 0) {
// firefox
return 'Firefox';
} else if (explorer.indexOf('Chrome') >= 0) {
// Chrome
return 'Chrome';
} else if (explorer.indexOf('Opera') >= 0) {
// Opera
return 'Opera';
} else if (explorer.indexOf('Safari') >= 0) {
// Safari
return 'Safari';
};
};
function tranform (table, aId, name) {
let tableHead = table.$children[0].$el;
let tableBody = table.$children[1].$el;
let tableInnerHTML = '<thead><tr>';
if (table.$children.length !== 1) {
let len = tableBody.rows.length;
let i = -1;
while (i < len) {
if (i === -1) {
Array.from(tableHead.rows[0].children).forEach((td) => {
tableInnerHTML = tableInnerHTML + '<th>' + td.children[0].children[0].innerHTML + '</th>';
});
tableInnerHTML += '</tr><thead><tbody>';
} else {
tableInnerHTML += '<tr>';
Array.from(tableBody.rows[i].children).forEach((td) => {
tableInnerHTML = tableInnerHTML + '<td>' + td.children[0].children[0].innerHTML + '</td>';
});
tableInnerHTML += '</tr>';
}
i++;
}
tableInnerHTML += '</tbody>';
}
if (getExplorer() !== 'Safari' && name.substr(-1, 4) !== '.xls') {
name += '.xls';
}
if (getExplorer() === 'ie') {
var curTbl = table;
var oXL = new ActiveXObject('Excel.Application');
var oWB = oXL.Workbooks.Add();
var xlsheet = oWB.Worksheets(1);
var sel = document.body.createTextRange();
sel.moveToElementText(curTbl);
sel.select();
sel.execCommand('Copy');
xlsheet.Paste();
oXL.Visible = true;
try {
var fname = oXL.Application.GetSaveAsFilename('Excel.xls', 'Excel Spreadsheets (*.xls), *.xls');
} catch (e) {
print('Nested catch caught ' + e);
} finally {
oWB.SaveAs(fname);
// oWB.Close(savechanges = false);
oXL.Quit();
oXL = null;
idTmr = setInterval(Cleanup(), 1);
}
} else {
tableToExcel(tableInnerHTML, aId, name);
}
}
function Cleanup () {
window.clearInterval(idTmr);
// CollectGarbage();
}
let tableToExcel = (function () {
let uri = 'data:application/vnd.ms-excel;base64,';
let template = '<html><head><meta charset="UTF-8"></head><body><table>{table}</table></body></html>';
let base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))); };
let format = function (s, c) {
return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; });
};
return function (table, aId, name) {
let ctx = {worksheet: name || 'Worksheet', table: table};
document.getElementById(aId).href = uri + base64(format(template, ctx));
document.getElementById(aId).download = name;
document.getElementById(aId).click();
};
})();
const table2excel = {};
table2excel.transform = tranform;
export default table2excel;
import axios from "axios";
import env from "../../build/env";
import semver from "semver";
import packjson from "../../package.json";
let util = {};
util.title = function(title) {
title = title || "特房E运维管理系统";
window.document.title = title;
};
const ajaxUrl =
env === "development"
? "http://127.0.0.1:8888"
: env === "production"
? "https://www.url.com"
: "https://debug.url.com";
util.ajax = axios.create({
baseURL: ajaxUrl,
timeout: 30000
});
util.inOf = function(arr, targetArr) {
let res = true;
arr.forEach(item => {
if (targetArr.indexOf(item) < 0) {
res = false;
}
});
return res;
};
util.oneOf = function(ele, targetArr) {
if (targetArr.indexOf(ele) >= 0) {
return true;
} else {
return false;
}
};
util.showThisRoute = function(itAccess, currentAccess) {
if (typeof itAccess === "object" && Array.isArray(itAccess)) {
return util.oneOf(currentAccess, itAccess);
} else {
return itAccess === currentAccess;
}
};
util.getRouterObjByName = function(routers, name) {
if (!name || !routers || !routers.length) {
return null;
}
let routerObj = null;
for (let item of routers) {
if (item.name === name) {
return item;
}
routerObj = util.getRouterObjByName(item.children, name);
if (routerObj) {
return routerObj;
}
}
return null;
};
util.getRouterObjByPath = function(routers, path) {
if (!path || !routers || !routers.length) {
return null;
}
let routerObj = null;
for (let item of routers) {
if (item.path === path) {
return item;
}
routerObj = util.getRouterObjByPath(item.children, path);
if (routerObj) {
return routerObj;
}
}
return null;
};
util.handleTitle = function(vm, item) {
if (typeof item.title === "object") {
return vm.$t(item.title.i18n);
} else {
return item.title;
}
};
util.setCurrentPath = function(vm, name) {
let title = "";
let isOtherRouter = false;
vm.$store.state.app.routers.forEach(item => {
if (item.children.length === 1) {
if (item.children[0].name === name) {
title = util.handleTitle(vm, item);
if (item.name === "otherRouter") {
isOtherRouter = true;
}
}
} else {
item.children.forEach(child => {
if (child.name === name) {
title = util.handleTitle(vm, child);
if (item.name === "otherRouter") {
isOtherRouter = true;
}
}
});
}
});
let currentPathArr = [];
if (name === "home_index") {
currentPathArr = [
{
title: util.handleTitle(
vm,
util.getRouterObjByName(vm.$store.state.app.routers, "home_index")
),
path: "",
name: "home_index"
}
];
} else if (
(name.indexOf("_index") >= 0 || isOtherRouter) &&
name !== "home_index"
) {
currentPathArr = [
{
title: util.handleTitle(
vm,
util.getRouterObjByName(vm.$store.state.app.routers, "home_index")
),
path: "/home",
name: "home_index"
},
{
title: title,
path: "",
name: name
}
];
} else {
let currentPathObj = vm.$store.state.app.routers.filter(item => {
if (item.children.length <= 1) {
return item.children[0].name === name;
} else {
let i = 0;
let childArr = item.children;
let len = childArr.length;
while (i < len) {
if (childArr[i].name === name) {
return true;
}
i++;
}
return false;
}
})[0];
if (currentPathObj.children.length <= 1 && currentPathObj.name === "home") {
currentPathArr = [
{
title: "首页",
path: "",
name: "home_index"
}
];
} else if (
currentPathObj.children.length <= 1 &&
currentPathObj.name !== "home"
) {
currentPathArr = [
{
title: "首页",
path: "/home",
name: "home_index"
},
{
title: currentPathObj.title,
path: "",
name: name
}
];
} else {
let childObj = currentPathObj.children.filter(child => {
return child.name === name;
})[0];
currentPathArr = [
{
title: "首页",
path: "/home",
name: "home_index"
},
{
title: currentPathObj.title,
path: "",
name: currentPathObj.name
},
{
title: childObj.title,
path: currentPathObj.path + "/" + childObj.path,
name: name
}
];
}
}
vm.$store.commit("setCurrentPath", currentPathArr);
return currentPathArr;
};
util.openNewPage = function(vm, name, argu, query) {
let pageOpenedList = vm.$store.state.app.pageOpenedList;
let openedPageLen = pageOpenedList.length;
let i = 0;
let tagHasOpened = false;
while (i < openedPageLen) {
if (name === pageOpenedList[i].name) {
// 页面已经打开
vm.$store.commit("pageOpenedList", {
index: i,
argu: argu,
query: query
});
tagHasOpened = true;
break;
}
i++;
}
vm.$store.commit("setCurrentPageName", name);
};
util.toDefaultPage = function(routers, name, route, next) {
let len = routers.length;
let i = 0;
let notHandle = true;
while (i < len) {
if (
routers[i].name === name &&
routers[i].children &&
routers[i].redirect === undefined
) {
route.replace({
name: routers[i].children[0].name
});
notHandle = false;
next();
break;
}
i++;
}
if (notHandle) {
next();
}
};
util.fullscreenEvent = function(vm) {
vm.$store.commit("initCachepage");
// 权限菜单过滤相关
vm.$store.commit("updateMenuList");
// 全屏相关
};
export default util;
/**
* 密码格式验证
* @param rule 验证规则(不少于6位)
* @param value 需要验证的值
* @param callback 回调函数
*/
export const validatePassword = (rule, value, callback) => {
if (value.length < 6) {
callback(new Error('密码长度不得小于6位'));
} else {
callback();
}
};
/**
* 手机号码格式验证
* @param rule 验证规则
* @param value 需要验证的值
* @param callback 回调函数
*/
export const validateMobile = (rule, value, callback) => {
var reg = /^[1][3,4,5,6,7,8][0-9]{9}$/;
if (!reg.test(value)) {
callback(new Error('手机号格式错误'));
} else {
callback();
}
};
/**
* 身份证号码格式验证
* @param rule 验证规则(是否满足18位)
* @param value 需要验证的值
* @param callback 回调函数
*/
export const validateIDCard = (rule, value, callback) => {
const reg = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (!reg.test(value)) {
callback(new Error('身份证号码格式错误'));
} else {
callback();
}
};
\ No newline at end of file
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import {router} from './router/index';
import 'babel-polyfill'
//组件
import routeBar from '../src/components/route-bar.vue'
import layoutMenu from '../src/components/menu.vue'
import cIcon from '../src/components/collapse.vue'
import mTable from '../src/components/mtable.vue'
import iView from 'iview'
import 'iview/dist/styles/iview.css'
import './assets/css/style.css'
import axios from './assets/js/axiosInterCeptor'
import store from './store';
import Request from './assets/js/request'
import utils from './assets/js/util'
Vue.use(iView)
Vue.component('route-bar', routeBar)
Vue.component('shrinkable-menu', layoutMenu)
Vue.component('collapse-icon', cIcon)
Vue.component('m-table', mTable)
Vue.prototype.$request = Request
Vue.prototype.$getcreatedTime=utils.getcreatedTime
Vue.prototype.$Vue = Vue
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store: store,
components: { App },
template: '<App/>'
})
import Vue from 'vue'
import Util from '../libs/util';
import VueRouter from 'vue-router'
import store from '../store';
import {routers} from './router';
Vue.use(VueRouter);
// 路由配置
const RouterConfig = {
// mode: 'history',
routes: routers
};
export const router = new VueRouter(RouterConfig);
router.beforeEach((to, from, next) => {
// iView.LoadingBar.start();
Util.title(to.title);
let token = sessionStorage.getItem("token");
if (!token && to.name !== 'login') { // 判断是否已经登录且前往的页面不是登录页
next({
name: 'login'
});
} else if (!token && to.name === 'login') { // 判断是否已经登录且前往的页面不是登录页
next({to});
}
else if (token && to.name === 'login') { // 判断是否已经登录且前往的是登录页
Util.title();
next({name: 'home_index'})
} else {
let accessRouter = store.getters.accessRouter
if (!accessRouter || accessRouter.length <= 0) {
store.dispatch('GenerateRoutes').then(() => { // 生成可访问的路由表
accessRouter = store.getters.accessRouter
let addRouter = [...accessRouter]
router.addRoutes(addRouter) // 动态添加可访问路由表
if (to.path === '/' || to.name) {
next({to})
} else {
next({ ...to, replace: true }) // 确保addRoutes已完成
}
})
} else {
// 已经 addRoutes 可以使用getRouterObjByName
accessRouter = store.getters.accessRouter
let allRouter = [...routers, ...accessRouter]
const curRouterObj = Util.getRouterObjByName(allRouter, to.name);
if (curRouterObj) {
Util.toDefaultPage(allRouter, to.name, router, next);
} else {
next({
replace: true,
name: 'error-403'
});
}
}
}
// }
});
router.afterEach((to) => {
Util.openNewPage(router.app, to.name, to.params, to.query);
// iView.LoadingBar.finish();
window.scrollTo(0, 0);
});
/**
* Created by zhuoym on 2021/5/20.
*/
export const loginRouter = {
path: '/login',
name: 'login',
meta: {
title: '登录'
},
component: resolve => require(['@/views/login/login.vue'], resolve),
};
export const page403 = {
path: '/403',
meta: {
title: '权限不足'
},
name: 'error-403',
component: resolve => { require(['@/views/error-page/403.vue'], resolve); }
};
export const page500 = {
path: '/500',
meta: {
title: '服务端错误'
},
name: 'error-500',
component: resolve => { require(['@/views/error-page/500.vue'], resolve); }
};
export const otherRouter = {
path: '/',
name: 'home',
meta: {
title: '首页',
},
component: resolve => require(['@/views/index.vue'], resolve),
children: [
{
path: '/',
name: 'home_index',
meta: {
title: '首页',
},
component: resolve => require(['@/views/welcome.vue'], resolve),
},
{
path: '/questionAcceptance',
name: 'questionAcceptance',
meta: {
title: '工单受理'
},
component: resolve => require(['@/views/questionAcceptance/index.vue'], resolve),
},
{
path: '/workOrderManage',
name: 'workOrderManage',
meta: {
title: '新增工单'
},
component: resolve => require(['@/views/workOrderManage/index.vue'], resolve),
},
{
path: '/transfer',
name: 'transfer',
meta: {
title: '新增工单'
},
component: resolve => require(['@/views/workOrderManage/transfer.vue'], resolve),
},
{
path: '/dispatch',
name: 'dispatch',
meta: {
title: '派单'
},
component: resolve => require(['@/views/dispatch/index.vue'], resolve),
},
{
path: '/WorkDetail',
name: 'WorkDetail',
meta: {
title: '详情工单'
},
component: resolve => require(['@/views/WorkDetail/index.vue'], resolve),
},
{
path: '/workOrderEdit',
name: 'workOrderEdit',
meta: {
title: '工单详情',
},
component: resolve => require(['@/views/workOrderEdit/index.vue'], resolve),
},
{
path: '/repairList',
name: 'repairList',
meta: {
title: '报修数据'
},
component: resolve => require(['@/views/repairList/index.vue'], resolve),
},
{
path: '/reportDetail',
name: 'reportDetail',
meta: {
title: '报表明细'
},
component: resolve => require(['@/views/reportDetail/index.vue'], resolve),
},
{
path: '/operationDetail',
name: 'operationDetail',
meta: {
title: '运维接单报表明细'
},
component: resolve => require(['@/views/operationDetail/index.vue'], resolve),
},
{
path: '/distributeUser',
name: 'distributeUser',
meta: {
title: '配置权限'
},
component: resolve => require(['@/views/distributeUser/index.vue'], resolve),
},
]
};
export const appRouter = [
{
path: '/bx',
meta: {
title: '报修管理',
},
name: 'bx',
component: resolve => require(['@/views/index.vue'], resolve),
children: [
{
path: '/add',
name: 'bx_add',
meta: {
title: '快速报修',
},
auth: 'tf_bx_add',
component: resolve => require(['@/views/bx/add.vue'], resolve),
},
{
path: '/list',
name: 'bx_list',
meta: {
title: '我的报修',
},
auth: 'tf_bx_list',
component: resolve => require(['@/views/bx/list.vue'], resolve),
},
]
},
{
path: '/workorder',
meta: {
title: '工单管理',
},
name: 'work_order',
component: resolve => require(['@/views/index.vue'], resolve),
children: [
{
path: 'list',
name: 'order_list',
meta: {
title: '工单列表',
},
auth: 'tf_repair_problem_list',
component: resolve => require(['@/views/workOrder/index.vue'], resolve),
},
{
path: 'evaluation',
name: 'evaluation_list',
meta: {
title: '评价列表',
},
auth: 'tf_repair_eveluate_list',
component: resolve => require(['@/views/evaluationList/index.vue'], resolve),
}
]
},
{
path: '/setting',
meta: {
title: '运维设置',
},
name: 'setting',
component: resolve => require(['@/views/index.vue'], resolve),
children: [
{
path: 'expire',
name: 'setting_expire',
meta: {
title: '逾期设置'
},
auth: 'tf_system_settting_list',
component: resolve => require(['@/views/operationSetting/index.vue'], resolve),
},
{
path: 'project',
name: 'setting_project',
meta: {
title: '项目管理'
},
auth: 'tf_settting_project',
component: resolve => require(['@/views/setting/project/index.vue'], resolve),
},
{
path: 'problem_class',
name: 'setting_problem_class',
meta: {
title: '问题类别'
},
auth: 'tf_problem_balse_level3_list',
component: resolve => require(['@/views/problemConfiguration/index.vue'], resolve),
},
{
path: 'common_problem',
name: 'setting_common_problem',
meta: {
title: '常见问题'
},
auth: 'tf_problem_balse_list',
component: resolve => require(['@/views/commonProblem/index.vue'], resolve),
},
]
},
{
path: '/client',
meta: {
title: '客户管理',
},
name: 'client',
component: resolve => require(['@/views/index.vue'], resolve),
children: [
{
path: 'list',
name: 'client_list',
meta: {
title: '客户列表',
},
auth: 'tf_client_list',
component: resolve => require(['@/views/customerManagement/index.vue'], resolve),
},
{
path: 'group',
name: 'client_group',
meta: {
title: '客户组织'
},
auth: 'tf_client_group_list',
component: resolve => require(['@/views/clientGroup/index.vue'], resolve),
}
]
},
{
path: '/report',
meta: {
title: '数据报表',
},
name: 'report',
component: resolve => require(['@/views/index.vue'], resolve),
children: [
{
path: 'company',
name: 'report_company',
meta: {
title: '公司数据报表'
},
auth: 'tf_company_problem_data',
component: resolve => require(['@/views/dataReport/index.vue'], resolve),
},
{
path: 'maint',
name: 'report_maint',
meta: {
title: '运维统计报表'
},
code: 'tf_overview_report',
component: resolve => require(['@/views/report/overview/index.vue'], resolve),
},
{
path: 'maint_order',
name: 'report_maint_order',
meta: {
title: '运维接单报表'
},
auth: 'tf_user_problem_data_list',
component: resolve => require(['@/views/operationData/index.vue'], resolve),
}
]
},
{
path: '/sysytem',
meta: {
title: '系统管理',
},
name: 'system',
component: resolve => require(['@/views/index.vue'], resolve),
children: [
{
path: 'login_history',
name: 'login_history',
meta: {
title: '登录历史'
},
auth: 'tf_login_record_list',
component: resolve => require(['@/views/loginHistory/index.vue'], resolve),
},
{
path: 'user',
name: 'user_list',
meta: {
title: '用户管理'
},
auth: 'tf_user_list',
component: resolve => require(['@/views/userManagement/index.vue'], resolve),
},
{
path: 'role',
name: 'role_list',
meta: {
title: '角色管理'
},
auth: 'tf_role_list',
component: resolve => require(['@/views/roleManagement/index.vue'], resolve),
},
{
path: 'data_dict',
name: 'data_dict',
meta: {
title: '数据字典'
},
auth: 'tf_dictionary_list',
component: resolve => require(['@/views/dataDictionary/index.vue'], resolve),
}
]
}
//
];
// 所有上面定义的路由都要写在下面的routers里
export const routers = [
loginRouter,
page403,
page500,
otherRouter
];
import Vue from 'vue';
import Vuex from 'vuex';
import app from './modules/app';
Vue.use(Vuex);
const store = new Vuex.Store({
state: {
//
},
mutations: {
//
},
actions: {
},
modules: {
app
},
getters: {
accessRouter: state => state.app.accessRouter,
loadedAccessRouter: state => state.app.loadedAccessRouter
}
});
export default store;
import { validateBlankStr } from "@/assets/js/validate";
/**
* Created by zhuoym on 2019/9/17.
*/
// 构造客户搜索下拉项
export function initCustSearchOption(custList, query, callIDoptions) {
custList.forEach(v => {
if (v.undef && v.undef.indexOf(query) != -1) {
let option = {
name: initCustInfo(v)+ ",内线:" + v.undef,
data: v,
label: v.name
};
callIDoptions.push(option);
} else if (v.tel && v.tel.indexOf(query) != -1) {
let option = {
name: initCustInfo(v) + ",座机:" + v.tel,
data: v,
label: v.name
};
callIDoptions.push(option);
} else if (v.phone && v.phone.indexOf(query) != -1) {
let option = {
name: initCustInfo(v) + ",手机:" + v.phone,
data: v,
label: v.name
};
callIDoptions.push(option);
} else if (v.name && v.name.indexOf(query) != -1) {
let option = {
name: initCustInfo(v),
data: v,
label: v.name
};
callIDoptions.push(option);
}
if (callIDoptions.length == 0) {
let option = {
name: query,
data: {},
label: query
};
callIDoptions.push(option);
}
})
}
export function initCustSearchOption4Bx(custList, callIDoptions) {
custList.forEach(v => {
let option = {
name: initCustInfo(v),
data: v,
label: initCustInfo(v)
};
callIDoptions.push(option);
})
}
export function getCustOrgInfo(v) {
return initCustInfo(v)
}
export function getCustSex(v) {
let sex = ''
switch (v.sex) {
case "男":
sex = "男";
break;
case "male":
sex = "男";
break;
case "女":
sex = "女";
break;
case "female":
sex = "女";
break;
default:
break;
}
return sex;
}
export function getCustContactNumber(v) {
console.log(v.phone || v.tel || v.undef)
return v.phone || v.tel || v.undef
}
function initCustInfo (v) {
return v.name + (v.companyName === null || v.companyName === "" ? "" : ",公司:" + v.companyName.trim()) + (v.deptName === null || v.deptName === "" ? "" : ",部门:" + v.deptName.trim())
}
function initCustContactInfo (v) {
return !v.undef ? "" : ",内线:" + v.undef.trim() + (!v.tel ? "" : ",座机:" + v.tel.trim()) + (!v.phone ? "" : ",手机:" + v.phone.trim())
}
<template>
<div>
<Row :gutter="10">
<Col span="24">
<Card class="search-card">
<p slot="title">
{{$route.meta.title}}
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :label-width="80">
<Row>
<Col span="6">
<FormItem label="时间">
<DatePicker type="daterange" v-model="createdTime" split-panels placeholder="请选择起始时间" style="width: 200px" @on-change="getcreatedTime"></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<div class="search-row">
<Col>
</Col>
<Col>
<Button type="primary" @click="searchSubmit" icon="search">检索</Button>
<Button type="ghost" @click="searchCancel" icon="refresh">重置</Button>
</Col>
</div>
</div>
</Card>
</Col>
</Row>
<Row :gutter="10" class="mt10">
<Col span="24">
<Card>
<div class="search-row">
<Row>
<Col>
<Button type="primary" icon="ios-redo" v-if="auth.tf_company_problem_data_export" @click="exportTabel()">导出</Button>
</Col>
<Col>
</Col>
</Row>
</div>
<Row class="searchable-table-con">
<m-table :config="tableConfig" :searchParams="formItem" ref="table" :isFirst="isFirst"></m-table>
</Row>
</Card>
</Col>
</Row>
</div>
</template>
<style>
textarea{
resize:none;
}
.test{
display: inline-block;
width:50px;
height:30px;
text-align: center;
line-height: 30px;
margin-right: 5px;
margin-bottom: 5px;
color: white;
position: relative;
}
.house{
width:40px;
height:30px;
text-align: center;
line-height: 30px;
color: white;
margin: 0 3px 9px 3px;
}
.bg-gray{
background-color: #808080;
color: white;
}
.bg-green{
background-color: #1cad1f;
color: white;
}
.bg-red{
background-color: #e42a2d;
color: white;
}
.img-position{
position: absolute;
top: 2px;
right: 3px;
}
.batch-house-tips{
display: inline-block;
font-size: 12px;
margin-right: 10px;
margin-bottom: 10px;
}
.batch-house-red{
background-color: #e42a2d;
padding: 5px;
color: #ffffff;
}
.batch-house-green{
background-color: #1cad1f;
padding: 5px;
color: #ffffff;
justify-content: center;
}
.batch-house-gray{
background-color: #808080;
padding: 5px;
color: #ffffff;
}
</style>
<script type="text/ecmascript-6">
import qs from "qs";
import axios from 'axios'
import index from "../../router"
export default {
data () {
return {
auth:JSON.parse(sessionStorage.auth),//登录用户的角色权限
isFirst: false, //首页.
loading: true, //加载
//表单
formItem: {
beginDate:"",
endDate:"",
},
endDate:"",
beginDate:"",
// 设置结束时间大于开始时间
end:{
disabledDate :(function(date){
return date.valueOf() < new Date( this.formItem.beginDate)
}).bind(this)
},
createdTime:[],
//表格
tableConfig:{
url:"/api/emaint/repairProblem/totalComapnyCountList",
columns:[
{
title: '操作',
width:70,
align:"center",
render:(h,params)=>{
return h('Button', {
props: {
type: 'primary',
size: 'small'
},
on: {
click: () => {
sessionStorage.setItem("companyName",params.row.companyName)
sessionStorage.setItem("beginDate",this.formItem.beginDate)
sessionStorage.setItem("endDate",this.formItem.endDate)
this.$router.push({name:"reportDetail",params:{companyName:params.row.companyName}})
}
}
},"详情")
}
},
{
title: '公司',
key: 'companyName',
width:120,
align:"center"
},
{
title: '硬件单数',
key: 'yjCount',
width:70,
align:"center"
},
{
title: '软件单数',
key: 'rjCount',
width:70,
align:"center"
},
{
title: '其他',
key: 'otherCount',
width:70,
align:"center"
},
{
title: '总数',
key: 'totalCount',
width:70,
align:"center"
},
{
title: '已完成单数',
key: 'completeCount',
width:70,
align:"center"
},
{
title: '待维修单数',
key: 'uncompleteCount',
width:70,
align:"center"
}
],
}
}
},
created(){
var dd=new Date()
var ff=new Date()
var week = dd.getDay(); //获取时间的星期数
var minus = week ? week - 1 : 6;
dd.setDate(dd.getDate() - minus); //获取minus天前的日期
var y = dd.getFullYear();
var m = (dd.getMonth()+1) < 10 ? "0"+(dd.getMonth() + 1):(dd.getMonth()+1); //获取月份
var d = dd.getDate() < 10 ?( '0' + dd.getDate()):dd.getDate()
this.formItem.beginDate=(y + "-" + m + "-" + d)
this.beginDate=this.formItem.beginDate
this.createdTime.push(this.beginDate)
var week = ff.getDay(); //获取时间的星期数
var maxus = week ? 7 - week : 0;
ff.setDate(ff.getDate() + maxus); //获取minus天前的日期
var a = ff.getFullYear();
var b = (ff.getMonth()+1) < 10 ? "0"+(ff.getMonth() + 1):(ff.getMonth()+1); //获取月份
var c = ff.getDate() < 10 ?( '0' + ff.getDate()):ff.getDate()
this.formItem.endDate=(a + "-" + b + "-" + c)
this.endDate=this.formItem.endDate
this.createdTime.push(this.endDate)
},
methods: {
// 导出
exportTabel(){
let begin=new Date(this.formItem.beginDate)
let beginM=begin.getMonth()+1
begin=begin.getFullYear()+"-"+beginM+"-"+begin.getDate()
let end=new Date(this.formItem.endDate)
let endM=end.getMonth()+1
end=end.getFullYear()+"-"+endM+"-"+end.getDate()
let url=axios.defaults.baseURL+"/api/emaint/repairProblem/exportCompanyProblemData?beginDate="+begin+"&endDate="+end+"&accessToken="+sessionStorage.token
location.href=url
},
//搜索
searchSubmit () {
if(this.formItem.beginDate!="" && this.formItem.endDate !=""){
this.isFirst = true
setTimeout(()=>{
this.$refs.table.init()
this.isFirst = false
},200)
}else{
this.$Modal.error({title: '提示信息', content: "请输入进行检索的完整起始时间"})
}
},
//重置
searchCancel(){
this.formItem.beginDate=""
this.formItem.endDate=""
this.beginDate=""
this.endDate=""
this.isFirst = true
this.createdTime=[]
setTimeout(()=>{
this.$refs.table.init()
this.isFirst = false
},200)
},
getcreatedTime(createdTime) {
this.formItem.beginDate=createdTime[0]
this.formItem.endDate=createdTime[1]
},
}
}
</script>
<template>
<div class="page">
<Row :gutter="10" >
<Col span="24">
<Card class="search-card">
<p slot="title">
角色新增
</p>
<Row>
<Col span="5">
角色名称:
</Col>
<Col span="12">
{{roleName}}
</Col>
</Row>
<Row>
<Col span="5">
角色说明:
</Col>
<Col span="12">
{{explain}}
</Col>
</Row>
</Card>
</Col>
</Row>
<Row :gutter="10" class="mt10">
<Col span="24">
<Card>
<Row class="tableItem">
<div class="tableColHead" >
<Col span="4" >
<div @click="clickAll">
<Checkbox v-model="selectAll" @on-change="checkAll" ></Checkbox>
</div>
</Col>
<Col span="20" style="font-weight:bolder;">
权限名称
</Col>
</div>
</Row>
<Row v-for="(item,index) in tableData" :key="index" :class="{tableItem:true,bottom:index==tableData.length-1}" >
<div class="tableCol" ref="tableCol" @click="clickItem" :class="{active:selectList.indexOf(item.id) != -1 ? true : false}">
<Col span="4">
<Checkbox @on-change="checkItemAll(item.id,item.childs)" :value="selectList.indexOf(item.id) != -1 ? true : false" ></Checkbox>
</Col>
<Col span="16" >
<div @click="openList(item,index)" class="tableName">
<span>
{{item.name}}
</span>
<Icon type="chevron-down" ref="iconDown" class="iconDown" v-show="item.childs.length>0"></Icon>
<Icon type="chevron-up" ref="iconUp" class="iconUp" v-show="item.childs.length>0"></Icon>
</div>
</Col>
</div>
<div ref="openlist" class="openlist" @click="clickItem">
<div v-for="(v,i) in item.childs" :key="i" class="tableCol" ref="tableCol" :class="{active:selectList.indexOf(v.id) != -1 ? true : false}">
<Col span="4">
<Checkbox @on-change="checkItemAll(v.id)" :value="selectList.indexOf(v.id) != -1 ? true : false"></Checkbox>
</Col>
<Col span="18" style="display:flex;justify-content:space-between;">
<span>
<!-- +'***'+v.code -->
{{v.name}}
</span>
</Col>
</div>
</div>
</Row>
</Card>
</Col>
<Row>
<Col span="20">
</Col>
<Col span="4">
<Button type="primary" @click="permission">确定</Button>
</Col>
</Row>
</Row>
</div>
</template>
<script type="text/ecmascript-6">
import qs from "qs";
export default {
data() {
return {
selectAll:false,//全选
isClick:false,//是否点击全选
roleName:sessionStorage.roleName,
explain:sessionStorage.explain,
selectList:[],//选中的权限列表
// 表格数据
tableData: [
]
};
},
methods: {
// 点击子复选框
clickItem(){
this.isClick=false
},
// 点击父复选框
clickAll(){
this.isClick=true
},
// 全选
checkAll(){
if(this.isClick==true){
if(this.selectAll){
this.selectList=[]
this.tableData.map((item)=>{
this.selectList.push(item.id)
item.childs.map((v)=>{
this.selectList.push(v.id)
})
})
}else{
this.selectList=[]
}
// console.log(this.selectList)
}else{
if(this.selectList.length<this.$refs.tableCol.length){
this.selectAll=false
}else{
this.selectAll=true
}
}
console.log(this.$refs.tableCol.length)
},
// 单选
checkItemAll(id,item){
if(!item){
if(this.selectList.indexOf(id)==-1){
this.selectList.push(id)
}else{
this.selectList.splice(this.selectList.indexOf(id),1)
}
}else{
if(this.selectList.indexOf(id)==-1){
this.selectList.push(id)
item.map((v)=>{
this.selectList.push(v.id)
})
}else{
this.selectList.splice(this.selectList.indexOf(id),1)
item.map((v)=>{
this.selectList.splice(this.selectList.indexOf(v.id),1)
})
}
}
},
// 打开二级列表
openList(item,index){
item.open=!item.open
if(item.childs.length>0){
if(item.open){
document.querySelectorAll(".iconDown")[index].style.display="none"
document.querySelectorAll(".iconUp")[index].style.display="unset"
document.querySelectorAll(".openlist")[index].style.display="block"
}else{
document.querySelectorAll(".iconDown")[index].style.display="unset"
document.querySelectorAll(".iconUp")[index].style.display="none"
document.querySelectorAll(".openlist")[index].style.display="none"
}
}
},
// 配置权限
permission(){
let idList=""
idList=this.selectList.join(",")
let params={
permissionId:idList,
roleId:sessionStorage.roleId
}
this.$request.post("/api/emaint/role/configuration/permission?permissionId="+idList+"&roleId="+sessionStorage.roleId,{}, res => {
// this.$request.post("/api/emaint/role/configuration/permission",params, res => {
this.$Message.success("分配成功")
this.$router.push("/roleManagement")
}, res => {
})
},
// 获取角色权限
getpermissionList(){
this.$request.post("/api/emaint/permissions/list", {}, res => {
this.tableData=res.responseResult
this.tableData.map((item,index)=>{
item.open=false;
})
}, res => {
})
},
//获取本角色权限
getRolepermission(){
let RoleParam={
page:1,
limit:1000,
roleId:sessionStorage.roleId
}
this.$request.post("/api/emaint/role/permissionPage", qs.stringify(RoleParam), res => {
this.selectList=[]
res.responseResult.list.map((item)=>{
this.selectList.push(item.id)
})
}, res => {
})
}
},
mounted(){
this.getpermissionList()
this.getRolepermission()
},
watch:{
tableData(){
return this.tableData
},
selectList(){
if(this.selectList.length<this.$refs.tableCol.length){
this.selectAll=false
}else{
this.selectAll=true
}
}
}
};
</script>
<style scoped>
div.page {
width: 100%;
display: flex;
}
div.page > div {
width: 50% !important;
margin-top: 0px;
margin-right: 5px !important;
margin-left: 0px !important;
}
div.page > div.mt10 div.ivu-row > div.ivu-col:first-of-type {
margin-top: 10px;
}
div.page > div.mt10 div.ivu-row > div.ivu-col:last-of-type {
margin-top: 10px;
border: 1px solid #eee;
background-color: rgba(240, 240, 240, 1);
}
div.ivu-card-body {
padding: 0px;
}
div.ivu-row {
width: 100%;
}
div.first,
div.two {
line-height: 30px;
}
div.first {
background-color: rgba(204, 204, 204, 1);
}
div.two {
background-color: rgba(240, 240, 240, 1);
}
.ivu-form {
padding: 0px 15px;
margin-top: 25px;
}
div.model div.ivu-modal {
width: 340px !important;
}
input.ivu-input,
.ivu-select-selection {
height: 40px !important;
}
div.controlbutton {
position: absolute;
background-color: #f7f7f7;
z-index: 15;
top: 35px;
width: 90px;
}
div.controlbutton button {
width: 100%;
border: none;
border-radius: 0px;
}
.openlist{
display: none;
}
.iconUp{
display: none;
}
.tableItem{
z-index:100000;
border:1px solid gainsboro;
border-bottom:none;
cursor: pointer;
}
.active{
background-color: #2d8cf0;
color: white;
}
.tableCol,.tableColHead{
height:50px;
display:flex;
align-items:center;
}
.tableName{
height:50px;
display:flex;
justify-content:space-between;
align-items:center;
}
.bottom{
border-bottom:1px solid gainsboro;
}
</style>
@keyframes error403animation {
0% {
transform: rotateZ(0deg);
}
40% {
transform: rotateZ(-20deg);
}
45% {
transform: rotateZ(-15deg);
}
50% {
transform: rotateZ(-20deg);
}
55% {
transform: rotateZ(-15deg);
}
60% {
transform: rotateZ(-20deg);
}
100% {
transform: rotateZ(0deg);
}
}
.error403{
&-body-con{
width: 700px;
height: 500px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
&-title{
text-align: center;
font-size: 240px;
font-weight: 700;
color: #2d8cf0;
height: 260px;
line-height: 260px;
margin-top: 40px;
.error403-0-span{
display: inline-block;
position: relative;
width: 170px;
height: 170px;
border-radius: 50%;
border: 20px solid #ed3f14;
color: #ed3f14;
margin-right: 10px;
i{
display: inline-block;
font-size: 120px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
}
}
.error403-key-span{
display: inline-block;
position: relative;
width: 100px;
height: 190px;
border-radius: 50%;
margin-right: 10px;
i{
display: inline-block;
font-size: 190px;
position: absolute;
left: 20px;
transform: translate(-50%,-60%);
transform-origin: center bottom;
animation: error403animation 2.8s ease 0s infinite;
}
}
}
&-message{
display: block;
text-align: center;
font-size: 30px;
font-weight: 500;
letter-spacing: 4px;
color: #dddde2;
}
}
&-btn-con{
text-align: center;
padding: 20px 0;
margin-bottom: 40px;
}
}
\ No newline at end of file
<style lang="less">
@import './403.less';
</style>
<template>
<div class="error403">
<div class="error403-body-con">
<Card>
<div class="error403-body-con-title">4<span class="error403-0-span"><Icon type="android-lock"></Icon></span><span class="error403-key-span"><Icon size="220" type="ios-bolt"></Icon></span></div>
<p class="error403-body-con-message">You don't have permission</p>
<div class="error403-btn-con">
<Button @click="goHome" size="large" style="width: 200px;" type="text">返回首页</Button>
<Button @click="backPage" size="large" style="width: 200px;margin-left: 40px;" type="primary">返回上一页</Button>
</div>
</Card>
</div>
</div>
</template>
<script>
export default {
name: 'Error403',
methods: {
backPage () {
this.$router.go(-1);
},
goHome () {
this.$router.push({
name: 'home_index'
});
}
}
};
</script>
@keyframes error404animation {
0% {
transform: rotateZ(0deg);
}
20% {
transform: rotateZ(-60deg);
}
40% {
transform: rotateZ(-10deg);
}
60% {
transform: rotateZ(50deg);
}
80% {
transform: rotateZ(-20deg);
}
100% {
transform: rotateZ(0deg);
}
}
.error404{
&-body-con{
width: 700px;
height: 500px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
&-title{
text-align: center;
font-size: 240px;
font-weight: 700;
color: #2d8cf0;
height: 260px;
line-height: 260px;
margin-top: 40px;
span{
display: inline-block;
color: #19be6b;
font-size: 230px;
animation: error404animation 3s ease 0s infinite alternate;
}
}
&-message{
display: block;
text-align: center;
font-size: 30px;
font-weight: 500;
letter-spacing: 12px;
color: #dddde2;
}
}
&-btn-con{
text-align: center;
padding: 20px 0;
margin-bottom: 40px;
}
}
\ No newline at end of file
<style lang="less">
@import './404.less';
</style>
<template>
<div class="error404">
<div class="error404-body-con">
<Card>
<div class="error404-body-con-title">4<span><Icon type="ios-navigate-outline"></Icon></span>4</div>
<p class="error404-body-con-message">YOU&nbsp;&nbsp;LOOK&nbsp;&nbsp;LOST</p>
<div class="error404-btn-con">
<Button @click="goHome" size="large" style="width: 200px;" type="text">返回首页</Button>
<Button @click="backPage" size="large" style="width: 200px;margin-left: 40px;" type="primary">返回上一页</Button>
</div>
</Card>
</div>
</div>
</template>
<script>
export default {
name: 'Error404',
methods: {
backPage () {
this.$router.go(-1);
},
goHome () {
this.$router.push({
name: 'home_index'
});
}
}
};
</script>
@keyframes error500animation {
0% {
transform: rotateZ(0deg);
}
20% {
transform: rotateZ(-10deg);
}
40% {
transform: rotateZ(5deg);
}
60% {
transform: rotateZ(-5deg);
}
80% {
transform: rotateZ(10deg);
}
100% {
transform: rotateZ(0deg);
}
}
.error500{
&-body-con{
width: 700px;
height: 500px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
&-title{
text-align: center;
font-size: 240px;
font-weight: 700;
color: #2d8cf0;
height: 260px;
line-height: 260px;
margin-top: 40px;
.error500-0-span{
display: inline-block;
position: relative;
width: 170px;
height: 170px;
border-radius: 50%;
border: 20px solid #ed3f14;
color: #ed3f14;
margin-right: 10px;
i{
display: inline-block;
font-size: 120px;
position: absolute;
bottom: -10px;
left: 10px;
transform-origin: center bottom;
animation: error500animation 3s ease 0s infinite alternate;
}
}
}
&-message{
display: block;
text-align: center;
font-size: 30px;
font-weight: 500;
letter-spacing: 4px;
color: #dddde2;
}
}
&-btn-con{
text-align: center;
padding: 20px 0;
margin-bottom: 40px;
}
}
\ No newline at end of file
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