田源
2023-12-05 99824bc8412280f710e8182631dc37a38720e8a3
统计分析真实数据联调
已修改1个文件
128 ■■■■ 文件已修改
Source/UBCS-WEB/src/views/statistic/statisticPage.vue 128 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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() {
@@ -207,27 +129,37 @@
        this.$message.warning("请检查已勾选数据类型是否为空!");
        return;
      }
      this.selectData.forEach(item => {
      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) => {
        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>