diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index 7ea5370..ac7ea6f 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -1,3 +1,4 @@ +import { ElMessage, ElTreeSelect } from 'element-plus'; import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from 'axios' import { showFullScreenLoading, tryHideFullScreenLoading } from '@/components/Loading/fullScreen' import { LOGIN_URL } from '@/config' @@ -70,6 +71,11 @@ class RequestHttp { } // 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错) if (data.code && data.code !== ResultEnum.SUCCESS) { + if(data.message.includes('&')){ + const formattedMessage = data.message.split('&').join('
'); + ElMessage.error({ message: formattedMessage, dangerouslyUseHTMLString: true }); + return Promise.reject(data) + } ElMessage.error(data.message) return Promise.reject(data) } diff --git a/frontend/src/utils/webSocketClient.ts b/frontend/src/utils/webSocketClient.ts index c613c8f..293b086 100644 --- a/frontend/src/utils/webSocketClient.ts +++ b/frontend/src/utils/webSocketClient.ts @@ -40,7 +40,7 @@ export default class SocketService { // let token = '4E6EF539AAF119D82AC4C2BC84FBA21F'; - const url = 'ws://192.168.1.127:7777/hello?name=cdf' + const url = 'ws://localhost:7777/hello?name=cdf' this.ws = new WebSocket(url); // 连接成功的事件 this.ws.onopen = () => { diff --git a/frontend/src/views/machine/device/index.vue b/frontend/src/views/machine/device/index.vue index b7516cb..1023158 100644 --- a/frontend/src/views/machine/device/index.vue +++ b/frontend/src/views/machine/device/index.vue @@ -172,6 +172,19 @@ const columns = reactive[]>([ prop: 'createTime', label: '创建时间', width: 200, + render: scope => { + if (scope.row.createTime) { + const date = new Date(scope.row.createTime); + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + const seconds = String(date.getSeconds()).padStart(2, '0'); + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + } + return ''; + } }, { prop: 'operation', label: '操作', fixed: 'right', width: 200 }, ]) @@ -193,20 +206,10 @@ const openDialog = (titleType: string, row: Partial = {}) => { // 批量删除设备 const batchDelete = async (id: string[]) => { const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''//获取数据字典中对应的id - const result = await useHandleData(deletePqDev, { 'ids': id, 'pattern': patternId }, '删除所选设备') - console.log(result) - if(result.code != 'A0000'){ - proTable.value?.clearSelection() - ElMessage.error('1') - console.log('1') - }else{ - ElMessage.error('12') - console.log('12') - proTable.value?.clearSelection() - proTable.value?.getTableList() - } - + await useHandleData(deletePqDev, { 'ids': id, 'pattern': patternId }, '删除所选设备') + proTable.value?.clearSelection() + proTable.value?.getTableList() } // 删除设备 @@ -214,6 +217,7 @@ const handleDelete = async (params: Device.ResPqDev) => { const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id//获取数据字典中对应的id await useHandleData(deletePqDev, { 'ids': [params.id], 'pattern': patternId }, `删除【${params.name}】设备`) proTable.value?.getTableList() + } // 导出设备 diff --git a/frontend/src/views/machine/testScript/components/testScriptPopup.vue b/frontend/src/views/machine/testScript/components/testScriptPopup.vue index a187d01..fcfd36e 100644 --- a/frontend/src/views/machine/testScript/components/testScriptPopup.vue +++ b/frontend/src/views/machine/testScript/components/testScriptPopup.vue @@ -122,7 +122,7 @@ const open = async (sign: string,row: any,currentMode: string,id:string) => { } }); - console.log('secondLevelOptions',secondLevelOptions); + //console.log('secondLevelOptions',secondLevelOptions); if(id != ''){//新增的时候才会重新赋值值类型 formContent.value.valueType = id diff --git a/frontend/src/views/plan/planList/index.vue b/frontend/src/views/plan/planList/index.vue index ece26b1..c266c66 100644 --- a/frontend/src/views/plan/planList/index.vue +++ b/frontend/src/views/plan/planList/index.vue @@ -159,6 +159,19 @@ const columns = reactive[]>([ prop: 'createTime', label: '创建时间', width: 200, + render: scope => { + if (scope.row.createTime) { + const date = new Date(scope.row.createTime); + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + const seconds = String(date.getSeconds()).padStart(2, '0'); + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + } + return ''; + } }, { prop: 'sourceName',