提交 27594884 编写于 作者: lyf's avatar lyf

架构升级

上级 ab0e1267
文件已删除
{
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"],
"comments": false,
}
# comment
deploy
node_modules
public
root = true [*.{js,jsx,ts,tsx,vue,scss,css}]
[*]
charset = utf-8
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = true
NODE_ENV=development
# baseUrl
BASE_URL=/pica-admin-consultation/
# 路由 base
VUE_APP_BASE_ROUTE_URL=/pica-admin-consultation
# 默认路由地址
VUE_APP_BASE_ROUTE=/
# 阿里云OSS对象存储地址
VUE_APP_OSS_URL=https://pica-h5-dev.yunqueyi.com/
# 模拟用户信息,如果有则发送模拟用户信息,只针对开发模式
VUE_APP_MOCK_USER_INFO=
# 是否加密
VUE_APP_ENCRYPT=
# 是否开启 vConsole
VUE_APP_CONSOLE=false
# appid
VUE_APP_APPID=ab5cb3c1fd834ca1892cd7b3c6e57717
#生成骨架屏扫描地址(可选择本地)
VUE_APP_SKELETON='http://localhost:8083'
NODE_ENV=development
# 自定义 VUE_APP_ENV
VUE_APP_ENV ='dev'
VUE_APP_SERVICE_URL=https://dev-sc.yunqueyi.com
# 阿里云OSS对象存储地址
VUE_APP_OSS_URL=https://pica-h5-dev.yunqueyi.com/
# 模拟用户信息,如果有则发送模拟用户信息,只针对开发模式
VUE_APP_MOCK_USER_INFO=
# 是否加密
VUE_APP_ENCRYPT=
# 是否开启vConsole
VUE_APP_CONSOLE=false
# 是否开启打印 console.log
VUE_APP_HAS_CONSOLE=true
#OSS上传Bucket_Name
VUE_APP_BUCKET_NAME='pica-app-dev'
# appid
VUE_APP_APPID=wxf4e66242d31c81c2
NODE_ENV=production
# 自定义 VUE_APP_ENV
VUE_APP_ENV ='production'
VUE_APP_SERVICE_URL=https://sc.yunqueyi.com
# 阿里云OSS对象存储地址
VUE_APP_OSS_URL=https://pica-h5.yunqueyi.com/
# 模拟用户信息,如果有则发送模拟用户信息,只针对开发模式
VUE_APP_MOCK_USER_INFO=
# 是否加密
VUE_APP_ENCRYPT=false
# 是否开启 vConsole
VUE_APP_CONSOLE=false
# appid
VUE_APP_APPID=wx2c577552a2d28550
# app渠道
VUE_APP_CHANNEL=prod
# OSS 上传 Bucket_Name
VUE_APP_BUCKET_NAME='pica-app-prod'
NODE_ENV=production
# 自定义 VUE_APP_ENV
VUE_APP_ENV ='testing'
VUE_APP_SERVICE_URL=https://test1-sc.yunqueyi.com
# 阿里云OSS对象存储地址
VUE_APP_OSS_URL=https://pica-h5-test.yunqueyi.com/
# 模拟用户信息,如果有则发送模拟用户信息,只针对开发模式
VUE_APP_MOCK_USER_INFO=
# 是否加密
VUE_APP_ENCRYPT=false
# 是否开启 vConsole
VUE_APP_CONSOLE=true
# 是否开启打印 console.log
VUE_APP_HAS_CONSOLE=false
# appid
VUE_APP_APPID=wxcaad75b7fff5659c
# APP 渠道
VUE_APP_CHANNEL=_test
# OSS上传Bucket_Name
VUE_APP_BUCKET_NAME='pica-app-test'
NODE_ENV=production
# 自定义 VUE_APP_ENV
VUE_APP_ENV ='uat'
VUE_APP_SERVICE_URL=https://uat-sc.yunqueyi.com
# 阿里云OSS对象存储地址
VUE_APP_OSS_URL=https://pica-h5-uat.yunqueyi.com/
# 模拟用户信息,如果有则发送模拟用户信息,只针对开发模式
VUE_APP_MOCK_USER_INFO=
# 是否加密
VUE_APP_ENCRYPT=false
# 是否开启vConsole
VUE_APP_CONSOLE=false
# appid
VUE_APP_APPID=wx342ef0e5afee54a7
# OSS 上传 Bucket_Name
VUE_APP_BUCKET_NAME='pica-app-uat'
/h5-submodules-master
/node_modules
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
// 全局变量
globals: {
'gdp': true,
},
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
'no-console': 0,
'no-debugger': 0,
'comma-spacing': [2, { // 控制逗号前面没有空格,后面必须有空格
'before': false,
'after': true
}],
'arrow-spacing': [2, { // 要求箭头函数前后有空格
'before': true,
'after': true
}],
'no-multi-spaces': 2,// 禁止使用多个空格,
'no-spaced-func': 2,// 禁止 function 标识符和括号之间出现空格,this.getList () 报错
'semi-spacing': [2, {// 强制分号之前不允许有空格
'before': false,
'after': true
}],
'space-infix-ops': 2,// 要求操作符前后必须有空格: 2 + 3 2 === 2 3 > 2
'spaced-comment': [2, 'always'], // 强制在注释中 // 或 /* 使用一致的空格
'array-bracket-spacing': [2, 'never'],// 指定数组的元素之间要以空格隔开(, 后面), never参数:[ 之后和 ] 之前不能带空格,always参数:[ 之后和 ] 之前必须带空格
"space-before-blocks": 2, // if/function等的大括号之前需要有空格
"vue/script-indent": ["error", 2, { // script标签缩进设置
"baseIndent": 1,
"switchCase": 0,
"ignores": []
}],
'no-undef-init': 2,// 禁止将变量初始化为 undefined,保存时会将let a = undefined变成let a
'semi': [2, 'always'],//强制结尾必须有分号;
'prefer-const': 2,// 要求使用 const 声明那些声明后不再被修改的变量
'quotes': [2, 'single'],//js中强制使用单引号
'no-multiple-empty-lines': [2, {// 不允许多个空行,最多一行
'max': 1
}],
'vue/order-in-components': ['error', {
'order': [
'el',
'name',
'parent',
'functional',
['delimiters', 'comments'],
['components', 'directives', 'filters'],
'extends',
'mixins',
'inheritAttrs',
'model',
['props', 'propsData'],
'data',
'computed',
'watch',
'LIFECYCLE_HOOKS',
'methods',
['template', 'render'],
'renderError'
]
}],
'vue/attributes-order': ['error', {
'order': [
'DEFINITION',
'LIST_RENDERING',
'CONDITIONALS',
'RENDER_MODIFIERS',
'GLOBAL',
'UNIQUE',
'TWO_WAY_BINDING',
'OTHER_DIRECTIVES',
'OTHER_ATTR',
'EVENTS',
'CONTENT'
]
}],
}
}
node_modules
dist/index.js
dist/authUseful.js
dist/stroke.js
dist/
/yqy/
node_modules/
.DS_Store .DS_Store
.vscode node_modules
/dist
.history/
# local env files
.env.local
.env.*.local
update_*.sh
package-lock.json
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea .idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.proxy.js
.version
log/
logs/
# .pica.prompts.js
log
logs
.version
module.exports = {
'autoRouter': false,
'type': "h5",
'projectName': "pica-admin-consultation",
'autoConfig': true,
'transition': false,
'useHistoryRouter': true,
'rewriteHtml': true,
'renderToBranch': true,
'srcAlias': "mn-template",
};
1.0.0
\ No newline at end of file
此差异已折叠。
FROM nginx
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\
echo "Asia/shanghai" > /etc/timezone
COPY error.html /usr/share/nginx/html/error.html
COPY nginx.conf /etc/nginx/nginx.conf
COPY dist/ /usr/vue/pica-admin-consultation/dist/
RUN chmod -R +rw /usr/share/nginx/html/error.html &&\
chown -R nginx:nginx /usr/share/nginx/html/error.html &&\
chmod -R +rw /usr/vue/pica-admin-consultation/dist/ &&\
chown -R nginx:nginx /usr/vue/pica-admin-consultation/dist/
基于dev-app-home-plugin-1115的改版的
Branch_tag-lecturer-rev-all-0115
\ No newline at end of file
# pica-admin-consultation
> 请先查看每个目录的 md 文件
## 启动
```shell script
npm run start
```
## 编译打包
```shell script
#开发环境
npm run build:dev
#预发环境
npm run build:pre
#生产环境
npm run build:prod
#测试环境
npm run build:test
```
## 插件配置
```js
module.exports = {
// 插件配置项
pluginOptions: {
// 蛮牛配置
pica: {
// CDN扩展JS资源排序: ['lodash', 'vue', 'vuex']
jsSort: [],
// CDN扩展CSS资源排序: ['vant.css']
cssSort: [],
// 骨架屏渲染的路由(手动配置)
skeletonRoutes: [
{
path: '/demo',
name: 'Demo',
meta: {
skeleton: true
}
},
],
// 启用自动配置骨架屏渲染路由
enableAutoSkeletonRoutes: false,
// 路由模式
routeMode: 'history',
// 骨架屏一次渲染几个路由
dpsLimit: 5,
// dps骨架屏渲染本地服务配置
dpsServer: {}
},
// 图片压缩
tinypng: {
key: ''
},
// 自动路由配置
autoRouting: {
chunkNamePrefix: 'page-'
}
}
};
```
## dpsServer
### port
服务监听端口,默认从8000开始查找可用端口
### proxy
反向代理中间件配置 @See [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware)
如果需要自定义返回:
```js
{
proxy: {
'^/app-gateway': (req, res, next) => {
res.json({ code: 200, data: {} });
res.end();
}
}
}
```
## 图片压缩
> 需要在`vue.config.js`中配置`pluginOptions.tinypng.key`的值。
```shell script
npm run tinypng
```
## 调用生成器
```shell script
vue invoke pica
```
## 根据 pica.prompts 生成封闭式模板
```shell script
npm run core
```
## 使用骨架屏
> 框架默认已开启骨架屏渲染。请查看`vue.config.js`
### 自动根据路由配置
需要在路由页面文件配置`route`
```json
{
"meta": {
"skeleton": true
}
}
```
如需自定义骨架
```json
{
"meta": {
"skeleton": {
"name": "必须和路由定义的name一致",
"path": "匹配当前路由的正则",
"pathname": "访问路由的path地址,例如: /mn/demo",
"skeletonId": "骨架屏路由ID,唯一即可"
}
}
}
```
## Jenkinsfile 构建
在 Jenkinsfile 文件中 `versionType = 'Patch';`,versionType 默认为 Patch,为小版本更新,1.2.3 对应 Major.Minor.Patch。
```bash
npm run build:test versionType:Patch
```
## 后台API接口反向代理
### 本地
如果`VUE_APP_MOCK_USER_INFO`不为空则走代理到本地。并且会在接口地址前加上`/proxy`.
默认会把`/proxy`的接口代理到`http://localhost:8081。
如需修改,请查看项目根目录的`.proxy.js`文件
### 走网关
如果`VUE_APP_MOCK_USER_INFO`为空则走代理到网关。并且会在接口地址前加上`/proxy/app-gateway`.
会把`/proxy`的接口代理到`VUE_APP_SERVICE_URL`环境变量,如该变量为空则默认为``
const path = require('path');
function resolve (dir) {
return path.join(__dirname, dir);
}
module.exports = {
resolve: {
alias: {
'@': resolve('src'),
'mn-template': resolve('node_modules/@pica-cli/vue-cli-plugin-pica-cli-plugin/core/src')
}
}
};
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
'@babel/plugin-proposal-object-rest-spread'
]
};
// https://github.com/shelljs/shelljs
require('shelljs/global')
env.NODE_ENV = 'production'
var path = require('path')
var config = require('../config')
var ora = require('ora')
var webpack = require('webpack')
var webpackConfig = require('./webpack.prod.conf')
var spinner = ora('building for production...')
spinner.start()
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
rm('-rf', assetsPath)
mkdir('-p', assetsPath)
cp('-R', 'static/*', assetsPath)
webpack(webpackConfig, function(err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n')
})
\ No newline at end of file
/* eslint-disable */
require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(function(event) {
if (event.action === 'reload') {
window.location.reload()
}
})
\ No newline at end of file
var config = require('../config')
if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var opn = require('opn')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = require('./webpack.dev.conf')
// default port where dev server listens for incoming traffic
var port = process.env.PORT || config.dev.port
// Define HTTP proxies to your custom API backend
// https://github.com/chimurai/http-proxy-middleware
var server = express()
var compiler = webpack(webpackConfig)
var devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath,
stats: {
colors: true,
chunks: false
}
})
var hotMiddleware = require('webpack-hot-middleware')(compiler)
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function(compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function(data, cb) {
hotMiddleware.publish({
action: 'reload'
})
cb()
})
})
var context = config.dev.context
switch(process.env.NODE_ENV){
case 'local': var proxypath = 'http://localhost:8001'; break;
case 'online': var proxypath = 'http://yqy.cangdu.org'; break;
default: var proxypath = config.dev.proxypath;
}
var options = {
target: proxypath,
changeOrigin: true,
}
if (context.length) {
server.use(proxyMiddleware(context, options))
}
// handle fallback for HTML5 history API
server.use(require('connect-history-api-fallback')())
// serve webpack bundle output
server.use(devMiddleware)
// enable hot-reload and state-preserving
// compilation error display
server.use(hotMiddleware)
// serve pure static assets
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
server.use(staticPath, express.static('./static'))
module.exports = server.listen(port, function(err) {
if (err) {
console.log(err)
return
}
var uri = 'http://localhost:' + port
console.log('Listening at ' + uri + '\n')
// when env is testing, don't need open it
if (process.env.NODE_ENV !== 'testing') {
opn(uri)
}
})
var path = require('path')
var config = require('../config')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
exports.assetsPath = function(_path) {
var assetsSubDirectory = process.env.NODE_ENV === 'production' ? config.build.assetsSubDirectory : config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function(options) {
options = options || {}
// generate loader string to be used with extract text plugin
function generateLoaders(loaders) {
var sourceLoader = loaders.map(function(loader) {
var extraParamChar
if (/\?/.test(loader)) {
loader = loader.replace(/\?/, '-loader?')
extraParamChar = '&'
} else {
loader = loader + '-loader'
extraParamChar = '?'
}
return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '')
}).join('!')
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract('vue-style-loader', sourceLoader)
} else {
return ['vue-style-loader', sourceLoader].join('!')
}
}
// http://vuejs.github.io/vue-loader/en/configurations/extract-css.html
return {
css: generateLoaders(['css']),
postcss: generateLoaders(['css']),
less: generateLoaders(['css', 'less']),
sass: generateLoaders(['css', 'sass?indentedSyntax']),
scss: generateLoaders(['css', 'sass']),
stylus: generateLoaders(['css', 'stylus']),
styl: generateLoaders(['css', 'stylus'])
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function(options) {
var output = []
var loaders = exports.cssLoaders(options)
for (var extension in loaders) {
var loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
loader: loader
})
}
return output
}
\ No newline at end of file
var path = require('path')
var config = require('../config')
var utils = require('./utils')
var projectRoot = path.resolve(__dirname, '../')
var env = process.env.NODE_ENV
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
// various preprocessor loaders added to vue-loader at the end of this file
var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap)
var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap)
var useCssSourceMap = cssSourceMapDev || cssSourceMapProd
module.exports = {
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
filename: '[name].js'
},
resolve: {
extensions: ['', '.js', '.vue', '.less', '.css', '.scss'],
fallback: [path.join(__dirname, '../node_modules')],
alias: {
'vue$': 'vue/dist/vue.common.js',
'src': path.resolve(__dirname, '../src'),
'assets': path.resolve(__dirname, '../src/assets'),
'components': path.resolve(__dirname, '../src/components'),
'@': path.resolve('src')
}
},
resolveLoader: {
fallback: [path.join(__dirname, '../node_modules')]
},
module: {
loaders: [{
test: /\.vue$/,
loader: 'vue'
}, {
test: /\.js$/,
loader: 'babel',
include: projectRoot,
exclude: /node_modules/
}, {
test: /\.json$/,
loader: 'json'
}, {
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url',
query: {
limit: 50000,
name: utils.assetsPath('img/[name].[ext]')
}
}, {
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url',
query: {
limit: 50000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}]
},
vue: {
loaders: utils.cssLoaders({
sourceMap: useCssSourceMap
}),
postcss: [
require('autoprefixer')({
browsers: ['last 10 versions']
})
]
}
}
\ No newline at end of file
var config = require('../config')
var webpack = require('webpack')
var merge = require('webpack-merge')
var utils = require('./utils')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function(name) {
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
module: {
loaders: utils.styleLoaders({
sourceMap: config.dev.cssSourceMap
})
},
// eval-source-map is faster for development
devtool: '#eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
favicon: 'favicon.ico',
inject: true
})
]
})
\ No newline at end of file
var path = require('path')
var config = require('../config')
var utils = require('./utils')
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var env = config.build.env
console.log('@@@@@@@@@@@@@@@@@@@', env)
var webpackConfig = merge(baseWebpackConfig, {
module: {
loaders: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
//devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].js?chunkhash=[chunkhash]'),
chunkFilename: utils.assetsPath('js/[name].[chunkhash].min.js?chunkhash=[chunkhash]')
},
vue: {
loaders: utils.cssLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.optimize.OccurrenceOrderPlugin(),
// extract css into its own file
new ExtractTextPlugin(utils.assetsPath('css/[name].css')),
// 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',
favicon: 'favicon.ico',
inject: true,
// minify: {
// removeComments: true,
// collapseWhitespace: true,
// removeAttributeQuotes: true
// // more options:
// // https://github.com/kangax/html-minifier#options-quick-reference
// },
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function(module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
})
]
})
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
module.exports = webpackConfig
\ No newline at end of file
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
env: {
NODE_ENV: '"production"',
BUILD_ENV: '"' + process.env.BUILD_ENV + '"'
},
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: './static',
assetsPublicPath: '/consultation/',
productionSourceMap: false,
// 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']
},
dev: {
env: {
NODE_ENV: '"development"',
BUILD_ENV: '"' + process.env.BUILD_ENV + '"'
},
port: 8888,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
// proxyTable: {
// '/': {
// target: 'http://test1-sc.yunqueyi.com/',
// changeOrigin: true
// }
// },
context: [ //代理路径
'/test'
],
proxypath: 'http://localhost:9000',
cssSourceMap: true
}
}
let dpsConfig = require('@pica-core/dps-config');
const externalsDpsConfig = {};
dpsConfig = {
...dpsConfig,
...externalsDpsConfig
};
module.exports = dpsConfig;
module.exports = [
/* {
name: 'payOrder',
url: 'payOrder'
}*/
];
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Error</title>
</head>
<body>
An error occurred on the server when processing the URL. Please contact the system administrator!
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
<meta name="screen-orientation" content="portrait"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<meta name="full-screen" content="yes">
<meta name="x5-fullscreen" content="true">
<title>云鹊医</title>
</head>
<body id="appBody">
<div id="app">
<router-view></router-view>
</div>
<!-- <script src="qiniu.min.js"></script> -->
<!-- <script src="https://unpkg.com/qiniu-js@2.2.0/dist/qiniu.min.js"></script> -->
</body>
</html>
worker_processes auto;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#隐藏版本号
server_tokens off;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
client_max_body_size 20m;
server {
listen 80;
server_name_in_redirect off;
server_name *.picahealth.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/vue/pica-admin-consultation/dist/;
# if (-d $request_filename) {
# rewrite ^/(.*)([^/])$ https://$host/pica-admin-consultation/$1$2/ permanent;
# }
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 404 405 500 502 503 504 /error.html;
location = /error.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
/* eslint-disable */
const fs = require('fs');
const path = require('path');
const program = require('commander');
const pathError = path.resolve(process.cwd(), './.error-log')
const ResetPathFile = require('@pica-core/reset-pathfile-plugin');
program
.command('mode <mode>')
.description('备份log日志')
.action(function (mode) {
// 判断.error-log文件是否存在
fs.stat(pathError, (err, stats) => {
// 如果不存在,就正常执行
if (err) {
console.log('正常执行!');
} else {
new ResetPathFile(mode, 1);
}
});
});
program
.command('check <value>')
.description('检查.error-log是否已删除')
.action(function (mode) {
// 判断.error-log文件是否存在
fs.stat(pathError, (err, stats) => {
// 如果不存在,就正常执行
if (err) {
console.log('正常执行!');
} else {
// 如果存在,执行下面的脚本
fs.unlink(pathError, (err) => {
if (err) throw err;
console.log('.error-log文件已被删除');
throw new Error('请联系运维同学去oss服务器手动copy版本控制相关文件');
});
}
});
});
program.parse(process.argv);
此差异已折叠。
{ {
"name": "yqy", "name": "pica-admin-consultation",
"version": "2.0.1", "version": "0.1.0",
"description": "vue2-yqy",
"author": "cangdu <1264889788@qq.com>",
"private": true, "private": true,
"license": "GPL",
"scripts": { "scripts": {
"dev": "cross-env BUILD_ENV=development node build/dev-server.js", "serve": "pica-cli-service serve",
"local": "cross-env BUILD_ENV=development node build/dev-server.js", "build": "pica-cli-service build",
"build": "node build/build.js", "lint": "pica-cli-service lint",
"build:dev": "cross-env BUILD_ENV=dev node build/build.js", "add-all": "pica-cli-service add-all",
"build:test": "cross-env BUILD_ENV=test node build/build.js", "build-skeleton": "pica-cli-service build-skeleton",
"build:uat": "cross-env BUILD_ENV=uat node build/build.js", "build:dev": "pica-cli-service build --mode dev",
"build:pro": "cross-env BUILD_ENV=pro node build/build.js" "build:pre": "pica-cli-service build --mode pre",
"build:prod": "pica-cli-service build --mode production",
"build:test": "pica-cli-service build --mode testing",
"core": "pica-cli-service core",
"img-md5": "pica-cli-service img-md5",
"page": "vue-cli-service page",
"skeleton": "pica-cli-service skeleton",
"tinypng": "pica-cli-service tinypng"
}, },
"dependencies": { "dependencies": {
"@babel/polyfill": "^7.2.5", "axios": "^0.19.2",
"@pica-core/web-buried-point": "^1.0.9",
"axios": "0.16.2",
"better-scroll": "^0.1.15",
"clipboard": "^2.0.6", "clipboard": "^2.0.6",
"dayjs": "^1.10.6", "core-js": "^3.6.5",
"echarts": "^4.2.0-rc.2", "dayjs": "^1.8.30",
"dsbridge": "^3.1.4",
"element-ui": "^2.6.1", "element-ui": "^2.6.1",
"fastclick": "^1.0.6", "lodash": "^4.17.15",
"iscroll": "^5.2.0", "md5": "^2.3.0",
"js-cookie": "^2.2.0", "pre-commit": "^1.2.2",
"qiniu-js": "^3.1.2", "qiniu-js": "^3.1.2",
"showdown": "^1.6.4",
"socket.io-client": "2.2.0", "socket.io-client": "2.2.0",
"storejs": "^1.1.0", "storejs": "^1.1.0",
"vue": "^2.1.0", "vant": "^2.12.27",
"vue-router": "^2.1.1", "vconsole": "^3.3.4",
"vuex": "^2.0.0" "vue": "^2.6.11",
"vue-fragment": "^1.5.1",
"vue-router": "^3.3.1",
"vuescroll": "^4.15.1",
"vuex": "^3.1.1"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^6.4.0", "@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"autoprefixer-loader": "^3.2.0", "@pica-cli/pica-cli-framework": "^1.0.10",
"babel-core": "^6.0.0", "@pica-cli/vue-cli-plugin-pica-cli-plugin": "~1.1.2",
"babel-loader": "^6.0.0", "@pica-core/multiple-versions-plugin": "^1.0.4",
"babel-plugin-transform-runtime": "^6.0.0", "@pica-core/reset-pathfile-plugin": "^1.0.4",
"babel-preset-es2015": "^6.0.0", "@pica-core/web-buried-point": "^1.0.15",
"babel-preset-stage-2": "^6.0.0", "@vue/cli-plugin-babel": "~4.5.0",
"babel-register": "^6.0.0", "@vue/cli-plugin-eslint": "~4.5.0",
"babel-runtime": "^6.23.0", "@vue/cli-service": "~4.5.0",
"chalk": "^1.1.3", "babel-eslint": "^10.1.0",
"connect-history-api-fallback": "^1.1.0", "babel-plugin-import": "^1.13.0",
"cross-env": "^5.0.0", "colors-console": "^1.0.3",
"css-loader": "^0.25.0", "dotenv": "^8.2.0",
"eventsource-polyfill": "^0.9.6", "draw-page-structure": "^1.0.8",
"express": "^4.13.3", "eslint": "^6.7.2",
"extract-text-webpack-plugin": "^1.0.1", "eslint-config-prettier": "^8.3.0",
"file-loader": "^0.9.0", "eslint-plugin-prettier": "^3.4.0",
"function-bind": "^1.0.2", "eslint-plugin-vue": "^6.2.2",
"html-webpack-plugin": "^2.8.1", "fast-install-puppeteer": "^1.0.5",
"http-proxy-middleware": "^0.17.2", "husky": "^3.0.9",
"json-loader": "^0.5.4", "lint-staged": "^9.4.2",
"less": "^2.7.1",
"less-loader": "^2.2.3",
"node-gyp": "^3.4.0",
"node-sass": "^4.13.1", "node-sass": "^4.13.1",
"opn": "^4.0.2", "postcss-px-to-viewport": "^1.1.1",
"ora": "^0.3.0", "prettier": "^2.3.2",
"sass": "^0.5.0", "prettier-eslint-cli": "^5.0.1",
"sass-loader": "^4.1.1", "puppeteer": "^10.1.0",
"scss": "^0.2.4", "sass": "^1.26.3",
"scss-loader": "0.0.1", "sass-loader": "^8.0.2",
"semver": "^5.3.0",
"shelljs": "^0.7.4",
"style-loader": "^0.13.1",
"tim-js-sdk": "^2.10.1", "tim-js-sdk": "^2.10.1",
"trtc-js-sdk": "^4.9.0", "trtc-js-sdk": "^4.9.0",
"url-loader": "^0.5.7",
"v-viewer": "^1.2.1", "v-viewer": "^1.2.1",
"vue-lazyload": "^1.2.6", "vue-skeleton-webpack-plugin": "^1.2.2",
"vue-loader": "^10.0.0", "vue-template-compiler": "^2.6.11",
"vue-style-loader": "^1.0.0", "webpack-bundle-analyzer": "^4.4.2"
"vue-template-compiler": "^2.1.0",
"webpack": "^1.13.2",
"webpack-dev-middleware": "^1.8.3",
"webpack-dev-server": "^1.16.2",
"webpack-hot-middleware": "^2.12.2",
"webpack-merge": "^0.14.1"
}, },
"engines": { "eslintConfig": {
"node": ">= 4.0.0", "root": true,
"npm": ">= 3.0.0" "env": {
} "node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
],
"husky": {
"hooks": {
"pre-commit": "pica-cli-service img-md5 && lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
],
"src/**/*.{vue,html,css,scss,sass}": [
"stylelint --fix",
"git add"
],
"src/**/*.{js,vue,html,css,scss,sass}": [
"prettier-eslint --write",
"git add"
]
},
"pica-cli-service": {}
} }
module.exports = {
plugins: {
autoprefixer: {},
}
};
\ No newline at end of file
## 增加骨架屏占位 Dom #skeleton
```html
<div id="skeleton"></div>
<div id="app"></div>
```
## 初始化时间记录
```js
(function (window) {
var dsBridge = window.dsBridge;
function logToLocaleString(method) {
var date = new Date();
console.log(date.toLocaleString() + ':' + date.getMilliseconds(), method);
}
window.onNativeLCEvent = logToLocaleString;
window.onload = function () {
dsBridge && dsBridge.call && dsBridge.call('onLCEvent', 'onload');
logToLocaleString('onload');
}
document.addEventListener('DOMContentLoaded', function () {
dsBridge && dsBridge.call && dsBridge.call('onLCEvent', 'DOMContentLoaded');
logToLocaleString('DOMContentLoaded');
});
document.addEventListener('readystatechange', function () {
if (document.readyState == 'interactive') {
dsBridge && dsBridge.call && dsBridge.call('onLCEvent', 'interactive');
logToLocaleString('interactive');
}
if (document.readyState == 'complete') {
dsBridge && dsBridge.call && dsBridge.call('onLCEvent', 'complete');
dsBridge && dsBridge.call && dsBridge.call('forceHideLoading');
logToLocaleString('complete');
}
})
}(window));
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0,viewport-fit=cover">
<!-- 打开和关闭DNS预读取 -->
<meta http-equiv="x-dns-prefetch-control" content="on">
<!-- 强制查询特定主机名 -->
<link rel="dns-prefetch" href="<%= process.env.VUE_APP_SERVICE_URL %>">
<link rel="icon" type="image/x-icon" href="<%= VUE_APP_OSS_URL %>static/img/logo.png">
<title>云鹊医-赋能基层医生</title>
<style>
._ {
position: fixed;
z-index: 999;
background: #eee;
border-radius: 4px;
animation: mn-skeleton-blink 1.2s ease-in-out infinite;
}
.__ {
top: 0%;
left: 0%;
width: 100%;
}
.skeleton-component {
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100vw;
height: 100vh;
background: #fff;
}
@keyframes mn-skeleton-blink {
50% {
opacity: 0.6;
}
}
</style>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="skeleton"></div>
<div id="app"></div>
<script>
function setSkeletonByName() {
var pathNameSplitList = location.pathname.split('/');
var lastName = pathNameSplitList[pathNameSplitList.length - 1];
var el = document.querySelector('.skeleton-component-' + lastName);
if (el) {
el.style.dispaly = 'block';
}
};
setSkeletonByName();
(function(window) {
function logToLocaleString(method) {
var date = new Date();
console.log(date.toLocaleString() + ':' + date.getMilliseconds(), method);
}
window.onNativeLCEvent = logToLocaleString;
window.onload = function() {
logToLocaleString('onload');
}
document.addEventListener('DOMContentLoaded', function() {
logToLocaleString('DOMContentLoaded');
setSkeletonByName();
});
document.addEventListener('readystatechange', function() {
if (document.readyState == 'interactive') {
logToLocaleString('interactive');
}
if (document.readyState == 'complete') {
logToLocaleString('complete');
}
})
}(window));
</script>
<!-- built files will be auto injected -->
<script src="<%= VUE_APP_OSS_URL %>static/js/vue-2.6.11.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/vuex-3.4.0.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/vant.min-2.12.26.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/vue-router-3.3.2.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/axios-0.19.0.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/element-ui@2.6.1.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/jsencrypt.min-3.0.0.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/crypto.min-4.0.0.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/vconsole-3.3.4.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/lodash-4.17.15.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/tim-js@2.13.1.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/trtc-js-sdk@4.11.5.js"></script>
</body>
</html>
\ No newline at end of file
<template>
<div>
<v-header :userName="userName" :authList="authList"></v-header>
<v-slidebar v-if="systemType" :tokenValue="token" :systemType="systemType"></v-slidebar>
<el-container>
<div class="content" id="body-content">
<transition name="router-fade" mode="out-in">
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
</transition>
<transition name="router-fade" mode="out-in">
<router-view v-if="!$route.meta.keepAlive"></router-view>
</transition>
<v-footer></v-footer>
</div>
</el-container>
<chat :showChat="showChat" :currentChat="currentChat"></chat>
<diagnoseAdvice :showAdvice="showAdvice"></diagnoseAdvice>
</div>
</template>
<script>
import VHeader from "./views/layout/header.vue";
import VSlidebar from "./views/layout/slidebar.vue";
import VFooter from "./views/layout/footer.vue";
import chat from './components/IM/chat'
import DiagnoseAdvice from '@/components/common/diagnoseAdvice.vue'
import {
base64decode,
isNotEmptyUtils,
getUrlParamsMap,
ssoLogin,
bindDragHeader
} from "./utils/utils.js";
import { mapActions, mapGetters, mapState } from "vuex";
import { getInnerLoginUrl } from "./utils/index";
let vm = null;
export default {
components: {
VHeader,
VSlidebar,
VFooter,
chat,
DiagnoseAdvice
},
data() {
return {
token: "",
userName: "",
authList: [],
systemType: 0,
};
},
computed: {
...mapState({
showChat: 'showChat',
currentChat: 'currentChat',
showAdvice:'showAdvice'
}),
...mapGetters(["_token"])
},
created() {
vm = this;
vm.getToken();
window._VM = vm;
},
mounted() {
setTimeout( function () {
bindDragHeader('.c-header', '.chat-wrap');
}, 1000)
},
methods: {
// 修改token
...mapActions(["changeToken"]),
// 解密token
getToken() {
let href = window.location.href;
let offset = href.indexOf("?");
// localStorage.setItem('token','475DB3D057AD489D81FE4E4DAB747B08')
if (offset !== -1) {
let paramStr = href.substring(offset + 1, href.length);
let pars = base64decode(paramStr);
let paramMap = getUrlParamsMap(pars, "&");
if (
isNotEmptyUtils(paramMap["token"]) &&
isNotEmptyUtils(paramMap["ssoOrigin"])
) {
vm.token = paramMap["token"];
localStorage.setItem("token", vm.token);
ssoLogin(href, paramMap);
//vm.$router.push({ path: 'home' })
} else {
if (!localStorage.getItem("token")) {
window.location.href = getInnerLoginUrl(); // 没有token返回登录页面
return;
}
}
} else {
if (!localStorage.getItem("token")) {
window.location.href = getInnerLoginUrl(); // 没有token返回登录页面
return;
}
}
vm.changeToken(vm.token);
vm.getUserAuth();
},
// 获取用户权限
getUserAuth(token) {
let req = null;
req = {
system_type: "26"
};
vm.POST("/contents/login/header", req).then(res => {
if (res.code == "000000") {
let systemType = 0, authList = res.data.systemInfoList;
let s = authList.find( item => {
return item.systemNameAbbreviation == 'diagnose';
});
if(s) {
systemType = s.id;
}
this.systemType = systemType;
this.showSlidebar = true;
console.log(res,111);
vm.userName = res.data.userName;
vm.authList = authList;
}
});
},
closeGlobalMsgNotice () {}
}
};
</script>
<style lang="scss">
// @import './style/common';
@import "./style/global";
@import "./style/mixin.scss";
.router-fade-enter-active,
.router-fade-leave-active {
transition: opacity 0.1s;
}
.router-fade-enter,
.router-fade-leave-active {
opacity: 0;
}
.el-container {
margin-left: 255px;
overflow: hidden;
.content {
background: #f0f2f5;
position: absolute;
left: 215px;
right: 0;
top: 64px;
bottom: 0;
width: auto;
box-sizing: border-box;
overflow-y: scroll;
}
}
</style>
该目录建议放置所有请求资源代码,可根据业务划分与不同子目录。
import request from 'mn-template/plugins/http';
export const getMatchList = async() => {
return request({
url: '/diagnose/match/list',
method: 'get',
});
};
\ No newline at end of file
import request from 'mn-template/plugins/http';
export const getServiceType = async() => {
return request({
url: '/diagnose/doctorService/serviceType',
method: 'get',
});
};
export const getDoctorInfoByNameLike = async(data) => {
return request({
url: '/diagnose/commission/downDoctor/doctorInfoByNameLike',
params: data,
method: 'get',
});
};
export const getDownDoctor = async(data) => {
return request({
url: '/diagnose/commission/downDoctor/pageSearch',
data: data,
method: 'post',
});
};
export const saveDownDoctor = async(data) => {
return request({
url: '/diagnose/commission/downDoctor/save',
data: data,
method: 'post',
});
};
export const getRuleInfo = async(data) => {
return request({
url: '/diagnose/commission/rule/info',
data: data,
method: 'post',
});
};
export const getProfit = async(data) => {
return request({
url: '/diagnose/doctorService/profit',
data: data,
method: 'post',
});
};
\ No newline at end of file
import request from 'mn-template/plugins/http';
// diagnosis-editor
export const getAdminDiagnose = async (data) => {
return request({
url: `/diagnose/admin/diagnose/${data.id}`,
method: 'get',
});
};
export const getDoctorList = async (data) => {
return request({
url: '/diagnose/doctorService/doctorList',
params: data,
method: 'get',
});
};
export const getDiagnoseLog = async (data) => {
return request({
url: `/diagnose/admin/diagnose/log/${data.id}`,
method: 'get',
});
};
export const diagnoseUpdate = async (data) => {
return request({
url: '/diagnose/admin/diagnose/update',
data: data,
method: 'post',
});
};
// diagnosis-im
export const getQueryTemplate = async () => {
return request({
url: '/contents/admin/template/queryTemplate?publishFlag=5&pageNo=1&pageSize=99999',
method: 'get',
});
};
export const getMemberList = async (data) => {
return request({
url: '/im/team/member/list',
params: data,
method: 'get',
});
};
export const messageForward = async (data) => {
return request({
url: '/im/team/message/forward',
data: data,
method: 'post',
});
};
export const messageHistory = async (data) => {
return request({
url: '/im/team/message/history',
data: data,
method: 'post',
});
};
export const messageSend = async (data) => {
return request({
url: '/im/team/op/message/send',
data: data,
method: 'post',
});
};
// diagnosis-list-new
export const getCountQuery = async () => {
return request({
url: '/diagnose/admin/diagnose/countQuery',
method: 'get',
});
};
export const getDepartments = async () => {
return request({
url: '/hospital/departments/0',
method: 'get',
});
};
export const diagnoseExport = async (data) => {
return request({
url: '/diagnose/admin/diagnose/export',
data: data,
method: 'post',
});
};
export const diagnoseList = async (data) => {
return request({
url: '/diagnose/admin/diagnose/list',
data: data,
method: 'post',
});
};
// diagnosis-list
export const diagnoseAppointTime = async (data) => {
return request({
url: '/diagnose/admin/diagnose/appointTime',
data: data,
method: 'post',
});
};
export const diagnoseEnd = async (data) => {
return request({
url: `/diagnose/admin/diagnose/end/${data.diagnoseLogId}`,
method: 'post',
});
};
export const diagnoseCall = async (data) => {
return request({
url: `/diagnose/admin/diagnose/call/${data.diagnoseLogId}`,
method: 'post',
});
};
export const diagnoseChoose = async (data) => {
return request({
url: `/diagnose/admin/diagnose/choose/${data.diagnoseLogId}`,
method: 'post',
});
};
export const diagnoseCancel = async (data) => {
return request({
url: `/diagnose/admin/diagnose/cancel/${data.diagnoseLogId}`,
method: 'post',
});
};
// diagnosis-live
export const teamDetail = async (data) => {
return request({
url: '/im/team/detail',
params: data,
method: 'get',
});
};
export const getSdkappid = async () => {
return request({
url: '/coupler/app/trtc/sdkappid',
method: 'get',
});
};
export const streamParams = async () => {
return request({
url: '/coupler/app/config/push/stream/params',
method: 'get',
});
};
export const callDirect = async (data) => {
return request({
url: '/im/team/call/direct/',
data: data,
method: 'post',
});
};
export const usersigTrtc = async (data) => {
return request({
url: '/coupler/usersig/trtc',
data: data,
method: 'post',
});
};
export const diagnoseEndCall = async (data) => {
return request({
url: `/diagnose/admin/diagnose/endCall/${data.diagnoseLogId}`,
data: data,
method: 'post',
});
};
export const doctorAdviceCreate = async (data) => {
return request({
url: '/diagnose/admin/diagnose/doctorAdvice/create',
data: data,
method: 'post',
});
};
export const doctorAdviceList = async (data) => {
return request({
url: `/diagnose/admin/diagnose/doctorAdvice/list/${data.diagnoseLogId}`,
method: 'get',
});
};
export const operatorQuery = async () => {
return request({
url: '/diagnose/admin/diagnose/operator/query',
method: 'get',
});
};
export const teamDetailV2 = async (data) => {
return request({
url: '/im/team/detail/v2',
params: data,
method: 'get',
});
};
export const stickerSave = async (data) => {
return request({
url: '/im/sticker/save',
post: data,
method: 'post',
});
};
export const getStickerList = async () => {
return request({
url: '/im/sticker/list',
method: 'get',
});
};
export const stickerInfo = async (data) => {
return request({
url: '/im/sticker/info',
params: data,
method: 'get',
});
};
export const searchContent = async (data) => {
return request({
url: 'contents/searchKeyword/searchContent',
params: data,
method: 'get',
});
};
export const opAck = async (data) => {
return request({
url: '/im/team/call/op/ack/',
data: data,
method: 'post',
});
};
import request from 'mn-template/plugins/http';
export const exportList = async(data) => {
return request({
url: '/diagnose/admin/diagnose/export/list',
data: data,
method: 'post',
});
};
\ No newline at end of file
import $http from 'mn-template/plugins/http';
// 获取亲友列表
export const listRelatives = () => $http({
method: 'get',
url: '/splitter/live/v2/list',
params: {version: '3.2.1'}
});
// 新增亲友
export const list = params => $http.get('/aaa/bbb', params);
import request from 'mn-template/plugins/http';
export const forwardPage = async(data) => {
return request({
url: '/contents/login/forward_page',
data: data,
method: 'post',
});
};
export const menuList = async(data) => {
return request({
url: '/basic-data/menu/list',
data: data,
method: 'post',
});
};
export const loginHeader = async(data) => {
return request({
url: '/contents/login/header',
data: data,
method: 'post',
});
};
\ No newline at end of file
import request from 'mn-template/plugins/http';
export const setDiagnoseMatch = async() => {
return request({
url: '/diagnose/match/1/',
method: 'get',
});
};
export const sumbitMatch = async(data) => {
return request({
url: '/diagnose/match/',
data: data,
method: 'post',
});
};
export const operatorQuery = async() => {
return request({
url: '/diagnose/admin/diagnose/operator/query',
method: 'get',
});
};
\ No newline at end of file
import request from 'mn-template/plugins/http';
export const gteServiceType = async() => {
return request({
url: '/diagnose/doctorService/serviceType',
method: 'get',
});
};
export const doctorServiceSearch = async(data) => {
return request({
url: '/diagnose/doctorService/search',
data: data,
method: 'post',
});
};
export const setBatchUpdatePrice = async(data) => {
return request({
url: '/diagnose/doctorService/batchUpdatePrice',
data: data,
method: 'post',
});
};
export const updatePrice = async(data) => {
return request({
url: '/diagnose/doctorService/updatePrice',
data: data,
method: 'post',
});
};
export const batchUndeploy = async(data) => {
return request({
url: '/diagnose/doctorService/batchUndeploy',
data: data,
method: 'post',
});
};
export const doctorServiceDeploy = async(data) => {
return request({
url: '/diagnose/doctorService/deploy',
data: data,
method: 'post',
});
};
export const doctorServiceUndeploy = async(data) => {
return request({
url: '/diagnose/doctorService/undeploy',
data: data,
method: 'post',
});
};
export const doctorServiceBatchDeploy = async(data) => {
return request({
url: '/diagnose/doctorService/batchDeploy',
data: data,
method: 'post',
});
};
export const doctorServiceProfit = async(data) => {
return request({
url: '/diagnose/doctorService/profit',
data: data,
method: 'post',
});
};
\ No newline at end of file
import request from 'mn-template/plugins/http';
export const conditionUpdate = async(data) => {
return request({
url: '/diagnose/socket/condition/update',
data: data,
method: 'post',
});
};
\ No newline at end of file
该目录下请放置需要被编译的图片资源,打包运行时,如在`vue.config.js`中配置了:
`pluginOptions.tinypng.key`则会自动压缩
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a
href="https://cli.vuejs.org"
target="_blank"
rel="noopener"
>vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
target="_blank"
rel="noopener"
>babel</a>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
target="_blank"
rel="noopener"
>eslint</a>
</li>
</ul>
<h3>Essential Links</h3>
<ul>
<li>
<a
href="https://vuejs.org"
target="_blank"
rel="noopener"
>Core Docs</a>
</li>
<li>
<a
href="https://forum.vuejs.org"
target="_blank"
rel="noopener"
>Forum</a>
</li>
<li>
<a
href="https://chat.vuejs.org"
target="_blank"
rel="noopener"
>Community Chat</a>
</li>
<li>
<a
href="https://twitter.com/vuejs"
target="_blank"
rel="noopener"
>Twitter</a>
</li>
<li>
<a
href="https://news.vuejs.org"
target="_blank"
rel="noopener"
>News</a>
</li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li>
<a
href="https://router.vuejs.org"
target="_blank"
rel="noopener"
>vue-router</a>
</li>
<li>
<a
href="https://vuex.vuejs.org"
target="_blank"
rel="noopener"
>vuex</a>
</li>
<li>
<a
href="https://github.com/vuejs/vue-devtools#vue-devtools"
target="_blank"
rel="noopener"
>vue-devtools</a>
</li>
<li>
<a
href="https://vue-loader.vuejs.org"
target="_blank"
rel="noopener"
>vue-loader</a>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
rel="noopener"
>awesome-vue</a>
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
此差异已折叠。
<template> <template>
<section class="user-info-wrapper"> <section class="user-info-wrapper">
<div class="user-avt"> <div class="user-avt">
<img :src="userInfo.avatarImageUrl" alt /> <img
:src="userInfo.avatarImageUrl"
alt
>
</div> </div>
<p class="user-name">{{userInfo.name}}</p> <p class="user-name">
<p class="user-mb">{{userInfo.mobilePhone}}</p> {{ userInfo.name }}
</p>
<p class="user-mb">
{{ userInfo.mobilePhone }}
</p>
<p> <p>
<el-button <el-button
class="footer" class="footer"
...@@ -12,46 +19,75 @@ ...@@ -12,46 +19,75 @@
type="primary" type="primary"
size="small" size="small"
@click="clipboardAction" @click="clipboardAction"
>复制手机号</el-button> >
复制手机号
</el-button>
</p> </p>
<section class="other-info-wrapper"> <section class="other-info-wrapper">
<article class="other-info"> <article class="other-info">
<div class="icon"> <div class="icon">
<img src="../../assets/image/IM/icon-contacts.png" alt /> <img
src="../../assets/image/IM/icon-contacts.png"
alt
>
</div> </div>
<span class="desc">{{userInfo.userTypeValue}}</span> <span class="desc">{{ userInfo.userTypeValue }}</span>
</article> </article>
<article class="other-info"> <article class="other-info">
<div class="icon"> <div class="icon">
<img src="../../assets/image/IM/icon-id-card.png" alt /> <img
src="../../assets/image/IM/icon-id-card.png"
alt
>
</div> </div>
<div class="icon-s"> <div class="icon-s">
<img v-if="userInfo.certifyStatus" src="../../assets/image/IM/check-yes.png" alt /> <img
<img v-else src="../../assets/image/IM/check-no.png" alt /> v-if="userInfo.certifyStatus"
src="../../assets/image/IM/check-yes.png"
alt
>
<img
v-else
src="../../assets/image/IM/check-no.png"
alt
>
</div> </div>
<span class="desc mr12">实名认证</span> <span class="desc mr12">实名认证</span>
<div class="icon-s"> <div class="icon-s">
<img v-if="userInfo.status" src="../../assets/image/IM/check-yes.png" alt /> <img
<img v-else src="../../assets/image/IM/check-no.png" alt /> v-if="userInfo.status"
src="../../assets/image/IM/check-yes.png"
alt
>
<img
v-else
src="../../assets/image/IM/check-no.png"
alt
>
</div> </div>
<span class="desc">执业认证</span> <span class="desc">执业认证</span>
</article> </article>
<article class="other-info"> <article class="other-info">
<div class="icon"> <div class="icon">
<img src="../../assets/image/IM/icon-org.png" alt /> <img
src="../../assets/image/IM/icon-org.png"
alt
>
</div> </div>
<span class="desc">{{userInfo.hospitalName ? userInfo.hospitalName : '无机构'}}</span> <span class="desc">{{ userInfo.hospitalName ? userInfo.hospitalName : '无机构' }}</span>
</article> </article>
</section> </section>
<section class="qt-wrapper"> <section class="qt-wrapper">
<p class="title">问题归类</p> <p class="title">
问题归类
</p>
<el-select <el-select
v-model="stickerIdList"
style="width:100%;" style="width:100%;"
multiple multiple
v-model="stickerIdList"
size="mini" size="mini"
@remove-tag="removeTag"
placeholder="请选择问题归类" placeholder="请选择问题归类"
@remove-tag="removeTag"
@visible-change="stickerSave" @visible-change="stickerSave"
> >
<el-option <el-option
...@@ -59,121 +95,125 @@ ...@@ -59,121 +95,125 @@
:key="index" :key="index"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
></el-option> />
</el-select> </el-select>
</section> </section>
</section> </section>
</template> </template>
<script> <script>
let clipboard = null; let clipboard = null;
export default { import { stickerSave, getStickerList, stickerInfo } from '@/api/diagnosis';
props: {
userInfo: {
type: Object,
default: () => {
return {
name: " ",
mobilePhone: " ",
isShowCopyBtn: true
};
}
},
taskLogId: {
type: String | Number,
default: ''
}
},
data() {
return {
stickerList: [],
stickerIdList: []
};
},
computed: {
},
watch: {
taskLogId(newVal) {
this.getStikerInfo(newVal);
}
},
created() {
this.getStickerList();
},
methods: {
// 查询所有的问题分类
getStickerList() {
this.GET(`/im/sticker/list`).then(res => {
if (res.code === "000000") {
console.log("in getStickerList", res);
this.stickerList = res.data || [];
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
// 根据tasklogid查询问题分类 export default {
getStikerInfo(taskLogId) { props: {
this.GET(`/im/sticker/info?taskLogId=${taskLogId}`).then(res => { userInfo: {
if (res.code === "000000") { type: Object,
let stickerIdList = [], stickerList = res.data || []; default: () => {
stickerList.forEach( item => { return {
stickerIdList.push(item.id); name: ' ',
}) mobilePhone: ' ',
this.stickerIdList = stickerIdList; isShowCopyBtn: true
} else { };
this.$message({
message: res.message,
type: "error"
});
} }
}); },
taskLogId: {
type: String | Number,
default: ''
}
}, },
data() {
// 删除时,也要保存 return {
removeTag() { stickerList: [],
console.log(this.stickerIdList); stickerIdList: []
this.stickerSave(false); };
}, },
computed: {
// 保存用户问题分类 },
stickerSave(status) { watch: {
// 下拉框出现(status==true),直接退出 taskLogId(newVal) {
if(status) return; this.getStikerInfo(newVal);
let params = {
stickerIdList: this.stickerIdList,
taskLogId: this.taskLogId,
} }
this.POST(`/im/sticker/save`, params).then(res => {
if (res.code === "000000") {
console.log("in getStickerSave", res);
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
}, },
created() {
this.getStickerList();
},
methods: {
// 查询所有的问题分类
getStickerList() {
getStickerList().then(res => {
if (res.code === '000000') {
console.log('in getStickerList', res);
this.stickerList = res.data || [];
} else {
this.$message({
message: res.message,
type: 'warning'
});
}
});
},
// 粘帖文本 // 根据tasklogid查询问题分类
clipboardAction() { getStikerInfo(taskLogId) {
const _this = this; stickerInfo({
clipboard && clipboard.destroy(); // 不是单例的,所以每次都要销毁 taskLogId:taskLogId
clipboard = new this.ClipboardJS(".footer", { }).then(res => {
// .footer:文档的CSS类名 if (res.code === '000000') {
text: function(trigger) { const stickerIdList = [], stickerList = res.data || [];
console.log(_this.userInfo.mobilePhoneCopy); stickerList.forEach( item => {
_this.$message.success('复制成功'); stickerIdList.push(item.id);
return _this.userInfo.mobilePhoneCopy; // 要粘贴的文案 });
} this.stickerIdList = stickerIdList;
}); } else {
this.$message({
message: res.message,
type: 'error'
});
}
});
},
// 删除时,也要保存
removeTag() {
console.log(this.stickerIdList);
this.stickerSave(false);
},
// 保存用户问题分类
stickerSave(status) {
// 下拉框出现(status==true),直接退出
if(status) return;
const params = {
stickerIdList: this.stickerIdList,
taskLogId: this.taskLogId,
};
stickerSave(params).then(res => {
if (res.code === '000000') {
console.log('in getStickerSave', res);
} else {
this.$message({
message: res.message,
type: 'warning'
});
}
});
},
// 粘帖文本
clipboardAction() {
const _this = this;
clipboard && clipboard.destroy(); // 不是单例的,所以每次都要销毁
clipboard = new this.ClipboardJS('.footer', {
// .footer:文档的CSS类名
text: function(trigger) {
console.log(_this.userInfo.mobilePhoneCopy);
_this.$message.success('复制成功');
return _this.userInfo.mobilePhoneCopy; // 要粘贴的文案
}
});
}
} }
} };
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.user-info-wrapper { .user-info-wrapper {
...@@ -256,4 +296,3 @@ export default { ...@@ -256,4 +296,3 @@ export default {
} }
</style> </style>
<template> <template>
<div class="bread-crumb"> <div class="bread-crumb">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: jumPathThird }">{{curmbFirst}}</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: jumPathThird }">
<el-breadcrumb-item v-if="curmbSecond">{{curmbSecond}}</el-breadcrumb-item> {{ curmbFirst }}
<el-breadcrumb-item v-if="curmbThird">{{curmbThird}}</el-breadcrumb-item> </el-breadcrumb-item>
</el-breadcrumb> <el-breadcrumb-item v-if="curmbSecond">
</div> {{ curmbSecond }}
</el-breadcrumb-item>
<el-breadcrumb-item v-if="curmbThird">
{{ curmbThird }}
</el-breadcrumb-item>
</el-breadcrumb>
</div>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
curmbFirst: { curmbFirst: {
type: String type: String
}, },
curmbSecond: { curmbSecond: {
type: String type: String
}, },
curmbThird: { curmbThird: {
type: String type: String
}, },
jumPathThird: { jumPathThird: {
type: String type: String
} }
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.bread-crumb { .bread-crumb {
...@@ -42,4 +48,3 @@ export default { ...@@ -42,4 +48,3 @@ export default {
} }
</style> </style>
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
<template> <template>
<div> <div>
<div> <div>
<el-badge is-dot class="item"> <el-badge
{{ item.label }} is-dot
</el-badge> class="item"
>
{{ item.label }}
</el-badge>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "timeLeft", name: 'TimeLeft',
data() { props:['item'],
return { data() {
timer: null, return {
time:60 timer: null,
}; time:60
}, };
props:['item'], },
mounted() { mounted() {
},
methods: {
down() {
this.timer = setInterval(() => {
this.time--;
if (this.time === 0) {
this.$emit('setItem')
clearInterval(this.timer);
}
}, 1000);
}, },
}, methods: {
}; down() {
this.timer = setInterval(() => {
this.time--;
if (this.time === 0) {
this.$emit('setItem');
clearInterval(this.timer);
}
}, 1000);
},
},
};
</script> </script>
<style lang="less" scoped> <style lang="scss" scoped>
</style> </style>
此差异已折叠。
此差异已折叠。
此差异已折叠。
该目录放置Vue第三方插件初始化的文件。该目录会被自动加载。
例如:
```js
import Vue from 'vue';
import { Plugin } from 'vue-fragment';
Vue.use(Plugin);
Vue.property.$test = 'pica';
```
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册