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