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

Merge branch 'dev-learning-1120' into 'test-learning-1205'

Dev learning 1120



See merge request !120
...@@ -207,11 +207,11 @@ const vueFilter = { ...@@ -207,11 +207,11 @@ const vueFilter = {
}, },
exportStatus: (value) => { exportStatus: (value) => {
if(value == 0) { if(value == 0) {
return '数据生成中,请稍后---'; return '生成中';
}else if(value == 1) { }else if(value == 1) {
return '数据生成完成'; return '成功';
} else { } else {
return '文件生成失败 请重新操作导出'; return '失败';
} }
}, },
getAvgTime: (value) => { getAvgTime: (value) => {
...@@ -232,6 +232,28 @@ const vueFilter = { ...@@ -232,6 +232,28 @@ const vueFilter = {
} }
return avgTime; return avgTime;
}, },
learnTimeValue: (value) => {
let s = parseInt(value),m = 0, h = 0;//秒,分,小时
if(s==NaN){//错误error
return '';
}
if(s > 60) {
m = parseInt(s/60);
s = parseInt(s%60);
if(m > 60) {
h = parseInt(m/60);
m = parseInt(m%60);
}
}
let result = ""+parseInt(s)+"秒";
if(m > 0) {
result = ""+parseInt(m)+"分"+result;
}
if(h > 0) {
result = ""+parseInt(h)+"小时"+result;
}
return result;
},
getTotalTime: (value) => { getTotalTime: (value) => {
let time = value +'分钟'; let time = value +'分钟';
return time; return time;
...@@ -280,6 +302,54 @@ const vueFilter = { ...@@ -280,6 +302,54 @@ const vueFilter = {
} else if(value == 4) { } else if(value == 4) {
return '已下架'; return '已下架';
} }
} },
examRate: (value) => {
let num = (value*100).toFixed(2);
let rate = num + '%';
return rate;
},
sexValue: (value) => {
if(value == 1) {
return '男';
} else if(value == 2) {
return '女';
} else if(value == 0) {
return '未知';
}
},
joinFlagValue: (value) => {
if(value == 1) {
return '已参与';
} else if(value == 2) {
return '未参与';
}
},
finishFlagValue: (value) => {
if(value == 1) {
return '已完成';
} else if(value == 2) {
return '未完成';
}
},
certGradeValue: (value) => {
if(value == 1) {
return '优秀';
} else if(value == 2) {
return '良好';
} else if(value == 3) {
return '及格';
} else if(value == 4) {
return '不及格';
}
},
finishFlagType: (value) => {
if(value == 0) {
return '未参与';
} else if(value == 1) {
return '未完成';
} else if(value == 2) {
return '已完成';
}
},
} }
export default vueFilter export default vueFilter
\ No newline at end of file
此差异已折叠。
...@@ -305,6 +305,20 @@ export function setRegionOption2(data) { ...@@ -305,6 +305,20 @@ export function setRegionOption2(data) {
} }
return option; return option;
} }
export function setRegionOptionNew(data) {
let option = [];
for (let i = 0; i < data.length; i++) {
let obj = data[i];
obj.label = data[i].label;
obj.value = data[i].id;
if(obj.degree == 4 || obj.degree == 0 || obj.label == "全部") {
// if(obj.degree == 4 ) {
obj.leaf = true;
}
option.push(obj);
}
return option;
}
export function setAdministrativeId(value) { export function setAdministrativeId(value) {
let areaId = '000'; let areaId = '000';
for (let i = 0; i < value.length; i++) { for (let i = 0; i < value.length; i++) {
...@@ -335,16 +349,17 @@ export function getLearnOrganization(data) { ...@@ -335,16 +349,17 @@ export function getLearnOrganization(data) {
let arr = []; let arr = [];
return arr; return arr;
} }
let organization = [ // let organization = [
{ // {
label: "全部", // label: "全部",
value: 0 // value: 0
}, // },
]; // ];
let organization = [];
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let obj = { let obj = {
label: data[i].hospital_name, label: data[i].hospitalName,
value: data[i].hospital_id, value: data[i].hospitalId,
index: i, index: i,
}; };
organization.push(obj); organization.push(obj);
...@@ -355,8 +370,9 @@ export function getPicOption(title, legendData, colorData, seriesData) { ...@@ -355,8 +370,9 @@ export function getPicOption(title, legendData, colorData, seriesData) {
let option = { let option = {
title: { title: {
text: title, text: title,
x: "center", x: "left",
top: "3%", left: '20px',
top: "20px",
}, },
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
...@@ -364,8 +380,8 @@ export function getPicOption(title, legendData, colorData, seriesData) { ...@@ -364,8 +380,8 @@ export function getPicOption(title, legendData, colorData, seriesData) {
}, },
legend: { legend: {
orient: "vertical", orient: "vertical",
top: "3%", top: "center",
left: "left", right: "right",
data: legendData data: legendData
}, },
grid: { grid: {
...@@ -375,13 +391,13 @@ export function getPicOption(title, legendData, colorData, seriesData) { ...@@ -375,13 +391,13 @@ export function getPicOption(title, legendData, colorData, seriesData) {
containLabel: true containLabel: true
}, },
color: colorData, color: colorData,
backgroundColor: '#F3F3F3', backgroundColor: '#FFFFFF',
series: [ series: [
{ {
name: "", name: "",
type: "pie", type: "pie",
radius: "55%", radius: "55%",
center: ["60%", "65%"], center: ["40%", "55%"],
data: seriesData, data: seriesData,
} }
] ]
...@@ -391,12 +407,17 @@ export function getPicOption(title, legendData, colorData, seriesData) { ...@@ -391,12 +407,17 @@ export function getPicOption(title, legendData, colorData, seriesData) {
export function getBarOption(xAxisData, seriesData) { export function getBarOption(xAxisData, seriesData) {
let option = { let option = {
title: { title: {
text: "用户年龄发布", text: "人员年龄分布",
x: "center", x: "left",
top: "3%", left: '20px',
top: "20px",
},
color: ['#5B8FF9'],
backgroundColor: '#FFFFFF',
tooltip: {
trigger: 'item',
formatter: "{b} : {c} "
}, },
color: ['#3398DB'],
backgroundColor: '#F3F3F3',
grid: { grid: {
left: '3%', left: '3%',
right: '4%', right: '4%',
...@@ -409,22 +430,31 @@ export function getBarOption(xAxisData, seriesData) { ...@@ -409,22 +430,31 @@ export function getBarOption(xAxisData, seriesData) {
data: xAxisData, data: xAxisData,
axisLabel: { axisLabel: {
interval: 0 interval: 0
} },
// axisTick: { axisTick: { // 隐藏刻度
// alignWithLabel: true show: false
// } },
axisLine: { //隐藏轴线
show: false
},
} }
], ],
yAxis: [ yAxis: [
{ {
type: 'value' type: 'value',
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
} }
], ],
series: [ series: [
{ {
name: '', name: '',
type: 'bar', type: 'bar',
barWidth: 30, barWidth: 18,
data: seriesData, data: seriesData,
} }
] ]
...@@ -592,13 +622,23 @@ export function initRank(data) { ...@@ -592,13 +622,23 @@ export function initRank(data) {
} }
return list; return list;
} }
export function getAvgTime(data) { export function getAvgTime(value) {
let list = [0, 0]; let list = [0,0];
if (data != null && data != '') { let avgTime = '';
list[0] = Math.floor(data / 60); if(value != null && value !='') {
list[1] = data % 60; list[0] = Math.floor(value / 60);
list[1] = value % 60;
} }
return list; if(list[0] == 0 && list[1] == 0) {
avgTime = list[1] + '秒';
} else if(list[0] == 0 && list[1] != 0) {
avgTime = list[1] + '秒';
} else if(list[0] != 0 && list[1] == 0) {
avgTime = list[0] + '分钟';
} else if(list[0] != 0 && list[1] != 0) {
avgTime = list[0] + '分钟' + list[1] + '秒';
}
return avgTime;
} }
export function getComponent(data) { export function getComponent(data) {
let list = []; let list = [];
...@@ -641,4 +681,35 @@ export function setSelectedKeys(checkedKeys, halfCheckedKeys) { ...@@ -641,4 +681,35 @@ export function setSelectedKeys(checkedKeys, halfCheckedKeys) {
selected.push(obj); selected.push(obj);
} }
return selected; return selected;
}
export function setDuringTime(time , type) {
let value = time;
if(time == '' || time == null) {
return '';
}
if(type == 'begin') {
value = time[0];
} else if(type == 'end') {
value = time[1];
}
return value;
}
export function setHospitalIdList(data) {
let listStr = '';
if(data == null || data.length == 0) {
return listStr
}
for(let i = 0 ; i<data.length ; i++) {
listStr += data[i]+'_';
}
listStr = listStr.substring(0, listStr.length - 1);
return listStr;
}
export function getHospitalIdList(data) {
let listArr = [];
if(data == null || data == '') {
return listArr
}
listArr = data.split("_")
return listArr;
} }
\ No newline at end of file
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="formData.pageNo" :current-page="formData.pageNo"
:page-sizes="[20, 50 ,100]" :page-sizes="[20, 50 ,100, 200]"
:page-size="formData.pageSize" :page-size="formData.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="totalRows" :total="totalRows"
...@@ -239,6 +239,7 @@ export default { ...@@ -239,6 +239,7 @@ export default {
handleSizeChange(val) { handleSizeChange(val) {
console.log(`每页 ${val} 条`); console.log(`每页 ${val} 条`);
vm.formData.pageSize = val; vm.formData.pageSize = val;
vm.formData.pageNo = 1;
vm.search(); vm.search();
}, },
// 换页 // 换页
...@@ -261,15 +262,18 @@ export default { ...@@ -261,15 +262,18 @@ export default {
let checkAll = operationData.hasAll(vm.formInline.organization); let checkAll = operationData.hasAll(vm.formInline.organization);
let req = { let req = {
projectId: vm.projectId, projectId: vm.projectId,
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 0 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag,
achievementStatus: vm.formData.achievementStatus, achievementStatus: vm.formData.achievementStatus,
status: vm.formData.status, status: vm.formData.status,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
doctorName: vm.formData.doctorName, doctorName: vm.formData.doctorName,
pageNo: vm.formData.pageNo, pageNo: vm.formData.pageNo,
pageSize: vm.formData.pageSize, pageSize: vm.formData.pageSize,
}; };
vm.reportGET("report/portal/getProjectData", req).then(res => { vm.POST("stats/report/getProjectData", req).then(res => {
// closeLoading(vm); // closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
vm.tableData = res.data.projectData; vm.tableData = res.data.projectData;
...@@ -339,7 +343,7 @@ export default { ...@@ -339,7 +343,7 @@ export default {
joinDoctorIdList: operationData.getAjustmentList(vm.changedDoctor), joinDoctorIdList: operationData.getAjustmentList(vm.changedDoctor),
}; };
openLoading(vm); openLoading(vm);
vm.reportPOST("report/portal/peopleAdjustment", req).then(res => { vm.POST("stats/report/peopleAdjustment", req).then(res => {
closeLoading(vm); closeLoading(vm);
vm.$message(res.message); vm.$message(res.message);
if (res.code == "000000") { if (res.code == "000000") {
......
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
<div class="export-download"> <div class="export-download">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb> <bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet"> <div class="component-content screenSet" id="screenSet">
<p>导出文件列表</p> <div class="p-title">任务列表</div>
<el-table :data="tableData" style="width: 100%"> <el-tabs v-model="listType" type="card" @tab-click="handleClick">
<el-tab-pane label="查看报告" name="2"></el-tab-pane>
<el-tab-pane label="导出列表" name="1"></el-tab-pane>
</el-tabs>
<el-table :data="tableData" class="table-export" style="width: 100%">
<el-table-column <el-table-column
prop="title" prop="title"
label="名称" label="名称"
...@@ -11,20 +15,25 @@ ...@@ -11,20 +15,25 @@
min-width="150" min-width="150"
show-overflow-tooltip show-overflow-tooltip
></el-table-column> ></el-table-column>
<el-table-column prop="createdTime" label="时间" align="center" min-width="120"> <el-table-column prop="time" label="时间" align="center" min-width="120">
<template slot-scope="scope">{{ scope.row.createdTime }}</template> <template slot-scope="scope">{{ scope.row.time }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="状态" align="center" min-width="150"> <el-table-column prop="status" label="状态" align="left" min-width="30">
<template slot-scope="scope">{{ scope.row.status | exportStatus }}</template> <template slot-scope="scope">
<span class="logo" v-bind:class="{ 'logo_0': scope.row.status == 0, 'logo_1': scope.row.status == 1, 'logo_2': scope.row.status == 2 }"></span>
<span class="text">{{ scope.row.status | exportStatus }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="70"> <el-table-column label="操作" fixed="right" align="center" min-width="70">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary"
:disabled="scope.row.buttonStatus" :disabled="scope.row.buttonStatus"
size="small" size="small"
type="text"
v-if="scope.row.status != 2"
@click="update(scope.row)" @click="update(scope.row)"
>{{ scope.row.buttonText }}</el-button> >{{ scope.row.buttonText }}</el-button>
<div v-if="scope.row.status == 2">-</div>
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty"> <div slot="empty">
...@@ -40,7 +49,7 @@ ...@@ -40,7 +49,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="param.pageNo" :current-page="param.pageNo"
:page-sizes="[20, 50 ,100]" :page-sizes="[20, 50 ,100 ,200]"
:page-size="param.pageSize" :page-size="param.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="totalRows" :total="totalRows"
...@@ -62,7 +71,7 @@ export default { ...@@ -62,7 +71,7 @@ export default {
data() { data() {
return { return {
curmbFirst: "学情报告", curmbFirst: "学情报告",
curmbSecond: "导出下载", curmbSecond: "任务列表",
projectId: "", projectId: "",
tableData: [], tableData: [],
param: { param: {
...@@ -71,7 +80,8 @@ export default { ...@@ -71,7 +80,8 @@ export default {
}, },
totalRows: 0, totalRows: 0,
totalTime: 3, totalTime: 3,
queryData: {} queryData: {},
listType: "2"
// buttonText: "刷新", // buttonText: "刷新",
// buttonStatus: false, // buttonStatus: false,
}; };
...@@ -79,75 +89,94 @@ export default { ...@@ -79,75 +89,94 @@ export default {
created() { created() {
vm = this; vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "projectId"); this.projectId = vm.getUrlSearch(window.location.href, "projectId");
let listType = vm.getUrlSearch(window.location.href, "listType");
if(listType == null) {
vm.listType = '2';
} else {
vm.listType = listType;
}
this.search(); this.search();
}, },
mounted: function() { mounted: function() {
commonUtil.resizeHeight(); commonUtil.resizeHeight();
}, },
methods: { methods: {
handleClick(tab, event) {
vm.listType = tab.name;
vm.search()
},
setButton() { setButton() {
for (let i = 0; i < vm.tableData.length; i++) { for (let i = 0; i < vm.tableData.length; i++) {
vm.tableData[i].index = i; vm.tableData[i].index = i;
if (vm.tableData[i].status == 1) { if (vm.tableData[i].status == 1) {
vm.tableData[i].buttonText = "下载"; if(vm.listType == '2') {
vm.tableData[i].buttonText = "查看报告";
} else if(vm.listType == '1') {
vm.tableData[i].buttonText = "下载";
}
vm.tableData[i].buttonStatus = false; vm.tableData[i].buttonStatus = false;
} else if(vm.tableData[i].status == 0) { } else if (vm.tableData[i].status == 0) {
vm.tableData[i].buttonText = "刷新"; vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = false; vm.tableData[i].buttonStatus = false;
} else if(vm.tableData[i].status == 2) { } else if (vm.tableData[i].status == 2) {
vm.tableData[i].buttonText = "刷新"; vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = true; vm.tableData[i].buttonStatus = true;
} }
} }
}, },
search() { search() {
// this.setButton(); let projectId = "";
let req = { if (vm.projectId != null) {
projectId: vm.projectId projectId = vm.projectId;
};
if(req.projectId == null) {
req.projectId = '';
} }
vm.reportGET("report/downLoad/getDownloadList", req).then(res => { let reqList = {
projectId: projectId,
pageNo: vm.param.pageNo,
pageSize: vm.param.pageSize,
type: parseInt(vm.listType),
id: ""
};
vm.GET("stats/mission/missionlist", reqList).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
vm.tableData = res.data.data; vm.tableData = res.data.list;
vm.totalRows = res.data.totalRows; vm.totalRows = res.data.totalSize;
vm.setButton(); vm.setButton();
} }
}); });
}, },
downLoad(row) {
// vm.queryData = this.$route.query;
// let req = vm.queryData;
// openLoading(vm);
// vm.reportGET("report/downLoad/downLoad", req).then(res => {
// closeLoading(vm);
// // console
// if (res.code == "000000") {
// }
// });
setTimeout(() => {
window.open(row.fileUrl);
}, 500);
},
getDownLoadStatus(row) { getDownLoadStatus(row) {
let req = { // let req = {
// id: row.id
// };
let projectId = "";
if (vm.projectId != null) {
projectId = vm.projectId;
}
let reqList = {
projectId: projectId,
pageNo: vm.param.pageNo,
pageSize: vm.param.pageSize,
type: parseInt(vm.listType),
id: row.id id: row.id
}; };
vm.reportGET("report/downLoad/getDownLoadStatus", req).then(res => { vm.GET("stats/mission/missionlist", reqList).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
vm.tableData[row.index].status = res.data.data; vm.tableData[row.index].status = res.data.list[0].status;
let updateStatus = res.data.list[0].status;
// console.log('res.data.data',res.data.data); // console.log('res.data.data',res.data.data);
if (res.data.data == 1) { if (updateStatus == 1) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " "; vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "下载"; // vm.tableData[row.index].buttonText = "下载";
vm.tableData[row.index].fileUrl = res.data.url; if(vm.listType == '2') {
} else if(res.data.data == 0) { vm.tableData[row.index].buttonText = "查看报告";
console.log("res", res, vm.tableData[row.index]); } else if(vm.listType == '1') {
vm.tableData[row.index].buttonText = "下载";
}
vm.tableData[row.index].fileUrl = res.data.list[0].url;
} else if (updateStatus == 0) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " "; vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新"; vm.tableData[row.index].buttonText = "刷新";
} else if(res.data.data == 2) { } else if (updateStatus == 2) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " "; vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新"; vm.tableData[row.index].buttonText = "刷新";
vm.tableData[row.index].buttonStatus = true; vm.tableData[row.index].buttonStatus = true;
...@@ -159,9 +188,22 @@ export default { ...@@ -159,9 +188,22 @@ export default {
} }
}); });
}, },
downLoad(row) {
setTimeout(() => {
window.open(row.fileUrl);
}, 500);
},
exportTime(row) {
vm.$router.push("item-list?downloadId="+row.id);
},
update(row) { update(row) {
if (vm.tableData[row.index].status == 1) { if (vm.tableData[row.index].status == 1) {
vm.downLoad(row); // vm.downLoad(row);
if(vm.listType == '2') {
vm.exportTime(row);
} else if(vm.listType == '1') {
vm.downLoad(row);
}
} else { } else {
this.$nextTick(function() { this.$nextTick(function() {
console.log(vm.tableData[row.index]); console.log(vm.tableData[row.index]);
...@@ -189,11 +231,12 @@ export default { ...@@ -189,11 +231,12 @@ export default {
// 更改数据显示数量 // 更改数据显示数量
handleSizeChange(val) { handleSizeChange(val) {
vm.param.pageSize = val; vm.param.pageSize = val;
vm.param.pageNo = 1;
vm.search(); vm.search();
}, },
// 换页 // 换页
handleCurrentChange(val) { handleCurrentChange(val) {
vm.param.pageNo = value; vm.param.pageNo = val;
vm.search(); vm.search();
} }
} }
...@@ -204,6 +247,46 @@ export default { ...@@ -204,6 +247,46 @@ export default {
.component-content { .component-content {
background: #fff; background: #fff;
padding: 10px; padding: 10px;
.p-title {
position: relative;
margin-top: 30px;
margin-left: 30px;
margin-bottom: 30px;
height: 25px;
font-size: 18px;
font-weight: 600;
line-height: 25px;
color: #000000;
}
.table-export {
.logo {
margin-top: 8px;
margin-right: 6px;
float: left;
width: 6px;
height: 6px;
border-radius: 50%;
}
.logo_0 {
background: #1890ff;
}
.logo_1 {
background: #52C41A;
}
.logo_2 {
background: #F5222D;
}
.text {
float: left;
}
.el-button--text {
color: #449284;
}
.el-button.is-disabled {
background: #fff !important;
border: 0px solid #fff !important;
}
}
} }
} }
</style> </style>
\ No newline at end of file
此差异已折叠。
此差异已折叠。
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="formData.pageNo" :current-page="formData.pageNo"
:page-sizes="[20, 50 ,100]" :page-sizes="[20, 50 ,100, 200]"
:page-size="formData.pageSize" :page-size="formData.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="totalRows" :total="totalRows"
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册