|
@@ -195,92 +195,98 @@ export default {
|
|
|
},
|
|
|
// 处理编制周期数据
|
|
|
formatBidCycleData (data) {
|
|
|
- if (!data) return
|
|
|
- const arr = []
|
|
|
- data.forEach((item) => {
|
|
|
- arr.push({
|
|
|
- '编制周期': item.key, // eslint-disable-line
|
|
|
- '项目数量': item.doc_count // eslint-disable-line
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ const arr = []
|
|
|
+ data.forEach((item) => {
|
|
|
+ arr.push({
|
|
|
+ '编制周期': item.key, // eslint-disable-line
|
|
|
+ '项目数量': item.doc_count // eslint-disable-line
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- this.bidCycle.data.rows = arr
|
|
|
- // 数据都为0 隐藏
|
|
|
- var countArr = this.bidCycle.data.rows.map((v) => {
|
|
|
- return v['项目数量']
|
|
|
- })
|
|
|
- const max = Math.max.apply(null, countArr)
|
|
|
- if (max === 0) {
|
|
|
- this.bidCycle.show = false
|
|
|
+ this.bidCycle.data.rows = arr
|
|
|
+ // 数据都为0 隐藏
|
|
|
+ var countArr = this.bidCycle.data.rows.map((v) => {
|
|
|
+ return v['项目数量']
|
|
|
+ })
|
|
|
+ const max = Math.max.apply(null, countArr)
|
|
|
+ if (max === 0) {
|
|
|
+ this.bidCycle.show = false
|
|
|
+ }
|
|
|
+ this.bidCycle.show = true
|
|
|
}
|
|
|
- this.bidCycle.show = true
|
|
|
},
|
|
|
// 处理类似项目预算分布数据
|
|
|
formatBudgetData (arr) {
|
|
|
- if (!arr) return
|
|
|
- let data = []
|
|
|
- data = arr.map((v, i) => {
|
|
|
- v.avg = v.avg === null ? '0' : v.avg
|
|
|
- const x = i % 10
|
|
|
- const y = 10 - Math.ceil((i + 1) / 10)
|
|
|
- return [x, y, v.avg, v.doc_count, v.key]
|
|
|
- })
|
|
|
- this.budget.data = data
|
|
|
- this.budget.show = true
|
|
|
- this.budget.flag = true
|
|
|
+ if (arr && arr.length > 0) {
|
|
|
+ let data = []
|
|
|
+ data = arr.map((v, i) => {
|
|
|
+ v.avg = v.avg === null ? '0' : v.avg
|
|
|
+ const x = i % 10
|
|
|
+ const y = 10 - Math.ceil((i + 1) / 10)
|
|
|
+ return [x, y, v.avg, v.doc_count, v.key]
|
|
|
+ })
|
|
|
+ this.budget.data = data
|
|
|
+ this.budget.show = true
|
|
|
+ this.budget.flag = true
|
|
|
+ }
|
|
|
},
|
|
|
formatAreaData (data) {
|
|
|
- if (!data) return
|
|
|
- const rows = []
|
|
|
- data.forEach((item) => {
|
|
|
- rows.push({
|
|
|
- /* eslint-disable */
|
|
|
- '省份': item.key,
|
|
|
- '类似项目数量': item.doc_count,
|
|
|
- '类似项目规模': moneyUnit(item.bidamount_sum)
|
|
|
- /* eslint-enable */
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ const rows = []
|
|
|
+ data.forEach((item) => {
|
|
|
+ rows.push({
|
|
|
+ /* eslint-disable */
|
|
|
+ '省份': item.key,
|
|
|
+ '类似项目数量': item.doc_count,
|
|
|
+ '类似项目规模': moneyUnit(item.bidamount_sum)
|
|
|
+ /* eslint-enable */
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- this.area.data.rows = rows
|
|
|
- this.area.show = true
|
|
|
+ this.area.data.rows = rows
|
|
|
+ this.area.show = true
|
|
|
+ }
|
|
|
},
|
|
|
// 处理类似项目采购单位类型分布数据
|
|
|
formatBuyClassData (data) {
|
|
|
- if (!data) return
|
|
|
- const arr = []
|
|
|
- // 降序排列
|
|
|
- data.sort((a, b) => {
|
|
|
- return b.doc_money - a.doc_money
|
|
|
- })
|
|
|
- data.forEach((item) => {
|
|
|
- arr.push(item.key, item.doc_money, item.doc_count, item.avg, item.main)
|
|
|
- })
|
|
|
- const normal = ['行业', '类似项目规模', '类似项目数量', '平均折扣率', '是否当前项目']
|
|
|
- const newArr = this.arrTrans(5, arr)
|
|
|
- newArr.unshift(normal)
|
|
|
- this.buyclass.data = newArr
|
|
|
- this.buyclass.show = true
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ const arr = []
|
|
|
+ // 降序排列
|
|
|
+ data.sort((a, b) => {
|
|
|
+ return b.doc_money - a.doc_money
|
|
|
+ })
|
|
|
+ data.forEach((item) => {
|
|
|
+ arr.push(item.key, item.doc_money, item.doc_count, item.avg, item.main)
|
|
|
+ })
|
|
|
+ const normal = ['行业', '类似项目规模', '类似项目数量', '平均折扣率', '是否当前项目']
|
|
|
+ const newArr = this.arrTrans(5, arr)
|
|
|
+ newArr.unshift(normal)
|
|
|
+ this.buyclass.data = newArr
|
|
|
+ this.buyclass.show = true
|
|
|
+ }
|
|
|
},
|
|
|
// 处理类似项目热点中标企业数据
|
|
|
formatHotWinData (data) {
|
|
|
- if (!data) return
|
|
|
- this.hotWin.show = true
|
|
|
- this.hotWin.data = data
|
|
|
- this.hotWin.flag = true
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ this.hotWin.show = true
|
|
|
+ this.hotWin.data = data
|
|
|
+ this.hotWin.flag = true
|
|
|
+ }
|
|
|
},
|
|
|
formatExpertData (data) {
|
|
|
- if (!data) return
|
|
|
- const arr = []
|
|
|
- data.forEach((v) => {
|
|
|
- v.parent = v.doc_count / data[0].doc_count * 100 + '%'
|
|
|
- arr.push({
|
|
|
- name: v.key,
|
|
|
- count: v.doc_count,
|
|
|
- parent: v.parent
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ const arr = []
|
|
|
+ data.forEach((v) => {
|
|
|
+ v.parent = v.doc_count / data[0].doc_count * 100 + '%'
|
|
|
+ arr.push({
|
|
|
+ name: v.key,
|
|
|
+ count: v.doc_count,
|
|
|
+ parent: v.parent
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- this.expert.show = true
|
|
|
- this.expert.data = arr
|
|
|
- this.expert.flag = true
|
|
|
+ this.expert.show = true
|
|
|
+ this.expert.data = arr
|
|
|
+ this.expert.flag = true
|
|
|
+ }
|
|
|
},
|
|
|
/* *********** 配置项部分 *********** */
|
|
|
// 类似项目标书编制周期分布配置
|