From cb48add95a233bb950dc3e7bc3cf02cc1cccd934 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 06 十一月 2023 17:56:35 +0800
Subject: [PATCH] Merge branch 'dev' of http://192.168.5.5:10010/r/web/bulletin-board-style1 into wn

---
 /dev/null                                         |  115 ----------------------------
 src/views/dashboard/components/ProcessInfo.vue    |    3 
 src/views/dashboard/components/ProcessingInfo.vue |   22 ++---
 src/views/dashboard/index.vue                     |   72 +++++++++++------
 4 files changed, 56 insertions(+), 156 deletions(-)

diff --git a/src/views/dashboard/components/CraftInfo.vue b/src/views/dashboard/components/CraftInfo.vue
deleted file mode 100644
index 3ebac61..0000000
--- a/src/views/dashboard/components/CraftInfo.vue
+++ /dev/null
@@ -1,115 +0,0 @@
-<template>
-  <div class="craft-info">
-    <div class="item-l-bng">
-      <img src="~@/assets/images/process-model.png" />
-    </div>
-    <div class="item-r">
-      <div class="item-r-t font_weight">{{ process.number }}</div>
-      <div class="item-r-b">{{ process.name }}</div>
-      <div class="item-r-b">{{ process.name }}</div>
-    </div>
-    <div class="tip-r">
-      <img src="~@/assets/images/process-tip.png" alt="" />
-    </div>
-    <div class="tip-current">褰撳墠浣跨敤</div>
-    <div class="btn">
-      <el-button type="primary" class="color_organge"> 鏇存柊宸ヨ壓</el-button>
-    </div>
-  </div>
-</template>
-<script setup lang="ts">
-// 宸ヨ壓淇℃伅
-import { toRefs } from 'vue'
-
-export interface ProcessInfoProps {
-  process: process
-}
-
-const props = defineProps<ProcessInfoProps>()
-const { process } = toRefs(props)
-</script>
-
-<style scoped lang="scss">
-$status-running: #f76c0f;
-$status-done: #2c5dbb82;
-.font_weight {
-  font-weight: 600;
-}
-.craft-info {
-  width: calc(50% - 35px);
-  height: 110px;
-  padding: 23px 10px 10px;
-  background: $status-done;
-  border-radius: 8px;
-  float: left;
-  overflow: hidden;
-  font-size: 15px;
-  position: relative;
-  margin-bottom: 30px;
-
-  &:nth-of-type(odd) {
-    margin-right: 30px;
-  }
-
-  .item-l-bng {
-    width: 40px;
-    float: left;
-    margin-right: 20px;
-
-    img {
-      width: 100%;
-    }
-  }
-
-  .item-r {
-    width: calc(100% - 60px);
-    float: left;
-    line-height: 25px;
-    color: #fff;
-    font-size: 16px;
-    cursor: pointer;
-
-    .item-r-t {
-      font-size: 16px;
-    }
-
-    .item-r-b {
-      font-size: 14px;
-    }
-  }
-
-  .tip-r {
-    position: absolute;
-    top: 5px;
-    right: 15px;
-    width: 20px;
-
-    img {
-      width: 100%;
-    }
-  }
-
-  .tip-current {
-    background: green;
-    color: #fff;
-    position: absolute;
-    top: 0px;
-    left: 70px;
-    width: auto;
-    padding: 2px 15px;
-    font-size: 12px;
-    border-radius: 0px 0px 6px 6px;
-  }
-
-  .btn {
-    width: 100px;
-    position: absolute;
-    right: 0px;
-    bottom: 10px;
-    .el-button--primary {
-      background: $status-running;
-      border: 0 !important;
-    }
-  }
-}
-</style>
diff --git a/src/views/dashboard/components/ProcessInfo.vue b/src/views/dashboard/components/ProcessInfo.vue
index c14bb31..859f890 100644
--- a/src/views/dashboard/components/ProcessInfo.vue
+++ b/src/views/dashboard/components/ProcessInfo.vue
@@ -13,7 +13,6 @@
     </div>
     <div v-if="craftModel.number == task?.Procedure?.processModelNumber" class="tip-current">褰撳墠浣跨敤</div>
     <div class="btn">
-      <!--  -->
       <el-button type="primary" :disabled="craftModel.isUpdate ? false : true" @click="onUpdateClick">
         <el-icon v-if="loading" color="#fff" :size="16" class="refresh-top-icon">
           <Loading />
@@ -79,7 +78,7 @@
   padding: 23px 10px 10px;
   background: $status-done;
   border-radius: 8px;
-  float: left;
+  //float: left;
   overflow: hidden;
   font-size: 15px;
   position: relative;
diff --git a/src/views/dashboard/components/ProcessingInfo.vue b/src/views/dashboard/components/ProcessingInfo.vue
index f29a18e..fe317d6 100644
--- a/src/views/dashboard/components/ProcessingInfo.vue
+++ b/src/views/dashboard/components/ProcessingInfo.vue
@@ -1,14 +1,7 @@
 <template>
   <div class="processing-info">
     <div class="step">
-      <el-steps
-        v-if="task?.AllProcedures"
-        :active="task.CurrentProcedureIndex ?? 0"
-        finish-status="success"
-        class="steps"
-      >
-        <el-step v-for="(item, index) in task.AllProcedures" :key="index" icon="" :title="item"></el-step>
-      </el-steps>
+      <TaskStep :active="task?.CurrentProcedureIndex ?? 0" :steps="task?.AllProcedures ?? []"></TaskStep>
     </div>
     <div class="details">
       <div class="row">
@@ -55,14 +48,12 @@
 <script setup lang="ts">
 // 鍔犲伐淇℃伅缁勪欢
 import type { Task } from '@/api/task'
-import { computed, onUnmounted, toRefs, watch } from 'vue'
+import { computed, toRefs } from 'vue'
 import { useDateFormat } from '@vueuse/core'
-import { useRequest } from 'vue-hooks-plus'
-import { getProductProgress } from '@/api'
-import type { ProductProgressParams } from '@/api'
 import { isNumber } from 'lodash-es'
 import { CHANNEL_NAME_MAP } from '@/common/constants'
 import { usePLCStore } from '@/stores/plc'
+import TaskStep from '@/views/dashboard/components/TaskStep.vue'
 
 const props = defineProps<{
   task?: Task
@@ -133,9 +124,8 @@
 
 .step {
   width: 100%;
-  height: 66px;
+  height: 46px;
   overflow-x: auto;
-  margin-top: -5px;
   padding: 0 20px;
   .steps {
     height: 100%;
@@ -179,8 +169,12 @@
 }
 :deep(.el-progress-bar__outer) {
   border-radius: 8px;
+  background-color: #13235a;
 }
 :deep(.el-progress-bar__inner) {
   border-radius: 8px;
 }
+:deep(.el-step__icon .is-icon) {
+  background-color: transparent;
+}
 </style>
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index e1b8f18..4b3975b 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -7,7 +7,7 @@
       <ChannelCollapse :channels="channels"></ChannelCollapse>
     </template>
     <template #middleBlock1>
-      <DashboardTitle></DashboardTitle>
+      <DashboardTitle @should-reload="reloadAllData"></DashboardTitle>
     </template>
     <template #middleBlock2>
       <el-tabs v-model="activeMainTabName" class="main-info-tabs">
@@ -15,17 +15,33 @@
           <ProcessingInfo style="margin-top: 6px" :task="activeTask"></ProcessingInfo>
         </el-tab-pane>
         <el-tab-pane label="宸ヨ壓淇℃伅" name="宸ヨ壓淇℃伅">
-          <el-scrollbar always>
-            <ProcessInfo
-              v-for="item in craftModelStore.craftModelList"
-              :key="item.ID"
-              :craft-model="item"
-              :task="activeTask"
-              :active-arr="activeArr"
-              @detail="openCraftModelDetailModal"
-              @update="updateCraft"
-            ></ProcessInfo>
-          </el-scrollbar>
+          <div style="height: 300px">
+            <el-scrollbar always style="height: 100%">
+              <div
+                v-infinite-scroll="craftModelStore.loadMore"
+                infinite-scroll-delay="500"
+                infinite-scroll-distance="40"
+                style="display: flex; align-items: center; flex-wrap: wrap"
+              >
+                <ProcessInfo
+                  v-for="item in craftModelStore.craftModelList"
+                  :key="item.ID"
+                  :task="activeTask"
+                  :active-arr="activeArr"
+                  :craft-model="item"
+                  @detail="openCraftModelDetailModal"
+                  @update="updateCraft"
+                ></ProcessInfo>
+              </div>
+              <div class="craft-loaded-tip">
+                <el-icon v-if="craftModelStore.loading" class="is-loading" size="30">
+                  <Loading />
+                </el-icon>
+
+                <div v-if="!craftModelStore.hasMore">鍔犺浇瀹屾垚</div>
+              </div>
+            </el-scrollbar>
+          </div>
         </el-tab-pane>
         <el-tab-pane label="鐗╂枡娓呭崟" name="鐗╂枡娓呭崟">
           <InputMaterialsList
@@ -42,7 +58,7 @@
     <template #middleBlock3>
       <SubTitle>浠诲姟璇︽儏</SubTitle>
       <div class="task-detail">
-        <TaskControl :task="activeTask" @should-reload="reloadAllData"></TaskControl>
+        <TaskControl :task="activeTask" @should-reload="reloadChannel"></TaskControl>
       </div>
       <ColorInfo :type="1"></ColorInfo>
       <ColorInfo :type="2"></ColorInfo>
@@ -77,8 +93,9 @@
   <MaterialDetails v-model="showMaterialDetail" :material="currentMaterialInfo"></MaterialDetails>
 </template>
 <script setup lang="ts">
-import { computed, ref, watch } from 'vue'
+import { computed, ref } from 'vue'
 import ChannelCollapse from '@/views/dashboard/components/ChannelCollapse.vue'
+
 import type { Worker, Order, Task, Material } from '@/api/task'
 import type { CraftModel } from '@/api/craftModel'
 import PersonInfo from '@/views/dashboard/components/PersonInfo.vue'
@@ -104,7 +121,9 @@
 import { useCraftModelStore } from '@/stores/craftModel'
 import CraftDetailModal from '@/views/dashboard/components/CraftDetailModal.vue'
 import MaterialDetails from '@/views/dashboard/components/MaterialDetails.vue'
+
 import { updateCraftParams } from '@/api'
+import { Loading } from '@element-plus/icons-vue'
 
 defineOptions({
   name: 'DashboardView'
@@ -114,14 +133,6 @@
 const taskStore = useTasksStore()
 const workers = computed(() => {
   return taskStore.activeTask?.Procedure?.procedure?.workers ?? []
-})
-
-const order = computed(() => {
-  return {
-    finishNumber: 0,
-    unit: '涓�',
-    amount: '10'
-  } as unknown as Order
 })
 
 const taskTabsList = [
@@ -153,8 +164,12 @@
  * 瀹屾垚浠诲姟鎴栬�呬笅鍙戝弬鏁版垚鍔熷悗瑕佸埛鏂伴�氶亾鏁版嵁
  * @param task
  */
-function reloadAllData(task: Task) {
-  tasksStore.reload(task.Channel)
+function reloadChannel(task: Task) {
+  tasksStore.reloadChannel(task.Channel)
+}
+
+function reloadAllData() {
+  tasksStore.reloadAllData()
 }
 // 鍚姩plc 杞
 const plcStore = usePLCStore()
@@ -228,7 +243,7 @@
   display: flex;
   align-items: center;
   justify-content: center;
-  padding-top: 12px;
+  padding-top: 22px;
 }
 :deep(.el-tabs) {
   height: 100%;
@@ -268,4 +283,11 @@
   width: 100%;
   font-size: 20px;
 }
+.craft-loaded-tip {
+  height: 40px;
+  text-align: center;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
 </style>

--
Gitblit v1.8.0