From 3a4b094461e11002287a667b8bea49b362a2fc6f Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 02 二月 2024 18:55:12 +0800
Subject: [PATCH] config配置修改、获取任务列表、设备列表、获取问题列表接口联调

---
 vite.config.ts                                    |   53 +++++++++++++-------------
 src/views/dashboard/index.vue                     |   10 ++--
 src/api/index.ts                                  |   16 ++++----
 src/views/dashboard/components/DashboardTitle.vue |   39 ++++++++++---------
 4 files changed, 60 insertions(+), 58 deletions(-)

diff --git a/src/api/index.ts b/src/api/index.ts
index b45f15f..326f27f 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -36,7 +36,7 @@
  */
 export function getTaskList(params: TaskListParams) {
   return request<BaseResponse<TasksGroupByChannel>>({
-    url: '/v1/task/list',
+    url: '/api-s/v1/reportWork/taskList',
     method: 'get',
     params
   })
@@ -111,7 +111,7 @@
  */
 export function getDeviceList() {
   return request<BaseResponse<Devices>>({
-    url: `/v1/device/list`,
+    url: `/api-s/v1/reportWork/deviceList`,
     method: 'get'
   })
 }
@@ -183,12 +183,12 @@
 /**
  * 鑾峰彇闂璇婃柇闂鍒楄〃
  */
-export function apiGetProblemList() {
-  return request<BaseResponse<Problem[]>>({
-    url: '/v1/system/problemList',
-    method: 'get'
-  })
-}
+// export function apiGetProblemList() {
+//   return request<BaseResponse<Problem[]>>({
+//     url: '/v1/system/problemList',
+//     method: 'get'
+//   })
+// }
 
 export interface ReportingRecordListParams {
   page?: number
diff --git a/src/views/dashboard/components/DashboardTitle.vue b/src/views/dashboard/components/DashboardTitle.vue
index aa9cf3d..863d4eb 100644
--- a/src/views/dashboard/components/DashboardTitle.vue
+++ b/src/views/dashboard/components/DashboardTitle.vue
@@ -61,7 +61,7 @@
 import IconCloudOff from '~icons/material-symbols-light/cloud-off-outline'
 import IconSlider from '~icons/bx/slider'
 import { useRequest } from 'vue-hooks-plus'
-import { apiGetProblemList } from '@/api'
+// import { apiGetProblemList } from '@/api'
 import { PROBLEMS_POLLING_DURATION } from '@/common/constants'
 import { Setting } from '@element-plus/icons-vue'
 import DeliverParamsConfigModal from '@/views/dashboard/components/DeliverParamsConfigModal.vue'
@@ -101,7 +101,8 @@
 
 // 闂璇婃柇鍒楄〃
 const problemList = computed(() => {
-  return problemsRes?.value?.data ?? []
+  // return problemsRes?.value?.data ?? []
+  return []
 })
 // 闂璇婃柇icon鐘舵��, 闂鍒楄〃涓湁涓�鏉″紓甯稿嵆涓虹孩鐏� 鍚﹀垯鏄豢鐏�  true缁跨伅
 const problemsIconStatus = computed(() => {
@@ -109,7 +110,8 @@
     // 榛樿缁跨伅, 鎷垮埌涓�娆℃暟鎹悗鎵嶄互鎺ュ彛涓哄噯
     return true
   }
-  return !problemList.value.some((ele) => !ele.CheckResult)
+  // return !problemList.value.some((ele) => !ele.CheckResult)
+  return false
 })
 // 浜戠杩炴帴icon鐘舵��, 闂鍒楄〃涓湁涓�鏉′唬琛ㄤ簯绔摼鎺ョ殑, 寮傚父鍗充负绾㈣壊浜慽con 鍚﹀垯鏄豢鑹�  true缁夸簯
 const cloudConnectionIconStatus = computed(() => {
@@ -118,8 +120,9 @@
     return true
   }
   // 娌℃暟鎹氨褰撴槸閾炬帴姝e父
-  const cloudConnection = problemList.value.find((ele) => ele.ItemCode === 'cloud')
-  return cloudConnection ? cloudConnection?.CheckResult : true
+  // const cloudConnection = problemList.value.find((ele) => ele.ItemCode === 'cloud')
+  // return cloudConnection ? cloudConnection?.CheckResult : true
+  return false
 })
 
 // 閰嶇疆涓嬪彂鍙傛暟寮圭獥
@@ -133,19 +136,19 @@
 /**
  * 杞闂璇婃柇
  */
-const {
-  data: problemsRes,
-  run: startProblemsPolling,
-  cancel: cancelProblemsPolling
-} = useRequest(apiGetProblemList, {
-  manual: true,
-  pollingInterval: PROBLEMS_POLLING_DURATION,
-  pollingWhenHidden: false
-})
-startProblemsPolling()
-onUnmounted(() => {
-  cancelProblemsPolling()
-})
+// const {
+//   data: problemsRes,
+//   run: startProblemsPolling,
+//   cancel: cancelProblemsPolling
+// } = useRequest(apiGetProblemList, {
+//   manual: true,
+//   pollingInterval: PROBLEMS_POLLING_DURATION,
+//   pollingWhenHidden: false
+// })
+// startProblemsPolling()
+// onUnmounted(() => {
+//   cancelProblemsPolling()
+// })
 
 const taskStore = useTasksStore()
 
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fea5c74..8420dff 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -75,7 +75,7 @@
       </div>
     </template>
     <template #rightBlock2>
-      <DeviceStatusInfo :plc="plcStore.plcInfo" :type="1"></DeviceStatusInfo>
+      <DeviceStatusInfo :type="1"></DeviceStatusInfo>
       <DeviceStatusInfo :device="deviceStore.deviceInfo" :type="2"></DeviceStatusInfo>
       <DeviceNumberInfo></DeviceNumberInfo>
     </template>
@@ -122,7 +122,7 @@
 import TaskControl from '@/views/dashboard/components/TaskControl.vue'
 import SubTitle from '@/views/dashboard/components/SubTitle.vue'
 import DashboardTitle from '@/views/dashboard/components/DashboardTitle.vue'
-import { usePLCStore } from '@/stores/plc'
+// import { usePLCStore } from '@/stores/plc'
 import { useDevicesStore } from '@/stores/devices'
 import { useCraftModelStore } from '@/stores/craftModel'
 import CraftDetailModal from '@/views/dashboard/components/CraftDetailModal.vue'
@@ -173,7 +173,7 @@
  */
 function reloadChannel(task: Task) {
   tasksStore.reloadChannel(task.Channel).then(() => {
-    plcStore.startPollingPLC()
+    // plcStore.startPollingPLC()
   })
 }
 
@@ -182,8 +182,8 @@
   location.reload()
 }
 // 鍚姩plc 杞
-const plcStore = usePLCStore()
-plcStore.startPollingPLC()
+// const plcStore = usePLCStore()
+// plcStore.startPollingPLC()
 // 鍚姩 璁惧 杞
 const deviceStore = useDevicesStore()
 deviceStore.startPollingDevice()
diff --git a/vite.config.ts b/vite.config.ts
index a5da4ec..89121cf 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -16,9 +16,9 @@
 export default defineConfig({
   server: {
     proxy: {
-      '/v1/': {
+      '/api-s/': {
         // http://192.168.20.119:8003 http://192.168.20.25:7010
-        target: 'http://192.168.20.119:8003',
+        target: 'http://192.168.20.120:9081',
         ws: true,
         changeOrigin: true
       }
@@ -27,27 +27,26 @@
   resolve: {
     alias: {
       '@': pathSrc
-    },
-  },
-  
-  build: {
-    minify:'terser',
-    // ,'edge90','firefox90','safari15'
-    target:['chrome52'],
-    cssTarget:["chrome52"],
-  },
-  css:{
-      postcss:{
-          plugins:[
-            require('postcss-pxtorem')({
-              // ipad:1280-800
-              rootValue:160.0, //鎹㈢畻鐨勫熀鏁帮紝 灞忓箷瀹藉害/10
-              propList:['*'],//闇�瑕佽浆鍖栫殑灞炴�э紝*琛ㄧず鎵�鏈夊睘鎬ч兘闇�瑕佽浆鍖�
-              // unitPrecision:5
-            })
-          ]
     }
+  },
 
+  build: {
+    minify: 'terser',
+    // ,'edge90','firefox90','safari15'
+    target: ['chrome52'],
+    cssTarget: ['chrome52']
+  },
+  css: {
+    postcss: {
+      plugins: [
+        require('postcss-pxtorem')({
+          // ipad:1280-800
+          rootValue: 160.0, //鎹㈢畻鐨勫熀鏁帮紝 灞忓箷瀹藉害/10
+          propList: ['*'] //闇�瑕佽浆鍖栫殑灞炴�э紝*琛ㄧず鎵�鏈夊睘鎬ч兘闇�瑕佽浆鍖�
+          // unitPrecision:5
+        })
+      ]
+    }
   },
   plugins: [
     vue(),
@@ -68,10 +67,10 @@
     }),
     // 寮�鍙戠幆澧冨吋瀹�
     esbuild({
-      target:"chrome64",
-      loaders:{
-        ".vue":'js',
-        ".ts":'js'
+      target: 'chrome64',
+      loaders: {
+        '.vue': 'js',
+        '.ts': 'js'
       }
     }),
     // 鍏煎浣庣増鏈祻瑙堝櫒
@@ -113,8 +112,8 @@
     }),
     Icons({
       autoInstall: true
-    }),
-  ],
+    })
+  ]
   // configureWebpack:config=>{
   //   config.entry.app=['babel-polyfill','./src/main.js']
   // },

--
Gitblit v1.8.0