提交 b58107b6 编写于 作者: chengxiang.li's avatar chengxiang.li

合并最新的线上代码至开发分支

......@@ -2371,9 +2371,9 @@
"dev": true
},
"element-ui": {
"version": "2.10.0",
"resolved": "http://192.168.110.93:4873/element-ui/-/element-ui-2.10.0.tgz",
"integrity": "sha1-5hKfa21v/g260SWkqNF9RHpfY5w=",
"version": "2.11.1",
"resolved": "http://192.168.110.93:4873/element-ui/-/element-ui-2.11.1.tgz",
"integrity": "sha512-PACNMHPWqm+/Wc2f/q93pLNzbNyVbpMCXCrYe81czengSWj7IBku7F3zccybkxtWn5qdCmMDBCpG5BzGJL4rKA==",
"requires": {
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
......
......@@ -22,6 +22,12 @@ const nameList = r => require.ensure([], () => r(require('../views/learning/name
const dataAlignment = r => require.ensure([], () => r(require('../views/learning/data-alignment.vue')), 'data-alignment')
const exportDownload = r => require.ensure([], () => r(require('../views/learning/export-download.vue')), 'export-download')
const reportLisOld = r => require.ensure([], () => r(require('../views/learning-o/report-list.vue')), 'report-list')
const itemListOld = r => require.ensure([], () => r(require('../views/learning-o/item-list.vue')), 'item-list')
const nameListOld = r => require.ensure([], () => r(require('../views/learning-o/name-list.vue')), 'name-list')
const dataAlignmentOld = r => require.ensure([], () => r(require('../views/learning-o/data-alignment.vue')), 'data-alignment')
const exportDownloadOld = r => require.ensure([], () => r(require('../views/learning-o/export-download.vue')), 'export-download')
const itemShield = r => require.ensure([], () => r(require('../views/education/item-shield.vue')), 'item-shield')
const entryManager = r => require.ensure([], () => r(require('../views/education/entry-manager.vue')), 'entry-manager')
const editEntry = r => require.ensure([], () => r(require('../views/education/edit-entry.vue')), 'edit-entry')
......@@ -74,7 +80,8 @@ export default [{
},{
path: '/item-role',
component: itemRole
},{
}
,{
path: '/report-list',
component: reportLis
},{
......@@ -91,6 +98,25 @@ export default [{
path: '/export-download',
component: exportDownload
},
{
path: '/report-list-old',
component: reportLisOld
},{
path: '/item-list-old',
component: itemListOld
},{
path: '/data-alignment-old',
component: dataAlignmentOld
},{
path: '/name-list-old',
component: nameListOld
},
{
path: '/export-download-old',
component: exportDownloadOld
},
{
path: '/item-shield',
component: itemShield,
......
......@@ -2,7 +2,17 @@ const common = {
state: {
_token: '',
idType: '',
masterAdministratorFlag: false
masterAdministratorFlag: false,
itemComponents:{
name:'',
status:''
},
itemManager:{
projectName: '',
projectBegintime: '',
projectEndtime: '',
projectStatus: ''
}
},
mutations: {
CHANGE_TOKEN: (state, data) => {
......@@ -13,7 +23,15 @@ const common = {
},
CHANGE_MASTER: (state, data) => {
state.masterAdministratorFlag = data
}
},
UPDATEITEM_COMPONENTS:(state, data) => {
//console.log(data)
state.itemComponents = {...data}
},
UPDATEITEM_MANAGER:(state, data) => {
console.log(data)
state.itemManager = {...data}
},
},
actions: {
changeToken({ commit }, tokenData) {
......@@ -24,8 +42,14 @@ const common = {
},
changeMaster({ commit }, masterData) {
commit('CHANGE_MASTER', masterData)
}
},
updateItemComponents({ commit }, masterData) {
commit('UPDATEITEM_COMPONENTS', masterData)
},
updateItemManager({ commit }, masterData) {
commit('UPDATEITEM_MANAGER', masterData)
},
}
}
export default common
\ No newline at end of file
export default common
......@@ -254,3 +254,15 @@ html,body{
color: #FF9A4B;
}
}
.empty-img {
position: relative;
height: 100px;
width: 100%;
display: flex;
img {
position: relative;
margin: 38px auto;
height: 24px;
width: 106px;
}
}
\ No newline at end of file
import fetch from '../fetch';
import { getBaseUrl, getSaasDomain, getSaasApiDomain } from '@/utils/index'
import utils from '@/utils/followup/followupUtils';
const headers = {
// sysCode: 9,
productType: 1, // productType 产品线类型,1 表示云鹊医产品系,2 表示云鹊健康产品系
sourceType: 3, // sourceType 终端来源,1 表示安卓,2 表示 ios,3 表示 web,4 表示 H5 登录,5 表示 admin 后台
}
// 获取 RSA public key
export const getPubKey = (params) => {
return fetch({
headers,
url: getBaseUrl(`account/cipher/key`),
method: 'get',
params: params,
description: 'get public key',
})
};
// 密码登录
export const handleLogin = data => {
return fetch({
headers,
url: getBaseUrl(`account/login`),
method: 'post',
data: data,
description: '密码登录',
})
}
// 密码退出登录
export const handleLogout = data => {
return fetch({
headers,
url: getBaseUrl(`account/logout`),
method: 'get',
data: data,
description: '密码退出登录',
})
}
// 获取图形验证码
export const handleGetCaptcha = data => {
return fetch({
headers,
url: getBaseUrl(`account/account/captcha`),
method: 'get',
data: data,
description: '获取图形验证码',
})
}
// 忘记密码时 获取短信验证码
export const handleGetAuthCode = data => {
return fetch({
headers,
url: getBaseUrl(`account/account/authCode`),
method: 'post',
data: data,
description: '获取短信验证码',
})
}
// 重设密码
export const handleResetPWD = data => {
return fetch({
headers,
url: getBaseUrl(`account/password/reset`),
method: 'post',
data: data,
description: '忘记密码之重设密码',
})
}
// 判断是否同意协议
export const handleAgreement = data => {
return fetch({
headers,
url: getBaseUrl(`api-ws/agreements/consent`),
method: 'get',
params: data,
description: '检查用户同意的协议',
})
}
/**
* 常量定义文件
*
*/
// 分页大小
export const PAGE_SIZE = 10
// 添加动作常量
export const ACTION_TYPE_ADD = 'ACTION_TYPE_ADD'
// 修改动作常量
export const ACTION_TYPE_UPDATE = 'ACTION_TYPE_UPDATE'
// 删除动作常量
export const ACTION_TYPE_DELETE = 'ACTION_TYPE_DELETE'
/* 是否使用Mock数据 */
export const IS_MOCK_DATAS = true
// 通用状态 全部/正常/停用
export const COMMON_STATUS_OPTIONS = [
{
value: '',
label: '启用状态'
}, {
value: 0,
label: '正常'
}, {
value: 1,
label: '停用'
}
]
// 识别状态 全部/未标记/正常/误识
export const RECORD_STATUS_OPTIONS = [
{
value: '',
label: '标记状态'
}, {
value: '0',
label: '未标记'
}, {
value: '1',
label: '正常'
}, {
value: '2',
label: '误识'
}
]
// 用户类型 全部/普通用户/VIP/黑名单
export const USER_TYPE_OPTIONS = [
{
value: '',
label: '用户类型'
}, {
value: 1,
label: '普通用户'
}, {
value: 2,
label: 'VIP'
}, {
value: 3,
label: '黑名单'
}
]
import fetch from '../fetch';
import { getBaseUrl } from '@/utils/index';
export const uploadExcel = (data, projectId) => {
// return utils.checkAuth(()=>{
return fetch({
headers: {
'Content-Type': 'application/json;charset=UTF-8',
sysCode: 12,
token: localStorage.getItem('storageToken'),
},
url: getBaseUrl('portal/v2/role/importRoleFile?projectId=' + projectId),
method: 'post',
data: data,
description: '上传excel文件',
})
// })
}
export const uploadOrgExcel = (data, projectId) => {
// return utils.checkAuth(()=>{
return fetch({
headers: {
'Content-Type': 'application/json;charset=UTF-8',
sysCode: 12,
token: localStorage.getItem('storageToken'),
},
url: getBaseUrl('portal/new/scope/org/v1/' + projectId + '/import'),
method: 'put',
data: data,
description: '上传excel文件',
})
// })
}
export const uploadPersonExcel = (data, projectId) => {
// return utils.checkAuth(()=>{
return fetch({
headers: {
'Content-Type': 'application/json;charset=UTF-8',
sysCode: 12,
token: localStorage.getItem('storageToken'),
},
url: getBaseUrl('portal/new/scope/doctor/v1/' + projectId + '/import'),
method: 'put',
data: data,
description: '上传excel文件',
})
// })
}
\ No newline at end of file
/**
* 环境变量配置文件
*/
export const envConfig = {
development: {
// // baseUrl: 'http://10.177.15.180:10202/',
// // baseUrl: 'http://192.168.140.14:10201/',
// baseUrl: 'https://test1-sc.yunqueyi.com/',
// baseUrl: 'https://uat-sc.yunqueyi.com/',
// baseUrl: 'http://10.177.15.150:10401/',
// baseUrl: 'http://10.177.15.150:11905/',
baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'https://test1-sc.yunqueyi.com/',
// baseUrl: 'https://uat-sc.yunqueyi.com/',
apiUrl: 'https://uat-api.yunqueyi.com/',
qiniuFileUrl: "https://uat-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://uat-saas.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'http://localhost:8090/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://uat-saas.yunqueyi.com/pica_index.html',
followUpSCSoSo: 'http://sosoapi.yunqueyi.com/sosoapi-web/pass/mock/73',
// followUpSC: 'https://uat-sc.yunqueyi.com',
followUpSC: 'https://dev-sc.yunqueyi.com',
saasDomainUrl: 'https://uat-saas.yunqueyi.com/',
workApiUrl: 'https://uat-work.yunqueyi.com/web',
workApiSrc: 'https://uat-work.yunqueyi.com',
// reportUrl: 'http://10.177.15.150:10401/',
// reportUrl: 'http://192.168.140.13:10401/',
// reportUrl: 'https://dev-sc-report.yunqueyi.com/',
reportUrl: 'https://dev-sc-report.yunqueyi.com/',
// reportUrl: 'https://test1-sc-report.yunqueyi.com/',
// reportUrl: 'https://uat-sc-report.yunqueyi.com/',
excelUrl: 'https://uat-file.yunqueyi.com/File/template/portal/',
itemFileUrl: 'http://pica-test-huabei2.oss-cn-beijing.aliyuncs.com/File/template/portal/',
},
dev: {
baseUrl: 'https://dev-sc.yunqueyi.com/',
apiUrl: 'https://dev-api.yunqueyi.com/',
qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html',
followUpSC: 'https://dev-sc.yunqueyi.com',
saasDomainUrl: 'https://dev-saas.yunqueyi.com/',
workApiUrl: 'https://dev-work.yunqueyi.com/web',
workApiSrc: 'https://dev-work.yunqueyi.com',
reportUrl: 'https://dev-sc-report.yunqueyi.com/',
excelUrl: 'https://test-file.yunqueyi.com/File/template/portal/',
itemFileUrl: 'http://pica-test-huabei2.oss-cn-beijing.aliyuncs.com/File/template/portal/',
},
test: {
baseUrl: 'https://test1-sc.yunqueyi.com/',
apiUrl: 'https://test1-api.yunqueyi.com/',
qiniuFileUrl: "https://test1-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://test1.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
followUpSC: 'https://test1-sc.yunqueyi.com',
yuequeyiIndexUrl: 'https://test1.yunqueyi.com/pica_index.html',
saasDomainUrl: 'https://test1.yunqueyi.com/',
workApiUrl: 'https://test1-work.yunqueyi.com/web',
workApiSrc: 'https://test1-work.yunqueyi.com',
reportUrl: 'https://test1-sc-report.yunqueyi.com/',
excelUrl: 'https://test-file.yunqueyi.com/File/template/portal/',
itemFileUrl: 'http://pica-test-huabei2.oss-cn-beijing.aliyuncs.com/File/template/portal/',
},
test2: {
baseUrl: 'https://test2-work.yunqueyi.com/sc/',
qiniuFileUrl: "https://test1-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://test1.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
followUpSC: 'https://test2-work.yunqueyi.com/sc',
yuequeyiIndexUrl: 'https://test1.yunqueyi.com/pica_index.html',
saasDomainUrl: 'https://test2-work.yunqueyi.com/web/',
workApiUrl: 'https://test2-work.yunqueyi.com/web',
workApiSrc: 'https://test2-work.yunqueyi.com',
reportUrl: 'https://test2-sc-report.yunqueyi.com/',
excelUrl: 'https://test-file.yunqueyi.com/File/template/portal/',
itemFileUrl: 'http://pica-test-huabei2.oss-cn-beijing.aliyuncs.com/File/template/portal/',
},
uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/',
apiUrl: 'https://uat-api.yunqueyi.com/',
qiniuFileUrl: "https://uat-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com", // 视频
qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://uat.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
followUpSC: 'https://uat-sc.yunqueyi.com',
yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html',
saasDomainUrl: 'https://uat.yunqueyi.com/',
workApiUrl: 'https://uat-work.yunqueyi.com/web',
workApiSrc: 'https://uat-work.yunqueyi.com',
reportUrl: 'https://uat-sc-report.yunqueyi.com/',
excelUrl: 'https://test-file.yunqueyi.com/File/template/portal/',
itemFileUrl: 'http://pica-test-huabei2.oss-cn-beijing.aliyuncs.com/File/template/portal/',
},
pro: {
baseUrl: 'https://sc.yunqueyi.com/',
apiUrl: 'https://api.yunqueyi.com/',
qiniuFileUrl: "https://sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://video.yunqueyi.com",
qiniuImgUrl: "https://files.yunqueyi.com",
loginUrl: 'https://www.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
followUpSC: 'https://sc.yunqueyi.com',
yuequeyiIndexUrl: 'https://www.yunqueyi.com/pica_index.html',
saasDomainUrl: 'https://www.yunqueyi.com/',
workApiUrl: 'https://work.yunqueyi.com/web',
workApiSrc: 'https://work.yunqueyi.com',
reportUrl: 'https://sc-report.yunqueyi.com/',
excelUrl: 'https://file.yunqueyi.com/File/template/portal/',
itemFileUrl: 'http://pica-test-huabei2.oss-cn-beijing.aliyuncs.com/File/template/portal/',
}
}
//api路径
import {isNotEmptyUtils} from "./utils";
export default async(url = '', data = {}, type = 'POST', method = 'fetch',server='CONTENT') => {
type = type.toUpperCase();
// url = (server==='WECHAT'?wechatUrl:baseUrl) + url;
if (url.match("^http") == null){
url = localStorage.getItem("Url") + url;
}
console.log("完整url:",url)
if (type == 'GET' && data) {
let dataStr = ''; //数据拼接字符串
Object.keys(data).forEach(key => {
dataStr += key + '=' + data[key] + '&';
})
if (dataStr !== '') {
dataStr = dataStr.substr(0, dataStr.lastIndexOf('&'));
url = url + '?' + dataStr;
// url = encodeURI(url + '?' + dataStr, true);
}
}
if (window.fetch && method == 'fetch') {
let requestConfig = {
credentials: 'include',
method: type,
// mode: "cors",
headers: {
// 'Access-Control-Allow-Origin': '*',
'Accept': '*',
'Content-Type': 'application/json',
'sysCode':'2'
// 'token': localStorage.getItem('token') || null, //固定传header:
// 'system_code': 'todo' //固定传header:系统编号
},
}
if (type == 'POST' || type === 'PUT' || type === 'PATCH' || type === 'DELETE' && data) {
Object.defineProperty(requestConfig, 'body', {
value: JSON.stringify(data)
})
}
try {
const response = await fetch(url, requestConfig);
const responseJson = await response.json();
return responseJson
} catch (error) {
throw new Error(error)
}
} else {
return new Promise((resolve, reject) => {
let requestObj;
if (window.XMLHttpRequest) {
requestObj = new XMLHttpRequest();
} else {
requestObj = new ActiveXObject;
}
let sendData = '';
if (type == 'POST' || type == 'DELETE' || type == 'PUT') {
sendData = JSON.stringify(data);
}
requestObj.open(type, url, true);
requestObj.setRequestHeader("Content-Type", "application/json");
requestObj.setRequestHeader("sysCode", "3");
requestObj.send(sendData);
requestObj.onreadystatechange = () => {
if (requestObj.readyState == 4) {
if (requestObj.status == 200) {
let obj = requestObj.response
if (typeof obj !== 'object' && isNotEmptyUtils(obj)) {
obj = JSON.parse(obj);
}
resolve(obj)
} else {
reject(requestObj)
}
}
}
})
}
}
import axios from 'axios'
import { Loading } from 'element-ui';
import store from '../store'
// import { getHostnameAndPort } from '../utils'
// axios.defaults.withCredentials = true
const service = axios.create({
// baseURL: process.env.BASE_API
timeout: 600000,
withCredentials: false
})
let loadingInstance = () => {
return Loading.service({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
}
let loading;
let needLoadingRequestCount = 0;
let showFullScreenLoading = () => {
if (needLoadingRequestCount === 0) {
loadingInstance();
}
needLoadingRequestCount++;
};
let tryHideFullScreenLoading = () => {
if (needLoadingRequestCount > 0) {
needLoadingRequestCount--;
}
if (needLoadingRequestCount === 0) {
loadingInstance().close();
}
};
// request拦截器
service.interceptors.request.use(config => {
if (config.noLoading) {
}else{
showFullScreenLoading();
}
const noSysCode = config.headers.noSysCode;
if(noSysCode){
delete config.headers.sysCode;
delete config.headers.deviceInfo;
delete config.headers.noSysCode;
delete config.headers.token;
}else{
if( config.headers['sysCode']==undefined) {
config.headers['sysCode'] = 12
}
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
// console.log('环境变量>>>> ', process.env.BUILD_ENV);
// config.headers['token'] = 'BFD804F3A3194FBBBE113962222839F6';
// config.headers['token'] = 'F8209898391C40A0B8DBC1ED9E157291';
config.headers['token'] = '2E46B77D801C479DBA1C550CE70D348F';
}else{
config.headers['token'] = localStorage.getItem('storageToken')
}
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
}
// if (config.data && config.data.setEntry) {
// config.headers['sysCode'] = config.data.sysCode || 10
// if(config.data.token){
// config.headers['token'] = config.data.token || '63C3FA92AF8A45A48B31EB7FD97B95EB'
// }
// config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
// }
return config
}, error => {
// logger.debug('service.interceptors.request: ', error)
tryHideFullScreenLoading();
Promise.reject(error)
})
// respone拦截器
service.interceptors.response.use(
response => {
if (response.config.noLoading) {
}else{
tryHideFullScreenLoading()
}
const res = response.data
/*
baseUrl时,返回000000为成功
apiUrl时,返回200为成功
*/
// if (res.code !== '000000') {
// return Promise.reject('error')
// } else {
return response.data
// }
},
error => {
// logger.error('err' + error)
tryHideFullScreenLoading();
return Promise.reject(error)
}
)
export default service
const vueFilter = {
liveDateFilter: (value) => {
if (!value) return '';
return new Date(value).format("yyyy-MM-dd hh:mm:ss");
},
liveFilter: (value) => {
if(value.liveStatus == 1){
return '未开始'
} else if(value.liveStatus == 5) {
return '直播中'
}else if(value.liveStatus == 10 && value.lookBackStatus == 2){
return '已结束(不可回看)'
}else if(value.liveStatus == 10 && value.lookBackStatus == 1) {
return '已结束(可回看)'
}
},
liveStatusFilter: (value) => {
if(value == 1) return "隐藏"
else return "发布"
},
liveTeacherType: (value) => {
let doctorName = []
if(value.length > 3) {
for(let i = 0; i < 3; i++) {
doctorName.push(value[i].doctorName)
}
return doctorName.join("、") + '...'
}else{
for(let i = 0; i < value.length; i++) {
doctorName.push(value[i].doctorName)
}
return doctorName.join("、")
}
},
controlType: (value) => {
if(value == 1) {
return '分页1'
}else if(value == 2) {
return '分页2'
}else if(value == 3) {
return '图片1'
}else if(value == 4) {
return '图片2'
}else if(value == 6) {
return '视频'
}
},
tabControlType: (value) => {
if(value == 3) {
return '图片1'
}else if(value == 4) {
return '图片2'
}else if(value == 6) {
return '视频'
}
},
refreshType: (value) => {
if(value == 1) return "支持"
else return "不支持"
},
moudleType: (value) => {
if(value == 1) return "未激活"
else return "激活"
},
dateFilter: (value) => {
if (!value) return '';
return new Date(value).format("yyyy-MM-dd hh:mm");
},
appColumnStatusFilter: (value) => {
if(value == 1) return "未提交"
else if(value == 4) return "已提交"
},
statusFilter: (value) => {
if(value == 1) return "已创建"
else if(value == 5) return "已发布"
else return "已下架"
},
linkTypeFilter: (value) => { // 跳转类型
if(value == 1) return '链接'
else if(value == 4) return '模块'
else return '无跳转'
},
teacherStatusFilter: (value) => {
if(value == 1) return "已下架"
else return "已发布"
},
moduleTypeFilter: (value,data) => { // 模块类型
for(let key in data) {
if(value == key) {
return data[key]
}
}
},
contentCreatedType: (value,data) => {
for(let i = 0; i< data.length;i++) {
if(value == data[i].id) {
return data[i].name
}
}
},
contentModifiedType: (value,data) => {
for(var i=0; i < data.length;i++) {
if(value == data[i].id) {
return data[i].name
}
}
},
columnPositionType: (value,data) => { // 位置
for(let key in data) {
if(value == key) {
return data[key]
}
}
},
// 项目组件
statusFileter: (value) => {
if(value == 1) {
return '草稿'
}else if(value == 2) {
return '未启用'
}else if(value == 3) {
return '已启用'
}else {
return '已禁用'
}
},
//项目管理
statusProject: (value) => {
//console.log(value)
if(value[0] == 1) {
return '草稿'
}else if(value[0] == 2) {
return '未上架'
}else if(value[0] == 3) {
if(value[1] == 1) {
return '待审核'
} else {
return '审核中'
}
}else if(value[0] == 4) {
return '已上架'
}else if(value[0] == 5) {
return '已下架'
}else if(value[0] == 6) {
return '已拒绝'
}
},
projeceRoleType: (value) => {
if(value == "L1") {
return '内部管理员'
}else if(value == "L2") {
return '项目负责人'
}else if(value == "L3") {
return '次级负责人'
} else if(value == "L0") {
return '普通用户'
}
},
joinStatus: (value) => {
if(value == "0") {
return '未参与'
}else if(value == "1") {
return '参与中'
}else {
return '已完成'
}
},
reportStatus: (value) => {
if(value == 1) {
return '进行中'
}else if(value == 2) {
return '已结束'
}
},
partJoin: (value) => {
if(value == 1) {
return '未参与'
}else {
return '参与'
}
},
partFinish: (value) => {
if(value == 1) {
return '未完成'
}else {
return '完成'
}
},
projectStatus: (value) => {
if(value == 1) {
return '未参与'
}else if(value == 2) {
return '参与中'
}else if(value == 3) {
return '完成项目'
}
},
recordValue: (value) => {
if(value == 1) {
return '无成绩'
}else if(value == 2) {
return '不通过'
}else if(value == 3) {
return '通过'
}
},
exportStatus: (value) => {
if(value == 0) {
return '数据生成中,请稍后---';
}else if(value == 1) {
return '数据生成完成';
} else {
return '文件生成失败 请重新操作导出';
}
},
getAvgTime: (value) => {
let list = [0,0];
let avgTime = '';
if(value != null && value !='') {
list[0] = Math.floor(value / 60);
list[1] = value % 60;
}
if(list[0] == 0 && list[1] == 0) {
avgTime = list[1] + '秒';
} else if(list[0] == 0 && list[1] != 0) {
avgTime = list[1] + '秒';
} else if(list[0] != 0 && list[1] == 0) {
avgTime = list[0] + '分';
} else if(list[0] != 0 && list[1] != 0) {
avgTime = list[0] + '分' + list[1] + '秒';
}
return avgTime;
},
getTotalTime: (value) => {
let time = value +'分钟';
return time;
},
shieldStatus: (value) => {
if(value == 1) {
return '未屏蔽';
} else if(value == 2) {
return '已屏蔽';
}
},
shieldButton: (value) => {
if(value == 1) {
return '屏蔽';
} else if(value == 2) {
return '取消屏蔽';
}
},
areaText: (value) => {
let text = '-';
if(value.regions.length == 0) {
text = '-'
} else if(value.regions.length == 1) {
text = value.regions[0];
} else if(value.regions.length > 1){
let len = value.regions.length;
text = value.regions[0]+'('+len+')';
}
return text;
},
areaList: (value) => {
let list = '';
for(let i=0; i<value.length ; i++) {
list += value[i]+'、';
}
list = list.substring(0, list.length - 1);
return list
},
}
export default vueFilter
\ No newline at end of file
import fetch from '../fetch';
import { getFollowUpApi, getBasicDataApi, getFollowUpSC } from '@/utils/index'
import utils from './followupUtils';
const headers = {
sysCode: 45,
hospitalAuth:true
} /**/
/*工作台*/
export const getTodayAppointsList = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/overView/todayAppoints`),
method: 'get',
params: params,
description: '获取今日预约列表',
})
};
export const getTodayOverview = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/overView/todayOverview`),
method: 'get',
params: params,
description: '获取今日履约、预约、履约人数',
})
};
export const getTodayPlans = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/overView/todayPlans`),
method: 'get',
params: params,
description: '查询今日履约计划',
})
};
/*计划管理*/
export const createFollowPlan = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/plans`),
method: 'post',
data: data,
description: '新增、修改履约计划',
})
})
}
export const getPlanList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/plans`),
method: 'get',
params: params,
description: '获取计划列表',
})
// })
};
export const getPlanDetail = (planId) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/${planId}`),
method: 'get',
description: '获取计划详情',
})
// })
};
export const getNodeTimeList = (planId) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/${planId}/time`),
method: 'get',
description: '获取履约时间节点列表',
})
// })
};
export const getNodeTimeContent = (planTimeId) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/time/${planTimeId}`),
method: 'get',
description: '获取节点详情',
})
// })
};
export const getResidentList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/`),
method: 'get',
params: params,
description: '获取居民列表',
})
// })
};
export const getGroupList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/group`),
method: 'get',
params: params,
description: '获取分组列表',
})
// })
};
export const getFollowStartTimeList = (planId) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/${planId}/times`),
method: 'get',
description: '获取履约开始时间列表(居民相关)',
})
// })
};
export const getResidentDetail = (planId,patientId,fuPlanPatientId ) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/${planId}/detail/${patientId}?planPatientsId=${fuPlanPatientId}`),
method: 'get',
description: '获取居民详情',
})
// })
};
export const changePlan = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/change`),
method: 'put',
data: data,
description: '变更计划',
})
})
};
export const finishPlan = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/status`),
method: 'put',
data: data,
description: '变更计划',
})
})
};
export const deletePlan = (planId) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/${planId}`),
method: 'delete',
description: '删除计划',
})
})
};
export const getVerifyStatus = (params) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/validate/status`),
method: 'get',
params: params,
description: '认证校验',
})
})
};
/*预约管理*/
export const getReservationList = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/appoint/appointed/list`),
method: 'post',
data: data,
description: '获取预约列表',
})
})
};
export const getCheckReservation = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/healths/notice/fu/doctor/appoint/pushValid`),
method: 'post',
data: data,
description: '发送预约校验',
})
})
};
export const getReservationPatients = (data) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/appoint/appointed/count`),
method: 'post',
data: data,
description: '查看预约人数',
})
// })
};
export const changeReservationStatus = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/appoint/status/`),
method: 'post',
data: data,
description: '手动变更预约状态',
})
})
};
export const sendReservation = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/appoint/`),
method: 'post',
data: data,
description: '发送预约',
})
})
};
/*录入管理*/
export const getEnteringList = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/entering/list`),
method: 'post',
data: data,
description: '录入列表查看',
})
})
}
export const changeEnteringStatus = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/entering/status/change`),
method: 'post',
data: data,
description: '变更履约状态',
})
})
}
export const getEnteringInfo = (patientId, fuPlanPatientTimesId) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/entering/${patientId}/fuInfo/${fuPlanPatientTimesId}`),
method: 'get',
// params: params,
description: '履约单条信息查看',
},)
// })
}
export const getFormList = (planTimesId) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/entering/scale/${planTimesId}/list`),
method: 'get',
// params: params,
description: '获取量表列表',
},)
// })
}
//获取新建计划居民列表
export const getPlanPatientsList = (data) =>{
// return utils.checkAuth(()=>{
return fetch({
headers:{
sysCode: 9,
hospitalAuth:true
},
url: getFollowUpSC(`/healths/patients/infolist`),
method: 'post',
data: data,
description: '获取新建计划居民列表',
},)
// })
}
// 获取履约计划模板列表
export const getFollowupTemplate = (data) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/templets`),
method: 'get',
data: data,
description: '获取履约计划模板列表',
})
// })
}
// 获取履约量表固定模板
export const getFollowupTableTemplate = (id) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/templets/${id}`),
method: 'get',
data: {},
description: '获取履约量表固定模板',
})
// })
}
// 获取量表列表
export const getFormOptions = (data)=>{
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/followup/entering/scale/list`),
method: 'get',
data: data,
description: '获取量表列表',
})
// })
}
/*常量*/
export const getBasicData = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/basic-data/constants/`),
method: 'get',
params: params,
description: '获取常量',
})
// })
};
// 获取所有漫画列表
export const getAllEducationComtent = (data) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/healths/comtent/workstation/list`),
method: 'post',
data: data,
description: '获取所有漫画列表'
})
// })
}
// 获取所有疾病
export const getAllDiseases = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/healths/patients/diseases/-1`),
method: 'get',
params: params,
description: '获取所有疾病',
})
// })
}
// 获取所有分组
export const getAllLabels = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getFollowUpSC(`/healths/labels/`),
method: 'get',
params: params,
description: '获取所有分组',
})
// })
}
// 获取微信和短信病人数接口
export const getPatientNumber = (data) => {
// return utils.checkAuth(()=>{
return fetch({
headers: {
sysCode: 9,
hospitalAuth:true
},
url: getFollowUpSC(`/healths/patientEducation/getSendPatientTypeNum`),
method: 'post',
data: data,
description: '获取微信和短信病人数接口',
})
// })
}
/*
* 量表相关
*/
// 获取域名白名单
export const getDomain = (data) => {
return fetch({
url: getFollowUpSC(`/followup/route/domain?type=1`),
method: 'get',
data: {},
})
}
// 获取展示的模块
export const getScaleModels = (domain,scaleNo) => {
return fetch({
url: `${domain}/scale/${scaleNo}/models`,
method: 'get',
data: {},
})
}
// 获取量表详情
export const getScaleDetail = (domain,planPatientsTimesId,scaleNo) => {
return fetch({
url: `${domain}/scale/${planPatientsTimesId}/${scaleNo}/info?type=2&isLine=2`,
method: 'get',
data: {},
})
}
// 提交量表
export const postScale = ( domain,data ) => {
return fetch({
url: `${domain}/scale/save`,
method: 'post',
data: JSON.stringify(data),
})
}
// 更新量表状态
export const updateScalesStatus = ( data ) => {
return fetch({
url: getFollowUpSC(`/followup/entering/scale/updateScalesStatus`),
method: 'post',
data: data,
})
}
// 获取量表详情
export const getFirstAccess = () => {
return fetch({
url: getFollowUpSC(`/followup/overView/firstAccess`),
method: 'get',
data: {},
})
}
/**
* Add by Anndy Yang
* 统一验证:量表内是否存在敏感字段、居民是否签署隐私协议、7天内是否发送过授权短信
* @param {[type]} data
{
"scaleNo":"String,量表编号",
// "patientIds":"List<Integer>,医生/居民id集合", // pc端只传这个字段
"planPatientsTimesId": "planPatientsTimesId", // app端只传这个字段
"protocolType":"Integer,协议类型(1:平台用户协议,5:隐私协议)",
"userType":"Integer,用户类型(1:居民,2:医生,3:其他)",
"validateType":"1:3个条件依次校验,2:后面2个条件依次校验"
}
* @return {[type]}
{
"code": "000000",
"message": "成功",
"data": {
"levelType":"类型 1:量表不存在敏感字段,2:居民都已签署协议,3:7天内发送过授权短信,4:7天内未发送过授权短信"
"ids":"List<Integer>,未签署协议的id集合(需要发送授权短信的居民id集合)"
}
}
*/
export const uniteValidate = (data) => {
return fetch({
url: getFollowUpSC(`/followup/protocol/uniteValidate`),
method: 'post',
data: data,
})
};
/**
* Add by Anndy Yang
* [批量]医生给居民发送授权短信
* @param {[type]} data {"patientIds":"List<Integer>,居民id集合"}
* @return {[type]} [description]
*/
export const authMessage = (data) => {
return fetch({
url: getFollowUpSC(`/followup/protocol/authMessage`),
method: 'post',
data: data,
})
};
// 关于权限获取展示的模块信息
export const getScaleModels2 = (domain,scaleNo, params) => {
return fetch({
url: `${domain}/followup/protocol/${scaleNo}/models`,
method: 'get',
params: params,
})
}
// 检查号码是否符合规范,包括长度,类型
function isCardNo(card){
//身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
var reg = /(^\d{15}$)|(^\d{17}(\d|X|x)$)/;
if(reg.test(card) === false){
return false;
}
return true;
}
// 取身份证前两位,校验省份
function checkProvince(card,vcity){
var province = card.substr(0,2);
if(vcity[province] == undefined){
return false;
}
return true;
}
// 检查生日是否正确
function checkBirthday(card){
var len = card.length;
//身份证15位时,次序为省(3位)市(3位)年(2位)月(2位)日(2位)校验位(3位),皆为数字
if(len == '15'){
var re_fifteen = /^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/;
var arr_data = card.match(re_fifteen);
var year = arr_data[2];
var month = arr_data[3];
var day = arr_data[4];
var birthday = new Date('19'+year+'/'+month+'/'+day);
return verifyBirthday('19'+year,month,day,birthday);
}
//身份证18位时,次序为省(3位)市(3位)年(4位)月(2位)日(2位)校验位(4位),校验位末尾可能为X
if(len == '18'){
var re_eighteen = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X|x)$/;
var arr_data = card.match(re_eighteen);
var year = arr_data[2];
var month = arr_data[3];
var day = arr_data[4];
var birthday = new Date(year+'/'+month+'/'+day);
return verifyBirthday(year,month,day,birthday);
}
return false;
}
// 校验日期
function verifyBirthday(year,month,day,birthday) {
var now = new Date();
var now_year = now.getFullYear();
//年月日是否合理
if(birthday.getFullYear() == year && (birthday.getMonth() + 1) == month && birthday.getDate() == day)
{
//判断年份的范围(0岁到100岁之间)
var time = now_year - year;
if(time >= 0 && time <= 100)
{
return true;
}
return false;
}
return false;
}
// 校验位的检测
function checkParity(card){
//15位转18位
card = changeFivteenToEighteen(card);
var len = card.length;
if(len == '18'){
var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
var cardTemp = 0, i, valnum;
for(i = 0; i < 17; i ++) {
cardTemp += card.substr(i, 1) * arrInt[i];
}
valnum = arrCh[cardTemp % 11];
if (valnum == card.substr(17, 1).toLocaleUpperCase())
{
return true;
}
return false;
}
return false;
}
// 15位转18位身份证号
function changeFivteenToEighteen(card){
if(card.length == '15')
{
var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
var cardTemp = 0, i;
card = card.substr(0, 6) + '19' + card.substr(6, card.length - 6);
for(i = 0; i < 17; i ++)
{
cardTemp += card.substr(i, 1) * arrInt[i];
}
card += arrCh[cardTemp % 11];
return card;
}
return card;
}
//最新的身份证校验规则
function validateIdCard (num) {
num = num.toUpperCase(); //身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X。
if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(num))) {
return false;
}
//验证前2位,城市符合
var aCity={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"};
if(aCity[parseInt(num.substr(0,2))]==null){
return false;
}
//下面分别分析出生日期和校验位
var len, re; len = num.length;
if (len == 15) {
re = new RegExp(/^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/);
var arrSplit = num.match(re); //检查生日日期是否正确
var dtmBirth = new Date('19' + arrSplit[2] + '/' + arrSplit[3] + '/' + arrSplit[4]);
var bGoodDay; bGoodDay = (dtmBirth.getYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]));
if (!bGoodDay) { // 身份证号的出生日期不对
return false;
} else { //将15位身份证转成18位 //校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
var nTemp = 0, i;
num = num.substr(0, 6) + '19' + num.substr(6, num.length - 6);
for(i = 0; i < 17; i ++) {
nTemp += num.substr(i, 1) * arrInt[i];
}
num += arrCh[nTemp % 11];
return true;
}
}
if (len == 18) {
re = new RegExp(/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/);
var arrSplit = num.match(re); //检查生日日期是否正确
var dtmBirth = new Date(arrSplit[2] + "/" + arrSplit[3] + "/" + arrSplit[4]);
var bGoodDay; bGoodDay = (dtmBirth.getFullYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]));
if (!bGoodDay) { // 身份证号的出生日期不对
return false;
}
else { //检验18位身份证的校验码是否正确。 //校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
var valnum;
var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
var nTemp = 0, i;
for(i = 0; i < 17; i ++) {
nTemp += num.substr(i, 1) * arrInt[i];
}
valnum = arrCh[nTemp % 11];
if (valnum != num.substr(17, 1)) { // 18位身份证号的校验码不正确
return false;
}
return true;
}
}
return false;
}
export const checkCardNum = (rule, value, callback) => {
// var vcity={ 11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",
// 21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",
// 33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",
// 42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",
// 51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",
// 63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"
// };
// //是否为空
// if(value === ''){
// callback(new Error('请输入正确的身份证'))
// }
// //校验长度,类型
// if(isCardNo(value) === false){
// callback(new Error('请输入正确的身份证'))
// }
// //检查省份
// if(checkProvince(value,vcity) === false){
// callback(new Error('请输入正确的身份证'))
// }
// //校验生日
// if(checkBirthday(value) === false){
// callback(new Error('请输入正确的身份证'))
// }
// //检验位的检测
// if(checkParity(value) === false){
// callback(new Error('请输入正确的身份证'))
// }
// callback()
if(value === ''){
callback(new Error('请输入正确的身份证'))
}else {
if(validateIdCard(value)) {
callback()
}else {
callback(new Error('请输入正确的身份证'))
}
}
}
import rangeJson from './rangConfig';
// 这个方法,是用户在选择履约轮次(6个月,12个月)后续操作
let checkNeedRule = (val) => {
const needRule = sessionStorage.getItem('needRule');
if( val!='0' && (!val||val=='') && (!needRule || needRule=='true') ){
return true;
}
return false;
}
// 校验范围通用方法
export const checkRange = (rule, value, callback) => {
let min,max;
let val = parseFloat(value);
let res;
// 处理 诸如 01 这种情况
if(value && value.length>1 && value.indexOf('.')<0){
res = (new RegExp(/^[1-9]\d*$/g)).test(value);
}else{
res = true;
}
rangeJson.forEach((item)=>{
if(item.field == rule.field){
min = item.min;
max = item.max;
}
})
const ruless = ( (val >= min) && (val <= max) && res )
// if(ruless || checkNeedRule(val)){
if( !value || ruless ){
callback()
}else{
callback(new Error(`输入范围${min}~${max}`))
}
}
// 校验手机号
export const checkMobile = (rule, value, callback) => {
const reg = /^1[3|4|5|6|7|8|9][0-9]{9}$/; //验证规则
const flag = reg.test(value);
if(flag){
callback()
}else{
callback(new Error(`请输入正确的手机号码`))
}
}
// 校验是否是整数
export const checkIsInteger = (rule, value, callback) => {
const val = parseFloat(value);
const num = Number.isInteger(val);
// const val = Number.parseInt(value);
// const num = /^[0-9]*[1-9][0-9]*$/.test(value);
// if(num || checkNeedRule(val)){
if( !value || num ){
callback()
}else{
callback(new Error(`输入整数`))
}
}
// 校验是否是一位小数
export const checkNumberIsToFixed = (rule, value, callback) => {
const isNum = /^(([1-9][0-9]*)|(([0]\.\d{1,1}|[1-9][0-9]*\.\d{1,1})))$/;
const val = Number(value);
// if(isNum.test(val) || checkNeedRule(val)){
if( !value || isNum.test(val) ){
callback()
}else{
callback(new Error(`最多输入1位小数`))
}
}
// 大于0的正整数
export const checkNormalInt = (rule, value, callback) => {
const val = parseFloat(value);
const isInteger = Number.isInteger(val);
// if((isInteger && val > 0) || checkNeedRule(val)){
if( !value || (isInteger && val > 0) ){
callback()
}else{
callback(new Error(`请输入大于0的正整数`))
}
}
// 校验是否是两位小数
export const checkNumberIsToFixedTwo = (rule, value, callback) => {
const isNum = /^(-)?(0|[1-9]\d*)(\s|$|\.\d{1,2}\b)/;
const val = Number(value);
// if(isNum.test(val) || checkNeedRule(val)){
if( !value || isNum.test(val) ){
callback()
}else{
callback(new Error(`最多输入2位小数`))
}
}
// 只获取指定的参数(浅复制);
function getParams(params, arr) {
const res = Object.create(null);
if (!params) return res;
if (Object.prototype.toString.call(params) === '[object FormData]') { // formData类型直接返回
return params;
}
if (arr && arr.length) { // 只对需要处理的处理下
arr.forEach(item => {
if (item) {
res[item] = params[item] || '';
}
});
return res;
} else {
return params;
}
}
export default {
getParams,
};
import dataConverter from './dataConverter';
import fetch from '@/utils/fetch';
import { getBaseUrl, getSaasDomain, getSaasApiDomain } from '@/utils/index'
import Vue from 'vue';
function getSaasHost(){
var host;
if(location.host.indexOf('dev-work')>-1 || location.host.indexOf('localhost')>-1){
host = 'https://dev-saas.yunqueyi.com'
}else if(location.host.indexOf('test1-work')>-1){
host = 'https://test1.yunqueyi.com'
}else if(location.host.indexOf('uat-work')>-1){
host = 'https://uat.yunqueyi.com'
}else{
host = 'https://www.yunqueyi.com'
}
return host
}
function getWsHost(){
var host;
if(location.host.indexOf('dev-work')>-1 || location.host.indexOf('localhost')>-1){
host = 'https://dev-ws.yunqueyi.com'
}else if(location.host.indexOf('test1-work')>-1){
host = 'https://test1-ws.yunqueyi.com'
}else if(location.host.indexOf('uat-work')>-1){
host = 'https://uat-ws.yunqueyi.com'
}else{
host = 'https://ws.yunqueyi.com'
}
return host
}
const alertMessage = (msg, confirmButtonText, cancelButtonText, callback) => {
Vue.prototype.$confirm(msg, '提醒', {
confirmButtonText: confirmButtonText,
cancelButtonText: cancelButtonText,
customClass: 'check-auth',
showClose: false,
}).then(() => {
callback();
}).catch(() => {
// 关闭弹窗
});
}
export default {
DC: dataConverter,
checkAuth: (callback) => {
return new Promise((resolve, reject) => {
resolve(fetch({
headers: {
token: localStorage.getItem('storageToken')
},
url: getBaseUrl(`/healths/doctor/hospitalAuth`),
method: 'get',
description: '检查用户的机构权限',
}).then(res => {
// 1、未加入 2、审核中 3、加入成功
if (res.code == '000000') {
if (res.data == 1) {
// 点击 去加入,进入加入机构流程
alertMessage('您当前暂无机构,无法使用居民管理、履约管理和群发消息等功能,请在加入机构后重试。','去加入','暂不加入', ()=>{
location.href = getSaasHost() + '/pica-base/pica_join.html'
})
return new Promise((resolve, reject) => {
})
} else if (res.data == 2) {
alertMessage('您创建的机构正在审核中,暂无法使用居民管理、履约管理和群发消息等功能,请在审核通过后重试。','查看审核','取消', ()=>{
location.href = getWsHost() + '/outside/status?tk=' + localStorage.getItem('storageToken')
})
return new Promise((resolve, reject) => {
})
} else if (res.data == 3) {
return callback()
}
}
}))
})
},
checkAuthFunc: ()=>{
return new Promise((resolve, reject) => {
resolve(fetch({
headers: {
token: localStorage.getItem('storageToken')
},
url: getBaseUrl(`healths/doctor/hospitalAuth`),
method: 'get',
description: '检查用户的机构权限',
}).then(res => {
// res.data = 2
if (res.code == '000000') {
if (res.data == 1) {
alertMessage('您当前暂无机构,无法使用居民管理、履约管理和群发消息等功能,请在加入机构后重试。','去加入','暂不加入', ()=>{
location.href = getSaasHost() + '/pica-base/pica_join.html'
})
} else if (res.data == 2) {
alertMessage('您创建的机构正在审核中,暂无法使用居民管理、履约管理和群发消息等功能,请在审核通过后重试。','查看审核','取消', ()=>{
location.href = getWsHost() + '/outside/status?tk=' + localStorage.getItem('storageToken')
})
} else if (res.data == 3) {
}
return new Promise((resolve, reject) => {
resolve(res.data)
})
}
}))
})
}
};
import range from './range';
import rangeHype from './rangeHype';
import rangeDiabetes from './rangeDiabetes';
export default [
...range,
...rangeHype,
...rangeDiabetes
]
// 脑卒中字段校验的配置文件
export default [
{
field: 'fastingBloodGlucose',
name: '空腹血糖',
min: 1,
max: 33.3
},
{
field: 'triglyceride',
name: '甘油三酯',
min: 0,
max: 5
},
{
field: 'cholesterol',
name: '胆固醇',
min: 1,
max: 10
},
{
field: 'cLdl',
name: '低密度脂蛋白胆固醇',
min: 0,
max: 5
},
{
field: 'cHdl',
name: '高密度脂蛋白胆固醇',
min: 0,
max: 5
},
{
field: 'stature',
name: '身高',
min: 100,
max: 200
},
{
field: 'weight',
name: '体重',
min: 35,
max: 200
},
{
field: 'waistline',
name: '腰围',
min: 50,
max: 150
},
{
field: 'firstSystolicPressure',
name: '收缩压SBP',
min: 70,
max: 240
},
{
field: 'firstDiastolicPressure',
name: '舒张压DBP',
min: 50,
max: 130
},
{
field: 'firstPulse',
name: '脉搏',
min: 30,
max: 200
},
{
field: 'secondSystolicPressure',
name: '收缩压SBP',
min: 70,
max: 240
},
{
field: 'secondDiastolicPressure',
name: '舒张压DBP',
min: 50,
max: 130
},
{
field: 'secondPulse',
name: '脉搏',
min: 30,
max: 200
},
]
// 高血压字段校验的配置文件
export default [
{
field: 'systolicBloodPressure',
name: '收缩压SBP',
min: 70,
max: 240
},
{
field: 'diastolicBloodPressure',
name: '舒张压DBP',
min: 50,
max: 130
},
{
field: 'bodyHeight',
name: '身高',
min: 100,
max: 250
},
{
field: 'bodyWeight',
name: '体重',
min: 35,
max: 250
},
{
field: 'nextBodyWeight',
name: '体重',
min: 35,
max: 250
},
{
field: 'fastingBloodSugar',
name: '空腹血糖值',
min: 1,
max: 33.3
},
{
field: 'glycosylatedHemoglobinPercent',
name: '糖化血红蛋白值',
min: 3.00,
max: 20.00
},
{
field: 'smokingAmount',
name: '日吸烟量',
min: 0,
max: 99
},
{
field: 'nextSmokingAmount',
name: '日吸烟量',
min: 0,
max: 99
},
{
field: 'alcoholConsumption',
name: '日饮酒量',
min: 0,
max: 99
},
{
field: 'nextAlcoholConsumption',
name: '日饮酒量',
min: 0,
max: 99
},
{
field: 'workoutOfWeek',
name: '运动情况',
min: 0,
max: 99
},
{
field: 'workoutDuration',
name: '运动情况',
min: 0,
max: 99
},
{
field: 'nextWorkoutOfWeek',
name: '运动情况',
min: 0,
max: 99
},
{
field: 'nextWorkoutDuration',
name: '运动情况',
min: 0,
max: 99
},
{
field: 'nextWorkoutDuration',
name: '运动情况',
min: 0,
max: 99
},
{
field: 'stapleFoodGram',
name: '主食摄入量',
min: 0,
max: 999
},
{
field: 'nextStapleFoodGram',
name: '主食摄入量',
min: 0,
max: 999
},
]
// 高血压字段校验的配置文件
export default [
{
field: 'systolicBloodPressure',
name: '收缩压SBP',
min: 70,
max: 240
},
{
field: 'diastolicBloodPressure',
name: '舒张压DBP',
min: 50,
max: 130
},
{
field: 'bodyHeight',
name: '身高',
min: 100,
max: 250
},
{
field: 'bodyWeight',
name: '体重',
min: 35,
max: 250
},
{
field: 'nextBodyWeight',
name: '下次履约体重',
min: 35,
max: 250
},
{
field: 'heartRate',
name: '心率',
min: 30,
max: 200
},
{
field: 'smokingAmount',
name: '本次日吸烟量',
min: 0,
max: 99
},
{
field: 'nextSmokingAmount',
name: '下次履约日吸烟量',
min: 0,
max: 99
},
{
field: 'alcoholConsumption',
name: '本次日饮酒量',
min: 0,
max: 99
},
{
field: 'nextAlcoholConsumption',
name: '下次履约日饮酒量',
min: 0,
max: 99
},
{
field: 'workoutOfWeek',
name: '本次运动情况',
min: 0,
max: 99
},
{
field: 'workoutDuration',
name: '本次运动情况',
min: 0,
max: 99
},
{
field: 'nextWorkoutOfWeek',
name: '下次履约运动情况',
min: 0,
max: 99
},
{
field: 'nextWorkoutDuration',
name: '下次履约运动情况',
min: 0,
max: 99
},
{
field: 'dosageDay',
name: '用法',
min: 0,
max: 5
},
]
/**
* Created by Anndy Yang on 18/09/18.
*/
import { envConfig } from '@/utils/env-config'
export function setEventByModuleCode(itemData){
let modeCode = itemData.appModuleInfo.code || '';
let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : ''
if( modeCode === 'M001' || modeCode === 'M002' || modeCode === 'M003') {
paramList = ''
}else if( modeCode === 'M100' || modeCode === 'M300' ) {
let urlPara = getUrlParmByCode(paramList);
paramList[0] && (paramList[0].value += urlPara);
}else if( modeCode === 'M400') {
let path = paramList[0]['key'];
let v = paramList[0]['value'];
let query = setRouterParm(paramList);
}
if(typeof paramList === 'string' && !paramList){
paramList = []
}
return paramList;
}
function getUrlParmByCode(paramList) {
if ( paramList.length <= 1) {
return ''
}
let dataStr = ''
let list = [];
for( let i = 1; i < paramList.length; i ++) {
list.push(paramList[i].key + '=' + paramList[i].value)
}
dataStr = list.join('&')
if (dataStr !== '') {
return '?' + dataStr
}
return ''
}
// 计算高度
export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'sidebarWrapperId',
containerHeightId = 'appContainerId', innerHeightId = 'elTableId'){
if (!p_getElm(refHeightId) || !p_getElm(containerHeightId) || !p_getElm(innerHeightId)) {
// window.onresize = null
logger.warn('No certain dom id!!!');
}
let containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 50
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
p_getElm(innerHeightId).style.height = containerHeight - iMinuxHeight + 'px'
if(p_getElm('elTableIdInner')){
p_getElm('elTableIdInner').style.height = containerHeight - iMinuxHeight + 'px'
}
window.onresize = function() {
containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 50
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
p_getElm(innerHeightId).style.height = containerHeight - iMinuxHeight + 'px'
if (p_getElm('elTableIdInner')) {
p_getElm('elTableIdInner').style.height = containerHeight - iMinuxHeight + 'px'
}
}
}
function p_getElm(elmId) {
return document.getElementById(elmId)
}
export function deepCopy(obj) {
var result = Array.isArray(obj) ? [] : {};
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === 'object') {
result[key] = deepCopy(obj[key]); //递归复制
} else {
result[key] = obj[key];
}
}
}
return result;
}
/**
*
* @param {Array} originData 初始数据
* @param {Boolean} isUp true: 升序 false: 降序
* @param {String} sortField 排序字段,如果没有,则直接排序
* @param {Function} converFun 字段对应的数值转换函数
*/
export function arraySort(originData, isUp = true, sortedField, converFun) {
// debugger
let sortedData = originData.slice(), swap, sourceA, sourceB;
for(let i = 0; i < sortedData.length - 1; i ++) {
for(let j = 0; j < sortedData.length - i -1; j++) {
sourceA = sortedData[j]
sourceB = sortedData[j + 1]
if(sortedField && !converFun) {
sourceA = sourceA[sortedField]
sourceB = sourceB[sortedField]
} else if(sortedField && converFun && typeof converFun === 'function'){
if(!sourceA[sortedField] || !sourceB[sortedField]) {
sourceA = 0
sourceB = 0
} else {
sourceA = converFun(sourceA[sortedField])
sourceB = converFun(sourceB[sortedField])
}
}
// if(!sourceA || !sourceB) {
// sourceA = 0
// sourceB = 0
// }
if(isUp) {
if((sourceA - 0) > (sourceB - 0)) {
swap = sortedData[j]
sortedData[j] = sortedData[j + 1]
sortedData[j + 1] = swap
}
} else {
if((sourceA - 0) < (sourceB - 0)) {
swap = sortedData[j]
sortedData[j] = sortedData[j + 1]
sortedData[j + 1] = swap
}
}
}
}
return sortedData
}
export function sortParmData(originData, orderCol, index) {
return originData.sort((a, b) => {
return (a[orderCol] - b[orderCol] ) * -1
})
}
// 获取SC服务器域名地址
export function getBaseUrl(url) {
return getConfigByEnvType('baseUrl') + url
}
// 获取七牛token
export function getQiniuToken1() {
return getConfigByEnvType('qiniuFileUrl')
}
// 登录URL
export function getLoginUrl(param) {
return getConfigByEnvType('loginUrl') + param
}
export function getInnerLoginUrl() {
return getConfigByEnvType('innerLoginUrl')
}
// 云鹊医首页
export function getYunQueYiUrl() {
return getConfigByEnvType('yuequeyiIndexUrl')
}
// 七牛上传视频和图片
export function uploadVideo() {
return getConfigByEnvType('qiniuResourceUrl')
}
export function uploadImg() {
return getConfigByEnvType('qiniuImgUrl')
}
// 获取履约微服务服务器域名地址
export function getFollowUpSC(url) {
return getConfigByEnvType('followUpSC') + url
}
// 获取常量接口域名地址
export function getBasicDataApi(url) {
return getConfigByEnvType('basicDataUrl') + url
}
// 获取saas端域名地址
export function getSaasDomain(url) {
return getConfigByEnvType('saasDomainUrl') + url
}
// 获取saasApi端域名地址
export function getWorkApi(url) {
return getConfigByEnvType('workApiUrl') + url
}
// 获取saas端api域名地址
export function getSaasApiDomain(url) {
return getConfigByEnvType('apiUrl') + url
}
// 获取工作站的域名地址
export function getWorkDomain(url) {
return getConfigByEnvType('workApiSrc') + url
}
// 根据不同环境,生成URL
function getConfigByEnvType(urlType) {
return envConfig[process.env.BUILD_ENV][urlType]
}
// 获取report服务器域名地址
export function getReportUrl(url) {
return getConfigByEnvType('reportUrl') + url
}
// 获取Excel地址
export function getExeclUrl(url) {
return getConfigByEnvType('excelUrl') + url
}
// 获取教培项目文件地址
export function getItemFileUrl(url) {
return getConfigByEnvType('itemFileUrl') + url
}
\ No newline at end of file
import fetch from '@/utils/fetch'
import { getBaseUrl, getReportUrl, getWorkApi } from '@/utils/index'
import { CryptoJS } from '@/plugins/aes'
import 'jsencrypt'
import { getPubKey } from '@/utils/account/accountApi';
let pubKey = "";
module.exports = {
data: function () {
return {
token: null
}
},
created: function () {
// let query = this.$router.query
// this.token = this.getUrlSearch(location.href, 'token') || (query && query.token) || null
// this.token = this.getUrlKey('token') || (query && query.token) || null
},
mounted: function() {
},
methods: {
// generate key
getAesKey(len) {
len = len || 16;
var aesKey = "";
var strList = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var strLen = strList.length;
for(var i=0; i<len; i++){
aesKey += strList.charAt( Math.floor( Math.random()*strLen ) );
};
return aesKey;
},
// 加密传参,发送请求
sendEncryptRequest(content, cb){
content = JSON.stringify(content); // 后端要求转 string
// debugger;
if(pubKey){ // pubKey获取过就不用再获取了
let params = this.formatContent(content, pubKey);
cb && cb(params);
}else{
this.handleGetPubKey(content, cb);
}
},
// get public key
handleGetPubKey(content, cb){
getPubKey().then(res => {
// console.log('>>>>>>>>>>>>>>>>>>>> publicKey: ', res)
if(res.code == '000000'){
pubKey = res.data;
if(cb){
let params = this.formatContent(content, pubKey);
cb && cb(params);
}
}else{
this.$message({
message: (res && res.message) || '接口出错',
type: 'warning'
});
}
})
},
// format account params
formatContent(content, pubKey) { // obj为具体的json传参
let aesKey = this.getAesKey(16);
// console.log('AES key::::::: ', aesKey)
let params = {
key: '',
content: ''
};
// 开发阶段后端接口还没处理加密,先传 原始json数据 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 后端加密OK后 再用下面的注释代码
// params.content = content;
params.content = this.AesEncrypt(content, aesKey);
params.key = this.RsaEncrypt(aesKey, pubKey);
return params;
},
// AES encrypt
AesEncrypt(content, aesKey) {
let sKey = CryptoJS.enc.Utf8.parse(aesKey);
let sContent = CryptoJS.enc.Utf8.parse(content);
let encrypted = CryptoJS.AES.encrypt(sContent, sKey, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
return encrypted.toString();
},
// RSA encrypt
RsaEncrypt(aesKey, pubKey){
let _encrypt = new JSEncrypt();
let boss_public_key = pubKey;
_encrypt.setPublicKey(boss_public_key);
let encrypted = _encrypt.encrypt(aesKey);
return encrypted;
},
getUrlPara(obj) {
let dataStr = ''
let list = [];
for (let attr in obj) {
if (obj.hasOwnProperty(attr) && attr != 'data') {
list.push(attr + '=' + obj[attr])
}
}
dataStr = list.join('&')
if (dataStr !== '') {
return '?' + dataStr
}
return ''
},
setRouterParm(paramList){
let parm = {};
if(paramList.length<=1){
return '';
}
for(let i=1;i<paramList.length;i++){
parm[paramList[i].key] = paramList[i].value;
}
return parm;
},
// 拼接多个参数
getUrlParmByCode(paramList) {
if ( paramList.length <= 1) {
return ''
}
let dataStr = ''
let list = [];
for( let i = 1; i < paramList.length; i ++) {
list.push(paramList[i].key + '=' + paramList[i].value)
}
dataStr = list.join('&')
if (dataStr !== '') {
return '?' + dataStr
}
return ''
},
//处理五分钟数据 初始化播放状态
handelFive(d) {
for (let i = 0; i < d.length; i++) {
d[i].play = '0';
}
return d;
},
// 根据条件排序
async searchForOrder(searchCategory = '1', searchValue = '', sortItem = 1, pageSize = 10, sourceData = []) {
if(pageSize <=0 ) return;
let str2 = (searchValue || '').replace(/[\-\_\,\!\|\~\`\(\)\#\$\%\^\&\*\{\}\:\;\"\L\<\>\?]/g, '');// 去掉特殊字符
let _this = this,
para = {
searchCategory: searchCategory,
searchValue: str2,
keywordColor: 'rgba(244,122,72,1)',
sortItem: sortItem,
pageNo: 1,
pageSize: pageSize,
token: _this.token,
setEntry: 'headers',
}
let url = 'contents/searchKeyword/searchContent'
let csourceData = await this.GET(url, para).then(res => {
// _this.searchText = ''
if (res.code == '000000') {
// 课程
if(searchCategory.indexOf('1') >= 0) {
sourceData = (res.data && res.data.contentAppModels) || []
}
if(searchCategory.indexOf('2') >= 0) {
// sourceData = []
sourceData = this.handelFive(res.data.fiveMinutesMedicalContentList || [])
}
if(searchCategory.indexOf('3') >= 0) {
sourceData = (res.data && res.data.pCourseDoctorModels) || []
}
if(searchCategory.indexOf('4') >= 0) {
sourceData = res.data.educationContents
}
}
return sourceData || []
})
return csourceData
},
setEventByModuleCode(itemData){
let modeCode = itemData.appModuleInfo.code || '';
let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : ''
if( modeCode === 'M001' || modeCode === 'M002' || modeCode === 'M003') {
paramList = ''
}else if( modeCode === 'M100' || modeCode === 'M300' ) {
// 支持多个参数
let urlPara = this.getUrlParmByCode(paramList);
if(paramList[0]){
if( paramList[0].value.indexOf("?") == -1){
paramList[0].value += urlPara
}
}
} else if (modeCode === 'M400') {
// debugger
let path = paramList[0]['key'];
let v = paramList[0]['value'];
let query = this.setRouterParm(paramList);
paramList = [{
url:v,
query:query
}]
this.$router.push({
path: v,
query: query
})
//alert(this.token);
return 'NO'
}
if(typeof paramList === 'string' && !paramList){
paramList = []
}
return paramList;
},
// 通用GET请求
GET(api, para, callback,str) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
let url = api + this.getUrlPara(para)
url = encodeURI(url);
return fetch({
url: getBaseUrl(url),
method: 'get',
data: para
})
},
reportGET(api, para, callback,str) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
let url = api + this.getUrlPara(para)
url = encodeURI(url);
return fetch({
url: getReportUrl(url),
method: 'get',
data: para
})
},
// saas-GET请求
saasGET(api, para) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
return fetch({
headers: {
sysCode: 9,
},
url: getWorkApi(api),
method: 'get',
params: para
})
},
// 通用DELETE请求
DELETE(api, para, callback,str) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
let url = api + this.getUrlPara(para)
return fetch({
url: getBaseUrl(url),
method: 'delete',
data: para
})
},
// 通用PUT请求
PUT(api, para, callback) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
return fetch({
url: getBaseUrl(api),
method: 'put',
data: para
})
},
// 通用POST请求
POST(api, para, callback) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
return fetch({
url: getBaseUrl(api),
method: 'post',
data: para
})
},
reportPOST(api, para, callback) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
return fetch({
url: getReportUrl(api),
method: 'post',
data: para
})
},
// 通用saas-POST请求
saasPOST(api, para, cType) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
let header = {}
if(cType) {
header['Content-Type'] = cType;
}
return fetch({
headers: {
sysCode: 9,
...header
},
url: getWorkApi(api),
method: 'post',
data: para
})
},
// 通用saas-PUT请求
saasPUT(api, para) {
return fetch({
headers: {
sysCode: 9,
},
url: getWorkApi(api),
method: 'put',
data: para
})
},
// 从html参数
getUrlKey(name) {
if (decodeURIComponent && location.href) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
} else {
return null
}
},
getUrlSearch(url, name) {
if (typeof name == 'undefined') {
name = url
url = location.href
}
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = url.slice(url.indexOf('?') + 1).match(reg);
if (r != null) {
try {
return decodeURIComponent(r[2]);
} catch (_e) {
return null
}
}
return null
}
}
}
let tableOrganization = [{
name: "上海市第一人民医院",
grade: "一甲医院",
province: "上海市",
city: "上海市",
district: "浦东新区",
street: "张江街道"
}, {
name: "上海市第二人民医院",
grade: "二甲医院",
province: "上海市",
city: "上海市",
district: "浦东新区",
street: "张江街道"
}, {
name: "上海市第三人民医院",
grade: "三甲医院",
province: "上海市",
city: "上海市",
district: "浦东新区",
street: "张江街道"
}];
let tablePerson = [{
name: "云小鹊",
hospital: "上海市第一人民医院",
department: "全科",
province: "上海市",
city: "上海市",
district: "浦东新区"
}, {
name: "云小鹊",
hospital: "上海市第二人民医院",
department: "全科",
province: "上海市",
city: "上海市",
district: "长宁区"
}, {
name: "云小鹊",
hospital: "上海市第三人民医院",
department: "全科",
province: "上海市",
city: "上海市",
district: "南汇区"
}];
let treeData = [
{
id: 11,
name: "一级 1",
label: "一级 1",
isLeaf: "true",
children: [
{
id: 1,
label: "一级 1",
isLeaf: "true",
children: [
{
id: 4,
label: "二级 1-1",
children: [
{
id: 9,
label: "三级 1-1-1"
},
{
id: 10,
label: "三级 1-1-2"
}
]
}
]
},
{
id: 2,
label: "一级 2",
children: [
{
id: 5,
label: "二级 2-1",
children: [],
},
{
id: 6,
label: "二级 2-2",
isLeaf: false,
}
]
},
{
id: 4,
label: "一级 4",
isLeaf: false,
},
{
id: 3,
label: "一级 3",
children: [
{
id: 7,
label: "二级 3-1"
},
{
id: 8,
label: "二级 3-2"
}
]
}
]
}
];
// 按钮type类型: 0-编辑
// 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝
// 7- 提醒审核 8(2)-取消审核 9-删除
let buttonStatusIn = [
//L1 内部管理员 L2项目负责人 L3次级负责人
//草稿
{ L1: "09", L2: "", L3: "" },
//未上架
{ L1: "039", L2: "039", L3: "0" },
//待审核、审批中
{ L1: "46", L2: "78", L3: "" },
//已上架
{ L1: "05", L2: "05", L3: "0" },
//已下架
{ L1: "039", L2: "039", L3: "0" },
//已拒绝/未上架
{ L1: "039", L2: "039", L3: "0" },
];
let buttonStatusOut = [
//L1 内部管理员 L2项目负责人 L3次级负责人
//草稿
{ L1: "", L2: "09", L3: "" },
//未上架
{ L1: "09", L2: "039", L3: "0" },
//待审核、审批中
{ L1: "46", L2: "78", L3: "" },
//已上架
{ L1: "05", L2: "05", L3: "0" },
//已下架
{ L1: "039", L2: "039", L3: "0" },
//已拒绝/未上架
{ L1: "09", L2: "039", L3: "0" },
];
export function returnData() {
let data = {};
data.tableOrganization = tableOrganization;
data.tablePerson = tablePerson;
data.treeData = treeData;
data.buttonStatusIn = buttonStatusIn;
data.buttonStatusOut = buttonStatusOut;
return data;
}
\ No newline at end of file
//求并集
export function getUnion(a, b) {
if (a.constructor === Array && b.constructor === Array) {
let set1 = new Set(a);
let set2 = new Set(b);
return Array.from(new Set([...set1, ...set2]));
}
return null;
}
//求差集
export function getDifference(a, b) {
if (a.constructor === Array && b.constructor === Array) {
let set1 = new Set(a);
let set2 = new Set(b);
return Array.from(new Set([...set1].filter(x => !set2.has(x))));
}
return null;
}
//求交集
export function getIntersect(a, b) {
if (a.constructor === Array && b.constructor === Array) {
let set1 = new Set(a);
let set2 = new Set(b);
return Array.from(new Set([...set1].filter(x => set2.has(x))));
}
return null;
}
//获取id的list
export function getIdList(data) {
let list = [];
if (typeof data === 'undefined') {
return list;
}
if (data.constructor === Array) {
for (let i = 0; i < data.length; i++) {
list.push(data[i].id);
}
}
return list;
}
//区域
export function getDivision(data) {
if (data === null || data == 'NaN') {
let empty = [];
return empty;
}
let list = data.split('|');
let num = [];
for (let i = 0; i < list.length; i++) {
num[i] = parseInt(list[i]);
}
//console.log(list);
return num;
}
export function getLevelList(data) {
let level = [];
level[0] = {
id: '-1',
label: '全部医院等级',
}
for (let i = 0; i < data.length; i++) {
let obj = {
id: data[i].no,
label: data[i].value,
}
level.push(obj);
}
//console.log(level);
return level;
}
function inTags(id, tags) {
let flag = false;
for (let i = 0; i < tags.length; i++) {
if (tags[i].key == id) {
flag = true;
}
}
return flag;
}
export function inOrganization(list, id) {
let flag = false;
if (list.length == 0) {
flag = true;
}
for (let i = 0; i < list.length; i++) {
if (list[i].id != id) {
flag = true;
}
}
return flag;
}
export function initTags(value) {
let tags = [];
for (let j = 0; j < value.length; j++) {
let tagsComponent = {};
tagsComponent.value = value.value;
tagsComponent[j].name = this.optionsComponent[j].label;
}
return tags;
}
//机构列表
export function getOrganizationList(data) {
let list = [];
list[0] = {
value: '0',
label: '全部机构',
};
for (let i = 0; i < data.length; i++) {
let obj = {
value: data[i].key,
label: data[i].name,
}
list.push(obj);
}
return list;
}
//机构列表
export function getHospitalList(data) {
let list = [];
list[0] = {
value: 0,
label: '全部医院',
};
for (let i = 0; i < data.length; i++) {
let obj = {
value: data[i].id,
label: data[i].name,
}
list.push(obj);
}
//console.log(list);
return list;
}
//拼树
export function changeTags(option) {
let list = [];
// for(let i=0;i<option.length;i++) {
// console.log(option[i].label);
// let obj = {
// name: option[i].name,
// key: option[i].key,
// }
// list.push(obj);
// }
console.log(option);
return option;
}
// 递归删除多余的节点
function handlerAction(treeData, selData) {
treeData.forEach((elem, index) => {
if (!isValuable(elem.value, selData)) {
treeData.splice(index, 1)
handlerAction(treeData, selData)
} else {
if (elem.children) {
handlerAction(elem.children, selData)
}
}
})
return treeData;
}
function isValuable(val, selData) {
for (let i = 0; i < selData.length; i++) {
if (selData[i]['value'].indexOf(val) >= 0) {
return true
}
}
return false
}
function changeTreeKey(oData, orgKey, targetKey) {
oData = [...oData]
oData.forEach(elem => {
elem[targetKey] = elem[orgKey]
delete elem[orgKey]
if (elem.children) {
changeTreeKey(elem.children, orgKey, targetKey)
}
})
return oData
}
function deleteTreeKey(oData, delKeys) {
oData = [...oData]
oData.forEach(elem => {
delKeys.forEach(key => {
delete elem[key]
})
if (elem.children) {
deleteTreeKey(elem.children, delKeys)
}
})
return oData
}
function deleteEmptyChild(oData) {
oData = [...oData]
oData.forEach(elem => {
if (elem.children && elem.children.length == 0) {
delete elem.children
} else if (elem.children) {
deleteEmptyChild(elem.children)
}
})
return oData
}
function addEmpty(data) {
let after = [];
after[0] = {
label: "全部地区",
value: "0",
}
for (let i = 0; i < data.length; i++) {
after.push(data[i]);
}
return after;
}
export function treeHandler(treeData, selData) {
//console.log('treeData',treeData,'selData',selData);
treeData = deleteTreeKey(treeData, ['status', 'disabled'])
treeData = changeTreeKey(treeData, 'id', 'value')
selData = changeTreeKey(selData, 'name', 'label')
selData = changeTreeKey(selData, 'key', 'value')
let endData = deleteEmptyChild(handlerAction(treeData, selData));
// console.log(treeData, selData)
//return handlerAction(treeData, selData);
let returnData = addEmpty(endData);
return returnData;
}
//小生态
export function getEcologyList() {
let dataList = [{
id: '123',
name: '上海第一人民医院',
hospitalLevelName: '二甲医院',
provinceName: '上海市',
cityName: '上海市',
countyName: '浦东新区',
townName: '--',
}, {
id: '124',
name: '上海第二人民医院',
hospitalLevelName: '二甲医院',
provinceName: '上海市',
cityName: '上海市',
countyName: '浦东新区',
townName: '--',
}, {
id: '125',
name: '上海第三人民医院',
hospitalLevelName: '二甲医院',
provinceName: '上海市',
cityName: '上海市',
countyName: '浦东新区',
townName: '--',
}]
return dataList;
}
export function getEcologySelect(data) {
// let ecologyist = [{
// label: '上海小生态',
// value: '1',
// },{
// label: '北京小生态',
// value: '2',
// }];
let ecologyist = [];
for (let i = 0; i < data.length; i++) {
let obj = {
label: data[i].name,
value: data[i].id,
}
ecologyist.push(obj);
}
return ecologyist;
}
export function isOverlap(startA, endA, startB, endB) {
let maxStart = Math.max(startA, startB);
let minEnd = Math.min(endA, endB);
console.log('maxStart', maxStart, 'minEnd', minEnd);
if (maxStart <= minEnd) {
return true;
} else {
return false;
}
}
export function setRegionOption(data) {
let option = [];
option[0] = { id: 0, value: 0, label: "全部", leaf: true };
for (let i = 0; i < data.length; i++) {
let obj = data[i];
obj.label = data[i].provinceName;
obj.value = data[i].provinceId;
option.push(obj);
}
return option;
}
export function setRegionOption2(data) {
let option = [];
option[0] = { id: 0, value: '0', label: "全部地区", leaf: true };
for (let i = 0; i < data.length; i++) {
let obj = data[i];
obj.label = data[i].provinceName;
obj.value = data[i].provinceId;
option.push(obj);
}
return option;
}
export function setAdministrativeId(value) {
let areaId = '000';
for (let i = 0; i < value.length; i++) {
areaId += '_' + value[i];
}
return areaId;
}
export function getRegionOption() {
let option = [{
value: 1,
label: '浙江',
children: [{
value: 2,
label: '杭州',
children: [{
value: 120115000000,
label: '西湖区'
}, {
value: 5,
label: '东湖区'
}]
}]
}];
return option;
}
export function getLearnOrganization(data) {
if (data.length == 0) {
let arr = [];
return arr;
}
let organization = [
{
label: "全部",
value: 0
},
];
for (let i = 0; i < data.length; i++) {
let obj = {
label: data[i].hospital_name,
value: data[i].hospital_id,
index: i,
};
organization.push(obj);
}
return organization;
}
export function getPicOption(title, legendData, colorData, seriesData) {
let option = {
title: {
text: title,
x: "center",
top: "3%",
},
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: "vertical",
top: "3%",
left: "left",
data: legendData
},
grid: {
left: "30%",
right: "0%",
bottom: "10%",
containLabel: true
},
color: colorData,
backgroundColor: '#F3F3F3',
series: [
{
name: "",
type: "pie",
radius: "55%",
center: ["60%", "65%"],
data: seriesData,
}
]
};
return option;
}
export function getBarOption(xAxisData, seriesData) {
let option = {
title: {
text: "用户年龄发布",
x: "center",
top: "3%",
},
color: ['#3398DB'],
backgroundColor: '#F3F3F3',
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: xAxisData,
axisLabel: {
interval: 0
}
// axisTick: {
// alignWithLabel: true
// }
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '',
type: 'bar',
barWidth: 30,
data: seriesData,
}
]
};
return option;
}
export function getRank(xAxisData, seriesData) {
let option = {
color: ["#1E90FF", "#32CD32"],
title: {
text: "排行榜",
x: "left",
textStyle: {
//主标题文本样式{"fontSize": 18,"fontWeight": "bolder","color": "#333"}
fontSize: 20,
fontStyle: "normal",
fontWeight: "normal",
color: "#000"
}
},
tooltip: {
trigger: "axis",
formatter: '{b0}<br/>{a0}: {c0}%',
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
data: ["完成人数"],
bottom: 0
},
grid: {
left: "3%",
right: "4%",
bottom: "10%",
containLabel: true
},
xAxis: [
{
type: "category",
data: xAxisData,
}
],
yAxis: [
{
type: "value",
axisLabel: {
show: true,
interval: 'auto',
formatter: '{value}%'
},
}
],
series: [
{
name: "完成通过率",
type: "bar",
stack: "完成通过率",
barMaxWidth: "50",
data: seriesData,
},
// {
// name: "参与人数",
// type: "bar",
// stack: "人数",
// barMaxWidth: "80",
// data: [220, 182, 191, 220, 182, 191]
// }
]
};
return option;
}
export function getSearchType(formData, checkAll) {
let type = 0;
if (formData.region.length == 1 || formData.region.length == 2) {
type = formData.region.length;
if (formData.region.length == 1 && formData.region[0] == 0) {
type = 6;
}
} else if (formData.region.length == 3) {
if (formData.organization.length == 0 || checkAll === true) {
type = 3;
} else {
type = 4;
}
} else if (formData.region.length == 4) {
if (formData.organization.length == 0 || checkAll === true) {
type = 5;
} else {
type = 4;
}
}
return type;
}
export function hasAll(data) {
let flag = false;
for (let i = 0; i < data.length; i++) {
if (data[i] == 0) {
flag = true;
return flag
}
}
return flag;
}
export function getIds(formData, organizationList, checkAll) {
let ids = '';
if (formData.organization.length == 0) {
//地区id
ids = formData.region[formData.region.length - 1];
} else {
//机构id 选了'全部'
if (checkAll === true) {
// for (let i = 0; i < organizationList.length; i++) {
// if (organizationList[i].value != 0) {
// ids += organizationList[i].value + ',';
// }
// }
ids = formData.region[formData.region.length - 1];
} else {
for (let i = 0; i < formData.organization.length; i++) {
if (formData.organization[i] != 0) {
ids += formData.organization[i] + ',';
}
}
ids = ids.substring(0, ids.length - 1);
}
}
return ids;
}
//获取id的list
export function getDoctorIdList(data) {
let list = [];
if (typeof data === 'undefined') {
return list;
}
if (data.constructor === Array) {
for (let i = 0; i < data.length; i++) {
list.push(data[i].doctorId);
}
}
return list;
}
export function getAjustmentList(data) {
let idList = "";
for (let i = 0; i < data.length; i++) {
idList += data[i] + ',';
}
idList = idList.substring(0, idList.length - 1);
return idList;
}
export function removeZero(data) {
let list = [];
for (let i = 0; i < data.length; i++) {
if (data[i].value != 0) {
list.push(data[i]);
}
}
return list;
}
export function initRank(data) {
let list = [{ gradeFlag: -1, gradeName: "全部" }];
for (let i = 0; i < data.length; i++) {
list.push(data[i]);
}
return list;
}
export function getAvgTime(data) {
let list = [0, 0];
if (data != null && data != '') {
list[0] = Math.floor(data / 60);
list[1] = data % 60;
}
return list;
}
export function getComponent(data) {
let list = [];
for (let i = 0; i < data.length; i++) {
list.push(data[i].value);
}
return list;
}
export function getSimpleCheckedNodes(store) {
const checkedNodes = [];
const traverse = function (node) {
const childNodes = node.root ? node.root.childNodes : node.childNodes;
childNodes.forEach(child => {
if (child.checked) {
checkedNodes.push(child.data);
}
if (child.indeterminate) {
traverse(child);
}
});
};
traverse(store)
return checkedNodes;
}
export function setSelectedKeys(checkedKeys, halfCheckedKeys) {
let selected = [];
for (let i = 0; i < checkedKeys.length; i++) {
let obj = {
key: checkedKeys[i].id,
type: 1,
};
selected.push(obj);
}
for (let j = 0; j < halfCheckedKeys.length; j++) {
let obj = {
key: halfCheckedKeys[j],
type: 2,
};
selected.push(obj);
}
return selected;
}
\ No newline at end of file
// 检查号码是否符合规范,包括长度,类型
export const isCardNo = (card) =>{
//身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
// var reg = /(^\d{15}$)|(^\d{17}(\d|X|x)$)/;
let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if(reg.test(card) === false){
return false;
}
return true;
}
// 取身份证前两位,校验省份
export const checkProvince = (card,vcity) =>{
var province = card.substr(0,2);
if(vcity[province] == undefined){
return false;
}
return true;
}
// 检查生日是否正确
export const checkBirthday = (card) =>{
var len = card.length;
//身份证15位时,次序为省(3位)市(3位)年(2位)月(2位)日(2位)校验位(3位),皆为数字
if(len == '15'){
var re_fifteen = /^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/;
var arr_data = card.match(re_fifteen);
var year = arr_data[2];
var month = arr_data[3];
var day = arr_data[4];
var birthday = new Date('19'+year+'/'+month+'/'+day);
return verifyBirthday('19'+year,month,day,birthday);
}
//身份证18位时,次序为省(3位)市(3位)年(4位)月(2位)日(2位)校验位(4位),校验位末尾可能为X
if(len == '18'){
var re_eighteen = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X|x)$/;
var arr_data = card.match(re_eighteen);
var year = arr_data[2];
var month = arr_data[3];
var day = arr_data[4];
var birthday = new Date(year+'/'+month+'/'+day);
return verifyBirthday(year,month,day,birthday);
}
return false;
}
// 校验日期
function verifyBirthday(year,month,day,birthday) {
var now = new Date();
var now_year = now.getFullYear();
//年月日是否合理
if(birthday.getFullYear() == year && (birthday.getMonth() + 1) == month && birthday.getDate() == day)
{
//判断年份的范围(0岁到100岁之间)
var time = now_year - year;
if(time >= 0 && time <= 100)
{
return true;
}
return false;
}
return false;
}
// 校验位的检测
export const checkParity = (card)=>{
//15位转18位
card = changeFivteenToEighteen(card);
var len = card.length;
if(len == '18'){
var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
var cardTemp = 0, i, valnum;
for(i = 0; i < 17; i ++) {
cardTemp += card.substr(i, 1) * arrInt[i];
}
valnum = arrCh[cardTemp % 11];
if (valnum == card.substr(17, 1).toLocaleUpperCase())
{
return true;
}
return false;
}
return false;
}
// 15位转18位身份证号
function changeFivteenToEighteen(card){
if(card.length == '15')
{
var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
var cardTemp = 0, i;
card = card.substr(0, 6) + '19' + card.substr(6, card.length - 6);
for(i = 0; i < 17; i ++)
{
cardTemp += card.substr(i, 1) * arrInt[i];
}
card += arrCh[cardTemp % 11];
return card;
}
return card;
}
export const validateIdCard = (num)=> {
num = num.toUpperCase(); //身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X。
if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(num))) {
return false;
}
//验证前2位,城市符合
var aCity={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"};
if(aCity[parseInt(num.substr(0,2))]==null){
return false;
}
//下面分别分析出生日期和校验位
var len, re; len = num.length;
if (len == 15) {
re = new RegExp(/^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/);
var arrSplit = num.match(re); //检查生日日期是否正确
var dtmBirth = new Date('19' + arrSplit[2] + '/' + arrSplit[3] + '/' + arrSplit[4]);
var bGoodDay; bGoodDay = (dtmBirth.getYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]));
if (!bGoodDay) { // 身份证号的出生日期不对
return false;
} else { //将15位身份证转成18位 //校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
var nTemp = 0, i;
num = num.substr(0, 6) + '19' + num.substr(6, num.length - 6);
for(i = 0; i < 17; i ++) {
nTemp += num.substr(i, 1) * arrInt[i];
}
num += arrCh[nTemp % 11];
return true;
}
}
if (len == 18) {
re = new RegExp(/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/);
var arrSplit = num.match(re); //检查生日日期是否正确
var dtmBirth = new Date(arrSplit[2] + "/" + arrSplit[3] + "/" + arrSplit[4]);
var bGoodDay; bGoodDay = (dtmBirth.getFullYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]));
if (!bGoodDay) { // 身份证号的出生日期不对
return false;
}
else { //检验18位身份证的校验码是否正确。 //校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
var valnum;
var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
var nTemp = 0, i;
for(i = 0; i < 17; i ++) {
nTemp += num.substr(i, 1) * arrInt[i];
}
valnum = arrCh[nTemp % 11];
if (valnum != num.substr(17, 1)) { // 18位身份证号的校验码不正确
return false;
}
return true;
}
}
return false;
}
// export const checkCardNum = (rule, value, callback) => {
// var vcity={ 11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",
// 21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",
// 33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",
// 42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",
// 51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",
// 63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"
// };
// //是否为空
// // if(value === ''){
// // callback(new Error('请输入正确的身份证'))
// // }
// if(value) {
// //校验长度,类型
// if(isCardNo(value) === false){
// callback(new Error('请输入正确的身份证'))
// }
// //检查省份
// if(checkProvince(value,vcity) === false){
// callback(new Error('请输入正确的身份证'))
// }
// //校验生日
// if(checkBirthday(value) === false){
// callback(new Error('请输入正确的身份证'))
// }
// //检验位的检测
// if(checkParity(value) === false){
// callback(new Error('请输入正确的身份证'))
// }
// }else {
// callback()
// }
// }
// 校验手机号
export const checkMobile = (rule, value, callback) => {
var reg = /^1[3|4|5|6|7|8|9][0-9]{9}$/; //验证规则
const flag = reg.test(value);
if(flag){
callback()
}else{
callback(new Error(`请输入正确的手机号码`))
}
}
import fetch from '../fetch';
import { getBaseUrl, getSaasDomain, getSaasApiDomain } from '@/utils/index'
import utils from '@/utils/followup/followupUtils';
const headers = {
sysCode: 9,
hospitalAuth:true
}
/*常量API*/
export const getConstants = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`basic-data/constants/`),
method: 'get',
params: params,
description: '获取常量',
})
// })
};
/*获取省市县乡列表*/
export const getProvinceList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`basic-data/position/provinces`),
method: 'get',
params: params,
description: '获取省列表',
})
// })
};
export const getCityList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`basic-data/position/cities`),
method: 'get',
params: params,
description: '获取市列表',
})
// })
};
export const getCountyList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`basic-data/position/counties`),
method: 'get',
params: params,
description: '获取区县列表',
})
// })
};
export const getTownList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`basic-data/position/towns`),
method: 'get',
params: params,
description: '获取乡镇列表',
})
// })
};
/*居民管理*/
export const getPatientList = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/infolist`),
method: 'post',
data: data,
description: '获取居民列表',
})
})
};
export const getDiseasesList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/diseases/-1`),
method: 'get',
params: params,
description: '获取所有疾病',
})
// })
};
// 新增居民
export const getQRCode = data => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/qrcodes/get`),
method: 'post',
data: data,
description: '获取二维码',
})
})
}
export const getUploadHistory = params => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/docImpPat/import/records`),
method: 'get',
params: params,
description: '获取上传历史记录',
})
})
}
export const refreshCode = data => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/qrcodes/refresh`),
method: 'post',
data: data,
description: '刷新二维码有效期',
})
})
}
export const getLabelsInfo = params => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/qrcodes/getLabelsInfo`),
method: 'get',
params: params,
description: '获取分组信息',
})
// })
}
export const downloadQRCode = data => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/qrcodes/shareUrl`),
method: 'post',
data: data,
description: '下载二维码',
})
})
}
export const uploadExcel = data => {
// return utils.checkAuth(()=>{
return fetch({
headers: {
noSysCode: true,
// hospitalAuth:true
},
url: getSaasDomain('web/patientManages/import'),
method: 'post',
data: data,
description: '上传excel文件',
})
// })
}
// 分组管理
export const getLabelList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/labels/`),
method: 'get',
params: params,
description: '获取分组列表',
})
// })
}
export const createNewLabel = (data) => {
return utils.checkAuth(()=>{
return fetch({
url: getBaseUrl(`healths/labels/`),
headers: {
"Content-Type": 'application/json',
hospitalAuth:true
},
method: 'post',
data: data,
description: '新增分组',
})
})
}
export const changeLabelName = (data) => {
return utils.checkAuth(()=>{
return fetch({
url: getBaseUrl(`healths/labels/`),
headers,
method: 'put',
data: data,
description: '修改分组名',
})
})
}
export const getLabelDetail = (labelId, params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/labels/v2/${labelId}/patients`),
method: 'get',
params: params,
description: '获取分组详情',
})
// })
}
export const deleteCurrentLabel = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/labels/`),
method: 'delete',
data: data,
description: '删除分组',
})
})
}
export const deleteCurrentPatients = data => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/labels/patients`),
method: 'delete',
data: data,
description: '删除分组下的居民',
})
})
}
export const saveLabelsForPatient = (labelId, data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/labels/v2/${labelId}/patients`),
method: 'post',
data: data,
description: '分组中添加居民',
})
})
}
// 获取七牛上传token
export const getQiniuToken = (params) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`file/image/token`),
method: 'get',
params: params,
})
})
};
// 意见反馈 getSaasApiDomain
export const submitFeedback = (data) => {
// return utils.checkAuth(()=>{
return fetch({
headers: {
noSysCode: true,
"Content-Type": 'application/json'
},
url: getSaasApiDomain(`web/companys/feedback`),
method: 'post',
data: data,
})
// })
};
/*资料不全居民*/
export const getNotCompleteList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/uncomplate/${params.pageNo}/${params.pageSize}`),
method: 'get',
description: '获取资料不全居民列表',
})
// })
};
export const sendCompleteMessage = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/remind`),
method: 'post',
data: data,
description: '提醒居民完善信息',
})
})
};
export const sendCompleteMessageList = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/list/remind`),
method: 'post',
data: data,
description: '批量提醒居民完善信息',
})
})
};
export const getNotCompleteCount = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/uncomplate/counts`),
method: 'get',
params: params,
description: '获取未完善居民人数',
})
// })
};
export const getRedNum = (params) => {
// 这个方法暂不做权限校验
return fetch({
headers,
url: getBaseUrl(`healths/patients/uncompleted/last/counts`),
method: 'get',
params: params,
description: '获取小红点数据',
})
};
export const getPatientDetail = (patientId) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/${patientId}`),
method: 'get',
// params: params,
description: '获取居民详情',
})
// })
};
export const deletePatient = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/batch`),
method: 'delete',
data: data,
description: '删除居民',
})
})
};
export const getRemindPatient = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/remind`),
method: 'post',
data: data,
description: '提醒居民绑定微信',
})
})
};
// 保存并新增
export const savePatientInfo = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/update`),
method: 'post',
data: data,
description: '保存居民信息',
})
})
};
export const getNationsList = (params) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`resident/constants/nations`),
method: 'get',
params: params,
description: '获取56个民族列表',
})
// })
};
export const getHealthRecordList = (data) => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`followup/entering/health/records`),
method: 'post',
data: data,
description: '健康档案记录列表',
})
// })
};
/*新的获取居民接口,搜索条件有变化*/
export const getPatientInfoList = (data) => {
return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`healths/patients/v2/infolist`),
method: 'post',
data: data,
description: '获取居民列表',
})
})
};
// 添加诊断:获取常用诊断列表
export const getCommonDiagnoseList = params => {
return fetch({
headers,
url: getBaseUrl(`medicineDictionary/icdCommonDiagnosis`),
method: 'get',
params: params,
description: '获取常用诊断列表',
})
}
// 添加诊断:搜索
export const goToSearch = params => {
return fetch({
headers,
url: getBaseUrl(`medicineDictionary/icdContents`),
method: 'get',
params: params,
description: '常用诊断搜索',
})
}
// 选择或搜索诊断
export const getIcdList = params => {
return fetch({
headers,
url: getBaseUrl(`healths/icd/list`),
// url: 'http://sosoapi.yunqueyi.com/sosoapi-web/pass/mock/46/healths/icd/list',
method: 'get',
params: params,
description: '选择或搜索诊断',
})
}
//手动添加埋点
export const postTrace = (actionName, viewPath) => {
let para = {
"datas": [
{
"pseudo_session": "",
"pseudo_id": "",
"class_name": "test-compontens",
"action": actionName, //"ACTION_WEB_ENTER"
"view_path": viewPath,//"http://10.177.11.248:8080/"
"created": new Date().getTime(),//"1568685179301"
"user_token": "",
"mobile": "",
"doctor_id": "",
"device_brand": "",
"device_model": "",
"app_version": "",
"device_type": "1",
"device_ip": "",
"web_data": {
},
"alternate_info": "",
"extra_info": "",
"web_data_type": "2"
}
]
}
return fetch({
headers,
url: getBaseUrl(`file/log/trace1`),
method: 'post',
data: para,
description: '手动添加埋点',
})
}
import {isEmptyUtils, isNotEmptyUtils, subString} from "./utils";
import fetchQiniu from './fetch-qiniu.js';
import { getQiniuToken1, uploadVideo, uploadImg } from './index'
let fileApiUrl = getQiniuToken1()
//该对象有一个 unsubscribe 方法取消订阅,同时终止上传行为。
let subscription = null;
//上传返回结果
let result = {
key: null,//文件保存在空间中的资源名
path: null,//保存到db的路径(不带域名)
fullPath: null,//文件网络路径(文件url)
size: null,//资源尺寸,单位为字节
name: null,//原始文件名
ext: null//上传资源的后缀名,通过自动检测的mimeType 或者原文件的后缀来获取
};
//上传状态
// var status = false;
//FIXME 请注意vue里面不要使用全局变量
let domain = uploadVideo() // 视频
let domain1 = uploadImg() // 图片
let errorCode = new Map([
[298,'部分操作执行成功'],
[400,'请求报文格式错误'],
[401,'认证授权失败'],
[403,'权限不足,拒绝访问。'],
[404,'资源不存在'],
[405,'请求方式错误'],
[406,'上传的数据 CRC32 校验错误'],
[413,'请求资源大小大于指定的最大值'],
[419,'用户账号被冻结'],
[478,'镜像回源失败'],
[502,'错误网关'],
[503,'服务端不可用'],
[504,'服务端操作超时'],
[573,'单个资源访问频率过高'],
[579,'上传成功但是回调失败'],
[599,'服务端操作失败'],
[608,'资源内容被修改'],
[612,'指定资源不存在或已被删除'],
[614,'目标资源已存在'],
[630,'已创建的空间数量达到上限,无法创建新空间。'],
[631,'指定空间不存在'],
[640,'调用列举资源(list)接口时,指定非法的marker参数。'],
[701,'在断点续上传过程中,后续上传接收地址不正确或ctx信息已过期。']
]);
let qiniuErrorCheck = function (code) {
errorCode.forEach(function (value, key, map) {
if (code === key){
console.error(key+':'+value)
}
})
}
//用来限制上传文件类型,为 null 时表示不对文件类型限制;限制类型放到数组里: ["image/png", "image/jpeg", "image/gif"]
let mimeTypeArray = null;
export const createFilePath = (file, fileName) => {
if (isEmptyUtils(file)) {
return null;
}
let arr = fileName.split('_');
if(arr.length != 4){
alert('上传视频文件名格式不正确');
return null;
}
let arr4 = arr[3].split('.');
//文件全路径(文件路径 + 文件名) 扩展名​/年/月/日/
let filePath = arr[0] + "/" + arr[1] + "/" + arr[2] + "_" + arr4[0] + '.'+arr4[1];
console.log(filePath);
return filePath;
};
/**
* 获取七牛上传凭证
*
* @return {Promise} token 七牛上传凭证
* */
const doQiniuAction1 = (fileType) => {
console.log('send---'+fileApiUrl);
return new Promise(function (resolve, reject) {
// if(isEmptyUtils(localStorage.getItem('qiniuToken'))){
fetchQiniu(fileApiUrl, {"fileType": fileType}, 'GET').then(function (result) {
let token = null;
if (isNotEmptyUtils(result) && result.code == "000000") {
token = result.data.qiniuToken;
resolve(token);
console.log('七牛临时授权成功');
localStorage.setItem('qiniuToken',token);
} else {
reject(result);
console.error('七牛临时授权失败:', result);
}
}).catch(function (error) {
reject();
console.error('七牛临时授权失败:', error);
});
// }else{
// console.log('从localStorage获取token:'+localStorage.getItem('qiniuToken'))
// resolve(localStorage.getItem('qiniuToken'));
// }
});
};
/**
*
* @param self
* @param file
* @param filePath
* @param previewId
* @param progressId
* @returns {Promise}
*/
export const qiniuUpload = (self, file, filePath, previewId, progressId) => {
// var deferred = $q.defer();
return new Promise(function (resolve, reject) {
if (isEmptyUtils(file) || isEmptyUtils(filePath)) {
console.error('七牛上传失败:非法参数');
reject();
}
let key = filePath ? filePath : getFilePath(file);
//修改状态为上传
self.qiniuUploadStatus = true;
// let token = "BRVB4TpxVFA5Wo6lIpfltmWKOltzGar46tvC3BlR:UHn0LDElwjP4jEZTXdq_1qV6_hw=:eyJzY29wZSI6InBpY2EtdGVzdCIsInJldHVybkJvZHkiOiJ7XCJrZXlcIjpcIiQoa2V5KVwiLFwiaGFzaFwiOlwiJChldGFnKVwiLFwiYnVja2V0XCI6XCIkKGJ1Y2tldClcIixcImZzaXplXCI6JChmc2l6ZSksXCJmbmFtZVwiOiQoZm5hbWUpLFwiZXh0XCI6JChleHQpfSIsImRlYWRsaW5lIjoxNTI5NDk0MTc1fQ==";
doQiniuAction().then(function (token) {
let putExtra = {
fname: file.name, //原文件名
params: {}, //用来放置自定义变量
mimeType: mimeTypeArray || null //null || array,用来限制上传文件类型,为 null 时表示不对文件类型限制;限制类型放到数组里: ["image/png", "image/jpeg", "image/gif"]
};
let config = {
useCdnDomain: true, //表示是否使用 cdn 加速域名,为布尔值,true 表示使用,默认为 false。
region: null //选择上传域名区域;当为 null 或 undefined 时,自动分析上传域名区域
};
/*
* qiniu.upload 返回一个 observable 对象用来控制上传行为,observable 对像通过 subscribe 方法可以被 observer 所订阅,
* 订阅同时会开始触发上传,同时返回一个 subscription 对象,该对象有一个 unsubscribe 方法取消订阅,同时终止上传行为。
* */
let observable = qiniu.upload(file, key, token, putExtra, config);
/**
* 接收上传进度信息,res 参数是一个带有 total 字段的 object,包含loaded、total、percent三个属性,提供上传进
* total.loaded: number,已上传大小,单位为字节。
* total.total: number,本次上传的总量控制信息,单位为字节,注意这里的 total 跟文件大小并不一致。
* total.percent: number,当前上传进度,范围:0~100
* */
let next = function (res) {
//res值{"total":{"loaded":18184,"size":18185,"percent":99.99450096233159}}
//获取百分比进度
let progress = res.total.percent.toFixed(2);
self.uploadProgress = Number(progress);
console.log('Progress: ' + progress);
//如果有进度条
/*if (isNotEmptyUtils(progressId)) {
let obj = $("#" + progressId);
//开始上传时,显示进度条
if (isNotEmptyUtils(obj.parent())) {
//修改状态为上传
// status = true;
self.qiniuUploadStatus = true;
obj.parent().removeClass("hidden");
obj.fadeIn("fast");
}
obj.css("width", progress + '%');
obj.text(progress + '%');
//上传完成,2秒后淡出进度条
if (progress === "100.00") {
//修改状态为非上传
// status = false;
self.qiniuUploadStatus = true;
obj.fadeOut(2000);
}
}*/
};
/**
* 接收上传完成后的后端返回信息,res 参数为一个 object, 为上传成功后后端返回的信息
* ,具体返回结构取决于后端sdk的配置,可参考上传策略(https://developer.qiniu.com/kodo/manual/1206/put-policy)
* */
let complete = function (res) {
console.log("七牛上传完成");
setTimeout(function(){
result.key = res.key;
result.path = '/' + res.key;
result.fullPath = domain + '/' + res.key + '?v=' + new Date().getTime();
result.size = res.fsize;
result.name = res.fname ;
result.ext = res.ext;
// deferred.resolve(result);
resolve(result);
// self.model.qCloudUrl = result.fullPath;
// $("#introVideoLecture").attr("src", self.model.qCloudUrl);
//修改状态为非上传
// status = false;
self.qiniuUploadStatus = false;
if (isNotEmptyUtils(previewId)) {
let address = domain + result.path;
console.log('文件路径: ' + address);
//显示图片
let $img = $('<img>').attr("src", address);
let obj = $("#" + previewId);
obj.empty().append($img);
obj.css('max-width', '100%');
}
},2000);
};
/**
* 上传错误后触发,当不是 xhr 请求错误时,会把当前错误产生原因直接抛出,诸如 JSON 解析异常等;当产生 xhr 请求错误时,参数 err 为一个包含 code、message、isRequestError 三个属性的 object:
* err.isRequestError: 用于区分是否 xhr 请求错误;当 xhr 请求出现错误并且后端通过 HTTP 状态码返回了错误信息时,该参数为 true;否则为 undefined 。
* err.reqId: string,xhr请求错误的 X-Reqid。
* err.code: number,请求错误状态码,只有在 err.isRequestError 为 true 的时候才有效,可查阅码值对应说明。
* err.message: string,错误信息,包含错误码,当后端返回提示信息时也会有相应的错误信息。
* */
let error = function (err) {
//修改状态为非上传
// status = false;
self.qiniuUploadStatus = false
localStorage.removeItem('qiniuToken');
console.log("七牛上传失败,详细信息请参考:https://developer.qiniu.com/kodo/api/3928/error-responses");
//输出简略错误信息
if (err.isRequestError){
qiniuErrorCheck(err.code)
}else {
console.error(err);
}
/*modalClick("提示", "上传失败!", "确定", function () {
$('#model-modify').modal('hide');
}, "", null);*/
// deferred.reject(new Error('七牛上传失败'));
// return deferred.promise;
return reject(new Error('七牛上传失败'));
};
// 上传开始
subscription = observable.subscribe(next, error, complete);
});
// return deferred.promise;
});
};
/**
* 获取时间戳
* @param {Date} [date]日期对象,为空时,返回当前时间戳
* @return {String} timeStamp时间戳 格式:yyyyMMddhhmmssS
*/
const timeStamp = (date) => {
if (isEmptyUtils(date)) {
return new Date().format('yyyyMMddhhmmssS');
}
return date.format('yyyyMMddhhmmssS');
}
/**
* 获取全局唯一标识符(GUID,Globally Unique Identifier)
* @return {String} guid
*/
const guid = () => {
/**
* @return {String}
*/
function S4() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
}
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
};
/**
* 文件重命名--七牛图片 2018 11
* @param {File} [file] 上传文件对象
* @param {String} [fileName] 指定文件名
* @param {String} [folder] 指定文件夹
* @return {String} fileName
*/
export const getFilePath = (file,fileName,folder) => {
if (isEmptyUtils(file)) {
return null;
}
//文件类型
var ext = file.type;
//后缀名
var suffix = file.name.substring(file.name.lastIndexOf(".") + 1);
//若为空则从name中获取---对wps格式的文件获取不到file.type
if (isEmptyUtils(ext)) {
ext = suffix;
}
//获取当前日期对象
var date = new Date();
if (isEmptyUtils(fileName)) {
//重命名后的文件名
fileName = timeStamp(date) + "-" + subString(guid(), 8) + "." + suffix;
}
//文件全路径(文件路径 + 文件名) 扩展名​/年/月/日/
// var filePath = ext + "/" + date.format('yyyy/MM/dd') + "/" + (isEmptyUtils(folder) ? "" : (folder + "/")) + fileName;
//var filePath = ext + "/" + "common/" + file.name.split('.')[0] + '-' + timeStamp(date) + "." + suffix;
var filePath = ext + "/" + "protal/project/" + timeStamp(date) + "." + suffix;
console.log('filePath==============',filePath);
return filePath;
}
/**
*七牛上传图片、视频、文件 2018 11 hws
* @param self
* @param file
* @param filePath
* @param previewId
* @param progressId
* @param fileType 1--图片和文件 空为视频
* @returns {Promise}
*/
export const doUpload = (self,file, filePath, previewId,progressId, fileType) => {
// var deferred = $q.defer();
return new Promise(function (resolve, reject) {
if (isEmptyUtils(file) || isEmptyUtils(filePath)) {
console.error('七牛上传失败:非法参数');
reject();
}
let key = filePath ? filePath : getFilePath(file);
//修改状态为上传
self.qiniuUploadStatus = true;
// let token = "BRVB4TpxVFA5Wo6lIpfltmWKOltzGar46tvC3BlR:UHn0LDElwjP4jEZTXdq_1qV6_hw=:eyJzY29wZSI6InBpY2EtdGVzdCIsInJldHVybkJvZHkiOiJ7XCJrZXlcIjpcIiQoa2V5KVwiLFwiaGFzaFwiOlwiJChldGFnKVwiLFwiYnVja2V0XCI6XCIkKGJ1Y2tldClcIixcImZzaXplXCI6JChmc2l6ZSksXCJmbmFtZVwiOiQoZm5hbWUpLFwiZXh0XCI6JChleHQpfSIsImRlYWRsaW5lIjoxNTI5NDk0MTc1fQ==";
doQiniuAction1(fileType).then(function (token) {
let putExtra = {
fname: file.name, //原文件名
params: {}, //用来放置自定义变量
mimeType: mimeTypeArray || null //null || array,用来限制上传文件类型,为 null 时表示不对文件类型限制;限制类型放到数组里: ["image/png", "image/jpeg", "image/gif"]
};
let config = {
useCdnDomain: true, //表示是否使用 cdn 加速域名,为布尔值,true 表示使用,默认为 false。
region: null //选择上传域名区域;当为 null 或 undefined 时,自动分析上传域名区域
};
/*
* qiniu.upload 返回一个 observable 对象用来控制上传行为,observable 对像通过 subscribe 方法可以被 observer 所订阅,
* 订阅同时会开始触发上传,同时返回一个 subscription 对象,该对象有一个 unsubscribe 方法取消订阅,同时终止上传行为。
* */
let observable = qiniu.upload(file, key, token, putExtra, config);
/**
* 接收上传进度信息,res 参数是一个带有 total 字段的 object,包含loaded、total、percent三个属性,提供上传进
* total.loaded: number,已上传大小,单位为字节。
* total.total: number,本次上传的总量控制信息,单位为字节,注意这里的 total 跟文件大小并不一致。
* total.percent: number,当前上传进度,范围:0~100
* */
let next = function (res) {
//res值{"total":{"loaded":18184,"size":18185,"percent":99.99450096233159}}
//获取百分比进度
let progress = res.total.percent.toFixed(2);
self.uploadProgress = Number(progress);
if(progressId == 'uploadProgress1') {
self.uploadProgress1 = Number(progress);
}
if(progressId == 'uploadProgress2') {
self.uploadProgress2 = Number(progress);
}
console.log('Progress: ' + progress);
//如果有进度条
/*if (isNotEmptyUtils(progressId)) {
let obj = $("#" + progressId);
//开始上传时,显示进度条
if (isNotEmptyUtils(obj.parent())) {
//修改状态为上传
// status = true;
self.qiniuUploadStatus = true;
obj.parent().removeClass("hidden");
obj.fadeIn("fast");
}
obj.css("width", progress + '%');
obj.text(progress + '%');
//上传完成,2秒后淡出进度条
if (progress === "100.00") {
//修改状态为非上传
// status = false;
self.qiniuUploadStatus = true;
obj.fadeOut(2000);
}
}*/
};
/**
* 接收上传完成后的后端返回信息,res 参数为一个 object, 为上传成功后后端返回的信息
* ,具体返回结构取决于后端sdk的配置,可参考上传策略(https://developer.qiniu.com/kodo/manual/1206/put-policy)
* */
let complete = function (res) {
console.log("七牛上传完成");
setTimeout(function(){
result.key = res.key;
result.path = '/' + res.key;
// result.fullPath = domain + '/' + res.key + '_' + new Date().getTime();
if(!fileType) { // 图片 文件
console.log('---domain-------',domain)
result.fullPath = domain + '/' + res.key;
}else{ // 视频
console.log('----domain1------',domain1)
result.fullPath = domain1 + '/' + res.key;
}
result.size = res.fsize;
result.name = res.fname ;
result.ext = res.ext;
// deferred.resolve(result);
resolve(result);
// self.model.qCloudUrl = result.fullPath;
// $("#introVideoLecture").attr("src", self.model.qCloudUrl);
//修改状态为非上传
// status = false;
self.qiniuUploadStatus = false;
// if (isNotEmptyUtils(previewId)) {
// let address = domain + result.path;
// console.log('文件路径: ' + address);
// //显示图片
// let uplodImg = $('<img>').attr("src", address);
// let obj = $("#" + previewId);
// obj.empty().append(uplodImg);
// obj.css('max-width', '100%');
// }
},500);
};
/**
* 上传错误后触发,当不是 xhr 请求错误时,会把当前错误产生原因直接抛出,诸如 JSON 解析异常等;当产生 xhr 请求错误时,参数 err 为一个包含 code、message、isRequestError 三个属性的 object:
* err.isRequestError: 用于区分是否 xhr 请求错误;当 xhr 请求出现错误并且后端通过 HTTP 状态码返回了错误信息时,该参数为 true;否则为 undefined 。
* err.reqId: string,xhr请求错误的 X-Reqid。
* err.code: number,请求错误状态码,只有在 err.isRequestError 为 true 的时候才有效,可查阅码值对应说明。
* err.message: string,错误信息,包含错误码,当后端返回提示信息时也会有相应的错误信息。
* */
let error = function (err) {
//修改状态为非上传
// status = false;
self.qiniuUploadStatus = false
localStorage.removeItem('qiniuToken');
console.log("七牛上传失败,详细信息请参考:https://developer.qiniu.com/kodo/api/3928/error-responses");
//输出简略错误信息
if (err.isRequestError){
qiniuErrorCheck(err.code)
}else {
console.error(err);
}
/*modalClick("提示", "上传失败!", "确定", function () {
$('#model-modify').modal('hide');
}, "", null);*/
// deferred.reject(new Error('七牛上传失败'));
// return deferred.promise;
return reject(new Error('七牛上传失败'));
};
// 上传开始
subscription = observable.subscribe(next, error, complete);
});
// return deferred.promise;
});
};
(function(doc, win) {
var docEl = doc.documentElement || doc.body,
htmlDom = doc.getElementsByTagName('html')[0],
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function() {
var clientWidth = docEl.clientWidth
if (!clientWidth) return
// docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
htmlDom.style.fontSize = clientWidth / 10 + 'px'
};
if (!doc.addEventListener) return
win.addEventListener(resizeEvt, recalc, false)
doc.addEventListener('DOMContentLoaded', recalc, false)
})(document, window)
\ No newline at end of file
import axios from 'axios';
// 对象的合并
export const containObject = function(...obj1) {
let obj = Object.assign(...obj1)
return obj
}
// 获取页面自适应高度
export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'slidebar-container',
containerHeightId = 'screenSet'){
let containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 15
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
window.onresize = function() {
containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 15
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
}
}
function p_getElm(elmId){
return document.getElementById(elmId)
}
//共通函数
Array.prototype.contains = function (obj) {
if (this.length > 0) {
for (let i = 0; i < this.length; i++) {
if (obj === this[i]) {
return true;
}
}
}
return false;
};
Array.prototype.remove = function (obj) {
if (this.contains(obj)) {
for (let i = 0; i < this.length; i++) {
if (obj === this[i]) {
this.splice(i, 1);
break;
}
}
}
return this;
};
// 时间处理
Date.prototype.format = function (fmt) { // author: meizz
let o = {
"M+": this.getMonth() + 1, // 月份
"d+": this.getDate(), // 日
"h+": this.getHours(), // 小时
"m+": this.getMinutes(), // 分
"s+": this.getSeconds(), // 秒
"q+": Math.floor((this.getMonth() + 3) / 3), // 季度
"S": this.getMilliseconds()
// 毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "")
.substr(4 - RegExp.$1.length));
for (let k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
};
/**
* base64编码
* @param {Object} str
*/
export const base64encode = (str) => {
let base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
let out, i, len;
let c1, c2, c3;
len = str.length;
i = 0;
out = "";
while (i < len) {
c1 = str.charCodeAt(i++) & 0xff;
if (i == len) {
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt((c1 & 0x3) << 4);
out += "==";
break;
}
c2 = str.charCodeAt(i++);
if (i == len) {
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt((c2 & 0xF) << 2);
out += "=";
break;
}
c3 = str.charCodeAt(i++);
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
out += base64EncodeChars.charAt(c3 & 0x3F);
}
return out;
};
/**
* base64解码
* @param {Object} str
*/
export const base64decode = (str) => {
let base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
let c1, c2, c3, c4;
let i, len, out;
len = str.length;
i = 0;
out = "";
while (i < len) {
/* c1 */
do {
c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
}
while (i < len && c1 == -1);
if (c1 == -1)
break;
/* c2 */
do {
c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
}
while (i < len && c2 == -1);
if (c2 == -1)
break;
out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
/* c3 */
do {
c3 = str.charCodeAt(i++) & 0xff;
if (c3 == 61)
return out;
c3 = base64DecodeChars[c3];
}
while (i < len && c3 == -1);
if (c3 == -1)
break;
out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
/* c4 */
do {
c4 = str.charCodeAt(i++) & 0xff;
if (c4 == 61)
return out;
c4 = base64DecodeChars[c4];
}
while (i < len && c4 == -1);
if (c4 == -1)
break;
out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
}
return out;
};
/**
* 时间秒数格式化
* @param s 时间戳(单位:秒)
* @returns {*} 格式化后的时分秒
*/
export const secToTime = (s) => {
let t = "";
if (s > -1) {
// let hour = Math.floor(s/3600);
let min = Math.floor(s / 60) % 60;
let sec = s % 60;
// if(hour < 10) {
// t = '0'+ hour + ":";
// } else {
// t = hour + ":";
// }
if (min < 10) {
t += "0";
}
t += min + ":";
if (sec < 10) {
t += "0";
}
t += sec.toFixed(0);
}
return t;
};
/**
* 校验对象是否为空
* */
export const isNotEmptyUtils = (obj) => {
if ("" == obj || null == obj || undefined == obj || "null" == obj) {
return false;
}
return true;
};
/**
* 校验对象是否为空
* */
export const isEmptyUtils = (obj) => {
return !isNotEmptyUtils(obj);
};
/**
* 校验数组是否为空
* */
export const isEmptyList = (list) => {
return (isEmptyUtils(list) || !(list instanceof Array) || list.length === 0);
};
/**
* 校验数组是否为空
* */
export const isNotEmptyList = (list) => {
return !isEmptyList(list);
};
/**
* 校验对象是否只包含数字0~9
* * @param {String} [obj] 校验对象
* */
export const isNumber = (obj) => {
return (obj != null && obj.toString().match('^[0-9]*$') != null);
};
// 获取用户系统信息start
const detectOS = () => {
let sUserAgent = navigator.userAgent;
let isWin = (navigator.platform == "Win32")
|| (navigator.platform == "Windows");
let isMac = (navigator.platform == "Mac68K")
|| (navigator.platform == "MacPPC")
|| (navigator.platform == "Macintosh")
|| (navigator.platform == "MacIntel");
if (isMac)
return "Mac";
let isUnix = (navigator.platform == "X11") && !isWin && !isMac;
if (isUnix)
return "Unix";
let isLinux = (String(navigator.platform).indexOf("Linux") > -1);
if (isLinux)
return "Linux";
let isIos = (sUserAgent.indexOf("Mac OS X") > -1);
if (isIos)
return "Mac";
if (isWin) {
let isWinXP = sUserAgent.indexOf("Windows NT 5.1") > -1
|| sUserAgent.indexOf("Windows XP") > -1;
if (isWinXP)
return "WinXP";
let isWinVista = sUserAgent.indexOf("Windows NT 6.0") > -1
|| sUserAgent.indexOf("Windows Vista") > -1;
if (isWinVista)
return "WinVista";
let isWin7 = sUserAgent.indexOf("Windows NT 6.1") > -1
|| sUserAgent.indexOf("Windows 7") > -1;
if (isWin7)
return "Win7";
let isWin8_1 = sUserAgent.indexOf("Windows NT 6.2") > -1
|| sUserAgent.indexOf("Windows 8") > -1;
let isWin8_2 = sUserAgent.indexOf("Windows NT 6.3") > -1
|| sUserAgent.indexOf("Windows 8.1") > -1;
if (isWin8_1 || isWin8_2)
return "Win8";
let isWin10_1 = sUserAgent.indexOf("Windows NT 6.4") > -1
|| sUserAgent.indexOf("Windows 10") > -1;
let isWin10_2 = sUserAgent.indexOf("Windows NT 10.0") > -1
|| sUserAgent.indexOf("Windows 10") > -1;
if (isWin10_1 || isWin10_2)
return "Win10";
}
return "other";
};
// 获取用户浏览器信息
const getBrowser = () => {
let OsObject = "未知";
if (navigator.userAgent.indexOf("MSIE") > 0 && navigator.userAgent.indexOf("compatible") > -1) { //<ie11
return "IE";
}
if (navigator.userAgent.indexOf("Trident") > 0 && navigator.userAgent.indexOf("rv:11.0") > -1) { //ie11
return "IE";
}
if (navigator.userAgent.indexOf("Firefox") > 0) {
return "Firefox";
}
if (navigator.userAgent.indexOf("Chrome") > 0) {
return "Chrome";
}
if (navigator.userAgent.indexOf("Safari") > 0) {
return "Safari";
}
if (navigator.userAgent.indexOf("Gecko") > 0) {
return "Firefox";
}
if (navigator.userAgent.indexOf("360") > 0) {
return "360";
}
return OsObject;
};
const GetLocalIPAddress = () => {
// let url ='http://counter.sina.com.cn/ip/';
// let url ='http://chaxun.1616.net/s.php?type=ip&output=json&callback=?&_='+Math.random();
// let ip = "";
// $.getJSON(url, function(data){
// localStorage.setItem("ipAddress",data.Ip);
// // check();
// });
// $.getScript('http://pv.sohu.com/cityjson?ie=utf-8', function () {
return returnCitySN["cip"];
// });
// return ip;
};
// 获取用户终端信息
const getTerminalType = () => {
let brow = "unknown";
// alert(navigator.userAgent);
if (navigator.userAgent.indexOf('iPad') > -1) {
// alert("iPad");
return brow = "iPad";
}
if (navigator.userAgent.indexOf('Android') > -1
|| navigator.userAgent.indexOf('Linux') > -1) {
// alert("Android");
return brow = "android";
}
if (navigator.userAgent.indexOf('iPhone') > -1
// || navigator.userAgent.indexOf('Mac') > -1
) {
// alert("iPhone");
return brow = "iPhone";
}
if (navigator.userAgent.indexOf('Trident') > -1) {
// alert("Trident");
return brow = "PC";
}
if (navigator.userAgent.indexOf('Presto') > -1) {
// alert("Presto");
return brow = "PC";
}
if (navigator.userAgent.indexOf('Chrome') > -1) {
// alert("Chrome");
return brow = "PC";
}
if (navigator.userAgent.indexOf('AppleWebKit') > -1) {
// alert("AppleWebKit");
return brow = "iPad";
}
if (navigator.userAgent.indexOf('Gecko') > -1
&& navigator.userAgent.indexOf('KHTML') == -1) {
// alert("Gecko");
return brow = "PC";
}
if (navigator.userAgent.indexOf("Mac OS X") > -1) {
// alert("ios");
return brow = "ios";
}
if (navigator.userAgent.indexOf('Safari') == -1) {
// alert("Safari");
return brow = "PC";
}
return brow;
};
const initEnvironment = () => {
let OS = detectOS();
let browser = getBrowser();
let ip = GetLocalIPAddress();
let terminalType = getTerminalType();
localStorage.setItem("OS", OS);
localStorage.setItem("browser", browser);
localStorage.setItem("ipAddress", ip);
localStorage.setItem("terminalType", terminalType);
};
/**
* str数据字符串,split分隔符
* @param {String} [str] 当前vue对象
* @param {String} [split] 当前vue对象
* @return{Array} [array]
* */
export const stringToArr = (str, split) => {
if (isEmptyUtils(str) || isEmptyUtils(split) || str.indexOf(split) === -1) {
return [str];
} else {
return str.split(split);
}
};
//单点登录--start
/**
* str数据字符串,split分隔符
* @param {String} [str] url参数部分
* @param {String} [split] 分隔符
* @return{Array} [parArr] 返回键值对list
* */
const getUrlParams = (str, split) => {
let parArr = [];
if (isEmptyUtils(str) || isEmptyUtils(split) || str.indexOf(split) === -1) {
return parArr;
} else {
let parMapArray = str.split(split);
if (parMapArray.length > 0) {
for (let i = 0; i < parMapArray.length; i++) {
if (parMapArray[i].indexOf("=") > -1) {
let item = parMapArray[i].split("=");
let par = {};
par[item[0]] = item[1];
parArr.push(par);
}
}
}
return parArr;
}
};
/**
* str数据字符串,split分隔符
* @param {String} [str] url参数部分
* @param {String} [split] 分隔符
* @return{Map} [parMap] 返回键值对Map
* */
export const getUrlParamsMap = (str, split) => {
let parMap = new Map();
if (isEmptyUtils(str) || isEmptyUtils(split) || str.indexOf(split) === -1) {
return parMap;
} else {
let parMapArray = str.split(split);
if (parMapArray.length > 0) {
for (let i = 0; i < parMapArray.length; i++) {
if (parMapArray[i].indexOf("=") > -1) {
let item = parMapArray[i].split("=");
parMap[item[0]] = item[1];
}
}
}
return parMap;
}
};
export const ssoLogin = (href, paramMap) => {
console.log("ssoLogin开始");
if (isNotEmptyUtils(paramMap)) {
if (isNotEmptyUtils(paramMap)) {
for (var param in paramMap) {
localStorage.setItem(param, paramMap[param]);
}
}
//获取用户系统信息
initEnvironment();
}
};
export const ssoLogin2 = () => { //单独部署不走saas端登录
console.log("ssoLogin2开始");
//获取用户系统信息
initEnvironment();
};
export const getDeviceInfo = () => { //系统信息,获取验证码时有用到
return {
device_brand: localStorage.getItem('terminalType'),
device_type: 1,
system_level: localStorage.getItem('OS'),
device_ip: localStorage.getItem('ipAddress'),
browser_ver: localStorage.getItem('browser')
}
};
//单点登录--end
//退出登录,跳转到登录页面
export const logout = () => {
let url = localStorage.getItem("Url");
let logoutUrl = localStorage.getItem("logoutUrl");
let ssoLoginUrl = localStorage.getItem("ssoLogin");
let ssoOriginUrl = localStorage.getItem("ssoOrigin");
console.log('logoutUrl:'+logoutUrl)
/* alert("ssoLogin Url:"+ ssoLoginUrl)
alert("logOut url:" + logoutUrl)
alert("ssoOrigin url:" + ssoOriginUrl);*/
localStorage.clear();
localStorage.setItem("Url", url);
localStorage.setItem("logoutUrl", logoutUrl);
localStorage.setItem("ssoLogin", ssoLoginUrl);
localStorage.setItem("ssoOrigin", ssoOriginUrl);
if (isEmptyUtils(logoutUrl)) {
if(isEmptyUtils(ssoLoginUrl)){
window.location.href = localStorage.getItem("ssoOrigin")
+ "/PICA_SSO_FE/html/pica_login.html";
}else{
window.location.href = localStorage.getItem("ssoLogin");
}
} else {
// window.location.href = logoutUrl;
window.location.href = localStorage.getItem("ssoOrigin")
+ "/PICA_SSO_FE/html/pica_login.html";
}
};
/**
* 消息提示 确定或取消
* @param {Object} [self] 当前vue对象
* @param {String} [title] 标题
* @param {String} [content] 内容
* @param {String} [confirmButton] 确认按钮文字
* @param {Function} [confirmFunction] 按下确按钮认时,执行的函数
* @param {String} [cancelButton] 取消按钮文字
* @param {Function} [cancelFunction] 按取消按钮认时,执行的函数
* @param {String} [messageType] 消息类型 success,info,warning,error
* */
export const messageBox = (self, title, content, confirmButton, confirmFunction, cancelButton, cancelFunction, messageType) => {
let titleText = title ? title : '提示';
let contentText = content ? content : '';
let confirmButtonText = confirmButton ? confirmButton : '确定';
let type = messageType ? messageType : 'info';
let typeArray = ["error", "warning", "info", "success"];
if (!typeArray.contains(type)) {
type = "info";
}
if (isNotEmptyUtils(cancelButton)) {
self.$confirm(contentText, titleText, {
confirmButtonText: confirmButtonText,
cancelButtonText: cancelButton,
type: type
}).then(() => {
// self.$message({
// type: 'success',
// message: '删除成功!'
// });
if (confirmFunction instanceof Function) {
confirmFunction();
}
}).catch(() => {
// self.$message({
// type: 'info',
// message: '已取消删除'
// });
if (cancelFunction instanceof Function) {
cancelFunction();
}
});
} else {
self.$alert(contentText, titleText, {
confirmButtonText: confirmButtonText,
type: type,
callback: action => {
// self.$message({
// type: 'info',
// message: `action: ${ action }`
// });
if (confirmFunction instanceof Function) {
confirmFunction();
}
}
});
}
};
/**
* 消息提示(支持html内容) 确定或取消
* @param {Object} [self] 当前vue对象
* @param {String} [title] 标题
* @param {String} [content] 内容
* @param {String} [confirmButton] 确认按钮文字
* @param {Function} [confirmFunction] 按下确按钮认时,执行的函数
* @param {String} [cancelButton] 取消按钮文字
* @param {Function} [cancelFunction] 按取消按钮认时,执行的函数
* @param {String} [messageType] 消息类型 success,info,warning,error
* */
export const htmlMessageBox = (self, title, content, confirmButton, confirmFunction, cancelButton, cancelFunction, messageType) => {
let titleText = title ? title : '提示';
let contentText = content ? content : '';
let confirmButtonText = confirmButton ? confirmButton : '确定';
let type = messageType ? messageType : 'info';
let typeArray = ["error", "warning", "info", "success"];
if (!typeArray.contains(type)) {
type = "info";
}
// debugger
if (isNotEmptyUtils(cancelButton)) {
self.$confirm(contentText, titleText, {
confirmButtonText: confirmButtonText,
cancelButtonText: cancelButton,
dangerouslyUseHTMLString: true,//是否将 message 属性作为 HTML 片段处理
type: type
}).then(() => {
if (confirmFunction instanceof Function) {
confirmFunction();
}
}).catch(() => {
if (cancelFunction instanceof Function) {
cancelFunction();
}
});
} else {
self.$alert(contentText, titleText, {
confirmButtonText: confirmButtonText,
dangerouslyUseHTMLString: true,//是否将 message 属性作为 HTML 片段处理
type: type,
callback: action => {
// self.$message({
// type: 'info',
// message: `action: ${ action }`
// });
if (confirmFunction instanceof Function) {
confirmFunction();
}
}
});
}
};
/**
*请求失败时判断
*
* @param {Object} [error] 后台返回的信息
* @param {Object} [self] 当前vue对象
* */
export const errorResponseCheck = (error, self) => {
closeLoading(self);
console.log(error);
setTimeout(function () {
let code = error ? (error.response ? error.response.data : 0) : 0;
// console.log("请求失败:%s", code);
if (code == '40011') {
messageBox(self, "登录", "登录失效,请重新登录!", "是", function () {
logout();
}, "", null);
setTimeout(function () {
logout();
}, 2000);
} else if (code == '40013') {
messageBox(self, "提示", "刷新太过频繁,休息一下!", "是", function () {
}, "", null);
// setTimeout(function () {
//
// }, 2000);
} else {
//sendErrorReport(code);
// messageBox(self, "提示", "操作失败!", "确定", function () {
//
// }, "", null, "error");
self.$message.error("操作失败");
}
}, 100)
};
//截位
export const subString = (obj, int) => {
if (isEmptyUtils(obj) || isEmptyUtils(int)) {
return "";
}
if (obj.length <= int) {
return obj;
} else {
obj = obj.substring(0, int);
}
return obj;
};
/**
* 打开loading
* @param {Object} [self] 当前this对象
* @return 当前loading对象
* */
export const openLoading = (self) => {
const options = {
lock: true,
text: 'Loading',
// target:'#bodyContent',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
};
self.elLoadingId = self.$loading(options);
return self.elLoadingId;
};
/**
* 关闭loading
* @param {Object} [self] 当前this对象
* @return 当前loading对象
* */
export const closeLoading = (self) => {
if (self.elLoadingId) {
self.elLoadingId.close();
}
};
/**
* 获取常量集合
*
*
* @param {Object} [self] 当前this对象
* @param {Object} [codeObject] 例如:codeObject={list1:"P097",list2:"P097"}
* */
export const getConstantList = (self, codeObject) => {
if (!codeObject instanceof Object) {
return;
}
let req = {
params: {
numMap: JSON.stringify(codeObject)
}
};
self.$axios.get(
localStorage.getItem("msUrl") + "constants"
, req
).then(function (res) {
let map = JSON.parse(JSON.stringify(res.data.data));//通过这个实现深拷贝
for (let key in map) {
self[key] = map[key];
}
});
};
export const initDepartment = (self, obj, type) => {
if (!obj instanceof Object) {
return;
}
var num = {
id: obj,
type: type
}
axios.create().post(
localStorage.getItem("kfUrl") + "PICAAddressHospitalServiceImpl/postDepartmentList",
num
).then(function (res) {
let list = JSON.parse(JSON.stringify(res.data.departmentList));//通过这个实现深拷贝
if (obj == -1) {
self.departmentListP = list;
} else {
self.departmentList = list;
}
if (type == 'childGetChildList') {
self.departmentPid = getPdepartmentId(self,'model','departmentId');
}
});
};
export const getPdepartmentId = (self) =>{
if(isNotEmptyList(self.model.departmentId)
|| !self.departmentList instanceof Array) {
return null;
}
if(self.departmentList.length>0) {
return self.departmentList[0].parent_id;
}else{
return -1;
}
};
export const getObjectIdsStr = (list, key) => {
if (isEmptyUtils(list)) {
return ''
}
let strRet = '';
for (let temp of list) {
strRet = strRet + temp[key] + ',';
}
return strRet;
}
export const getPositionList = (provinceId,cityId,countyId,townId) => {
return new Promise(function (resolve, reject) {
var num = {
provinceId,
cityId,
countyId,
townId
}
axios.create().post(
localStorage.getItem("kfUrl") + "combineHospital/getPositionList",
num
).then(function (res) {
resolve(res);
}).then(function (res) {
reject(res);
});
});
};
export const setOptionLabel = (self,selfModel,selfEId,selfEName,list,listEId,listEName) => {
if (isEmptyList(list) || isEmptyUtils(listEId) || isEmptyUtils(listEName)) {
return ;
}
for (let i = 0; i < list.length; i++) {
if(list[i][listEId] == self[selfModel][selfEId]){
self[selfModel][selfEName] = list[i][listEName];
break;
}
}
return;
};
/**
* 添加自定义的验证规则
*/
export function isvalidUsername(str) {
const valid_map = ['admin', 'editor']
return valid_map.indexOf(str.trim()) >= 0
}
/* 合法uri*/
export function validateURL(textval) {
const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
return urlregex.test(textval)
}
/* 小写字母*/
export function validateLowerCase(str) {
const reg = /^[a-z]+$/
return reg.test(str)
}
/* 大写字母*/
export function validateUpperCase(str) {
const reg = /^[A-Z]+$/
return reg.test(str)
}
/* 大小写字母*/
export function validatAlphabets(str) {
const reg = /^[A-Za-z]+$/
return reg.test(str)
}
// 2-150个中英文字符
export function validateWord150(rule, value, callback, message) {
if(!/^[\u4e00-\u9fffa-zA-Z]{2,150}$/.test(value)) {
callback(new Error(message))
} else {
callback()
}
}
// 考试30个中英文字符
export function validateWord30(value,message) {
if(!/^[\u4e00-\u9fffa-zA-Z]{0,30}$/.test(value)) {
callback(new Error('考试名称长度不超过30个中文字符长度'))
} else {
callback()
}
}
/* 通用密码验证(数字、字母、下划线或特殊字符且长度为0-150位) */
export function isValidPassword(rule, value, callback, message) {
if (!/^(?:\d+|[a-zA-Z]+|[!@#$%^&*]+){0,150}$/.test(value)) {
callback(new Error(message))
} else {
callback()
}
}
\ No newline at end of file
......@@ -10,9 +10,9 @@ export const envConfig = {
// baseUrl: 'https://uat-sc.yunqueyi.com/',
// baseUrl: 'http://10.177.15.150:10401/',
// baseUrl: 'http://10.177.15.150:11905/',
baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'https://test1-sc.yunqueyi.com/',
// baseUrl: 'https://uat-sc.yunqueyi.com/',
baseUrl: 'https://uat-sc.yunqueyi.com/',
apiUrl: 'https://uat-api.yunqueyi.com/',
qiniuFileUrl: "https://uat-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
......
......@@ -171,6 +171,8 @@ const vueFilter = {
return '进行中'
}else if(value == 2) {
return '已结束'
}else if(value == 3) {
return '已下架'
}
},
partJoin: (value) => {
......@@ -207,11 +209,11 @@ const vueFilter = {
},
exportStatus: (value) => {
if(value == 0) {
return '数据生成中,请稍后---';
return '生成中';
}else if(value == 1) {
return '数据生成完成';
return '成功';
} else {
return '文件生成失败 请重新操作导出';
return '失败';
}
},
getAvgTime: (value) => {
......@@ -232,6 +234,37 @@ const vueFilter = {
}
return avgTime;
},
learnTimeValue: (value) => {
if(value === null || value === '') {
return '-';
}
if(value === 0) {
return '0秒';
}
let s = parseInt(value),m = 0, h = 0;//秒,分,小时
if(s==NaN){//错误error
return '';
}
if(s > 60) {
m = parseInt(s/60);
s = parseInt(s%60);
if(m > 60) {
h = parseInt(m/60);
m = parseInt(m%60);
}
}
let result = "";
if(s > 0) {
result = ""+parseInt(s)+"秒";
}
if(m > 0) {
result = ""+parseInt(m)+"分"+result;
}
if(h > 0) {
result = ""+parseInt(h)+"小时"+result;
}
return result;
},
getTotalTime: (value) => {
let time = value +'分钟';
return time;
......@@ -280,6 +313,86 @@ const vueFilter = {
} else if(value == 4) {
return '已下架';
}
}
},
examRate: (value) => {
let num = (value*100).toFixed(1);
let rate = num + '%';
return rate;
},
sexValue: (value) => {
if(value == 1) {
return '男';
} else if(value == 2) {
return '女';
} else if(value == 0) {
return '-';
}
},
joinFlagValue: (value) => {
if(value === 1) {
return '已参与';
} else if(value === 2 || value === 0) {
return '未参与';
} else {
return '-';
}
},
finishFlagValue: (value) => {
if(value === 1) {
return '已完成';
} else if(value === 2 || value === 0) {
return '未完成';
} else {
return '-';
}
},
departmentNameValue: (value) => {
if(value === '') {
return '-';
}
return value;
},
nullOfValue: (value) => {
if(value === null || value === '') {
return '-';
}
return value;
},
certGradeValue: (value) => {
if(value == 1) {
return '优秀';
} else if(value == 2) {
return '良好';
} else if(value == 3) {
return '及格';
} else if(value == 4) {
return '不及格';
} else {
return '-';
}
},
finishFlagType: (value) => {
if(value[0] === null || value[0] === '') {
return '-';
}
if(value[1] === null) {
if(value[0] == 0) {
return '未参与';
} else if(value[0] == 1) {
return '未完成';
} else if(value[0] == 2) {
return '已完成';
}
} else {
if(value[0] == 0) {
return '未参与';
} else if(value[0] == 1) {
return '已参与';
}
}
},
toThousands:(value) => {
return (value || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
},
}
export default vueFilter
\ No newline at end of file
export function dustributeOption(legendData, seriesData) {
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "item",
// formatter: "{b} : {d}%",
formatter:function(data){
let value = data.name + ':' + parseFloat(data.percent.toFixed(1))+"%"
return value;
}
},
label: {
// formatter: "{d}%",
// color: '#000000',
formatter:function(data){ return parseFloat(data.percent.toFixed(1))+"%";}
},
color: ['#FF9A4B', '#39AF9A', '#FFB01B', '#3BA0FF', '#5D7092'],
legend: {
orient: "horizontal",
top: "",
// left: "0%",
data: legendData
},
series: [
{
name: "",
type: "pie",
radius: [0, "78%"],
center: ["50%", "59%"],
data: seriesData,
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
}
}
]
};
return option;
}
export function recordOption(legendData, xAxisData, seriesData) {
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
shadowStyle: {
shadowColor: '#E3EFED',
width: 36,
},
},
backgroundColor: 'rgba(0,0,0,0.7)',
formatter: function (params) {
let relVal = params[0].name + "人数:";
let value = 0;
for (let i = 0, l = params.length; i < l; i++) {
value += params[i].value;
}
relVal += value + "人";
let divList = [];
divList[0] = "<div style='background: #5D7092;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[1] = "<div style='background: #39AF9A;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[2] = "<div style='background: #FFB01B;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[3] = "<div style='background: #FF9A4B;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[4] = "<div style='background: #3BA0FF;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
for (let j = params.length - 1 , k = 0; j >= 0; j-- , k++) {
if(value != 0) {
relVal +=
"<br/>" + divList[k] +
params[j].seriesName +
"占比: " +
parseFloat((
(100 * parseFloat(params[j].value)) /
parseFloat(value)
).toFixed(1)) +
"%";
} else {
relVal +=
"<br/>" + divList[k] +
params[j].seriesName +
"占比: "+ "0%";
}
}
return relVal;
}
},
color: ['#3BA0FF', '#FF9A4B', '#FFB01B', '#39AF9A', '#5D7092'],
legend: {
right: "3%",
data: legendData,
},
grid: {
left: "3%",
right: "3%",
bottom: "3%",
containLabel: true
},
xAxis: {
type: "category",
data: xAxisData,
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
},
yAxis: {
minInterval: 1,
type: "value",
name: "人数 (个)",
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
},
series: seriesData,
};
return option;
}
export function certificateOption(xAxisData, seriesJoin, seriesCert, seriesRate, legendData) {
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "axis",
// axisPointer: {
// type: "cross",
// crossStyle: {
// color: "#999"
// }
// },
axisPointer: {
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
shadowStyle: {
shadowColor: '#E3EFED',
width: 36,
},
},
backgroundColor: 'rgba(0,0,0,0.7)',
formatter: function (params) {
let relVal = "";
let divList = [];
divList[0] = "<div style='background: #5D7092;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[1] = "<div style='background: #FFB01B;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[2] = "<div style='background: #559A99;height: 12px;width: 12px;margin: 5px 5px 0 5px;float: left;border-radius:50%;'></div>";
for (let j = 0, l = params.length; j < l; j++) {
relVal += divList[j] + params[j].seriesName + ": " + params[j].value;
if (j === 2) {
relVal += "%";
} else {
relVal += "<br/>";
}
}
return relVal;
}
},
color: ['#5D7092', '#FFB01B', '#559A99'],
dataZoom: {
show: true,
start: 0,
end: 100,
left:"10%",
right:"10%",
},
legend: {
right: '6%',
data: legendData,
},
grid: {
left: '3%',
right: '3%',
containLabel: true
},
xAxis: [
{
axisLabel: {
interval: 0,
rotate: 45
},
type: "category",
data: xAxisData,
axisPointer: {
type: "shadow"
},
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
}
],
yAxis: [
{
minInterval: 1,
type: "value",
name: "人数(个)",
axisLabel: {
formatter: "{value} "
},
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
},
{
type: "value",
name: "比例",
min: 0,
max: 100,
show: false,
axisLabel: {
formatter: "{value} %"
},
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
// splitLine: {
// show: false
// }
}
],
series: [
{
name: "参与人数",
barWidth: 10,
type: "bar",
data: seriesJoin,
label: {
show: true,
position: "top",
rotate: -90,
offset: [-5, -15]
}
},
{
name: legendData[1],
barWidth: 10,
type: "bar",
data: seriesCert,
label: {
show: true,
position: "top",
rotate: -90,
offset: [-5, -15]
}
},
{
name: legendData[2],
type: "line",
yAxisIndex: 1,
data: seriesRate,
label: {
show: true,
position: "top",
formatter: "{c}%" //这是关键,在需要的地方加上就行了
}
}
]
};
return option;
}
export function durationOption(xAxisData, seriesData) {
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
},
formatter:function(data){
let value = data[0].name + '平均天数:' + data[0].value+"天"
return value;
}
},
color: ['#449284'],
dataZoom: {
show: true,
start: 0,
end: 100,
left:"10%",
right:"10%",
},
grid: {
left: 20,
right: 20,
containLabel: true
},
xAxis: [
{
axisLabel: {
interval: 0,
rotate: 35
},
type: "category",
data: xAxisData,
axisTick: {
alignWithLabel: true
},
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
}
],
yAxis: [
{
type: "value",
name: "完成时长 (天)",
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
}
],
series: [
{
name: "时长",
type: "bar",
barWidth: 18,
data: seriesData,
label: {
show: true,
position: "top",
formatter: "{c}", //这是关键,在需要的地方加上就行了
rotate: -90,
offset: [-5, -15]
}
}
]
};
return option;
}
export function educationEffect(xAxisData, seriesBefore, seriesAfter) {
let option = {
title: {
text: ""
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow"
},
formatter: function (params) {
let relVal = params[0].name + "";
let divList = [];
divList[0] = "<div style='background: #FEBB3C;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[1] = "<div style='background: #39AF9A;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
for (let j = 0; j <= params.length - 1; j++) {
relVal +=
"<br/>" + divList[j] +
params[j].seriesName +
": " + params[j].value + "%";
}
return relVal;
}
},
color: ["#FEBB3C", "#39AF9A"],
legend: {
right: "3%",
data: ["项目前总正确率", "项目后总正确率"]
},
grid: {
top: '20%',
left: "3%",
right: "3%",
bottom: "3%",
containLabel: true
},
xAxis: {
type: "category",
data: xAxisData,
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
},
yAxis: {
min: 0,
max: 100,
type: "value",
name: "正确率 (%)",
axisLabel: {
formatter: "{value}%"
},
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
},
series: [
{
name: "项目前总正确率",
type: "bar",
barWidth: 18,
data: seriesBefore,
label: {
show: true,
position: "top",
formatter: "{c}%",
rotate: -90,
offset: [-5, -15]
}
},
{
name: "项目后总正确率",
type: "bar",
barWidth: 18,
data: seriesAfter,
label: {
show: true,
position: "top",
formatter: "{c}%",
rotate: -90,
offset: [-5, -15]
}
}
]
};
return option;
}
export function knowledgeEffect(xAxisData, seriesBefore, seriesAfter) {
let option = {
title: {
text: ""
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow"
},
formatter: function (params) {
let relVal = params[0].name + "";
let divList = [];
divList[0] = "<div style='background: #FFB01B;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[1] = "<div style='background: #5D7092;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
for (let j = 0; j <= params.length - 1; j++) {
relVal +=
"<br/>" + divList[j] +
params[j].seriesName +
": " + params[j].value + "%";
}
return relVal;
}
},
color: ["#FFB01B", "#5D7092"],
dataZoom: {
show: true,
start: 0,
end: 100,
left:"10%",
right:"10%",
},
legend: {
right: 20,
data: ["培训前正确率", "培训后正确率"]
},
grid: {
top: '20%',
left: 20,
right: 20,
containLabel: true
},
xAxis: {
axisLabel: {
interval: 0,
rotate: 45
},
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
type: "category",
data: xAxisData,
},
yAxis: {
min: 0,
max: 100,
type: "value",
name: "正确率 (%)",
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
axisLabel: {
formatter: "{value}%"
}
},
series: [
{
name: "培训前正确率",
type: "bar",
barWidth: 18,
data: seriesBefore,
label: {
show: true,
position: "top",
formatter: "{c}%", //这是关键,在需要的地方加上就行了
rotate: -90,
offset: [-5, -15]
},
},
{
name: "培训后正确率",
type: "bar",
barWidth: 18,
data: seriesAfter,
label: {
show: true,
position: "top",
formatter: "{c}%", //这是关键,在需要的地方加上就行了
rotate: -90,
offset: [-5, -15]
}
}
]
};
return option;
}
export function examTimes(xAxisData, seriesData) {
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
},
formatter:function(data){
let value = data[0].name + '完成人数:' + data[0].value+"名"
return value;
}
},
color: ['#449284'],
grid: {
left: 20,
right: 20,
containLabel: true
},
dataZoom: {
show: true,
start: 0,
end: 100,
left:"10%",
right:"10%",
},
xAxis: [
{
axisLabel: {
interval: 0,
},
type: "category",
data: xAxisData,
axisTick: {
alignWithLabel: true
},
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
}
],
yAxis: [
{
type: "value",
name: "人数 (名)",
minInterval: 1,
min: 0,
splitNumber: 5,
axisLabel: {
formatter: '{value} '
},
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
}
],
series: [
{
name: "",
type: "bar",
barWidth: 17,
data: seriesData,
label: {
show: true,
position: "top",
formatter: "{c}",
rotate: -90,
offset: [-5, -15],
}
}
]
};
return option;
}
export function examScore(xAxisData, seriesData) {
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
},
formatter:function(data){
let value = data[0].name + '人数:' + data[0].value+"名"
return value;
}
},
color: ['#CAA861'],
grid: {
left: 20,
right: 20,
containLabel: true
},
dataZoom: {
show: true,
start: 0,
end: 100,
left:"10%",
right:"10%",
},
xAxis: [
{
axisLabel: {
interval: 0,
},
type: "category",
data: xAxisData,
axisTick: {
alignWithLabel: true
},
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
}
],
yAxis: [
{
type: "value",
name: "人数 (名)",
minInterval: 1,
min: 0,
splitNumber: 5,
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
}
],
series: [
{
name: "",
type: "bar",
barWidth: 17,
data: seriesData,
label: {
show: true,
position: "top",
formatter: "{c}",
rotate: -90,
offset: [-5, -15],
}
}
]
};
return option;
}
export function ringOption(num, color) {
let option = {
title: {
text: num + '%',
x: 'center',
y: 'center',
textStyle: {
fontSize: 24,
fontWeight: 'normal',
color: '#000000',
},
subtextStyle: {
color: "#000000",
fontWeight: 'normal'
}
},
series: [{
type: 'pie',
radius: ['100%', '80%'],
// silent: true,
labelLine: {
show: false
},
data: [{
hoverOffset: 1,
value: num,
itemStyle: {
color: color
},
label: {
show: false
}
},
{
markArea: {
silent: true,
},
value: 100 - num,
itemStyle: {
color: '#F0F2F5'
},
label: {
show: false
}
}
]
}]
};
return option;
}
export function getPicOption(title, legendData, colorData, seriesData, centerValue) {
let option = {
title: {
text: title,
x: "left",
left: '20px',
top: "20px",
},
tooltip: {
trigger: 'item',
// formatter: "{a} <br/>{b} : {c} ({d}%)"
formatter:function(data){
let value = data.name+'人数:'+data.value + '<br/>占比:' + parseFloat(data.percent.toFixed(1))+"%"
return value;
}
},
label: {
formatter:function(data){ return parseFloat(data.percent.toFixed(1))+"%";}
},
legend: {
orient: "vertical",
top: "center",
right: "28",
data: legendData
},
grid: {
left: "30%",
right: "0%",
bottom: "10%",
containLabel: true
},
color: colorData,
backgroundColor: '#FFFFFF',
series: [
{
name: "",
type: "pie",
radius: [0, '55%'],
center: centerValue,
data: seriesData,
}
]
};
return option;
}
export function getBarOption(xAxisData, seriesData) {
let option = {
title: {
text: "人员年龄分布",
x: "left",
left: '20px',
top: "20px",
},
color: ['rgba(91, 143, 249, 0.85)'],
backgroundColor: '#FFFFFF',
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
},
formatter:function(data){
let value = data[0].name + '人数:' + data[0].value+"名"
return value;
}
},
grid: {
top: '84',
bottom: '36',
left: '20',
right: '20',
containLabel: true
},
xAxis: [
{
type: 'category',
data: xAxisData,
axisLabel: {
interval: 0
},
axisTick: { // 隐藏刻度
show: false
},
axisLine: { //隐藏轴线
show: false
},
}
],
yAxis: [
{
type: 'value',
minInterval: 1,
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
}
],
series: [
{
name: '',
type: 'bar',
barWidth: 18,
data: seriesData,
}
]
};
return option;
}
\ No newline at end of file
......@@ -220,24 +220,25 @@ module.exports = {
},
// 通用GET请求
GET(api, para, callback,str) {
GET(api, para, callback, str, noLoading) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
let url = api + this.getUrlPara(para)
url = encodeURI(url);
return fetch({
url: getBaseUrl(url),
method: 'get',
data: para
data: para,
noLoading
})
},
reportGET(api, para, callback,str) {
reportGET(api, para, callback, str) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
let url = api + this.getUrlPara(para)
url = encodeURI(url);
return fetch({
url: getReportUrl(url),
method: 'get',
data: para
data: para,
})
},
// saas-GET请求
......@@ -273,12 +274,13 @@ module.exports = {
})
},
// 通用POST请求
POST(api, para, callback) {
POST(api, para, callback, str, noLoading) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
return fetch({
url: getBaseUrl(api),
method: 'post',
data: para
data: para,
noLoading
})
},
reportPOST(api, para, callback) {
......
......@@ -305,6 +305,20 @@ export function setRegionOption2(data) {
}
return option;
}
export function setRegionOptionNew(data) {
let option = [];
for (let i = 0; i < data.length; i++) {
let obj = data[i];
obj.label = data[i].label;
obj.value = data[i].id;
if(obj.degree == 4 || obj.degree == 0 || obj.label == "全部") {
// if(obj.degree == 4 ) {
obj.leaf = true;
}
option.push(obj);
}
return option;
}
export function setAdministrativeId(value) {
let areaId = '000';
for (let i = 0; i < value.length; i++) {
......@@ -335,16 +349,17 @@ export function getLearnOrganization(data) {
let arr = [];
return arr;
}
let organization = [
{
label: "全部",
value: 0
},
];
// let organization = [
// {
// label: "全部",
// value: 0
// },
// ];
let organization = [];
for (let i = 0; i < data.length; i++) {
let obj = {
label: data[i].hospital_name,
value: data[i].hospital_id,
label: data[i].hospitalName,
value: data[i].hospitalId,
index: i,
};
organization.push(obj);
......@@ -355,17 +370,25 @@ export function getPicOption(title, legendData, colorData, seriesData) {
let option = {
title: {
text: title,
x: "center",
top: "3%",
x: "left",
left: '20px',
top: "20px",
},
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
// formatter: "{a} <br/>{b} : {c} ({d}%)"
formatter:function(data){
let value = data.name + ':' + data.percent.toFixed(1)+"%"
return value;
}
},
label: {
formatter:function(data){ return data.percent.toFixed(1)+"%";}
},
legend: {
orient: "vertical",
top: "3%",
left: "left",
top: "center",
right: "26",
data: legendData
},
grid: {
......@@ -375,13 +398,13 @@ export function getPicOption(title, legendData, colorData, seriesData) {
containLabel: true
},
color: colorData,
backgroundColor: '#F3F3F3',
backgroundColor: '#FFFFFF',
series: [
{
name: "",
type: "pie",
radius: "55%",
center: ["60%", "65%"],
radius: [0, '55%'],
center: ["50%", "57.2%"],
data: seriesData,
}
]
......@@ -391,16 +414,22 @@ export function getPicOption(title, legendData, colorData, seriesData) {
export function getBarOption(xAxisData, seriesData) {
let option = {
title: {
text: "用户年龄发布",
x: "center",
top: "3%",
text: "人员年龄分布",
x: "left",
left: '20px',
top: "20px",
},
color: ['rgba(91, 143, 249, 0.85)'],
backgroundColor: '#FFFFFF',
tooltip: {
trigger: 'item',
formatter: "{b} : {c} "
},
color: ['#3398DB'],
backgroundColor: '#F3F3F3',
grid: {
left: '3%',
right: '4%',
bottom: '3%',
top: '84',
bottom: '36',
left: '20',
right: '20',
containLabel: true
},
xAxis: [
......@@ -409,22 +438,32 @@ export function getBarOption(xAxisData, seriesData) {
data: xAxisData,
axisLabel: {
interval: 0
}
// axisTick: {
// alignWithLabel: true
// }
},
axisTick: { // 隐藏刻度
show: false
},
axisLine: { //隐藏轴线
show: false
},
}
],
yAxis: [
{
type: 'value'
type: 'value',
minInterval: 1,
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
}
],
series: [
{
name: '',
type: 'bar',
barWidth: 30,
barWidth: 18,
data: seriesData,
}
]
......@@ -592,13 +631,23 @@ export function initRank(data) {
}
return list;
}
export function getAvgTime(data) {
let list = [0, 0];
if (data != null && data != '') {
list[0] = Math.floor(data / 60);
list[1] = data % 60;
export function getAvgTime(value) {
let list = [0,0];
let avgTime = '';
if(value != null && value !='') {
list[0] = Math.floor(value / 60);
list[1] = value % 60;
}
return list;
if(list[0] == 0 && list[1] == 0) {
avgTime = list[1] + '秒';
} else if(list[0] == 0 && list[1] != 0) {
avgTime = list[1] + '秒';
} else if(list[0] != 0 && list[1] == 0) {
avgTime = list[0] + '分钟';
} else if(list[0] != 0 && list[1] != 0) {
avgTime = list[0] + '分钟' + list[1] + '秒';
}
return avgTime;
}
export function getComponent(data) {
let list = [];
......@@ -641,4 +690,66 @@ export function setSelectedKeys(checkedKeys, halfCheckedKeys) {
selected.push(obj);
}
return selected;
}
export function setDuringTime(time , type) {
let value = time;
if(time == '' || time == null) {
return '';
}
if(type == 'begin') {
value = time[0];
} else if(type == 'end') {
value = time[1];
}
return value;
}
export function setHospitalIdList(data) {
let listStr = '';
if(data == null || data.length == 0) {
return listStr
}
for(let i = 0 ; i<data.length ; i++) {
listStr += data[i]+'_';
}
listStr = listStr.substring(0, listStr.length - 1);
return listStr;
}
export function getHospitalIdList(data) {
let listArr = [];
if(data == null || data == '') {
return listArr
}
listArr = data.split("_")
return listArr;
}
export function learnTimeValue(value) {
if(value === null || value === '') {
return '-';
}
if(value === 0) {
return '0秒';
}
let s = parseInt(value),m = 0, h = 0;//秒,分,小时
if(s==NaN){//错误error
return '';
}
if(s > 60) {
m = parseInt(s/60);
s = parseInt(s%60);
if(m > 60) {
h = parseInt(m/60);
m = parseInt(m%60);
}
}
let result = "";
if(s > 0) {
result = ""+parseInt(s)+"秒";
}
if(m > 0) {
result = ""+parseInt(m)+"分"+result;
}
if(h > 0) {
result = ""+parseInt(h)+"小时"+result;
}
return result;
}
\ No newline at end of file
......@@ -22,7 +22,7 @@
</div>
</div>
<div class="first-step" v-if="stepNum == 1">
<el-form ref="basicInfoForm" class="basic-form" :model="portalComponent" :rules="rules" label-width="125px" label-suffix=":" size="small" style="margin-bottom:30px;">
<el-form ref="basicInfoForm" class="basic-form" :model="portalComponent" :rules="rules" label-width="175px" label-suffix=":" size="small" style="margin-bottom:30px;">
<el-form-item label="组件名称" prop="name">
<el-input type="text" v-model="portalComponent.name" @blur="componentName" size="small" placeholder="请输入组件名称" style="width:30%;"></el-input>
<span class="word-num">{{(portalComponent.name).replace(/\s+/g,"").length}}/20</span>
......@@ -53,11 +53,23 @@
</el-form-item>
<p class="upload-message" v-if="uploadImgMessage">请上传组件图片</p>
</div> -->
<el-form-item label="组件内的模块完成比率须≥" prop="certificateCondition">
<el-input-number
v-model="portalComponent.certificateCondition"
controls-position="right"
@change="handleChange"
:disabled="componentStatus == 3 || componentStatus == 4"
:precision="0"
:step="1"
:min="0"
:max="100">
</el-input-number>
</el-form-item>
<el-row>
<el-col :span="6">
<el-col :span="8">
<div class="basic-item-icon">
<span class="require">*</span>
<el-form-item label="配置证书">
<el-form-item label="配置证书" required>
<el-radio-group v-model="certificateLable" @change="selectCertificate" :disabled="componentStatus == 3 || componentStatus == 4">
<el-radio label="是"></el-radio>
<el-radio label="否"></el-radio>
......@@ -78,17 +90,7 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item v-if="hasCertificate" label="组件完成(%)" prop="certificateCondition">
<el-input-number
v-model="portalComponent.certificateCondition"
controls-position="right"
@change="handleChange"
:disabled="componentStatus == 3 || componentStatus == 4"
:step="10"
:min="10"
:max="100">
</el-input-number>
</el-form-item>
</el-form>
</div>
<div class="" v-if="stepNum == 2">
......@@ -107,6 +109,13 @@
<el-input v-model="item.name" @blur="moduleNameValidate(index)" :disabled="fieldDisabled(item)" size="small" placeholder="请选择模块名称" style="width:288px;"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<!-- <el-col :span="10">
<el-form-item label="模块名称" prop="name">
<el-input v-model="item.name" @blur="moduleNameValidate(index)" :disabled="fieldDisabled(item)" size="small" placeholder="请选择模块名称" style="width:288px;"></el-input>
</el-form-item>
</el-col> -->
<el-col :span="8" v-if="idType == 1">
<el-form-item label="是否对外开放" prop="openFlag">
<el-radio-group v-model="item.openFlag" @change="selectIsOpen(index)" :disabled="fieldDisabled(item) || item.openDisabled">
......@@ -115,6 +124,14 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8" v-if="idType == 1">
<el-form-item label="通过标准" prop="passType">
<el-radio-group v-model="item.passType" @change="selectStandard(index)" :disabled="fieldDisabledStandard(item)">
<el-radio :label="1">全部完成</el-radio>
<el-radio :label="2">无要求</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6" v-if="idType == 1">
<el-form-item label="是否启用" prop="status">
<el-radio-group v-model="item.status" @change="selectIsOpenStatus(index)" :disabled="fieldDisabled(item)">
......@@ -405,14 +422,15 @@ export default {
imageUrl:'',
seqNo: '',
certificateId: '', // 0 没有证书,配置证书为否
certificateCondition: '60', // 证书完成率
certificateCondition: '100', // 证书完成率
status: ''
},
componentList: {
moduleModelList: [{
id: '',
name: '',
openFlag: '', // 1 否 不开放 2 是 开放
openFlag: '', // 1 否 不开放 2 是 开放,
passType:'1',//1:全部完成 2:无要求
templetModelList: []
}]
},
......@@ -437,7 +455,7 @@ export default {
{ required: true, message: '请选择证书', trigger: 'blur' },
],
"certificateCondition": [
{ required: true, message: '请选择获得证书完成率', trigger: 'blur' },
{ required: true, message: '请输入内容', trigger: 'blur' },
]
},
moduleRules: {
......@@ -510,6 +528,10 @@ export default {
})
}
},
selectStandard(index){
},
// 删除图片
deleteImg() {
vm.portalComponent.imageUrl = ''
......@@ -520,14 +542,19 @@ export default {
vm.portalComponent.certificateId = ''
if(val == '否') {
vm.hasCertificate = false
vm.portalComponent.certificateCondition = 0
//vm.portalComponent.certificateCondition = 0
}else{
vm.hasCertificate = true
vm.portalComponent.certificateCondition = 60
//vm.portalComponent.certificateCondition = 100
}
vm.portalComponent.certificateCondition = 100
},
// 获取组件完成率
handleChange(value) {
console.log(value)
if(value == 1){
}
vm.portalComponent.certificateCondition = value
},
// 获取证书下拉列表
......@@ -757,6 +784,9 @@ export default {
}
}
},
fieldDisabledStandard(item){
return (vm.componentStatus == 3 || vm.componentStatus == 4 );
},
fieldDisabled(item){
// return vm.conditionSelect || item.moduleType == 2 || (item.id != '' && item.openFlag == 2) || vm.idType == 2 || item.statusFlag
return vm.newconditionSelect || item.moduleType == 2 || vm.idType == 2 || (vm.componentStatus != 1 && vm.componentStatus != 2 && item.statusFlag);
......@@ -854,9 +884,10 @@ export default {
openFlag: 1, // 1不开放 2开放
moduleType: 1, // 2为从预设模块中添加
status: 1, // 1 不启用 2启用
passType:1,
templetModelList: []
});
vm.componentList.moduleModelList[(vm.componentList.moduleModelList.length - 1)].openDisabled = true;
//vm.componentList.moduleModelList[(vm.componentList.moduleModelList.length - 1)].openDisabled = true;
},
// 添加模板
addTemplate(item,index) {
......@@ -1113,7 +1144,11 @@ export default {
vm.GET('portal/portalComponent/disableOrStart',req).then((res) => {
if(res.code == "000000") {
if(flag == 2) {
vm.$router.push({ path: 'item-component' })
let query = {}
if(this.$route.query.pageNum){
query = {pageNum:this.$route.query.pageNum}
}
vm.$router.push({ path: 'item-component',query:query })
} else {
vm.$message.info("暂存成功!")
}
......@@ -1397,5 +1432,3 @@ export default {
}
}
</style>
......@@ -192,6 +192,16 @@
</el-form-item>
<p class="upload-message" v-if="uploadImgMessage2">请选择封面</p>
</div>
<el-form-item label="项目结束后:">
<el-radio-group
size="small"
v-model="formData.allowLearn"
:disabled="showAllowType()"
>
<el-radio :label="1">允许继续学习(停止发证)</el-radio>
<el-radio :label="2">不允许继续学习</el-radio>
</el-radio-group>
</el-form-item>
<p class="p_label">项目范围来源:(一经选择无法更改)</p>
<el-form-item label="">
<el-radio-group
......@@ -203,6 +213,16 @@
<el-radio :label="1">使用小生态范围</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="人员权限设定">
<el-radio-group
size="small"
v-model="formData.authorityType"
:disabled="showNoticeType()"
>
<el-radio :label="1">自定义</el-radio>
<el-radio :label="2">使用平台默认权限</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="项目范围外可见">
<el-radio-group
size="small"
......@@ -728,6 +748,7 @@
v-model="formComponent.component"
multiple
collapse-tags
filterable
style="width: 350px"
placeholder="请选择组件"
@change="changeValue"
......@@ -756,33 +777,26 @@
>{{tag.name}}</el-tag>
</el-col>
</el-form-item>
<el-form-item label="学习时长控制:" class="time-contrl">
<el-form-item required label="学习时长:" class="time-contrl">
<el-col :span="10">
<el-radio-group class="el-time-ctr" v-model="formComponent.courseRequire" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6">
<el-radio :label="1">是(则项目中各课程须达到课程配置中的观看时长要求才允许通过)</el-radio>
<el-radio :label="1">是(必须达到课程配置的观看时长要求才算通过)</el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-col>
</el-form-item>
<el-form-item label="配置证书:">
<el-col :span="10">
<el-radio-group class="el-configure" v-model="formComponent.configure" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
</el-col>
</el-form-item>
</el-form>
<el-form
ref="formExam"
label-width="150px"
:model="formExam"
class="achievement"
v-show="formComponent.configure == 1"
>
<el-form-item label="项目成绩评定条件">
<el-form-item required label="项目通过标准" :class="customError.standard.className">
<el-select
v-model="formExam.certificateType"
v-model="formExam.passType"
placeholder="请选择"
style="width: 350px"
@change="updateCertificateType"
......@@ -795,31 +809,126 @@
:value="item.value"
></el-option>
</el-select>
<div class="el-form-item__error" v-if="customError.standard.error != ''">{{customError.standard.error}}</div>
</el-form-item>
<div v-show="formExam.certificateType == 2" v-for="(item , index) in formExam.exam" :key="index">
<el-form-item label="发放证书">
<el-col :span="6">
<el-select
v-model="item.certificateId"
placeholder="请选择证书"
style=""
@change="updateCertificate(index)"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
>
<el-option
v-for="item in optionsCertificate"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-col>
<el-col :span="3">
<el-button @click="addCertificate" icon="el-icon-plus" circle></el-button>
<el-button @click="reduceCertificate(index)" icon="el-icon-minus" circle></el-button>
</el-col>
</el-form-item>
<el-form-item label="项目中最高">
<el-form-item required label="累计学习时长大于等于:" v-show="formExam.passType == 3" :class="customError.passTotalLearnTime.className">
<el-input placeholder="请输入" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" v-model="formComponent.passTotalLearnTime" style="width:200px" @input="focusFun($event,'passTotalLearnTime')">
<template slot="append">分钟</template>
</el-input>
<div class="el-form-item__error" v-if="customError.passTotalLearnTime.error != ''">{{customError.passTotalLearnTime.error}}</div>
</el-form-item>
<!--add 选择平均分展示-->
<div v-show="formExam.passType == 2" >
<div class="mleft60" v-show="formExam.passType == 2">
<div class="mini-source" style="overflow: hidden;">
<el-form-item label="项目中最高" label-width="80px" style="float: left;" :class="customError.passExamCount.className" class="min-label">
<div class="source-item">
<el-input placeholder="请输入数字" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" size="mini" v-model="formComponent.passExamCount" style="width:150px" @input="focusFun($event,'passExamCount')">
<template slot="append"></template>
</el-input>
</div>
<div class="el-form-item__error" v-if="customError.passExamCount.error != ''">{{customError.passExamCount.error}}</div>
</el-form-item>
<div style="float: left;padding:0 5px;line-height: 26px;font-size: 12px;color:#606266">考试成绩的平均分大于等于</div>
<el-form-item label="" label-width="0px" style="float: left;" :class="customError.passAverageScore.className" class="min-label">
<div class="source-item">
<el-input placeholder="请输入数字" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" size="mini" v-model="formComponent.passAverageScore" style="width:150px" @input="focusFun($event,'passAverageScore')">
<template slot="append"></template>
</el-input>
</div>
<div class="el-form-item__error" v-if="customError.passAverageScore.error != ''">{{customError.passAverageScore.error}}</div>
</el-form-item>
<div style="float: left;padding:0 5px;line-height: 26px;font-size: 12px;color:#606266">则项目通过</div>
</div>
</div>
</div>
<el-form-item required label="配置证书:">
<el-col :span="10">
<el-radio-group class="el-configure" v-model="formComponent.configure" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
</el-col>
</el-form-item>
<!--edit 选择配置证书展示-->
<div v-show="formComponent.configure == 1 && formExam.passType == 2" v-for="(item , index) in formExam.exam" :key="index">
<div class="mleft60">
<div class="soure-configure">
<div class="configure-item">
<el-form-item label="平均分:" label-width="65px" style="float: left;" :class="item.minClass" class="min-label">
<el-col :span="5">
<el-input :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" placeholder="请输入数字" size="mini" v-model="item.rangeMin" style="width:215px" @input="focusFun($event,'rangeMin',index)">
<template slot="append"></template>
</el-input>
</el-col>
<div class="el-form-item__error" v-if="item.minError">{{item.minError}}</div>
</el-form-item>
<div style="float: left;padding:0 5px;line-height: 26px;">~</div>
<el-form-item label-width="0" style="float: left;margin-left:0px;" :class="item.maxClass" class="min-label">
<el-col :span="5">
<el-input :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" placeholder="请输入数字" size="mini" v-model="item.rangeMax" style="width:215px" @input="focusFun($event,'rangeMax',index)">
<template slot="append"></template>
</el-input>
</el-col>
<div class="el-form-item__error" v-if="item.maxError">{{item.maxError}}</div>
</el-form-item>
</div>
<div class="configure-item">
<el-form-item label="发放证书:" style="margin-left: -85px;" :class="item.certClass">
<el-select
v-model="item.certificateId"
placeholder="请选择证书"
size="mini"
style="width: 450px;"
@change="updateCertificate(index)"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
>
<el-option
v-for="item in optionsCertificate"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<div class="el-form-item__error" v-if="item.certError">{{item.certError}}</div>
</el-form-item>
</div>
<!-- <el-form-item label="发放证书" style="width:100px;">
<el-col :span="3">
<el-button @click="addCertificate" icon="el-icon-plus" circle></el-button>
<el-button @click="reduceCertificate(index)" icon="el-icon-minus" circle></el-button>
</el-col>
</el-form-item> -->
<div class="configure-option">
<el-button size="mini" @click="addCertificate" icon="el-icon-plus" circle :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"></el-button>
<el-button size="mini" @click="reduceCertificate(index)" icon="el-icon-minus" circle :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"></el-button>
</div>
</div>
</div>
<!-- <el-form-item label="项目中最高">
<el-col :span="3">
<el-input v-model="item.examCount" @change="updateCount(index)" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"></el-input>
</el-col>
......@@ -831,9 +940,10 @@
<el-col :span="3">
<el-input v-model="item.rangeMax" @change="updateMax(index)" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"></el-input>
</el-col>
</el-form-item>
</el-form-item> -->
</div>
<el-form-item v-show="formExam.certificateType == 1" label="发放证书">
<el-form-item required v-show="formComponent.configure == 1 && (formExam.passType == 1 || formExam.passType == 3)" label="发放证书" :class="customError.certificate.className">
<el-select
v-model="formComponent.certificate"
placeholder="请选择证书"
......@@ -847,6 +957,7 @@
:value="item.value"
></el-option>
</el-select>
<div class="el-form-item__error" v-if="customError.certificate.error != ''">{{customError.certificate.error}}</div>
</el-form-item>
</el-form>
</div>
......@@ -892,7 +1003,28 @@ export default {
return {
idTypeValue: 1,
idTypeProject: '',
customError:{
standard:{
className:'',
error:''
},
certificate:{
className:'',
error:''
},
passTotalLearnTime:{
className:'',
error:''
},
passExamCount:{
className:'',
error:''
},
passAverageScore:{
className:'',
error:''
}
},
projectId: null,
peopleLevel: null,
//面包屑
......@@ -925,6 +1057,8 @@ export default {
receiveOption: 1,
visibleFlag: 1,
learnableFlag: 2,
authorityType:1,
allowLearn:2
},
pickerOptions0: {
disabledDate: time => {
......@@ -1055,6 +1189,9 @@ export default {
configure: 2,
certificate: "",
courseRequire: 0, //0:不控制 1:按课程时长配置要求
passExamCount:'',
passAverageScore:'',
passTotalLearnTime:''
},
tagsComponent: [],
projectStatus: "",
......@@ -1063,6 +1200,7 @@ export default {
//考试数据
formExam: {
certificateType: 1,
passType:1,
exam: [{
examCount: 1,
rangeMin: '',
......@@ -1072,14 +1210,19 @@ export default {
}]
},
certificateTypeList: [
{
label: '所有组件通过',
value: 1,
},
{
label: '根据平均分发证书',
label: '根据平均分设定',
value: 2,
},
{
label: '所有组件通过即发放',
value: 1,
}
label: '根据项目内学习时长设定',
value: 3,
},
],
visibleName: false,
organizationContent: '',
......@@ -1144,7 +1287,12 @@ export default {
visitTime: [
{required: false, trigger: "change", validator: checkNormalInt,}
],
showRules1:[
{ required: true, message: "请输入门数", trigger: "blur" }
],
},
rules: {
projectName: [
{ required: true, message: "请输入项目名称", trigger: "blur" },
......@@ -1227,6 +1375,45 @@ export default {
commonUtil.resizeHeight();
},
methods: {
focusFun(ev,parm,index){
if(index != undefined){
if(parseInt(ev) < 0 || !this.checkIntFun(ev)){
console.log(typeof index)
this.formExam.exam[index][parm] = ''
}
if(parm == 'rangeMax' && parseInt(ev) > 100){
this.formExam.exam[index][parm] = "100"
}
if(ev != ''){
if(parm == 'rangeMax'){
this.formExam.exam[index].maxClass = ''
this.formExam.exam[index].maxError = ''
}
if(parm == 'rangeMin'){
this.formExam.exam[index].minClass = ''
this.formExam.exam[index].minError = ''
}
}
}else{
if(parseInt(ev) < 0 || !this.checkIntFun(ev)){
this.formComponent[parm] = ''
}
if(parm == 'passAverageScore' && parseInt(ev) > 100){
this.formComponent[parm] = "100"
}
if(ev != ''){
this.customError[parm] = {
className:'',
error:''
}
}
}
},
//表单校验
submitForm(formName) {
let flag = null;
......@@ -1289,6 +1476,8 @@ export default {
receiveOption: editData.notifyData.receiveOption,
visibleFlag: editData.projectData.visibleFlag,
learnableFlag: editData.projectData.learnableFlag,
authorityType:editData.projectData.authorityType,
allowLearn:editData.projectData.allowLearn || 2,
};
this.organizationContent = editData.projectData.creatorOrganizationName;
if (editData.attachmentData.length > 2) {
......@@ -1320,7 +1509,22 @@ export default {
}
//初始化考试平均分配置数据
this.formExam.certificateType = editData.projectData.certificateType;
this.formExam.passType = editData.projectData.passType;
this.formExam.exam = editData.certificateRule;
if(this.formExam.exam.length > 0){
for(let k=0;k<this.formExam.exam.length;k++){
this.formExam.exam[k].certClass = ''
this.formExam.exam[k].certError = ''
this.formExam.exam[k].minClass = ''
this.formExam.exam[k].minError = ''
this.formExam.exam[k].maxClass = ''
this.formExam.exam[k].maxError = ''
}
}
console.log(this.formExam.exam)
this.formComponent.passAverageScore = editData.projectData.passAverageScore > 0 ? editData.projectData.passAverageScore : ''
this.formComponent.passExamCount = editData.projectData.passExamCount > 0 ? editData.projectData.passExamCount : ''
this.formComponent.passTotalLearnTime = editData.projectData.passTotalLearnTime
if(this.formExam.exam.length == 0) {
this.formExam.exam = [{
examCount: 1,
......@@ -1328,6 +1532,12 @@ export default {
rangeMax: '',
certificateId: '',
certificateName: '',
minClass:'',
minError:'',
maxClass:'',
maxError:'',
certClass:'',
certError:''
}]
}
},
......@@ -1342,6 +1552,7 @@ export default {
closeLoading(vm);
if (res.code == "000000" && res.data.projectData != null) {
let editData = res.data;
console.log(editData)
this.status4Flag = res.data.projectData.status4Flag;
this.setEditData(editData);
this.idTypeProject = res.data.projectData.idType;
......@@ -1373,6 +1584,8 @@ export default {
organizationName: this.formData.organizationName,
visibleFlag: this.formData.visibleFlag,
learnableFlag: this.formData.learnableFlag,
authorityType:this.formData.authorityType,
allowLearn:this.formData.allowLearn,
};
let attachmentModel = [
{
......@@ -1528,14 +1741,23 @@ export default {
projectId: this.projectId,
type: type,
status: this.projectStatus,
certificateType: this.formExam.certificateType,
certificateType: this.formExam.passType == 2 ? 2 : 1,
getCertificateRule: [],
courseRequire: this.formComponent.courseRequire,
passType:this.formExam.passType
};
if(this.formExam.passType == 2){
param.passAverageScore = this.formComponent.passAverageScore
param.passExamCount = this.formComponent.passExamCount
}
if(this.formExam.passType == 3){
param.passTotalLearnTime = this.formComponent.passTotalLearnTime
}
// console.log('排序后',vm.tagsComponent,'param',param);
if(this.formComponent.configure == 1) {
// 2.多证书有规
if(this.formExam.certificateType == 2) {
if(this.formExam.passType == 2) {
let ruleData = vm.formExam.exam;
for(let o=0;o<ruleData.length;o++) {
if(ruleData[o].certificateId != '' && ruleData[o].certificateId != null) {
......@@ -1552,11 +1774,11 @@ export default {
}
}
// 1.单证书无规则
else {
if(this.formComponent.certificate != '' && this.formComponent.certificate != null) {
param.certificateId[0] = this.formComponent.certificate;
}
}
else {
if(this.formComponent.certificate != '' && this.formComponent.certificate != null) {
param.certificateId[0] = this.formComponent.certificate;
}
}
}
vm.POST("portal/portalInfo/componentDraft", param).then(res => {
console.log(res);
......@@ -1567,7 +1789,12 @@ export default {
if (res.code == "000000") {
//notify
if (type == 2) {
this.$router.push("item-manager");
let query = {}
if(this.$route.query.pageNum){
query = {pageNum:this.$route.query.pageNum}
}
this.$router.push({ path: 'item-manager',query:query })
// this.$router.push("item-manager?pageNum="+this.$route.query.pageNum);
}
}
});
......@@ -2352,10 +2579,7 @@ export default {
this.changedPerson2
);
},
selectionChangeDepartment(val) {
this.multipleSelectionDepartment = val;
//console.log(this.multipleSelectionDepartment);
},
//改变小生态 table check
selectionChangeEcology(rows) {
this.changedEcology = [];
......@@ -2868,6 +3092,13 @@ export default {
}
return true;
},
//判断通知展示问题
showAllowType() {
if(this.peopleLevel == 'L3' || this.peopleLevel == 'L0') {
return true;
}
return false;
},
//选择小生态
selectChangeEcology(value) {
this.formEcology.pageNum = 1;
......@@ -3071,12 +3302,21 @@ export default {
// }
},
addCertificate() {
if(vm.formExam.exam.length == 5){
return vm.$message('最多配置5个证书');
}
let obj = {
examCount: 1,
rangeMin: '',
rangeMax: '',
certificateId: '',
certificateName: '',
minClass:'',
minError:'',
maxClass:'',
maxError:'',
certClass:'',
certError:''
};
vm.formExam.exam.push(obj);
},
......@@ -3085,7 +3325,7 @@ export default {
if(vm.formExam.exam.length > 1) {
vm.formExam.exam.splice(index,1);
} else {
vm.$message('至少配置个证书');
vm.$message('至少配置1个证书');
}
},
//考试门数更新校验
......@@ -3184,68 +3424,258 @@ export default {
break;
}
}
vm.formExam.exam[index].certClass = ''
vm.formExam.exam[index].certError = ''
},
// add 校验输入是否为整数
checkIntFun(str){
let r = /^\+?[0-9]*$/;
return r.test(str);
},
//更新项目成绩评定条件
updateCertificateType() {
console.log('更新certificateType',vm.formExam.certificateType)
if(vm.formExam.certificateType == 2) {
if(vm.formExam.passType == 2) {
vm.formExam.exam = [{
examCount: 1,
rangeMin: '',
rangeMax: '',
certificateId: '',
certificateName: '',
minClass:'',
minError:'',
maxClass:'',
maxError:'',
certClass:'',
certError:''
}];
} else if(vm.formExam.certificateType == 1) {
} else if(vm.formExam.passType == 1) {
vm.formComponent.certificate = '';
}
},
//校验分数是否存在交叉
checkCrossFun(d){
let isRepart = false,index = null,parm = null;
//alert(d.length)
if( d.length > 0 ){
for(let i = 1;i < d.length;i++){
console.log(d[i-1].rangeMin,d[i-1].rangeMax)
if(parseInt(d[i-1].rangeMax) < parseInt(d[i-1].rangeMin)){
isRepart = true;
index = i-1;
parm = '1'
break;
}
if(d[i].rangeMin <= d[i-1].rangeMax && d[i].rangeMin >= d[i-1].rangeMin || d[i-1].rangeMax >= d[i].rangeMin && d[i-1].rangeMax <= d[i].rangeMax || d[i].rangeMax >= d[i-1].rangeMin && d[i].rangeMax <= d[i-1].rangeMax){
isRepart = true;
index = i;
parm = "2"
//alert(isRepart)
break;
}
if(parseInt(d[i].rangeMin) > parseInt(d[i].rangeMax)){
isRepart = true;
index = i;
parm = '3'
break;
}
}
}
console.log(parm)
return {isRepart:isRepart,index:index,parm:parm}
},
hideErrorInfo(str){
if(str){
this.customError[str] = {
className:'',
error:''
}
}else{
this.customError = {}
}
},
dioErrorPop(str){
return this.$message({
message: str,
type: 'warning'
});
},
//校验考试通过平均分配置
checkCertificate () {
if(vm.formComponent.configure == 2) {
return true;
// if(vm.formComponent.configure == 2) {
// return true;
// }
console.log(vm.formExam.exam)
if(vm.formExam.passType == 2) {
if(vm.formComponent.passExamCount == ''){
this.customError.passExamCount = {
className:'is-error',
error:'请输入门数'
}
return
}
if(vm.formComponent.passAverageScore == ''){
this.customError.passAverageScore = {
className:'is-error',
error:'请输入分数'
}
return
}
if(!vm.checkIntFun(vm.formComponent.passAverageScore)){
return vm.dioErrorPop('项目通过分数只能是数字')
}
}else if(vm.formExam.passType == 3){
if(vm.formComponent.passTotalLearnTime === '' || vm.formComponent.passTotalLearnTime == null){
vm.customError.passTotalLearnTime = {
className : 'is-error',
error : '请输入学习时长'
}
return
}
}
console.log(vm.formExam.exam)
//空判断
if(vm.formExam.certificateType == 2) {
let checkIdList = [];
for(let i=0;i<vm.formExam.exam.length;i++) {
checkIdList[i] = vm.formExam.exam[i].certificateId;
if(vm.formExam.exam[i].certificateId == ''){
vm.$message('证书不能为空');
return false;
}
if(vm.formExam.exam[i].examCount == ''){
vm.$message('考试门数不能为空');
return false;
if(vm.formComponent.configure == 1) {
if(vm.formExam.passType == 2){
let checkIdList = [];
var compare = function (obj1, obj2) {
var val1 = obj1.rangeMin;
var val2 = obj2.rangeMin;
if (val1 < val2) {
return -1;
} else if (val1 > val2) {
return 1;
} else {
return 0;
}
}
if(vm.formExam.exam[i].rangeMin == '' || vm.formExam.exam[i].rangeMax == ''){
vm.$message('分数不能为空');
return false;
vm.formExam.exam.sort(compare)
let isCross = vm.checkCrossFun(vm.formExam.exam).isRepart;
if(isCross){
let l = vm.checkCrossFun(vm.formExam.exam).index
if(parm == '1' || parm == '3'){
vm.formExam.exam[l].minClass = 'is-error'
vm.formExam.exam[l].minError = '分数最小值不能大于最大值'
//return;
}else if(parm == '2'){
vm.formExam.exam[l].minClass = 'is-error'
vm.formExam.exam[l].minError = '请重新输入,不能出现重合分数'
}
this.$set(vm.formExam.exam, l, vm.formExam.exam[l])
return
}
}
// 判断证书不能重复
checkIdList = checkIdList.sort();
for(let j=0;j<checkIdList.length-1;j++) {
if (checkIdList[j] == checkIdList[j+1]) {
vm.$message('证书不能重复选择');
return false;
for(let i=0;i<vm.formExam.exam.length;i++) {
if(vm.formExam.exam[i].rangeMin === '' ){
vm.formExam.exam[i].minClass = 'is-error'
vm.formExam.exam[i].minError = '请输入平均分'
this.$set(vm.formExam.exam, i, vm.formExam.exam[i])
return
}
vm.formExam.exam[i].minClass = ''
vm.formExam.exam[i].minError = ''
if(vm.formExam.exam[i].rangeMax === '' ){
vm.formExam.exam[i].maxClass = 'is-error'
vm.formExam.exam[i].maxError = '请输入平均分'
this.$set(vm.formExam.exam, i, vm.formExam.exam[i])
return
}
vm.formExam.exam[i].maxClass = ''
vm.formExam.exam[i].maxError = ''
if(parseInt(vm.formExam.exam[i].rangeMin) > parseInt(vm.formExam.exam[i].rangeMax)){
vm.formExam.exam[i].minClass = 'is-error'
vm.formExam.exam[i].minError = '分数最小值不能大于最大值'
this.$set(vm.formExam.exam, i, vm.formExam.exam[i])
return
}
if(vm.formExam.exam[i].certificateId == ''){
vm.formExam.exam[i].certClass = 'is-error'
vm.formExam.exam[i].certError = '请选择证书'
this.$set(vm.formExam.exam, i, vm.formExam.exam[i])
return
}
vm.formExam.exam[i].certClass = ''
vm.formExam.exam[i].certError = ''
if(parseInt(vm.formComponent.passAverageScore) > parseInt(vm.formExam.exam[i].rangeMin)){
vm.formExam.exam[i].minClass = 'is-error'
vm.formExam.exam[i].minError = '平均分不能低于考试通过分数'
vm.customError.passAverageScore = {
className :'is-error',
error:'平均分不能低于考试通过分数'
}
return
}
if(checkIdList.indexOf(vm.formExam.exam[i].certificateId) == -1){
checkIdList.push(vm.formExam.exam[i].certificateId)
}else{
vm.formExam.exam[i].certClass = 'is-error'
vm.formExam.exam[i].certError = '请重新选择,不能出现重复证书'
this.$set(vm.formExam.exam, i, vm.formExam.exam[i])
return;
}
this.customError.passAverageScore = {
className:'',
error:''
}
//checkIdList[i] = vm.formExam.exam[i].certificateId;
this.$set(vm.formExam.exam, i, vm.formExam.exam[i])
}
}
// 考试门数必须相同
for(let i=0;i<vm.formExam.exam.length-1;i++) {
if (vm.formExam.exam[i].examCount != vm.formExam.exam[i+1].examCount) {
vm.$message('考试门数必须相同');
return false;
// 判断证书不能重复
// checkIdList = checkIdList.sort();
// for(let j=0;j<checkIdList.length-1;j++) {
// if (checkIdList[j] == checkIdList[j+1]) {
// //vm.$message('证书不能重复选择');
// this.$message({
// message: '请重新选择,不能出现重复证书',
// type: 'warning'
// });
// return false;
// }
// }
// 考试门数必须相同
// for(let i=0;i<vm.formExam.exam.length-1;i++) {
// if (vm.formExam.exam[i].examCount != vm.formExam.exam[i+1].examCount) {
// // vm.$message('考试门数必须相同');
// this.$message({
// message: '考试门数必须相同',
// type: 'warning'
// });
// return false;
// }
// }
}else{
if(this.formComponent.certificate == ''){
vm.customError.certificate = {
className : 'is-error',
error : '请选择证书'
}
return;
}
}
} else if(vm.formExam.certificateType == 1) {
//组件通过即发放 证书必填
if(vm.formComponent.configure == 1 && vm.formExam.certificateType == 1) {
if(vm.formComponent.certificate == '') {
vm.$message('证书不能为空!');
return false;
}
}
// if(vm.formComponent.configure == 1 && vm.formExam.certificateType == 1) {
// if(vm.formComponent.certificate == '') {
// vm.$message('证书不能为空!');
// return false;
// }
// }
}
return true;
},
......@@ -3606,6 +4036,14 @@ export default {
};
</script>
<style lang="scss">
.min-label{
.el-form-item__label{
line-height: 26px;
}
.el-form-item__content{
line-height: 26px;
}
}
.add-manager-wrap {
.add-content {
background: #fff;
......@@ -3613,6 +4051,34 @@ export default {
.rim {
border: 1px solid #dddddd;
}
.mleft60{
margin-left:60px;
}
.soure-configure{
background: #F9F9F9;padding:15px;width:550px;font-size: 12px;color:#606266;position:relative;margin-bottom:20px;
.configure-option{
position: absolute;
right: -95px;
top:50%;
margin-top:-15px;
}
.mb15{margin-bottom:15px}
.configure-item{
overflow:hidden;
.configure-item-l{
display: inline-block;
width:60px;
text-align: right;
}
}
}
.mini-source{
background: #F9F9F9;width:650px;padding:15px;
margin-bottom:20px;
.source-item{
padding-top:0px;font-size:12px;line-height: 28px;color: #606266;
}
}
.step-content {
overflow: hidden;
height: 60px;
......
......@@ -80,7 +80,7 @@
import BreadCrumb from '../../components/breadcrumb.vue'
import { doUpload, getFilePath } from "../../utils/qiniu-util"
import { validateWord } from "../../utils/validate.js"
import { mapGetters } from 'vuex'
import { mapGetters,mapActions } from 'vuex'
import { openLoading, closeLoading } from '../../utils/utils'
import * as commonUtil from '../../utils/utils'
let vm = null
......@@ -145,6 +145,12 @@ export default {
vm = this
vm.idType = localStorage.getItem('storageIdType')
vm.masterAdministratorFlag = localStorage.getItem('storageMaster')
if(this.$route.query.pageNum){
console.log(this.$store.state.common.itemComponents)
vm.searchParam.status = this.$store.state.common.itemComponents.status
vm.searchParam.name = this.$store.state.common.itemComponents.name
vm.searchParam.pageNo = parseInt(this.$route.query.pageNum)
}
vm.search()
},
// 挂载到Dom完成时
......@@ -152,6 +158,9 @@ export default {
commonUtil.resizeHeight()
},
methods: {
...mapActions([
'updateItemComponents'
]),
// 列表查询
search(flag) {
if(flag) vm.searchParam.pageNo = 1
......@@ -190,7 +199,8 @@ export default {
}
vm.GET('portal/portalComponent/componentEditRange',req).then((res) => {
if(res.code == "000000") {
vm.$router.push({path: 'create-component',query: {id:row.id,status: row.status,resultFlag: res.data.resultFlag}})
vm.updateItemComponents({name:vm.searchParam.name,status:vm.searchParam.status})
vm.$router.push({path: 'create-component',query: {id:row.id,status: row.status,resultFlag: res.data.resultFlag,pageNum:vm.searchParam.pageNo}})
}else {
vm.$message.info(res.message)
}
......@@ -310,5 +320,3 @@ export default {
}
}
</style>
......@@ -195,7 +195,7 @@
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { mapGetters } from 'vuex'
import { mapGetters,mapActions } from 'vuex'
import { returnData } from "../../utils/mock";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
......@@ -260,7 +260,7 @@ export default {
if (this.formInline.projectEndtime != "" && this.formInline.projectEndtime !=null) {
return (
time.getTime() >
new Date(this.formInline.projectEndtime).getTime()
new Date(this.formInline.projectEndtime).getTime()
);
}
}
......@@ -269,7 +269,7 @@ export default {
disabledDate: time => {
return (
time.getTime() <
new Date(this.formInline.projectBegintime).getTime()
new Date(this.formInline.projectBegintime).getTime()
); //减去一天的时间代表可以选择同一天;
}
},
......@@ -279,7 +279,7 @@ export default {
},
computed: {
...mapGetters([
"_token",
"_token",
// "idType",
// "masterAdministratorFlag"
])
......@@ -289,6 +289,10 @@ export default {
vm.idType = localStorage.getItem('storageIdType');
vm.masterAdministratorFlag = localStorage.getItem('storageMaster');
console.log('idType:',vm.idType);
if(this.$route.query.pageNum){
this.formInline = {...this.$store.state.common.itemManager}
this.formInline.pageNo = parseInt(this.$route.query.pageNum)
}
this.$nextTick(function() {;
this.getProjectList();
});
......@@ -298,6 +302,9 @@ export default {
commonUtil.resizeHeight();
},
methods: {
...mapActions([
'updateItemManager'
]),
toPage() {
this.$router.push("edit-manager");
},
......@@ -359,8 +366,9 @@ export default {
let projectId = row.id;
let level = row.level;
if (type === 0) {
this.updateItemManager(this.formInline)
//编辑
this.$router.push("edit-manager?projectId=" + projectId +"&level="+level);
this.$router.push("edit-manager?projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo);
} else if (type === 7) {
//提醒审核
let req = {
......@@ -542,7 +550,7 @@ export default {
}
}
}
.el-tooltip__popper {
max-width:50%
.el-tooltip__popper {
max-width:50%
}
</style>
\ No newline at end of file
</style>
......@@ -150,7 +150,7 @@
index: 'report-list'
},
{
title: '导出下载',
title: '任务列表',
icon: 'el-icon-document',
index: 'export-download'
}
......
<template>
<div class="data-alignment">
<div class="alignment-header">
<el-row>
<el-col :span="18">
<div class="title">数据调整</div>
</el-col>
<el-col :span="3">
<el-button class="add-button" size="small" type="primary" @click="saveUpdate">保存修改</el-button>
</el-col>
<el-col :span="3">
<el-button class="add-button" size="small" @click="close">取消</el-button>
</el-col>
</el-row>
</div>
<div class="text">
<p>地区:{{ dialogData.region }}</p>
<p>选择机构:{{ dialogData.organization }}</p>
</div>
<el-form
class="form-update"
ref="serchForm"
:model="formData"
label-width="100px"
style="width:40%;"
>
<el-form-item label="项目成绩:">
<el-select
v-model="formData.achievementStatus"
size="small"
style="width: 100%;"
placeholder="请选择项目成绩"
>
<el-option
v-for="(item,index) in achievementList"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="统计状态:">
<el-select
v-model="formData.status"
size="small"
style="width: 100%;"
placeholder="请选择统计状态"
>
<el-option
v-for="(item,index) in statusList"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="姓名:">
<el-input v-model="formData.doctorName" placeholder="请输入人员名称"></el-input>
</el-form-item>
</el-form>
<div class="form-button">
<el-button @click="searchData()" type="primary">查询</el-button>
<el-button @click="resetForm()">重置</el-button>
</div>
<!-- <div class="line"></div> -->
<p class="explain">说明:只有被勾选中的人才会归入数据统计范围,不勾的不会统计</p>
<el-table
class="data-main"
border
center
ref="multipleTable"
:data="tableData"
tooltip-effect="dark"
@selection-change="handleSelectionChange"
:row-key="getRowKeys"
>
<el-table-column type="selection" width="55" :reserve-selection="true"></el-table-column>
<el-table-column prop="name" label="姓名" min-width="80"></el-table-column>
<el-table-column prop="projectStatus" label="项目状态" width="120">
<template slot-scope="scope">{{ scope.row.projectStatus | projectStatus }}</template>
</el-table-column>
<el-table-column prop="projectResult" label="项目成绩" width="120">
<template slot-scope="scope">{{ scope.row.projectResult | recordValue }}</template>
</el-table-column>
<el-table-column prop="hospitalName" label="机构" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="departmentName" label="科室" show-overflow-tooltip></el-table-column>
<el-table-column prop="provinceName" label="省/直辖市" show-overflow-tooltip></el-table-column>
<el-table-column prop="cityName" label="市" show-overflow-tooltip></el-table-column>
<el-table-column prop="countyName" label="区/县" show-overflow-tooltip></el-table-column>
<el-table-column prop="townName" label="乡镇/街道" show-overflow-tooltip></el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png" />
<p>没有相关数据,请重新选择查询范围</p>
</div>
</div>
</el-table>
<!-- 分页 -->
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formData.pageNo"
:page-sizes="[20, 50 ,100]"
:page-size="formData.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
<el-dialog title="发布学情报告" :visible.sync="dialogVisible" width="30%" append-to-body>
<p style="color:red">项目【{{ projectName }}】的数据修改</p>
<p>确认需要更新学情报告吗?</p>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="updateData()">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as operationData from "../../utils-o/operation";
let vm;
export default {
props: {
formInline: {
type: Object
},
organizationList: {
type: Array
},
dialogData: {
type: Object
}
},
data() {
return {
formData: {
achievementStatus: "",
status: 1,
doctorName: '',
pageNo: 1,
pageSize: 20,
},
achievementList: [
//项目状态
{
label: "全部",
value: '',
},
{
label: "通过",
value: 1
},
{
label: "不通过",
value: 2
},
{
label: "无成绩",
value: 3
}
],
statusList: [
//项目状态
{
label: "全部",
value: 1
},
{
label: "归入统计",
value: 2
},
{
label: "移除统计",
value: 3
},
],
tableData: [],
multipleSelection: [], //被选中的行
totalRows: 0, //数据总数
getRowKeys(row) {
return row.doctorId;
},
selectedData: [],
dialogVisible: false,
projectId: "",
projectName: "",
changedDoctor: [],
changedDoctor2: [],
lookedDoctor: [],
};
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
this.projectName = vm.getUrlSearch(window.location.href, "projectName");
// this.search();
console.log(vm.dialogData);
},
mounted: function() {
//父组件传值
this.$on("search", () => {
// this.lookedDoctor = [];
// this.changedDoctor = [];
// this.changedDoctor2 = [];
// this.$refs.multipleTable.clearSelection();
this.resetForm();
// this.search();
});
},
methods: {
// 将选中行放入数组
handleSelectionChange(rows) {
this.changedDoctor = [];
this.changedDoctor2 = [];
this.selectedData = [];
if (rows) {
rows.forEach(row => {
if (row) {
this.changedDoctor.push(row.doctorId);
}
});
}
this.changedDoctor2 = operationData.getDifference(
this.lookedDoctor,
this.changedDoctor
);
console.log(
"选",
this.changedDoctor,
"没",
this.changedDoctor2
);
},
// 更改数据显示数量
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
vm.formData.pageSize = val;
vm.search();
},
// 换页
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
vm.formData.pageNo = val;
vm.search();
},
close() {
this.$emit("closeDialog");
},
searchData() {
vm.formData.pageNo = 1;
vm.search();
},
search() {
setTimeout(function(){
openLoading(vm);
},20);
let checkAll = operationData.hasAll(vm.formInline.organization);
let req = {
projectId: vm.projectId,
achievementStatus: vm.formData.achievementStatus,
status: vm.formData.status,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
doctorName: vm.formData.doctorName,
pageNo: vm.formData.pageNo,
pageSize: vm.formData.pageSize,
};
vm.reportGET("report/portal/getProjectData", req).then(res => {
// closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.projectData;
vm.totalRows = res.data.count;
let idList = operationData.getDoctorIdList(vm.tableData);
// console.log('idList',idList);
vm.lookedDoctor = operationData.getUnion(
vm.lookedDoctor,
idList
);
vm.initDoctorChoose();
}
});
},
initDoctorChoose() {
let tableStatus = vm.tableData;
if(typeof tableStatus === 'undefined') {
return;
}
tableStatus.forEach(row => {
let idList = [];
idList[0] = row.doctorId;
let intersect = operationData.getIntersect(idList,this.changedDoctor);
let intersect2 = operationData.getIntersect(idList,this.changedDoctor2);
// console.log('intersect',intersect,'intersect2',intersect2);
//debugger;
if(intersect.length > 0) {
//选中
//this.$refs.multipleOrganization.toggleRowSelection(row);
} else if (intersect2.length > 0) {
//不选
} else {
if (row.status == 1) {
this.$nextTick(function() {
this.$refs.multipleTable.toggleRowSelection(row);
});
}
}
});
},
//重置
resetForm() {
this.lookedDoctor = [];
this.changedDoctor = [];
this.changedDoctor2 = [];
this.$refs.multipleTable.clearSelection();
vm.formData = Object.assign(
{},
{
achievementStatus: "",
status: 1,
doctorName: '',
pageNo: 1,
pageSize: 20,
}
);
vm.search();
},
saveUpdate() {
this.dialogVisible = true;
},
updateData() {
let req = {
projectId: vm.projectId,
removeDoctorIdList: operationData.getAjustmentList(vm.changedDoctor2),
joinDoctorIdList: operationData.getAjustmentList(vm.changedDoctor),
};
openLoading(vm);
vm.reportPOST("report/portal/peopleAdjustment", req).then(res => {
closeLoading(vm);
vm.$message(res.message);
if (res.code == "000000") {
this.$emit("closeSearch");
}
});
this.dialogVisible = false;
}
}
};
</script>
<style lang='scss' rel='stylesheet/scss'>
.data-alignment {
background: #fff;
.alignment-header {
padding: 20px;
margin: 0 30px;
border-bottom: 1px solid #606266;
}
.text {
margin-top: 30px;
margin-left: 98px;
font-size: 13px;
color: #606266;
}
.form-update {
margin: 30px 0px 0px 60px;
}
.form-button {
width: 45%;
top: -62px;
position: relative;
left: 50%;
}
.line {
margin: -20px 30px 30px 30px;
width: 100%;
border-bottom: 1px solid #606266;
}
.explain {
margin: 10px 0 10px 38px;
font-size: 13px;
color: #606266;
}
.data-main {
margin-left: 36px;
width: 90%;
// padding: 0 40px;
.select {
margin-bottom: 30px;
}
}
.pagination {
margin-right: 10px;
}
}
</style>
<template>
<div class="export-download">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<p>导出文件列表</p>
<el-table :data="tableData" style="width: 100%">
<el-table-column
prop="title"
label="名称"
align="center"
min-width="150"
show-overflow-tooltip
></el-table-column>
<el-table-column prop="createdTime" label="时间" align="center" min-width="120">
<template slot-scope="scope">{{ scope.row.createdTime }}</template>
</el-table-column>
<el-table-column prop="status" label="状态" align="center" min-width="150">
<template slot-scope="scope">{{ scope.row.status | exportStatus }}</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="70">
<template slot-scope="scope">
<el-button
type="primary"
:disabled="scope.row.buttonStatus"
size="small"
@click="update(scope.row)"
>{{ scope.row.buttonText }}</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png" />
<p>没有相关数据,请重新选择查询范围</p>
</div>
</div>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="param.pageNo"
:page-sizes="[20, 50 ,100]"
:page-size="param.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
</div>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import * as commonUtil from "../../utils-o/utils";
import { openLoading, closeLoading } from "../../utils-o/utils";
import axios from "axios";
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
return {
curmbFirst: "学情报告",
curmbSecond: "导出下载",
projectId: "",
tableData: [],
param: {
pageSize: 20,
pageNo: 1
},
totalRows: 0,
totalTime: 3,
queryData: {}
// buttonText: "刷新",
// buttonStatus: false,
};
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "projectId");
this.search();
},
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
setButton() {
for (let i = 0; i < vm.tableData.length; i++) {
vm.tableData[i].index = i;
if (vm.tableData[i].status == 1) {
vm.tableData[i].buttonText = "下载";
vm.tableData[i].buttonStatus = false;
} else if(vm.tableData[i].status == 0) {
vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = false;
} else if(vm.tableData[i].status == 2) {
vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = true;
}
}
},
search() {
// this.setButton();
let req = {
projectId: vm.projectId
};
if(req.projectId == null) {
req.projectId = '';
}
vm.reportGET("report/downLoad/getDownloadList", req).then(res => {
if (res.code == "000000") {
vm.tableData = res.data.data;
vm.totalRows = res.data.totalRows;
vm.setButton();
}
});
},
downLoad(row) {
// vm.queryData = this.$route.query;
// let req = vm.queryData;
// openLoading(vm);
// vm.reportGET("report/downLoad/downLoad", req).then(res => {
// closeLoading(vm);
// // console
// if (res.code == "000000") {
// }
// });
setTimeout(() => {
window.open(row.fileUrl);
}, 500);
},
getDownLoadStatus(row) {
let req = {
id: row.id
};
vm.reportGET("report/downLoad/getDownLoadStatus", req).then(res => {
if (res.code == "000000") {
vm.tableData[row.index].status = res.data.data;
// console.log('res.data.data',res.data.data);
if (res.data.data == 1) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "下载";
vm.tableData[row.index].fileUrl = res.data.url;
} else if(res.data.data == 0) {
console.log("res", res, vm.tableData[row.index]);
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新";
} else if(res.data.data == 2) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新";
vm.tableData[row.index].buttonStatus = true;
}
} else {
vm.$message(res.message);
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新";
}
});
},
update(row) {
if (vm.tableData[row.index].status == 1) {
vm.downLoad(row);
} else {
this.$nextTick(function() {
console.log(vm.tableData[row.index]);
let nowTime = vm.totalTime;
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = nowTime + "s后可以刷新";
vm.tableData[row.index].buttonStatus = true;
let clock = window.setInterval(() => {
nowTime--;
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = nowTime + "s后可以刷新";
if (nowTime <= 0) {
window.clearInterval(clock);
vm.tableData[row.index].title =
vm.tableData[row.index].title + " ";
// vm.tableData[row.index].buttonText = "刷新";
vm.tableData[row.index].buttonStatus = false; //这里重新开启
vm.getDownLoadStatus(row);
}
}, 1000);
});
}
},
// 更改数据显示数量
handleSizeChange(val) {
vm.param.pageSize = val;
vm.search();
},
// 换页
handleCurrentChange(val) {
vm.param.pageNo = value;
vm.search();
}
}
};
</script>
<style lang="scss">
.export-download {
.component-content {
background: #fff;
padding: 10px;
}
}
</style>
\ No newline at end of file
<template>
<div class="course-analysis-wrap">
<div v-for="(item , index) in cardData" :key="index" class="">
<el-card class="box-card">
<div slot="header" class="title">
<span class="weight">{{ item.title }}</span>
</div>
<div class="box-content">
<span v-if="item.num !=0" class="weight">{{ item.num }} </span>
<span v-if="item.num !=0">{{ item.unit }} </span>
<span v-if="index == 2 && second !=0" class="weight" >{{ second }} </span>
<span v-if="index == 2 && second !=0"></span>
</div>
</el-card>
<div v-if="index+1 !== cardData.length" class="line"></div>
</div>
<el-table
:data="tableData"
class="course-table">
<el-table-column prop="courseName" label="课程名" align="center">
</el-table-column>
<el-table-column prop="courseTotalTime" label="课程时长" align="center">
<template slot-scope="scope">
{{ scope.row.courseTotalTime | getTotalTime }}
</template>
</el-table-column>
<el-table-column prop="courseAvgStudyTime" label="人均学习时长" align="center">
<template slot-scope="scope">
{{ scope.row.courseAvgStudyTime | getAvgTime }}
</template>
</el-table-column>
<el-table-column prop="courseLearnerCount" label="参与培训人数" align="center">
</el-table-column>
<el-table-column prop="courseFinishedCount" label="完成培训人数" align="center">
</el-table-column>
<el-table-column fixed="right" label="操作" min-width="50" align="center">
<template slot-scope="scope">
<el-button
@click="checkName(scope.row)"
type="text"
size="small"
>查看名单</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有相关数据,请重新选择查询范围</p>
</div>
</div>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-sizes="[20, 50 ,100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
</div>
</template>
<script>
import { create } from "domain";
import * as operationData from "../../utils-o/operation";
import { openLoading, closeLoading } from "../../utils-o/utils";
let vm = null;
export default {
props: {
formInline: {
type: Object
},
activeName: {
type: String
},
dialogData: {
type: Object
},
organizationList: {
type: Array
}
},
data() {
return {
cardData: [],
tableData: [],
totalRows: 0,
projectId: '',
pageNo: 1,
pageSize: 20,
second: 0,
}
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
},
mounted: function() {
this.$on('search',()=>{
// console.log(this.formInline);
this.pageNo = 1;
this.search();
});
this.$on("init", () => {
this.$nextTick(function() {
if (vm.formInline.region.length != 0) {
this.search();
}
});
});
this.$on("reset",() =>{
this.pageNo = 1;
this.pageSize = 20;
this.tableData = [];
this.cardData = [];
});
},
methods: {
setCardData(data) {
vm.totalRows = data.projectCourseCount;
let avgTime = [];
avgTime = operationData.getAvgTime(data.projectAvgStudyTime);
vm.cardData = [
{
title: '项目所有课程数',
num: data.projectCourseCount,
unit: '门课程',
},{
title: '项目所有课程总时长',
num: data.projectCourseTotalTime,
unit: '分钟',
},{
title: '项目人均学习时长',
num: avgTime[0],
unit: '分钟',
}
];
vm.second = avgTime[1];
},
search() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行查询 ')
});
return;
}
let checkAll = operationData.hasAll(vm.formInline.organization)
let req = {
projectId: vm.projectId,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
originalFlag: vm.formInline.checked == false ? 0 : 1
};
console.log("3 req", req);
openLoading(vm);
vm.reportGET("report/portalProjectCourse/getTotal", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.projectCourseCount == 0 ) {
vm.$message("没有相关数据,请重新选择查询范围");
}
vm.setCardData(res.data)
} else {
vm.$message(res.message);
}
});
let reqList = req;
reqList.pageNo = vm.pageNo;
reqList.pageSize = vm.pageSize;
vm.reportGET("report/portalProjectCourse/getCourseList", reqList).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.list;
}
});
},
checkName(data) {
console.log('dialogData',this.dialogData);
let checkAll = operationData.hasAll(vm.formInline.organization)
let routerData = {};
routerData = this.dialogData;
routerData.projectId = vm.projectId;
routerData.projectName = vm.getUrlSearch(window.location.href, "projectName");
routerData.tableType = 1;
routerData.courseId = data.courseId;
routerData.ids = operationData.getIds(vm.formInline,vm.organizationList,checkAll);
routerData.type = operationData.getSearchType(vm.formInline,checkAll);
routerData.originalFlag = vm.formInline.checked == false ? 0 : 1;
// this.$router.push({ path: '/name-list-old', query: routerData});
let routeData = this.$router.resolve({ path: '/name-list-old', query: routerData});
window.open(routeData.href, '_blank');
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
vm.pageSize = val;
vm.search();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
vm.pageNo = val;
vm.search();
},
},
}
</script>
<style lang="scss">
.course-analysis-wrap {
background: #fff;
overflow: hidden;
padding: 10px;
.weight {
font-weight: bold;
}
.title:after {
clear: both
}
.el-card {
border-width: 0px;
}
.el-card.is-always-shadow {
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
}
.line {
background: #e4e4e4;
height: 80px;
width: 1px;
float: left;
margin-top: 20px;
}
.box-card {
width: 32%;
margin-right: 1%;
float: left;
.el-card__header {
border-bottom-width: 0;
}
.title {
text-align: center;
}
.box-content {
text-align: center;
height: 40px;
}
}
.course-table {
top: 20px;
margin-bottom: 20px;
}
}
</style>
\ No newline at end of file
<template>
<div class="crowd-analysis-wrap">
<el-radio-group class="crowd-radio" v-model="radio" size="small" @change="updateRadio">
<el-radio-button label="1">全部用户</el-radio-button>
<el-radio-button label="2">参与项目</el-radio-button>
<el-radio-button label="3">通过项目</el-radio-button>
</el-radio-group>
<div v-show="!showData" class="empty">
<p>"没有相关数据,请重新选择查询范围"</p>
</div>
<div class="chart" v-show="showData">
<div class="item" id="education" ref="education"></div>
<div class="item item-right" id="job" ref="job"></div>
<div class="item">
<div class="title">用户性别分布</div>
<div class="sex">
<div class="sex-item" v-for="(item , index) in sexData" :key="index">
<img class="sex-img" v-bind:src="item.src" />
<p class="sex-type">{{ item.type }}</p>
<p></p>
<p class="sex-num">{{ item.num }}</p>
</div>
</div>
</div>
<div class="item item-right" id="age" ref="age"></div>
</div>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as commonUtil from "../../utils-o/utils";
import * as operationData from "../../utils-o/operation";
import echarts from "echarts";
import { setTimeout } from "timers";
let vm = null;
export default {
components: {
BreadCrumb
},
props: {
formInline: {
type: Object
},
activeName: {
type: String
},
organizationList: {
type: Array
}
},
data() {
return {
radio: 1,
sexData: [],
projectId: "",
crowdData: {},
showData: false,
echartsData: {
chart1: {},
chart2: {},
chart3: {},
},
};
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
},
mounted: function() {
// commonUtil.resizeHeight();
//父组件传值
this.$on("search", () => {
vm.radio = 1;
this.search();
});
this.$on("init", () => {
this.$nextTick(function() {
if (vm.formInline.region.length != 0) {
this.search();
}
});
});
this.$on("reset", () => {
this.showData = false;
this.crowdData = {};
});
if (this.activeName == "second") {
}
},
methods: {
search() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行查询 ')
});
return;
}
let checkAll = operationData.hasAll(vm.formInline.organization);
let req = {
projectId: vm.projectId,
cityOrHospitalId: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
kind: operationData.getSearchType(vm.formInline,checkAll),
type: vm.radio,
originalFlag: vm.formInline.checked == false ? 0 : 1
};
console.log("2 req", req);
openLoading(vm);
vm.reportGET("report/portal/getPeoplesDetails", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.educationList.length == 0 && res.data.jobTitle.length == 0 ) {
vm.$message("没有相关数据,请重新选择查询范围");
this.showData = false;
} else {
this.showData = true;
}
this.crowdData = res.data;
setTimeout(function() {
vm.educationDivision();
vm.jobDivision();
vm.getSexData();
vm.ageDivision();
},20);
// this.educationDivision();
// this.jobDivision();
// this.getSexData();
// this.ageDivision();
} else {
vm.$message(res.message);
}
});
},
updateResize() {
this.$nextTick(function() {
window.onresize = function() {
vm.echartsData.chart1.resize();
vm.echartsData.chart2.resize();
vm.echartsData.chart3.resize();
};
});
},
updateRadio(value) {
console.log(value,vm.radio);
this.search();
},
//用户性别分布
getSexData() {
let sexList = this.crowdData.sexList;
// if(sexList.length <3) {
// this.sexData = [];
// return;
// }
this.sexData = [
{
src: require("../../assets/image/man.png"),
type: "男性",
num: 0
},
{
src: require("../../assets/image/weman.png"),
type: "女性",
num: 0
},
{
src: require("../../assets/image/question.png"),
type: "未完善信息",
num: 0
}
];
for(let i=0;i<sexList.length;i++) {
if(sexList[i].name == "男") {
this.sexData[0].num = sexList[i].value;
} else if(sexList[i].name == "女") {
this.sexData[1].num = sexList[i].value;
} else {
this.sexData[2].num = sexList[i].value;
}
}
},
educationDivision(data) {
let myChart = echarts.init(this.$refs.education);
let educationList = operationData.removeZero(this.crowdData.educationList);
let legendData = [];
let seriesData = [];
let colorData = ["#FF9F7F", "#008000", "#E062AE", "#37A2DA", "#0050DC", "#67E0E3", "#8A2BE2"];
// for (let i = 0; i < educationList.length; i++) {
// legendData[i] = educationList[i].name;
// }
if(educationList.length > 0) {
legendData = ['博士后','博士','硕士','本科','大专','中专及以下','其他'];
}
seriesData = educationList;
let option = operationData.getPicOption(
"用户学历分布",
legendData,
colorData,
seriesData
);
myChart.setOption(option);
vm.echartsData.chart1 = myChart;
vm.updateResize();
},
jobDivision(data) {
let myChart2 = echarts.init(this.$refs.job);
let jobTitle = operationData.removeZero(this.crowdData.jobTitle);
let legendData = [];
let seriesData = [];
let colorData = ["#FF9F7F", "#008000", "#E062AE", "#37A2DA", "#0050DC", "#67E0E3", "#8A2BE2"];
for (let i = 0; i < jobTitle.length; i++) {
legendData[i] = jobTitle[i].name;
}
seriesData = jobTitle;
let option = operationData.getPicOption(
"用户职务分布",
legendData,
colorData,
seriesData
);
myChart2.setOption(option);
vm.echartsData.chart2 = myChart2;
vm.updateResize();
},
ageDivision(data) {
let myChart3 = echarts.init(this.$refs.age);
let xAxisData = [];
let seriesData = [];
let ageList = this.crowdData.ageList;
for (let i = 0; i < ageList.length; i++) {
// xAxisData[i] = ageList[i].name;
if(ageList[i].value != 0) {
xAxisData.push(ageList[i].name);
}
}
for (let i = 0; i < ageList.length; i++) {
// seriesData[i] = ageList[i].value;
if(ageList[i].value != 0) {
seriesData.push(ageList[i].value);
}
}
let option = operationData.getBarOption(xAxisData, seriesData);
myChart3.setOption(option);
vm.echartsData.chart3 = myChart3;
vm.updateResize();
}
}
};
</script>
<style lang="scss">
.crowd-analysis-wrap {
background: #fff;
overflow: hidden;
padding: 10px;
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.crowd-radio {
position: relative;
left: 50%;
margin-top: 25px;
margin-left: -119px;
.is-active {
.el-radio-button__inner {
// background: #fff;
// color: #409EFF;
}
}
}
.empty {
height: 300px;
line-height: 300px;
color: #FF3399;
text-align: center;
}
.chart {
position: relative;
margin: 20px auto 0 auto;
width: 100%;
// overflow: auto;
.item {
position: relative;
float: left;
margin-top: 20px;
padding: 0;
width: 48%;
// height: 20vw;
height: 350px;
border: 1px solid #dedede;
.title {
position: relative;
margin: 15px auto 10px auto;
font-size: 18px;
text-align: center;
font-weight: bold;
}
.sex {
position: relative;
top: 42px;
left: 0;
.sex-item {
float: left;
height: 350px;
width: 33.3%;
.sex-img {
margin: 0 auto;
position: relative;
left: 10%;
// width: 80%;
width: 60%;
margin-left: 10%;
}
.sex-type {
text-align: center;
}
.sex-num {
margin-top: 40px;
font-size: 30px;
font-weight: bold;
text-align: center;
}
}
}
}
.item-right {
float: right;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="examination-analysis">
<div v-for="(item , index) in cardData" :key="index" class="box">
<el-card class="box-card">
<div slot="header" class="title">
<span class="weight">{{ item.title }}</span>
</div>
<div class="box-content">
<span class="weight">{{ item.num }}</span>
{{ item.unit }}
</div>
</el-card>
<div v-if="index+1 !== cardData.length" class="line"></div>
</div>
<div class="table">
<el-table :data="tableData" style="width: 100%" border>
<el-table-column prop="examName" label="考试名" min-width="150" align="center"></el-table-column>
<el-table-column prop="examUserCount" label="参与考试人数" min-width="100" align="center"></el-table-column>
<el-table-column prop="userCountForPassExam" label="通过考试人数" min-width="80" align="center"></el-table-column>
<el-table-column v-if="showTd[0]" prop="userCountList[0]" :label="labelTd[0]" min-width="80" align="center"></el-table-column>
<el-table-column v-if="showTd[1]" prop="userCountList[1]" :label="labelTd[1]" min-width="80" align="center"></el-table-column>
<el-table-column v-if="showTd[2]" prop="userCountList[2]" :label="labelTd[2]" min-width="80" align="center"></el-table-column>
<el-table-column v-if="showTd[3]" prop="userCountList[3]" :label="labelTd[3]" min-width="80" align="center"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="100">
<template slot-scope="scope">
<el-button type="text" size="small" @click="goPage(scope.row)">查看名单</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有相关数据,请重新选择查询范围</p>
</div>
</div>
</el-table>
</div>
<!-- 分页 -->
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-sizes="[20, 50 ,100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
</div>
</template>
<script>
import { log } from 'util';
import * as operationData from "../../utils-o/operation";
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as commonUtil from "../../utils-o/utils";
let vm
export default {
props: {
formInline: {
type: Object
},
activeName: {
type: String
},
dialogData: {
type: Object
},
organizationList: {
type: Array
}
},
data() {
return {
projectId: '',
tableData: [],
cardData: [],
totalRows: 0, //数据总数
pageNo: 1, //当前是第几页
pageSize: 20, //页面总数
labelTd: [],
showTd: [false,false,false,false],
};
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
},
// 挂载到Dom完成时
mounted: function() {
this.$on('search',()=>{
// console.log(this.formInline);
this.pageNo = 1;
this.search();
});
this.$on("init", () => {
this.$nextTick(function() {
if (vm.formInline.region.length != 0) {
this.search();
}
});
});
this.$on("reset",() =>{
this.pageNo = 1;
this.pageSize = 20;
this.tableData = [];
this.cardData = [];
});
},
methods: {
setCardData(data) {
vm.totalRows = data.projectExamCount;
vm.cardData = [
{
title: "项目所有考试数",
num: data.projectExamCount,
unit: "门考试"
},
{
title: "项目所有考题数",
num: data.projectExamQuestionCount,
unit: "道题"
}
];
// vm.cardData[0].num = data.projectExamCount;
// vm.cardData[1].num = data.projectExamQuestionCount;
},
// 搜索列表
search() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行查询 ')
});
return;
}
let checkAll = operationData.hasAll(vm.formInline.organization)
let req = {
projectId: vm.projectId,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
originalFlag: vm.formInline.checked == false ? 0 : 1
};
console.log("4 req", req);
openLoading(vm);
vm.reportGET("report/portalProjectExam/getTotal", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.projectExamCount == 0 ) {
vm.$message("没有相关数据,请重新选择查询范围");
}
vm.setCardData(res.data);
vm.labelTd = res.data.gradeNameList;
} else {
vm.$message(res.message);
}
});
let reqList = req;
reqList.pageNo = vm.pageNo;
reqList.pageSize = vm.pageSize;
vm.reportGET("report/portalProjectExam/getExamList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.list;
if(res.data.list.length == 0) {
return;
}
if(res.data.list[0].userCountList == null || res.data.list[0].userCountList.length == 0) {
vm.showTd = [false,false,false,false];
} else if (res.data.list[0].userCountList.length == 1){
vm.showTd = [true,false,false,false];
} else if (res.data.list[0].userCountList.length == 2){
vm.showTd = [true,true,false,false];
} else if (res.data.list[0].userCountList.length == 3){
vm.showTd = [true,true,true,false];
} else if (res.data.list[0].userCountList.length == 4){
vm.showTd = [true,true,true,true];
}
}
});
//
},
// 跳转查看名单页面
goPage(data) {
let checkAll = operationData.hasAll(vm.formInline.organization)
let routerData = {};
routerData = this.dialogData;
routerData.projectId = vm.projectId;
routerData.projectName = vm.getUrlSearch(window.location.href, "projectName");
routerData.tableType = 2;
routerData.examId = data.examId;
routerData.ids = operationData.getIds(vm.formInline,vm.organizationList,checkAll);
routerData.type = operationData.getSearchType(vm.formInline,checkAll),
routerData.originalFlag = vm.formInline.checked == false ? 0 : 1
// this.$router.push({ path: '/name-list-old', query: routerData});
let routeData = this.$router.resolve({ path: '/name-list-old', query: routerData});
window.open(routeData.href, '_blank');
},
// 更改数据显示数量
handleSizeChange(val) {
console.log(`每页 ${val} 条`)
vm.pageSize = val
vm.search()
},
// 换页
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
vm.pageNo = val
vm.search()
}
}
};
</script>
<style lang='scss' rel='stylesheet/scss'>
.examination-analysis {
background: #fff;
overflow: hidden;
padding: 10px;
.weight {
font-weight: bold;
}
.el-card {
border-width: 0px;
}
.el-card.is-always-shadow {
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
}
.line {
background: #e4e4e4;
height: 80px;
width: 1px;
float: left;
margin-top: 20px;
}
.box {
}
.table {
margin-top: 30px;
}
.box-card {
width: 48%;
margin-right: 1%;
float: left;
.el-card__header {
border-bottom-width: 0;
}
.title {
text-align: center;
}
.box-content {
text-align: center;
height: 40px;
font-size: 15px;
}
}
}
</style>
<template>
<div class="learning-effect">
<div class="learning" ref="learning"></div>
<div class="education" ref="education"></div>
</div>
</template>
<script>
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as commonUtil from "../../utils-o/utils";
const echarts = require("echarts");
export default {
data() {
return {};
},
mounted() {
commonUtil.resizeHeight();
this.initEcharts();
},
methods: {
// 初始化图表
initEcharts() {
openLoading(this);
let trainChart = echarts.init(this.$refs["learning"]);
let educationChart = echarts.init(this.$refs["education"]);
let trainPara = {
color: ["#FF9999", "#66CCFF"],
text: '培训前后知识点掌握情况变化',
xAxisData: [
"转诊与履约",
"转诊与履约",
"周三",
"治疗原则及降压目标",
"周五",
"治疗原则及降压目标",
"周日"
],
seriesBeforeDate: [20, 32, 31, 34, 39, 33, 32],
seriesAfterDate: [86, 10, 96, 10, 16, 16, 15]
}
let educationPara = {
color: ["#33FFFF", "#FF9999"],
text: '不同学历培训前后正确率对比',
xAxisData: [
"转诊与履约",
"转诊与履约",
"周三",
"治疗原则及降压目标",
"周五",
"治疗原则及降压目标",
"周日"
],
seriesBeforeDate: [20, 32, 31, 34, 39, 33, 32],
seriesAfterDate: [86, 10, 96, 10, 16, 16, 15]
};
// 显示图表。
trainChart.setOption(this.echartOptions(trainPara));
educationChart.setOption(this.echartOptions(educationPara));
closeLoading(this)
},
// 图表的参数
echartOptions(parameter) {
let option = {
color: parameter.color,
title: {
text: parameter.text,
x: "center",
textStyle: {
//主标题文本样式
fontSize: 16,
fontWeight: "bolder",
color: "#333"
}
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow"
}
},
legend: {
data: ["培训前正确率", "培训后正确率"],
right: 0,
top: 20
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: [
{
type: "category",
data: parameter.xAxisData,
axisLabel: {
//坐标轴刻度标签的相关设置。
interval: 0,
rotate: "45"
}
}
],
yAxis: [
{
name: "比率(%)",
type: "value",
axisLabel: {
show: true,
interval: "auto",
formatter: "{value} %"
},
show: true,
axisLine: {
// 轴线
show: false
}
}
],
series: [
{
name: "培训前正确率",
type: "bar",
barGap: "20%",
barMaxWidth: "50",
itemStyle: {
normal: {
label: {
show: true,
position: "top",
formatter: "{c}%"
}
}
},
data: parameter.seriesBeforeDate
},
{
name: "培训后正确率",
type: "bar",
barGap: "20%",
barMaxWidth: "50",
itemStyle: {
normal: {
label: {
show: true,
position: "top",
formatter: "{c}%" //这是关键,在需要的地方加上就行了
}
}
},
data: parameter.seriesAfterDate
}
]
};
return option;
}
}
};
</script>
<style lang='scss' rel='stylesheet/scss'>
.learning-effect {
width: 100%;
.learning,
.education {
margin-top: 40px;
min-width: 400px;
height: 400px;
background: #fff;
}
}
</style>
<template>
<div class="item-list-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird" :jumPathThird="jumPathThird"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<el-form class="item-form" ref="formInline" :model="formInline" label-width="80px">
<el-form-item label="选择地区:">
<!-- :props="props" -->
<el-cascader
size="small"
ref="cascaderRegion"
:options="optionsRegion"
:props="props"
v-model="formInline.region"
@change="handleChange"
filterable
change-on-select
placeholder="请先选择地区后再进行查询"
style="width:330px"
></el-cascader>
</el-form-item>
<el-form-item label="选择机构:">
<el-select
size="small"
v-model="formInline.organization"
:placeholder="organizationNotice"
@change="changeOrganization"
multiple
collapse-tags
:disabled="formInline.region.length < 3"
style="width:330px"
>
<el-option
v-for="item in organizationList"
:key="item.index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<div class="tag-group">
<el-tag
v-for="tag in tags"
:key="tag.value"
type="info"
closable
@close="handleTagClose(tag)"
>{{ tag.label }}</el-tag>
</div>
<el-form-item label v-if="showOriginal == 1">
<el-checkbox size="small" v-model="formInline.checked">查看原始数据</el-checkbox>
</el-form-item>
</el-form>
<div class="form-button">
<el-button @click="search()" type="primary">查询</el-button>
<el-button @click="resetForm()">重置</el-button>
</div>
<div class="button-group">
<el-button v-if="roleType == 'L1' || roleType == 'L2'" type="default" size="small" @click="changeDate">数据修改</el-button>
<!-- <el-button type="default" size="small" @click="update" v-else>修改范围</el-button> -->
<el-button type="default" size="small" :disabled="exportStatus" @click="exportExcel">导出明细</el-button>
</div>
<!-- <div class="item-tab"></div> -->
<el-tabs v-model="activeName" @tab-click="handleClick" :before-leave="beforeLeave">
<el-tab-pane label="参与情况" name="first">
<part-in
ref="childPart"
:formInline="formInline"
:activeName="activeName"
:organizationNum="organizationNum"
:organizationList="organizationList"
></part-in>
</el-tab-pane>
<el-tab-pane label="人群分析" name="second">
<crowd-analysis
ref="childCrowd"
:formInline="formInline"
:activeName="activeName"
:organizationList="organizationList"
></crowd-analysis>
</el-tab-pane>
<el-tab-pane label="课程分析" name="third">
<course-analysis
ref="childCourse"
:formInline="formInline"
:activeName="activeName"
:dialogData="dialogData"
:organizationList="organizationList"
></course-analysis>
</el-tab-pane>
<el-tab-pane label="考试分析" name="fourth" v-if="displayExam == 1">
<examination-analysisfrom
ref="childExam"
:formInline="formInline"
:activeName="activeName"
:dialogData="dialogData"
:organizationList="organizationList"
></examination-analysisfrom>
</el-tab-pane>
<!-- <el-tab-pane label="学习效果分析" name="fifth" lazy>
<learning-effect></learning-effect>
</el-tab-pane>-->
</el-tabs>
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%" center>
<p style="text-align:center">文件正在生成,你可以去“我的导出下载”页,下载文件</p>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">留在当前页</el-button>
<el-button type="primary" @click="toDownload()">去下载</el-button>
</span>
</el-dialog>
<el-dialog title :visible.sync="dialogUpdate" width="80%" center>
<!-- <el-button @click="dialogUpdate = false">取 消</el-button> -->
<data-alignment
ref="childAlignment"
@closeDialog="dialogUpdate = false"
@closeSearch="closeSearch"
:formInline="formInline"
:dialogData="dialogData"
:organizationList="organizationList"
></data-alignment>
</el-dialog>
</div>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import CourseAnalysis from "./item-course-analysis.vue";
import CrowdAnalysis from "./item-crowd-analysis.vue";
import PartIn from "./item-part-in.vue";
import ExaminationAnalysisfrom from "./item-examination-analysis.vue";
import LearningEffect from "./item-learning-effect.vue";
import DataAlignment from "./data-alignment.vue";
import { create } from "domain";
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as commonUtil from "../../utils-o/utils";
import * as operationData from "../../utils-o/operation";
import { log } from "util";
let vm = null;
export default {
components: {
BreadCrumb,
CourseAnalysis,
CrowdAnalysis,
PartIn,
ExaminationAnalysisfrom,
LearningEffect,
DataAlignment
},
data() {
return {
curmbFirst: "学情报告",
curmbSecond: "项目列表",
curmbThird: "",
jumPathThird: "/report-list",
projectId: "",
projectName: "",
exportStatus: false,
organizationList: [],
optionsRegion: [],
props: {
lazy: true,
lazyLoad(node, resolve) {
const { level } = node;
console.log("node", node);
if (node.level == 1) {
let req = {
provinceId: node.data.value
};
vm.GET("basic-data/position/cities", req).then(res => {
let newData = vm.setMoreOption(res.data.cityList, "cities");
console.log("newData", newData);
resolve(newData);
});
} else if (node.level == 2) {
let req = {
cityId: node.data.value
};
vm.GET("basic-data/position/counties", req).then(res => {
let newData = vm.setMoreOption(res.data.countyList, "counties");
console.log("newData", newData);
resolve(newData);
});
} else if (node.level == 3) {
let req = {
countyId: node.data.value
};
vm.GET("basic-data/position/towns", req).then(res => {
let newData = vm.setMoreOption(res.data.townList, "towns");
console.log("newData", newData);
resolve(newData);
});
}
}
},
showOriginal: 2,
roleType: '',
formInline: {
region: [0],
date: "",
organization: [],
checked: false,
pageNo: 1,
pageSize: 20
},
organizationNotice: '选择地区筛选到区才能选择机构',
dialogData: {
region: "",
// regionData: "",
organization: ""
// organizationData: "",
},
tags: [],
activeName: "first",
organizationNum: 0,
dialogVisible: false,
dialogUpdate: false,
displayExam: 2,
flag: 1,
};
},
computed: {
...mapGetters(["_token"])
},
watch: {
tags: function(val) {
this.setDialogData();
}
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
this.projectName = vm.getUrlSearch(window.location.href, "projectName");
this.curmbThird = vm.getUrlSearch(window.location.href, "projectName");
this.getDisplay();
this.search();
// this.getRegionOption();
},
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
getDisplay(type) {
let req = {
projectId: vm.projectId,
projectName: vm.projectName,
};
openLoading(vm);
vm.reportGET("report/portal/display", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
console.log('vm.showOriginal',res.data)
vm.showOriginal = res.data.status;
vm.roleType = res.data.roleType;
vm.displayExam = res.data.existExam;
vm.flag = res.data.flag;
}
if(type !=2) {
vm.getRegionOption();
}
});
},
beforeLeave(activeName, oldActiveName) {
console.log('action',activeName,'oldActive',oldActiveName)
},
handleClick(tab, event) {
//console.log(tab, event);
// if(tab.name == this.activeName) {
// return;
// }
console.log("activeName", this.activeName, tab.name);
if (tab.name == "first") {
this.$refs.childPart.$emit("init");
} else if (tab.name == "second") {
this.$refs.childCrowd.$emit("init");
} else if (tab.name == "third") {
this.$refs.childCourse.$emit("init");
} else if (tab.name == "fourth") {
this.$refs.childExam.$emit("init");
}
},
handleChange(value) {
this.formInline.organization = [];
this.tags = [];
setTimeout(function() {
// console.log(vm.$refs["cascaderRegion"].inputValue);
vm.dialogData.region = vm.$refs["cascaderRegion"].inputValue;
// vm.dialogData.regionData = value[value.length-1];
// console.log('vm.dialogData.region',vm.dialogData.region)
}, 20);
// console.log('region',value,vm.formInline);
if (value.length >= 3) {
this.getOrganizationList();
this.organizationNotice = "请选择机构";
} else {
this.organizationNotice = "选择地区筛选到区才能选择机构";
}
},
setMoreOption(data, type) {
let option = [];
for (let i = 0; i < data.length; i++) {
let obj = data[i];
if (type == "cities") {
obj.label = data[i].cityName;
obj.value = data[i].cityId;
} else if (type == "counties") {
obj.label = data[i].countyName;
obj.value = data[i].countyId;
// obj.leaf = true;
} else if (type == "towns") {
obj.label = data[i].townName;
obj.value = data[i].townId;
obj.leaf = true;
}
option.push(obj);
}
return option;
},
changeOrganization(value) {
// console.log('formInline',this.formInline.organization);
this.tags = [];
//选了全部的情况下
for (let a = 0; a < this.formInline.organization.length; a++) {
if (this.formInline.organization[a] == 0) {
//选了全部
let tagItem = {
label: "全部",
value: 0
};
this.tags.push(tagItem);
return;
}
}
//没选全部
for (let i = 0; i < this.organizationList.length; i++) {
for (let j = 0; j < value.length; j++) {
if (value[j] == this.organizationList[i].value) {
// console.log('value[j]',j,value[j],this.organizationList[i].label )
let tagItem = {
label: this.organizationList[i].label,
value: this.organizationList[i].value
};
this.tags.push(tagItem);
}
}
}
},
handleTagClose(tag) {
// console.log(tag);
//选了全部的情况下
if (this.tags.length > 0 && this.tags[0].value == 0) {
this.tags.splice(0, 1);
this.formInline.organization = [];
return;
}
//没全部的情况下
for (let i = 0; i < this.tags.length; i++) {
if (tag.value == this.tags[i].value) {
this.tags.splice(i, 1);
this.formInline.organization.splice(
this.formInline.organization.indexOf(tag.value),
1
);
break;
}
}
},
getMoreRegion() {
let http = new Promise((resolve, reject) => {
let req = {
provinceId: 350
};
vm.GET("basic-data/position/cities", req).then(res => {
resolve(res);
});
});
console.log("http值", http);
return http;
},
//获取地区
getRegionOption() {
if(vm.flag == 2 && vm.roleType == "L2") {
this.optionsRegion = [{id: 11, provinceId: 330, provinceName: "浙江省",value: 330, label: "浙江省"}]
} else {
let req = {};
openLoading(vm);
vm.GET("basic-data/position/provinces", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.optionsRegion = operationData.setRegionOption(
res.data.provinceList
);
// console.log("this.optionsRegion", this.optionsRegion);
}
});
}
},
getOrganizationList() {
this.organizationList = [];
let countyId = vm.formInline.region[vm.formInline.region.length - 1];
let type = 3;
if(vm.formInline.region.length == 4) {
type = 5;
}
let req = {
projectId: vm.projectId,
type: type,
id: countyId
};
openLoading(vm);
vm.reportGET("report/portal/getOrganizationList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.organizationList = operationData.getLearnOrganization(
res.data.hospitalList
);
}
});
},
getOrganizationNum() {
//选择全部
let num = 0;
if (this.tags.length == 0) {
return;
}
if (this.tags[0].value == 0) {
num = this.organizationList.length - 1;
return num;
}
//没有选择全部
num = this.tags.length;
return num;
},
closeSearch() {
vm.dialogUpdate = false;
vm.getDisplay(2);
vm.search();
},
search() {
// console.log(this.formInline,this.activeName);
if (this.activeName == "first") {
this.organizationNum = this.getOrganizationNum();
// console.log('this.organizationNum',this.organizationNum)
this.$nextTick(function() {
this.$refs.childPart.$emit("search");
});
} else if (this.activeName == "second") {
this.$refs.childCrowd.$emit("search");
} else if (this.activeName == "third") {
this.$refs.childCourse.$emit("search");
} else if (this.activeName == "fourth") {
this.$refs.childExam.$emit("search");
}
},
//重置
resetForm() {
vm.formInline = Object.assign(
{},
{
region: [],
date: "",
organization: [],
checked: false,
pageNo: 1,
pageSize: 20,
}
);
vm.tags = [];
if (this.activeName == "first") {
this.$refs.childPart.$emit("reset");
} else if (this.activeName == "second") {
this.$refs.childCrowd.$emit("reset");
} else if (this.activeName == "third") {
this.$refs.childCourse.$emit("reset");
} else if (this.activeName == "fourth") {
this.$refs.childExam.$emit("reset");
}
},
exportExcel() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行导出 ')
});
return;
}
//按钮置灰三秒
vm.exportStatus = true;
setTimeout(function() {
vm.exportStatus = false;
},3000);
this.dialogVisible = true;
//download接口
let checkAll = operationData.hasAll(vm.formInline.organization)
let req = {
projectId : vm.projectId,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
originalFlag: vm.formInline.checked == false ? 0 : 1,
projectName: vm.$route.query.projectName,
cityName: vm.getCityName(),
};
openLoading(vm);
vm.reportGET("report/downLoad/downLoad", req).then(res => {
closeLoading(vm);
// console
if (res.code == "000000") {
}
});
},
getCityName() {
let city = '';
let region = vm.dialogData.region;
console.log('region',region,typeof region,region == '');
if(region != '') {
city = region.split(' / ').join('');
console.log('city',city);
}
return city;
},
toDownload() {
let checkAll = operationData.hasAll(vm.formInline.organization)
let routerData = {
// projectId : vm.projectId,
projectId : '',
};
vm.$router.push({ path: "export-download-old", query: routerData });
},
update() {},
release() {},
setDialogData() {
//传递给dialog数据
this.dialogData.organization = "";
for (let x = 0; x < this.tags.length; x++) {
this.dialogData.organization += this.tags[x].label + "、";
}
let len = this.dialogData.organization.length;
this.dialogData.organization = this.dialogData.organization.substring(
0,
len - 1
);
},
changeDate() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行修改 ')
});
return;
}
this.setDialogData();
this.dialogUpdate = true;
this.$nextTick(function() {
this.$refs.childAlignment.$emit("search");
});
}
}
};
</script>
<style lang="scss">
.item-list-wrap {
.component-content {
// background: #fff;
padding: 10px;
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.item-form {
padding: 10px;
background: #fff;
width:100%;
border-radius: 4px;
}
.form-button {
width: 45%;
top: -120px;
position: relative;
left: 50%;
}
.button-group {
position: relative;
// right: 100px;
float: right;
margin-right: 20px;
}
.choose {
font-size: 12px;
margin-bottom: 20px;
}
.item-tab {
width: 95%;
height: 46px;
background: #F0F2F5;
position: absolute;
}
.el-tabs__item.is-active {
color: #409eff;
}
.el-tabs__header {
width: 65%;
}
.el-tabs__nav-wrap::after {
height: 0px;
}
.tag-group {
margin-left: 78px;
.el-tag {
margin-right: 20px;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="part-in-wrap">
<div v-show="!showData" class="empty">
<p>"没有相关数据,请重新选择查询范围"</p>
</div>
<div v-for="(item , index) in cardData" :key="index" class>
<el-card class="box-card">
<div slot="header" class="title">
<span class="weight">{{ item.title }}</span>
</div>
<div class="box-content">
<span class="weight">{{ item.num }}</span>
</div>
</el-card>
<div class="line"></div>
</div>
<div v-if="showChart" class="charts" id="rankChart" ref="rankChart"></div>
<!-- <div class="charts" id="age" ref="age"></div> -->
<el-table
v-if="showTable"
v-show="organizationNum < 2"
:data="finishDetail"
class="project-table"
style="width: 100%;margin-bottom: 30px;"
border
>
<el-table-column prop="name" label="姓名" align="center"></el-table-column>
<el-table-column prop="departmentName" label="科室" align="center"></el-table-column>
<el-table-column prop="joinStatus" label="是否参与项目" align="center">
<template slot-scope="scope">{{ scope.row.joinStatus | partJoin }}</template>
</el-table-column>
<el-table-column prop="projectStatus" label="是否完成项目" align="center">
<template slot-scope="scope">{{ scope.row.projectStatus | partFinish }}</template>
</el-table-column>
<el-table-column prop="finishTime" label="完成项目日期" align="center">
<template slot-scope="scope">{{ scope.row.finishTime }}</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有相关数据,请重新选择查询范围</p>
</div>
</div>
</el-table>
</div>
</template>
<script>
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as commonUtil from "../../utils-o/utils";
import * as operationData from "../../utils-o/operation";
import echarts from "echarts";
import { setTimeout } from "timers";
let vm = null;
export default {
props: {
formInline: {
type: Object
},
activeName: {
type: String
},
organizationNum: {
type: Number
},
organizationList: {
type: Array
}
},
data() {
return {
// 只有一个机构时显示人员完成情况
projectId: "",
finishDetail: [],
cardData: [],
showChart: false,
showTable: false,
showData: false,
};
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
},
mounted: function() {
// commonUtil.resizeHeight();
this.$on("search", () => {
this.search();
});
this.$on("init", () => {
this.$nextTick(function() {
if (vm.formInline.region.length != 0) {
this.search();
}
});
});
this.$on("reset", () => {
this.showData = false;
this.showChart = false;
this.showTable = false;
this.finishDetail = [];
this.cardData = [];
});
// if (this.activeName == "first") {
// this.updateResize();
// }
},
methods: {
search() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行查询 ')
});
return;
}
let checkAll = operationData.hasAll(vm.formInline.organization)
console.log(vm.formInline,checkAll,vm.organizationList);
let req = {
projectId: vm.projectId,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
originalFlag: vm.formInline.checked == false ? 0 : 1
};
console.log("1 req", req);
openLoading(vm);
vm.reportGET("report/portal/getParticipateInfo", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.getCardData(res.data);
vm.showData = true;
if(res.data.participateHospitalCount == 0 && res.data.participatePeopleCount == 0) {
vm.$message("没有相关数据,请重新选择查询范围");
}
} else {
vm.$message(res.message);
}
});
vm.reportGET("report/portal/top", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.getRank(res.data);
this.getTableData(res.data);
}
});
},
updateResize() {
this.$nextTick(function() {
let chartRank = echarts.init(document.getElementById("rankChart"));
window.onresize = function() {
chartRank.resize();
};
});
},
getTableData(data) {
if (vm.formInline.region.length >= 3 && vm.organizationNum == 1) {
vm.showTable = true;
vm.finishDetail = data.hospitalPeopleList;
} else {
vm.showTable = false;
}
},
getRank(data) {
let xAxisData = [];
let seriesData = [];
for (let i = 0; i < data.top.length; i++) {
xAxisData[i] = data.top[i].name;
seriesData[i] = data.top[i].percentage;
}
if(vm.organizationNum == 1 || xAxisData.length <= 1) {
vm.showChart = false;
}
if (xAxisData.length > 1 && vm.organizationNum !=1) {
vm.showChart = true;
setTimeout(function() {
let myChart = echarts.init(vm.$refs.rankChart);
let optionValue = operationData.getRank(xAxisData, seriesData);
myChart.setOption(optionValue);
vm.updateResize();
}, 200);
}
},
getCardData(data) {
vm.cardData = [
{
title: "应参与机构数",
num: data.participateHospitalCount,
},
{
title: "已参与机构数",
num: data.hasParticipateHospitalCount,
},
{
title: "应参与人数",
num: data.participatePeopleCount,
},
{
title: "已参与人数",
num: data.hasParticipatePeopleCount,
},
{
title: data.type == 1 ? "项目完成人数" : "项目获证人数",
num: data.acquireCertificatePeopleCount,
},
];
if(data.manyCertificate != null) {
for(let i=0;i<data.manyCertificate.length;i++) {
let obj = {
title: data.manyCertificate[i].name,
num: data.manyCertificate[i].value,
}
if(obj.title != null) {
vm.cardData.push(obj);
}
}
}
// vm.cardData[0].num = data.participateHospitalCount;
// vm.cardData[1].num = data.participatePeopleCount;
// vm.cardData[2].num = data.hasParticipatePeopleCount;
// vm.cardData[3].num = data.acquireCertificatePeopleCount;
},
}
};
</script>
<style lang='scss'>
.part-in-wrap {
background: #fff;
overflow: hidden;
// padding: 10px;
.empty {
height: 300px;
line-height: 300px;
color: #FF3399;
text-align: center;
}
.el-card {
border-width: 0px;
}
.el-card.is-always-shadow {
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
}
.line {
background: #e4e4e4;
height: 80px;
width: 1px;
float: left;
margin-top: 20px;
}
.box-card {
width: 13%;
margin-right: 1%;
font-size: 14px;
float: left;
.el-card__header {
border-bottom-width: 0;
}
.title {
text-align: center;
}
.box-content {
text-align: center;
height: 40px;
font-size: 15px;
}
}
.charts {
top: 20px;
margin-left: 10%;
width: 80%;
border-radius: 4px;
border: 1px solid #ebeef5;
background-color: #fff;
overflow: hidden;
color: #303133;
-webkit-transition: 0.3s;
transition: 0.3s;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
height: 600px;
background: #fff;
padding: 20px;
}
.project-table {
top: 15px;
background: #fff;
}
}
</style>
<template>
<div class="name-list-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird" :curmbFouth="curmbFouth" :jumPathThird="jumPathThird" :jumPathFouth="jumPathFouth"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<p class="course-p">地区:{{ queryData.region }}</p>
<p class="course-p">选择机构:{{ queryData.organization }}</p>
<el-form
class="form-update"
ref="serchForm"
:model="formData"
label-width="100px"
style="width:40%;"
>
<el-form-item v-if="tableType == 1" label="课程完成状态:">
<el-select
v-model="formData.learnFlag"
size="small"
style="width: 100%;"
placeholder="请选择状态"
>
<el-option
v-for="(item,index) in statusList"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="tableType == 2" label="考试成绩等级:">
<el-select v-model="formData.gradeFlag" size="small" style="width: 100%;" placeholder="请选择状态">
<el-option
v-for="(item,index) in rankList"
:key="index"
:label="item.gradeName"
:value="item.gradeFlag"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="查询姓名: ">
<el-input size="small" placeholder="查询姓名" v-model="formData.doctorName"></el-input>
</el-form-item>
</el-form>
<div class="form-button">
<el-button @click="searchData()" type="primary">查询</el-button>
<el-button @click="resetForm()">重置</el-button>
</div>
<el-table :data="tableData" class="course-table">
<el-table-column prop="doctorName" label="姓名" align="center"></el-table-column>
<el-table-column prop="sex" label="性别" align="center"></el-table-column>
<el-table-column prop="age" label="年龄" align="center"></el-table-column>
<el-table-column prop="titleName" label="职称" align="center"></el-table-column>
<el-table-column prop="hospitalName" label="机构" align="center"></el-table-column>
<el-table-column prop="addressName" label="地区" align="center"></el-table-column>
<el-table-column v-if="tableType == 1" prop="learnStatus" label="参与课程状态" align="center">
<template slot-scope="scope">
<span>{{ scope.row.learnStatus }}</span>
</template>
</el-table-column>
<el-table-column
v-if="tableType == 1"
prop="finishedTime"
label="完成培训日期"
align="center"
min-width="150"
>
<template slot-scope="scope">
<span>{{ scope.row.finishedTime }}</span>
</template>
</el-table-column>
<el-table-column
v-if="tableType == 2"
prop="passTime"
label="通过考试日期"
min-width="150"
align="center"
>
<template slot-scope="scope">
<span>{{ scope.row.passTime }}</span>
</template>
</el-table-column>
<el-table-column
v-if="tableType == 2"
prop="gradeName"
label="考试成绩等级"
min-width="80"
align="center"
>
<template slot-scope="scope">
<span>{{ scope.row.gradeName }}</span>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有相关数据,请重新选择查询范围</p>
</div>
</div>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formData.pageNo"
:page-sizes="[20, 50 ,100]"
:page-size="formData.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
</div>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as commonUtil from "../../utils-o/utils";
import * as operationData from "../../utils-o/operation";
let vm = null;
export default {
components: {
BreadCrumb
},
props: {
formInline: {
type: Object
}
},
data() {
return {
curmbFirst: "学情报告",
curmbSecond: "项目管理",
curmbThird: "",
curmbFouth: "",
jumPathThird: "/report-list",
jumPathFouth: "",
formData: {
doctorName: "",
learnFlag: -1,
gradeFlag: -1,
pageNo: 1,
pageSize: 20,
},
region: "",
organization: "",
tableData: [],
tableType: 1,
totalRows: 0,
statusList: [
{
value: -1,
label: "全部"
},
{
value: 0,
label: "未参与"
},
{
value: 1,
label: "参与中"
},
{
value: 2,
label: "已完成"
}
],
rankList: [],
queryData: {}
};
},
// computed: {
// ...mapGetters([
// "_token",
// ])
// },
created() {
vm = this;
vm.getInitData();
vm.search();
},
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
getHostital() {
let req = {
projectId: vm.queryData.projectId,
hospitalIds: vm.queryData.ids,
};
vm.reportGET("report/portal/getHostitalName", req).then(res => {
if (res.code == "000000") {
}
});
},
getInitData() {
vm.queryData = this.$route.query;
vm.tableType = vm.queryData.tableType;
vm.curmbThird = vm.getUrlSearch(window.location.href, "projectName");
vm.jumPathFouth = '/item-list?id=' + vm.queryData.projectId + '&projectName=' + vm.queryData.projectName;
console.log("queryData", vm.queryData);
if(vm.queryData.type == 4) {
vm.getHostital();
}
},
searchData() {
vm.formData.pageNo = 1;
vm.search();
},
search() {
let query = this.queryData;
if (this.tableType == 1) {
vm.curmbFouth = "课程培训情况";
//课程分析
// console.log('this.tableType',this.tableType)
let req = {
projectId: query.projectId,
originalFlag: query.originalFlag,
ids: query.ids,
type: query.type,
courseId: query.courseId,
learnFlag: vm.formData.learnFlag,
doctorName: vm.formData.doctorName,
pageNo: vm.formData.pageNo,
pageSize: vm.formData.pageSize,
};
console.log("course req", req);
openLoading(vm);
vm.reportGET("report/portalProjectCourse/getUserList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.totalCount == 0 ) {
vm.$message("没有相关数据,请重新选择查询范围");
}
vm.tableData = res.data.list;
vm.totalRows = res.data.totalCount;
} else {
vm.$message(res.message);
}
});
} else if (this.tableType == 2) {
vm.curmbFouth = "考试培训情况";
//考试分析
let reqRank = {
projectId: query.projectId,
}
vm.reportGET("report/portalProjectExam/getGradeList", reqRank).then(res => {
if (res.code == "000000") {
vm.rankList = operationData.initRank(res.data.list);
}
});
let req = {
projectId: query.projectId,
originalFlag: query.originalFlag,
ids: query.ids,
type: query.type,
examId: query.examId,
gradeFlag: vm.formData.gradeFlag,
doctorName: vm.formData.doctorName,
pageNo: vm.formData.pageNo,
pageSize: vm.formData.pageSize,
};
console.log("exam req", req);
openLoading(vm);
vm.reportGET("report/portalProjectExam/getUserList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.totalCount == 0 ) {
vm.$message("没有相关数据,请重新选择查询范围");
}
vm.tableData = res.data.list;
vm.totalRows = res.data.totalCount;
} else {
vm.$message(res.message);
}
});
}
},
resetForm() {
vm.formData = Object.assign(
{},
{
doctorName: "",
learnFlag: -1,
gradeFlag: -1,
pageNo: 1,
pageSize: 20,
}
);
vm.search();
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.formData.pageSize = val;
this.search();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.formData.pageNo = val;
this.search();
}
}
};
</script>
<style lang="scss">
.name-list-wrap {
.component-content {
background: #fff;
padding: 10px;
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.course-p {
margin: 30px 0 20px 30px;
font-size: 13px;
color: #606266;
}
.form-update {
margin: 30px 0px 0px 20px;
}
.form-button {
width: 45%;
top: -62px;
position: relative;
left: 50%;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="item-list">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="itemlist-content screenSet" id="screenSet">
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form ref="serchForm" :model="formData" label-width="75px" style="width:100%;">
<el-col :span="6">
<el-form-item label="项目状态:">
<el-select
v-model="formData.status"
size="small"
style="width: 100%;"
placeholder="请选择项目状态"
>
<el-option
v-for="(item,index) in statusSelect"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input v-model="formData.name" size="small" placeholder="请输入项目名称">
<i slot="suffix" class="el-icon-search"></i>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="searchData()">查询</el-button>
<el-button type="default" size="small" @click="resetForm()" style="margin-left:0;">重置</el-button>
</el-col>
</el-form>
</el-row>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="projectName" label="项目名称" min-width="200" align="center"></el-table-column>
<el-table-column prop="timeStatus" label="项目状态" min-width="80" align="center">
<template slot-scope="scope">
{{ scope.row.timeStatus | reportStatus }}
</template>
</el-table-column>
<el-table-column prop="projectBegintime" label="开始时间" min-width="160" align="center">
<template slot-scope="scope">{{ scope.row.projectBegintime }}</template>
</el-table-column>
<el-table-column prop="projectEndtime" label="结束时间" min-width="160" align="center">
<template slot-scope="scope">{{ scope.row.projectEndtime }}</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="200">
<template slot-scope="scope">
<el-button style="color:#509284" type="text" size="small" @click="go(scope.row)">查看学情报告</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png" />
<p>没有找到符合的结果</p>
</div>
</div>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formData.pageNo"
:page-sizes="[20, 50 ,100]"
:page-size="formData.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as commonUtil from "../../utils-o/utils";
import BreadCrumb from "../../components/breadcrumb.vue";
let vm = null;
export default {
data() {
return {
curmbFirst: "学情报告",
curmbSecond: "项目列表",
formData: {
//搜索信息
status: "",
name: "",
pageNo: 1, //当前是第几页
pageSize: 20 //页面总数
},
statusSelect: [
//项目状态
{
label: "全部",
value: ""
},
{
label: "进行中",
value: 1
},
{
label: "已结束",
value: 2
}
],
tableData: [],
totalRows: 0, //数据总数
idType: '',
};
},
components: {
BreadCrumb
},
created() {
vm = this;
vm.idType = localStorage.getItem('storageIdType');
vm.search();
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
searchData() {
vm.formData.pageNo = 1;
vm.search();
},
// 搜索列表
search() {
let req = {};
req = this.formData;
openLoading(vm);
vm.GET("portal/portalInfo/getPortalReportProject", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.totalRows == 0) {
vm.$message("没有找到符合的结果");
}
vm.tableData = res.data.projectList;
vm.totalRows = res.data.totalRows;
} else {
vm.$message(res.message);
}
});
},
// 重置搜索信息
resetForm() {
this.formData = {
status: "",
name: "",
pageNo: 1, //当前是第几页
pageSize: 20 //页面总数
};
vm.search();
},
// 更改数据显示数量
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
vm.formData.pageSize = val;
vm.search();
},
// 换页
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
vm.formData.pageNo = val;
vm.search();
},
//跳转到报告详情页
go(row) {
let routerData = {
id: row.id,
projectName: row.projectName,
};
vm.$router.push({ path: "/item-list-old" , query: routerData });
}
}
};
</script>
<style lang="scss">
.item-list {
.itemlist-content {
padding: 10px;
background: #fff;
}
}
</style>
\ No newline at end of file
......@@ -90,8 +90,7 @@
<el-table-column prop="townName" label="乡镇/街道" show-overflow-tooltip></el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png" />
<p>没有相关数据,请重新选择查询范围</p>
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
......@@ -102,14 +101,14 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formData.pageNo"
:page-sizes="[20, 50 ,100]"
:page-sizes="[20, 50 ,100, 200]"
:page-size="formData.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
<el-dialog title="发布学情报告" :visible.sync="dialogVisible" width="30%" append-to-body>
<p style="color:red">项目【{{ projectName }}】的数据修改</p>
<p style="color:red">项目【{{ projectName }}】的数据修改将于次日生效</p>
<p>确认需要更新学情报告吗?</p>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
......@@ -239,6 +238,7 @@ export default {
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
vm.formData.pageSize = val;
vm.formData.pageNo = 1;
vm.search();
},
// 换页
......@@ -258,18 +258,23 @@ export default {
setTimeout(function(){
openLoading(vm);
},20);
let checkAll = operationData.hasAll(vm.formInline.organization);
// let checkAll = operationData.hasAll(vm.formInline.organization);
let req = {
projectId: vm.projectId,
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag,
beginDate: operationData.setDuringTime(vm.formInline.during,'begin'),
endDate: operationData.setDuringTime(vm.formInline.during,'end'),
achievementStatus: vm.formData.achievementStatus,
status: vm.formData.status,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
doctorName: vm.formData.doctorName,
pageNo: vm.formData.pageNo,
pageSize: vm.formData.pageSize,
};
vm.reportGET("report/portal/getProjectData", req).then(res => {
vm.POST("stats/report/getProjectData", req).then(res => {
// closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.projectData;
......@@ -339,7 +344,7 @@ export default {
joinDoctorIdList: operationData.getAjustmentList(vm.changedDoctor),
};
openLoading(vm);
vm.reportPOST("report/portal/peopleAdjustment", req).then(res => {
vm.POST("stats/report/peopleAdjustment", req).then(res => {
closeLoading(vm);
vm.$message(res.message);
if (res.code == "000000") {
......@@ -396,5 +401,11 @@ export default {
.pagination {
margin-right: 10px;
}
.table-empty {
img {
height: 24px;
width: 106px;
}
}
}
</style>
......@@ -2,35 +2,47 @@
<div class="export-download">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<p>导出文件列表</p>
<el-table :data="tableData" style="width: 100%">
<div class="p-title">任务列表</div>
<el-tabs v-model="listType" type="card" @tab-click="handleClick">
<el-tab-pane label="查看报告" name="2"></el-tab-pane>
<el-tab-pane label="导出列表" name="1"></el-tab-pane>
</el-tabs>
<!--
:cell-style = "cellStyle"
:header-cell-style = "headCellStyle"
-->
<el-table :data="tableData" class="table-export" style="width: 100%">
<el-table-column
prop="title"
label="名称"
align="center"
align="left"
min-width="150"
show-overflow-tooltip
></el-table-column>
<el-table-column prop="createdTime" label="时间" align="center" min-width="120">
<template slot-scope="scope">{{ scope.row.createdTime }}</template>
<el-table-column prop="time" label="时间" align="center" min-width="120">
<template slot-scope="scope">{{ scope.row.time }}</template>
</el-table-column>
<el-table-column prop="status" label="状态" align="center" min-width="150">
<template slot-scope="scope">{{ scope.row.status | exportStatus }}</template>
<el-table-column prop="status" label="状态" align="left" min-width="75">
<template slot-scope="scope">
<span class="logo" v-bind:class="{ 'logo_0': scope.row.status == 0, 'logo_1': scope.row.status == 1, 'logo_2': scope.row.status == 2 }"></span>
<span class="text">{{ scope.row.status | exportStatus }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="70">
<el-table-column label="操作" fixed="right" align="center" >
<template slot-scope="scope">
<el-button
type="primary"
:disabled="scope.row.buttonStatus"
size="small"
type="text"
v-if="scope.row.status != 2"
@click="update(scope.row)"
>{{ scope.row.buttonText }}</el-button>
<div v-if="scope.row.status == 2">-</div>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png" />
<p>没有相关数据,请重新选择查询范围</p>
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
......@@ -40,7 +52,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="param.pageNo"
:page-sizes="[20, 50 ,100]"
:page-sizes="[20, 50 ,100 ,200]"
:page-size="param.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
......@@ -62,7 +74,7 @@ export default {
data() {
return {
curmbFirst: "学情报告",
curmbSecond: "导出下载",
curmbSecond: "任务列表",
projectId: "",
tableData: [],
param: {
......@@ -71,7 +83,8 @@ export default {
},
totalRows: 0,
totalTime: 3,
queryData: {}
queryData: {},
listType: "2"
// buttonText: "刷新",
// buttonStatus: false,
};
......@@ -79,75 +92,94 @@ export default {
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "projectId");
let listType = vm.getUrlSearch(window.location.href, "listType");
if(listType == null) {
vm.listType = '2';
} else {
vm.listType = listType;
}
this.search();
},
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
handleClick(tab, event) {
vm.listType = tab.name;
vm.search()
},
setButton() {
for (let i = 0; i < vm.tableData.length; i++) {
vm.tableData[i].index = i;
if (vm.tableData[i].status == 1) {
vm.tableData[i].buttonText = "下载";
if(vm.listType == '2') {
vm.tableData[i].buttonText = "查看报告";
} else if(vm.listType == '1') {
vm.tableData[i].buttonText = "下载";
}
vm.tableData[i].buttonStatus = false;
} else if(vm.tableData[i].status == 0) {
} else if (vm.tableData[i].status == 0) {
vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = false;
} else if(vm.tableData[i].status == 2) {
} else if (vm.tableData[i].status == 2) {
vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = true;
}
}
},
search() {
// this.setButton();
let req = {
projectId: vm.projectId
};
if(req.projectId == null) {
req.projectId = '';
let projectId = "";
if (vm.projectId != null) {
projectId = vm.projectId;
}
vm.reportGET("report/downLoad/getDownloadList", req).then(res => {
let reqList = {
projectId: projectId,
pageNo: vm.param.pageNo,
pageSize: vm.param.pageSize,
type: parseInt(vm.listType),
id: ""
};
vm.GET("stats/mission/missionlist", reqList).then(res => {
if (res.code == "000000") {
vm.tableData = res.data.data;
vm.totalRows = res.data.totalRows;
vm.tableData = res.data.list;
vm.totalRows = res.data.totalSize;
vm.setButton();
}
});
},
downLoad(row) {
// vm.queryData = this.$route.query;
// let req = vm.queryData;
// openLoading(vm);
// vm.reportGET("report/downLoad/downLoad", req).then(res => {
// closeLoading(vm);
// // console
// if (res.code == "000000") {
// }
// });
setTimeout(() => {
window.open(row.fileUrl);
}, 500);
},
getDownLoadStatus(row) {
let req = {
// let req = {
// id: row.id
// };
let projectId = "";
if (vm.projectId != null) {
projectId = vm.projectId;
}
let reqList = {
projectId: projectId,
pageNo: vm.param.pageNo,
pageSize: vm.param.pageSize,
type: parseInt(vm.listType),
id: row.id
};
vm.reportGET("report/downLoad/getDownLoadStatus", req).then(res => {
vm.GET("stats/mission/missionlist", reqList).then(res => {
if (res.code == "000000") {
vm.tableData[row.index].status = res.data.data;
vm.tableData[row.index].status = res.data.list[0].status;
let updateStatus = res.data.list[0].status;
// console.log('res.data.data',res.data.data);
if (res.data.data == 1) {
if (updateStatus == 1) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "下载";
vm.tableData[row.index].fileUrl = res.data.url;
} else if(res.data.data == 0) {
console.log("res", res, vm.tableData[row.index]);
// vm.tableData[row.index].buttonText = "下载";
if(vm.listType == '2') {
vm.tableData[row.index].buttonText = "查看报告";
} else if(vm.listType == '1') {
vm.tableData[row.index].buttonText = "下载";
}
vm.tableData[row.index].url = res.data.list[0].url;
} else if (updateStatus == 0) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新";
} else if(res.data.data == 2) {
} else if (updateStatus == 2) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新";
vm.tableData[row.index].buttonStatus = true;
......@@ -159,9 +191,22 @@ export default {
}
});
},
downLoad(row) {
setTimeout(() => {
window.open(row.url);
}, 500);
},
exportTime(row) {
vm.$router.push("item-list?downloadId="+row.id);
},
update(row) {
if (vm.tableData[row.index].status == 1) {
vm.downLoad(row);
// vm.downLoad(row);
if(vm.listType == '2') {
vm.exportTime(row);
} else if(vm.listType == '1') {
vm.downLoad(row);
}
} else {
this.$nextTick(function() {
console.log(vm.tableData[row.index]);
......@@ -189,21 +234,93 @@ export default {
// 更改数据显示数量
handleSizeChange(val) {
vm.param.pageSize = val;
vm.param.pageNo = 1;
vm.search();
},
// 换页
handleCurrentChange(val) {
vm.param.pageNo = value;
vm.param.pageNo = val;
vm.search();
}
},
cellStyle({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
console.log('column',column)
return `padding-left:40px;`;
} else {
return ''
}
},
// 表头行的 style 的回调方法
headCellStyle({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0 && rowIndex === 0) {
return `padding-left:40px;`;
} else {
return ''
}
},
}
};
</script>
<style lang="scss">
.el-tooltip__popper{
max-width: 300px;
}
.export-download {
.component-content {
background: #fff;
padding: 10px;
.p-title {
position: relative;
margin-top: 30px;
margin-left: 30px;
margin-bottom: 30px;
height: 25px;
font-size: 18px;
font-weight: 600;
line-height: 25px;
color: #000000;
}
.table-export {
thead th {
background: #fff;
}
.logo {
margin-top: 8px;
margin-right: 6px;
float: left;
width: 6px;
height: 6px;
border-radius: 50%;
}
.logo_0 {
background: #1890ff;
}
.logo_1 {
background: #52C41A;
}
.logo_2 {
background: #F5222D;
}
.text {
float: left;
}
.el-button--text {
color: #449284;
}
.el-button.is-disabled {
background: #fff !important;
border: 0px solid #fff !important;
}
}
.table-empty {
img {
height: 24px;
width: 106px;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="course-analysis-wrap">
<div v-for="(item , index) in cardData" :key="index" class="">
<el-card class="box-card">
<div slot="header" class="title">
<span class="weight">{{ item.title }}</span>
</div>
<div class="box-content">
<span v-if="item.num !=0" class="weight">{{ item.num }} </span>
<span v-if="item.num !=0">{{ item.unit }} </span>
<span v-if="index == 2 && second !=0" class="weight" >{{ second }} </span>
<span v-if="index == 2 && second !=0"></span>
</div>
</el-card>
<div v-if="index+1 !== cardData.length" class="line"></div>
</div>
<el-table
:data="tableData"
class="course-table">
<el-table-column prop="courseName" label="课程名" align="center">
<div class="course-analysis-wrap">
<div class="box-list">
<div class="box-min">
<div v-for="(item , index) in cardData" :key="index" class="box-card" v-bind:class="{ 'box-last': index == 2 }">
<p class="value">{{ item.value }}</p>
<p class="title">{{ item.title }}</p>
</div>
</div>
</div>
<div class="spacing"></div>
<!-- <div class="chart-title">考试列表</div> -->
<div v-if="downloadId == null">
<el-table :data="tableData" class="course-table">
<el-table-column prop="courseName" label="课程名" align="center"></el-table-column>
<el-table-column prop="courseTime" label="课程时长" align="center">
<template slot-scope="scope">{{ scope.row.courseTime | learnTimeValue }}</template>
</el-table-column>
<el-table-column prop="courseTotalTime" label="课程时长" align="center">
<template slot-scope="scope">
{{ scope.row.courseTotalTime | getTotalTime }}
</template>
<el-table-column prop="averageTime" label="人均学习时长" align="center">
<template slot-scope="scope">{{ scope.row.averageTime | learnTimeValue }}</template>
</el-table-column>
<el-table-column prop="courseAvgStudyTime" label="人均学习时长" align="center">
<el-table-column prop="joinCount" label="参与培训人数" align="center"></el-table-column>
<el-table-column prop="finishCount" label="完成培训人数" align="center"></el-table-column>
<el-table-column label="操作" min-width="50" align="center">
<template slot-scope="scope">
{{ scope.row.courseAvgStudyTime | getAvgTime }}
<el-button class="button-jump" @click="goPage(scope.row)" type="text" size="small">查看名单</el-button>
</template>
</el-table-column>
<el-table-column prop="courseLearnerCount" label="参与培训人数" align="center">
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
</div>
<div v-if="downloadId != null">
<el-table :data="tableData.slice((pageNo-1)*pageSize,pageNo*pageSize)" class="course-table">
<el-table-column prop="courseName" label="课程名" align="center"></el-table-column>
<el-table-column prop="courseTime" label="课程时长" align="center">
<template slot-scope="scope">{{ scope.row.courseTime | learnTimeValue }}</template>
</el-table-column>
<el-table-column prop="courseFinishedCount" label="完成培训人数" align="center">
<el-table-column prop="averageTime" label="人均学习时长" align="center">
<template slot-scope="scope">{{ scope.row.averageTime | learnTimeValue }}</template>
</el-table-column>
<el-table-column fixed="right" label="操作" min-width="50" align="center">
<el-table-column prop="joinCount" label="参与培训人数" align="center"></el-table-column>
<el-table-column prop="finishCount" label="完成培训人数" align="center"></el-table-column>
<el-table-column label="操作" min-width="50" align="center">
<template slot-scope="scope">
<el-button
@click="checkName(scope.row)"
type="text"
size="small"
>查看名单</el-button>
<el-button class="button-jump" @click="goPage(scope.row)" type="text" size="small">查看名单</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有相关数据,请重新选择查询范围</p>
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-sizes="[20, 50 ,100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
</div>
<div class="pagination">
<el-pagination
class="pagination"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-sizes="[20, 50 ,100, 200]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
<div class="spacing"></div>
</div>
</template>
<script>
import { create } from "domain";
......@@ -81,25 +90,38 @@ export default {
},
organizationList: {
type: Array
}
},
timeInfoData: {
type: Object
},
},
data() {
return {
cardData: [],
tableData: [],
totalRows: 0,
projectId: '',
projectId: "",
pageNo: 1,
pageSize: 20,
second: 0,
timeInfoChild: {},
downloadId: null,
};
},
watch: {
timeInfoData: {
deep: true,
handler(nv, ov) {
vm.timeInfoChild = nv;
}
}
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
vm.projectId = vm.getUrlSearch(window.location.href, "id");
vm.downloadId = vm.getUrlSearch(window.location.href, "downloadId");
},
mounted: function() {
this.$on('search',()=>{
this.$on("search", () => {
// console.log(this.formInline);
this.pageNo = 1;
this.search();
......@@ -111,145 +133,226 @@ export default {
}
});
});
this.$on("reset",() =>{
this.$on("reset", () => {
this.pageNo = 1;
this.pageSize = 20;
this.tableData = [];
this.cardData = [];
});
this.$on("static", () => {
vm.getStatic();
});
},
methods: {
getStatic() {
// console.log(vm.timeInfoChild);
let courseAnalysisModel = vm.timeInfoChild.courseAnalysisModel;
vm.setCardData(courseAnalysisModel);
vm.tableData = courseAnalysisModel.pCourseList;
vm.totalRows = courseAnalysisModel.totalSize;
},
setCardData(data) {
vm.totalRows = data.projectCourseCount;
let avgTime = [];
avgTime = operationData.getAvgTime(data.projectAvgStudyTime);
vm.cardData = [
let cardData = [
{
title: "项目所有课程数",
value: "0门"
},
{
title: '项目所有课程数',
num: data.projectCourseCount,
unit: '门课程',
},{
title: '项目所有课程总时长',
num: data.projectCourseTotalTime,
unit: '分钟',
},{
title: '项目人均学习时长',
num: avgTime[0],
unit: '分钟',
title: "项目所有课程总时长",
value: "0分钟"
},
{
title: "项目人均学习时长",
value: "0分钟"
}
];
vm.second = avgTime[1];
cardData[0].value = data.totalSize+'门';
// cardData[1].value = data.pCourseTotalTime+"分钟";
cardData[1].value = operationData.learnTimeValue(data.pCourseTotalTime);
cardData[2].value = operationData.learnTimeValue(data.pCourseAvg);
vm.cardData = cardData;
},
search() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行查询 ')
});
return;
}
let checkAll = operationData.hasAll(vm.formInline.organization)
search(type) {
// if (vm.formInline.region.length == 0) {
// const h = this.$createElement;
// vm.$message({
// message: h(
// "p",
// { style: "color: #FF3399" },
// "请先选择地区后再进行查询 "
// )
// });
// return;
// }
let checkAll = operationData.hasAll(vm.formInline.organization);
let req = {
projectId: vm.projectId,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
originalFlag: vm.formInline.checked == false ? 0 : 1
beginDate: operationData.setDuringTime(vm.formInline.during, "begin"),
endDate: operationData.setDuringTime(vm.formInline.during, "end"),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag,
pageNo: vm.pageNo,
pageSize: vm.pageSize,
};
console.log("3 req", req);
openLoading(vm);
vm.reportGET("report/portalProjectCourse/getTotal", req).then(res => {
closeLoading(vm);
vm.POST("stats/report/course", req, '', '', true).then(res => {
if (res.code == "000000") {
if(res.data.projectCourseCount == 0 ) {
vm.$message("没有相关数据,请重新选择查询范围");
if (type !== 2) {
vm.setCardData(res.data);
}
vm.setCardData(res.data)
vm.tableData = res.data.pCourseList;
vm.totalRows = res.data.totalSize;
} else {
vm.$message(res.message);
}
});
let reqList = req;
reqList.pageNo = vm.pageNo;
reqList.pageSize = vm.pageSize;
vm.reportGET("report/portalProjectCourse/getCourseList", reqList).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.list;
// vm.$message(res.message);
}
});
},
checkName(data) {
console.log('dialogData',this.dialogData);
let checkAll = operationData.hasAll(vm.formInline.organization)
goPage(data) {
let routerData = {};
routerData = this.dialogData;
routerData.projectId = vm.projectId;
routerData.projectName = vm.getUrlSearch(window.location.href, "projectName");
routerData.tableType = 1;
routerData.courseId = data.courseId;
routerData.ids = operationData.getIds(vm.formInline,vm.organizationList,checkAll);
routerData.type = operationData.getSearchType(vm.formInline,checkAll);
routerData.originalFlag = vm.formInline.checked == false ? 0 : 1;
if(vm.downloadId == null) {
// console.log("dialogData", this.dialogData);
routerData = this.dialogData;
routerData.projectId = vm.projectId;
routerData.projectName = vm.getUrlSearch(
window.location.href,
"projectName"
);
routerData.tableType = 1;
routerData.courseId = data.courseId;
routerData.beginDate = operationData.setDuringTime(vm.formInline.during, "begin"),
routerData.endDate = operationData.setDuringTime(vm.formInline.during, "end"),
routerData.regionId = vm.formInline.region[vm.formInline.region.length - 1];
routerData.originalFlag = vm.formInline.checked == false ? 2 : 1;
routerData.timeFlag = vm.formInline.timeFlag;
routerData.hospitalIdList = operationData.setHospitalIdList(vm.formInline.organization);
} else {
let reportParamModel = vm.timeInfoChild.reportParamModel;
routerData.base = 'static';
routerData.region = reportParamModel.regionNames;
routerData.organization = reportParamModel.hospitalNames;
routerData.projectId = reportParamModel.projectId,
routerData.projectName = reportParamModel.projectName,
routerData.tableType = 1;
routerData.courseId = data.courseId;
routerData.beginDate = reportParamModel.beginDate;
routerData.endDate = reportParamModel.endDate;
routerData.regionId = reportParamModel.regionId;
routerData.originalFlag = reportParamModel.originalFlag;
routerData.timeFlag = reportParamModel.timeFlag;
routerData.hospitalIdList = operationData.setHospitalIdList(reportParamModel.hospitalIdList);
}
// this.$router.push({ path: '/name-list', query: routerData});
let routeData = this.$router.resolve({ path: '/name-list', query: routerData});
window.open(routeData.href, '_blank');
let routeData = this.$router.resolve({
path: "/name-list",
query: routerData
});
window.open(routeData.href, "_blank");
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
vm.pageSize = val;
vm.search();
vm.pageNo = 1;
if(vm.downloadId == null) {
vm.search();
}
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
vm.pageNo = val;
vm.search();
},
},
}
if(vm.downloadId == null) {
vm.search();
}
}
}
};
</script>
<style lang="scss">
.course-analysis-wrap {
background: #fff;
overflow: hidden;
padding: 10px;
.weight {
font-weight: bold;
}
.title:after {
clear: both
}
.el-card {
border-width: 0px;
}
.el-card.is-always-shadow {
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
}
.line {
background: #e4e4e4;
height: 80px;
width: 1px;
float: left;
margin-top: 20px;
background: #fff;
overflow: hidden;
.spacing {
position: relative;
width: 100%;
height: 20px;
background: #f0f2f5;
}
.chart-title {
position: relative;
margin-top: 17px;
margin-left: 30px;
width: 100%;
height: 60px;
font-size: 18px;
font-weight: 600;
line-height: 60px;
color: #000000;
}
.box-list {
position: relative;
height: 120px;
background: #f0f2f5;
overflow-x: auto;
overflow-y: hidden;
.box-min {
height: 120px;
min-width: 950px;
}
.box-card {
position: relative;
background-color: #ffffff;
width: 32%;
margin-right: 1%;
margin-right: 2%;
height: 120px;
float: left;
.el-card__header {
border-bottom-width: 0;
}
.title {
.el-card__body {
padding: 0px;
}
.value {
color: #373839;
text-align: center;
margin-top: 24px;
margin-bottom: 8px;
height: 45px;
line-height: 45px;
font-size: 32px;
font-weight: 500;
}
.box-content {
text-align: center;
height: 40px;
.title {
color: #666666;
text-align: center;
font-size: 14px;
height: 20px;
line-height: 20px;
}
}
.course-table {
top: 20px;
margin-bottom: 20px;
.box-last {
margin-right: 0%;
}
}
.course-table {
top: 20px;
padding: 0;
width: 95%;
margin:0 auto 20px auto;
.button-jump {
color: #449284;
}
}
.pagination {
margin-top: 30px;
margin-right: 13px;
}
.table-empty {
img {
height: 24px;
width: 106px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="crowd-analysis-wrap">
<el-radio-group class="crowd-radio" v-model="radio" size="small" @change="updateRadio">
<el-radio-button label="1">全部用户</el-radio-button>
<el-radio-button label="2">参与项目</el-radio-button>
<el-radio-button label="3">通过项目</el-radio-button>
<el-radio-group v-if="showRadioValue === 0" class="crowd-radio" v-model="radio" size="small" @change="updateRadio">
<el-radio-button label="0">全部人员</el-radio-button>
<el-radio-button label="1">参与项目</el-radio-button>
<el-radio-button label="2">通过项目</el-radio-button>
</el-radio-group>
<div v-if="showRadioValue === 1" class="change-radio">{{ changeRadio[radio] }}</div>
<div v-show="!showData" class="empty">
<p>"没有相关数据,请重新选择查询范围"</p>
</div>
<div>
<div class="chart" v-show="showData">
<div v-if="showEducation === true">
<div class="item" id="education" ref="education"></div>
</div>
<div v-if="showEducation === false" class="empty-left">
<div class="title">人员学历分布</div>
<img src="../../assets/image/noData.png" />
</div>
<div v-if="showJob === true">
<div class="item item-right" id="job" ref="job"></div>
</div>
<div v-if="showJob === false" class="empty-left item-right">
<div class="title">人员职务分布</div>
<img src="../../assets/image/noData.png" />
</div>
</div>
</div>
<div>
<div class="chart" v-show="showData">
<div class="item" id="education" ref="education"></div>
<div class="item item-right" id="job" ref="job"></div>
<div class="item">
<div class="title">用户性别分布</div>
<div class="title">人员性别分布</div>
<div class="sex">
<div class="sex-item" v-for="(item , index) in sexData" :key="index">
<img class="sex-img" v-bind:src="item.src" />
<p class="sex-type">{{ item.type }}</p>
<p></p>
<!-- <img class="sex-img" v-bind:src="item.src" /> -->
<!-- <el-progress class="sex-img" :color="item.color" :stroke-width=12 type="circle" :percentage="item.rate"></el-progress> -->
<div v-if="index == 0" class="sex-img" id="ring0" ref="ring0"></div>
<div v-if="index == 1" class="sex-img" id="ring1" ref="ring1"></div>
<div v-if="index == 2" class="sex-img" id="ring2" ref="ring2"></div>
<p class="sex-num">{{ item.num }}</p>
<p class="sex-type">{{ item.type }}</p>
</div>
</div>
</div>
<div class="item item-right" id="age" ref="age"></div>
<div v-if="showAge === true">
<div class="item item-right" id="age" ref="age"></div>
</div>
<div v-if="showAge === false" class="empty-left item-right">
<div class="title">人员年龄分布</div>
<img src="../../assets/image/noData.png" />
</div>
</div>
</div>
<div class="spacing"></div>
</div>
</template>
<script>
......@@ -33,6 +62,7 @@ import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
import * as chartData from "../../utils/learning/chartData";
import echarts from "echarts";
import { setTimeout } from "timers";
let vm = null;
......@@ -49,31 +79,83 @@ export default {
},
organizationList: {
type: Array
}
},
timeInfoData: {
type: Object
},
showRadio: {
type: Number
},
},
data() {
return {
radio: 1,
sexData: [],
radio: '0',
sexData: [
{
color: '#1890FF',
type: "男性",
num: 0,
rate: 0,
},
{
color: '#FB5B52',
type: "女性",
num: 0,
rate: 0,
},
{
color: '#5D7092',
type: "未完善信息",
num: 0,
rate: 0,
}
],
projectId: "",
crowdData: {},
showData: false,
showData: true,
echartsData: {
chart1: {},
chart2: {},
chart3: {},
},
downloadId: null,
timeInfoChild: {},
showEducation: true,
showJob: true,
showAge: true,
changeRadio: {
'0': '全部人员',
'1': '参与项目',
'2': '通过项目',
},
showRadioValue: 0,
};
},
watch: {
timeInfoData: {
deep: true,
handler(nv, ov) {
vm.timeInfoChild = nv;
}
},
showRadio: {
deep: true,
handler(nv, ov) {
vm.showRadioValue = nv;
}
},
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
vm.projectId = vm.getUrlSearch(window.location.href, "id");
vm.downloadId = vm.getUrlSearch(window.location.href, "downloadId");
},
mounted: function() {
// commonUtil.resizeHeight();
//父组件传值
this.$on("search", () => {
vm.radio = 1;
vm.radio = '0';
this.search();
});
this.$on("init", () => {
......@@ -84,51 +166,48 @@ export default {
});
});
this.$on("reset", () => {
this.showData = false;
this.crowdData = {};
});
if (this.activeName == "second") {
}
this.$on("static", () => {
vm.getStatic();
});
},
methods: {
getStatic() {
// console.log(vm.timeInfoChild);
let userAnalysisModel = vm.timeInfoChild.userAnalysisModel;
setTimeout(function() {
vm.educationDivision(userAnalysisModel.eduListInMap[0]);
vm.jobDivision(userAnalysisModel.titleListInMap[0]);
vm.getSexData(userAnalysisModel.sexListInMap[0]);
vm.ageDivision(userAnalysisModel.ageListInMap[0]);
},20);
},
search() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行查询 ')
});
return;
}
let checkAll = operationData.hasAll(vm.formInline.organization);
// let checkAll = operationData.hasAll(vm.formInline.organization);
let req = {
projectId: vm.projectId,
cityOrHospitalId: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
kind: operationData.getSearchType(vm.formInline,checkAll),
type: vm.radio,
originalFlag: vm.formInline.checked == false ? 0 : 1
beginDate: operationData.setDuringTime(vm.formInline.during, "begin"),
endDate: operationData.setDuringTime(vm.formInline.during, "end"),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag
};
console.log("2 req", req);
openLoading(vm);
vm.reportGET("report/portal/getPeoplesDetails", req).then(res => {
closeLoading(vm);
vm.POST("stats/report/userAnalysis_pc/"+vm.radio, req, '', '', true).then(res => {
if (res.code == "000000") {
if(res.data.educationList.length == 0 && res.data.jobTitle.length == 0 ) {
vm.$message("没有相关数据,请重新选择查询范围");
this.showData = false;
} else {
this.showData = true;
}
// if(res.data.educationList.length == 0 && res.data.jobTitle.length == 0 ) {
// vm.$message("没有相关数据,请重新选择查询范围");
// this.showData = false;
// } else {
// this.showData = true;
// }
this.crowdData = res.data;
setTimeout(function() {
vm.educationDivision();
vm.jobDivision();
vm.getSexData();
vm.ageDivision();
vm.educationDivision(res.data.eduList);
vm.jobDivision(res.data.titleList);
vm.getSexData(res.data.sexList);
vm.ageDivision(res.data.ageList);
},20);
// this.educationDivision();
// this.jobDivision();
// this.getSexData();
// this.ageDivision();
} else {
vm.$message(res.message);
}
......@@ -144,91 +223,147 @@ export default {
});
},
updateRadio(value) {
console.log(value,vm.radio);
this.search();
if(vm.downloadId == null) {
console.log(value,vm.radio);
this.search();
} else {
let index = parseInt(value);
let userAnalysisModel = vm.timeInfoChild.userAnalysisModel;
setTimeout(function() {
vm.educationDivision(userAnalysisModel.eduListInMap[index]);
vm.jobDivision(userAnalysisModel.titleListInMap[index]);
vm.getSexData(userAnalysisModel.sexListInMap[index]);
vm.ageDivision(userAnalysisModel.ageListInMap[index]);
},20);
}
},
//用户性别分布
getSexData() {
let sexList = this.crowdData.sexList;
// if(sexList.length <3) {
// this.sexData = [];
// return;
// }
this.sexData = [
getSexData(data) {
let sexList = data;
let sexData = [
{
src: require("../../assets/image/man.png"),
color: '#1890FF',
type: "男性",
num: 0
num: 0,
rate: 0,
},
{
src: require("../../assets/image/weman.png"),
color: '#FB5B52',
type: "女性",
num: 0
num: 0,
rate: 0,
},
{
src: require("../../assets/image/question.png"),
color: '#5D7092',
type: "未完善信息",
num: 0
num: 0,
rate: 0,
}
];
for(let i=0;i<sexList.length;i++) {
if(sexList[i].name == "男") {
this.sexData[0].num = sexList[i].value;
} else if(sexList[i].name == "女") {
this.sexData[1].num = sexList[i].value;
} else {
this.sexData[2].num = sexList[i].value;
let sum = 0;
if(sexList.length > 0) {
for(let i = 0 ; i<sexList.length; i++) {
sum += sexList[i].value;
}
sexData[0].num = sexList[1].value;
sexData[1].num = sexList[2].value;
sexData[2].num = sexList[0].value;
if(sum > 0) {
sexData[0].rate = (sexList[1].value / sum *100).toFixed(1);
sexData[1].rate = (sexList[2].value / sum *100).toFixed(1);
sexData[2].rate = (sexList[0].value / sum *100).toFixed(1);
}
}
// if(sexList.length >= 3) {
// sexData[1].num = sexList[2].value;
// sexData[1].rate = (sexList[2].value / sum *100).toFixed(1);
// }
// console.log('this.$refs.ring0',this.$refs.ring0[0]);
let myChartRing0 = echarts.init(this.$refs.ring0[0]);
let option0 = chartData.ringOption(sexData[0].rate, sexData[0].color);
myChartRing0.setOption(option0);
let myChartRing1 = echarts.init(this.$refs.ring1[0]);
let option1 = chartData.ringOption(sexData[1].rate, sexData[1].color);
myChartRing1.setOption(option1);
let myChartRing2 = echarts.init(this.$refs.ring2[0]);
let option2 = chartData.ringOption(sexData[2].rate, sexData[2].color);
myChartRing2.setOption(option2);
vm.sexData = sexData;
},
educationDivision(data) {
let myChart = echarts.init(this.$refs.education);
let educationList = operationData.removeZero(this.crowdData.educationList);
if(data.length == 0) {
vm.showEducation = false;
return;
} else {
vm.showEducation = true;
}
let educationList = data;
let legendData = [];
let seriesData = [];
let colorData = ["#FF9F7F", "#008000", "#E062AE", "#37A2DA", "#0050DC", "#67E0E3", "#8A2BE2"];
// for (let i = 0; i < educationList.length; i++) {
// legendData[i] = educationList[i].name;
// }
if(educationList.length > 0) {
legendData = ['博士后','博士','硕士','本科','大专','中专及以下','其他'];
let colorData = ["#7453FF", "#3BA0FF", "#5D7092", "#39AF9A", "#FFBC3D", "#FF9A4B", "#B87F00"];
for (let i = 0; i < educationList.length; i++) {
legendData[i] = educationList[i].name;
seriesData[i] = educationList[i];
}
seriesData = educationList;
let option = operationData.getPicOption(
"用户学历分布",
let centerValue = ["242", "57.2%"];
let option = chartData.getPicOption(
"人员学历发布",
legendData,
colorData,
seriesData
seriesData,
centerValue
);
myChart.setOption(option);
vm.echartsData.chart1 = myChart;
vm.updateResize();
setTimeout(function(){
let myChart = echarts.init(vm.$refs.education);
myChart.setOption(option);
vm.echartsData.chart1 = myChart;
},20);
},
jobDivision(data) {
let myChart2 = echarts.init(this.$refs.job);
let jobTitle = operationData.removeZero(this.crowdData.jobTitle);
if(data.length == 0) {
vm.showJob = false;
return;
} else {
vm.showJob = true;
}
let titleList = data;
let legendData = [];
let seriesData = [];
let colorData = ["#FF9F7F", "#008000", "#E062AE", "#37A2DA", "#0050DC", "#67E0E3", "#8A2BE2"];
for (let i = 0; i < jobTitle.length; i++) {
legendData[i] = jobTitle[i].name;
let colorData = ["#3BA0FF", "#366BCB", "#39AF9A", "#FFBC3D", "#FF9A4B", "#B87F00", "#7453FF"];
for (let i = 0; i < titleList.length; i++) {
legendData[i] = titleList[i].name;
seriesData[i] = titleList[i];
}
seriesData = jobTitle;
let option = operationData.getPicOption(
"用户职务分布",
let centerValue = ["242", "57.2%"];
let option = chartData.getPicOption(
"人员职务分布",
legendData,
colorData,
seriesData
seriesData,
centerValue,
);
myChart2.setOption(option);
vm.echartsData.chart2 = myChart2;
vm.updateResize();
setTimeout(function(){
let myChart2 = echarts.init(vm.$refs.job);
myChart2.setOption(option);
vm.echartsData.chart2 = myChart2;
},20);
},
ageDivision(data) {
let myChart3 = echarts.init(this.$refs.age);
if(data.length == 0) {
vm.showAge = false;
return;
} else {
vm.showAge = true;
}
let xAxisData = [];
let seriesData = [];
let ageList = this.crowdData.ageList;
let ageList = data;
for (let i = 0; i < ageList.length; i++) {
// xAxisData[i] = ageList[i].name;
if(ageList[i].value != 0) {
......@@ -241,20 +376,37 @@ export default {
seriesData.push(ageList[i].value);
}
}
let option = operationData.getBarOption(xAxisData, seriesData);
let option = chartData.getBarOption(xAxisData, seriesData);
myChart3.setOption(option);
vm.echartsData.chart3 = myChart3;
vm.updateResize();
setTimeout(function(){
let myChart3 = echarts.init(vm.$refs.age);
myChart3.setOption(option);
vm.echartsData.chart3 = myChart3;
},20);
}
}
};
</script>
<style lang="scss">
.crowd-analysis-wrap {
background: #fff;
background: #F0F2F5;
overflow: hidden;
padding: 10px;
// padding: 10px;
overflow-x: auto;
.change-radio {
position: relative;
top: 5px;
left: 100%;
margin-left: -155px;
width:120px;
height:34px;
background:rgba(68,146,132,1);
border-radius:4px;
font-size:14px;
line-height: 34px;
text-align: center;
color: #fff;
}
.header-title {
padding: 10px 12px;
font-size: 12px;
......@@ -279,57 +431,94 @@ export default {
color: #FF3399;
text-align: center;
}
.spacing {
position: relative;
width: 100%;
height: 20px;
background: #f0f2f5;
}
.chart {
position: relative;
margin: 20px auto 0 auto;
width: 100%;
// overflow: auto;
width: 1124px;
overflow-x: hidden;
.empty-left {
position: relative;
float: left;
margin-right: 20px;
padding: 0;
width: 552px;
height: 360px;
display: flex;
background: #ffffff;
.title {
position: relative;
margin-top: 20px;
margin-left: 20px;
font-size: 18px;
font-weight: bold;
}
img {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
height: 24px;
width: 106px;
}
}
.item {
position: relative;
float: left;
margin-top: 20px;
margin-right: 20px;
padding: 0;
width: 48%;
// height: 20vw;
height: 350px;
border: 1px solid #dedede;
// width: 48%;
width: 552px;
height: 360px;
background: #ffffff;
// border: 1px solid #dedede;
.title {
position: relative;
margin: 15px auto 10px auto;
margin-top: 20px;
margin-left: 20px;
font-size: 18px;
text-align: center;
font-weight: bold;
}
.sex {
position: relative;
top: 42px;
top: 67px;
left: 0;
.sex-item {
float: left;
height: 350px;
width: 33.3%;
width: 184px;
.sex-img {
margin: 0 auto;
position: relative;
left: 10%;
// width: 80%;
width: 60%;
margin-left: 10%;
// left: 16%;
height: 125px;
width: 125px;
}
.sex-type {
.sex-num {
margin-top: 18px;
height:24px;
line-height:24px;
font-size:24px;
font-weight:600;
text-align: center;
}
.sex-num {
margin-top: 40px;
font-size: 30px;
font-weight: bold;
.sex-type {
margin-top: 8px;
height:14px;
font-size:14px;
color: #999999;
text-align: center;
}
}
}
}
.item-right {
float: right;
margin-right: 0;
}
}
}
......
......@@ -2,9 +2,9 @@
<div class="data-all-wrap">
<div v-if="dataType == 0" class="data-chart">
<div class="box-list">
<div v-for="(item , index) in cardData" :key="index" class="box">
<el-card class="box-card">
<el-tooltip class="item-tool" placement="bottom-end" effect="light">
<div class="box-min">
<div v-for="(item , index) in cardData" :key="index" class="box-card" v-bind:class="{ 'box-last': index == 2 }">
<el-tooltip v-if="index == 2" class="item-tool" placement="bottom-end" effect="light">
<div slot="content">
<p v-for="text in item.content">{{ text }}</p>
</div>
......@@ -16,49 +16,121 @@
</div>
<div class="vertical"></div>
<div class="right-content">
<p class="has">{{ item.hasKey }}:{{ item.hasNum }}</p>
<p class="should">{{ item.shouldKey }}:{{ item.shouldNum }}</p>
<p class="has">{{ item.hasKey }}{{ item.hasNum | toThousands }}</p>
<p class="should">{{ item.shouldKey }}{{ item.shouldNum | toThousands }}</p>
</div>
</el-card>
<!-- <div v-if="index+1 !== cardData.length" class="line"></div> -->
</div>
</div>
</div>
<div class="chart-title">证历分布情况</div>
<div class="chart-distributeChart">
<div class="distributeChart" id="distributeChart" ref="distributeChart"></div>
<div class="data-text">
<div class="content-text">
<p v-for="item in distributeList" :key="item.value">{{item.label}}{{item.value}}</p>
<div class="date-table">
<el-tabs class="change-range" v-model="checkRange" type="card" @tab-click="handleCheckRange">
<el-tab-pane label="累计" name="1"></el-tab-pane>
<el-tab-pane label="新增" name="2"></el-tab-pane>
</el-tabs>
<el-radio-group v-if="showRadioValue === 0" class="change-date" v-model="checkTime" size="medium" @change="handleCheckTime">
<el-radio-button label="1"></el-radio-button>
<el-radio-button label="2"></el-radio-button>
<el-radio-button label="3"></el-radio-button>
<el-radio-button label="4"></el-radio-button>
</el-radio-group>
<div v-if="showRadioValue === 1" class="change-radio">{{ changeRadio[checkTime] }}</div>
<el-table :data="tableDateTime" style="width: 100%">
<el-table-column prop="date" label="日期" align="center" min-width="100"></el-table-column>
<el-table-column prop="hospitalCount" label="应参与机构数" align="center"></el-table-column>
<el-table-column prop="hospitalJoinCount" label="已参与机构数" align="center"></el-table-column>
<el-table-column prop="doctorCount" label="应参与人数" align="center"></el-table-column>
<el-table-column prop="doctorJoinCount" label="已参与人数" align="center"></el-table-column>
<el-table-column prop="finishCount" :label="finishCountLabel" align="center"></el-table-column>
<el-table-column v-if="gradeFlag[0] == true" prop="grade1Count" label="优秀" align="center"></el-table-column>
<el-table-column v-if="gradeFlag[1] == true" prop="grade2Count" label="良好" align="center"></el-table-column>
<el-table-column v-if="gradeFlag[2] == true" prop="grade3Count" label="及格" align="center"></el-table-column>
<el-table-column v-if="gradeFlag[3] == true" prop="grade4Count" label="不及格" align="center"></el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeDwmy"
@current-change="handleCurrentDwmy"
:current-page="formDwmy.pageNo"
:page-sizes="[20, 30, 100 ,200]"
:page-size="formDwmy.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalCount"
></el-pagination>
</div>
</div>
<div v-if="certFlag != 0">
<div v-if="downloadId == null">
<div class="spacing"></div>
<div class="chart-title">证书分布情况</div>
<div v-if="showDistributeChart === true" class="chart-distributeChart">
<div class="distributeChart" id="distributeChart" ref="distributeChart"></div>
<div class="data-text">
<div class="content-text">
<p v-for="item in distributeList" >{{item.label}}{{item.value}}</p>
</div>
</div>
</div>
<div v-if="showDistributeChart === false" class="empty-img">
<img src="../../assets/image/noData.png" />
</div>
</div>
<div class="chart-title">证书级别按学历发布情况</div>
<div class="chart-recordChart">
<div class="spacing"></div>
<div class="chart-title">证书级别按学历分布情况</div>
<div class="overflow-chart">
<div v-if="showRecordChart === true" class="chart-recordChart">
<div class="recordChart" id="recordChart" ref="recordChart"></div>
<div class="data-text">
<div class="content-text">
<p v-for="item in recordList" :key="item.value">{{item.label}}{{item.value}}</p>
<p v-for="item in recordList" >{{item.label}}{{item.value}}</p>
</div>
</div>
</div>
<!-- <el-select class="chart-select" v-model="rankType" placeholder="请选择">
<el-option
v-for="item in rankOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>-->
<div class="chart-title">培训情况排名</div>
<div class="chart" id="certificateChart" ref="certificateChart"></div>
<div class="chart-title">在线培训完成时长情况</div>
<div class="chart" id="durationChart" ref="durationChart"></div>
</div>
</div>
<div v-if="showRecordChart === false" class="empty-img">
<img src="../../assets/image/noData.png" />
</div>
</div>
<!-- <div v-if="certFlag != 0"> -->
<div class="spacing"></div>
<div class="chart-title-more">
<p>项目情况排名</p>
<el-radio-group v-if="showCertificateChart === true && showRadioValue === 0" class="rank-radio" size="medium" v-model="rankType" @change="changeRank">
<el-radio-button label="1">{{ rankLabel1 }}</el-radio-button>
<el-radio-button label="2">{{ rankLabel2 }}</el-radio-button>
<el-radio-button label="3">按参与人数排名</el-radio-button>
</el-radio-group>
<div v-if="showRadioValue === 1" class="change-radio2">{{ changeRadio2[rankType] }}</div>
</div>
<div v-if="showCertificateChart === true" class="overflow-chart">
<div class="chartCert" id="certificateChart" ref="certificateChart"></div>
</div>
<div v-if="showCertificateChart === false" class="empty-img">
<img src="../../assets/image/noData.png" />
</div>
<div class="spacing"></div>
<div class="chart-title">在线培训完成天数情况</div>
<div v-if="showDurationChart === true" class="overflow-chart">
<div class="chartDuration" id="durationChart" ref="durationChart"></div>
</div>
<div v-if="showDurationChart === false" class="empty-img">
<img src="../../assets/image/noData.png" />
</div>
<div class="chart-remarks">注:在线培训完成天数=完成项目时间-开始参与项目时间</div>
<div class="spacing"></div>
</div>
<!-- </div> -->
<div v-if="dataType == 1" class="data-table">
<div class="box-list">
<div v-for="(item , index) in cardData" :key="index" class="box">
<el-card class="box-card box-card2">
<el-tooltip class="item-tool" placement="bottom-end" effect="light">
<div class="box-min-2">
<div v-for="(item , index) in cardData" :key="index" class="box-card box-card2" v-bind:class="{ 'box-last': index == 1 }">
<el-tooltip v-if="index == 1" class="item-tool" placement="bottom-end" effect="light">
<div slot="content">
<p v-for="text in item.content">{{ text }}</p>
</div>
......@@ -70,45 +142,178 @@
</div>
<div class="vertical"></div>
<div class="right-content">
<p class="has">{{ item.hasKey }}:{{ item.hasNum }}</p>
<p class="should">{{ item.shouldKey }}:{{ item.shouldNum }}</p>
<p class="has">{{ item.hasKey }}{{ item.hasNum | toThousands }}</p>
<p class="should">{{ item.shouldKey }}{{ item.shouldNum | toThousands }}</p>
</div>
</el-card>
<!-- <div v-if="index+1 !== cardData.length" class="line"></div> -->
</div>
</div>
</div>
<div class="person">
<div class="person-title">项目人员情况</div>
<!-- <el-radio-group class="person-radio" v-model="tableType" @change="change">
<el-radio-button label="0">已获证</el-radio-button>
<el-radio-button label="1">未获证</el-radio-button>
<el-radio-button label="2">未参与</el-radio-button>
</el-radio-group> -->
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="rank" label="排名" align="center"></el-table-column>
<el-table-column prop="name" label="姓名" align="center"></el-table-column>
<el-table-column prop="sex" label="性别" align="center"></el-table-column>
<el-table-column prop="department" label="科室" align="center"></el-table-column>
<el-table-column prop="join" label="是否参与项目" align="center"></el-table-column>
<el-table-column prop="complete" label="是否完成项目" align="center"></el-table-column>
<el-table-column prop="grade" label="证书级别" align="center"></el-table-column>
<el-table-column prop="certificateDate" label="获证日期" align="center"></el-table-column>
<el-table-column prop="record" label="成绩" align="center"></el-table-column>
<el-table-column prop="learnTime" label="学习时长" align="center"></el-table-column>
<div class="date-table">
<el-tabs class="change-range" v-model="checkRange" type="card" @tab-click="handleCheckRange">
<el-tab-pane label="累计" name="1"></el-tab-pane>
<el-tab-pane label="新增" name="2"></el-tab-pane>
</el-tabs>
<el-radio-group v-if="showRadioValue === 0" class="change-date" v-model="checkTime" size="medium" @change="handleCheckTime">
<el-radio-button label="1"></el-radio-button>
<el-radio-button label="2"></el-radio-button>
<el-radio-button label="3"></el-radio-button>
<el-radio-button label="4"></el-radio-button>
</el-radio-group>
<div v-if="showRadioValue === 1" class="change-radio">{{ changeRadio[checkTime] }}</div>
<el-table :data="tableDateTime" style="width: 100%">
<el-table-column prop="date" label="日期" align="center" min-width="100"></el-table-column>
<el-table-column prop="doctorCount" label="应参与人数" align="center"></el-table-column>
<el-table-column prop="doctorJoinCount" label="已参与人数" align="center"></el-table-column>
<el-table-column prop="finishCount" :label="finishCountLabel" align="center"></el-table-column>
<el-table-column v-if="gradeFlag[0] == true" prop="grade1Count" label="优秀" align="center"></el-table-column>
<el-table-column v-if="gradeFlag[1] == true" prop="grade2Count" label="良好" align="center"></el-table-column>
<el-table-column v-if="gradeFlag[2] == true" prop="grade3Count" label="及格" align="center"></el-table-column>
<el-table-column v-if="gradeFlag[3] == true" prop="grade4Count" label="不及格" align="center"></el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formTable.pageNo"
:page-sizes="[10, 20, 30, 100]"
:page-size="formTable.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
<el-pagination
background
@size-change="handleSizeDwmy"
@current-change="handleCurrentDwmy"
:current-page="formDwmy.pageNo"
:page-sizes="[20, 30, 100 ,200]"
:page-size="formDwmy.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalCount"
></el-pagination>
</div>
</div>
<div class="spacing"></div>
<div class="person">
<div class="person-title">项目人员情况</div>
<el-tabs v-if="downloadId == null" class="tabs-person" v-model="tableType" type="card" @tab-click="handlePerson">
<el-tab-pane :label="tableLabel1" name="1"></el-tab-pane>
<el-tab-pane :label="tableLabel2" name="2"></el-tab-pane>
<el-tab-pane label="未参与" name="3"></el-tab-pane>
</el-tabs>
<div v-if="downloadId == null">
<el-table :data="tableData" class="person-table">
<el-table-column v-if="tableType == '1'" prop="rankNo" label="排名" align="center"></el-table-column>
<el-table-column prop="doctorName" label="姓名" align="center"></el-table-column>
<el-table-column prop="sex" label="性别" align="center">
<template slot-scope="scope">
<span>{{ scope.row.sex | sexValue}}</span>
</template>
</el-table-column>
<el-table-column prop="departmentName" label="科室" align="center">
<template slot-scope="scope">
<span>{{ scope.row.departmentName | departmentNameValue}}</span>
</template>
</el-table-column>
<el-table-column prop="joinFlag" label="是否参与项目" align="center">
<template slot-scope="scope">
<span>{{ scope.row.joinFlag | joinFlagValue}}</span>
</template>
</el-table-column>
<el-table-column prop="finishFlag" label="是否完成项目" align="center">
<template slot-scope="scope">
<span>{{ scope.row.finishFlag | finishFlagValue}}</span>
</template>
</el-table-column>
<el-table-column v-if="certFlag == 2" prop="certGrade" label="证书级别" align="center">
<template slot-scope="scope">
<span>{{ scope.row.certGrade | certGradeValue}}</span>
</template>
</el-table-column>
<el-table-column prop="finishDate" label="完成项目日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.finishDate | nullOfValue}}</span>
</template>
</el-table-column>
<el-table-column v-if="containOfficialFlag == 1" prop="score" label="成绩" align="center">
<template slot-scope="scope">
<span>{{ scope.row.score | nullOfValue}}</span>
</template>
</el-table-column>
<el-table-column prop="learnTime" min-width="150" label="学习时长" align="center">
<template slot-scope="scope">
<span>{{ scope.row.learnTime | learnTimeValue}}</span>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
</div>
<div v-if="downloadId != null" class="front-table">
<el-table :data="tableData.slice((formTable.pageNo-1)*formTable.pageSize,formTable.pageNo*formTable.pageSize)" class="person-table">
<el-table-column prop="doctorName" label="姓名" align="center"></el-table-column>
<el-table-column prop="sex" label="性别" align="center">
<template slot-scope="scope">
<span>{{ scope.row.sex | sexValue}}</span>
</template>
</el-table-column>
<el-table-column prop="departmentName" label="科室" align="center">
<template slot-scope="scope">
<span>{{ scope.row.departmentName | departmentNameValue}}</span>
</template>
</el-table-column>
<el-table-column prop="joinFlag" label="是否参与项目" align="center">
<template slot-scope="scope">
<span>{{ scope.row.joinFlag | joinFlagValue}}</span>
</template>
</el-table-column>
<el-table-column prop="finishFlag" label="是否完成项目" align="center">
<template slot-scope="scope">
<span>{{ scope.row.finishFlag | finishFlagValue}}</span>
</template>
</el-table-column>
<el-table-column v-if="certFlag == 2" prop="certGrade" label="证书级别" align="center">
<template slot-scope="scope">
<span>{{ scope.row.certGrade | certGradeValue}}</span>
</template>
</el-table-column>
<el-table-column prop="finishDate" label="完成项目日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.finishDate | nullOfValue}}</span>
</template>
</el-table-column>
<el-table-column v-if="containOfficialFlag == 1" prop="score" label="成绩" align="center">
<template slot-scope="scope">
<span>{{ scope.row.score | nullOfValue}}</span>
</template>
</el-table-column>
<el-table-column prop="learnTime" min-width="150" label="学习时长" align="center">
<template slot-scope="scope">
<span>{{ scope.row.learnTime | learnTimeValue}}</span>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
</div>
<div class="chart-remarks">注:成绩=完成项目要求的所有考试平均分(不包含摸底考试)</div>
<div class="pagination">
<el-pagination
class="pagination"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formTable.pageNo"
:page-sizes="[20, 30, 100 ,200]"
:page-size="formTable.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
</div>
<div class="spacing"></div>
</div>
</div>
</template>
......@@ -116,6 +321,7 @@
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
import * as chartData from "../../utils/learning/chartData";
import echarts from "echarts";
import { setTimeout } from "timers";
let vm = null;
......@@ -132,6 +338,12 @@ export default {
},
organizationList: {
type: Array
},
timeInfoData: {
type: Object
},
showRadio: {
type: Number
}
},
data() {
......@@ -139,7 +351,7 @@ export default {
roleType: "L1",
projectId: "",
dataType: 0,
tableType: "0",
tableType: "1",
echartsData: {
chart0: {},
chart1: {},
......@@ -149,7 +361,7 @@ export default {
distributeList: [],
recordList: [],
cardData: [],
rankType: 1,
rankType: "1",
rankOptions: [
{
value: 1,
......@@ -161,42 +373,313 @@ export default {
}
],
tableData: [],
tableDateTime: [],
totalRows: 0,
formDwmy: {
pageNo: 1,
pageSize: 20,
},
formTable: {
pageNo: 1,
pageSize: 10,
pageSize: 20,
},
checkRange: "1",
checkTime: "1",
totalCount: 0,
gradeFlag: [false, false, false, false],
hospitalCnt: '',
hospitalCutList: [],
certFlag: 0,
downloadId: null,
timeInfoChild: {},
showDistributeChart: true,
showRecordChart: true,
showCertificateChart: true,
showDurationChart: true,
finishCountLabel: '获证人数',
rankLabel1: '按获证人数排名',
rankLabel2: '按获证比例排名',
tableLabel1: '已获证',
tableLabel2: '未获证',
containOfficialFlag: 1,
changeRadio: {
'1': '日',
'2': '周',
'3': '月',
'4': '年',
},
changeRadio2: {
'1': '按完成人数排名',
'2': '按完成比例排名',
'3': '按参与人数排名',
},
showRadioValue: 0,
};
},
watch: {
timeInfoData: {
deep: true,
handler(nv, ov) {
vm.timeInfoChild = nv;
}
},
showRadio: {
deep: true,
handler(nv, ov) {
vm.showRadioValue = nv;
}
},
},
created() {
vm = this;
vm.projectId = vm.getUrlSearch(window.location.href, "id");
vm.initCard();
if(vm.dataType == 0) {
// vm.setInitWidth();
setTimeout(function() {
// vm.$nextTick(() => {
vm.setDistributeChart();
vm.setRecordChart();
vm.setDurationChart();
vm.setCertificateChart();
// });
}, 500);
} else {
vm.setTable();
}
vm.downloadId = vm.getUrlSearch(window.location.href, "downloadId");
},
mounted: function() {
this.$on("search", () => {
vm.gethHspitalsCnt();
});
this.$on("static", () => {
vm.getStatic();
});
},
mounted: function() {},
methods: {
initCard() {
getStatic() {
// console.log(vm.timeInfoChild.reportParamModel);
if(vm.timeInfoChild.reportParamModel.hospitalIdList != null && vm.timeInfoChild.reportParamModel.hospitalIdList.length == 1) {
vm.dataType = 1;
} else {
vm.dataType = 0;
}
// console.log('展示all类型:',vm.dataType)
vm.setStatic();
},
setCertLabel() {
if(vm.certFlag == 0) {
//无证
vm.finishCountLabel = '完成人数';
vm.rankLabel1 = '按完成人数排名';
vm.rankLabel2 = '按完成比例排名';
vm.tableLabel1 = '已完成';
vm.tableLabel2 = '未完成';
let a = '1';
let b = '2';
vm.changeRadio2[a] = '按完成人数排名';
vm.changeRadio2[b] = '按完成比例排名';
} else {
vm.finishCountLabel = '获证人数';
vm.rankLabel1 = '按获证人数排名';
vm.rankLabel2 = '按获证比例排名';
vm.tableLabel1 = '已获证';
vm.tableLabel2 = '未获证';
let a = '1';
let b = '2';
vm.changeRadio2[a] = '按获证人数排名';
vm.changeRadio2[b] = '按获证比例排名';
}
},
setStatic() {
vm.certFlag = vm.timeInfoChild.doctorInfoRep.certFlag;
vm.containOfficialFlag = vm.timeInfoChild.doctorInfoRep.containOfficialFlag;
vm.setCertLabel();
vm.searchDwmy();
vm.initCard(vm.timeInfoChild.genSituationModel.percentData);
if(vm.dataType == 0) {
//多个机构
setTimeout(function(){
if(vm.certFlag !== 0) {
vm.setRecordChart(vm.timeInfoChild.genSituationModel.eduData);
}
// if(vm.certFlag !== 0) {
let certificateChart = vm.timeInfoChild.genSituationModel.studyRankMap[0];
if(certificateChart === undefined) {
certificateChart = [];
}
vm.setCertificateChart(certificateChart);
vm.setDurationChart(vm.timeInfoChild.genSituationModel.costRank);
// }
},20)
} else {
//单个几个
let genSituationModel = vm.timeInfoChild.genSituationModel;
vm.totalRows = genSituationModel.personData.length;
vm.tableData = genSituationModel.personData;
}
},
gethHspitalsCnt() {
let req = {
projectId: vm.projectId,
regionId: vm.formInline.region[vm.formInline.region.length - 1]
};
vm.GET("stats/region/hospitals/cnt", req, '', '', true).then(res => {
if (res.code == "000000") {
vm.hospitalCnt = res.data.hospitalCnt;
// vm.hospitalCnt = 1;
if(vm.hospitalCnt == 1) {
vm.hospitalCutList = res.data.list;
}
// vm.searchType();
vm.getDisplay();
}
});
},
getDisplay() {
let reqInfo = {
projectId: vm.projectId,
};
vm.GET("stats/region/info", reqInfo).then(res => {
if (res.code == "000000") {
vm.certFlag = res.data.certFlag;
vm.containOfficialFlag = res.data.containOfficialFlag;
vm.setCertLabel();
vm.searchType();
}
});
},
searchType() {
if(vm.formInline.organization.length == 1) {
vm.dataType = 1;
} else {
if(vm.hospitalCnt == 1) {
vm.dataType = 1;
} else {
vm.dataType = 0;
}
}
// console.log('vm.hospitalCnt',vm.hospitalCnt);
vm.checkRange = "1";
vm.checkTime = "1";
vm.rankType = "1";
vm.tableType = "1";
if(vm.dataType == 0) {
this.search();
this.searchDwmy();
} else {
this.searchDwmy();
this.searchPerson();
}
},
searchPerson(type) {
let req = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during,'begin'),
endDate: operationData.setDuringTime(vm.formInline.during,'end'),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag,
sourceType: 2,
pageNo: vm.formTable.pageNo,
pageSize: vm.formTable.pageSize,
};
if(req.hospitalIdList.length == 0) {
req.hospitalIdList = [];
req.hospitalIdList[0] = vm.hospitalCutList[0].hospitalId;
}
vm.POST("stats/report/generalPersonal/"+vm.tableType, req, '', '', true).then(res => {
if (res.code == "000000") {
if(type != 1) {
vm.initCard(res.data.percentData);
}
vm.totalRows = res.data.totalSize;
vm.tableData = res.data.personData;
}
});
},
handlePerson(tab, event) {
vm.tableType = tab.name;
vm.formTable.pageNo = 1;
vm.searchPerson(1);
},
search() {
let req = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during,'begin'),
endDate: operationData.setDuringTime(vm.formInline.during,'end'),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag,
};
vm.POST("stats/report/general_pc", req, '', '', true).then(res => {
if (res.code == "000000") {
vm.initCard(res.data.percentData);
if(vm.certFlag !== 0) {
vm.setDistributeChart(res.data.certData);
vm.setRecordChart(res.data.eduData);
}
// if(vm.certFlag !== 0) {
vm.setCertificateChart(res.data.studyRank);
vm.setDurationChart(res.data.costRank);
// }
}
});
},
searchDwmy() {
let req = {};
if(vm.downloadId == null) {
req = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during,'begin'),
endDate: operationData.setDuringTime(vm.formInline.during,'end'),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag,
timeType: parseInt(vm.checkTime),
dataType: parseInt(vm.checkRange),
pageNo: vm.formDwmy.pageNo,
pageSize: vm.formDwmy.pageSize,
};
} else {
let reportParamModel = vm.timeInfoChild.reportParamModel;
req = {
projectId: reportParamModel.projectId,
beginDate: reportParamModel.beginDate,
endDate: reportParamModel.endDate,
hospitalIdList: reportParamModel.hospitalIdList,
originalFlag: reportParamModel.originalFlag,
regionId: reportParamModel.regionId,
timeFlag: reportParamModel.timeFlag,
timeType: parseInt(vm.checkTime),
dataType: parseInt(vm.checkRange),
pageNo: vm.formDwmy.pageNo,
pageSize: vm.formDwmy.pageSize,
};
}
vm.POST("stats/dwmy/", req, '', '', true).then(res => {
if (res.code == "000000") {
vm.tableDateTime = res.data.list;
vm.totalCount = res.data.totalCount;
for(let i=0 ; i < res.data.title.length ; i++) {
vm.gradeFlag[i] = res.data.title[i].show;
}
}
});
},
handleCheckRange(tab, event) {
vm.formDwmy.pageNo = 1;
vm.checkRange = tab.name;
vm.searchDwmy();
},
handleCheckTime(value) {
vm.formDwmy.pageNo = 1;
vm.timeType = value;
vm.searchDwmy();
},
initCard(data) {
let cardData = [
{
value: "45%",
value: "0%",
title: "机构参与率",
hasKey: "已参与机构数",
hasNum: "318535",
hasNum: "0",
shouldKey: "应参与机构数",
shouldNum: "78534",
shouldNum: "0",
content: [
"机构参与率:已参与机构数/应参与机构数*100% ",
"应参与机构数:筛选范围下,所有圈选机构数量,包含白名单反退出来的机构",
......@@ -204,12 +687,12 @@ export default {
]
},
{
value: "78%",
value: "0%",
title: "人员参与率",
hasKey: "已参与人数",
hasNum: "878534",
hasNum: "0",
shouldKey: "应参与人数",
shouldNum: "674343",
shouldNum: "0",
content: [
"人员参与率:已参与人数/应参与人数*100%",
"应参与人数:筛选范围下,所圈选人员数量",
......@@ -217,594 +700,313 @@ export default {
]
},
{
value: "71%",
value: "0%",
title: "获证率",
hasKey: "已获证人数",
hasNum: "567",
hasNum: "0",
shouldKey: "应参与人数",
shouldNum: "78534",
shouldNum: "0",
content: [
"获证率:已完成人数/应参与人数*100%",
"应参与人数:筛选范围下,所圈选人员数量",
"已获证人数:筛选范围下,在应参与人员中,已获证的人员数量"
"获证率:已获证人数/应参与人数*100%",
]
}
];
if(data == null) {
//数据为空
if(vm.dataType == 0) {
vm.cardData = cardData;
} else if(vm.dataType == 1) {
vm.cardData = cardData.slice(1);
}
return;
}
cardData[2].title = vm.certFlag == 0 ? '完成率' : '获证率';
cardData[2].hasKey = vm.certFlag == 0 ? '已完成人数' : '已获证人数';
if(vm.certFlag == 0) {
cardData[2].content = [
"完成率:已完成人数/应参与人数*100%",
]
} else {
cardData[2].content = [
"获证率:已获证人数/应参与人数*100%",
]
}
cardData[1].value = parseFloat((data.doctorRate*100).toFixed(1)) + '%';
cardData[1].hasNum = data.joinCount;
cardData[1].shouldNum = data.doctorCount;
cardData[2].value = parseFloat((data.certificateRate*100).toFixed(1)) + '%';
cardData[2].hasNum = data.finishCount;
cardData[2].shouldNum = data.doctorCount;
if(vm.dataType == 0) {
cardData[0].value = parseFloat((data.hospitalRate*100).toFixed(1)) + '%';
cardData[0].hasNum = data.hospitalJoinCount;
cardData[0].shouldNum = data.hospitalCount;
vm.cardData = cardData;
} else if(vm.dataType == 1) {
vm.cardData = cardData.slice(0,2);
vm.cardData = cardData.slice(1);
}
},
updateResize() {
setTimeout(function() {
window.onresize = function() {
vm.echartsData.chart0.resize();
vm.echartsData.chart1.resize();
vm.echartsData.chart2.resize();
vm.echartsData.chart3.resize();
};
},100);
// setTimeout(function() {
// window.onresize = function() {
// vm.echartsData.chart0.resize();
// vm.echartsData.chart1.resize();
// vm.echartsData.chart2.resize();
// vm.echartsData.chart3.resize();
// };
// },100);
},
setInitWidth() {
setDistributeChart(data) {
if(data.length == 0) {
vm.showDistributeChart = false;
return;
} else {
vm.showDistributeChart = true;
}
let keyName = ['未获证人数','优秀人数','良好人数','及格人数','不及格人数','已获证人数'];
let keyName2 = ['未获证人数占比','优秀人数占比','良好人数占比','及格人数占比','不及格人数占比','已获证人数占比'];
let distributeList = [];
let legendData = [];
let seriesData = [];
//certId为-1 或 单证下 特殊处理
for(let i = 0; i<data.length ; i++) {
if(data[i].certId == -1) {
data[i].certId = 0;
}
if(vm.certFlag == 1 && data[i].certId !== -1 && data[i].certId !== 0) {
data[i].certId = 5;
}
}
//
for(let i = 0; i<data.length ; i++) {
let obj = {
label: keyName[data[i].certId],
value: data[i].doneCount,
};
distributeList.push(obj);
legendData.push(keyName2[data[i].certId])
let objSer = {
name: keyName2[data[i].certId],
value: data[i].doneCount,
}
seriesData.push(objSer);
}
vm.distributeList = distributeList;
setTimeout(function(){
let myChart = echarts.init(vm.$refs.distributeChart);
let option = chartData.dustributeOption(legendData,seriesData);
myChart.setOption(option);
// vm.echartsData.chart0 = myChart;
// vm.updateResize();
},20);
},
setDistributeChart() {
vm.distributeList = [
{
label: '未获证人数',
value: 2290,
},
setRecordChart(data) {
if(data.length == 0) {
vm.showRecordChart = false;
return;
} else {
vm.showRecordChart = true;
}
let recordList = [
{
label: '获优秀人数',
value: 1900,
label: '博士后',
value: 0,
},
{
label: '获及格人数',
value: 150,
},
]
let myChart = echarts.init(this.$refs.distributeChart);
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "item",
formatter: "{b} : {c} ({d}%)"
},
label: {
formatter: "{d}%"
},
color: ['#FF9A4B','#39AF9A', '#FFB01B'],
legend: {
orient: "horizontal",
top: "",
left: "40%",
data: ["未获证人数占比", "获优秀人数占比", "获及格人数占比"]
},
series: [
{
name: "",
type: "pie",
radius: "60%",
center: ["65%", "50%"],
data: [
{ value: 3000, name: "未获证人数占比" },
{ value: 6800, name: "获优秀人数占比" },
{ value: 3200, name: "获及格人数占比" }
],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
}
}
]
};
myChart.setOption(option);
vm.echartsData.chart0 = myChart;
vm.updateResize();
},
setRecordChart() {
vm.recordList = [
{
label: '博士',
value: 50,
value: 0,
},
{
label: '硕士',
value: 90,
value: 0,
},
{
label: '本科',
value: 700,
value: 0,
},
{
label: '大专',
value: 20428,
value: 0,
},
{
label: '中专及以下',
value: 34234,
value: 0,
},
{
label: '其他',
value: 2345,
value: 0,
},
]
let myChart = echarts.init(this.$refs.recordChart);
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "axis",
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
shadowStyle: {
shadowColor: '#E3EFED',
width: 36,
},
},
backgroundColor: 'rgba(0,0,0,0.7)',
formatter: function(params) {
let relVal = params[0].name + "人数:";
let value = 0;
for (let i = 0, l = params.length; i < l; i++) {
value += params[i].value;
}
relVal += value + "人";
let divList = [];
divList[0] = "<div style='background: #FFB01B;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[1] = "<div style='background: #39AF9A;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[2] = "<div style='background: #5D7092;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
for (let j = params.length - 1 ; j >= 0; j--) {
relVal +=
"<br/>" + divList[j] +
params[j].seriesName +
"占比: " +
(
(100 * parseFloat(params[j].value)) /
parseFloat(value)
).toFixed(2) +
"%";
}
return relVal;
}
},
color: ['#FFB01B','#39AF9A', '#5D7092'],
legend: {
data: ["未获证人数", "获优秀人数", "获及格人数"]
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: {
type: "category",
data: ["博士", "硕士", "本科", "大专", "中专及以下", "其他"]
},
yAxis: {
type: "value",
name: "人数 (个)"
},
series: [
{
name: "获及格人数",
type: "bar",
stack: "总量",
barWidth: 18,
label: {
normal: {
show: true,
rotate: -90,
}
},
data: [220, 182, 191, 234, 290, 330]
},
{
name: "获优秀人数",
type: "bar",
stack: "总量",
barWidth: 18,
label: {
normal: {
show: true,
rotate: -90,
}
},
data: [120, 132, 101, 134, 90, 230]
},
{
name: "未获证人数",
type: "bar",
stack: "总量",
barWidth: 18,
label: {
normal: {
show: true,
rotate: -90,
}
},
data: [1, 302, 301, 334, 390, 330]
},
]
};
myChart.setOption(option);
vm.echartsData.chart1 = myChart;
vm.updateResize();
},
setCertificateChart() {
let myChart = echarts.init(this.$refs.certificateChart);
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
crossStyle: {
color: "#999"
}
},
backgroundColor: 'rgba(0,0,0,0.7)',
formatter: function(params) {
let relVal = "";
let divList = [];
divList[0] = "<div style='background: #5D7092;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[1] = "<div style='background: #FFB01B;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[2] = "<div style='background: #559A99;height: 12px;width: 12px;margin: 5px 5px 0 5px;float: left;border-radius:50%;'></div>";
for (let j = 0, l = params.length; j < l; j++) {
relVal += divList[j] + params[j].seriesName + ": " + params[j].value;
if (j === 2) {
relVal += "%";
} else {
relVal += "<br/>";
}
}
return relVal;
}
},
color: ['#5D7092','#FFB01B', '#559A99'],
dataZoom: {
show: true,
start: 0,
end: 60
},
legend: {
data: ["参与人数", "获证人数", "获证比例"]
},
xAxis: [
{
axisLabel: {
interval: 0,
rotate: 45
},
type: "category",
data: [
"北京市",
"天津市",
"河北省",
"山西省",
"内蒙古自治区",
"辽宁省",
"吉林省",
"黑龙江省",
"上海市",
"江苏省",
"浙江省",
"安徽省",
"福建省",
"江西省",
"山东省",
"河南省",
"湖北省",
"湖南省",
"广东省",
"广西壮族自治区",
"海南省",
"重庆市",
"四川省",
"贵州省",
"云南省",
"西藏自治区",
"陕西省",
"甘肃省",
"青海省",
"宁夏回族自治区",
"新疆维吾尔自治区"
],
axisPointer: {
type: "shadow"
}
}
],
yAxis: [
{
type: "value",
name: "人数(个)",
axisLabel: {
formatter: "{value} "
}
},
{
type: "value",
name: "比例",
min: 0,
max: 100,
axisLabel: {
formatter: "{value} %"
}
}
],
series: [
{
name: "参与人数",
barWidth: 10,
type: "bar",
data: [
10,
52,
200,
334,
390,
330,
220,
10,
52,
200,
334,
390,
330,
220,
10,
52,
200,
334,
390,
330,
220,
10,
52,
200,
334,
390,
330,
220,
10,
52,
200,
334,
390
],
label: {
let keyName = ['未获证人数','获优秀人数','获良好人数','获及格人数','获不及格人数','已获证人数'];
let legendData = [];
let xAxisData = ["博士后","博士", "硕士", "本科", "大专", "中专及以下", "其他"];
//certId为-1 或 单证下 特殊处理
for(let i = 0; i<data.length ; i++) {
if(data[i].certId == -1) {
data[i].certId = 0;
}
if(vm.certFlag == 1 && data[i].certId !== -1 && data[i].certId !== 0) {
data[i].certId = 5;
}
}
//
for(let i = 0; i<data.length; i++) {
// console.log('data[i]',data[i].certList);
let certList = data[i].certList;
legendData.push(keyName[data[i].certId]);
for(let a = 0; a < certList.length ; a++) {
recordList[a].value += certList[a].value;
}
}
let seriesData = [];
let seriesArr = [];
let seriesName = [];
let index = 0;
for(let x = data.length - 1 ; x >= 0 ; x--) {
let certList = data[x].certList;
seriesArr[index] = [];
seriesName.push(keyName[data[x].certId]);
for(let y = 0; y < certList.length ; y++) {
seriesArr[index].push(certList[y].value);
}
index++;
}
let colorValue = ['#5D7092', '#39AF9A', '#FFB01B', '#FF9A4B', '#3BA0FF'];
for(let z = 0; z < seriesArr.length ; z++) {
let seriesObj = {
name: seriesName[z],
type: "bar",
stack: "总量",
barWidth: 18,
label: {
normal: {
show: true,
position: "top",
formatter: "{c}", //这是关键,在需要的地方加上就行了
rotate: -90,
offset: [-5, -15]
}
},
{
name: "获证人数",
barWidth: 10,
type: "bar",
data: [9, 8, 100, 200, 200, 55, 10, 9, 8, 100, 200, 200, 55, 10, 9, 8, 100, 200, 200, 55, 10],
label: {
show: true,
position: "top",
formatter: "{c}", //这是关键,在需要的地方加上就行了
rotate: -90,
offset: [-5, -15]
}
itemStyle: {
color: colorValue[seriesArr.length - z -1],
},
{
name: "获证比例",
type: "line",
yAxisIndex: 1,
data: [
2,
22,
32,
41,
61,
10,
20,
23,
55,
67,
91,
6,
2,
22,
32,
41,
61,
10,
20,
23,
55,
67,
91,
6
],
label: {
show: true,
position: "top",
formatter: "{c}%" //这是关键,在需要的地方加上就行了
}
}
]
};
myChart.setOption(option);
vm.echartsData.chart2 = myChart;
vm.updateResize();
data: seriesArr[z],
};
seriesData.push(seriesObj);
}
vm.recordList = recordList;
setTimeout(function(){
let myChart = echarts.init(vm.$refs.recordChart);
let option = chartData.recordOption(legendData, xAxisData, seriesData);
// console.log('data',legendData,xAxisData,seriesData,option);
myChart.clear();
myChart.setOption(option);
// vm.echartsData.chart1 = myChart;
// vm.updateResize();
},20);
},
setDurationChart() {
let myChart = echarts.init(this.$refs.durationChart);
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
}
},
color: ['#449284'],
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
dataZoom: {
show: true,
start: 0,
end: 66
},
xAxis: [
{
axisLabel: {
interval: 0,
rotate: 35
},
type: "category",
data: [
"北京市",
"天津市",
"河北省",
"山西省",
"内蒙古自治区",
"辽宁省",
"吉林省",
"黑龙江省",
"上海市",
"江苏省",
"浙江省",
"安徽省",
"福建省",
"江西省",
"山东省",
"河南省",
"湖北省",
"湖南省",
"广东省",
"广西壮族自治区",
"海南省",
"重庆市",
"四川省",
"贵州省",
"云南省",
"西藏自治区",
"陕西省",
"甘肃省",
"青海省",
"宁夏回族自治区",
"新疆维吾尔自治区"
],
axisTick: {
alignWithLabel: true
}
}
],
yAxis: [
{
type: "value",
name: "完成时长 (天)"
}
],
series: [
{
name: "时长",
type: "bar",
barWidth: 17,
data: [
10,
52,
200,
334,
390,
330,
220,
10,
52,
200,
334,
390,
330,
220,
10,
52,
200,
334,
390,
330,
220,
10,
52,
200,
334,
390,
330,
220,
10,
52,
200,
334,
390
],
label: {
show: true,
position: "top",
formatter: "{c}", //这是关键,在需要的地方加上就行了
rotate: -90,
offset: [-5, -15]
}
}
]
};
myChart.setOption(option);
vm.echartsData.chart3 = myChart;
vm.updateResize();
changeRank(value) {
if(vm.downloadId == null) {
let req = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during,'begin'),
endDate: operationData.setDuringTime(vm.formInline.during,'end'),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag,
};
openLoading(vm);
vm.POST("stats/report/studyRank/"+value, req).then(res => {
closeLoading(vm);
vm.setCertificateChart(res.data.studyRank);
});
} else {
let index = parseInt(value) - 1;
vm.setCertificateChart(vm.timeInfoChild.genSituationModel.studyRankMap[index]);
}
},
handleSizeChange(val) {
setCertificateChart(data) {
if(data.length == 0) {
vm.showCertificateChart = false;
return;
} else {
vm.showCertificateChart = true;
}
let legendData = [];
if(vm.certFlag == 0) {
legendData = ["参与人数", "完成人数", "完成比例"];
} else {
legendData = ["参与人数", "获证人数", "获证比例"];
}
let xAxisData = [];
let seriesJoin = [];
let seriesCert = [];
let seriesRate = [];
for(let i = 0 ; i < data.length ; i++) {
xAxisData.push(data[i].subName);
seriesJoin.push(data[i].joinCount);
seriesCert.push(data[i].certCount);
seriesRate.push(parseFloat((data[i].certRate*100).toFixed(1)));
}
setTimeout(function(){
let myChart = echarts.init(vm.$refs.certificateChart);
let option = chartData.certificateOption(xAxisData, seriesJoin, seriesCert, seriesRate, legendData);
myChart.setOption(option);
// vm.echartsData.chart2 = myChart;
// vm.updateResize();
},20);
},
setDurationChart(data) {
if(data.length == 0) {
vm.showDurationChart = false;
return;
} else {
vm.showDurationChart = true;
}
let xAxisData = [];
let seriesData = [];
for(let i = 0 ; i<data.length ; i++) {
xAxisData.push(data[i].subName);
seriesData.push(parseFloat((data[i].costTime).toFixed(1)));
}
setTimeout(function(){
let myChart = echarts.init(vm.$refs.durationChart);
let option = chartData.durationOption(xAxisData, seriesData);
myChart.setOption(option);
vm.echartsData.chart3 = myChart;
vm.updateResize();
},20);
},
//日周月年分页
handleSizeDwmy(val) {
console.log(`每页 ${val} 条`);
vm.formDwmy.pageSize = val;
vm.formDwmy.pageNo = 1;
vm.searchDwmy();
},
handleCurrentDwmy(val) {
console.log(`当前页: ${val}`);
vm.formDwmy.pageNo = val;
vm.searchDwmy();
},
//机构人员分页
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
vm.formTable.pageSize = val;
vm.formTable.pageNo = 1;
if(vm.downloadId == null) {
vm.searchPerson(1);
}
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
vm.formTable.pageNo = val;
if(vm.downloadId == null) {
vm.searchPerson(1);
}
},
setTable() {
vm.tableData = [
{
id: 1,
rank: 1,
name: '伊娟',
sex: '女',
department: '内科',
join: 1,
complete: 1,
grade: '1级',
certificateDate: '2019-10-11',
record: 100,
learnTime: '4小时23分34秒',
}
];
}
}
};
</script>
......@@ -824,19 +1026,62 @@ export default {
.data-all-wrap {
background: #fff;
overflow: hidden;
padding: 10px;
// padding: 10px;
.change-radio {
position: absolute;
top: 0px;
right: 25px;
width:60px;
height:34px;
background:rgba(68,146,132,1);
border-radius:4px;
font-size:14px;
line-height: 34px;
text-align: center;
color: #fff;
}
.change-radio2 {
position: absolute;
top: 26px;
right: 30px;
width: 120px;
height:34px;
background:rgba(68,146,132,1);
border-radius:4px;
font-size:14px;
line-height: 34px;
text-align: center;
color: #fff;
}
.table-empty {
img {
height: 24px;
width: 106px;
}
}
.box-list {
position: relative;
// width: 100%;
height: 110px;
margin: 30px 30px 0 30px;
height: 120px;
overflow-x: auto;
overflow-y: hidden;
.box-min {
height: 106px;
min-width: 1050px;
}
.box-min-2 {
height: 106px;
min-width: 900px;
}
.box-card {
position: relative;
background-color: #e3efed;
background-color: #F1F7F6;
color: #449284;
width: 31%;
width: 32%;
margin-right: 2%;
height: 110px;
height: 106px;
float: left;
border-radius:2px;
.notice {
position: absolute;
z-index: 999;
......@@ -855,7 +1100,7 @@ export default {
position: relative;
float: left;
width: 33%;
height: 110px;
height: 106px;
text-align: left;
padding: 23px 0 0 20px;
.title {
......@@ -873,7 +1118,7 @@ export default {
}
.vertical {
position: absolute;
left: 34%;
left: 120px;
float: left;
margin-top: 23px;
width:1px;
......@@ -884,67 +1129,136 @@ export default {
position: relative;
float: left;
width: 64%;
height: 110px;
height: 106px;
text-align: left;
font-size: 14px;
padding: 23px 0 0 29px;
padding: 33px 0 0 29px;
p {
height: 14px;
line-height: 14px;
}
.should {
margin-top: 28px;
margin-top: 12px;
}
}
}
.box-card2 {
width: 48%;
margin-right: 1%;
width: 49%;
margin-right: 2%;
}
.box-last {
margin-right: 0;
}
}
.chart-select {
.spacing {
position: relative;
width: 100%;
height: 20px;
background: #f0f2f5;
}
.chart-title {
.date-table {
position: relative;
margin-top: 17px;
width: 100%;
height: 60px;
margin-top: 20px;
padding: 0 30px 0 30px;
.change-range {
.el-tabs__header {
margin-bottom: 0px;
}
.el-tabs__nav-scroll {
margin-left: 0px;
}
}
.change-date {
position: absolute;
top: 0px;
right: 30px;
z-index: 10;
}
}
.rank-radio {
position: relative;
}
.chart-title {
position: relative;
margin-top: 30px;
margin-left: 30px;
height: 25px;
font-size:18px;
font-weight:600;
line-height: 60px;
line-height: 25px;
color: #000000;
border-bottom: 1px solid #E4E7ED;
}
.chart {
.chart-title-more {
position: relative;
width: 100%;
height: 70px;
p {
position: relative;
float: left;
width: 400px;
margin-top: 30px;
margin-left: 30px;
height: 25px;
font-size:18px;
font-weight:600;
line-height: 25px;
color: #000000;
}
.rank-radio {
position: relative;
margin: 30px 30px 0 0;
float: right;
.el-radio-button__inner {
padding: 7px 11px;
}
}
}
.chart-remarks {
position: relative;
height: 66px;
padding: 20px 0 30px 30px;
font-size: 16px;
font-weight: 400;
line-height: 16px;
color: #666666;
}
.chartCert {
position: relative;
margin: 20px auto 0 auto;
width: 1064px;
height: 462px;
}
.chartDuration {
position: relative;
margin: 20px auto 0 auto;
// width: 100%;
width: 860px;
height: 350px;
width: 1064px;
height: 380px;
}
.chart-distributeChart {
position: relative;
margin: 20px auto 0 auto;
height: 350px;
// height: 320px;
width: 100%;
overflow-x: hidden;
.distributeChart {
position: relative;
float: left;
// float: left;
margin: 0 auto 30px auto;
// width: 70%;
width: 600px;
height: 350px;
width: 618px;
height: 320px;
}
.data-text {
position: relative;
float: left;
position: absolute;
top: 0;
left: 50%;
margin-left: 307px;
height: 320px;
width: 30%;
height: 350px;
.content-text {
position: relative;
margin-top: 135px;
margin-left: 35%;
margin-top: 78px;
text-align: left;
p {
margin-top: 20px;
......@@ -960,25 +1274,24 @@ export default {
.chart-recordChart {
position: relative;
margin: 20px auto 0 auto;
height: 350px;
width: 100%;
// height: 350px;
width: 1030px;
overflow-x: hidden;
.recordChart {
position: relative;
float: left;
// width: 83.5%;
width: 700px;
height: 350px;
width: 910px;
height: 416px;
}
.data-text {
position: relative;
float: left;
width: 16%;
height: 350px;
width: 120px;
height: 416px;
.content-text {
position: relative;
margin-top: 100px;
margin-left: 16%;
margin-top: 56px;
text-align: left;
p {
margin-top: 20px;
......@@ -995,10 +1308,24 @@ export default {
position: relative;
margin-top: 20px;
width: 100%;
.tabs-person {
margin: 0 auto;
width: 95%;
.el-tabs__header {
margin-bottom: 0px;
}
.el-tabs__nav-scroll {
margin-left: 0px;
}
}
.person-title {
position: relative;
margin: 30px 0 25px 30px;
height: 25px;
font-size:18px;
font-weight:700;
margin-bottom: 20px;
font-weight:600;
line-height: 25px;
color: #000000;
}
.person-radio {
margin-top: 10px;
......@@ -1019,6 +1346,15 @@ export default {
}
}
}
.person-table {
padding: 0;
width: 95%;
margin:0 auto 20px auto;
}
.pagination {
margin-top: 30px;
margin-right: 13px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="examination-analysis">
<div v-for="(item , index) in cardData" :key="index" class="box">
<el-card class="box-card">
<div slot="header" class="title">
<span class="weight">{{ item.title }}</span>
</div>
<div class="box-content">
<span class="weight">{{ item.num }}</span>
{{ item.unit }}
<div class="box-list">
<div v-for="(item , index) in cardData" :key="index" class="box-card" v-bind:class="{ 'box-last': index == 2 }">
<!-- <el-card class="box-card" v-bind:class="{ 'box-last': index == 2 }"> -->
<p class="value">{{ item.value }}</p>
<p class="title">{{ item.title }}</p>
<!-- </el-card> -->
</div>
</div>
<div class="spacing"></div>
<div v-if="containOfficial === 1">
<div class="chart-title">完成项目考试次数情况</div>
<div v-if="showExamTimes === true" class="overflow-chart">
<div class="chart" id="examTimes" ref="examTimes"></div>
</div>
<div v-if="showExamTimes === false" class="empty-img">
<img src="../../assets/image/noData.png" />
</div>
<div class="chart-remarks">注:本报表数据来源包括用户参加正式考试次数,不包含摸底考试次数。</div>
<div class="spacing"></div>
<!-- <div class="chart-title">完成项目考试分数情况</div> -->
<div class="chart-title-more">
<p>完成项目考试分数情况</p>
<el-radio-group v-if="showExamScore === true && showRadioValue === 0" class="rank-radio" size="medium" v-model="rankType" @change="changeRank">
<el-radio-button label="1">1分</el-radio-button>
<el-radio-button label="5">5分</el-radio-button>
<el-radio-button label="10">10分</el-radio-button>
</el-radio-group>
<!-- <div v-if="showRadioValue === 1" class="change-radio">{{ changeRadio[rankType] }}</div> -->
</div>
<div v-if="showExamScore === true" class="overflow-chart">
<div class="chart" id="examScore" ref="examScore"></div>
</div>
<div v-if="showExamScore === false" class="empty-img">
<img src="../../assets/image/noData.png" />
</div>
<div class="chart-remarks">注:本报表数据来源包括用户参加正式考试,不包含摸底考试。</div>
<div class="spacing"></div>
</div>
<div class="chart-title">考试列表</div>
<div v-if="downloadId == null">
<el-table :data="tableData" class="exam-table">
<el-table-column prop="examType" label="类型" align="center"></el-table-column>
<el-table-column prop="examName" label="考试名" min-width="150" align="center"></el-table-column>
<el-table-column prop="doctorCount" label="应参与考试人数" align="center"></el-table-column>
<el-table-column prop="passCount" label="通过考试人数" align="center"></el-table-column>
<el-table-column prop="passRate" label="整体通过率" align="center">
<template slot-scope="scope">{{ scope.row.passRate | examRate }}</template>
</el-table-column>
<el-table-column prop="joinCount" label="参与考试人数" align="center"></el-table-column>
<el-table-column prop="joinRate" label="参与通过率" align="center">
<template slot-scope="scope">{{ scope.row.joinRate | examRate }}</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="100">
<template slot-scope="scope">
<el-button class="button-jump" type="text" size="small" @click="goPage(scope.row)">查看名单</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-card>
<div v-if="index+1 !== cardData.length" class="line"></div>
</el-table>
</div>
<div class="table">
<el-table :data="tableData" style="width: 100%" border>
<div v-if="downloadId != null">
<el-table :data="tableData.slice((pageNo-1)*pageSize,pageNo*pageSize)" class="exam-table">
<el-table-column prop="examType" label="类型" align="center"></el-table-column>
<el-table-column prop="examName" label="考试名" min-width="150" align="center"></el-table-column>
<el-table-column prop="examUserCount" label="参与考试人数" min-width="100" align="center"></el-table-column>
<el-table-column prop="userCountForPassExam" label="通过考试人数" min-width="80" align="center"></el-table-column>
<el-table-column v-if="showTd[0]" prop="userCountList[0]" :label="labelTd[0]" min-width="80" align="center"></el-table-column>
<el-table-column v-if="showTd[1]" prop="userCountList[1]" :label="labelTd[1]" min-width="80" align="center"></el-table-column>
<el-table-column v-if="showTd[2]" prop="userCountList[2]" :label="labelTd[2]" min-width="80" align="center"></el-table-column>
<el-table-column v-if="showTd[3]" prop="userCountList[3]" :label="labelTd[3]" min-width="80" align="center"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="100">
<el-table-column prop="doctorCount" label="应参与考试人数" align="center"></el-table-column>
<el-table-column prop="passCount" label="通过考试人数" align="center"></el-table-column>
<el-table-column prop="passRate" label="整体通过率" align="center">
<template slot-scope="scope">{{ scope.row.passRate | examRate }}</template>
</el-table-column>
<el-table-column prop="joinCount" label="参与考试人数" align="center"></el-table-column>
<el-table-column prop="joinRate" label="参与通过率" align="center">
<template slot-scope="scope">{{ scope.row.joinRate | examRate }}</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="100">
<template slot-scope="scope">
<el-button type="text" size="small" @click="goPage(scope.row)">查看名单</el-button>
<el-button class="button-jump" type="text" size="small" @click="goPage(scope.row)">查看名单</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有相关数据,请重新选择查询范围</p>
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
</div>
<!-- 分页 -->
<div class="pagination">
<el-pagination
class="pagination"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-sizes="[20, 50 ,100]"
:page-sizes="[20, 50 ,100, 200]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
<div class="spacing"></div>
</div>
</template>
<script>
import { log } from 'util';
import * as operationData from "../../utils/operation";
import { log } from "util";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
let vm
import * as operationData from "../../utils/operation";
import * as chartData from "../../utils/learning/chartData";
import echarts from "echarts";
let vm;
export default {
props: {
formInline: {
......@@ -69,147 +127,305 @@ export default {
},
organizationList: {
type: Array
}
},
timeInfoData: {
type: Object
},
containOfficialFlag: {
type: Number
},
showRadio: {
type: Number
},
},
data() {
return {
projectId: '',
projectId: "",
tableData: [],
cardData: [],
totalRows: 0, //数据总数
pageNo: 1, //当前是第几页
pageSize: 20, //页面总数
labelTd: [],
showTd: [false,false,false,false],
showTd: [false, false, false, false],
echartsData: {
chart0: {},
chart1: {}
},
examData: {},
rankType: '1',
timeInfoChild: {},
downloadId: null,
showExamTimes: true,
showExamScore: true,
containOfficial: 1,
changeRadio: {
'1': '1分',
'5': '5分',
'10': '10分',
},
showRadioValue: 0,
};
},
watch: {
timeInfoData: {
deep: true,
handler(nv, ov) {
vm.timeInfoChild = nv;
}
},
containOfficialFlag: {
deep: true,
handler(nv, ov) {
vm.containOfficial = nv;
}
},
showRadio: {
deep: true,
handler(nv, ov) {
vm.showRadioValue = nv;
}
},
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
vm.projectId = vm.getUrlSearch(window.location.href, "id");
vm.downloadId = vm.getUrlSearch(window.location.href, "downloadId");
},
// 挂载到Dom完成时
// 挂载到Dom完成时
mounted: function() {
this.$on('search',()=>{
this.$on("search", () => {
// console.log(this.formInline);
this.pageNo = 1;
this.rankType = '1';
this.search();
this.searchTable();
});
this.$on("init", () => {
this.$nextTick(function() {
if (vm.formInline.region.length != 0) {
this.search();
this.searchTable();
}
});
});
this.$on("reset",() =>{
this.$on("reset", () => {
this.pageNo = 1;
this.pageSize = 20;
this.tableData = [];
this.cardData = [];
});
this.$on("static", () => {
vm.getStatic();
});
},
methods: {
setCardData(data) {
vm.totalRows = data.projectExamCount;
vm.cardData = [
{
title: "项目所有考试数",
num: data.projectExamCount,
unit: "门考试"
},
{
title: "项目所有考题数",
num: data.projectExamQuestionCount,
unit: "道题"
}
];
// vm.cardData[0].num = data.projectExamCount;
// vm.cardData[1].num = data.projectExamQuestionCount;
},
// 搜索列表
search() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行查询 ')
});
return;
getStatic() {
let examAnalysisModel = vm.timeInfoChild.examAnalysisModel;
vm.containOfficial = vm.timeInfoChild.doctorInfoRep.containOfficialFlag;
vm.setCardData(examAnalysisModel);
if(vm.containOfficial === 1) {
vm.setExamTimes(examAnalysisModel.examTimesList);
vm.setExamScore(examAnalysisModel.examScoreList);
}
let checkAll = operationData.hasAll(vm.formInline.organization)
let req = {
vm.tableData = examAnalysisModel.examListDto.examInfoList;
vm.totalRows = examAnalysisModel.examListDto.totalRows;
},
search() {
let req = {
projectId: vm.projectId,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
originalFlag: vm.formInline.checked == false ? 0 : 1
beginDate: operationData.setDuringTime(vm.formInline.during, "begin"),
endDate: operationData.setDuringTime(vm.formInline.during, "end"),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag
};
console.log("4 req", req);
openLoading(vm);
vm.reportGET("report/portalProjectExam/getTotal", req).then(res => {
closeLoading(vm);
vm.POST("stats/report/exam", req, '', '', true).then(res => {
if (res.code == "000000") {
if(res.data.projectExamCount == 0 ) {
vm.$message("没有相关数据,请重新选择查询范围");
}
vm.examData = res.data;
vm.setCardData(res.data);
vm.labelTd = res.data.gradeNameList;
if(vm.containOfficial === 1) {
vm.setExamTimes(res.data.examTimesList);
vm.setExamScore(res.data.examScoreList);
}
} else {
vm.$message(res.message);
}
});
},
searchTable() {
let req = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during, "begin"),
endDate: operationData.setDuringTime(vm.formInline.during, "end"),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag
};
let reqList = req;
reqList.pageNo = vm.pageNo;
reqList.pageSize = vm.pageSize;
vm.reportGET("report/portalProjectExam/getExamList", req).then(res => {
closeLoading(vm);
// openLoading(vm);
vm.POST("stats/report/exam/list", req, '', '', true).then(res => {
// closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.list;
if(res.data.list.length == 0) {
return;
}
if(res.data.list[0].userCountList == null || res.data.list[0].userCountList.length == 0) {
vm.showTd = [false,false,false,false];
} else if (res.data.list[0].userCountList.length == 1){
vm.showTd = [true,false,false,false];
} else if (res.data.list[0].userCountList.length == 2){
vm.showTd = [true,true,false,false];
} else if (res.data.list[0].userCountList.length == 3){
vm.showTd = [true,true,true,false];
} else if (res.data.list[0].userCountList.length == 4){
vm.showTd = [true,true,true,true];
}
vm.tableData = res.data.examInfoList;
vm.totalRows = res.data.totalRows;
}
});
//
},
setCardData(data) {
vm.totalRows = data.projectExamCount;
let cardData = [
{
title: "项目正式考试数",
value: "0门"
},
{
title: "项目摸底考试数",
value: "0门"
},
{
title: "项目所有考题数",
value: "0道"
}
];
cardData[0].value = data.afterExamCount + "门";
cardData[1].value = data.beforeExamCount + "门";
cardData[2].value = data.examTitleCount + "道";
vm.cardData = cardData;
},
updateResize() {
setTimeout(function() {
window.onresize = function() {
vm.echartsData.chart0.resize();
vm.echartsData.chart1.resize();
};
}, 30);
},
setExamTimes(data) {
if(data.length == 0) {
vm.showExamTimes = false;
return;
} else {
vm.showExamTimes = true;
}
let xAxisData = [];
let seriesData = [];
for (let i = 0; i < data.length; i++) {
xAxisData.push(data[i].times + "次");
seriesData.push(data[i].count);
}
setTimeout(function(){
let myChart = echarts.init(vm.$refs.examTimes);
let option = chartData.examTimes(xAxisData, seriesData);
myChart.setOption(option);
vm.echartsData.chart0 = myChart;
},20);
},
changeRank(value) {
console.log(value);
if(vm.downloadId == null) {
if(value == '1') {
vm.setExamScore(vm.examData.examScoreList);
} else if(value == '5') {
vm.setExamScore(vm.examData.fiveExamScoreList);
} else if(value == '10') {
vm.setExamScore(vm.examData.tenExamScoreList);
}
} else {
let examAnalysisModel = vm.timeInfoChild.examAnalysisModel;
if(value == '1') {
vm.setExamScore(examAnalysisModel.examScoreList);
} else if(value == '5') {
vm.setExamScore(examAnalysisModel.fiveExamScoreList);
} else if(value == '10') {
vm.setExamScore(examAnalysisModel.tenExamScoreList);
}
}
},
setExamScore(data) {
if(data.length == 0) {
vm.showExamScore = false;
return;
} else {
vm.showExamScore = true;
}
let xAxisData = [];
let seriesData = [];
for (let i = 0; i < data.length; i++) {
xAxisData.push(data[i].timesStr);
seriesData.push(data[i].count);
}
setTimeout(function(){
let myChart = echarts.init(vm.$refs.examScore);
let option = chartData.examScore(xAxisData, seriesData);
myChart.setOption(option);
vm.echartsData.chart1 = myChart;
},20);
},
// 跳转查看名单页面
goPage(data) {
let checkAll = operationData.hasAll(vm.formInline.organization)
let routerData = {};
routerData = this.dialogData;
routerData.projectId = vm.projectId;
routerData.projectName = vm.getUrlSearch(window.location.href, "projectName");
routerData.tableType = 2;
routerData.examId = data.examId;
routerData.ids = operationData.getIds(vm.formInline,vm.organizationList,checkAll);
routerData.type = operationData.getSearchType(vm.formInline,checkAll),
routerData.originalFlag = vm.formInline.checked == false ? 0 : 1
if(vm.downloadId == null) {
routerData = this.dialogData;
routerData.projectId = vm.projectId;
routerData.projectName = vm.getUrlSearch(
window.location.href,
"projectName"
);
routerData.tableType = 2;
routerData.examId = data.examId;
routerData.beginDate = operationData.setDuringTime(vm.formInline.during, "begin"),
routerData.endDate = operationData.setDuringTime(vm.formInline.during, "end"),
routerData.regionId = vm.formInline.region[vm.formInline.region.length - 1];
routerData.originalFlag = vm.formInline.checked == false ? 2 : 1;
routerData.timeFlag = vm.formInline.timeFlag;
routerData.hospitalIdList = operationData.setHospitalIdList(vm.formInline.organization);
} else {
let reportParamModel = vm.timeInfoChild.reportParamModel;
routerData.base = 'static';
routerData.region = reportParamModel.regionNames;
routerData.organization = reportParamModel.hospitalNames;
routerData.projectId = reportParamModel.projectId,
routerData.projectName = reportParamModel.projectName,
routerData.tableType = 2;
routerData.examId = data.examId;
routerData.beginDate = reportParamModel.beginDate;
routerData.endDate = reportParamModel.endDate;
routerData.regionId = reportParamModel.regionId;
routerData.originalFlag = reportParamModel.originalFlag;
routerData.timeFlag = reportParamModel.timeFlag;
routerData.hospitalIdList = operationData.setHospitalIdList(reportParamModel.hospitalIdList);
}
// this.$router.push({ path: '/name-list', query: routerData});
let routeData = this.$router.resolve({ path: '/name-list', query: routerData});
window.open(routeData.href, '_blank');
let routeData = this.$router.resolve({
path: "/name-list",
query: routerData
});
window.open(routeData.href, "_blank");
},
// 更改数据显示数量
handleSizeChange(val) {
console.log(`每页 ${val} 条`)
vm.pageSize = val
vm.search()
console.log(`每页 ${val} 条`);
vm.pageSize = val;
vm.pageNo = 1;
if(vm.downloadId == null) {
vm.searchTable();
}
},
// 换页
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
vm.pageNo = val
vm.search()
console.log(`当前页: ${val}`);
vm.pageNo = val;
if(vm.downloadId == null) {
vm.searchTable();
}
}
}
};
......@@ -219,9 +435,20 @@ export default {
.examination-analysis {
background: #fff;
overflow: hidden;
padding: 10px;
.weight {
font-weight: bold;
.change-radio {
position: relative;
float: right;
top: 27px;
right: 55px;
margin-left: -60px;
width: 80px;
height: 34px;
background:rgba(68,146,132,1);
border-radius:4px;
font-size:14px;
line-height: 34px;
text-align: center;
color: #fff;
}
.el-card {
border-width: 0px;
......@@ -236,25 +463,121 @@ export default {
float: left;
margin-top: 20px;
}
.box {
}
.table {
margin-top: 30px;
}
.box-card {
width: 48%;
margin-right: 1%;
float: left;
.el-card__header {
border-bottom-width: 0;
.spacing {
position: relative;
width: 100%;
height: 20px;
background: #f0f2f5;
}
.box-list {
position: relative;
height: 110px;
background: #f0f2f5;
.box-card {
position: relative;
background-color: #ffffff;
width: 32%;
margin-right: 2%;
height: 120px;
float: left;
.el-card__header {
border-bottom-width: 0;
}
.el-card__body {
padding: 0px;
}
.value {
color: #373839;
text-align: center;
margin-top: 24px;
margin-bottom: 8px;
height: 45px;
line-height: 45px;
font-size: 32px;
font-weight: 500;
}
.title {
color: #666666;
text-align: center;
font-size: 14px;
height: 20px;
line-height: 20px;
}
}
.title {
text-align: center;
.box-last {
margin-right: 0%;
}
.box-content {
text-align: center;
height: 40px;
font-size: 15px;
}
.chart-title {
position: relative;
margin-top: 30px;
margin-left: 30px;
height: 25px;
font-size:18px;
font-weight:600;
line-height: 25px;
color: #000000;
}
.chart-title-more {
position: relative;
width: 100%;
height: 70px;
p {
position: relative;
float: left;
width: 400px;
margin-top: 30px;
margin-left: 30px;
height: 25px;
font-size:18px;
font-weight:600;
line-height: 25px;
color: #000000;
}
.rank-radio {
position: relative;
margin: 30px 30px 0 0;
float: right;
.el-radio-button__inner {
padding: 7px 29px;
}
}
}
.chart {
position: relative;
margin: 0 auto 0 auto;
width: 1064px;
height: 380px;
}
.chart-remarks {
position: relative;
height: 66px;
padding: 20px 0 30px 30px;
font-size: 16px;
font-weight: 400;
line-height: 16px;
color: #666666;
}
.exam-table {
top: 20px;
padding: 0;
width: 95%;
margin:0 auto 20px auto;
.button-jump {
color: #449284;
}
}
.pagination {
margin-top: 30px;
margin-right: 13px;
}
.table-empty {
img {
height: 24px;
width: 106px;
}
}
}
......
<template>
<div class="learning-effect">
<el-button type="default" size="small" @click="exportPDF">导出明细</el-button>
<div class="education" ref="education"></div>
<div class="learning" ref="learning"></div>
<div class="box-list">
<div v-for="(item , index) in cardData" :key="index" class="box-card" v-bind:class="{ 'box-last': index == 1 }">
<!-- <el-card class="box-card" v-bind:class="{ 'box-last': index == 1 }"> -->
<p class="value">{{ item.value }}</p>
<p class="title">{{ item.title }}</p>
<!-- </el-card> -->
</div>
</div>
<div class="spacing"></div>
<div class="chart-title">不同学历培训前后正确率对比</div>
<div v-if="showChartEdu === true" class="overflow-chart">
<div class="chartEdu" ref="education"></div>
</div>
<div v-if="showChartEdu === false" class="empty-img">
<img src="../../assets/image/noData.png" />
</div>
<div class="chart-remarks">注:本报表数据来源仅统计同时包含摸底考和正式考的课程培训。</div>
<div class="spacing"></div>
<div class="chart-title">培训前后知识点掌握情况</div>
<div v-if="showChartLearn === true" class="overflow-chart">
<div class="chartLearn" ref="learning"></div>
</div>
<div v-if="showChartLearn === false" class="empty-img">
<img src="../../assets/image/noData.png" />
</div>
<div class="chart-remarks">注:本报表数据来源仅统计同时包含摸底考和正式考的课程培训。</div>
</div>
</template>
<script>
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
import * as chartData from "../../utils/learning/chartData";
import echarts from "echarts";
import html2Canvas from 'html2canvas'
import JsPDF from 'jspdf'
let vm = null;
export default {
props: {
formInline: {
type: Object
},
activeName: {
type: String
},
timeInfoData: {
type: Object
},
},
data() {
return {
cardData: [],
echartsData: {
chart1: {},
chart2: {}
}
},
timeInfoChild: {},
showChartEdu: true,
showChartLearn: true,
};
},
watch: {
timeInfoData: {
deep: true,
handler(nv, ov) {
vm.timeInfoChild = nv;
}
}
},
created() {
vm = this;
vm.$nextTick(() => {
vm.setEducation();
vm.setLearning();
});
vm.projectId = vm.getUrlSearch(window.location.href, "id");
},
mounted() {
commonUtil.resizeHeight();
this.$on("search", () => {
this.search();
});
this.$on("static", () => {
vm.getStatic();
});
},
methods: {
exportPDF() {
let element = '';
element = document.querySelector('.data-all-wrap');
console.log(element);
if(element == null) {
return
}
setTimeout(() => {
html2Canvas(element).then(function(canvas) {
let contentWidth = canvas.width;
let contentHeight = canvas.height;
//一页pdf显示html页面生成的canvas高度;
let pageHeight = contentWidth / 592.28 * 841.89;
//未生成pdf的html页面高度
let leftHeight = contentHeight;
//页面偏移
let position = 0;
//a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
let imgWidth = 595.28;
let imgHeight = 592.28 / contentWidth * contentHeight;
let pageData = canvas.toDataURL('image/jpeg', 1.0);
let pdf = new JsPDF('', 'pt', 'a4');
//有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
//当内容未超过pdf一页显示的范围,无需分页
if (leftHeight < pageHeight) {
pdf.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight);
} else {
while (leftHeight > 0) {
pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
leftHeight -= pageHeight;
position -= 841.89;
//避免添加空白页
if (leftHeight > 0) {
pdf.addPage();
}
}
}
let title = "导出学情报告";
pdf.save(title + '.pdf');
});
}, 0);
getStatic() {
let studyEffectDto = vm.timeInfoChild.studyEffectAnalysisModel.studyEffectDto;
vm.initCard(studyEffectDto);
vm.setEducation(studyEffectDto.educationEffectList);
vm.setLearning(studyEffectDto.knowledgeEffectList);
},
updateResize() {
this.$nextTick(function() {
......@@ -87,129 +96,169 @@ export default {
};
});
},
setEducation() {
let myChart = echarts.init(this.$refs.education);
let option = {
title: {
text: ""
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow"
}
},
color: ['#5D7092','#FFB01B'],
legend: {
data: ["项目前总正确率", "项目后总正确率"]
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: {
type: "category",
data: ["本科", "大专", "中专及以下", "硕士", "博士", "其他"]
},
yAxis: {
min: 0,
max: 100,
type: "value",
axisLabel: {
formatter: "{value} %"
}
},
series: [
{
name: "项目前总正确率",
type: "bar",
barWidth: 10,
data: [45, 45, 34, 34, 4, 8]
},
{
name: "项目后总正确率",
type: "bar",
barWidth: 10,
data: [70, 66, 67, 67, 24, 24]
}
]
search() {
let req = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during, "begin"),
endDate: operationData.setDuringTime(vm.formInline.during, "end"),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag
};
myChart.setOption(option);
vm.echartsData.chart1 = myChart;
vm.updateResize();
vm.POST("stats/report/studyEffect", req, '', '', true).then(res => {
if (res.code == "000000") {
vm.initCard(res.data);
setTimeout(function() {
vm.setEducation(res.data.educationEffectList);
vm.setLearning(res.data.knowledgeEffectList);
}, 20);
}
});
},
setLearning() {
let myChart = echarts.init(this.$refs.learning);
let option = {
title: {
text: ""
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow"
}
},
color: ['#5D7092','#FFB01B'],
legend: {
data: ["培训前正确率", "培训后正确率"]
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: {
axisLabel: {
interval: 0,
rotate: 45
},
type: "category",
data: ["推荐联合用药方案"]
},
yAxis: {
min: 0,
max: 100,
type: "value",
axisLabel: {
formatter: "{value} %"
}
initCard(data) {
let cardData = [
{
value: "0%",
title: "培训前总正确率"
},
series: [
{
name: "培训前正确率",
type: "bar",
barWidth: 10,
data: [45]
},
{
name: "培训后正确率",
type: "bar",
barWidth: 10,
data: [81]
}
]
};
myChart.setOption(option);
vm.echartsData.chart2 = myChart;
vm.updateResize();
{
value: "0%",
title: "培训后总正确率"
}
];
cardData[0].value = parseFloat((data.beforeRate*100).toFixed(1)) + "%";
cardData[1].value = parseFloat((data.afterRate*100).toFixed(1)) + "%";
vm.cardData = cardData;
},
setEducation(data) {
if(data.length == 0) {
vm.showChartEdu = false;
return;
} else {
vm.showChartEdu = true;
}
let xAxisData = [];
let seriesBefore = [];
let seriesAfter = [];
for(let i = 0; i < data.length ; i++) {
xAxisData.push(data[i].classifyName);
seriesBefore.push(parseFloat((data[i].beforeRate*100).toFixed(1)));
seriesAfter.push(parseFloat((data[i].afterRate*100).toFixed(1)));
}
setTimeout(function(){
let myChart = echarts.init(vm.$refs.education);
let option = chartData.educationEffect(xAxisData, seriesBefore ,seriesAfter);
myChart.setOption(option);
vm.echartsData.chart1 = myChart;
},20);
},
setLearning(data) {
if(data.length == 0) {
vm.showChartLearn = false;
return;
} else {
vm.showChartLearn = true;
}
let xAxisData = [];
let seriesBefore = [];
let seriesAfter = [];
for(let i = 0; i < data.length ; i++) {
xAxisData.push(data[i].classifyName);
seriesBefore.push(parseFloat((data[i].beforeRate*100).toFixed(1)));
seriesAfter.push(parseFloat((data[i].afterRate*100).toFixed(1)));
}
setTimeout(function(){
let myChart = echarts.init(vm.$refs.learning);
let option = chartData.knowledgeEffect(xAxisData, seriesBefore ,seriesAfter);
myChart.setOption(option);
vm.echartsData.chart2 = myChart;
},20);
}
}
};
</script>
<style lang='scss' rel='stylesheet/scss'>
.learning-effect {
width: 100%;
.learning,
.education {
margin-top: 40px;
min-width: 400px;
height: 400px;
background: #fff;
background: #fff;
overflow: hidden;
// padding: 10px;
.spacing {
position: relative;
width: 100%;
height: 20px;
background: #f0f2f5;
}
.box-list {
position: relative;
height: 110px;
background: #f0f2f5;
.box-card {
position: relative;
background-color: #ffffff;
width: 49%;
margin-right: 2%;
height: 120px;
float: left;
.el-card__header {
border-bottom-width: 0;
}
.el-card__body {
padding: 0px;
}
.value {
color: #373839;
text-align: center;
margin-top: 24px;
margin-bottom: 8px;
height: 45px;
line-height: 45px;
font-size: 32px;
font-weight: 500;
}
.title {
color: #666666;
text-align: center;
font-size: 14px;
height: 20px;
line-height: 20px;
}
}
.box-last {
margin-right: 0%;
}
}
.chart-title {
position: relative;
margin-top: 30px;
margin-left: 30px;
height: 25px;
font-size:18px;
font-weight:600;
line-height: 25px;
color: #000000;
}
.chartEdu {
position: relative;
margin: 20px auto 0 auto;
width: 1064px;
height: 380px;
}
.chartLearn {
position: relative;
margin: 20px auto 0 auto;
width: 1064px;
height: 462px;
}
.chart-remarks {
position: relative;
height: 66px;
padding: 20px 0 30px 30px;
font-size: 16px;
font-weight: 400;
line-height: 16px;
color: #666666;
}
}
</style>
......@@ -2,9 +2,33 @@
<div class="item-list-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird" :jumPathThird="jumPathThird"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<el-form class="item-form" ref="formInline" :model="formInline" label-width="80px">
<div v-if="staticData == 1" class="item-form">
<div class="form-title">查询条件</div>
<div class="form-p">
<p>
<span>选择地区</span>
<span class="span-value">{{ reportParamModel.regionNames }}</span>
</p>
<p>
<span>原始数据</span>
<span class="span-value">{{ reportParamModel.originalFlag === 2 ? '否' : '是' }}</span>
</p>
<p>
<span>选择机构</span>
<span class="span-value">{{ reportParamModel.hospitalNames }}</span>
</p>
<p>
<span >选择时间</span>
<span class="span-value">{{ reportParamModel.beginDate }}-{{ reportParamModel.endDate }}</span>
</p>
</div>
<div class="buttom-line"></div>
</div>
<el-form v-if="staticData == 0" class="item-form" ref="formInline" :model="formInline" label-width="80px">
<div class="form-title">查询条件</div>
<el-form-item label="选择地区:">
<!-- :props="props" -->
<el-col :span="12">
<el-cascader
size="small"
ref="cascaderRegion"
......@@ -17,16 +41,22 @@
placeholder="请先选择地区后再进行查询"
style="width:330px"
></el-cascader>
</el-col>
<el-col :span="6">
<el-checkbox v-if="showOriginal == 1" size="small" v-model="formInline.checked">查看原始数据</el-checkbox>
</el-col>
</el-form-item>
<el-form-item label="选择机构:">
<div class="form-text" v-if="optionsRegion.length == 1 && hospitalCntList.length == 1">{{ hospitalCntList[0].hospitalName }}</div>
<el-select
v-else
size="small"
v-model="formInline.organization"
:placeholder="organizationNotice"
@change="changeOrganization"
multiple
collapse-tags
:disabled="formInline.region.length < 3"
:disabled="areaLen < 3"
style="width:330px"
>
<el-option
......@@ -46,23 +76,64 @@
@close="handleTagClose(tag)"
>{{ tag.label }}</el-tag>
</div>
<el-form-item label v-if="showOriginal == 1">
<el-checkbox size="small" v-model="formInline.checked">查看原始数据</el-checkbox>
<el-form-item label="选择时间:">
<el-col :span="12">
<el-select
size="small"
v-model="formInline.timeFlag"
placeholder="请选择"
style="width:330px;"
@change="changeTimeFlag"
>
<el-option
v-for="item in timeFlagList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-col>
<el-col :span="8" v-show="formInline.timeFlag == 2">
<el-date-picker
size="small"
v-model="formInline.during"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions0">
</el-date-picker>
</el-col>
</el-form-item>
<div class="buttom-line"></div>
<!-- <el-form-item label v-if="showOriginal !== 1">
<el-checkbox size="small" v-model="formInline.checked">查看原始数据</el-checkbox>
</el-form-item> -->
<div v-if="staticData == 0" class="form-button">
<el-button size="small" @click="search()" type="primary">查询</el-button>
<el-button size="small" @click="resetForm()">重置</el-button>
</div>
</el-form>
<div class="form-button">
<el-button @click="search()" type="primary">查询</el-button>
<el-button @click="resetForm()">重置</el-button>
</div>
<div class="button-group">
<el-button v-if="roleType == 'L1' || roleType == 'L2'" type="default" size="small" @click="changeDate">数据修改</el-button>
<!-- <el-button type="default" size="small" @click="update" v-else>修改范围</el-button> -->
<el-button type="default" size="small" :disabled="exportStatus" @click="exportExcel">导出明细</el-button>
<el-button class="" v-if="roleType == 1 || roleType == 2" type="default" size="small" @click="changeDate">数据修改</el-button>
<el-button class="" type="default" size="small" @click="exportPDF">导出PDF</el-button>
<el-button class="" type="default" size="small" :disabled="exportStatus" @click="exportExcel">导出明细</el-button>
</div>
<!-- <div class="item-tab"></div> -->
<el-tabs id="item-list-tabs" v-model="activeName" @tab-click="handleClick" :before-leave="beforeLeave">
<el-tab-pane label="参与情况" name="first">
<div class="item-tab"></div>
<el-tabs class="item-list-tabs" ref="tabs" id="item-list-tabs" v-model="activeName" @tab-click="handleClick" :before-leave="beforeLeave">
<el-tab-pane label="总体情况" name="zero" >
<data-all
ref="childDataAll"
:formInline="formInline"
:activeName="activeName"
:organizationNum="organizationNum"
:organizationList="organizationList"
:timeInfoData="timeInfoData"
:showRadio="showRadio"
></data-all>
</el-tab-pane>
<!-- <el-tab-pane label="参与情况" name="first">
<part-in
ref="childPart"
:formInline="formInline"
......@@ -70,22 +141,25 @@
:organizationNum="organizationNum"
:organizationList="organizationList"
></part-in>
</el-tab-pane>
</el-tab-pane> -->
<el-tab-pane label="人群分析" name="second">
<crowd-analysis
ref="childCrowd"
:formInline="formInline"
:activeName="activeName"
:organizationList="organizationList"
:timeInfoData="timeInfoData"
:showRadio="showRadio"
></crowd-analysis>
</el-tab-pane>
<el-tab-pane label="课程分析" name="third">
<el-tab-pane label="课程分析" name="third" v-if="displayCourse == 1">
<course-analysis
ref="childCourse"
:formInline="formInline"
:activeName="activeName"
:dialogData="dialogData"
:organizationList="organizationList"
:timeInfoData="timeInfoData"
></course-analysis>
</el-tab-pane>
<el-tab-pane label="考试分析" name="fourth" v-if="displayExam == 1">
......@@ -95,26 +169,32 @@
:activeName="activeName"
:dialogData="dialogData"
:organizationList="organizationList"
:timeInfoData="timeInfoData"
:containOfficialFlag="containOfficialFlag"
:showRadio="showRadio"
></examination-analysisfrom>
</el-tab-pane>
<!-- <el-tab-pane label="数据总览" name="zero" >
<data-all
ref="childDataAll"
<el-tab-pane label="学习效果分析" name="fifth" v-if="displayEffect == 1">
<learning-effect
ref="childEffect"
:formInline="formInline"
:activeName="activeName"
:organizationNum="organizationNum"
:organizationList="organizationList"
></data-all>
:timeInfoData="timeInfoData"
></learning-effect>
</el-tab-pane>
<el-tab-pane label="学习效果分析" name="fifth" :lazy=true>
<learning-effect></learning-effect>
</el-tab-pane> -->
</el-tabs>
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%" center>
<p style="text-align:center">文件正在生成,你可以去“我的导出下载”页,下载文件</p>
<p style="text-align:center">您的导出预计将在24小时内完成,是否继续?</p>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">留在当前页</el-button>
<el-button type="primary" @click="toDownload()">去下载</el-button>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="exportHttp()">继续导出</el-button>
</span>
</el-dialog>
<el-dialog title="提示" :visible.sync="dialogSearch" width="30%" center>
<p style="text-align:center">您的报告预计将在24小时内生成,是否继续?</p>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogSearch = false">取消</el-button>
<el-button type="primary" @click="exportTime()">继续生成</el-button>
</span>
</el-dialog>
<el-dialog title :visible.sync="dialogUpdate" width="80%" center>
......@@ -146,6 +226,8 @@ import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
import { log } from "util";
import html2Canvas from 'html2canvas';
import JsPDF from 'jspdf';
let vm = null;
export default {
......@@ -174,61 +256,91 @@ export default {
lazy: true,
lazyLoad(node, resolve) {
const { level } = node;
console.log("node", node);
if (node.level == 1) {
let req = {
provinceId: node.data.value
};
vm.GET("basic-data/position/cities", req).then(res => {
let newData = vm.setMoreOption(res.data.cityList, "cities");
console.log("newData", newData);
resolve(newData);
});
} else if (node.level == 2) {
// console.log("node props", node);
if (node.level >= 1 && node.loaded === false && node.children.length == 0) {
let req = {
cityId: node.data.value
projectId: vm.projectId,
regionId: node.data.value
};
vm.GET("basic-data/position/counties", req).then(res => {
let newData = vm.setMoreOption(res.data.countyList, "counties");
console.log("newData", newData);
resolve(newData);
});
} else if (node.level == 3) {
let req = {
countyId: node.data.value
};
vm.GET("basic-data/position/towns", req).then(res => {
let newData = vm.setMoreOption(res.data.townList, "towns");
console.log("newData", newData);
vm.GET("stats/region", req).then(res => {
let newData = vm.setRegionOptionMore(res.data.list);
// console.log("newData", newData);
resolve(newData);
});
} else {
resolve()
}
}
},
showOriginal: 2,
roleType: '',
formInline: {
region: [0],
region: [],
date: "",
organization: [],
checked: false,
timeFlag: 1,
during: null,
pageNo: 1,
pageSize: 20
pageSize: 20,
},
organizationNotice: '选择地区筛选到区才能选择机构',
dialogData: {
region: "",
region: "全部",
// regionData: "",
organization: ""
// organizationData: "",
},
tags: [],
activeName: "first",
activeName: "zero",
organizationNum: 0,
dialogVisible: false,
dialogUpdate: false,
displayExam: 2,
displayExam: 1,
flag: 1,
//v2.0更新data部分
timeFlagList: [
{
value: 1,
label: '截至昨日',
},
{
value: 2,
label: '自定义时间',
}
],
areaLen: 1,
hospitalCnt: 0,
hospitalId: [],
certFlag: 0,
displayCourse: 1,
displayEffect: 1,
exportReq: {},
dialogSearch: false,
downloadId: null,
staticData: 0,
timeInfoData: {},
reportParamModel: {
beginDate: "",
endDate: "",
regionNames: "",
hospitalNames: "",
originalFlag: 2
},
hospitalCntList: [],
maxDate: '',
minDate: '',
allRegionId: '',
containOfficialFlag: 1,
showRadio: 0,
pickerOptions0: {
disabledDate: time => {
// 在科学计数法中,为了使公式简便,可以用带“E”的格式表示。例如1.03乘10的8次方,可简写为“1.03e8”的形式
// 一天是24*60*60*1000 = 86400000 = 8.64e7
// console.log('this.maxDate',this.maxDate)
return time.getTime() > new Date(this.maxDate).getTime() || time.getTime() < new Date(this.minDate).getTime() - 8.64e7;
}
},
};
},
computed: {
......@@ -237,6 +349,11 @@ export default {
watch: {
tags: function(val) {
this.setDialogData();
},
formInline() {
if (this.$refs.optionsRegion) {
this.$refs.optionsRegion.dropDownVisible = false; //监听值发生变化就关闭它
}
}
},
created() {
......@@ -244,84 +361,163 @@ export default {
this.projectId = vm.getUrlSearch(window.location.href, "id");
this.projectName = vm.getUrlSearch(window.location.href, "projectName");
this.curmbThird = vm.getUrlSearch(window.location.href, "projectName");
this.getDisplay();
this.search();
this.downloadId = vm.getUrlSearch(window.location.href, "downloadId");
this.checkShowType();
// this.getDisplay();
// this.search();
// this.getRegionOption();
},
mounted: function() {
commonUtil.resizeHeight();
// setInterval(function() {
// document.querySelectorAll(".el-cascader-node").forEach(el => {
// el.onclick = function() {
// if (this.previousElementSibling) this.previousElementSibling.click();
// };
// });
// }, 1000);
},
methods: {
checkShowType() {
if(vm.downloadId == null) {
vm.getDisplay();
vm.curmbSecond = "项目列表";
vm.jumPathThird = "/report-list";
}
if(vm.downloadId != null) {
vm.staticData = 1;
vm.exportTimeInfo();
vm.curmbSecond = "任务列表";
vm.jumPathThird = "/export-download";
}
},
exportTimeInfo() {
let req = {};
openLoading(vm);
vm.GET("stats/export/time/info/"+ vm.downloadId, req).then(res => {
closeLoading(vm);
if(res.code == "000000") {
vm.timeInfoData = res.data;
vm.reportParamModel = res.data.reportParamModel;
let doctorInfoRep = res.data.doctorInfoRep;
vm.displayCourse = doctorInfoRep.existCourse;
vm.displayExam = doctorInfoRep.existExam;
vm.displayEffect = doctorInfoRep.existEffect;
vm.curmbThird = res.data.reportParamModel.projectName;
setTimeout(function() {
vm.$refs.childDataAll.$emit("static");
vm.$refs.childCrowd.$emit("static");
if(doctorInfoRep.existCourse == 1) {
vm.$refs.childCourse.$emit("static");
}
if(doctorInfoRep.existExam == 1) {
vm.$refs.childExam.$emit("static");
}
if(doctorInfoRep.existEffect == 1) {
vm.$refs.childEffect.$emit("static");
}
},20);
} else {
vm.$message(res.message);
}
});
},
getDisplay(type) {
let req = {
let reqInfo = {
projectId: vm.projectId,
projectName: vm.projectName,
};
openLoading(vm);
vm.reportGET("report/portal/display", req).then(res => {
closeLoading(vm);
vm.GET("stats/region/info", reqInfo).then(res => {
if (res.code == "000000") {
console.log('vm.showOriginal',res.data)
vm.showOriginal = res.data.status;
vm.roleType = res.data.roleType;
vm.displayCourse = res.data.existCourse;
vm.displayExam = res.data.existExam;
vm.flag = res.data.flag;
}
if(type !=2) {
vm.displayEffect = res.data.existEffect;
vm.certFlag = res.data.certFlag;
vm.maxDate = new Date(res.data.maxDate);
vm.minDate = new Date(res.data.minDate);
vm.containOfficialFlag = res.data.containOfficialFlag;
// console.log('日期:',vm.maxDate,vm.minDate)
vm.getRegionOption();
}
});
},
beforeLeave(activeName, oldActiveName) {
console.log('action',activeName,'oldActive',oldActiveName)
// console.log('action',activeName,'oldActive',oldActiveName)
},
handleClick(tab, event) {
//console.log(tab, event);
// if(tab.name == this.activeName) {
// return;
// console.log("activeName", this.activeName, tab.name);
// if (tab.name == "first") {
// this.$refs.childPart.$emit("init");
// } else if (tab.name == "second") {
// this.$refs.childCrowd.$emit("init");
// } else if (tab.name == "third") {
// this.$refs.childCourse.$emit("init");
// } else if (tab.name == "fourth") {
// this.$refs.childExam.$emit("init");
// }
console.log("activeName", this.activeName, tab.name);
if (tab.name == "first") {
this.$refs.childPart.$emit("init");
} else if (tab.name == "second") {
this.$refs.childCrowd.$emit("init");
} else if (tab.name == "third") {
this.$refs.childCourse.$emit("init");
} else if (tab.name == "fourth") {
this.$refs.childExam.$emit("init");
}
},
handleChange(value) {
this.formInline.organization = [];
this.tags = [];
let node =this.$refs.cascaderRegion.getCheckedNodes()[0];
console.log('node change',node)
setTimeout(function() {
// console.log(vm.$refs["cascaderRegion"].inputValue);
// console.log('行政区域改变',vm.$refs["cascaderRegion"].inputValue);
vm.dialogData.region = vm.$refs["cascaderRegion"].inputValue;
// vm.dialogData.regionData = value[value.length-1];
// console.log('vm.dialogData.region',vm.dialogData.region)
}, 20);
// console.log('region',value,vm.formInline);
if (value.length >= 3) {
this.getOrganizationList();
this.organizationNotice = "请选择机构";
if(node.label !== '全部') {
let areaArr = value[value.length -1].split('_');
vm.areaLen = areaArr.length;
// console.log('areaArr!!',areaArr);
if (areaArr.length >= 3) {
this.getOrganizationList();
this.organizationNotice = "请选择机构";
} else {
this.organizationNotice = "选择地区筛选到区才能选择机构";
}
} else {
this.organizationNotice = "选择地区筛选到区才能选择机构";
vm.areaLen = 1;
vm.organizationNotice = "选择地区筛选到区才能选择机构";
}
vm.gethHspitalsCnt()
//添加子节点
// let node =this.$refs.cascaderRegion.getCheckedNodes()[0];
if(node.data && node.data.id && node.hasChildren === true && node.loaded === false) {
let req = {
projectId: vm.projectId,
regionId: node.data.value
};
vm.GET("stats/region", req).then(res => {
let newData = vm.setRegionOptionMore(res.data.list);
vm.searchNode(vm.optionsRegion, node.data.id, newData);
});
}
},
searchNode(val,id,data){
val.map(item=>{
if(item.id===id){
vm.$set(item,'children',data)
}else if(item.children&&item.children.length){
return vm.searchNode(item.children,id,data)
}
return item
})
},
setMoreOption(data, type) {
setRegionOptionMore(data) {
let option = [];
for (let i = 0; i < data.length; i++) {
let obj = data[i];
if (type == "cities") {
obj.label = data[i].cityName;
obj.value = data[i].cityId;
} else if (type == "counties") {
obj.label = data[i].countyName;
obj.value = data[i].countyId;
// obj.leaf = true;
} else if (type == "towns") {
obj.label = data[i].townName;
obj.value = data[i].townId;
obj.label = data[i].label;
obj.value = data[i].id;
if(obj.degree == 4) {
obj.leaf = true;
}
option.push(obj);
......@@ -391,45 +587,46 @@ export default {
},
//获取地区
getRegionOption() {
if(vm.flag == 2 && vm.roleType == "L2") {
this.optionsRegion = [{id: 11, provinceId: 330, provinceName: "浙江省",value: 330, label: "浙江省"}]
} else {
let req = {};
openLoading(vm);
vm.GET("basic-data/position/provinces", req).then(res => {
closeLoading(vm);
// let list = [];
// for(let i =0;i<res.data.provinceList.length;i++) {
// list[i] = res.data.provinceList[i].provinceName;
// }
// console.log(list);
if (res.code == "000000") {
this.optionsRegion = operationData.setRegionOption(
res.data.provinceList
);
// console.log("this.optionsRegion", this.optionsRegion);
}
});
}
let req = {
projectId: vm.projectId,
};
vm.GET("stats/region", req, '', '', true).then(res => {
if (res.code == "000000") {
vm.formInline.region = [];
vm.formInline.region[0] = res.data.list[0].id;
vm.allRegionId = res.data.list[0].id;
vm.optionsRegion = operationData.setRegionOptionNew(
res.data.list
);
vm.search();
vm.gethHspitalsCnt();
}
});
},
gethHspitalsCnt() {
let req = {
projectId: vm.projectId,
regionId: vm.formInline.region[vm.formInline.region.length - 1]
};
vm.GET("stats/region/hospitals/cnt", req, '', '', false).then(res => {
if (res.code == "000000") {
vm.hospitalCnt = res.data.hospitalCnt;
vm.hospitalCntList = res.data.list
}
});
},
//获取机构列表
getOrganizationList() {
this.organizationList = [];
let countyId = vm.formInline.region[vm.formInline.region.length - 1];
let type = 3;
if(vm.formInline.region.length == 4) {
type = 5;
}
vm.organizationList = [];
let regionId = vm.formInline.region[vm.formInline.region.length - 1];
let req = {
projectId: vm.projectId,
type: type,
id: countyId
regionId : regionId
};
openLoading(vm);
vm.reportGET("report/portal/getOrganizationList", req).then(res => {
closeLoading(vm);
vm.GET("stats/region/hospital", req, '', '', true).then(res => {
if (res.code == "000000") {
this.organizationList = operationData.getLearnOrganization(
res.data.hospitalList
res.data.list
);
}
});
......@@ -451,23 +648,96 @@ export default {
closeSearch() {
vm.dialogUpdate = false;
vm.getDisplay(2);
vm.search();
vm.resetForm();
},
setExportReq() {
vm.exportReq = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during,'begin'),
endDate: operationData.setDuringTime(vm.formInline.during,'end'),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag,
};
},
changeTimeFlag(value) {
if(value == 1) {
vm.formInline.during = null;
}
},
exportTime() {
let req = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during, "begin"),
endDate: operationData.setDuringTime(vm.formInline.during, "end"),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 2 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag,
hospitalNames: vm.dialogData.organization,
regionNames: vm.dialogData.region,
};
if(vm.organizationList.length == 1) {
req.hospitalIdList = [];
req.hospitalIdList[0] = vm.organizationList[0].value;
}
// if(req.regionNames == '全部') {
//全部地区 机构只有一个情况
if(vm.hospitalCntList.length == 1) {
req.hospitalIdList = [];
req.hospitalIdList[0] = vm.hospitalCntList[0].hospitalId;
}
// }
openLoading(vm);
vm.POST("stats/export/time", req).then(res => {
closeLoading(vm);
if(res.code == "000000") {
vm.$router.push("export-download?projectId="+vm.projectId+'&listType=2');
} else {
vm.$message(res.message)
}
vm.dialogSearch = false;
});
},
search() {
// console.log(this.formInline,this.activeName);
if (this.activeName == "first") {
this.organizationNum = this.getOrganizationNum();
// console.log('this.organizationNum',this.organizationNum)
this.$nextTick(function() {
this.$refs.childPart.$emit("search");
});
} else if (this.activeName == "second") {
this.$refs.childCrowd.$emit("search");
} else if (this.activeName == "third") {
this.$refs.childCourse.$emit("search");
} else if (this.activeName == "fourth") {
this.$refs.childExam.$emit("search");
// console.log(vm.formInline);
if(vm.formInline.timeFlag == 1) {
//截止昨日
vm.setExportReq();
vm.$refs.childDataAll.$emit("search");
vm.$refs.childCrowd.$emit("search");
if(vm.displayCourse == 1) {
vm.$refs.childCourse.$emit("search");
}
if(vm.displayExam == 1) {
vm.$refs.childExam.$emit("search");
}
if(vm.displayEffect == 1) {
vm.$refs.childEffect.$emit("search");
}
} else if(vm.formInline.timeFlag == 2) {
//开始时间结束时间
if(vm.formInline.during == null) {
vm.$message('自定义时间,请选择时间段!')
} else {
vm.dialogSearch = true;
}
}
// if (this.activeName == "first") {
// this.organizationNum = this.getOrganizationNum();
// // console.log('this.organizationNum',this.organizationNum)
// this.$nextTick(function() {
// this.$refs.childPart.$emit("search");
// });
// } else if (this.activeName == "second") {
// this.$refs.childCrowd.$emit("search");
// } else if (this.activeName == "third") {
// this.$refs.childCourse.$emit("search");
// } else if (this.activeName == "fourth") {
// this.$refs.childExam.$emit("search");
// }
},
//重置
resetForm() {
......@@ -478,51 +748,56 @@ export default {
date: "",
organization: [],
checked: false,
timeFlag: 1,
during: null,
pageNo: 1,
pageSize: 20,
}
);
vm.formInline.region[0] = vm.allRegionId;
vm.areaLen = 0;
vm.tags = [];
if (this.activeName == "first") {
this.$refs.childPart.$emit("reset");
} else if (this.activeName == "second") {
this.$refs.childCrowd.$emit("reset");
} else if (this.activeName == "third") {
this.$refs.childCourse.$emit("reset");
} else if (this.activeName == "fourth") {
this.$refs.childExam.$emit("reset");
}
setTimeout(function(){
vm.search();
},20)
// if (this.activeName == "first") {
// this.$refs.childPart.$emit("reset");
// } else if (this.activeName == "second") {
// this.$refs.childCrowd.$emit("reset");
// } else if (this.activeName == "third") {
// this.$refs.childCourse.$emit("reset");
// } else if (this.activeName == "fourth") {
// this.$refs.childExam.$emit("reset");
// }
},
exportExcel() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行导出 ')
});
return;
if(vm.downloadId == null) {
//按钮置灰三秒
vm.exportStatus = true;
setTimeout(function() {
vm.exportStatus = false;
},3000);
this.dialogVisible = true;
} else {
let downloadUrl = vm.timeInfoData.excelDownUrl;
setTimeout(() => {
window.open(downloadUrl);
}, 500);
}
//按钮置灰三秒
vm.exportStatus = true;
setTimeout(function() {
vm.exportStatus = false;
},3000);
this.dialogVisible = true;
//download接口
let checkAll = operationData.hasAll(vm.formInline.organization)
let req = {
projectId : vm.projectId,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
originalFlag: vm.formInline.checked == false ? 0 : 1,
projectName: vm.$route.query.projectName,
cityName: vm.getCityName(),
};
},
exportHttp() {
let req = vm.exportReq;
openLoading(vm);
vm.reportGET("report/downLoad/downLoad", req).then(res => {
vm.POST("stats/export/current", req).then(res => {
closeLoading(vm);
// console
if (res.code == "000000") {
if(res.code == "000000") {
vm.$router.push("export-download?projectId="+vm.projectId+'&listType=1');
} else {
vm.$message(res.message)
}
vm.dialogVisible = false;
});
},
getCityName() {
......@@ -543,8 +818,6 @@ export default {
};
vm.$router.push({ path: "export-download", query: routerData });
},
update() {},
release() {},
setDialogData() {
//传递给dialog数据
this.dialogData.organization = "";
......@@ -570,13 +843,89 @@ export default {
this.$nextTick(function() {
this.$refs.childAlignment.$emit("search");
});
}
},
exportPDF() {
openLoading(vm);
let tabsList = vm.$refs.tabs.$children;
for(let i= 1;i<tabsList.length;i++) {
tabsList[i].$el.style.display = 'block';
}
let element = '';
element = document.querySelector('.item-list-tabs .el-tabs__content');
if(element == null) {
return
}
let opts = {
// scale:window.devicePixelRatio, // 添加的scale 参数
// logging: true, //日志开关
// width:element.offsetWidth, //dom 原始宽度
// height:element.offsetHeight, //dom 原始高度
// useCORS: true,
// taintTest: true, //是否在渲染前测试图片
// dpi:300,
background: '#F0F2F5',
};
vm.showRadio = 1;
setTimeout(() => {
html2Canvas(element,opts).then(function(canvas) {
let contentWidth = canvas.width;
let contentHeight = canvas.height;
//一页pdf显示html页面生成的canvas高度;
let pageHeight = contentWidth / 592.28 * 841.89;
//未生成pdf的html页面高度
let leftHeight = contentHeight;
//页面偏移
let position = 0;
//a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
let imgWidth = 595.28;
let imgHeight = 592.28 / contentWidth * contentHeight;
// let pageData = canvas.toDataURL('image/jpeg', 1.0);
let pageData = canvas.toDataURL('image/png');
let pdf = new JsPDF('', 'pt', [contentWidth*0.8,contentHeight*0.8]);
// pdf.addImage(pageData, 'JPEG', 0, position, contentWidth*0.8, contentHeight*0.8)
pdf.addImage(pageData, 'PNG', 0, position, contentWidth*0.8, contentHeight*0.8)
let title = "导出学情报告";
pdf.save(title + '.pdf');
for(let i= 1;i<tabsList.length;i++) {
let idStr = tabsList[i].$el.id;
// console.log(idStr,vm.activeName);
if(idStr.indexOf(vm.activeName) == -1) {
tabsList[i].$el.style.display = 'none';
}
}
vm.showRadio = 0;
closeLoading(vm);
});
}, 100);
},
}
};
</script>
<style lang="scss">
.item-list-wrap {
.el-radio-button__inner:hover {
color: #449284;
}
.is-active {
.el-radio-button__inner:hover {
color: #fff;
}
}
.overflow-chart {
overflow-x: auto;
}
.el-radio-button {
display: contents;
}
.component-content {
// position: relative;
// background: #fff;
padding: 10px;
.header-title {
......@@ -586,48 +935,137 @@ export default {
border-bottom: 1px solid #efefef;
}
.item-form {
padding: 10px;
background: #fff;
width:100%;
border-radius: 4px;
}
.form-button {
width: 45%;
top: -120px;
position: relative;
left: 50%;
// margin-bottom: 20px;
padding: 10px 0 10px 0;
background: #fff;
width: 100%;
border-radius: 4px 4px 0 0;
.form-text {
color: #606266;
font-size: 12px;
}
.form-p {
margin: 17px 0 0 30px;
line-height:20px;
font-size:14px;
color: #666666;
p {
margin-bottom: 12px;
.span-value {
margin-left: 20px;
}
}
}
.buttom-line {
margin: 30px auto 10px auto;
height: 1px;
background: #E4E7ED;
width: 94.66%
}
.form-title {
position: relative;
margin: 20px 0 24px 30px;
height: 25px;
font-size:18px;
font-weight:600;
line-height: 25px;
color: #000000;
}
.el-form-item {
margin-left: 25px;
}
.is-checked {
.el-checkbox__inner {
background-color: #449284;
border-color: #449284;
}
.el-checkbox__label {
color: #449284;
}
}
.form-button {
position: absolute;
width: 140px;
top: 78px;
right: 10px;
.el-button--default{
border:1px solid #449284;
color: #449284;
}
.el-button:hover {
background: #F1F7F6;
}
}
.col-text {
font-size: 12px;
}
}
.button-group {
position: relative;
// right: 100px;
float: right;
margin-right: 20px;
z-index: 999;
.el-button {
border:1px solid #449284;
color: #449284;
}
.is-disabled {
color: #fff;
}
.el-button:hover {
background: #F1F7F6;
}
}
.choose {
font-size: 12px;
margin-bottom: 20px;
}
.item-tab {
width: 95%;
width: 100%;
height: 46px;
background: #F0F2F5;
position: absolute;
}
.el-tabs__item.is-active {
color: #409eff;
color: #449284;
}
.el-tabs__item:hover {
color: #449284;
}
.el-tabs__header {
width: 65%;
width: 100%;
background: #fff;
margin-bottom: 20px;
.el-tabs__nav-scroll {
margin-left: 30px;
}
}
.el-tabs__nav-wrap::after {
height: 0px;
}
.tag-group {
margin-left: 78px;
margin-left: 104px;
margin-bottom: 20px;
.el-tag {
margin-right: 20px;
}
}
.el-tabs__active-bar {
background-color: #449284;
}
.el-tabs__content {
::-webkit-scrollbar
{
width: 4px;
height: 10px;
background-color: #D8D8D8;
}
::-webkit-scrollbar-thumb {
background-color: #D8D8D8;
}
}
}
}
</style>
\ No newline at end of file
......@@ -121,7 +121,7 @@ export default {
projectId: vm.projectId,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
originalFlag: vm.formInline.checked == false ? 0 : 1
originalFlag: vm.formInline.checked == false ? 2 : 1
};
console.log("1 req", req);
openLoading(vm);
......
......@@ -31,8 +31,8 @@
<el-option
v-for="(item,index) in rankList"
:key="index"
:label="item.gradeName"
:value="item.gradeFlag"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
......@@ -45,26 +45,42 @@
<el-button @click="resetForm()">重置</el-button>
</div>
<el-table :data="tableData" class="course-table">
<el-table-column prop="doctorName" label="姓名" align="center"></el-table-column>
<el-table-column prop="sex" label="性别" align="center"></el-table-column>
<el-table-column prop="age" label="年龄" align="center"></el-table-column>
<el-table-column prop="titleName" label="职称" align="center"></el-table-column>
<el-table-column prop="doctorName" label="姓名" align="center">
<template slot-scope="scope">
<span>{{ scope.row.doctorName | nullOfValue }}</span>
</template>
</el-table-column>
<el-table-column prop="sex" label="性别" align="center">
<template slot-scope="scope">
<span>{{ scope.row.sex | sexValue}}</span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" align="center">
<template slot-scope="scope">
<span>{{ scope.row.age | nullOfValue }}</span>
</template>
</el-table-column>
<el-table-column prop="titleName" label="职称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.titleName | nullOfValue }}</span>
</template>
</el-table-column>
<el-table-column prop="hospitalName" label="机构" align="center"></el-table-column>
<el-table-column prop="addressName" label="地区" align="center"></el-table-column>
<el-table-column v-if="tableType == 1" prop="learnStatus" label="参与课程状态" align="center">
<el-table-column v-if="tableType == 1" prop="finishFlag" label="参与课程状态" align="center">
<template slot-scope="scope">
<span>{{ scope.row.learnStatus }}</span>
<span>{{ [scope.row.finishFlag , base] | finishFlagType }}</span>
</template>
</el-table-column>
<el-table-column
v-if="tableType == 1"
prop="finishedTime"
prop="finishTime"
label="完成培训日期"
align="center"
min-width="150"
>
<template slot-scope="scope">
<span>{{ scope.row.finishedTime }}</span>
<span>{{ scope.row.finishTime | nullOfValue }}</span>
</template>
</el-table-column>
<el-table-column
......@@ -75,7 +91,7 @@
align="center"
>
<template slot-scope="scope">
<span>{{ scope.row.passTime }}</span>
<span>{{ scope.row.passTime | nullOfValue }}</span>
</template>
</el-table-column>
<el-table-column
......@@ -91,8 +107,7 @@
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有相关数据,请重新选择查询范围</p>
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
......@@ -102,7 +117,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formData.pageNo"
:page-sizes="[20, 50 ,100]"
:page-sizes="[20, 50 ,100, 200]"
:page-size="formData.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
......@@ -148,26 +163,43 @@ export default {
tableData: [],
tableType: 1,
totalRows: 0,
statusList: [
statusList: [],
rankList: [
{
value: -1,
label: "全部"
},
{
value: 0,
label: "未参与"
label: "无成绩"
},
{
value: 1,
label: "参与中"
label: "优秀"
},
{
value: 2,
label: "已完成"
}
label: "良好"
},
{
value: 3,
label: "及格"
},
{
value: 4,
label: "不及格"
},
{
value: 5,
label: "通过"
},
{
value: 6,
label: "不通过"
},
],
rankList: [],
queryData: {}
queryData: {},
base: null,
};
},
// computed: {
......@@ -177,13 +209,52 @@ export default {
// },
created() {
vm = this;
vm.base = vm.getUrlSearch(window.location.href, "base");
vm.getInitData();
vm.search();
vm.initStatusList();
},
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
initStatusList() {
if(vm.base == null) {
vm.statusList = [
{
value: -1,
label: "全部"
},
{
value: 0,
label: "未参与"
},
{
value: 1,
label: "未完成"
},
{
value: 2,
label: "已完成"
}
];
} else {
vm.statusList = [
{
value: -1,
label: "全部"
},
{
value: 0,
label: "未参与"
},
{
value: 1,
label: "已参与"
},
]
}
},
getHostital() {
let req = {
projectId: vm.queryData.projectId,
......@@ -200,9 +271,9 @@ export default {
vm.curmbThird = vm.getUrlSearch(window.location.href, "projectName");
vm.jumPathFouth = '/item-list?id=' + vm.queryData.projectId + '&projectName=' + vm.queryData.projectName;
console.log("queryData", vm.queryData);
if(vm.queryData.type == 4) {
vm.getHostital();
}
// if(vm.queryData.hospitalIdList.length > 0) {
// vm.getHostital();
// }
},
searchData() {
vm.formData.pageNo = 1;
......@@ -216,18 +287,27 @@ export default {
// console.log('this.tableType',this.tableType)
let req = {
projectId: query.projectId,
beginDate: query.beginDate,
endDate: query.endDate,
hospitalIdList: operationData.getHospitalIdList(query.hospitalIdList),
originalFlag: query.originalFlag,
ids: query.ids,
type: query.type,
regionId: query.regionId,
timeFlag: query.timeFlag,
courseId: query.courseId,
learnFlag: vm.formData.learnFlag,
doctorName: vm.formData.doctorName,
type: vm.formData.learnFlag,
name: vm.formData.doctorName,
pageNo: vm.formData.pageNo,
pageSize: vm.formData.pageSize,
};
console.log("course req", req);
let reqUrl = '';
if(vm.base == null) {
reqUrl = 'stats/report/courseDetail';
} else {
reqUrl = 'stats/export/time/info/course';
}
console.log("course req", req , reqUrl);
openLoading(vm);
vm.reportGET("report/portalProjectCourse/getUserList", req).then(res => {
vm.POST(reqUrl, req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.totalCount == 0 ) {
......@@ -242,28 +322,29 @@ export default {
} else if (this.tableType == 2) {
vm.curmbFouth = "考试培训情况";
//考试分析
let reqRank = {
projectId: query.projectId,
}
vm.reportGET("report/portalProjectExam/getGradeList", reqRank).then(res => {
if (res.code == "000000") {
vm.rankList = operationData.initRank(res.data.list);
}
});
let req = {
projectId: query.projectId,
beginDate: query.beginDate,
endDate: query.endDate,
hospitalIdList: operationData.getHospitalIdList(query.hospitalIdList),
originalFlag: query.originalFlag,
ids: query.ids,
type: query.type,
regionId: query.regionId,
timeFlag: query.timeFlag,
examId: query.examId,
gradeFlag: vm.formData.gradeFlag,
doctorName: vm.formData.doctorName,
pageNo: vm.formData.pageNo,
pageSize: vm.formData.pageSize,
};
console.log("exam req", req);
let reqUrl = '';
if(vm.base == null) {
reqUrl = 'stats/report/getUserList';
} else {
reqUrl = 'stats/export/time/info/exam';
}
// console.log("exam req", req);
openLoading(vm);
vm.reportGET("report/portalProjectExam/getUserList", req).then(res => {
vm.POST(reqUrl, req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.totalCount == 0 ) {
......@@ -275,6 +356,8 @@ export default {
vm.$message(res.message);
}
});
}
},
resetForm() {
......@@ -293,6 +376,7 @@ export default {
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.formData.pageSize = val;
this.formData.pageNo = 1;
this.search();
},
handleCurrentChange(val) {
......@@ -328,6 +412,12 @@ export default {
position: relative;
left: 50%;
}
.table-empty {
img {
height: 24px;
width: 106px;
}
}
}
}
</style>
\ No newline at end of file
......@@ -54,8 +54,7 @@
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png" />
<p>没有找到符合的结果</p>
<img src="../../assets/image/noData.png" />
</div>
</div>
</el-table>
......@@ -65,7 +64,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formData.pageNo"
:page-sizes="[20, 50 ,100]"
:page-sizes="[20, 50 ,100, 200]"
:page-size="formData.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
......@@ -106,6 +105,10 @@ export default {
{
label: "已结束",
value: 2
},
{
label: "已下架",
value: 3
}
],
tableData: [],
......@@ -134,9 +137,9 @@ export default {
search() {
let req = {};
req = this.formData;
openLoading(vm);
vm.GET("portal/portalInfo/getPortalReportProject", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.totalRows == 0) {
vm.$message("没有找到符合的结果");
......@@ -176,7 +179,11 @@ export default {
id: row.id,
projectName: row.projectName,
};
vm.$router.push({ path: "/item-list" , query: routerData });
if(row.showNew == 1) {
vm.$router.push({ path: "/item-list" , query: routerData });
} else {
vm.$router.push({ path: "/item-list-old" , query: routerData });
}
}
}
};
......@@ -186,6 +193,12 @@ export default {
.itemlist-content {
padding: 10px;
background: #fff;
.table-empty {
img {
height: 24px;
width: 106px;
}
}
}
}
</style>
\ No newline at end of file
......@@ -5,7 +5,7 @@
<div class="header-title">
查询条件
<el-upload
v-if="activeUser == 'L1'"
v-if="activeUser == 'L1' && authorityType == 1"
class="upload-excel"
action="#"
accept=".xlsx"
......@@ -106,42 +106,61 @@
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="350" align="left">
<template slot-scope="scope">
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L2')"
@click="openDialog(scope.row,'L2')"
>升级项目负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L3')"
@click="openDialog(scope.row,'L3')"
>升级次级负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L3_2')"
@click="openDialog(scope.row,'L3_2')"
>降为次级负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L0')"
@click="openDialog(scope.row,'L0')"
>降为普通用户</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showAppend(scope.row.projeceRole)"
@click="addArea(scope.row)"
>追加区域权限</el-button>
<template slot-scope="scope" >
<div v-if="authorityType == 2">
<el-button
class="button-text"
type="text"
size="small"
v-if="scope.row.projeceRole != 'L2'"
@click="proChange(scope.row,'L2')"
>升级项目负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-else
@click="proChange(scope.row,'')"
>取消项目负责人</el-button>
</div>
<div v-if="authorityType == 1">
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L2')"
@click="openDialog(scope.row,'L2')"
>升级项目负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L3')"
@click="openDialog(scope.row,'L3')"
>升级次级负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L3_2')"
@click="openDialog(scope.row,'L3_2')"
>降为次级负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L0')"
@click="openDialog(scope.row,'L0')"
>降为普通用户</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showAppend(scope.row.projeceRole)"
@click="addArea(scope.row)"
>追加区域权限</el-button>
</div>
</template>
</el-table-column>
<div slot="empty">
......@@ -163,6 +182,18 @@
:total="totalRows"
></el-pagination>
</div>
<el-dialog title :visible.sync="changeDialog.show" width="30%" center>
<p v-html="changeDialog.txt">
</p>
<span slot="footer" class="dialog-footer">
<el-button type="default" size="small" @click="changeDialog.show = false">取消</el-button>
<el-button type="primary" size="small" @click="changeFunRole()">确定</el-button>
</span>
</el-dialog>
<el-dialog title :visible.sync="dialog.show" width="30%" center>
<!-- <p v-if="numL3 > 1" class="dialog-p">
确认将{{ dialog.role }}
......@@ -359,7 +390,12 @@ export default {
role: "项目负责人",
name: "李雷",
option: "升级为项目负责人",
full: false
full: false,
},
changeDialog:{
show: false,
txt:''
},
dialogFull: false,
scopeRow: {},
......@@ -384,7 +420,10 @@ export default {
attachRegionId: "",
creator: false,
hospitalMasterAdmin: false
hospitalMasterAdmin: false,
optionType:'',
optionItem:{},
authorityType:0,
};
},
created() {
......@@ -396,6 +435,45 @@ export default {
commonUtil.resizeHeight();
},
methods: {
//add 升、降项目负责人
proChange(item,str){
this.optionType = str;
this.optionItem = item;
let s = ''
s = str != '' ? '确认将项目负责人 <span class="user-name">'+item.userName+'</span> 升级为项目负责人吗?' : '确认取消 <span class="user-name">'+ item.userName+'</span> 项目负责人权限吗?'
this.changeDialog = {
show: true,
txt:s
}
},
changeFunRole() {
let req = {
portalProjectId: this.formInline.portalProjectId,
updateL: this.optionType == '' ? 'L3' : 'L2',
userId: this.optionItem.userId,
numL2: this.numL2,
nowL: this.optionItem.projeceRole
};
// vm.GET("portal/portalProjectOrRole/roleLevelUpdate", req).then(res => {
vm.GET("portal/v2/role/roleLevelUpdate", req).then(res => {
vm.dialog.show = false;
if (res.code == "000000") {
console.log(res);
vm.queryRoleList();
vm.$message({
message: "设置成功!",
type: "success"
});
this.changeDialog = {
show: false,
txt:''
}
} else {
this.$message.error(res.code);
}
});
},
updateAgain() {
vm.dialogFail = false;
},
......@@ -497,6 +575,8 @@ export default {
closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.projectRoleInfoModels;
vm.authorityType = res.data.authorityType
vm.totalRows = res.data.total;
vm.activeUser = res.data.activeUser;
vm.creator = res.data.creator;
......@@ -1094,4 +1174,4 @@ export default {
overflow-y: scroll;
}
}
</style>
\ No newline at end of file
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册