Commit d4a9e8bf authored by whlviolin's avatar whlviolin

测试包络分析结果展示

parent 9cfdd002
...@@ -76,30 +76,42 @@ export function getOption(data1) { ...@@ -76,30 +76,42 @@ export function getOption(data1) {
export function getOption2(data) { export function getOption2(res) {
console.log(data)
let seriesList = [] let seriesList = []
let col = data["决策单元"] let col = []
let leg = [] let leg = []
for (let item in data) { let header = res['header']//["决策单元",'技术效益(BCC)','规模效益(CCR/BCC)','综合技术效益(CCR)']
console.log(item) let data = res['data']
if(item == "决策单元" || item == "有效性") { for(let i in header){
continue; console.log(header[i])
let litem = header[i]
let datalist = []
for (let j in data) {
let ditem = data[j]
let value = ditem[litem]
if(litem == "决策单元") {
col.push(value)
continue;
}
if(litem == "有效性") {
continue;
}
datalist.push(value)
} }
let obj = { if(litem != "决策单元" && litem != "有效性") {
name: item, leg.push(litem)
type: 'line', let obj = {
data: data[item] name: litem,
type: 'line',
data: datalist
}
seriesList.push(obj)
} }
leg.push(item)
seriesList.push(obj)
}
}
console.log(col)
console.log(seriesList)
let option = { let option = {
title: { title: {
text: '效益有效性分析' text: '效益有效性分析'
...@@ -132,4 +144,4 @@ export function getOption2(data) { ...@@ -132,4 +144,4 @@ export function getOption2(data) {
series: seriesList series: seriesList
}; };
return option; return option;
} }
\ No newline at end of file
...@@ -529,14 +529,22 @@ ...@@ -529,14 +529,22 @@
"args_y": JSON.stringify(this.choose_args2), "args_y": JSON.stringify(this.choose_args2),
"args_z": JSON.stringify(this.choose_args3), "args_z": JSON.stringify(this.choose_args3),
} }
runDEAAlgo(params).then(res => { this.hasResult = true
console.log("算法执行结果") this.algoRes = //res.data;
console.log(res) {title: "数据包络分析(DEA)_编号_身高cm_负荷时间",
this.hasResult = true res11: {header:["决策单元",'技术效益(BCC)','规模效益(CCR/BCC)','综合技术效益(CCR)','有效性'],data:[{"决策单元":0,'技术效益(BCC)':0.907106846851185,'规模效益(CCR/BCC)':0.988628931300419,'综合技术效益(CCR)':0.89679207257778,'有效性':'非 DEA 有效'},{"决策单元":1,'技术效益(BCC)':0.3,'规模效益(CCR/BCC)':0.1,'综合技术效益(CCR)':0.2,'有效性':'DEA 强有效'}],
this.algoRes = {title: "数据包络分析(DEA)_编号_身高cm_负荷时间"}//res.data; },
}).catch(err => { res22: {header:['技术效益(BCC)','规模效益(CCR/BCC)','综合技术效益(CCR)'],data:[{'技术效益(BCC)':0.907106846851185,'规模效益(CCR/BCC)':0.988628931300419,'综合技术效益(CCR)':0.89679207257778},{'技术效益(BCC)':0.3,'规模效益(CCR/BCC)':0.1,'综合技术效益(CCR)':0.2}]},
console.log(err) }
}) // runDEAAlgo(params).then(res => {
// console.log("算法执行结果")
// console.log(res)
// this.hasResult = true
// this.algoRes = //res.data;
// {title: "数据包络分析(DEA)_编号_身高cm_负荷时间"}
// }).catch(err => {
// console.log(err)
// })
}, },
run() { run() {
if(this.selectAlgo.key == "DEA") { if(this.selectAlgo.key == "DEA") {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</div> </div>
<div v-if="loading" style="position: absolute; top: 41px; right:0px; left:0px; bottom:0px;overflow: scroll;"> <div v-if="loading" style="position: absolute; top: 41px; right:0px; left:0px; bottom:0px;overflow: scroll;">
<div style="padding-bottom: 100px;"> <div style="padding-bottom: 100px;">
<div style="width: 100%; height:200px;margin:10px 50px;"> <div style="width: 100%; height:100px;margin:10px 50px;">
<span style="font-weight:600;font-size:16px">算法结果描述</span> <span style="font-weight:600;font-size:16px">算法结果描述</span>
</div> </div>
<div style="margin:50px;"> <div style="margin:50px;">
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<el-table <el-table
border border
stripe stripe
height="100%" height="100%"
:data="tableData1" :data="tableData1"
:style="{'width': '100%', 'height': '100%'}"> :style="{'width': '100%', 'height': '100%'}">
<template v-for="item in tableHeader1"> <template v-for="item in tableHeader1">
...@@ -63,7 +63,9 @@ ...@@ -63,7 +63,9 @@
<script> <script>
import { getOption2 } from "@/utils/echartsUtil" import { getOption2 } from "@/utils/echartsUtil"
import VabChart from '@/plugins/echarts' import * as echarts from 'echarts';
import VabChart from '@/plugins/echarts'
//引入echarts
export default { export default {
name: 'res1', name: 'res1',
props: { props: {
...@@ -73,7 +75,7 @@ export default { ...@@ -73,7 +75,7 @@ export default {
} }
}, },
components: { components: {
VabChart VabChart
}, },
data() { data() {
return { return {
...@@ -97,14 +99,14 @@ export default { ...@@ -97,14 +99,14 @@ export default {
let res1 = this.algoRes["res11"] let res1 = this.algoRes["res11"]
let header = res1["header"] let header = res1["header"]
this.tableHeader = header; this.tableHeader = header;
this.tableData = JSON.parse(res1["data"]) this.tableData = res1["data"]
let res2 = this.algoRes["res22"] let res2 = this.algoRes["res22"]
let header2 = res2["header"] let header2 = res2["header"]
this.tableHeader1 = header2; this.tableHeader1 = header2;
this.tableData1 = JSON.parse(res2["data"]) this.tableData1 = res2["data"]
this.fwl = getOption2(res1["data2"]); this.fwl = getOption2(res1);
} }
...@@ -114,4 +116,4 @@ export default { ...@@ -114,4 +116,4 @@ export default {
<style scoped> <style scoped>
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment