Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
9
912project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
CRS
912project
Commits
e2181ec5
提交
e2181ec5
authored
4月 13, 2020
作者:
CRS
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'crs' 到 'master'
new 查看合并请求
!117
上级
93209bb4
a8dba0ed
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
156 行增加
和
16 行删除
+156
-16
otherPdf.vue
src/components/otherPdf/otherPdf.vue
+153
-16
htmlToPdf.js
src/tools/htmlToPdf.js
+3
-0
没有找到文件。
src/components/otherPdf/otherPdf.vue
浏览文件 @
e2181ec5
...
...
@@ -202,9 +202,8 @@
<p
class=
"title1"
>
3.
原应用系统评估
</p>
<p
class=
"title2"
>
3.1.
原应用系统概要
</p>
<p
class=
"title3"
>
3.1.1.
基本信息
</p>
<p
class=
"contentList"
style=
"text-indent:0em;"
>
概要信息:
</p>
</div>
<div
v-for=
"
item
of messageList"
>
<div
v-for=
"
(item,itemIndex)
of messageList"
>
<div
class=
"page"
v-for=
"(arr,index) of item.val"
>
<p
class=
"contentList"
style=
"text-indent:0em;"
v-if=
"index ===0"
>
{{
item
.
name
}}
:
</p>
<div>
...
...
@@ -216,6 +215,9 @@
</tr>
</table>
</div>
<p
class=
"pageIndex"
v-for=
"item of messagePage"
>
<span
v-if=
"item.itemIndex === itemIndex && item.arrIndex === index"
>
{{
19
+
item
.
page
}}
</span>
</p>
</div>
</div>
<div
class=
"page"
>
...
...
@@ -273,6 +275,9 @@
<td>
{{
acc
.
position
}}
</td>
</tr>
</table>
<p
class=
"pageIndex"
v-for=
"item of optimizedPage"
>
<span
v-if=
"item.itemIndex === itemInd && item.arrIndex === index"
>
{{
20
+
item
.
page
+
page1
}}
</span>
</p>
</div>
</div>
</div>
...
...
@@ -306,6 +311,10 @@
<td>
{{
acc
.
position
}}
</td>
</tr>
</table>
<p
class=
"pageIndex"
v-for=
"item of replacedPage"
>
<span
v-if=
"item.itemIndex === itemInd && item.arrIndex === index && optimized.length !== 0"
>
{{
20
+
item
.
page
+
page1
+
page2
}}
</span>
<span
v-if=
"item.itemIndex === itemInd && item.arrIndex === index && optimized.length === 0"
>
{{
20
+
item
.
page
+
page1
+
1
}}
</span>
</p>
</div>
</div>
</div>
...
...
@@ -339,6 +348,12 @@
<td>
{{
acc
.
position
}}
</td>
</tr>
</table>
<p
class=
"pageIndex"
v-for=
"item of verificationPage"
>
<span
v-if=
"item.itemIndex === itemInd && item.arrIndex === index && optimized.length !== 0 && replaced.length !== 0"
>
{{
20
+
item
.
page
+
page1
+
page2
+
page3
}}
</span>
<span
v-if=
"item.itemIndex === itemInd && item.arrIndex === index && optimized.length === 0 && replaced.length !== 0"
>
{{
20
+
item
.
page
+
page1
+
1
+
page3
}}
</span>
<span
v-if=
"item.itemIndex === itemInd && item.arrIndex === index && optimized.length !== 0 && replaced.length === 0"
>
{{
20
+
item
.
page
+
page1
+
1
+
page2
}}
</span>
<span
v-if=
"item.itemIndex === itemInd && item.arrIndex === index && optimized.length === 0 && replaced.length === 0"
>
{{
20
+
item
.
page
+
page1
+
2
}}
</span>
</p>
</div>
</div>
</div>
...
...
@@ -1089,38 +1104,89 @@ export default {
"version"
:
""
}]
},
messageList
:[]
messageList
:[],
page1
:
0
,
// 3.1.1 基本信息页码数
page2
:
0
,
// 可优化页码数
page3
:
0
,
// 必须替换页码数
page4
:
0
,
// 需要验证页码数
pageAll
:
0
,
// page2,3,4所有页码数
del
:
0
,
// page2,3,4没有数据的页码数
messagePage
:
[],
// 基本信息页码数列
optimizedPage
:
[],
// 可优化页码数列
replacedPage
:
[],
// 必须替换页码数列
verificationPage
:
[],
// 需要验证页码数列
};
},
created
()
{
this
.
init
()
this
.
init2
()
},
mounted
:
function
()
{
setTimeout
(()
=>
{
this
.
getPage
()
},
1000
)
},
methods
:{
// 获取页码
getPage
()
{
for
(
let
i
=
1
;
i
<
$
(
'.page'
).
length
;
i
++
)
{
let
html
=
'<p class="pageIndex">'
+
i
+
'</p>'
;
if
(
i
===
20
)
{
html
=
'<p class="pageIndex">'
+
(
i
+
this
.
page1
)
+
'</p>'
;
}
if
(
i
>
20
&&
this
.
del
!==
0
)
{
// 可优化项不是空
html
=
'<p class="pageIndex">'
+
(
i
+
this
.
page1
+
this
.
pageAll
-
this
.
del
)
+
'</p>'
;
if
(
i
===
21
&&
this
.
page2
===
0
)
{
html
=
'<p class="pageIndex">'
+
(
i
+
this
.
page1
)
+
'</p>'
;
}
if
(
i
===
22
&&
this
.
page3
===
0
)
{
html
=
'<p class="pageIndex">'
+
(
i
+
this
.
page1
+
this
.
page2
)
+
'</p>'
;
}
else
if
(
i
===
22
&&
this
.
page3
===
0
&&
this
.
page2
===
0
)
{
html
=
'<p class="pageIndex">'
+
(
i
+
this
.
page1
+
this
.
page2
-
1
)
+
'</p>'
;
}
if
(
i
===
23
&&
this
.
page4
===
0
&&
this
.
page2
!==
0
&&
this
.
page3
!==
0
)
{
html
=
'<p class="pageIndex">'
+
(
i
+
this
.
page1
+
this
.
page2
+
this
.
page3
)
+
'</p>'
;
}
else
if
(
i
===
23
&&
this
.
page4
===
0
&&
this
.
page2
===
0
||
i
===
23
&&
this
.
page4
===
0
&&
this
.
page3
===
0
)
{
html
=
'<p class="pageIndex">'
+
(
i
+
this
.
page1
+
this
.
page2
+
this
.
page3
-
1
)
+
'</p>'
;
}
else
if
(
i
===
23
&&
this
.
page4
===
0
&&
this
.
page2
===
0
&&
this
.
page3
===
0
)
{
html
=
'<p class="pageIndex">'
+
(
i
+
this
.
page1
+
this
.
page2
+
this
.
page3
-
2
)
+
'</p>'
;
}
}
else
if
(
i
>
20
&&
this
.
del
===
0
)
{
html
=
'<p class="pageIndex">'
+
(
i
+
this
.
page1
)
+
'</p>'
;
}
let
other
=
'.page:nth-child('
+
(
i
+
1
)
+
')'
;
$
(
other
).
append
(
html
);
for
(
let
item
of
this
.
listContent
)
{
if
(
$
(
'.page'
)[
i
].
innerText
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
name
!==
'目录'
)
{
item
.
val
=
i
;
if
(
item
.
name
===
'4. 评估建议'
||
item
.
name
===
'5. 附件'
)
{
item
.
val
=
i
+
this
.
page1
+
this
.
pageAll
-
this
.
del
;
}
}
if
(
item
.
child1
!==
undefined
)
{
for
(
let
arr
of
item
.
child1
)
{
if
(
$
(
'.page'
)[
i
].
innerText
.
indexOf
(
arr
.
name
)
!==
-
1
)
{
arr
.
val
=
i
;
if
(
arr
.
name
===
'3.2. 关键技术依赖'
)
{
arr
.
val
=
i
+
this
.
page1
;
}
if
(
arr
.
name
===
'3.3. 难度系数和综合系数修正'
||
arr
.
name
===
'3.4. 人工月估算'
||
arr
.
name
===
'3.5. 额外申请'
||
arr
.
name
===
'3.6. 预算建议'
||
arr
.
name
===
'4.1. 适配/改造路线选择'
||
arr
.
name
===
'4.2. 关键工作与方法'
)
{
arr
.
val
=
i
+
this
.
page1
+
this
.
pageAll
-
this
.
del
;
}
}
if
(
arr
.
child2
!==
undefined
)
{
for
(
let
acc
of
arr
.
child2
)
{
if
(
$
(
'.page'
)[
i
].
innerText
.
indexOf
(
acc
.
name
)
!==
-
1
)
{
acc
.
val
=
i
;
if
(
acc
.
name
===
'3.1.2. 原系统代码规模'
||
acc
.
name
===
'3.2.1. 可优化的项'
)
{
acc
.
val
=
i
+
this
.
page1
}
else
if
(
acc
.
name
===
'3.2.2. 必须替换的项'
&&
this
.
page2
===
0
)
{
acc
.
val
=
i
+
this
.
page1
}
else
if
(
acc
.
name
===
'3.2.2. 必须替换的项'
&&
this
.
page2
!==
0
)
{
acc
.
val
=
i
+
this
.
page1
+
this
.
page2
;
}
else
if
(
acc
.
name
===
'3.2.3. 需要验证修改的项'
&&
this
.
page2
!==
0
||
acc
.
name
===
'3.2.3. 需要验证修改的项'
&&
this
.
page3
!==
0
)
{
acc
.
val
=
i
+
this
.
page1
+
this
.
page2
+
this
.
page3
-
1
;
}
else
if
(
acc
.
name
===
'3.2.3. 需要验证修改的项'
&&
this
.
page2
===
0
&&
this
.
page3
===
0
)
{
acc
.
val
=
i
+
this
.
page1
+
this
.
page2
+
this
.
page3
-
2
;
}
else
if
(
acc
.
name
===
'4.2.1. 开发框架解决方法'
||
acc
.
name
===
'4.2.2. 浏览器的适配兼容性改造解决方法'
||
acc
.
name
===
'4.2.3. 浏览器功能组件的替换和适配解决方法'
||
acc
.
name
===
'4.2.4. B/S结构下的重构'
||
acc
.
name
===
'4.2.5. C/S结构下的重构'
||
acc
.
name
===
'4.2.6. 部署和迁移策略'
)
{
acc
.
val
=
i
+
this
.
page1
+
this
.
pageAll
-
this
.
del
}
}
}
}
...
...
@@ -1152,7 +1218,9 @@ export default {
// console.log('数据请求结果', res.data)
if
(
res
.
data
!==
500
)
{
this
.
systemName
=
res
.
data
.
sysName
;
this
.
reportName
=
'在国产化安全自主可控环境下的'
+
res
.
data
.
type
===
2
?
'适配'
:
'改造'
+
'工作评估报告'
;
this
.
reportName
=
res
.
data
.
type
===
2
?
'适配'
:
'改造'
+
'工作评估报告'
;
this
.
reportName
=
'在国产化安全自主可控环境下的'
+
this
.
reportName
;
this
.
htmlTitle
=
this
.
reportName
;
this
.
sysScale
.
codeNum
=
res
.
data
.
sysScale
.
code
.
num
===
-
1
?
'-'
:
res
.
data
.
sysScale
.
code
.
num
;
this
.
sysScale
.
modelNum
=
res
.
data
.
sysScale
.
mode
.
num
===
-
1
?
'-'
:
res
.
data
.
sysScale
.
mode
.
num
;
this
.
sysScale
.
fileNum
=
res
.
data
.
sysScale
.
file
.
num
===
-
1
?
'-'
:
res
.
data
.
sysScale
.
file
.
num
;
...
...
@@ -1228,8 +1296,10 @@ export default {
this
.
optimized
.
push
(
item
)
}
}
this
.
imeDayFilter
();
}
this
.
imeDayFilter
();
this
.
init2
();
}
})
},
...
...
@@ -1237,17 +1307,21 @@ export default {
// this.$server.getExcel('this.$route.query.id').then(res =>{
// console.log(res)
// })
console
.
log
(
this
.
messageAll
);
for
(
let
item
in
this
.
messageAll
)
{
// console.log(item,this.messageAll[item]);
let
array
=
[];
let
val
=
{
name
:
'概要信息
'
,
name
:
'
'
,
val
:
[]
};
}
if
(
item
===
'arrayList'
)
{
val
.
name
=
'概要信息'
}
array
.
push
(
val
);
let
page
=
0
;
for
(
let
a
=
0
;
a
<
this
.
messageAll
.
arrayList
.
length
;
a
++
)
{
for
(
let
a
=
0
;
a
<
this
.
messageAll
[
item
]
.
length
;
a
++
)
{
if
(
a
%
20
===
0
)
{
array
[
0
].
val
.
push
([]);
array
[
array
.
length
-
1
].
val
.
push
([]);
if
(
a
!==
0
)
{
page
+=
1
;
}
...
...
@@ -1257,10 +1331,73 @@ export default {
name
:
this
.
messageAll
.
arrayList
[
a
].
name
,
value
:
this
.
messageAll
.
arrayList
[
a
].
value
}
array
[
0
].
val
[
page
].
push
(
value
)
array
[
array
.
length
-
1
].
val
[
page
].
push
(
value
)
}
this
.
messageList
=
array
;
console
.
log
(
array
)
}
let
messagePa
=
0
;
for
(
let
i
=
0
;
i
<
this
.
messageList
.
length
;
i
++
)
{
this
.
page1
+=
this
.
messageList
[
i
].
val
.
length
;
for
(
let
a
=
0
;
a
<
this
.
messageList
[
i
].
val
.
length
;
a
++
)
{
messagePa
+=
1
let
val
=
{
itemIndex
:
i
,
arrIndex
:
a
,
page
:
messagePa
}
this
.
messagePage
.
push
(
val
)
}
}
let
replacedPa
=
0
;
if
(
this
.
replaced
.
length
!==
0
)
{
for
(
let
i
=
0
;
i
<
this
.
replaced
.
length
;
i
++
)
{
this
.
page3
+=
this
.
replaced
[
i
].
val
.
length
;
for
(
let
a
=
0
;
a
<
this
.
replaced
[
i
].
val
.
length
;
a
++
)
{
replacedPa
+=
1
let
val
=
{
itemIndex
:
i
,
arrIndex
:
a
,
page
:
replacedPa
}
this
.
replacedPage
.
push
(
val
)
}
}
this
.
del
+=
1
;
}
let
verificationPa
=
0
;
if
(
this
.
verification
.
length
!==
0
)
{
for
(
let
i
=
0
;
i
<
this
.
verification
.
length
;
i
++
)
{
this
.
page4
+=
this
.
verification
[
i
].
val
.
length
;
for
(
let
a
=
0
;
a
<
this
.
verification
[
i
].
val
.
length
;
a
++
)
{
verificationPa
+=
1
let
val
=
{
itemIndex
:
i
,
arrIndex
:
a
,
page
:
verificationPa
}
this
.
verificationPage
.
push
(
val
)
}
}
this
.
del
+=
1
;
}
let
optimizedPa
=
0
;
if
(
this
.
optimized
.
length
!==
0
)
{
for
(
let
i
=
0
;
i
<
this
.
optimized
.
length
;
i
++
)
{
this
.
page2
+=
this
.
optimized
[
i
].
val
.
length
;
for
(
let
a
=
0
;
a
<
this
.
optimized
[
i
].
val
.
length
;
a
++
)
{
optimizedPa
+=
1
let
val
=
{
itemIndex
:
i
,
arrIndex
:
a
,
page
:
optimizedPa
}
this
.
optimizedPage
.
push
(
val
)
}
}
this
.
del
+=
1
;
}
this
.
pageAll
=
this
.
page2
+
this
.
page3
+
this
.
page4
;
this
.
getPage
()
}
}
}
...
...
src/tools/htmlToPdf.js
浏览文件 @
e2181ec5
// 导出页面为PDF格式
import
Vue
from
'vue'
let
v
=
new
Vue
();
import
html2Canvas
from
'html2canvas'
import
JsPDF
from
'jspdf'
export
default
{
install
(
Vue
,
options
)
{
Vue
.
prototype
.
getPdf
=
function
()
{
let
title
=
this
.
htmlTitle
v
.
$message
.
info
(
'正在生成pdf文件!请稍等'
)
html2Canvas
(
document
.
querySelector
(
'#pdfDom'
),
{
allowTaint
:
true
}).
then
(
function
(
canvas
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论