提交 24658176 编写于 作者: zhentian.jia's avatar zhentian.jia

接口联调

上级 25afd104
......@@ -7,7 +7,8 @@ export const envConfig = {
// // baseUrl: 'http://192.168.140.14:10201/',
// baseUrl: 'https://test1-sc.yunqueyi.com/',
//baseUrl: 'https://uat-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/',
apiUrl: 'https://dev-api.yunqueyi.com/',
......
......@@ -273,40 +273,70 @@ export function getEcologySelect(data) {
}
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) {
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 = [];
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 getRegionOption() {
let option = [{
value: 'zhejiang',
value: 1,
label: '浙江',
children: [{
value: 'hangzhou',
value: 2,
label: '杭州',
children: [{
value: 'xihu',
value: 5,
label: '西湖区'
}, {
value: 'donghu',
value: 6,
label: '东湖区'
}]
}]
}];
return option;
}
export function getPicOption(title,legendData, colorData, seriesData) {
export function getLearnOrganization(data) {
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
};
organization.push(obj);
}
return organization;
}
export function getPicOption(title, legendData, colorData, seriesData) {
let option = {
title: {
text: title,
x: "center"
},
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: "vertical",
left: "left",
......@@ -345,7 +375,7 @@ export function getBarOption(xAxisData, seriesData) {
type: 'category',
data: xAxisData,
axisLabel: {
interval:0
interval: 0
}
// axisTick: {
// alignWithLabel: true
......@@ -368,7 +398,7 @@ export function getBarOption(xAxisData, seriesData) {
};
return option;
}
export function getRank() {
export function getRank(xAxisData, seriesData) {
let option = {
color: ["#1E90FF", "#32CD32"],
title: {
......@@ -384,13 +414,14 @@ export function getRank() {
},
tooltip: {
trigger: "axis",
formatter: '{b0}<br/>{a0}: {c0}%',
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
data: ["完成人数", "参与人数"],
data: ["完成人数"],
bottom: 0
},
grid: {
......@@ -402,30 +433,64 @@ export function getRank() {
xAxis: [
{
type: "category",
data: ["周一", "周二", "周三", "周一", "周二", "周三"],
data: xAxisData,
}
],
yAxis: [
{
type: "value"
type: "value",
axisLabel: {
show: true,
interval: 'auto',
formatter: '{value}%'
},
}
],
series: [
{
name: "完成人数",
name: "完成通过率",
type: "bar",
stack: "人数",
barMaxWidth: "80",
data: [120, 132, 101, 120, 132, 101],
stack: "完成通过率",
barMaxWidth: "50",
data: seriesData,
},
{
name: "参与人数",
type: "bar",
stack: "人数",
barMaxWidth: "80",
data: [220, 182, 191, 220, 182, 191]
}
// {
// name: "参与人数",
// type: "bar",
// stack: "人数",
// barMaxWidth: "80",
// data: [220, 182, 191, 220, 182, 191]
// }
]
};
return option;
}
export function getSearchType(formData) {
let type = 0;
if(formData.region.length == 1 || formData.region.length == 2) {
type = formData.region.length;
} else if(formData.region.length == 3) {
if(formData.organization.length == 0) {
type = 3;
} else {
type = 4
}
}
return type;
}
export function getIds(formData) {
let ids='';
if(formData.organization.length == 0) {
//地区id
ids = formData.region[formData.region.length-1];
} else {
//机构id多选
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;
}
\ No newline at end of file
......@@ -12,7 +12,7 @@
<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">
<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>
......@@ -49,11 +49,14 @@ export default {
return {
radio: 1,
updateCrowd: false,
sexData: []
sexData: [],
projectId: "",
crowdData: {}
};
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
this.$nextTick(function() {
this.search();
});
......@@ -71,17 +74,32 @@ export default {
});
});
if (this.activeName == "second") {
this.updateResize();
// this.updateResize();
}
},
methods: {
search() {
if (this.activeName == "second") {
this.getEducationData();
this.getJobData();
this.getSexData();
this.getAgeData();
if (this.activeName != "second") {
return;
}
let req = {
projectId: vm.projectId,
cityOrHospitalId: operationData.getIds(vm.formInline),
kind: operationData.getSearchType(vm.formInline),
type: this.radio,
};
console.log("2 req", req);
openLoading(vm);
vm.GET("report/portal/getPeoplesDetails", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.crowdData = res.data;
this.educationDivision();
this.jobDivision();
this.getSexData();
this.ageDivision();
}
});
},
updateResize() {
this.$nextTick(function() {
......@@ -96,57 +114,40 @@ export default {
});
},
updateRadio(value) {
console.log(value);
console.log(value,vm.radio);
this.search();
},
//用户学历分布
getEducationData() {
let data = [2,22, 50, 350, 80, 95,55];
if (this.updateCrowd == true) {
data = [3,33, 90, 100, 22, 75,66];
}
this.educationDivision(data);
},
//用户职务分布
getJobData() {
let data = [27, 70, 65, 50];
this.jobDivision(data);
},
//用户性别分布
getSexData() {
let sexList = this.crowdData.sexList;
this.sexData = [
{
src: require("../../assets/image/man.png"),
type: "男性",
num: 21715
num: sexList[0].value
},
{
src: require("../../assets/image/weman.png"),
type: "女性",
num: 19715
num: sexList[1].value
},
{
src: require("../../assets/image/question.png"),
type: "未完善信息",
num: 1715
num: sexList[2].value
}
];
},
//用户年龄分布
getAgeData() {
let data = [1000, 25000, 15000, 8000, 7000, 500];
this.ageDivision(data);
},
educationDivision(data) {
let myChart = echarts.init(this.$refs.education);
let legendData = ["博士后","博士", "硕士", "本科", "大专", "专科以下","其他"];
let colorData = ["#FF9F7F", "#FFDB5C", "#E062AE", "#37A2DA", "#67E0E3"];
let educationList = this.crowdData.educationList;
let legendData = [];
let seriesData = [];
for (let i = 0; i < data.length; i++) {
seriesData[i] = {};
seriesData[i].value = data[i];
seriesData[i].name = legendData[i];
let colorData = ["#FF9F7F", "#FFDB5C", "#E062AE", "#37A2DA", "#67E0E3"];
for (let i = 0; i < educationList.length; i++) {
legendData[i] = educationList[i].name;
}
seriesData = educationList;
let option = operationData.getPicOption(
"用户学历分布",
legendData,
......@@ -154,42 +155,48 @@ export default {
seriesData
);
myChart.setOption(option);
window.onresize = function() {
myChart.resize();
}
},
jobDivision(data) {
let myChart = echarts.init(this.$refs.job);
let legendData = ["医生", "护士", "医护人员", "其他"];
let myChart2 = echarts.init(this.$refs.job);
let jobTitle = this.crowdData.jobTitle;
let legendData = [];
let seriesData = [];
let colorData = ["#FF9F7F", "#37A2DA", "#67E0E3", "#FFDB5C"];
let seriesData = [
{ value: 270, name: "医生" },
{ value: 70, name: "护士" },
{ value: 65, name: "医护人员" },
{ value: 50, name: "其他" }
];
for (let i = 0; i < data.length; i++) {
seriesData[i].value = data[i];
for (let i = 0; i < jobTitle.length; i++) {
legendData[i] = jobTitle[i].name;
}
seriesData = jobTitle;
let option = operationData.getPicOption(
"用户职务分布",
legendData,
colorData,
seriesData
);
myChart.setOption(option);
myChart2.setOption(option);
window.onresize = function() {
myChart2.resize();
}
},
ageDivision(data) {
let myChart = echarts.init(this.$refs.age);
let xAxisData = [
"18-30",
"30-40",
"40-50",
"50-60",
"60以上",
"未完善信息"
];
let seriesData = 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;
}
for (let i = 0; i < ageList.length; i++) {
seriesData[i] = ageList[i].value;
}
let option = operationData.getBarOption(xAxisData, seriesData);
myChart.setOption(option);
myChart3.setOption(option);
window.onresize = function() {
myChart3.resize();
}
}
}
};
......
......@@ -10,9 +10,9 @@
:options="optionsRegion"
v-model="formInline.region"
@change="handleChange"
@expand-change="expandChange"
filterable
change-on-select
:props="props"
style="width:330px"
></el-cascader>
</el-form-item>
......@@ -64,16 +64,27 @@
: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"></crowd-analysis>
</el-tab-pane>
<el-tab-pane label="课程分析" name="third">
<course-analysis ref="childCourse" :formInline="formInline" :activeName="activeName" :dialogData="dialogData"></course-analysis>
<course-analysis
ref="childCourse"
:formInline="formInline"
:activeName="activeName"
:dialogData="dialogData"
></course-analysis>
</el-tab-pane>
<el-tab-pane label="考试分析" name="fourth">
<examination-analysisfrom ref="childCourse" :formInline="formInline" :activeName="activeName" :dialogData="dialogData"></examination-analysisfrom>
<examination-analysisfrom
ref="childCourse"
:formInline="formInline"
:activeName="activeName"
:dialogData="dialogData"
></examination-analysisfrom>
</el-tab-pane>
<el-tab-pane label="学习效果分析" name="fifth" lazy>
<learning-effect></learning-effect>
......@@ -123,36 +134,59 @@ export default {
return {
curmbFirst: "学情报告",
curmbSecond: "项目列表",
organizationList: [
{
label: "全部",
value: 0
},
{
label: "西湖区第二人民医院",
value: 66
},
{
label: "杭州市中医院",
value: 233
},
{
label: "仁济医院",
value: 999
}
],
projectId: "",
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);
});
}
// setTimeout(() => {
// let nodes = [
// {
// value: 5,
// label: "西湖区"
// },
// {
// value: 6,
// label: "东湖区"
// }
// ];
// resolve(nodes);
// }, 1000);
}
},
formInline: {
region: [],
date: "",
organization: [],
checked: false,
pageNo: 1,
pageSize: 10,
pageSize: 10
},
dialogData: {
region: '',
organization: '',
region: "",
organization: ""
},
tags: [],
activeName: "first",
......@@ -171,6 +205,7 @@ export default {
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
this.getRegionOption();
},
mounted: function() {
......@@ -181,29 +216,41 @@ export default {
//console.log(tab, event);
console.log("activeName", this.activeName);
if (tab.name == "first") {
}
else if (tab.name == "second") {
} else if (tab.name == "second") {
this.$refs.childCrowd.$emit("init");
}
else if (tab.name == "third") {
} else if (tab.name == "third") {
// this.setDialogData();
}
else if (tab.name == "fourth") {
} else if (tab.name == "fourth") {
}
},
handleChange(value) {
this.formInline.organization = [];
this.tags = [];
// console.log(this.$refs["cascaderRegion"]);
setTimeout(function() {
// console.log(vm.$refs["cascaderRegion"].inputValue);
vm.dialogData.region = vm.$refs["cascaderRegion"].inputValue;
console.log('vm.dialogData.region',vm.dialogData.region)
// console.log('vm.dialogData.region',vm.dialogData.region)
}, 20);
// console.log('region',value,vm.formInline);
if (value.length >= 3) {
this.getOrganizationList();
}
},
expandChange(value) {
// console.log('expand',value)
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;
}
option.push(obj);
}
return option;
},
changeOrganization(value) {
// console.log('formInline',this.formInline.organization);
......@@ -254,8 +301,65 @@ export default {
}
}
},
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() {
this.optionsRegion = operationData.getRegionOption();
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 = [
// {
// label: "全部",
// value: 0
// },
// {
// label: "西湖区第二人民医院",
// value: 66
// },
// {
// label: "杭州市中医院",
// value: 233
// },
// {
// label: "仁济医院",
// value: 999
// }
];
let countyId = vm.formInline.region[vm.formInline.region.length - 1];
let req = {
projectId: vm.projectId,
countyId: countyId
};
openLoading(vm);
vm.GET("report/portal/getOrganizationList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.organizationList = operationData.getLearnOrganization(res.data);
}
});
},
getOrganizationNum() {
//选择全部
......@@ -312,12 +416,15 @@ export default {
release() {},
setDialogData() {
//传递给dialog数据
this.dialogData.organization = '';
for(let x=0;x<this.tags.length;x++) {
this.dialogData.organization += this.tags[x].label+'、';
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);
this.dialogData.organization = this.dialogData.organization.substring(
0,
len - 1
);
},
changeDate() {
this.setDialogData();
......
......@@ -14,23 +14,23 @@
</div>
<div class="charts" id="rankChart" ref="rankChart"></div>
<!-- <div class="charts" id="age" ref="age"></div> -->
<el-table v-show="organizationNum < 2" :data="finishDetail" class="project-table" style="width: 100%" border>
<el-table
v-show="organizationNum < 2"
:data="finishDetail"
class="project-table"
style="width: 100%"
border
>
<el-table-column prop="name" label="姓名" align="center"></el-table-column>
<el-table-column prop="desk" label="科室" align="center"></el-table-column>
<el-table-column prop="join" label="是否参与项目" align="center">
<template slot-scope="scope">
{{ scope.row.join | partJoin }}
</template>
<template slot-scope="scope">{{ scope.row.join | partJoin }}</template>
</el-table-column>
<el-table-column prop="finish" label="是否完成项目" align="center">
<template slot-scope="scope">
{{ scope.row.finish | partFinish }}
</template>
<template slot-scope="scope">{{ scope.row.finish | partFinish }}</template>
</el-table-column>
<el-table-column prop="endTime" label="完成项目日期" align="center">
<template slot-scope="scope">
{{ scope.row.endTime | liveDateFilter }}
</template>
<template slot-scope="scope">{{ scope.row.endTime | liveDateFilter }}</template>
</el-table-column>
</el-table>
</div>
......@@ -53,45 +53,97 @@ export default {
organizationNum: {
type: Number
},
organizationList: {
type: Array
},
},
data() {
return {
// 只有一个机构时显示人员完成情况
projectId: "",
finishDetail: [],
cardData: [],
cardData: [
{
title: "应参与机构数",
num: 0,
unit: ""
},
{
title: "应参与人数",
num: 0,
unit: ""
},
{
title: "已参与人数",
num: 0,
unit: ""
},
{
title: "项目获证人数",
num: 0,
unit: ""
},
{
title: "优秀证书人数",
num: 0,
unit: ""
},
{
title: "合格证书人数",
num: 0,
unit: ""
}
],
showChart: true,
showTable: false,
showTable: false
};
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
this.$nextTick(function() {
this.getCardData();
this.getRank();
this.getTableData();
// this.search();
});
},
mounted: function() {
commonUtil.resizeHeight();
this.$on('search',()=>{
console.log(this.formInline,this.organizationNum);
if(this.organizationNum > 1) {
this.getCardData();
} else {
this.getTableData();
}
this.$on("search", () => {
// console.log(this.formInline, this.organizationNum);
this.search();
});
if (this.activeName == "first") {
this.updateResize();
}
},
methods: {
search() {
if(vm.formInline.region.length == 0) {
vm.$message('请选择地区');
return;
}
let req = {
projectId: vm.projectId,
ids: operationData.getIds(vm.formInline),
type: operationData.getSearchType(vm.formInline),
OriginalFlag: vm.formInline.checked == false? 0 : 1,
};
console.log('1 req',req);
openLoading(vm);
vm.GET("report/portal/getParticipateInfo", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.getCardData(res.data);
this.getRank(res.data);
this.getTableData();
}
});
},
updateResize() {
this.$nextTick(function() {
let chartRank = echarts.init(document.getElementById("rankChart"))
let chartRank = echarts.init(document.getElementById("rankChart"));
window.onresize = function() {
chartRank.resize();
}
};
});
},
getTableData() {
......@@ -101,49 +153,31 @@ export default {
desk: "神经内科",
join: 1,
finish: 1,
endTime: 1561707567000,
endTime: 1561707567000
}
];
},
getRank() {
getRank(data) {
let myChart = echarts.init(this.$refs.rankChart);
let optionValue = operationData.getRank();
let xAxisData = [];
let seriesData = [];
for (let i = 0; i < data.top.length; i++) {
xAxisData[i] = data.top[i].name;
seriesData[i] = data.top[i].value;
}
let optionValue = operationData.getRank(xAxisData, seriesData);
myChart.setOption(optionValue);
},
getCardData() {
this.cardData = [
{
title: "应参与机构数",
num: 10290,
unit: ""
},
{
title: "应参与人数",
num: 59287,
unit: ""
},
{
title: "已参与人数",
num: 47262,
unit: ""
},
{
title: "项目获证人数",
num: 47262,
unit: ""
},
{
title: "优秀证书人数",
num: 47262,
unit: ""
},
{
title: "合格证书人数",
num: 47262,
unit: ""
},
];
},
getCardData(data) {
//this.cardData = [];
vm.cardData[0].num = data.participateHospitalCount;
vm.cardData[1].num = data.participatePeopleCount;
vm.cardData[2].num = data.hasParticipatePeopleCount;
vm.cardData[3].num = data.acquireCertificatePeopleCount;
vm.cardData[4].num = data.excellentCertificateCount.value;
vm.cardData[5].num = data.qualifiedCertificateCount.value;
}
}
};
</script>
......@@ -154,10 +188,10 @@ export default {
border-width: 0px;
}
.el-card.is-always-shadow {
box-shadow: 0 0 0 0 rgba(0,0,0,.1)
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
}
.line {
background: #E4E4E4;
background: #e4e4e4;
height: 80px;
width: 1px;
float: left;
......@@ -174,8 +208,8 @@ export default {
text-align: center;
}
.box-content {
text-align: center;
height: 40px;
text-align: center;
height: 40px;
}
}
.charts {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册