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