|
@ -49,6 +49,19 @@ |
|
|
<span class="name" @click.native="nameClick(row.deviceuuid)">{{ row.gTitle }}</span> |
|
|
<span class="name" @click.native="nameClick(row.deviceuuid)">{{ row.gTitle }}</span> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
<template #pager> |
|
|
|
|
|
<!--使用 pager 插槽--> |
|
|
|
|
|
<vxe-pager |
|
|
|
|
|
class="tablePage" |
|
|
|
|
|
:layouts="['Sizes', 'PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']" |
|
|
|
|
|
v-model:current-page="tablePage.currentPage" |
|
|
|
|
|
v-model:page-size="tablePage.pageSize" |
|
|
|
|
|
auto-hidden |
|
|
|
|
|
:total="tablePage.total" |
|
|
|
|
|
@page-change="handlePageChange" |
|
|
|
|
|
> |
|
|
|
|
|
</vxe-pager> |
|
|
|
|
|
</template> |
|
|
</vxe-grid> |
|
|
</vxe-grid> |
|
|
<!-- <vxe-grid class="tableGrid" v-bind="gridOptions"> </vxe-grid> --> |
|
|
<!-- <vxe-grid class="tableGrid" v-bind="gridOptions"> </vxe-grid> --> |
|
|
</n-spin> |
|
|
</n-spin> |
|
@ -110,7 +123,8 @@ import { |
|
|
VxeFormInstance, |
|
|
VxeFormInstance, |
|
|
VxeFormPropTypes, |
|
|
VxeFormPropTypes, |
|
|
VxeFormEvents, |
|
|
VxeFormEvents, |
|
|
VxeTablePropTypes |
|
|
VxeTablePropTypes, |
|
|
|
|
|
VxePagerEvents |
|
|
} from 'vxe-table'; |
|
|
} from 'vxe-table'; |
|
|
import { getTableHeader, getStationInfo, getTableData, editConfig, sendCtrl } from '@/api/table/list'; |
|
|
import { getTableHeader, getStationInfo, getTableData, editConfig, sendCtrl } from '@/api/table/list'; |
|
|
import { TableVo } from '@/api/table/types'; |
|
|
import { TableVo } from '@/api/table/types'; |
|
@ -136,6 +150,12 @@ const cellRow = ref({}); |
|
|
const cellColumn = ref(); |
|
|
const cellColumn = ref(); |
|
|
const cellField = ref(); |
|
|
const cellField = ref(); |
|
|
const tableBorder = ref(true); |
|
|
const tableBorder = ref(true); |
|
|
|
|
|
|
|
|
|
|
|
const tablePage = reactive({ |
|
|
|
|
|
total: 0, |
|
|
|
|
|
currentPage: 1, |
|
|
|
|
|
pageSize: 10 |
|
|
|
|
|
}); |
|
|
// const fields = ref(['deviceuuid']) //需要合并的列数据字段 |
|
|
// const fields = ref(['deviceuuid']) //需要合并的列数据字段 |
|
|
// const waringArrow = ref([]) |
|
|
// const waringArrow = ref([]) |
|
|
|
|
|
|
|
@ -182,7 +202,7 @@ const userInfo = JSON.parse(userStorageInfo === null ? '' : userStorageInfo); |
|
|
//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://172.1.2.6:9010/websocket/${userInfo.userName}`; //websocket地址 |
|
|
|
|
|
|
|
|
const emit = defineEmits(['tableHeaderData']); |
|
|
const emit = defineEmits(['tableHeaderData']); |
|
|
// const listData = ref([ |
|
|
// const listData = ref([ |
|
@ -228,11 +248,16 @@ const headerData = ref<HeaderVo[]>(); |
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
// stationInfo(); |
|
|
// stationInfo(); |
|
|
// tableHeader(); |
|
|
// tableHeader(); |
|
|
|
|
|
tablePage.currentPage = |
|
|
|
|
|
sessionStorage.getItem('currentPage') === null ? 1 : 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('menuKey', (res: any) => { |
|
|
mitt.on('menuKey', (res: any) => { |
|
|
//监听左侧菜单点击 |
|
|
//监听左侧菜单点击 |
|
|
|
|
|
tablePage.currentPage = 1; |
|
|
|
|
|
sessionStorageIns.setUseStorage('currentPage', 1); |
|
|
menuKey.value = res; |
|
|
menuKey.value = res; |
|
|
tableHeader(); |
|
|
tableHeader(); |
|
|
tableDatas(); |
|
|
tableDatas(); |
|
@ -292,6 +317,14 @@ mitt.on('tableMessage', (res: any) => { |
|
|
// console.log("waringArrow:", waringArrow.value) |
|
|
// console.log("waringArrow:", waringArrow.value) |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const handlePageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }) => { |
|
|
|
|
|
tablePage.currentPage = currentPage; |
|
|
|
|
|
tablePage.pageSize = pageSize; |
|
|
|
|
|
sessionStorageIns.setUseStorage('currentPage', currentPage); |
|
|
|
|
|
sessionStorageIns.setUseStorage('pageSize', pageSize); |
|
|
|
|
|
tableDatas(); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
function stationInfo() { |
|
|
function stationInfo() { |
|
|
//获取热源信息 |
|
|
//获取热源信息 |
|
|
getStationInfo().then((res: any) => { |
|
|
getStationInfo().then((res: any) => { |
|
@ -361,13 +394,19 @@ function tableHeader() { |
|
|
|
|
|
|
|
|
function tableDatas() { |
|
|
function tableDatas() { |
|
|
//获取表格数据 |
|
|
//获取表格数据 |
|
|
const params = menuKey.value; |
|
|
// const params = menuKey.value; |
|
|
|
|
|
const params = { |
|
|
|
|
|
pageNum: tablePage.currentPage, |
|
|
|
|
|
pageSize: tablePage.pageSize, |
|
|
|
|
|
orgCode: menuKey.value |
|
|
|
|
|
}; |
|
|
loadingShow.value = true; |
|
|
loadingShow.value = true; |
|
|
getTableData(params).then((res: any) => { |
|
|
getTableData(params).then((res: any) => { |
|
|
if (res.code === 200) { |
|
|
if (res.code === 200) { |
|
|
// tableData.value=oldData |
|
|
// tableData.value=oldData |
|
|
tableData.value = res.data; |
|
|
tableData.value = res.rows; |
|
|
tableStoreCounter.tableDataAction(res.data); |
|
|
tableStoreCounter.tableDataAction(res.rows); |
|
|
|
|
|
tablePage.total = res.total; |
|
|
// gridOptions.data = res.data; |
|
|
// gridOptions.data = res.data; |
|
|
loadingShow.value = false; |
|
|
loadingShow.value = false; |
|
|
} |
|
|
} |
|
@ -399,7 +438,7 @@ const cellDBLClickEvent: VxeTableEvents.CellDblclick<TableVo> = ({ row, column } |
|
|
|
|
|
|
|
|
const formatRole: VxeColumnPropTypes.Formatter<HeaderVo> = ({ cellValue }) => { |
|
|
const formatRole: VxeColumnPropTypes.Formatter<HeaderVo> = ({ cellValue }) => { |
|
|
//表单参数为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/>') |
|
|
// const cellData = `<span class="cellClass ${cellValue.alertProp===1?'warning':''}">${cellValue.val}</span>${iconFont}`; |
|
|
// const cellData = `<span class="cellClass ${cellValue.alertProp===1?'warning':''}">${cellValue.val}</span>${iconFont}`; |
|
|
// const cellData = `<span class="cellClass ${cellValue.alertProp === 1 ? 'warning' : cellValue.canBeControl === '1' ? 'cellEdit' : ''}">${cellValue.val}</span><i class="iconfont ${cellValue.changeProp === -1 ? 'icon-decline' : cellValue.changeProp === 1 ? 'icon-rise' : ''}" ></i>${cellValue.canBeControl === '1' ? '<i class="iconfont icon-edit-icon"></i>' : ''}`; |
|
|
// const cellData = `<span class="cellClass ${cellValue.alertProp === 1 ? 'warning' : cellValue.canBeControl === '1' ? 'cellEdit' : ''}">${cellValue.val}</span><i class="iconfont ${cellValue.changeProp === -1 ? 'icon-decline' : cellValue.changeProp === 1 ? 'icon-rise' : ''}" ></i>${cellValue.canBeControl === '1' ? '<i class="iconfont icon-edit-icon"></i>' : ''}`; |
|
|