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

接口联调

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