Browse Source

看板--成型看板机台展示增加自动播放翻页

xiaost 1 year ago
parent
commit
db33fa5ee6

+ 36 - 15
package-lock.json

@@ -11,6 +11,7 @@
         "@jiaminghi/data-view": "^2.7.3",
         "@types/echarts": "^4.4.3",
         "axios": "^1.3.5",
+        "caniuse-lite": "^1.0.30001610",
         "core-js": "^3.6.4",
         "crypto-js": "^4.2.0",
         "echarts": "^4.6.0",
@@ -18,9 +19,12 @@
         "js-cookie": "^3.0.5",
         "less": "^4.1.3",
         "less-loader": "^6.0.0",
+        "swiper": "^3.4.2",
         "vue": "^2.6.11",
         "vue-awesome": "^4.0.2",
+        "vue-awesome-swiper": "^2.6.7",
         "vue-router": "^3.1.5",
+        "vue-seamless-scroll": "^1.1.23",
         "vuex": "^3.1.2"
       },
       "devDependencies": {
@@ -4353,21 +4357,9 @@
       }
     },
     "node_modules/caniuse-lite": {
-      "version": "1.0.30001456",
-      "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001456.tgz",
-      "integrity": "sha512-XFHJY5dUgmpMV25UqaD4kVq2LsiaU5rS8fb0f17pCoXQiQslzmFgnfOxfvo1bTpTqf7dwG/N/05CnLCnOEKmzA==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "opencollective",
-          "url": "https://opencollective.com/browserslist"
-        },
-        {
-          "type": "tidelift",
-          "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
-        }
-      ],
-      "license": "CC-BY-4.0"
+      "version": "1.0.30001610",
+      "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001610.tgz",
+      "integrity": "sha512-QFutAY4NgaelojVMjY63o6XlZyORPaLfyMnsl3HgnWdJUcX6K0oaJymHjH8PT5Gk7sTm8rvC/c5COUQKXqmOMA=="
     },
     "node_modules/case-sensitive-paths-webpack-plugin": {
       "version": "2.4.0",
@@ -4991,6 +4983,11 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/comutils": {
+      "version": "1.1.19",
+      "resolved": "https://registry.npmmirror.com/comutils/-/comutils-1.1.19.tgz",
+      "integrity": "sha512-JxXB67juILiwhdLwOsYyjUqwWEhHdObI0EClOPk+JDtEuTbac59s0pxGpfCBnNNQ5JommifmcMGneW/4Cg7YWw=="
+    },
     "node_modules/concat-map": {
       "version": "0.0.1",
       "resolved": "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz",
@@ -14810,6 +14807,14 @@
         "boolbase": "~1.0.0"
       }
     },
+    "node_modules/swiper": {
+      "version": "3.4.2",
+      "resolved": "https://registry.npmmirror.com/swiper/-/swiper-3.4.2.tgz",
+      "integrity": "sha512-bXolyzBIawQRluQwFbN8DYpe6Q02bKJ2/h4JV+6dzN/WX8a8ZFPa+F0o8z7hEHSyh2NzKkTWaogaTZYVfgmKTw==",
+      "engines": {
+        "node": ">= 4.7.0"
+      }
+    },
     "node_modules/table": {
       "version": "5.4.6",
       "resolved": "https://registry.npmmirror.com/table/-/table-5.4.6.tgz",
@@ -15926,6 +15931,14 @@
         "vue": "^2.4.0"
       }
     },
+    "node_modules/vue-awesome-swiper": {
+      "version": "2.6.7",
+      "resolved": "https://registry.npmmirror.com/vue-awesome-swiper/-/vue-awesome-swiper-2.6.7.tgz",
+      "integrity": "sha512-kUmCds5HTcV9Uz0eYnvajbxpVgAKQFrX0r+akk8XtuUouI5e2ImhO7aZ8iVhTLE4hwKwoyFP8jekAa0JlNqifA==",
+      "dependencies": {
+        "swiper": "^3.4.2"
+      }
+    },
     "node_modules/vue-eslint-parser": {
       "version": "7.11.0",
       "resolved": "https://registry.npmmirror.com/vue-eslint-parser/-/vue-eslint-parser-7.11.0.tgz",
@@ -16124,6 +16137,14 @@
       "integrity": "sha512-VYXZQLtjuvKxxcshuRAwjHnciqZVoXAjTjcqBTz4rKc8qih9g9pI3hbDjmqXaHdgL3v8pV6P8Z335XvHzESxLQ==",
       "license": "MIT"
     },
+    "node_modules/vue-seamless-scroll": {
+      "version": "1.1.23",
+      "resolved": "https://registry.npmmirror.com/vue-seamless-scroll/-/vue-seamless-scroll-1.1.23.tgz",
+      "integrity": "sha512-HBjUub8WwsKJzbFCrwKPDrZn4e+SSbkKgwWtjKtfLwesiFGwSsVxP44/Z6d3kpXy94qIFOiflJH6l0/9pj7SGA==",
+      "dependencies": {
+        "comutils": "^1.1.9"
+      }
+    },
     "node_modules/vue-style-loader": {
       "version": "4.1.3",
       "resolved": "https://registry.npmmirror.com/vue-style-loader/-/vue-style-loader-4.1.3.tgz",

+ 6 - 2
package.json

@@ -3,14 +3,15 @@
   "version": "1.5.1",
   "private": true,
   "scripts": {
-    "serve": "vue-cli-service serve",
-    "build": "vue-cli-service build",
+    "serve": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
+    "build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
     "@jiaminghi/data-view": "^2.7.3",
     "@types/echarts": "^4.4.3",
     "axios": "^1.3.5",
+    "caniuse-lite": "^1.0.30001610",
     "core-js": "^3.6.4",
     "crypto-js": "^4.2.0",
     "echarts": "^4.6.0",
@@ -18,9 +19,12 @@
     "js-cookie": "^3.0.5",
     "less": "^4.1.3",
     "less-loader": "^6.0.0",
+    "swiper": "^3.4.2",
     "vue": "^2.6.11",
     "vue-awesome": "^4.0.2",
+    "vue-awesome-swiper": "^2.6.7",
     "vue-router": "^3.1.5",
+    "vue-seamless-scroll": "^1.1.23",
     "vuex": "^3.1.2"
   },
   "devDependencies": {

+ 1 - 1
src/components/officechart/bottom1Chart/chart.vue

@@ -88,7 +88,7 @@ export default {
             }
           },
           {
-            name: '率%',
+            name: '完成率%',
             type: 'line',
             data:[],
             yAxisIndex: 1,

+ 2 - 2
src/components/officechart/up1Chart/chart.vue

@@ -3,8 +3,8 @@
     <Echart
         :options="options"
         id="up1Chart"
-        height="200px"
-        width="260px"
+        height="235px"
+        width="310px"
     ></Echart>
   </div>
 </template>

+ 3 - 1
src/main.js

@@ -18,7 +18,8 @@ import 'vue-awesome/icons/align-left.js';
 import echarts from 'echarts'
 import ElementUI from 'element-ui';
 
-import Cookies from 'js-cookie'
+import Cookies from 'js-cookie';
+import  scroll from 'vue-seamless-scroll';
 
 //5.x 引用方式为按需引用
 //希望使用5.x版本的话,需要在package.json中更新版本号,并切换引用方式
@@ -31,6 +32,7 @@ Vue.prototype.$cookie = Cookies;
 Vue.component('icon', Icon);
 Vue.use(dataV);
 Vue.use(ElementUI);
+Vue.use(scroll);
 
 router.beforeEach((to, from, next) => {
   /**

+ 88 - 31
src/views/cx/bottom.vue

@@ -1,56 +1,83 @@
 <template>
   <div id="bottom">
-      <div class="listdata">
-          <div class="item "  v-for="item in devicedata" :key="item"> <!--:key="item.dl_id"-->
+      <swiper class="listdata swiper" :options="swiperOption"  ref="mySwiper">
+          <swiper-slide  class="listdata" v-for="i in sreencount" :key="i"> <!--:key="item.dl_id"-->
+            <div class="item " v-for="item in devicedata.slice(32*(i-1), 32*i)" :key="item.dl_id"> <!--:key="item.dl_id"-->
               <div class="bg-color-black" >
-                  <div v-if="item?.dl_id">
-                    <div style=" color: #29dd70; font-size: 22px;">机台 {{ item.de_location }}
-                      <span class="fs-sm">&nbsp;&nbsp; &nbsp;{{item.status}} </span>
-                    </div>
-                      <div class="fs-xs inlineshow" >模具:{{ item.dl_mouldcode }}</div>
-                      <div class="fs-xs">作业员:{{ item.dl_inman }}</div>
-                      <div class="fs-xs"> 开始时间:{{ item.dl_indate }}</div>
-                      <div class="fs-xs">工单:{{ item.dl_macode }} </div>
-                      <div class="fs-xs">产品:{{ item.ma_prodcode }} </div>
-                      <div class ="circled">
-                          <div class ="circleitem" style="padding-top: 10px;">
-                              <div class="fs-xs">工单数:{{ item.ma_qty }} </div>
-                              <div class="fs-xs">完成数:{{ item.outqty }}</div>
-                          </div>
-                          <div  class ="circleitem" >
-                             <CircleChart :tips="item.rate" :id="item.id"/>
-                          </div>
-                      </div>
+                <div v-if="item.dl_id>0">
+                  <div style=" color: #29dd70; font-size: 22px;">机台 {{ item.de_location }}
+                    <span class="fs-sm">&nbsp;&nbsp; &nbsp;{{item.status}} </span>
                   </div>
-                  <div v-else="" class="nodataitem">
-                      <span class=" display: block;"> 无数据</span>
+                  <div class="fs-xs inlineshow" >模具:{{ item.dl_mouldcode }}</div>
+                  <div class="fs-xs">作业员:{{ item.dl_inman }}</div>
+                  <div class="fs-xs"> 开始时间:{{ item.dl_indate }}</div>
+                  <div class="fs-xs">工单:{{ item.dl_macode }} </div>
+                  <div class="fs-xs">产品:{{ item.ma_prodcode }} </div>
+                  <div class ="circled">
+                    <div class ="circleitem" style="padding-top: 10px;">
+                      <div class="fs-xs">工单数:{{ item.ma_qty }} </div>
+                      <div class="fs-xs">完成数:{{ item.outqty }}</div>
+                    </div>
+                    <div  class ="circleitem" >
+                      <CircleChart :tips="item.rate" :id="item.id"/>
+                    </div>
                   </div>
+                </div>
+                <div v-else="" class="nodataitem">
+<!--                  <span class=" display: block;"> 无数据</span>-->
+                </div>
               </div>
-          </div>
-      </div>
+            </div>
+          </swiper-slide>
+        <div class="swiper-pagination" slot="pagination"></div>
+       </swiper>
+
   </div>
 </template>
 
 <script>
-    import CircleChart from '@/components/cxchart/bottom'
+    import CircleChart from '@/components/cxchart/bottom';
+    import { swiper, swiperSlide } from 'vue-awesome-swiper';
+    import 'swiper/dist/css/swiper.css';
   export default {
     data() {
       return {
           devicedata:[],
+          swiperOption: {
+            direction: 'vertical',
+            slidesPerView: 1,
+            spaceBetween: 0,
+            autoplay:7000,
+            autoplayDisableOnInteraction:false,
+            pagination: '.swiper-pagination',
+            paginationClickable: true,
+            //loop: true,
+          },
+        sreencount :1,
+        timing :null
       }
     },
     components: {
-        CircleChart
+        CircleChart,
+         swiper,
+         swiperSlide
     },
     mounted () {
       this.drawTimingFn();
     },
-
+    computed: {
+      mySwiper () {
+        return this.$ref.mySwiper.swiper
+      }
+    },
+    beforeDestroy () {
+      clearInterval(this.timing)
+    },
     methods: {
       drawTimingFn () {
         this.setData();
-        setInterval(() => {
-          this.setData(); //获取-数据
+        this.timing = setInterval(() => {
+          this.setData(); //获取--数据
         }, 30000);
       },
       async setData () {
@@ -62,8 +89,22 @@
          }).then((result)=>{
                   let dataList = JSON.parse(result.data.data);
                   this.devicedata=dataList;
-                  if(dataList.length<32){
+                  if(null != this.devicedata) {
+                    let len = this.devicedata.length;
+                    let cn = Math.ceil(len / 32);
+                    this.sreencount =cn;
+                    let minuscn = cn*32-len;
+                    if(minuscn>0){
+                      let arr = new Array();
+                      for(let i = 1; i<= minuscn; i++) {
+                        let ar1 = [{"dl_id":-1*i}];
+                        arr.push(ar1);
+                      }
+                      this.devicedata = this.devicedata.concat(arr);
+                    }
+                    /* if(dataList.length<32){
                       this.devicedata = this.devicedata.concat(new Array(32-dataList.length));
+                  }*/
                   }
 
               },(result)=>{
@@ -85,10 +126,12 @@
          // font-family: Arial;
         font-weight: bold;
       }
+
      .listdata{
+         width: 1888px;
+         height: $box-height;
          display: flex;
          flex-wrap: wrap;
-        // padding-top:10px;
          justify-content: space-around;
          .item {
              border-radius: 6px;
@@ -118,6 +161,20 @@
                  width: 50%;
              }
          }
+         .swiper-pagination {
+           //height: 10px;
+           ::v-deep .swiper-pagination-bullet{
+             width: 15px;  /* 设置宽度 */
+             height: 15px
+           }
+           ::v-deep .swiper-pagination-bullet{
+             background-color: #FFFFFF;
+           }
+           ::v-deep .swiper-pagination-bullet-active{
+             background-color: #007aff;
+           }
+
+         }
      }
   }
 

+ 4 - 4
src/views/cx/up4.vue

@@ -1,10 +1,10 @@
 <template>
   <div id="up4">
       <div class="bg-color-black">
-          <div class="d-flex pt-2 pl-2">
-        <span>
-          <icon name="chart-line" class="text-icon"></icon>
-        </span>
+          <div class="d-flex pt-2 pl-2" style=" margin-left: auto;margin-right: auto;width: 30%;">
+            <span>
+              <icon name="chart-line" class="text-icon"></icon>
+            </span>
               <div class="d-flex">
                   <span class="fs-xl text mx-2">计划完成进度</span>
               </div>

+ 21 - 5
src/views/office/center.vue

@@ -16,13 +16,17 @@
       </div>
     </div>
     <div class="down">
-      <div class="ranking bg-color-black">
+      <div class="body-box">
+        <span class="fs-xl text mx-2"> &nbsp;&nbsp;&nbsp;&nbsp; 车间投产良率分析</span>
+        <up1Chart />
+      </div>
+      <!--<div class="ranking bg-color-black">
         <span>
           <icon name="chart-pie" class="text-icon"></icon>
         </span>
         <span class="fs-xl text mx-2 mb-1 pl-3">当日产品良率分析</span>
         <dv-scroll-ranking-board class="dv-scr-rank-board mt-1" :config="ranking" ref="scroll-ranking-board"/>
-      </div>
+      </div>-->
       <div class="percent">
         <div class="item bg-color-black">
           <span>首检合格率</span>
@@ -50,6 +54,7 @@
 
 <script>
 import CenterChart from '@/components/officechart/centerChart'
+import up1Chart from "_c/officechart/up1Chart/index.vue";
 
 export default {
   data() {
@@ -101,6 +106,7 @@ export default {
     }
   },
   components: {
+    up1Chart,
     CenterChart
   },
   mounted () {
@@ -148,7 +154,7 @@ export default {
                       }
               );
       //7天内产品良率
-      await this.$http.get("kanban/datalist.action?caller=KB!Office!KeyStepRate&_noc=1&page=1&pageSize=100",{
+      /*await this.$http.get("kanban/datalist.action?caller=KB!Office!KeyStepRate&_noc=1&page=1&pageSize=100",{
         params: {
           condition: "1=1",
         }
@@ -168,11 +174,11 @@ export default {
                          const scrollBoard = this.$refs['scroll-ranking-board'];
                          scrollBoard.updateRows(datas);
                          this.ranking = { data: datas }
-                         */
+
                       },(result)=>{
                         console.error(result)
                       }
-              );
+              );*/
       //饼图pie,首检合格率,巡检合格率
       await this.$http.get("kanban/datalist.action?caller=PieCheckRate&_noc=1&page=1&pageSize=100",{
         params: {
@@ -237,6 +243,16 @@ export default {
     .bg-color-black {
       border-radius: 5px;
     }
+    .body-box {
+      border-radius: 10px;
+      overflow: hidden;
+      width: 59%;
+      .dv-cap-chart {
+        width: 100%;
+        height: 210px;
+        text-align:left;
+      }
+    }
     .ranking {
       padding: 5px;
       width: 59%;

+ 55 - 6
src/views/office/up1.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="up1">
     <div class="bg-color-black">
+      <!--
       <div class="d-flex pt-2 pl-2">
         <span>
           <icon name="align-left" class="text-icon"></icon>
@@ -12,12 +13,20 @@
         <span class="fs-xl text mx-2">车间投产良率分析</span>
         <up1Chart />
       </div>
+      -->
+      <div class="ranking">
+        <span>
+          <icon name="chart-pie" class="text-icon"></icon>
+        </span>
+        <span class="fs-xl text mx-2 mb-1 pl-3">当日产品良率分析</span>
+        <dv-scroll-ranking-board class="dv-scr-rank-board mt-1" :config="ranking" ref="scroll-ranking-board"/>
+      </div>
     </div>
   </div>
 </template>
 
 <script>
-import up1Chart from '@/components/officechart/up1Chart'
+//import up1Chart from '@/components/officechart/up1Chart'
 
 export default {
   data() {
@@ -26,10 +35,15 @@ export default {
         data: [],
        // unit: 'W'
       },
-      timing :null
+      timing :null,
+      ranking: {
+        data: [],
+        carousel: 'single',
+        rowNum: 6,
+      },
     }
   },
-  components: { up1Chart },
+  //components: { up1Chart },
   mounted() {
     this.refreshdata();
   },
@@ -65,6 +79,33 @@ export default {
                 console.error(result)
               }
           );
+
+      //当日产品良率
+      await this.$http.get("kanban/datalist.action?caller=KB!Office!KeyStepRate&_noc=1&page=1&pageSize=100",{
+        params: {
+          condition: "1=1",
+        }
+      }).then((result)=>{
+            let dataList = JSON.parse(result.data.data);
+            let datas = new Array();
+            for (let index = 0; index < dataList.length; index++) {
+              const element = dataList[index];
+              datas.push({
+                name:element.name ,
+                value:element.value,
+              });
+            }
+            this.ranking.data = datas;
+            this.ranking = { ...this.ranking };
+            /*两种刷新方式
+             const scrollBoard = this.$refs['scroll-ranking-board'];
+             scrollBoard.updateRows(datas);
+             this.ranking = { data: datas }
+             */
+          },(result)=>{
+            console.error(result)
+          }
+      );
     }
   }
 }
@@ -79,10 +120,18 @@ export default {
   width: $box-width;
   border-radius: 5px;
   .bg-color-black {
-    height: $box-height - 10px;
-    width: $box-width;
+    height: $box-height - 20px;
+    width: $box-width - 10px;
     border-radius: 10px;
-    padding: 0px 5px 0px 0px;
+    padding: 5px 5px 5px 5px;
+  }
+  .ranking {
+    padding: 5px;
+    .dv-scr-rank-board {
+      padding-top: 5px;
+      height: 350px;
+      width:270px
+    }
   }
   .text {
     color: #c3cbde;

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


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