This commit is contained in:
熊成强 2020-11-05 17:46:54 +08:00
parent f750eec2f2
commit b9ba1edb5e
2 changed files with 11 additions and 2 deletions

View File

@ -38,7 +38,6 @@ service.interceptors.request.use(config => {
// if (getToken() && !isToken) { // if (getToken() && !isToken) {
// config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 // config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
// } // }
console.log(' Vue.cookies: ', Vue.$cookies)
config.headers['token'] = Vue.$cookies.get('token') || '' config.headers['token'] = Vue.$cookies.get('token') || ''
return config return config
}, error => { }, error => {

View File

@ -68,7 +68,7 @@
业务指标权重{{handleGetWeight(i)}}%/{{Math.round((i.weight * 100)*1000)/1000}}% 业务指标权重{{handleGetWeight(i)}}%/{{Math.round((i.weight * 100)*1000)/1000}}%
</div> </div>
<div> <div>
所有指标总权重: {{ Math.round((obj.weight * 100)*1000)/1000}}% 所有指标总权重: {{ handleGetWeight1()}}%
</div> </div>
</div> </div>
<div style=" padding: 10px;"> <div style=" padding: 10px;">
@ -203,7 +203,17 @@ export default {
}) })
history.go(-1) history.go(-1)
}, },
handleGetWeight1 () {
let num = 0
this.obj.recortModelDtos.map(i => {
i.detailDtos.filter(i => !i.isDelete).map(i => {
num += i.checkWeight
})
})
return Math.round((num * 100) * 1000) / 1000
},
handleGetWeight (arr) { handleGetWeight (arr) {
console.log('arr: ', arr)
const weight = arr.detailDtos.filter(i => !i.isDelete).reduce((num, i) => { const weight = arr.detailDtos.filter(i => !i.isDelete).reduce((num, i) => {
num += i.isDelete !== 1 ? i.checkWeight : 0 num += i.isDelete !== 1 ? i.checkWeight : 0
return num return num