微调
This commit is contained in:
@@ -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('<br>');
|
||||
ElMessage.error({ message: formattedMessage, dangerouslyUseHTMLString: true });
|
||||
return Promise.reject(data)
|
||||
}
|
||||
ElMessage.error(data.message)
|
||||
return Promise.reject(data)
|
||||
}
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -172,6 +172,19 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
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,27 +206,18 @@ const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
|
||||
// 批量删除设备
|
||||
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')
|
||||
await useHandleData(deletePqDev, { 'ids': id, 'pattern': patternId }, '删除所选设备')
|
||||
|
||||
proTable.value?.clearSelection()
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 删除设备
|
||||
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()
|
||||
|
||||
}
|
||||
|
||||
// 导出设备
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -159,6 +159,19 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
||||
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',
|
||||
|
||||
Reference in New Issue
Block a user