Commit 9b0edb9f authored by 何鹏程's avatar 何鹏程

初始化项目

parents
Pipeline #138 failed with stages
{
"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
.DS_Store
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.git
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
/dist
\ No newline at end of file
// 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": {}
}
}
# md-node-cms
> A Vue.js project
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
```
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)
}
}
'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',
publicPath: '../../'
})
} 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 merge = require('webpack-merge')
const isProduction = process.env.NODE_ENV === 'production'
const sourceMapEnabled = isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap
const extendLoaders = {
i18n: '@kazupon/vue-i18n-loader'
}
module.exports = {
loaders: merge(utils.cssLoaders({
sourceMap: sourceMapEnabled,
extract: isProduction
}),extendLoaders),
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)
}
const createLintingRule = () => ({
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'),
resolve('test'),
resolve('/node_modules/_element-ui@2.14.1@element-ui/src'), //和下面截图文件名字对应起来即可正常打包!!!
resolve('/node_modules/_element-ui@2.14.1@element-ui/packages')
],
options: {
formatter: require('eslint-friendly-formatter'),
emitWarning: !config.dev.showEslintErrorsInOverlay
}
})
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'sysStatic': resolve('src/assets'),
'sysComponents': resolve('src/components'),
'sysPage': resolve('src/page')
}
},
module: {
rules: [
...(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client'), resolve('mock')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}
'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 })
},
devtool: config.dev.devtool,
devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
hot: true,
contentBase: false,
compress: true,
host: HOST || config.dev.host, //ip
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,
watchOptions: {
poll: config.dev.poll,
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
favicon: './favicon.ico',
inject: true
}),
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 {
process.env.PORT = port
devWebpackConfig.devServer.port = port
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 Version = new Date().getTime();
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].'+ Version +'.js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].'+ Version +'.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'
const path = require('path')
module.exports = {
dev: {
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api': {
// target: 'http://172.16.15.100:801',// 开发环境地址
target: 'http://172.16.15.117:8084/',// 开发环境地址
// target: 'http://172.16.15.115:8010',// 开发环境地址
//target: 'http://172.16.15.100:8081',// 开发环境地址
changeOrigin: true,
pathRewrite: {
'^/api': '/api'
}
}
},
host: 'localhost',
port: 8086,
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false,
useEslint: false,
showEslintErrorsInOverlay: false,
devtool: 'cheap-module-eval-source-map',
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"'
}
favicon.ico

1.12 KB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- IE使用当前浏览器的最高文档模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 多核浏览器使用webkit内核 -->
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>明医咨询认证平台</title>
<!-- 引入阿里云oss-sdk -->
<script src="https://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"></script>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
/**
* 因Mock自身原因,不能直接模拟不带属性名的数组。这里需要的是[1,2,3],而不是{data: [1,2,3]}
* 以下被注释掉的方法不可取,因每次获取后,返回值不变
*/
// import Mock from 'mockjs'
// var data = Mock.mock({
// "data|7": [
// '@natural(60, 100)'
// ]
// })
// export default [{
// path: '/charts',
// data: data.data
// }]
export default [{
path: '/charts',
data: function() {
var res = []
for (var i = 0; i < 7; i++) {
res.push(parseInt(Math.random() * 100) + 1)
}
return res
}
}]
var data = {
'token': '@guid'
}
export default [{
path: '/getToken',
data: data
}]
export default {
path: '/groupList',
data: {
key: 'accountInfo',
name: '账号信息',
leaf: 0,
child: [
{
key: 'userInfo',
name: '用户信息',
leaf: 0,
child: [
{
key: 'userBasic',
name: '基本信息',
leaf: 0,
child: [
{
key: 'userName',
name: '用户名',
leaf: 1
},
{
key: 'loginName',
name: '登录名',
leaf: 1
},
{
key: 'name',
name: '姓名',
leaf: 1
}
]
}
]
},
{
key: 'adminInfo',
name: '管理员信息',
leaf: 0,
child: [
{
key: 'userBasic',
name: '基本信息',
leaf: 0,
child: [
{
key: 'userName',
name: '用户名',
leaf: 1
},
{
key: 'loginName',
name: '登录名',
leaf: 1
},
{
key: 'name',
name: '姓名',
leaf: 1
},
{
key: 'sex',
name: '性别',
leaf: 1
}
]
}
]
}
]
}
}
import Mock from 'mockjs'
import menuList from './menuList'
import login from './login'
import echarts from './echarts'
import table from './table'
import groupList from './groupList'
import getToken from './getToken'
let data = [].concat(menuList, login, echarts, table, groupList, getToken)
data.forEach(function(res) {
Mock.mock(res.path, res.data)
})
export default Mock
var data = {
'login': 'true',
'captcha': "@image('100x40', '#FFFFFF', '@word')",
'message': '用户名,密码,验证码随便填!若登陆失败,多点几次登陆@increment',
'uid': '@id',
'name': '@cname',
'token': '@guid'
}
export default [{
path: '/login',
data: data
}]
var data_hospital = {
menuType:2,
menuList:[
{
name: '胸痛中心',
permissions:[],
path: '/manage/projectManage',
icon: 'fa-book',
child: [
{
permissions:[
{btnName:'btn1',isShow:true}
],
path: '/hospital/index',
name: '首页',
icon: 'fa-book'
},
{
permissions:[
{btnName:'btn1',isShow:true}
],
path: '/hospital/certification',
name: '认证概况',
icon: 'fa-book'
},
{
permissions:[
{btnName:'btn1',isShow:true}
],
path: '/hospital/autnTask',
name: '认证任务',
icon: 'fa-book'
},
{
permissions:[
{btnName:'btn1',isShow:true}
],
path: '/hospital/cnstMls',
name: '建设材料',
icon: 'fa-book'
},
{
permissions:[
{btnName:'btn1',isShow:true}
],
path: '/hospital/qaCtl',
name: '质控数据',
icon: 'fa-book'
},
{
permissions:[
{btnName:'btn1',isShow:true}
],
path: '/hospital/ctfCutn',
name: '认证资讯',
icon: 'fa-book'
},
{
permissions:[
{btnName:'btn1',isShow:true}
],
path: '/hospital/news',
name: '消息中心',
icon: 'fa-book'
}
],
}
]
}
var data_manage = {
menuType:1,
menuList:[
{
permissions:[],
path: '/manage/projectManage',
name: '项目管理',
icon: 'fa-book',
child: []
},
{
permissions:[],
path: '/manage/medicalOfficer',
name: '医学联络官',
icon: 'fa-book',
child: []
},
{
permissions:[],
path: '/manage/systemInforms',
name: '系统通知',
icon: 'fa-book',
child: []
}
]
}
export default [{
path: '/user/menuList',
data: data_manage
}]
export default {
path: '/tableData',
data: {
head: [
{
key: 'name',
name: '姓名'
},
{
key: 'sex',
name: '性别'
},
{
key: 'age',
name: '年龄'
},
{
key: 'address',
name: '地址'
},
{
key: 'email',
name: '邮件'
},
{
key: 'remark',
name: '备注'
}
],
body: [
{
'name': '@cname',
'sex|1': ['男', '女'],
'age': '@natural(18, 60)',
'address': '@city(true) ',
'email': '@email()',
'remark': '@cparagraph(1)',
operation: 'edit,delete'
},
{
'name': '@cname',
'sex|1': ['男', '女'],
'age': '@natural(18, 60)',
'address': '@city(true)',
'email': '@email()',
'remark': '@cparagraph(1)',
operation: 'edit,delete'
}
]
}
}
This diff is collapsed.
{
"name": "md-vue-pm",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "pangzhiyuan <pangzhiyuan>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.conf.js",
"start": "npm run dev",
"lint": "eslint --ext .js,.vue src",
"build": "node build/build.js"
},
"dependencies": {
"@types/node": "^10.5.2",
"axios": "^0.18.0",
"crypto-js": "^3.1.9-1",
"echarts": "^4.9.0",
"element-ui": "^2.4.3",
"js-cookie": "^2.2.0",
"lodash": "^4.17.10",
"ly-downloader": "^1.0.5",
"mockjs": "^1.0.1-beta3",
"nprogress": "^0.2.0",
"vue": "^2.5.2",
"vue-i18n": "^8.0.0",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"@kazupon/vue-i18n-loader": "^0.3.0",
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^8.2.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",
"babel-register": "^6.26.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"eslint": "^4.15.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-html": "^4.0.5",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.0",
"express": "^4.16.3",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"good-storage": "^1.0.1",
"html-webpack-plugin": "^2.30.1",
"http-proxy-middleware": "^0.18.0",
"node-notifier": "^5.1.2",
"node-sass": "^4.9.2",
"opn": "^5.3.0",
"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-pxtorem": "^5.1.1",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"sass-loader": "^7.0.3",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"style-loader": "^0.21.0",
"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"
class="main-app"
>
<router-view></router-view>
</div>
</template>
<script>
export default {
// TODO: 全局状态加载及变更。请根据实际情况改写
beforeMount() {
},
methods: {
}
}
</script>
<style lang="scss">
</style>
import request from '../util/ajax'
export function login() {
return request({
url: ''
})
}
export function queryDictionaryList(params) {
return request({
url: '/api/team/dictionary/queryDictionaryList',
method: 'POST',
data: params
})
}
export function queryEmergencyHospitalList(params) {
return request({
url: '/api/team/hospital/queryEmergencyHospitalList',
method: 'POST',
data: params
})
}
export function queryExtendConfig(params) {
return request({
url: '/api/team/extend/queryExtendConfig',
method: 'POST',
data: params
})
}
\ No newline at end of file
import request from '../util/ajax'
export function queryEmergencyCarPageList(params) {
return request({
url: '/api/team/car/queryEmergencyCarPageList',
method: 'POST',
data: params
})
}
export function saveOrUpdateEmergencyCar(params) {
return request({
url: '/api/team/car/saveOrUpdateEmergencyCar',
method: 'POST',
data: params
})
}
export function deleteEmergencyCar(params) {
return request({
url: '/api/team/car/deleteEmergencyCar',
method: 'POST',
data: params
})
}
export function bindSiteToEmergencyCar(params) {
return request({
url: '/api/team/car/bindSiteToEmergencyCar',
method: 'POST',
data: params
})
}
export function queryTeamEmergencyCarInfo(params) {
return request({
url: '/api/team/car/queryTeamEmergencyCarInfo',
method: 'POST',
data: params
})
}
export function queryCarList(params) {
return request({
url: '/api/team/car/queryCarList',
method: 'POST',
data: params
})
}
import request from '../util/ajax'
export function queryEmergencyExpertPageList(params) {
return request({
url: '/api/team/expert/queryEmergencyExpertPageList',
method: 'POST',
data: params
})
}
export function addOrUpdateEmergencyExpert(params) {
return request({
url: '/api/team/expert/addOrUpdateEmergencyExpert',
method: 'POST',
data: params
})
}
export function queryInfoById(params) {
return request({
url: '/api/team/expert/queryInfoById',
method: 'POST',
data: params
})
}
export function deleteTeamEmergencyExpert(params) {
return request({
url: '/api/team/expert/deleteTeamEmergencyExpert',
method: 'POST',
data: params
})
}
\ No newline at end of file
import request from '../util/ajax'
export function queryEmergencySiteList(params) {
return request({
url: '/api/team/site/queryEmergencySiteList',
method: 'POST',
data: params
})
}
export function queryEmergencySitePageList(params) {
return request({
url: '/api/team/site/queryEmergencySitePageList',
method: 'POST',
data: params
})
}
export function saveOrUpdateEmergencySite(params) {
return request({
url: '/api/team/site/saveOrUpdateEmergencySite',
method: 'POST',
data: params
})
}
export function deleteEmergencySite(params) {
return request({
url: '/api/team/site/deleteEmergencySite',
method: 'POST',
data: params
})
}
export function auditEmergencySite(params) {
return request({
url: '/api/team/site/auditEmergencySite',
method: 'POST',
data: params
})
}
export function queryEmergencySiteDtoById(params) {
return request({
url: '/api/team/site/queryEmergencySiteDtoById',
method: 'POST',
data: params
})
}
\ No newline at end of file
.main-app {
width: 100%;
height: 100%;
position: static;
.main-wrapper {
height: 100%;
width: 100%;
.main-header {
height: 60px;
line-height: 60px;
background: #017BCE;
padding: 0 20px;
.p {
font-size: 24px;
color: #ffffff;
float: left;
}
.div {
float: right;
color: #FFFFFF;
img {
width: 24px;
height: 24px;
vertical-align: middle;
margin: -3px 8px 0;
}
}
}
.main-body {
position: inherit;
height: calc(100% - 60px);
background: #E0E2E4;
.main-nav {
height: 100%;
width: 230px;
float: left;
transition: width .3s linear;
overflow: hidden;
background-color: #ffffff;
box-shadow: 2px 0px 6px 0px rgba(0, 21, 41, 0.12);
.el-menu {
border-right: none;
.el-submenu__title {
height: 40px;
line-height: 40px;
color: #000000;
font-size: 16px;
.fa {
color: #1E70FE;
margin-right: 8px;
}
.el-submenu__icon-arrow {
font-weight: bold;
font-size: 16px;
margin-top: -8px;
right: 16px;
}
}
.el-menu-item {
height: 40px;
line-height: 40px;
font-size: 14px;
color: #000000;
}
&.el-menu--inline {
background-color: #F3F6F8;
}
}
.el-menu-item {
color: #000000;
&.is-active {
background-color: #D6D6D6;
color: #000000 !important;
}
&:hover {
background: #D6D6D6;
}
}
}
.main-content {
height: 100%;
overflow: auto;
.main-page {
padding: 20px;
height: 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
.main-page-header {
background: #FFFFFF;
margin-bottom: 20px;
padding: 20px 32px 6px;
.title {
font-size: 20px;
color: rgba(0, 0, 0, 0.87);
line-height: 20px;
margin-bottom: 33px;
}
.btns {
float: right;
}
}
.main-page-body {
background-color: #FFFFFF;
overflow: auto;
flex: 1;
}
}
// .btn_type1 {
// background: #2875CA;
// &:hover {
// background: #1f4977;
// }
// }
// .btn_type2 {
// border-color: #B2B2B2;
// }
}
}
}
}
.main-table {
.el-table {
th,
td {
padding: 0;
}
th {
.cell {
font-weight: normal;
color: #646464;
background: #F6F1D9;
line-height: 40px;
height: 40px;
}
}
td {
.cell {
color: #333333;
line-height: 30px;
height: 30px;
}
}
}
.main-table-pagination {
text-align: right;
margin-top: 16px;
.el-pagination {}
}
}
.el-form-item--small.el-form-item {
margin-bottom: 20px;
}
.el-checkbox__label {
padding-left: 5px;
}
.el-input__inner {
padding: 0 5px;
}
.el-radio__inner::after {
background: #40a2de;
width: 8px;
height: 8px;
}
.el-radio__label {
padding-left: 5px;
}
.el-form-item__label {
padding-right: 10px;
}
.el-tooltip__popper.is-dark {
opacity: 0.7;
}
.noData {
margin: 0 auto;
background: url("../images/CoverPage.png") no-repeat center;
height: 350px;
}
html,
body,
div,
section,
header,
footer,
aside,
ul,
ol,
li,
table,
tr,
th,
td,
button,
input,
textarea,
select,
h1,
h2,
h3,
h4,
h5,
h6,
em,
i,
strong,
p,
span,
blockquote {
margin: 0;
padding: 0;
}
h1,
h2,
h3,
h4,
h5,
h6,
em,
i,
strong,
input,
textarea,
button,
select {
font-weight: normal;
font-style: normal;
font-size: 100%;
}
ul,
ol {
list-style: none;
vertical-align: top;
}
table,
td,
th {
border-collapse: collapse;
border-spacing: 0;
}
input,
button,
select,
textarea {
outline: none;
background: none;
}
textarea {
resize: none;
}
img,
a img {
border: none;
vertical-align: top;
}
a,
a:link,
a:active,
a:visited {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html {
height: 100%;
}
body {
font-size: 14px;
font-family: "Microsoft Yahei", Arial;
color: #666;
height: 100%;
}
.clear:after {
content: "";
display: block;
clear: both;
visibility: hidden;
height: 0;
}
/** 主题样式 **/
@import "../libs/element-variables-default";
$--font-path: '~element-ui/lib/theme-chalk/fonts';
/** 默认样式 **/
@import "~element-ui/packages/theme-chalk/src/index";
// 引入基础变量
@import 'reset';
@import '../font-awesome-4.7.0/scss/font-awesome.scss';
// 框架样式
@import 'common';
This source diff could not be displayed because it is too large. You can view the blob instead.
// Spinning Icons
// --------------------------
.#{$fa-css-prefix}-spin {
-webkit-animation: fa-spin 2s infinite linear;
animation: fa-spin 2s infinite linear;
}
.#{$fa-css-prefix}-pulse {
-webkit-animation: fa-spin 1s infinite steps(8);
animation: fa-spin 1s infinite steps(8);
}
@-webkit-keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
// Bordered & Pulled
// -------------------------
.#{$fa-css-prefix}-border {
padding: .2em .25em .15em;
border: solid .08em $fa-border-color;
border-radius: .1em;
}
.#{$fa-css-prefix}-pull-left { float: left; }
.#{$fa-css-prefix}-pull-right { float: right; }
.#{$fa-css-prefix} {
&.#{$fa-css-prefix}-pull-left { margin-right: .3em; }
&.#{$fa-css-prefix}-pull-right { margin-left: .3em; }
}
/* Deprecated as of 4.4.0 */
.pull-right { float: right; }
.pull-left { float: left; }
.#{$fa-css-prefix} {
&.pull-left { margin-right: .3em; }
&.pull-right { margin-left: .3em; }
}
// Base Class Definition
// -------------------------
.#{$fa-css-prefix} {
display: inline-block;
font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
// Fixed Width Icons
// -------------------------
.#{$fa-css-prefix}-fw {
width: (18em / 14);
text-align: center;
}
This diff is collapsed.
// Icon Sizes
// -------------------------
/* makes the font 33% larger relative to the icon container */
.#{$fa-css-prefix}-lg {
font-size: (4em / 3);
line-height: (3em / 4);
vertical-align: -15%;
}
.#{$fa-css-prefix}-2x { font-size: 2em; }
.#{$fa-css-prefix}-3x { font-size: 3em; }
.#{$fa-css-prefix}-4x { font-size: 4em; }
.#{$fa-css-prefix}-5x { font-size: 5em; }
// List Icons
// -------------------------
.#{$fa-css-prefix}-ul {
padding-left: 0;
margin-left: $fa-li-width;
list-style-type: none;
> li { position: relative; }
}
.#{$fa-css-prefix}-li {
position: absolute;
left: -$fa-li-width;
width: $fa-li-width;
top: (2em / 14);
text-align: center;
&.#{$fa-css-prefix}-lg {
left: -$fa-li-width + (4em / 14);
}
}
// Mixins
// --------------------------
@mixin fa-icon() {
display: inline-block;
font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@mixin fa-icon-rotate($degrees, $rotation) {
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})";
-webkit-transform: rotate($degrees);
-ms-transform: rotate($degrees);
transform: rotate($degrees);
}
@mixin fa-icon-flip($horiz, $vert, $rotation) {
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)";
-webkit-transform: scale($horiz, $vert);
-ms-transform: scale($horiz, $vert);
transform: scale($horiz, $vert);
}
// Only display content to screen readers. A la Bootstrap 4.
//
// See: http://a11yproject.com/posts/how-to-hide-content/
@mixin sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
border: 0;
}
// Use in conjunction with .sr-only to only display content when it's focused.
//
// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
//
// Credit: HTML5 Boilerplate
@mixin sr-only-focusable {
&:active,
&:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
}
/* FONT PATH
* -------------------------- */
@font-face {
font-family: 'FontAwesome';
src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}');
src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'),
url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'),
url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'),
url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'),
url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg');
// src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
font-weight: normal;
font-style: normal;
}
// Rotated & Flipped Icons
// -------------------------
.#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); }
.#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); }
.#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); }
.#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); }
.#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); }
// Hook for IE8-9
// -------------------------
:root .#{$fa-css-prefix}-rotate-90,
:root .#{$fa-css-prefix}-rotate-180,
:root .#{$fa-css-prefix}-rotate-270,
:root .#{$fa-css-prefix}-flip-horizontal,
:root .#{$fa-css-prefix}-flip-vertical {
filter: none;
}
// Screen Readers
// -------------------------
.sr-only { @include sr-only(); }
.sr-only-focusable { @include sr-only-focusable(); }
// Stacked Icons
// -------------------------
.#{$fa-css-prefix}-stack {
position: relative;
display: inline-block;
width: 2em;
height: 2em;
line-height: 2em;
vertical-align: middle;
}
.#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x {
position: absolute;
left: 0;
width: 100%;
text-align: center;
}
.#{$fa-css-prefix}-stack-1x { line-height: inherit; }
.#{$fa-css-prefix}-stack-2x { font-size: 2em; }
.#{$fa-css-prefix}-inverse { color: $fa-inverse; }
This diff is collapsed.
/*!
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@import "variables";
@import "mixins";
@import "path";
@import "core";
@import "larger";
@import "fixed-width";
@import "list";
@import "bordered-pulled";
@import "animated";
@import "rotated-flipped";
@import "stacked";
@import "icons";
@import "screen-reader";
/* Element Chalk Variables */
/* Colors
-------------------------- */
$--color-white: #fff !default;
$--color-333: #333 !default;
$--color-666: #666 !default;
$--color-999: #999 !default;
$--color-primary: #017BCE !default;
$--color-primary-light: #026CB4 !default;
$--color-text-primary: #017BCE !default;
$--link-color: $--color-primary-light !default;
$--link-hover-color: $--color-primary !default;
/* Checkbox
-------------------------- */
$--checkbox-font-size: 14px !default;
$--checkbox-font-weight: 500 !default;
$--checkbox-color: $--color-666 !default;
$--checkbox-input-height: 14px !default;
$--checkbox-input-width: 14px !default;
$--checkbox-border-radius: 0px !default;
$--checkbox-input-fill: $--color-white !default;
$--checkbox-input-border: 1px solid #40a2de !default;
$--checkbox-input-border-color: #40a2de !default;
$--checkbox-icon-color: $--color-white !default;
$--radio-input-height: 14px !default;
$--radio-input-width: 14px !default;
$--checkbox-bordered-height: 30px !default;
$--checkbox-bordered-small-height: 30px !default;
/* Input
-------------------------- */
$--input-height: 30px !default;
$--input-border: 1px solid #40a2de !default;
$--input-border-color: #40a2de !default;
$--input-border-radius: 0 !default;
$--input-hover-border: #40a2de !default;
/* Radio
-------------------------- */
$--radio-input-height: 14px !default;
$--radio-input-width: 14px !default;
$--radio-input-border: 1px solid #40a2de !default;
$--radio-checked-input-border-color: #40a2de !default;
$--radio-checked-icon-color: #fff !default;
/* Select
-------------------------- */
$--select-border-color-hover: #40a2de !default;
/* Tooltip
-------------------------- */
$--tooltip-fill: #000 !default;
$--tooltip-color: $--color-white !default;
$--tooltip-font-size: 12px !default;
$--tooltip-arrow-size: 6px !default;
$--tooltip-padding: 10px !default;
$--tooltip-border-color: #000 !default;
export const tableDataMixin = {
data() {
return {
pageNum: 1,
pageSize: 10,
pageSizes: [10, 20, 50],
total: 0,
sortName: '',
sortValue: '',
pagination: true,
multipleSelection: []
}
},
mounted() {
if (this.$refs.searchForm) {
let _this = this
// enter键登录
this.$refs.searchForm.$el.onkeydown = function(e) {
let key = window.event.keyCode
if (key === 13) {
_this.getTableData()
}
}
}
},
methods: {
search() {
this.tableData.loading = true
/* this.pageNum = 1*/
this.getTableData()
},
handleSizeChange(val) {
this.pageNum = 1
this.pageSize = val
this.getTableData()
},
handleCurrentChange(val) {
this.pageNum = val
this.getTableData()
},
handleRowClick(row, event, column) {
this.$refs.table.toggleRowSelection(row)
},
handleSelectionChange(val) {
this.multipleSelection = val
},
tableRowClassName({row, rowIndex}) {
for (let item of this.multipleSelection) {
if (item.id && item.id === row.id) {
return 'selected-row'
}
}
},
handleSortChange({prop, order}) {
this.sortName = prop
if (order === 'descending') {
this.sortValue = 'desc'
} else {
this.sortValue = 'asc'
}
this.getTableData()
},
dealTableResponse(res) {
this.tableData.loading = false
if (res && res.msg==201) {
this.tableData.body = res.respData.list
if(this.tableData.body.length==0){
this.pagination = false
}else {
this.pagination = true
}
this.pageNum = res.respData.pageNum > 0 ? res.respData.pageNum : 1
this.pageSize = res.respData.pageSize ? res.respData.pageSize :10
this.total = res.respData.total
} else {
this.$message.error(res.msg)
}
},
resetForm(formName) {
this.$refs[formName].resetFields()
this.search()
}
}
}
<template>
<div class="main-table">
<slot></slot>
<div
class="main-table-pagination"
v-if="pagination"
>
<el-pagination
:current-page="pageNum"
:page-size="pageSize"
background
:page-sizes="pageSizes"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:layout="pageLayout"
:class="align"
>
</el-pagination>
</div>
</div>
</template>
<script>
export default {
name: 'TableMixin',
props: {
pagination: Boolean,
paginationAlign: {
type: String,
default: 'right'
},
pageLayout: {
type: String,
default: 'total, sizes, prev, pager, next, jumper'
},
pageSize: {
type: Number,
default: 10
},
pageSizes: {
type: Array,
default: function() {
return [10, 20, 50]
}
},
total: {
type: Number,
default: 0
},
pageNum: {
type: Number,
default: 1
},
handleSizeChange: {
type: Function,
default: function() {
return null
}
},
handleCurrentChange: {
type: Function,
default: function() {
return null
}
}
},
computed: {
align() {
let res
switch (this.paginationAlign) {
case 'right':
res = 'textR'
break
case 'center':
res = 'textC'
break
default:
res = ''
}
return res
}
}
}
</script>
<style lang="scss">
.sys-table {
position: relative;
}
</style>
// 组件全局注册
import Vue from 'vue'
import TableMixin from './TableMixin'
// 组件库
const Components = [
TableMixin
]
// 注册全局组件
Components.map((com) => {
Vue.component(com.name, com)
})
export default Vue
// 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 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import Echarts from 'echarts';
import store from './store'
import axios from './util/ajax'
import 'sysStatic/css/theme-default-new.scss'
//import '../mock/index.js'
import './components/install'
import {message} from './util/resetMessage';
Vue.config.productionTip = false
Vue.prototype.$axios = axios;
Vue.prototype.$echarts = Echarts;
Vue.use(ElementUI)
Vue.prototype.$message = message;
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
axios,
store,
components: { App },
template: '<App/>'
})
<template>
<el-dialog
title="绑定站点"
:visible.sync="dialogVisible"
width="500px"
@closed="closedHandler"
:close-on-click-modal="false"
>
<el-form
ref="dataForm"
:model="dataForm"
size="small"
label-width="150px"
:rules="rules"
v-loading="loading"
>
<el-form-item
label="站点名称"
prop="siteId"
>
<el-select
v-model="dataForm.siteId"
placeholder="请选择站点"
style="width: 100%"
>
<el-option
v-for="item in siteList"
:label="item.siteName"
:key="item.id"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item
label="上级医院名称"
prop="hospitalCode"
>
<el-select
v-model="dataForm.hospitalCode"
placeholder="请选择上级医院"
style="width: 100%"
>
<el-option
v-for="item in hospitalList"
:label="item.hospitalName"
:key="item.id"
:value="item.hospitalCode"
/>
</el-select>
</el-form-item>
</el-form>
<span
slot="footer"
class="dialog-footer"
>
<el-button
size="small"
@click="dialogVisible = false"
>取 消</el-button>
<el-button
type="primary"
size="small"
@click="submitForm()"
>确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import { queryTeamEmergencyCarInfo, bindSiteToEmergencyCar } from '@/api/emergencyCar'
import { queryEmergencyHospitalList } from '@/api/common'
import { queryEmergencySiteList } from '@/api/site'
export default {
data() {
return {
dialogVisible: false,
loading: false,
dataForm: {
siteId: '',
hospitalCode: ''
},
siteList: [],
hospitalList: [],
rules: {
siteId: [
{ required: true, message: '请选择站点' },
],
hospitalCode: [
{ required: true, message: '请选择上级医院' },
]
}
}
},
mounted() {
//获取可选择的医院
queryEmergencyHospitalList().then(res => {
this.hospitalList = res.respData
})
queryEmergencySiteList().then(res => {
this.siteList = res.respData
})
},
methods: {
init(id) {
this.dialogVisible = true
this.loading = true
if (!id) {
this.$message.error('救护车id不能为空')
return
}
queryTeamEmergencyCarInfo({ id: id }).then(res => {
if (res.msg === 201) {
const { hospitalCode, siteId } = res.respData
this.dataForm = {
id: id,
hospitalCode: hospitalCode,
siteId: siteId
}
this.$nextTick(() => {
this.loading = false
this.$refs.dataForm.clearValidate()
})
} else {
this.$message.error(res.content);
}
})
},
submitForm() {
this.$refs.dataForm.validate((valid) => {
if (valid) {
const params = {
...this.dataForm
}
const hospital = this.hospitalList.find(i => i.hospitalCode === this.dataForm.hospitalCode)
if (!hospital) {
this.$message.error('无效数据');
return
}
const { hospitalName, id } = hospital
params.hospitalName = hospitalName
params.hospitalId = id
const site = this.siteList.find(i => i.id === this.dataForm.siteId)
if (!site) {
this.$message.error('无效数据');
return
}
const { siteName } = site
params.siteName = siteName
bindSiteToEmergencyCar(params).then(res => {
if (res.msg === 201) {
this.dialogVisible = false
this.$message.success('绑定成功')
this.$emit('subsucc')
} else {
this.$message.error(res.content)
}
})
}
})
},
closedHandler() {
this.$refs.dataForm.resetFields()
}
}
}
</script>
<style>
</style>
\ No newline at end of file
This diff is collapsed.
<template>
<div class="main-page">
<div class="main-page-header">
<p class="title">急救车资源</p>
<el-form
:inline="true"
:model="searchForm"
ref="searchForm"
size="small"
>
<el-form-item
prop="vechieType"
label="车辆类型"
>
<el-select
v-model="searchForm.vechieType"
placeholder="请选择车辆类型"
style="width: 100%"
:clearable="true"
>
<el-option
v-for="item in vechieTypeList"
:label="item.name"
:key="item.id"
:value="item.val"
/>
</el-select>
</el-form-item>
<el-form-item
prop="vechieUseStatus"
label="车辆状态"
>
<el-radio-group v-model="searchForm.vechieUseStatus">
<el-radio label="">全部</el-radio>
<el-radio label="1">在用</el-radio>
<el-radio label="2">闲置</el-radio>
<el-radio label="3">其他</el-radio>
</el-radio-group>
</el-form-item>
<div class="btns">
<el-button
type="primary"
size="small"
@click="search"
>查询</el-button>
<el-button
size="small"
@click="resetForm('searchForm')"
>重置</el-button>
</div>
</el-form>
</div>
<div class="main-page-body">
<div class="mainContent">
<div class="bt">
<el-button
type="primary"
size="small"
@click="showEmergencyCarDialog()"
>新增</el-button>
</div>
<table-mixin
:pageSize="pageSize"
:pageNum="pageNum"
:total="total"
:pagination="pagination"
:handleSizeChange="handleSizeChange"
:handleCurrentChange="handleCurrentChange"
>
<el-table
v-loading="tableData.loading"
:data="tableData.body"
@sort-change="handleSortChange"
>
<div
slot="empty"
class="noData"
></div>
<el-table-column
label="序号"
type="index"
width="50"
>
</el-table-column>
<el-table-column
v-for="(item,index) in tableData.head"
:prop="item.key"
:label="item.name"
align="left"
:formatter="item.formatter"
:sortable="item.sortable"
:fixed="item.fixed"
:key="index"
:width="item.width"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="操作"
align="left"
width="auto"
min-width="200px"
>
<template slot-scope="scope">
<el-link
type="primary"
@click="showEmergencyCarDialog('update', scope.row.id)"
>修改</el-link>
<el-link
type="primary"
@click="delHandler(scope.row.id)"
>删除</el-link>
<el-link
type="primary"
@click="siteHandler(scope.row.id)"
>绑定站点</el-link>
</template>
</el-table-column>
</el-table>
</table-mixin>
<EmergencyCarDialog
ref="emergencyCarDialog"
@subsucc="search"
/>
<BindSiteDialog
ref="bindSiteDialog"
@subsucc="search"
/>
</div>
</div>
</div>
</template>
<script>
import { tableDataMixin } from '../../common/js/mixin'
import EmergencyCarDialog from './components/emergencyCarDialog.vue'
import BindSiteDialog from './components/bindSiteDialog.vue'
import { queryEmergencyCarPageList, deleteEmergencyCar } from '@/api/emergencyCar'
import { getDic } from '../../util/dict'
export default {
name: 'emergencyCar',
mixins: [tableDataMixin],
components: {
EmergencyCarDialog,
BindSiteDialog
},
data() {
return {
searchForm: {
vechieUseStatus: '',
vechieType: ''
},
vechieTypeList: [],
areaList: [],
tableData: {
loading: false,
head: [
{
name: '车辆使用单位',
key: 'vehicleUsingUnit',
sortable: false,
width: '200',
fixed: false
},
{
name: '辖区',
key: 'area',
sortable: false,
width: '120',
fixed: false,
formatter: this.areaFormatter
},
{
name: '急救车牌号',
key: 'licensePlateNumber',
sortable: false,
width: '120',
fixed: false
},
{
name: '车辆负责人',
key: 'vehicleManager',
sortable: false,
width: '200',
fixed: false
},
{
name: '当前车辆状态',
key: 'vechieUseStatus',
sortable: false,
width: '80',
fixed: false,
formatter: this.vechieUseStatusFormatter
},
{
name: '是否院前急救',
key: 'isPreHospitalVechie',
sortable: false,
width: '80',
fixed: false,
formatter: this.isPreHospitalVechieFormatter
},
{
name: '车辆类型',
key: 'vechieType',
sortable: false,
width: '120',
fixed: false,
formatter: this.vechieTypeFormatter
}
],
body: [],
option: [],
condition: []
}
}
},
mounted() {
// 获取字典
getDic(['vechie_type', 'area']).then(res => {
this.vechieTypeList = res.vechie_type
this.areaList = res.area
})
this.search()
},
methods: {
getTableData() {
this.tableData.loading = true
const params = {
...this.searchForm,
pageNo: this.pageNum,
pageSize: this.pageSize
}
queryEmergencyCarPageList(params).then((res) => {
if (res.msg == 201) {
this.dealTableResponse(res)
} else {
this.$message.error(res.content)
}
})
},
showEmergencyCarDialog(type = 'add', id = '') {
this.$refs.emergencyCarDialog.init(type, id)
},
siteHandler(id = "") {
this.$refs.bindSiteDialog.init(id)
},
areaFormatter(row, column, cellValue, index) {
const area = this.areaList.find(i => i.val === cellValue)
return area ? area.name : ''
},
vechieUseStatusFormatter(row, column, cellValue, index) {
const vechieUseStatusList = ['', '在用', '闲置', '其他']
return vechieUseStatusList[cellValue] || ''
},
isPreHospitalVechieFormatter(row, column, cellValue, index) {
const isPreHospitalVechieList = ['', '是', '否']
return isPreHospitalVechieList[cellValue] || ''
},
vechieTypeFormatter(row, column, cellValue, index) {
const vechieType = this.vechieTypeList.find(i => i.val === cellValue)
return vechieType ? vechieType.name : ''
},
delHandler(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
deleteEmergencyCar({ id: id }).then(res => {
if (res.msg === 201) {
this.$message.success('删除成功!')
} else {
this.$message.success(res.content)
}
this.search()
})
})
}
}
}
</script>
<style lang="scss" scoped>
.mainContent {
padding: 20px;
.bt {
text-align: right;
margin-bottom: 16px;
}
}
</style>
<template>
<div>
401:没有操作权限
<a @click="back">返回上一页</a>
</div>
</template>
<script>
export default {
methods: {
back() {
this.$router.go(-1)
}
}
}
</script>
<template>
<div>
403:访问被拒绝
<a @click="back">返回上一页</a>
</div>
</template>
<script>
export default {
methods: {
back() {
this.$router.go(-1)
}
}
}
</script>
<template>
<div>
404
<a @click="back">返回上一页</a>
</div>
</template>
<script>
export default {
methods: {
back() {
this.$router.go(-1)
}
}
}
</script>
<template>
<div>
500:系统出现未知错误
<a @click="back">返回首页</a>
</div>
</template>
<script>
export default {
methods: {
back() {
this.$router.replace('home')
}
}
}
</script>
<template>
<div class="error-page">
<router-view></router-view>
</div>
</template>
<template>
<el-dialog
title="绑定站点"
:visible.sync="dialogVisible"
width="500px"
@closed="closedHandler"
:close-on-click-modal="false"
>
<el-form
ref="dataForm"
:model="dataForm"
size="small"
label-width="150px"
:rules="rules"
v-loading="loading"
>
<el-form-item
label="站点名称"
prop="siteId"
>
<el-select
v-model="dataForm.siteId"
placeholder="请选择站点"
style="width: 100%"
>
<el-option
v-for="item in siteList"
:label="item.siteName"
:key="item.id"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item
label="上级医院名称"
prop="hospitalCode"
>
<el-select
v-model="dataForm.hospitalCode"
placeholder="请选择上级医院"
style="width: 100%"
>
<el-option
v-for="item in hospitalList"
:label="item.hospitalName"
:key="item.id"
:value="item.hospitalCode"
/>
</el-select>
</el-form-item>
</el-form>
<span
slot="footer"
class="dialog-footer"
>
<el-button
size="small"
@click="dialogVisible = false"
>取 消</el-button>
<el-button
type="primary"
size="small"
@click="submitForm()"
>确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import { queryTeamEmergencyCarInfo, bindSiteToEmergencyCar } from '@/api/emergencyCar'
import { queryEmergencyHospitalList } from '@/api/common'
import { queryEmergencySiteList } from '@/api/site'
export default {
data() {
return {
dialogVisible: false,
loading: false,
dataForm: {
siteId: '',
hospitalCode: ''
},
siteList: [],
hospitalList: [],
rules: {
siteId: [
{ required: true, message: '请选择站点' },
],
hospitalCode: [
{ required: true, message: '请选择上级医院' },
]
}
}
},
mounted() {
//获取可选择的医院
queryEmergencyHospitalList().then(res => {
this.hospitalList = res.respData
})
queryEmergencySiteList().then(res => {
this.siteList = res.respData
})
},
methods: {
init(id) {
this.dialogVisible = true
this.loading = true
if (!id) {
this.$message.error('救护车id不能为空')
return
}
queryTeamEmergencyCarInfo({ id: id }).then(res => {
if (res.msg === 201) {
const { hospitalCode, siteId } = res.respData
this.dataForm = {
id: id,
hospitalCode: hospitalCode,
siteId: siteId
}
this.$nextTick(() => {
this.loading = false
this.$refs.dataForm.clearValidate()
})
} else {
this.$message.error(res.content);
}
})
},
submitForm() {
this.$refs.dataForm.validate((valid) => {
if (valid) {
const params = {
...this.dataForm
}
const hospital = this.hospitalList.find(i => i.hospitalCode === this.dataForm.hospitalCode)
if (!hospital) {
this.$message.error('无效数据');
return
}
const { hospitalName, id } = hospital
params.hospitalName = hospitalName
params.hospitalId = id
const site = this.siteList.find(i => i.id === this.dataForm.siteId)
if (!site) {
this.$message.error('无效数据');
return
}
const { siteName } = site
params.siteName = siteName
bindSiteToEmergencyCar(params).then(res => {
if (res.msg === 201) {
this.dialogVisible = false
this.$message.success('绑定成功')
this.$emit('subsucc')
} else {
this.$message.error(res.content)
}
})
}
})
},
closedHandler() {
this.$refs.dataForm.resetFields()
}
}
}
</script>
<style>
</style>
\ No newline at end of file
This diff is collapsed.
<template>
<div>
绿道
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class='main-header'>
<p class="p">
区域急危重症救治协同平台
</p>
<div class="div">
<img
src="../../assets/images/user.png"
alt=""
>
<span>张医生</span>
</div>
</div>
</template>
<script>
export default {
data() {
return {}
},
mounted() {
},
methods: {
},
}
</script>
<style lang="scss">
</style>
This diff is collapsed.
<template>
<el-submenu
v-if="item.child && item.child.length"
:index="navIndex"
>
<!-- 创建父级菜单 -->
<template slot="title">
<i
class="fa fa-fw"
:class="item.icon"
></i>
<span>{{ item.name }}</span>
</template>
<!-- 创建子菜单 -->
<nav-bar-item
v-for="(subItem,i) in item.child"
:key="navIndex+'-'+i"
:navIndex="navIndex+'-'+i"
:item="subItem"
>
</nav-bar-item>
</el-submenu>
<el-menu-item
v-else
:index="item.path"
:route="{path: item.path}"
>
<i
class="fa fa-fw"
:class="item.icon"
:Icons="'icon'+navIndex"
></i>
<span>{{ item.name }}</span>
</el-menu-item>
</template>
<script>
export default {
name: 'NavBarItem',
props: ['item', 'navIndex'],
mounted() {
// console.log(this.item)
}
}
</script>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// 免登录白名单页面
const whiteList = [
'/login',
// '/register'
]
export default whiteList
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import Vue from 'vue';
export default new Vue();
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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 to comment