Browse Source

feat(生产日报看板): 添加查询所有班组功能并优化班组选择逻辑

liujt 3 months ago
parent
commit
9effce70d7
4 changed files with 999 additions and 783 deletions
  1. 32 0
      package-lock.json
  2. 9 0
      src/api/vis/productionDailyDashboard.js
  3. 22 10
      src/views/bpm/vis-page/productionDailyDashboard.vue
  4. 936 773
      yarn.lock

+ 32 - 0
package-lock.json

@@ -18,6 +18,7 @@
         "cropperjs": "^1.5.12",
         "dayjs": "^1.11.9",
         "echarts": "^5.5.0",
+        "echarts-gl": "^2.0.9",
         "echarts-wordcloud": "^2.0.0",
         "ele-admin": "^1.11.2",
         "element-china-category-data": "^1.0.4",
@@ -4656,6 +4657,11 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/claygl": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/claygl/-/claygl-1.3.0.tgz",
+      "integrity": "sha512-+gGtJjT6SSHD2l2yC3MCubW/sCV40tZuSs5opdtn79vFSGUgp/lH139RNEQ6Jy078/L0aV8odCw8RSrUcMfLaQ=="
+    },
     "node_modules/clean-css": {
       "version": "5.3.3",
       "resolved": "https://registry.npmmirror.com/clean-css/-/clean-css-5.3.3.tgz",
@@ -6082,6 +6088,18 @@
         "zrender": "5.5.0"
       }
     },
+    "node_modules/echarts-gl": {
+      "version": "2.0.9",
+      "resolved": "https://registry.npmmirror.com/echarts-gl/-/echarts-gl-2.0.9.tgz",
+      "integrity": "sha512-oKeMdkkkpJGWOzjgZUsF41DOh6cMsyrGGXimbjK2l6Xeq/dBQu4ShG2w2Dzrs/1bD27b2pLTGSaUzouY191gzA==",
+      "dependencies": {
+        "claygl": "^1.2.1",
+        "zrender": "^5.1.1"
+      },
+      "peerDependencies": {
+        "echarts": "^5.1.2"
+      }
+    },
     "node_modules/echarts-wordcloud": {
       "version": "2.1.0",
       "resolved": "https://registry.npmmirror.com/echarts-wordcloud/-/echarts-wordcloud-2.1.0.tgz",
@@ -20112,6 +20130,11 @@
         }
       }
     },
+    "claygl": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/claygl/-/claygl-1.3.0.tgz",
+      "integrity": "sha512-+gGtJjT6SSHD2l2yC3MCubW/sCV40tZuSs5opdtn79vFSGUgp/lH139RNEQ6Jy078/L0aV8odCw8RSrUcMfLaQ=="
+    },
     "clean-css": {
       "version": "5.3.3",
       "resolved": "https://registry.npmmirror.com/clean-css/-/clean-css-5.3.3.tgz",
@@ -21253,6 +21276,15 @@
         "zrender": "5.5.0"
       }
     },
+    "echarts-gl": {
+      "version": "2.0.9",
+      "resolved": "https://registry.npmmirror.com/echarts-gl/-/echarts-gl-2.0.9.tgz",
+      "integrity": "sha512-oKeMdkkkpJGWOzjgZUsF41DOh6cMsyrGGXimbjK2l6Xeq/dBQu4ShG2w2Dzrs/1bD27b2pLTGSaUzouY191gzA==",
+      "requires": {
+        "claygl": "^1.2.1",
+        "zrender": "^5.1.1"
+      }
+    },
     "echarts-wordcloud": {
       "version": "2.1.0",
       "resolved": "https://registry.npmmirror.com/echarts-wordcloud/-/echarts-wordcloud-2.1.0.tgz",

+ 9 - 0
src/api/vis/productionDailyDashboard.js

@@ -34,4 +34,13 @@ export async function queryTeamListByCurrentUserid() {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
+}
+
+// 所有班组
+export async function queryTeamListAll(params) {
+  const res = await request.get(`/main/team/page`, {params});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 22 - 10
src/views/bpm/vis-page/productionDailyDashboard.vue

@@ -19,7 +19,7 @@
                 v-for="item in teamList"
                 :key="item.id"
                 :label="item.name"
-                :value="item.id"
+                :value="item.value"
               >
               </el-option>
             </el-select>
@@ -316,7 +316,7 @@
 <script>
 import { component as VueFullscreen } from 'vue-fullscreen';
 import { toggleFullscreen } from 'ele-admin';
-import { getTeamProductionDayDataOne, getTeamProductionDayDataThree, getTeamProductionDayDataTwo, queryTeamListByCurrentUserid } from '@/api/vis/productionDailyDashboard';
+import { getTeamProductionDayDataOne, getTeamProductionDayDataThree, getTeamProductionDayDataTwo, queryTeamListAll } from '@/api/vis/productionDailyDashboard';
 // 导入图表组件
 import ChartCard from './components/ChartCard';
 import ProcessPersonnelChart from './components/charts/ProcessPersonnelChart';
@@ -453,21 +453,33 @@ export default {
   methods: {
     // 查询当前用户所属班组
     queryTeamList() {
-      queryTeamListByCurrentUserid().then((res) => {
-        console.log(res);
+      queryTeamListAll({
+        pageNum: 1,
+        pageSize: 1000
+      }).then((res) => {
+        console.log(res.list);
         // if (res) {
-        if (!res ||res.length == 0) {
+        if (!res || res.list.length == 0) {
           this.$message({
             message: '当前用户没有所属班组',
             type: 'warning'
           });
           return;
         }
-        this.teamList = res;
-        this.teamId = res[0].id;
-        this.getTeamProductionDayDataOneData();
-        this.getTeamProductionDayDataTwoData();
-        this.getTeamProductionDayDataThreeData();
+        this.teamList = res.list.map(item => {
+          return {
+            name: item.name,
+            value: item.id
+          }
+        });
+        console.log('teamList~~~', this.teamList);
+
+        this.teamId = this.teamList[0].value;
+        console.log('teamId~~~', this.teamId);
+        this.changeTeam();
+        // this.getTeamProductionDayDataOneData();
+        // this.getTeamProductionDayDataTwoData();
+        // this.getTeamProductionDayDataThreeData();
       }).catch((error) => {
         console.error('获取班组列表失败:', error);
       });

File diff suppressed because it is too large
+ 936 - 773
yarn.lock


Some files were not shown because too many files changed in this diff