From 3d828ba07224d1935f47cb0c20dcb959281361d6 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期四, 07 十二月 2023 14:06:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS-WEB/src/views/statistic/statisticPage.vue | 168 +++++++++++++++++++++----------------------------------
1 files changed, 65 insertions(+), 103 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/statistic/statisticPage.vue b/Source/UBCS-WEB/src/views/statistic/statisticPage.vue
index 2619751..9403436 100644
--- a/Source/UBCS-WEB/src/views/statistic/statisticPage.vue
+++ b/Source/UBCS-WEB/src/views/statistic/statisticPage.vue
@@ -13,6 +13,7 @@
top="-50px"
>
<el-table
+ ref="table"
:data="tableData"
border
style="width: 100%"
@@ -66,6 +67,8 @@
import ColumnarChart from "../../components/StatisticsComponent/ColumnarChart"
import mixCart from "../../components/StatisticsComponent/mixCart"
import {getStatisticAnalysis} from "@/api/statistic/chart"
+import {getList} from "@/api/system/statistic";
+
export default {
components: {
lineChart,
@@ -76,6 +79,8 @@
name: "statisticPage",
data() {
return {
+ menuList:[],
+ dataKeyList: [],
addVisible: false,
chartName: "",
lineList: [],
@@ -83,105 +88,22 @@
columnarList: [],
mixList: [],
selectData: [],
- tableData: [
- {
- menuName: "宸ヨ壓鏂囦欢",
- codeType: "1",
- menuData: [
- [222, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "娴嬭瘯sc",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "浜у搧鍨嬪彿",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "鍥哄畾璧勪骇",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "鏉庤埅涓绘暟鎹�",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "Part",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "浜哄憳涓绘暟鎹�",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "浜哄憳",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "鏍囧噯",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "鐗╁搧涓绘暟鎹�",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "鍨嬪彿",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- }
- ]
+ tableData: []
}
},
+ created() {
+ this.getMasterList()
+ },
methods: {
+ getMasterList() {
+ const userId = localStorage.getItem('userId');
+ getList({userId: userId}).then(res => {
+ this.tableData = res.data.data;
+ })
+ },
//鏂板
addHandler() {
this.addVisible = true;
- getStatisticAnalysis({btmNames:'part'} ).then(res=>{
- console.log(res)
- })
},
//鍙栨秷
escHandler() {
@@ -193,7 +115,50 @@
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) {
+ // this.menuList=[
+ // {
+ // menuData: [
+ // [0, 0, 0, 0, 0, 0, 4, 9, 12, 12, 12, 12],
+ // [0, 0, 0, 0, 0, 0, 4, 5, 3, 0, 0, 0]
+ // ],
+ // code:1
+ // },
+ // {
+ // menuData: [
+ // [0, 0, 0, 1, 1, 1, 1, 1, 1, 29, 5315, 5315],
+ // [0, 0, 0, 1, 0, 0, 0, 0, 0, 28, 5286, 0]
+ // ],
+ // code:2
+ // },
+ // {
+ // menuData: [
+ // [0, 58, 60, 61, 75, 84, 145, 162, 166, 177, 186, 186],
+ // [0, 58, 2, 1, 14, 9, 61, 17, 4, 11, 9, 0]
+ // ],
+ // code:3
+ // }
+ // ]
+ // this.nextSave();
+ // this.$message.success('淇濆瓨鎴愬姛')
+ 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",
@@ -202,32 +167,29 @@
};
let hasValidData = false; // 娣诲姞涓�涓爣蹇楁潵璁板綍鏄惁鏈夋湁鏁堢殑閫夋嫨鏁版嵁
- let codeStatus = this.selectData.every(key => key.codeType)
- if (!codeStatus) {
- this.$message.warning("璇锋鏌ュ凡鍕鹃�夋暟鎹被鍨嬫槸鍚︿负绌猴紒");
- return;
- }
- this.selectData.forEach(item => {
+
+ this.selectData.forEach((item, index) => {
+ item.menuData = this.menuList[index].menuData;
const dataKey = typeList[item.codeType];
if (dataKey) {
this[dataKey].push(item);
- hasValidData = true; // 鏍囪鏈夋湁鏁堟暟鎹娣诲姞
+ hasValidData = true;
}
});
if (hasValidData) {
+ // this.$refs.table.clearSelection();
this.addVisible = false;
}
},
//琛ㄦ牸澶氶��
- selectChange(selection, row) {
- // console.log(selection, row)
+ selectChange(selection) {
this.selectData = selection;
},
}
}
</script>
-<style scoped lang="scss">
+<style lang="scss" scoped>
</style>
--
Gitblit v1.9.3