提交 dc20dddb 编写于 作者: guangjun.yang's avatar guangjun.yang

解决选择机构看不到名字的问题

上级 c63ea58d
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
此差异已折叠。
// 检查号码是否符合规范,包括长度,类型
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
此差异已折叠。
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 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(`请输入正确的手机号码`))
}
}
此差异已折叠。
此差异已折叠。
(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
此差异已折叠。
/**
* 添加自定义的验证规则
*/
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
......@@ -120,8 +120,8 @@
</template>
<script>
import { openLoading, closeLoading } from "../../utils/utils";
import * as operationData from "../../utils/operation";
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as operationData from "../../utils-o/operation";
let vm;
export default {
props: {
......
......@@ -51,8 +51,8 @@
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import * as commonUtil from "../../utils/utils";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils-o/utils";
import { openLoading, closeLoading } from "../../utils-o/utils";
import axios from "axios";
let vm = null;
export default {
......
......@@ -65,8 +65,8 @@
</template>
<script>
import { create } from "domain";
import * as operationData from "../../utils/operation";
import { openLoading, closeLoading } from "../../utils/utils";
import * as operationData from "../../utils-o/operation";
import { openLoading, closeLoading } from "../../utils-o/utils";
let vm = null;
export default {
props: {
......
......@@ -30,9 +30,9 @@
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
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;
......
......@@ -52,9 +52,9 @@
<script>
import { log } from 'util';
import * as operationData from "../../utils/operation";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
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: {
......
......@@ -6,8 +6,8 @@
</template>
<script>
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as commonUtil from "../../utils-o/utils";
const echarts = require("echarts");
export default {
data() {
......
......@@ -132,9 +132,9 @@ 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/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
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;
......
......@@ -46,9 +46,9 @@
</template>
<script>
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
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;
......
......@@ -115,9 +115,9 @@
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
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: {
......
......@@ -76,8 +76,8 @@
</template>
<script>
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import { openLoading, closeLoading } from "../../utils-o/utils";
import * as commonUtil from "../../utils-o/utils";
import BreadCrumb from "../../components/breadcrumb.vue";
let vm = null;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册