+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -101,8 +55,10 @@ import {powerCurveQuery,powerImport,powerExport} from "/@/api/backend/powerCurve
import { ElMessage } from 'element-plus'
import { encrypt_aes, generateRandomNumber } from '/@/utils/crypto'
import type { TableColumnCtx } from 'element-plus'
+import { dataMethods } from './utils'
-/*interface User {
+
+interface User {
id:string,
turbineId:string,
name:string,
@@ -110,7 +66,9 @@ import type { TableColumnCtx } from 'element-plus'
speedMin:string,
speedMax:string,
factorK:string,
- factorB:string
+ factorB:string,
+ NameIndex:string,
+ count:number
}
interface SpanMethodProps {
@@ -119,27 +77,55 @@ interface SpanMethodProps {
rowIndex: number
columnIndex: number
}
-const objectSpanMethod = ({
- row,
- column,
- rowIndex,
- columnIndex,
- }: SpanMethodProps) => {
+
+const objectSpanMethod = ({row, column, rowIndex, columnIndex,}: SpanMethodProps) => {
if (columnIndex === 0) {
- if (rowIndex % 2 === 0) {
+ if (rowIndex % 7 === 0) {
+ return {
+ rowspan: 7,
+ colspan: 1,
+ };
+ } else {
+ return {
+ rowspan: 0,
+ colspan: 0,
+ };
+ }
+ }
+
+ /*if (columnIndex === 0) {
+ if (rowIndex % row.count === 0) {
return {
- rowspan: 2,
+ rowspan: row.count,
colspan: 1,
- }
+ };
} else {
return {
rowspan: 0,
colspan: 0,
- }
+ };
}
- }
-}*/
+ }*/
+}
const tableData=ref([])
+let obj = {}
+const formatData = (list) => {
+debugger
+ list.forEach(item => {
+ let count = list.filter(listItem => listItem.name === item.name).length
+ if (obj[item.name] ) {
+ obj[item.name]++
+
+ } else {
+ obj[item.name] = 1
+ }
+ item.NameIndex = obj[item.name]
+
+ item.count = count
+ })
+ tableData.value = list
+}
+
const formQuery = reactive({
pageSize: 20,
@@ -152,6 +138,7 @@ const currentPage = ref(1)
const currentPageSize = ref(20)
const handleSizeChange = (val: number) => {
formQuery.pageSize = val
+ //formQuery.pageNum = 1
getTableData(formQuery)
}
const handleCurrentChange = (val: number) => {
@@ -163,7 +150,7 @@ const getTableData = (formQuery) => {
powerCurveQuery(formQuery).then((res: any) => {
if (res.code == 200) {
pageTotal.value = res.data.total
- tableData.value = (res.data.rows || []).map((item: { speedMin?: number | string; speedMax?: number | string }) => {
+ tableData.value = res.data.rows.map((item: { speedMin?: number | string; speedMax?: number | string }) => {
const speedMin = item.speedMin ?? '';
const speedMax = item.speedMax ?? '';
if(speedMax==''){
@@ -179,6 +166,7 @@ const getTableData = (formQuery) => {
}
});
+ // formatData(tableData.value)
} else {
ElMessage.error(res.msg)
}
@@ -256,6 +244,7 @@ const Export = () => {
document.body.removeChild(a)
})
}
+
onMounted(() => {
getTableData(formQuery)
})