diff --git a/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue b/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue index 8160c94e..9cb2f788 100644 --- a/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue +++ b/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue @@ -190,7 +190,7 @@ - + { }, }) } - console.log(row) router.push({ name: 'windTurbine', @@ -693,7 +692,6 @@ const openMeasure = () => { const saveSelectPoint = () => { const list = selectPointDialogRef.value?.getSelectList() if (list) { - console.log(list) const addCoulmn = list.map((item: any) => { return { @@ -712,46 +710,57 @@ const saveSelectPoint = () => { } } const downFun = () => { - const itemsWithoutAge = tableData.value.map((item) => { - const { irn, ...rest } = item - 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) - - 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'},` - } + // const itemsWithoutAge = tableData.value.map((item) => { + // const { irn, ...rest } = item + // 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' + ',' + }) str += '\n' - } + }) + str = title + str let uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str) let link = document.createElement('a') link.href = uri diff --git a/ui/dasadmin/src/views/backend/malfunction/index.vue b/ui/dasadmin/src/views/backend/malfunction/index.vue index 8813536e..9d1a1d61 100644 --- a/ui/dasadmin/src/views/backend/malfunction/index.vue +++ b/ui/dasadmin/src/views/backend/malfunction/index.vue @@ -49,7 +49,7 @@ - +
@@ -79,7 +79,7 @@ >
- +