| | |
| | | </span> |
| | | </el-dialog> |
| | | <!-- echarts组件--> |
| | | <div style="margin-top: 15px"> |
| | | <div style="margin-top: 15px;padding-bottom: 35px"> |
| | | <lineChart v-for="(item,index) in lineList" :key="index" :chartName="item.menuName" |
| | | :lineData="item.menuData"></lineChart> |
| | | <pieChart v-for="(item,index) in pieList" :key="index" :chartName="item.menuName" |
| | |
| | | name: "statisticPage", |
| | | data() { |
| | | return { |
| | | menuList:[], |
| | | menuList: [], |
| | | dataKeyList: [], |
| | | addVisible: false, |
| | | chartName: "", |
| | |
| | | this.$message.warning('请至少选择一条数据!'); |
| | | return; |
| | | } |
| | | let codeStatus = this.selectData.every(key => key.codeType) |
| | | if (!codeStatus) { |
| | | this.$message.warning("请检查已勾选数据类型是否为空!"); |
| | | return; |
| | | } |
| | | |
| | | this.dataKeyList = this.selectData.map(obj => obj.code) |
| | | const btmName = this.dataKeyList.join(","); |
| | | if (btmName) { |
| | | getStatisticAnalysis({btmNames: btmName}).then(res => { |
| | | this.menuList = res.data.data; |
| | | this.nextSave(); |
| | | this.$message.success('保存成功') |
| | | }); |
| | | } else { |
| | | this.$message.warning('请选择数据!') |
| | | } |
| | | }, |
| | | nextSave() { |
| | | const typeList = { |
| | | "0": "lineList", |
| | | "1": "pieList", |
| | |
| | | }; |
| | | |
| | | let hasValidData = false; // 添加一个标志来记录是否有有效的选择数据 |
| | | let codeStatus = this.selectData.every(key => key.codeType) |
| | | if (!codeStatus) { |
| | | this.$message.warning("请检查已勾选数据类型是否为空!"); |
| | | return; |
| | | } |
| | | this.dataKeyList = this.selectData.map(obj => obj.code) |
| | | const btmName = this.dataKeyList.join(","); |
| | | if (btmName) { |
| | | getStatisticAnalysis({btmNames:btmName} ).then(res=>{ |
| | | this.menuList = res.data.data; |
| | | this.$message.success('保存成功') |
| | | }) |
| | | |
| | | } |
| | | this.selectData.forEach((item,index) => { |
| | | this.selectData.forEach((item, index) => { |
| | | item.menuData = this.menuList[index].menuData; |
| | | const dataKey = typeList[item.codeType]; |
| | | if (dataKey) { |
| | | this[dataKey].push(item); |
| | | this[dataKey].forEach(res=>{ |
| | | console.log('res',res) |
| | | }) |
| | | hasValidData = true; |
| | | } |
| | | }); |