提交 e2181ec5 authored 作者: CRS's avatar CRS

合并分支 'crs' 到 'master'

new 查看合并请求 !117
...@@ -202,9 +202,8 @@ ...@@ -202,9 +202,8 @@
<p class="title1">3.&nbsp;原应用系统评估</p> <p class="title1">3.&nbsp;原应用系统评估</p>
<p class="title2">3.1.&nbsp;原应用系统概要</p> <p class="title2">3.1.&nbsp;原应用系统概要</p>
<p class="title3">3.1.1.&nbsp;基本信息</p> <p class="title3">3.1.1.&nbsp;基本信息</p>
<p class="contentList" style="text-indent:0em;">概要信息:</p>
</div> </div>
<div v-for="item of messageList"> <div v-for="(item,itemIndex) of messageList">
<div class="page" v-for="(arr,index) of item.val"> <div class="page" v-for="(arr,index) of item.val">
<p class="contentList" style="text-indent:0em;" v-if="index ===0">{{item.name}}</p> <p class="contentList" style="text-indent:0em;" v-if="index ===0">{{item.name}}</p>
<div> <div>
...@@ -216,6 +215,9 @@ ...@@ -216,6 +215,9 @@
</tr> </tr>
</table> </table>
</div> </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> </div>
<div class="page"> <div class="page">
...@@ -273,6 +275,9 @@ ...@@ -273,6 +275,9 @@
<td>{{acc.position}}</td> <td>{{acc.position}}</td>
</tr> </tr>
</table> </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> </div>
</div> </div>
...@@ -306,6 +311,10 @@ ...@@ -306,6 +311,10 @@
<td>{{acc.position}}</td> <td>{{acc.position}}</td>
</tr> </tr>
</table> </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> </div>
</div> </div>
...@@ -339,6 +348,12 @@ ...@@ -339,6 +348,12 @@
<td>{{acc.position}}</td> <td>{{acc.position}}</td>
</tr> </tr>
</table> </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> </div>
</div> </div>
...@@ -1089,38 +1104,89 @@ export default { ...@@ -1089,38 +1104,89 @@ export default {
"version": "" "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() { created() {
this.init() this.init()
this.init2()
}, },
mounted: function () { mounted: function () {
setTimeout(()=>{
this.getPage()
},1000)
}, },
methods:{ methods:{
// 获取页码 // 获取页码
getPage() { getPage() {
for (let i = 1; i < $('.page').length; i++) { for (let i = 1; i < $('.page').length; i++) {
let html = '<p class="pageIndex">' + i + '</p>'; 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) + ')'; let other = '.page:nth-child(' + (i+1) + ')';
$(other).append(html); $(other).append(html);
for (let item of this.listContent) { for (let item of this.listContent) {
if ($('.page')[i].innerText.indexOf(item.name) !== -1 && item.name !== '目录') { if ($('.page')[i].innerText.indexOf(item.name) !== -1 && item.name !== '目录') {
item.val = i; item.val = i;
if (item.name === '4. 评估建议' || item.name === '5. 附件') {
item.val = i + this.page1 + this.pageAll - this.del;
}
} }
if (item.child1 !== undefined) { if (item.child1 !== undefined) {
for (let arr of item.child1) { for (let arr of item.child1) {
if ($('.page')[i].innerText.indexOf(arr.name) !== -1) { if ($('.page')[i].innerText.indexOf(arr.name) !== -1) {
arr.val = i; 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) { if (arr.child2 !== undefined) {
for (let acc of arr.child2) { for (let acc of arr.child2) {
if ($('.page')[i].innerText.indexOf(acc.name) !== -1) { if ($('.page')[i].innerText.indexOf(acc.name) !== -1) {
acc.val = i; 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 { ...@@ -1152,7 +1218,9 @@ export default {
// console.log('数据请求结果', res.data) // console.log('数据请求结果', res.data)
if (res.data !== 500) { if (res.data !== 500) {
this.systemName = res.data.sysName; 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.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.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; this.sysScale.fileNum = res.data.sysScale.file.num === -1 ? '-' : res.data.sysScale.file.num;
...@@ -1228,8 +1296,10 @@ export default { ...@@ -1228,8 +1296,10 @@ export default {
this.optimized.push(item) this.optimized.push(item)
} }
} }
this.imeDayFilter();
} }
this.imeDayFilter();
this.init2();
} }
}) })
}, },
...@@ -1237,30 +1307,97 @@ export default { ...@@ -1237,30 +1307,97 @@ export default {
// this.$server.getExcel('this.$route.query.id').then(res =>{ // this.$server.getExcel('this.$route.query.id').then(res =>{
// console.log(res) // console.log(res)
// }) // })
console.log(this.messageAll); for (let item in this.messageAll) {
let array = []; // console.log(item,this.messageAll[item]);
let val = { let array = [];
name: '概要信息', let val = {
val: [] name: '',
}; val: []
array.push(val); }
let page = 0; if (item === 'arrayList') {
for (let a = 0; a < this.messageAll.arrayList.length; a++) { val.name = '概要信息'
if (a % 20 === 0) { }
array[0].val.push([]); array.push(val);
if (a !== 0) { let page = 0;
page += 1; for (let a = 0; a < this.messageAll[item].length; a++) {
if (a % 20 === 0) {
array[array.length - 1].val.push([]);
if (a !== 0) {
page += 1;
}
}
let value = {
index: (a+1),
name: this.messageAll.arrayList[a].name,
value: this.messageAll.arrayList[a].value
}
array[array.length - 1].val[page].push(value)
}
this.messageList = 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)
} }
} }
let value = { this.del += 1;
index: (a+1), }
name: this.messageAll.arrayList[a].name, let verificationPa = 0;
value: this.messageAll.arrayList[a].value 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)
}
} }
array[0].val[page].push(value) this.del += 1;
} }
this.messageList = array; this.pageAll = this.page2 + this.page3 + this.page4;
console.log(array) this.getPage()
} }
} }
} }
......
// 导出页面为PDF格式 // 导出页面为PDF格式
import Vue from 'vue'
let v = new Vue();
import html2Canvas from 'html2canvas' import html2Canvas from 'html2canvas'
import JsPDF from 'jspdf' import JsPDF from 'jspdf'
export default { export default {
install (Vue, options) { install (Vue, options) {
Vue.prototype.getPdf = function () { Vue.prototype.getPdf = function () {
let title = this.htmlTitle let title = this.htmlTitle
v.$message.info('正在生成pdf文件!请稍等')
html2Canvas(document.querySelector('#pdfDom'), { html2Canvas(document.querySelector('#pdfDom'), {
allowTaint: true allowTaint: true
}).then(function (canvas) { }).then(function (canvas) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论