Переглянути джерело

打印修改&&大屏bug修改

dengrui 2 місяців тому
батько
коміт
30f79ab14a

+ 71 - 21
src/views/plan/requisition/print.vue

@@ -15,49 +15,61 @@
               <div class="leftItem">
                 <div>
                   <div class="lable">物料编码:</div>
-                  <div class="value">
-                    <div class="value">{{ item.materialCode }}</div>
-                  </div>
+                  <template v-if="item.materialCode.length > 15">
+                    <div class="value">
+                      {{ item.materialCode.slice(0, 14) }}
+                    </div>
+                    <div class="value">
+                      {{
+                        item.materialCode.length > 30
+                          ? item.materialCode.slice(15, 26) + "..."
+                          : item.materialCode.slice(15)
+                      }}
+                    </div>
+                  </template>
+                  <template v-else>
+                    <div class="value">
+                      {{ item.materialCode }}
+                    </div>
+                  </template>
                 </div>
                 <div>
                   <div class="lable">物料名称:</div>
-
                   <template v-if="item.materialName.length > 15">
                     <div class="value">
-                      {{ item.materialName.slice(0, 13) }}
+                      {{ item.materialName.slice(0, 14) }}
                     </div>
                     <div class="value">
                       {{
                         item.materialName.length > 30
-                          ? item.materialName.slice(14, 24) + "..."
-                          : item.materialName.slice(14)
+                          ? item.materialName.slice(15, 26) + "..."
+                          : item.materialName.slice(15)
                       }}
                     </div>
                   </template>
                   <template v-else>
                     <div class="value">
-                      <div class="value">{{ item.materialName }}</div>
+                      {{ item.materialName }}
                     </div>
                   </template>
                 </div>
                 <div>
                   <div class="lable">物料批次:</div>
-
                   <template v-if="item.applyCode.length > 15">
                     <div class="value">
-                      {{ item.applyCode.slice(0, 13) }}
+                      {{ item.applyCode.slice(0, 14) }}
                     </div>
                     <div class="value">
                       {{
                         item.applyCode.length > 30
-                          ? item.applyCode.slice(14, 24) + "..."
-                          : item.applyCode.slice(14)
+                          ? item.applyCode.slice(15, 26) + "..."
+                          : item.applyCode.slice(15)
                       }}
                     </div>
                   </template>
                   <template v-else>
                     <div class="value">
-                      <div class="value">{{ item.applyCode }}</div>
+                      {{ item.applyCode }}
                     </div>
                   </template>
                 </div>
@@ -90,27 +102,63 @@
             <div class="leftItem">
               <div>
                 <div class="lable">物料编码:</div>
-
                 <template v-if="item.materialCode.length > 15">
                   <div class="value">
-                    {{ item.materialCode.slice(0, 13) }}
+                    {{ item.materialCode.slice(0, 14) }}
                   </div>
                   <div class="value">
                     {{
                       item.materialCode.length > 30
-                        ? item.materialCode.slice(14, 24) + "..."
-                        : item.materialCode.slice(14)
+                        ? item.materialCode.slice(15, 26) + "..."
+                        : item.materialCode.slice(15)
                     }}
                   </div>
                 </template>
+                <template v-else>
+                  <div class="value">
+                    {{ item.materialCode }}
+                  </div>
+                </template>
               </div>
               <div>
                 <div class="lable">物料名称:</div>
-                <div class="value">{{ item.materialName }}</div>
+                <template v-if="item.materialName.length > 15">
+                  <div class="value">
+                    {{ item.materialName.slice(0, 14) }}
+                  </div>
+                  <div class="value">
+                    {{
+                      item.materialName.length > 30
+                        ? item.materialName.slice(15, 26) + "..."
+                        : item.materialName.slice(15)
+                    }}
+                  </div>
+                </template>
+                <template v-else>
+                  <div class="value">
+                    {{ item.materialName }}
+                  </div>
+                </template>
               </div>
               <div>
                 <div class="lable">物料批次:</div>
-                <div class="value">{{ item.applyCode }}</div>
+                <template v-if="item.applyCode.length > 15">
+                  <div class="value">
+                    {{ item.applyCode.slice(0, 14) }}
+                  </div>
+                  <div class="value">
+                    {{
+                      item.applyCode.length > 30
+                        ? item.applyCode.slice(15, 26) + "..."
+                        : item.applyCode.slice(15)
+                    }}
+                  </div>
+                </template>
+                <template v-else>
+                  <div class="value">
+                    {{ item.applyCode }}
+                  </div>
+                </template>
               </div>
               <div>
                 <div class="lable">物料数量:</div>
@@ -173,8 +221,9 @@ const printPage = () => {
     justify-content: space-between;
     margin-bottom: 10px;
     border-radius: 16px;
+    font-size: 3.5mm;
     .leftItem {
-      width: 30mm;
+      width: 31mm;
       display: flex;
       flex-direction: column;
       justify-content: space-evenly;
@@ -215,8 +264,9 @@ const printPage = () => {
     height: 60mm !important;
     display: flex;
     justify-content: space-between;
+    font-size: 3.5mm;
     .leftItem {
-      width: 30mm;
+      width: 31mm;
       height: 60mm !important;
       display: flex;
       flex-direction: column;

+ 5 - 2
src/views/report/statistics/screens/line3D/index.vue

@@ -151,11 +151,11 @@ const scrollbarRef2 = ref(null);
 const modelRef = ref(null);
 const autoView = () => {
   aotuStatus.value = true;
-  modelRef.value.start();
+  modelRef.value.startFnc();
 };
 const returnView = () => {
   aotuStatus.value = false;
-  modelRef.value.down();
+  modelRef.value.downFnc();
 };
 
 const deviceArray = ref([
@@ -437,6 +437,9 @@ setTimeout(() => {
     ShowScrollRef2.value.setActive();
   });
 }, 3000);
+onMounted(() => {
+  modelRef.value.startFnc();
+});
 </script>
 
 <style lang="scss" scoped>

+ 27 - 11
src/views/report/statistics/screens/line3D/middle3D.vue

@@ -21,6 +21,7 @@ const cameraYVal = ref(12);
 const cameraXVal = ref(20);
 //相机z轴高度
 const cameraZVal = ref(8);
+const animateArray = ref([]);
 const modleColor = ref({
   online: "0x06ffa5",
   outline: "0xdb4848",
@@ -32,18 +33,28 @@ const getInfoArray = async () => {
 };
 
 const init3D = () => {
-  let internval = null;
+  let internval = ref(null);
+  let firstTimeout = ref(null);
+  let itemTimeoutArray = ref([]);
   //巡航函数
   const start = () => {
-    console.log("111");
-    // animateCamera();
-    // internval = setInterval(() => {
-    //   animateCamera();
-    // }, 30000);
+    firstTimeout.value = setTimeout(() => {
+      animateCamera();
+    }, 0);
+    internval.value = setInterval(() => {
+      animateCamera();
+    }, 30000);
   };
   //停止巡航
   const down = () => {
-    clearInterval(interval);
+    clearInterval(internval.value);
+    clearTimeout(firstTimeout.value);
+    itemTimeoutArray.value.forEach((item) => clearTimeout(item));
+    animateArray.value.forEach((item) => {
+      item.kill();
+    });
+    camera.position.set(0, 15, 8);
+    camera.lookAt(0, 0, 0);
   };
   //创建场景
   const scene = new THREE.Scene();
@@ -213,7 +224,7 @@ const init3D = () => {
   }
   //单个巡航实现函数
   function timeout(time, option, i) {
-    setTimeout(() => {
+    const itemTimeout = setTimeout(() => {
       camera.position.set(
         cameraPositions[i].reset.x,
         cameraYVal.value,
@@ -228,8 +239,10 @@ const init3D = () => {
       const tl = gsap.timeline({
         defaults: { ease: "linear" },
       });
+      animateArray.value.push(tl);
       tl.to(camera.position, option);
     }, time);
+    itemTimeoutArray.value.push(itemTimeout);
   }
   //车间巡航动画
   function animateCamera() {
@@ -275,9 +288,12 @@ defineExpose({ startFnc, downFnc });
 onMounted(() => {
   getInfoArray();
   const { start, down } = init3D();
-  startFnc.value = start;
-  downFnc.value = down;
-  console.log(startFnc.value);
+  startFnc.value = () => {
+    start();
+  };
+  downFnc.value = () => {
+    down();
+  };
 });
 </script>