提交代码

This commit is contained in:
guanj
2025-11-14 15:00:10 +08:00
parent 49dcf440ff
commit 0af955d05c
7 changed files with 38 additions and 27 deletions

View File

@@ -13,6 +13,7 @@
:sort-config="{ remote: true }"
@sort-change="handleSortChange"
>
<!-- Column 组件内部是 el-table-column -->
<template v-if="isGroup">
<GroupColumn :column="tableStore.table.column" />
@@ -91,6 +92,8 @@ const props = withDefaults(defineProps<Props>(), {
})
onMounted(() => {
tableStore.table.ref = tableRef.value as VxeTableInstance
})
// console.log(props)
const onTableSizeChange = (val: number) => {

View File

@@ -1,4 +1,4 @@
import { number } from "vue-types"
import { number } from 'vue-types'
const dataProcessing = (arr: any[]) => {
return arr
@@ -24,9 +24,10 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
base = 1
} else {
const multiple = 1 / 0.1
// 先放大→向上取整→再缩小
return Math.ceil(Math.abs(o) * multiple) / multiple
base = Math.ceil(Math.abs(o) * multiple) / multiple
}
let calculatedValue
if (isMin) {
if (value < 0) {
@@ -39,7 +40,6 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
calculatedValue = value - num * value
} else {
calculatedValue = value + num * value
}
}
@@ -62,7 +62,7 @@ export const yMethod = (arr: any) => {
let min = 0
maxValue = Math.max(...numList)
minValue = Math.min(...numList)
const o = maxValue - minValue
const o = maxValue - minValue == 0 ? maxValue : maxValue - minValue
min = calculateValue(o, minValue, num, true)
max = calculateValue(o, maxValue, num, false)

View File

@@ -51,7 +51,8 @@ export default class TableStore {
exportProcessingData: null,
beforeSearchFun: null,
height: '',
publicHeight: 0
publicHeight: 0,
filename: '',
})
constructor(public options: TableStoreParams) {
@@ -105,8 +106,10 @@ export default class TableStore {
this.table.webPagingData = window.XEUtils.chunk(this.table.data, this.table.params.pageSize)
this.table.data = this.table.webPagingData[this.table.params.pageNum - 1]
}
this.table.loadCallback && this.table.loadCallback()
this.table.loading = false
})
.catch(() => {
this.table.loading = false
@@ -142,6 +145,7 @@ export default class TableStore {
'selection-change',
() => {
this.table.selection = data as TableRow[]
}
],
[

View File

@@ -3,7 +3,12 @@
<TableHeader :showSearch="false" v-show="flag">
<template v-slot:select>
<el-form-item label="日期">
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true" @change="handleDatePickerChange"></DatePicker>
<DatePicker
ref="datePickerRef"
:nextFlag="false"
:theCurrentTime="true"
@change="handleDatePickerChange"
></DatePicker>
</el-form-item>
</template>
<template v-slot:operation>
@@ -64,7 +69,7 @@ import DatePicker from '@/components/form/datePicker/index.vue'
import { useDebounceFn } from '@vueuse/core'
import { queryActivatePage, queryByPagePath } from '@/api/system-boot/csstatisticalset'
import RoutingConfig from '@/views/pqs/cockpit/homePage/components/routingConfig.vue'
import { useRouter,useRoute } from 'vue-router'
import { useRouter, useRoute } from 'vue-router'
import { useTimeCacheStore } from '@/stores/timeCache'
const { push } = useRouter()
const datePickerRef = ref()
@@ -170,13 +175,16 @@ const zoom = (value: any) => {
if (flag.value) {
layout.value = [{ ...value, x: 0, y: 0, w: 12, h: 6 }]
} else {
layout.value = layoutCopy.value.map((item:any, index: number) => ({
layout.value = layoutCopy.value.map((item: any, index: number) => ({
...item,
i: item.i || index, // 确保有唯一标识
component: registerComponent(item.path)
}))
}
console.log("🚀 ~ zoom ~ layout.value:", layout.value)
flag.value = !flag.value
initRowHeight()
key.value += 1
}
@@ -214,7 +222,7 @@ const fetchLayoutData = async () => {
// 窗口大小变化处理 - 使用防抖
const handleResize = useDebounceFn(() => {
initRowHeight()
key.value += 1
// key.value += 1
}, 200)
// 修改
@@ -232,14 +240,9 @@ const settings = () => {
// 处理 DatePicker 值变化事件
const handleDatePickerChange = (value: any) => {
// 将值缓存到 timeCache
if (value) {
timeCacheStore.setCache(
route.path,
value.interval,
value.timeValue
)
timeCacheStore.setCache(route.path, value.interval, value.timeValue)
}
}

View File

@@ -59,7 +59,7 @@ const tableStore: any = new TableStore({
method: 'POST',
showPage: false,
exportName: '主要监测点列表',
column: [
{
field: 'index',

View File

@@ -358,11 +358,11 @@ const onSubmit = () => {
formRef.value.validate(async (valid: boolean) => {
let url = ''
await html2canvas(document.querySelector('.GridLayout'), {
useCORS: true
}).then(canvas => {
url = canvas.toDataURL('image/png')
})
// await html2canvas(document.querySelector('.GridLayout'), {
// useCORS: true
// }).then(canvas => {
// url = canvas.toDataURL('image/png')
// })
form.pagePath = form.pagePath || ''
if (valid) {

1
types/table.d.ts vendored
View File

@@ -9,6 +9,7 @@ declare global {
ref: VxeTableInstance | null
data: TableRow[] | any
allData: TableRow[] | any
copyData: TableRow[] | any
filename: any
allFlag: Boolean
// 前端分页数据