修改实时数据导出丢失数据
修改故障录波tab页显示名称
This commit is contained in:
parent
b9ded9def6
commit
8df96191b3
@ -190,7 +190,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog v-model="realDataLineChartVisible" title="实时曲线" @close="closeLineChart">
|
<el-dialog v-model="realDataLineChartVisible" title="实时曲线" @close="closeLineChart" width="1000">
|
||||||
<RealDataChart
|
<RealDataChart
|
||||||
ref="realDataChartRef"
|
ref="realDataChartRef"
|
||||||
:visible="realDataLineChartVisible"
|
:visible="realDataLineChartVisible"
|
||||||
@ -648,7 +648,6 @@ const openWindTurbine = (row: TableDataObjType) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.log(row)
|
|
||||||
|
|
||||||
router.push({
|
router.push({
|
||||||
name: 'windTurbine',
|
name: 'windTurbine',
|
||||||
@ -693,7 +692,6 @@ const openMeasure = () => {
|
|||||||
const saveSelectPoint = () => {
|
const saveSelectPoint = () => {
|
||||||
const list = selectPointDialogRef.value?.getSelectList()
|
const list = selectPointDialogRef.value?.getSelectList()
|
||||||
if (list) {
|
if (list) {
|
||||||
console.log(list)
|
|
||||||
|
|
||||||
const addCoulmn = list.map((item: any) => {
|
const addCoulmn = list.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
@ -712,46 +710,57 @@ const saveSelectPoint = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const downFun = () => {
|
const downFun = () => {
|
||||||
const itemsWithoutAge = tableData.value.map((item) => {
|
// const itemsWithoutAge = tableData.value.map((item) => {
|
||||||
const { irn, ...rest } = item
|
// const { irn, ...rest } = item
|
||||||
return rest
|
// return rest
|
||||||
|
// })
|
||||||
|
// if (!tableColumn.value.length || !itemsWithoutAge.length) {
|
||||||
|
// return []
|
||||||
|
// }
|
||||||
|
// const columnSet = new Set(tableColumn.value.map((item) => item.prop))
|
||||||
|
// const result: any = []
|
||||||
|
// itemsWithoutAge.forEach((item) => {
|
||||||
|
// const newItem: any = {}
|
||||||
|
// for (const itemKey in item) {
|
||||||
|
// if (columnSet.has(itemKey)) {
|
||||||
|
// newItem[itemKey] = item[itemKey]
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (Object.keys(newItem).length > 0) {
|
||||||
|
// result.push(newItem)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// let addobj: any = {}
|
||||||
|
// tableColumn.value.map((v, i) => {
|
||||||
|
// addobj['rowData' + i] = v.label
|
||||||
|
// })
|
||||||
|
// let tableDatadown = JSON.parse(JSON.stringify(result))
|
||||||
|
// tableDatadown.unshift(addobj)
|
||||||
|
// console.log(tableDatadown)
|
||||||
|
// debugger
|
||||||
|
// let str = ``
|
||||||
|
// for (let i = 0; i < tableDatadown.length; i++) {
|
||||||
|
// for (let item in tableDatadown[i]) {
|
||||||
|
// if (typeof tableDatadown[i][item] === 'string') {
|
||||||
|
// tableDatadown[i][item] = tableDatadown[i][item].replace(/[\n,]/g, (match: any) => (match === '\n' ? ' ' : ','))
|
||||||
|
// } else {
|
||||||
|
// console.warn(`tableDatadown[${i}][${item}] is not a string`)
|
||||||
|
// }
|
||||||
|
// str += `${tableDatadown[i][item] + '\t'},`
|
||||||
|
// }
|
||||||
|
// str += '\n'
|
||||||
|
// }
|
||||||
|
const title = tableColumn.value.map((item: any) => item.label).join('\t,') + '\n'
|
||||||
|
const titleKeyArr = tableColumn.value.map((item: any) => item.prop)
|
||||||
|
let str = ''
|
||||||
|
tableData.value.forEach((item) => {
|
||||||
|
titleKeyArr.forEach((prop: any) => {
|
||||||
|
const val = typeof item[prop] === 'string' ? item[prop] : item[prop] ? String(item[prop]) : ''
|
||||||
|
str += val + '\t' + ','
|
||||||
})
|
})
|
||||||
if (!tableColumn.value.length || !itemsWithoutAge.length) {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
const columnSet = new Set(tableColumn.value.map((item) => item.prop))
|
|
||||||
const result: any = []
|
|
||||||
itemsWithoutAge.forEach((item) => {
|
|
||||||
const newItem: any = {}
|
|
||||||
for (const itemKey in item) {
|
|
||||||
if (columnSet.has(itemKey)) {
|
|
||||||
newItem[itemKey] = item[itemKey]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Object.keys(newItem).length > 0) {
|
|
||||||
result.push(newItem)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
let addobj: any = {}
|
|
||||||
tableColumn.value.map((v, i) => {
|
|
||||||
addobj['rowData' + i] = v.label
|
|
||||||
})
|
|
||||||
let tableDatadown = JSON.parse(JSON.stringify(result))
|
|
||||||
tableDatadown.unshift(addobj)
|
|
||||||
console.log(tableDatadown)
|
|
||||||
|
|
||||||
let str = ``
|
|
||||||
for (let i = 0; i < tableDatadown.length; i++) {
|
|
||||||
for (let item in tableDatadown[i]) {
|
|
||||||
if (typeof tableDatadown[i][item] === 'string') {
|
|
||||||
tableDatadown[i][item] = tableDatadown[i][item].replace(/[\n,]/g, (match: any) => (match === '\n' ? ' ' : ','))
|
|
||||||
} else {
|
|
||||||
console.warn(`tableDatadown[${i}][${item}] is not a string`)
|
|
||||||
}
|
|
||||||
str += `${tableDatadown[i][item] + '\t'},`
|
|
||||||
}
|
|
||||||
str += '\n'
|
str += '\n'
|
||||||
}
|
})
|
||||||
|
str = title + str
|
||||||
let uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str)
|
let uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str)
|
||||||
let link = document.createElement('a')
|
let link = document.createElement('a')
|
||||||
link.href = uri
|
link.href = uri
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="main">
|
<el-main class="main">
|
||||||
<el-tabs v-model="activeName" @tab-change="checkTab" class="tabs">
|
<el-tabs v-model="activeName" @tab-change="checkTab" class="tabs">
|
||||||
<el-tab-pane label="故障录波" name="malFunction" class="tabPane">
|
<el-tab-pane label="故障录波文件" name="malFunction" class="tabPane">
|
||||||
<div class="tableMain">
|
<div class="tableMain">
|
||||||
<el-table :data="tableData" class="tableClass">
|
<el-table :data="tableData" class="tableClass">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
@ -79,7 +79,7 @@
|
|||||||
></el-pagination>
|
></el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="日志管理" name="logManage" class="tabPane">
|
<el-tab-pane label="运行日志文件" name="logManage" class="tabPane">
|
||||||
<div class="tableMain">
|
<div class="tableMain">
|
||||||
<el-table :data="logTableData" class="tableClass">
|
<el-table :data="logTableData" class="tableClass">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
|
Loading…
Reference in New Issue
Block a user