修改自定义报表
This commit is contained in:
@@ -95,21 +95,24 @@ const tableStore = new TableStore({
|
|||||||
tableStore.table.params.lineId = dotList.value.id
|
tableStore.table.params.lineId = dotList.value.id
|
||||||
},
|
},
|
||||||
loadCallback: () => {
|
loadCallback: () => {
|
||||||
console.log(tableStore.table.data)
|
|
||||||
tableStore.table.data.forEach((item: any) => {
|
tableStore.table.data.forEach((item: any) => {
|
||||||
|
item.data1 ? (item.data = JSON.parse(item.data1)) : ''
|
||||||
item.celldata.forEach((k: any) => {
|
item.celldata.forEach((k: any) => {
|
||||||
item.data[k.r][k.c].v = k.v
|
item.data[k.r][k.c].v ? (item.data[k.r][k.c].v = k.v) : ''
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
luckysheet.create({
|
console.log(tableStore.table.data)
|
||||||
container: 'luckysheet',
|
setTimeout(() => {
|
||||||
title: '', // 表 头名
|
luckysheet.create({
|
||||||
lang: 'zh', // 中文
|
container: 'luckysheet',
|
||||||
showtoolbar: false, // 是否显示工具栏
|
title: '', // 表 头名
|
||||||
showinfobar: false, // 是否显示顶部信息栏
|
lang: 'zh', // 中文
|
||||||
showsheetbar: true, // 是否显示底部sheet按钮
|
showtoolbar: false, // 是否显示工具栏
|
||||||
data: tableStore.table.data
|
showinfobar: false, // 是否显示顶部信息栏
|
||||||
})
|
showsheetbar: true, // 是否显示底部sheet按钮
|
||||||
|
data: tableStore.table.data
|
||||||
|
})
|
||||||
|
}, 10)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|||||||
@@ -85,6 +85,15 @@ const beforeUpload = (file: any) => {
|
|||||||
}
|
}
|
||||||
luckysheet.destroy()
|
luckysheet.destroy()
|
||||||
options.value.title = exportJson.info.name
|
options.value.title = exportJson.info.name
|
||||||
|
console.log('🚀 ~ exportJson.sheets:', exportJson.sheets)
|
||||||
|
exportJson.sheets.forEach((item: any) => {
|
||||||
|
// item.celldata = []
|
||||||
|
// item.data = []
|
||||||
|
item.celldata.forEach((k: any) => {
|
||||||
|
k.v.ct.s ? (k.v.v = k.v.ct.s[0].v) : ''
|
||||||
|
k.v.ct.s ? (k.v.m = k.v.ct.s[0].v) : ''
|
||||||
|
})
|
||||||
|
})
|
||||||
options.value.data = exportJson.sheets
|
options.value.data = exportJson.sheets
|
||||||
luckysheet.create(options.value)
|
luckysheet.create(options.value)
|
||||||
})
|
})
|
||||||
@@ -95,9 +104,14 @@ const preservation = () => {
|
|||||||
}
|
}
|
||||||
// 新增
|
// 新增
|
||||||
const submitForm = (formdata: any, text: string) => {
|
const submitForm = (formdata: any, text: string) => {
|
||||||
console.log('🚀 ~ submitForm ~ text:', text)
|
// let userStr = JSON.stringify(luckysheet.getAllSheets())
|
||||||
let userStr = JSON.stringify(luckysheet.getAllSheets())
|
let userStr = luckysheet.getAllSheets()
|
||||||
let blob = new Blob([userStr], {
|
console.log('🚀 ~ submitForm ~ userStr:', userStr)
|
||||||
|
userStr.forEach((item: any) => {
|
||||||
|
item.data1 = JSON.stringify(item.data)
|
||||||
|
})
|
||||||
|
|
||||||
|
let blob = new Blob([JSON.stringify(userStr)], {
|
||||||
type: 'application/json;charset=UTF-8'
|
type: 'application/json;charset=UTF-8'
|
||||||
})
|
})
|
||||||
let files = new window.File([blob], 'content.json', {
|
let files = new window.File([blob], 'content.json', {
|
||||||
|
|||||||
Reference in New Issue
Block a user