Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
提交
议题看板
打开侧边栏
jingqi.liu
pica.cloud.web-education-admin
提交
e7f148cc
提交
e7f148cc
编写于
11月 25, 2019
作者:
zhentian.jia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
m学习效果api对接
上级
cbea0693
变更
5
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
634 行增加
和
594 行删除
+634
-594
chartData.js
src/utils/learning/chartData.js
+475
-0
operation.js
src/utils/operation.js
+9
-8
item-data-all.vue
src/views/learning/item-data-all.vue
+71
-509
item-learning-effect.vue
src/views/learning/item-learning-effect.vue
+44
-59
item-list.vue
src/views/learning/item-list.vue
+35
-18
未找到文件。
src/utils/learning/chartData.js
0 → 100644
浏览文件 @
e7f148cc
此差异已折叠。
点击以展开。
src/utils/operation.js
浏览文件 @
e7f148cc
...
...
@@ -348,16 +348,17 @@ export function getLearnOrganization(data) {
let
arr
=
[];
return
arr
;
}
let
organization
=
[
{
label
:
"全部"
,
value
:
0
},
];
// let organization = [
// {
// label: "全部",
// value: 0
// },
// ];
let
organization
=
[];
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
let
obj
=
{
label
:
data
[
i
].
hospital
_n
ame
,
value
:
data
[
i
].
hospital
_i
d
,
label
:
data
[
i
].
hospital
N
ame
,
value
:
data
[
i
].
hospital
I
d
,
index
:
i
,
};
organization
.
push
(
obj
);
...
...
src/views/learning/item-data-all.vue
浏览文件 @
e7f148cc
此差异已折叠。
点击以展开。
src/views/learning/item-learning-effect.vue
浏览文件 @
e7f148cc
<
template
>
<div
class=
"learning-effect"
>
<!--
<el-button
type=
"default"
size=
"small"
@
click=
"exportPDF"
>
导出明细
</el-button>
-->
<div
class=
"
education
"
ref=
"education"
></div>
<div
class=
"
learning
"
ref=
"learning"
></div>
<div
class=
"
chart
"
ref=
"education"
></div>
<div
class=
"
chart
"
ref=
"learning"
></div>
</div>
</
template
>
<
script
>
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
*
as
commonUtil
from
"../../utils/utils"
;
import
*
as
operationData
from
"../../utils/operation"
;
import
*
as
chartData
from
"../../utils/learning/chartData"
;
import
echarts
from
"echarts"
;
import
html2Canvas
from
'html2canvas'
import
JsPDF
from
'jspdf'
let
vm
=
null
;
export
default
{
props
:
{
formInline
:
{
type
:
Object
},
activeName
:
{
type
:
String
},
},
data
()
{
return
{
echartsData
:
{
...
...
@@ -24,58 +32,14 @@ export default {
},
created
()
{
vm
=
this
;
vm
.
setData
();
},
mounted
()
{
commonUtil
.
resizeHeight
();
this
.
$on
(
"search"
,
()
=>
{
this
.
search
();
});
},
methods
:
{
exportPDF
()
{
let
element
=
''
;
element
=
document
.
querySelector
(
'.data-all-wrap'
);
console
.
log
(
element
);
if
(
element
==
null
)
{
return
}
setTimeout
(()
=>
{
html2Canvas
(
element
).
then
(
function
(
canvas
)
{
let
contentWidth
=
canvas
.
width
;
let
contentHeight
=
canvas
.
height
;
//一页pdf显示html页面生成的canvas高度;
let
pageHeight
=
contentWidth
/
592.28
*
841.89
;
//未生成pdf的html页面高度
let
leftHeight
=
contentHeight
;
//页面偏移
let
position
=
0
;
//a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
let
imgWidth
=
595.28
;
let
imgHeight
=
592.28
/
contentWidth
*
contentHeight
;
let
pageData
=
canvas
.
toDataURL
(
'image/jpeg'
,
1.0
);
let
pdf
=
new
JsPDF
(
''
,
'pt'
,
'a4'
);
//有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
//当内容未超过pdf一页显示的范围,无需分页
if
(
leftHeight
<
pageHeight
)
{
pdf
.
addImage
(
pageData
,
'JPEG'
,
0
,
0
,
imgWidth
,
imgHeight
);
}
else
{
while
(
leftHeight
>
0
)
{
pdf
.
addImage
(
pageData
,
'JPEG'
,
0
,
position
,
imgWidth
,
imgHeight
)
leftHeight
-=
pageHeight
;
position
-=
841.89
;
//避免添加空白页
if
(
leftHeight
>
0
)
{
pdf
.
addPage
();
}
}
}
let
title
=
"导出学情报告"
;
pdf
.
save
(
title
+
'.pdf'
);
});
},
0
);
},
updateResize
()
{
this
.
$nextTick
(
function
()
{
window
.
onresize
=
function
()
{
...
...
@@ -84,7 +48,26 @@ export default {
};
});
},
setData
()
{
search
()
{
let
req
=
{
projectId
:
vm
.
projectId
,
beginDate
:
operationData
.
setDuringTime
(
vm
.
formInline
.
during
,
'begin'
),
endDate
:
operationData
.
setDuringTime
(
vm
.
formInline
.
during
,
'end'
),
hospitalIdList
:
vm
.
formInline
.
organization
,
originalFlag
:
vm
.
formInline
.
checked
==
false
?
0
:
1
,
regionId
:
vm
.
formInline
.
region
[
vm
.
formInline
.
region
.
length
-
1
],
timeFlag
:
vm
.
formInline
.
timeFlag
,
};
openLoading
(
vm
);
if
(
req
.
regionId
==
"000"
)
{
req
.
regionId
=
"310"
;
}
// console.log("0 req", req);
vm
.
POST
(
"stats/report/studyEffect"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
"000000"
)
{
}
});
setTimeout
(
function
()
{
vm
.
setEducation
();
vm
.
setLearning
();
...
...
@@ -206,13 +189,15 @@ export default {
<
style
lang=
'scss'
rel=
'stylesheet/scss'
>
.learning-effect
{
width
:
100%
;
.learning
,
.education
{
margin-top
:
40px
;
min-width
:
400px
;
height
:
400px
;
background
:
#fff
;
background
:
#fff
;
overflow
:
hidden
;
padding
:
10px
;
.chart
{
position
:
relative
;
margin
:
20px
auto
0
auto
;
// width: 100%;
width
:
860px
;
height
:
350px
;
}
}
</
style
>
src/views/learning/item-list.vue
浏览文件 @
e7f148cc
...
...
@@ -27,7 +27,7 @@
@
change=
"changeOrganization"
multiple
collapse-tags
:disabled=
"
formInline.region.length
<
3
"
:disabled=
"
areaLen
<
3
"
style=
"width:330px"
>
<el-option
...
...
@@ -53,7 +53,7 @@
size=
"small"
v-model=
"formInline.timeFlag"
placeholder=
"请选择"
style=
"width:330px"
style=
"width:330px
;
"
>
<el-option
v-for=
"item in timeFlagList"
...
...
@@ -136,7 +136,11 @@
></examination-analysisfrom>
</el-tab-pane>
<el-tab-pane
label=
"学习效果分析"
name=
"fifth"
>
<learning-effect
ref=
"childEffect"
></learning-effect>
<learning-effect
ref=
"childEffect"
:formInline=
"formInline"
:activeName=
"activeName"
></learning-effect>
</el-tab-pane>
</el-tabs>
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogVisible"
width=
"30%"
center
>
...
...
@@ -255,7 +259,8 @@ export default {
value
:
2
,
label
:
'开始时间结束时间'
,
}
]
],
areaLen
:
1
,
};
},
computed
:
{
...
...
@@ -293,10 +298,21 @@ export default {
vm
.
displayExam
=
res
.
data
.
existExam
;
vm
.
flag
=
res
.
data
.
flag
;
}
// if(type !=2) {
// vm.getRegionOption();
// }
});
let
reqInfo
=
{
projectId
:
vm
.
projectId
,
};
// openLoading(vm);
// vm.GET("stats/region/info", reqInfo).then(res => {
// closeLoading(vm);
// if (res.code == "000000") {
// // vm.showOriginal = res.data.status;
// // vm.roleType = res.data.roleType;
// // vm.displayExam = res.data.existExam;
// // vm.flag = res.data.flag;
// }
// });
},
beforeLeave
(
activeName
,
oldActiveName
)
{
// console.log('action',activeName,'oldActive',oldActiveName)
...
...
@@ -323,7 +339,10 @@ export default {
// console.log('vm.dialogData.region',vm.dialogData.region)
},
20
);
// console.log('region',value,vm.formInline);
if
(
value
.
length
>=
3
)
{
let
areaArr
=
value
[
value
.
length
-
1
].
split
(
'_'
);
vm
.
areaLen
=
areaArr
.
length
;
console
.
log
(
'areaArr!!'
,
areaArr
);
if
(
areaArr
.
length
>=
3
)
{
this
.
getOrganizationList
();
this
.
organizationNotice
=
"请选择机构"
;
}
else
{
...
...
@@ -421,24 +440,20 @@ export default {
}
});
},
//获取机构列表
getOrganizationList
()
{
this
.
organizationList
=
[];
let
countyId
=
vm
.
formInline
.
region
[
vm
.
formInline
.
region
.
length
-
1
];
let
type
=
3
;
if
(
vm
.
formInline
.
region
.
length
==
4
)
{
type
=
5
;
}
vm
.
organizationList
=
[];
let
regionId
=
vm
.
formInline
.
region
[
vm
.
formInline
.
region
.
length
-
1
];
let
req
=
{
projectId
:
vm
.
projectId
,
type
:
type
,
id
:
countyId
regionId
:
regionId
};
openLoading
(
vm
);
vm
.
reportGET
(
"report/portal/getOrganizationList
"
,
req
).
then
(
res
=>
{
vm
.
GET
(
"stats/region/hospital
"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
"000000"
)
{
this
.
organizationList
=
operationData
.
getLearnOrganization
(
res
.
data
.
hospitalL
ist
res
.
data
.
l
ist
);
}
});
...
...
@@ -467,6 +482,7 @@ export default {
this
.
$refs
.
childDataAll
.
$emit
(
"search"
);
this
.
$refs
.
childCrowd
.
$emit
(
"search"
);
this
.
$refs
.
childCourse
.
$emit
(
"search"
);
this
.
$refs
.
childEffect
.
$emit
(
"search"
);
// if (this.activeName == "first") {
// this.organizationNum = this.getOrganizationNum();
...
...
@@ -689,6 +705,7 @@ export default {
}
.tag-group
{
margin-left
:
78px
;
margin-bottom
:
20px
;
.el-tag
{
margin-right
:
20px
;
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录