Quellcode durchsuchen

首页展示进行中的作业

wyn vor 3 Monaten
Ursprung
Commit
1d1cf91076
3 geänderte Dateien mit 42 neuen und 134 gelöschten Zeilen
  1. 6 0
      src/api/home/index.ts
  2. 1 1
      src/api/sop/index.ts
  3. 35 133
      src/views/Home/Index.vue

+ 6 - 0
src/api/home/index.ts

@@ -0,0 +1,6 @@
+import request from '@/config/axios'
+
+// 查询SOP列表
+export const getHomePage = async () => {
+  return await request.get({ url: '/iscs/statistics-api/getHomePage'})
+}

+ 1 - 1
src/api/sop/index.ts

@@ -37,7 +37,7 @@ export const getSopPage = async (params: PageParam) => {
 }
 
 // 获取SOP详细信息
-export const selectSopById = async (id: number) => {
+export const selectSopById = async () => {
   return await request.get({ url: '/iscs/sop/selectSopById', params: { id: id } })
 }
 

+ 35 - 133
src/views/Home/Index.vue

@@ -18,96 +18,27 @@
               </div>
             </div>
           </el-col>
-          <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
-            <div class="h-70px flex items-center justify-end lt-sm:mt-10px">
-              <div class="px-8px text-right">
-                <div class="mb-16px text-14px text-gray-400">{{ t('workplace.project') }}</div>
-                <CountTo
-                  class="text-20px"
-                  :start-val="0"
-                  :end-val="totalSate.project"
-                  :duration="2600"
-                />
-              </div>
-              <el-divider direction="vertical" />
-              <div class="px-8px text-right">
-                <div class="mb-16px text-14px text-gray-400">{{ t('workplace.toDo') }}</div>
-                <CountTo
-                  class="text-20px"
-                  :start-val="0"
-                  :end-val="totalSate.todo"
-                  :duration="2600"
-                />
-              </div>
-              <el-divider direction="vertical" border-style="dashed" />
-              <div class="px-8px text-right">
-                <div class="mb-16px text-14px text-gray-400">{{ t('workplace.access') }}</div>
-                <CountTo
-                  class="text-20px"
-                  :start-val="0"
-                  :end-val="totalSate.access"
-                  :duration="2600"
-                />
-              </div>
-            </div>
-          </el-col>
         </el-row>
       </el-skeleton>
     </el-card>
   </div>
+  <ContentWrap>
+    <el-table :data="tableData" border style="width: 100%">
+      <el-table-column prop="ticketName" label="作业名称" width="700"/>
+      <el-table-column prop="workstationName" label="岗位" width="200" />
+      <el-table-column prop="machineryName" label="设备工艺" width="500" />
+      <el-table-column label="作业类型" prop="ticketType" width="230">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.TICKET_TYPE" :value="scope.row.ticketType" />
+        </template>
+      </el-table-column>
+      <el-table-column prop="ticketStartTime" label="作业开始时间" width="220" />
 
-  <el-row class="mt-8px" :gutter="8" justify="space-between">
-    <el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-8px">
-<!--      <el-card shadow="never">-->
-<!--        <template #header>-->
-<!--          <div class="h-3 flex justify-between">-->
-<!--            <span>{{ t('workplace.project') }}</span>-->
-<!--            <el-link-->
-<!--              type="primary"-->
-<!--              :underline="false"-->
-<!--              href="https://github.com/yudaocode"-->
-<!--              target="_blank"-->
-<!--            >-->
-<!--              {{ t('action.more') }}-->
-<!--            </el-link>-->
-<!--          </div>-->
-<!--        </template>-->
-<!--        <el-skeleton :loading="loading" animated>-->
-<!--          <el-row>-->
-<!--            <el-col-->
-<!--              v-for="(item, index) in projects"-->
-<!--              :key="`card-${index}`"-->
-<!--              :xl="8"-->
-<!--              :lg="8"-->
-<!--              :md="8"-->
-<!--              :sm="24"-->
-<!--              :xs="24"-->
-<!--            >-->
-<!--              <el-card-->
-<!--                shadow="hover"-->
-<!--                class="mr-5px mt-5px cursor-pointer"-->
-<!--                @click="handleProjectClick(item.message)"-->
-<!--              >-->
-<!--                <div class="flex items-center">-->
-<!--                  <Icon-->
-<!--                    :icon="item.icon"-->
-<!--                    :size="25"-->
-<!--                    class="mr-8px"-->
-<!--                    :style="{ color: item.color }"-->
-<!--                  />-->
-<!--                  <span class="text-16px">{{ item.name }}</span>-->
-<!--                </div>-->
-<!--                <div class="mt-12px text-12px text-gray-400">{{ t(item.message) }}</div>-->
-<!--                <div class="mt-12px flex justify-between text-12px text-gray-400">-->
-<!--                  <span>{{ item.personal }}</span>-->
-<!--                  <span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span>-->
-<!--                </div>-->
-<!--              </el-card>-->
-<!--            </el-col>-->
-<!--          </el-row>-->
-<!--        </el-skeleton>-->
-<!--      </el-card>-->
+    </el-table>
+  </ContentWrap>
 
+  <el-row class="mt-8px" :gutter="16" justify="space-between">
+    <el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-8px">
       <el-card shadow="never" class="mt-8px">
         <el-skeleton :loading="loading" animated>
           <el-row :gutter="20" justify="space-between">
@@ -129,60 +60,13 @@
         </el-skeleton>
       </el-card>
     </el-col>
-    <el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-8px">
-      <el-card shadow="never">
-        <template #header>
-          <div class="h-3 flex justify-between">
-            <span>{{ t('workplace.shortcutOperation') }}</span>
-          </div>
-        </template>
-        <el-skeleton :loading="loading" animated>
-          <el-row>
-            <el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-8px">
-              <div class="flex items-center">
-                <Icon :icon="item.icon" class="mr-8px" :style="{ color: item.color }" />
-                <el-link type="default" :underline="false" @click="handleShortcutClick(item.url)">
-                  {{ item.name }}
-                </el-link>
-              </div>
-            </el-col>
-          </el-row>
-        </el-skeleton>
-      </el-card>
-<!--      <el-card shadow="never" class="mt-8px">-->
-<!--        <template #header>-->
-<!--          <div class="h-3 flex justify-between">-->
-<!--            <span>{{ t('workplace.notice') }}</span>-->
-<!--            <el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>-->
-<!--          </div>-->
-<!--        </template>-->
-<!--        <el-skeleton :loading="loading" animated>-->
-<!--          <div v-for="(item, index) in notice" :key="`dynamics-${index}`">-->
-<!--            <div class="flex items-center">-->
-<!--              <el-avatar :src="avatar" :size="35" class="mr-16px">-->
-<!--                <img src="@/assets/imgs/avatar.gif" alt="" />-->
-<!--              </el-avatar>-->
-<!--              <div>-->
-<!--                <div class="text-14px">-->
-<!--                  <Highlight :keys="item.keys.map((v) => t(v))">-->
-<!--                    {{ item.type }} : {{ item.title }}-->
-<!--                  </Highlight>-->
-<!--                </div>-->
-<!--                <div class="mt-16px text-12px text-gray-400">-->
-<!--                  {{ formatTime(item.date, 'yyyy-MM-dd') }}-->
-<!--                </div>-->
-<!--              </div>-->
-<!--            </div>-->
-<!--            <el-divider />-->
-<!--          </div>-->
-<!--        </el-skeleton>-->
-<!--      </el-card>-->
-    </el-col>
+
   </el-row>
 </template>
 <script lang="ts" setup>
 import { set } from 'lodash-es'
 import { EChartsOption } from 'echarts'
+import * as Home from '@/api/home/index'
 import { formatTime } from '@/utils'
 
 import { useUserStore } from '@/store/modules/user'
@@ -190,6 +74,8 @@ import { useUserStore } from '@/store/modules/user'
 import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
 import { pieOptions, barOptions } from './echarts-data'
 import { useRouter } from 'vue-router'
+import {getHomePage} from "@/api/home/index";
+import {DICT_TYPE,getIntDictOptions} from "@/utils/dict";
 
 defineOptions({ name: 'Index' })
 
@@ -201,6 +87,22 @@ const loading = ref(true)
 const avatar = userStore.getUser.avatar
 const username = userStore.getUser.nickname
 const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
+const tableData=ref([])
+
+
+onMounted(()=>{
+  getJobDate()
+})
+
+const getJobDate=async()=>{
+  try{
+    const jobData=await Home.getHomePage()
+    tableData.value=jobData.jobList
+    console.log(jobData,tableData.value,'数据有什么')
+  }catch(error){}
+}
+
+
 // 获取统计数
 let totalSate = reactive<WorkplaceTotal>({
   project: 0,