修改报表绑定指标

This commit is contained in:
guanj
2025-11-25 15:15:38 +08:00
parent f916721b6a
commit 0c71b2ac32
10 changed files with 785 additions and 572 deletions

View File

@@ -1,8 +1,14 @@
<template>
<div class="default-main">
<div class="mb10" style="display: flex; justify-content: flex-end">
<el-upload ref="upload" action="" :auto-upload="false" :show-file-list="false" :limit="1"
:on-change="beforeUpload">
<el-upload
ref="upload"
action=""
:auto-upload="false"
:show-file-list="false"
:limit="1"
:on-change="beforeUpload"
>
<el-button icon="el-icon-Upload" type="primary" class="mr10">导入excel</el-button>
</el-upload>
<el-button @click="downloadExcel" class="" type="primary" icon="el-icon-Download">导出excel</el-button>
@@ -54,13 +60,13 @@ const info = () => {
luckysheet.create(options.value)
}
//绑定value
const setValue = (e: any) => {
const setValue = (e: any, frontAndBack: number) => {
let data = luckysheet.getRange()
luckysheet.setCellValue(
data[0].row[0],
data[0].column[0],
{
v: e[e.length - 1],
v: frontAndBack == 0 ? e[e.length - 1] : `~` + e[e.length - 1],
tr: e
}
// checkedNodes[0].data.label
@@ -119,24 +125,28 @@ const submitForm = (formdata: any, text: string) => {
params.append('reportForm', formdata.reportForm)
ElMessage.info('正在保存请稍等!')
if (text == '新增报表模板') {
addTemplate(params).then(res => {
ElMessage.success('新增成功!')
formFer.value.shutDown()
emit('shutDown')
}).catch(err => {
ElMessage.error('保存失败!')
formFer.value.shutDown()
})
addTemplate(params)
.then(res => {
ElMessage.success('新增成功!')
formFer.value.shutDown()
emit('shutDown')
})
.catch(err => {
ElMessage.error('保存失败!')
formFer.value.shutDown()
})
} else if (text == '编辑报表模板') {
params.append('id', list.value.id)
dateTemplateup(params).then(res => {
ElMessage.success('编辑成功!')
formFer.value.shutDown()
emit('shutDown')
}).catch(err => {
ElMessage.error('保存失败!')
formFer.value.shutDown()
})
dateTemplateup(params)
.then(res => {
ElMessage.success('编辑成功!')
formFer.value.shutDown()
emit('shutDown')
})
.catch(err => {
ElMessage.error('保存失败!')
formFer.value.shutDown()
})
}
}
const open = async (text: string, row?: any) => {
@@ -150,7 +160,7 @@ const open = async (text: string, row?: any) => {
info()
}
defineExpose({ open })
onMounted(() => { })
onMounted(() => {})
</script>
<style lang="scss" scoped>
:deep(.el-tab-pane) {