config配置修改、获取任务列表、设备列表、获取问题列表接口联调
| | |
| | | */ |
| | | export function getTaskList(params: TaskListParams) { |
| | | return request<BaseResponse<TasksGroupByChannel>>({ |
| | | url: '/v1/task/list', |
| | | url: '/api-s/v1/reportWork/taskList', |
| | | method: 'get', |
| | | params |
| | | }) |
| | |
| | | */ |
| | | export function getDeviceList() { |
| | | return request<BaseResponse<Devices>>({ |
| | | url: `/v1/device/list`, |
| | | url: `/api-s/v1/reportWork/deviceList`, |
| | | method: 'get' |
| | | }) |
| | | } |
| | |
| | | /** |
| | | * 获取问题诊断问题列表 |
| | | */ |
| | | 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 |
| | |
| | | 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' |
| | |
| | | |
| | | // 问题诊断列表 |
| | | const problemList = computed(() => { |
| | | return problemsRes?.value?.data ?? [] |
| | | // return problemsRes?.value?.data ?? [] |
| | | return [] |
| | | }) |
| | | // 问题诊断icon状态, 问题列表中有一条异常即为红灯 否则是绿灯 true绿灯 |
| | | const problemsIconStatus = computed(() => { |
| | |
| | | // 默认绿灯, 拿到一次数据后才以接口为准 |
| | | return true |
| | | } |
| | | return !problemList.value.some((ele) => !ele.CheckResult) |
| | | // return !problemList.value.some((ele) => !ele.CheckResult) |
| | | return false |
| | | }) |
| | | // 云端连接icon状态, 问题列表中有一条代表云端链接的, 异常即为红色云icon 否则是绿色 true绿云 |
| | | const cloudConnectionIconStatus = computed(() => { |
| | |
| | | return true |
| | | } |
| | | // 没数据就当是链接正常 |
| | | 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 |
| | | }) |
| | | |
| | | // 配置下发参数弹窗 |
| | |
| | | /** |
| | | * 轮询问题诊断 |
| | | */ |
| | | 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() |
| | | |
| | |
| | | </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> |
| | |
| | | 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' |
| | |
| | | */ |
| | | function reloadChannel(task: Task) { |
| | | tasksStore.reloadChannel(task.Channel).then(() => { |
| | | plcStore.startPollingPLC() |
| | | // plcStore.startPollingPLC() |
| | | }) |
| | | } |
| | | |
| | |
| | | location.reload() |
| | | } |
| | | // 启动plc 轮询 |
| | | const plcStore = usePLCStore() |
| | | plcStore.startPollingPLC() |
| | | // const plcStore = usePLCStore() |
| | | // plcStore.startPollingPLC() |
| | | // 启动 设备 轮询 |
| | | const deviceStore = useDevicesStore() |
| | | deviceStore.startPollingDevice() |
| | |
| | | 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 |
| | | } |
| | |
| | | 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(), |
| | |
| | | }), |
| | | // 开发环境兼容 |
| | | esbuild({ |
| | | target:"chrome64", |
| | | loaders:{ |
| | | ".vue":'js', |
| | | ".ts":'js' |
| | | target: 'chrome64', |
| | | loaders: { |
| | | '.vue': 'js', |
| | | '.ts': 'js' |
| | | } |
| | | }), |
| | | // 兼容低版本浏览器 |
| | |
| | | }), |
| | | Icons({ |
| | | autoInstall: true |
| | | }), |
| | | ], |
| | | }) |
| | | ] |
| | | // configureWebpack:config=>{ |
| | | // config.entry.app=['babel-polyfill','./src/main.js'] |
| | | // }, |