|
|
@ -135,7 +135,7 @@ import mitt from '@/plugins/bus'; |
|
|
|
import socket from '@/utils/socket'; |
|
|
|
import useStorage from '@/utils/useStorage'; |
|
|
|
import { useUserStoreHook } from '@/store/modules/user'; |
|
|
|
import { useDateFormat } from '@vueuse/core'; |
|
|
|
// import { useDateFormat } from '@vueuse/core'; |
|
|
|
|
|
|
|
const sessionStorageIns = useStorage('sessionStorage'); |
|
|
|
const { perms } = useUserStoreHook(); |
|
|
@ -211,8 +211,8 @@ const userInfo = JSON.parse(userStorageInfo === null ? '' : userStorageInfo); |
|
|
|
// const baseApi = "http://board.heatiot.cn:8001/prod-api"//websocket链接地址,与项目接口地址一致。 |
|
|
|
//const baseApi = import.meta.env.VITE_APP_BASE_API |
|
|
|
//const apiUrl = baseApi.replace(/https?:/, ''); |
|
|
|
const wsUrl = `ws://${window.location.host}/ws/websocket/${userInfo.userName}`; //websocket地址 |
|
|
|
// const wsUrl = `ws://10.10.10.56:9010/websocket/${userInfo.userName}`; //websocket地址 |
|
|
|
// const wsUrl = `ws://${window.location.host}/ws/websocket/${userInfo.userName}`; //websocket地址 |
|
|
|
const wsUrl = `ws://10.10.10.56:9010/websocket/${userInfo.userName}`; //websocket地址 |
|
|
|
|
|
|
|
const emit = defineEmits(['tableHeaderData']); |
|
|
|
// const listData = ref([ |
|
|
@ -258,13 +258,13 @@ const headerData = ref<HeaderVo[]>(); |
|
|
|
onMounted(() => { |
|
|
|
// stationInfo(); |
|
|
|
// tableHeader(); |
|
|
|
console.log('起始时间:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
// console.log('起始时间:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
console.log('aaaa', sessionStorage.getItem('currentPage')); |
|
|
|
tablePage.currentPage = |
|
|
|
sessionStorage.getItem('currentPage') === null ? 1 : Number(sessionStorage.getItem('currentPage')); |
|
|
|
console.log(Number(sessionStorage.getItem('currentPage'))); |
|
|
|
tablePage.pageSize = sessionStorage.getItem('pageSize') === null ? 10 : Number(sessionStorage.getItem('pageSize')); |
|
|
|
socket.initialize(wsUrl); //初始化websocket http:// |
|
|
|
// socket.initialize(wsUrl); //初始化websocket http:// |
|
|
|
}); |
|
|
|
|
|
|
|
mitt.on('currentPageEmit', (res: any) => { |
|
|
@ -409,7 +409,7 @@ function tableHeader() { |
|
|
|
function tableDatas() { |
|
|
|
//获取表格数据 |
|
|
|
// const params = menuKey.value; |
|
|
|
console.log('接口开始:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
// console.log('接口开始:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
const params = { |
|
|
|
pageNum: tablePage.currentPage, |
|
|
|
pageSize: tablePage.pageSize, |
|
|
@ -424,10 +424,9 @@ function tableDatas() { |
|
|
|
tablePage.total = res.total; |
|
|
|
// gridOptions.data = res.data; |
|
|
|
loadingShow.value = false; |
|
|
|
console.log('接口结束:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
// console.log('接口结束:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const cellDBLClickEvent: VxeTableEvents.CellDblclick<TableVo> = ({ row, column }) => { |
|
|
@ -454,7 +453,7 @@ const cellDBLClickEvent: VxeTableEvents.CellDblclick<TableVo> = ({ row, column } |
|
|
|
}; |
|
|
|
|
|
|
|
const formatRole: VxeColumnPropTypes.Formatter<HeaderVo> = ({ cellValue }) => { |
|
|
|
console.log('渲染开始:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
// console.log('渲染开始:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
//表单参数为object时处理 |
|
|
|
// console.log(cellValue); |
|
|
|
// const iconFont=cellValue.changeProp===-1?'<i class="iconfont icon-decline" />':(cellValue.changeProp===1?'<i class="iconfont icon-rise" />':'<i/>') |
|
|
@ -473,13 +472,13 @@ const formatRole: VxeColumnPropTypes.Formatter<HeaderVo> = ({ cellValue }) => { |
|
|
|
${cellValue.ctrlPro.valueType != 'bool' ? cellValue.val : cellValue.val === 'true' ? '启' : '停'} |
|
|
|
</span> |
|
|
|
${cellValue.canBeControl === '1' && controlPerm ? '<i class="iconfont icon-edit-icon"></i>' : ''}`; |
|
|
|
console.log('渲染完成:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
// console.log('渲染完成:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
return cellData; |
|
|
|
}; |
|
|
|
|
|
|
|
// 通用行合并函数(将相同多列数据合并为一行) |
|
|
|
const mergeRowMethod: VxeTablePropTypes.SpanMethod<TableVo> = ({ row, _rowIndex, column, visibleData }) => { |
|
|
|
console.log('通用行合并渲染开始:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
// console.log('通用行合并渲染开始:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
const fields = ['gTitle']; |
|
|
|
const cellValue = row[column.field]; |
|
|
|
if (cellValue && fields.includes(column.field)) { |
|
|
@ -497,7 +496,7 @@ const mergeRowMethod: VxeTablePropTypes.SpanMethod<TableVo> = ({ row, _rowIndex, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('通用行合并渲染完成:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
// console.log('通用行合并渲染完成:', useDateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss').value); |
|
|
|
}; |
|
|
|
|
|
|
|
const submitEvent: VxeFormEvents.Submit = () => { |
|
|
|