Browse Source

Merge branch 'master' of http://192.168.101.4:3000/jiaxiaoqiang/JG-CLIENT-TEMP

dy 1 year ago
parent
commit
a0e7a28a3d

+ 9 - 0
src/api/process/reportBreak.ts

@@ -43,3 +43,12 @@ export function reportWorkList(id: string) {
     data: { processId: id },
   });
 }
+
+//图纸管理列表查询
+export function drawingList(data: object) {
+  return request({
+    url: `/api/v1/base/drawing/list`,
+    method: "post",
+    data: data,
+  });
+}

+ 45 - 0
src/components/PDFView/index.vue

@@ -0,0 +1,45 @@
+<template>
+  <VuePdfEmbed
+    :source="pdfSource"
+    annotation-layer
+    text-layer
+    @click="showPdf"
+  />
+  <el-drawer
+    v-model="visible"
+    :footer="false"
+    :header="false"
+    :show-close="false"
+    destroy-on-close
+    direction="rtl"
+    size="972px"
+  >
+    <VuePdfEmbed :source="pdfSource" annotation-layer text-layer />
+  </el-drawer>
+</template>
+
+<script lang="ts" setup>
+import VuePdfEmbed from "vue-pdf-embed";
+// essential styles
+import "vue-pdf-embed/dist/style/index.css";
+
+// optional styles
+import "vue-pdf-embed/dist/style/annotationLayer.css";
+import "vue-pdf-embed/dist/style/textLayer.css";
+
+// either URL, Base64, binary, or document proxy
+const props = defineProps({
+  pdfSource: {
+    type: String,
+    required: true,
+  },
+});
+
+const visible = ref(false);
+
+const showPdf = () => {
+  visible.value = true;
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 28 - 4
src/layout/components/header.vue

@@ -1,17 +1,29 @@
 <template>
   <div class="commonHeader">
     <div style="width: 155px">
-      <svg-icon v-if="routeMeta.back" icon-class="back" size="48" @click="commonBack" />
+      <svg-icon
+        v-if="routeMeta.back"
+        icon-class="back"
+        size="48"
+        @click="commonBack"
+      />
       <svg-icon v-else icon-class="LOGO" style="height: 48px; width: 155px" />
     </div>
-    <div>
+    <div v-if="routeMeta.back && routeMeta.title" class="middle-title">
+      {{ routeMeta.title }}
+    </div>
+    <div v-else>
       <div class="date">{{ date }}</div>
       <div class="time">{{ time }}</div>
     </div>
     <div>
       <el-space>
         <div class="task">
-          <el-progress :percentage="processCount" :show-text="false" :stroke-width="10" />
+          <el-progress
+            :percentage="processCount"
+            :show-text="false"
+            :stroke-width="10"
+          />
           <div class="process">任务进度: {{ processCount }}%</div>
         </div>
         <div>
@@ -19,7 +31,11 @@
           <div class="work">gongwei</div>
         </div>
 
-        <el-dropdown ref="dropdown1" trigger="contextmenu" @command="handleCommand">
+        <el-dropdown
+          ref="dropdown1"
+          trigger="contextmenu"
+          @command="handleCommand"
+        >
           <img v-if="headUrl" :src="headUrl" alt="" @click="showClick" />
           <svg-icon v-else icon-class="head" size="48" @click="showClick" />
           <template #dropdown>
@@ -93,6 +109,14 @@ const handleCommand = (command: string | number | object) => {
   padding: 16px 24px;
   //border: 1px solid red;
 
+  .middle-title {
+    font-weight: 500;
+    font-size: 38px;
+    color: rgba(0, 0, 0, 0.9);
+    line-height: 24px;
+    text-align: center;
+  }
+
   .date {
     font-weight: 500;
     font-size: 14px;

+ 11 - 1
src/router/index.ts

@@ -43,7 +43,7 @@ export const constantRoutes: RouteRecordRaw[] = [
         component: () => import("@/views/pro-steps/index.vue"),
         name: "ProSteps",
         meta: {
-          title: "pro-steps",
+          title: "",
           icon: "homepage",
           keepAlive: true,
           back: true,
@@ -143,6 +143,16 @@ export const constantRoutes: RouteRecordRaw[] = [
           back: true,
         },
       },
+      {
+        path: "drawing",
+        component: () => import("@/views/pro-operation/drawing/index.vue"),
+        name: "drawing-list",
+        meta: {
+          title: "图纸",
+          icon: "homepage",
+          back: true,
+        },
+      },
     ],
   },
 

+ 2 - 2
src/store/modules/dictionary.ts

@@ -4,7 +4,7 @@ import { getUserDicts, getUserList } from "@/api/auth";
 
 export const useDictionaryStore = defineStore("dictionaryStore", () => {
   const types = ["unqualified_type", "stage", "process_state"];
-  const dicts = ref<{ string?: any[] }>({});
+  const dicts = ref<{ [key: string]: any[] }>({});
 
   // 所有的用户列表
   const allUsers = ref<any[]>([]);
@@ -28,7 +28,7 @@ export const useDictionaryStore = defineStore("dictionaryStore", () => {
   function getLableByValue(type: string, value: string) {
     const dict = dicts.value[type];
     if (dict) {
-      const lable = dict.find((item: string) => item.dictValue === value);
+      const lable = dict.find((item: any) => item.dictValue === value);
       return lable?.dictLabel;
     }
     return "";

+ 8 - 0
src/views/pro-operation/call-materiel/complete-suit.vue

@@ -4,6 +4,7 @@
       <div v-for="(box, index) in merterielBoxes" :key="index" class="suit-box">
         <div class="suit-title">{{ box.title }}短发的</div>
         <div class="suit-desc">{{ box.desc }}对待</div>
+        <svg-icon class="svgStyle" icon-class="jiaobiao" size="25" />
       </div>
     </div>
   </el-scrollbar>
@@ -51,6 +52,7 @@ const merterielBoxes = ref<any>([
     flex-direction: column;
     align-items: start;
     justify-content: center;
+    position: relative;
 
     .suit-title {
       font-weight: 500;
@@ -64,6 +66,12 @@ const merterielBoxes = ref<any>([
       color: rgba(0, 0, 0, 0.6);
       text-align: left;
     }
+
+    .svgStyle {
+      position: absolute;
+      bottom: 0;
+      right: 0;
+    }
   }
 }
 </style>

+ 76 - 0
src/views/pro-operation/drawing/index.vue

@@ -0,0 +1,76 @@
+<template>
+  <el-scrollbar>
+    <div class="grid-container">
+      <div v-for="(box, index) in drawingData" :key="index" class="suit-box">
+        <div class="pdf-box">
+          <PDFView :pdf-source="box.drawingPath" />
+        </div>
+        <div class="suit-title">{{ box?.drawingTitle }}</div>
+        <!--        <div class="suit-desc">{{ box?.desc }}对待</div>-->
+      </div>
+    </div>
+  </el-scrollbar>
+</template>
+
+<script lang="ts" setup>
+import { drawingList } from "@/api/process/reportBreak";
+import { useProcessStore } from "@/store/modules/processView";
+import PDFView from "@/components/PDFView/index.vue";
+
+const processStore = useProcessStore();
+const drawingData = ref<any>([]);
+
+onMounted(() => {
+  drawingList({ materialCode: processStore.scanInfo.materialCode }).then(
+    (res) => {
+      drawingData.value = res.data;
+    }
+  );
+});
+</script>
+
+<style lang="scss" scoped>
+.grid-container {
+  display: grid;
+  /*行间距*/
+  grid-row-gap: 24px;
+  /*列间距*/
+  grid-column-gap: 24px;
+
+  overflow-y: auto;
+  padding: 24px;
+  width: calc(100% - 48px);
+  grid-template-columns: 1fr 1fr 1fr;
+
+  .suit-box {
+    height: 343px;
+    background-color: white;
+    border-radius: 16px 16px 16px 16px;
+    display: flex;
+    flex-direction: column;
+    align-items: start;
+    justify-content: center;
+
+    .pdf-box {
+      height: 263px;
+      width: 100%;
+      overflow: hidden;
+    }
+
+    .suit-title {
+      font-weight: 500;
+      font-size: 20px;
+      color: rgba(0, 0, 0, 0.9);
+      text-align: left;
+      margin-left: 24px;
+    }
+
+    .suit-desc {
+      font-size: 20px;
+      color: rgba(0, 0, 0, 0.6);
+      text-align: left;
+      margin-left: 24px;
+    }
+  }
+}
+</style>

+ 1 - 0
src/views/pro-steps/components/operates.vue

@@ -43,6 +43,7 @@ const setIndex = (index: number) => {
     case "liuzhuan":
       break;
     case "tuzhi":
+      router.push({ name: "drawing-list" });
       break;
     case "weiwai":
       break;