提交 25dbadff authored 作者: taojinlong's avatar taojinlong

Merge branch 'dev' of github.com:dataease/dataease into dev

...@@ -268,6 +268,16 @@ ...@@ -268,6 +268,16 @@
<exclude>static/**/*.ttf</exclude> <exclude>static/**/*.ttf</exclude>
</excludes> </excludes>
</resource> </resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>static/**/*.woff</include>
<include>static/**/*.woff2</include>
<include>static/**/*.ttf</include>
</includes>
</resource>
</resources> </resources>
<plugins> <plugins>
...@@ -371,6 +381,7 @@ ...@@ -371,6 +381,7 @@
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
<executions> <executions>
<execution> <execution>
<?m2e execute onConfiguration?>
<id>main-class-placement</id> <id>main-class-placement</id>
<phase>generate-resources</phase> <phase>generate-resources</phase>
<configuration> <configuration>
......
...@@ -99,7 +99,10 @@ ...@@ -99,7 +99,10 @@
`update_time`, `update_time`,
`snapshot`, `snapshot`,
`style_priority`, `style_priority`,
`ext_stack` `ext_stack`,
`ext_bubble`,
`y_axis_ext`,
`render`
) SELECT ) SELECT
#{newChartId}, #{newChartId},
GET_CHART_VIEW_COPY_NAME ( #{oldChartId} ), GET_CHART_VIEW_COPY_NAME ( #{oldChartId} ),
...@@ -117,7 +120,10 @@ ...@@ -117,7 +120,10 @@
`update_time`, `update_time`,
`snapshot`, `snapshot`,
`style_priority`, `style_priority`,
`ext_stack` `ext_stack`,
`ext_bubble`,
`y_axis_ext`,
`render`
FROM FROM
chart_view chart_view
WHERE WHERE
......
...@@ -43,8 +43,8 @@ public class IndexController { ...@@ -43,8 +43,8 @@ public class IndexController {
return "doc.html"; return "doc.html";
default: default:
// DataEaseException.throwException("Invalid License."); // DataEaseException.throwException("Invalid License.");
//return "nolic.html"; return "nolic.html";
return "doc.html"; // return "doc.html";
} }
// return "index.html"; // return "index.html";
} }
......
...@@ -1334,7 +1334,10 @@ export default { ...@@ -1334,7 +1334,10 @@ export default {
new_window: '新窗口', new_window: '新窗口',
now_window: '当前窗口', now_window: '当前窗口',
hyperLinks: '超链接', hyperLinks: '超链接',
link_open_tips: '仪表板非编辑状态可打开链接' link_open_tips: '仪表板非编辑状态可打开链接',
data_loading: '数据准备中...',
export_loading: '导出中...',
export_pdf: '导出PDF'
}, },
plugin: { plugin: {
local_install: '本地安装', local_install: '本地安装',
......
<template> <template>
<el-row> <el-row
v-loading="exportLoading"
style="height: 100%;width: 100%;"
:element-loading-text="$t('panel.export_loading')"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)"
>
<el-row class="export_body_class"> <el-row class="export_body_class">
<div id="exportPdf" ref="exportPdf"> <div id="exportPdf" ref="exportPdf">
<div class="export_body_inner_class" v-html="templateContentChange" /> <div class="export_body_inner_class" v-html="templateContentChange" />
...@@ -7,7 +13,7 @@ ...@@ -7,7 +13,7 @@
</el-row> </el-row>
<el-row class="root_class"> <el-row class="root_class">
<el-button size="mini" @click="cancel()">{{ $t('commons.cancel') }}</el-button> <el-button size="mini" @click="cancel()">{{ $t('commons.cancel') }}</el-button>
<el-button type="primary" size="mini" @click="save()">导出PDF</el-button> <el-button type="primary" size="mini" @click="save()">{{ $t('panel.export_pdf') }}</el-button>
</el-row> </el-row>
</el-row> </el-row>
</template> </template>
...@@ -36,6 +42,7 @@ export default { ...@@ -36,6 +42,7 @@ export default {
}, },
data() { data() {
return { return {
exportLoading: false,
activeName: '', activeName: '',
templateContentChange: '', templateContentChange: '',
time: '', time: '',
...@@ -82,15 +89,20 @@ export default { ...@@ -82,15 +89,20 @@ export default {
}, },
save() { save() {
const _this = this const _this = this
html2canvas(document.getElementById('exportPdf')).then(function(canvas) { _this.exportLoading = true
const contentWidth = canvas.width setTimeout(() => {
const contentHeight = canvas.height html2canvas(document.getElementById('exportPdf')).then(function(canvas) {
const pageData = canvas.toDataURL('image/jpeg', 1.0) _this.exportLoading = false
const PDF = new JsPDF('l', 'px', [contentWidth, contentHeight]) const contentWidth = canvas.width
PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight) const contentHeight = canvas.height
PDF.save(_this.panelName + '.pdf') const pageData = canvas.toDataURL('image/jpeg', 1.0)
} const PDF = new JsPDF('l', 'px', [contentWidth, contentHeight])
) PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight)
PDF.save(_this.panelName + '.pdf')
_this.$emit('closePreExport')
}
)
}, 50)
} }
} }
......
<template> <template>
<el-row style="height: 100%;width: 100%;"> <el-row
v-loading="dataLoading"
style="height: 100%;width: 100%;"
:element-loading-text="$t('panel.data_loading')"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)"
>
<el-col v-if="panelInfo.name.length>0" class="panel-design"> <el-col v-if="panelInfo.name.length>0" class="panel-design">
<el-row class="panel-design-head"> <el-row class="panel-design-head">
<!--仪表板头部区域--> <!--仪表板头部区域-->
...@@ -132,7 +138,8 @@ export default { ...@@ -132,7 +138,8 @@ export default {
fullscreen: false, fullscreen: false,
pdfExportShow: false, pdfExportShow: false,
snapshotInfo: '', snapshotInfo: '',
isShare: false isShare: false,
dataLoading: false
} }
}, },
computed: { computed: {
...@@ -183,50 +190,62 @@ export default { ...@@ -183,50 +190,62 @@ export default {
window.open(url, '_blank') window.open(url, '_blank')
}, },
saveToTemplate() { saveToTemplate() {
this.templateSaveShow = true this.dataLoading = true
html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { setTimeout(() => {
const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.2是图片质量 html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => {
if (snapshot !== '') { this.templateSaveShow = true
this.templateInfo = { this.dataLoading = false
name: this.$store.state.panel.panelInfo.name, const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.2是图片质量
snapshot: snapshot, if (snapshot !== '') {
templateStyle: JSON.stringify(this.canvasStyleData), this.templateInfo = {
templateData: JSON.stringify(this.componentData), name: this.$store.state.panel.panelInfo.name,
templateType: 'self', snapshot: snapshot,
nodeType: 'template', templateStyle: JSON.stringify(this.canvasStyleData),
level: 1, templateData: JSON.stringify(this.componentData),
pid: null, templateType: 'self',
dynamicData: '' nodeType: 'template',
level: 1,
pid: null,
dynamicData: ''
}
} }
} })
}) }, 50)
}, },
downloadToTemplate() { downloadToTemplate() {
html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { this.dataLoading = true
const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.2是图片质量 setTimeout(() => {
if (snapshot !== '') { html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => {
this.templateInfo = { this.dataLoading = false
name: this.$store.state.panel.panelInfo.name, const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.2是图片质量
templateType: 'self', if (snapshot !== '') {
snapshot: snapshot, this.templateInfo = {
panelStyle: JSON.stringify(this.canvasStyleData), name: this.$store.state.panel.panelInfo.name,
panelData: JSON.stringify(this.componentData), templateType: 'self',
dynamicData: '' snapshot: snapshot,
panelStyle: JSON.stringify(this.canvasStyleData),
panelData: JSON.stringify(this.componentData),
dynamicData: ''
}
const blob = new Blob([JSON.stringify(this.templateInfo)], { type: '' })
FileSaver.saveAs(blob, this.$store.state.panel.panelInfo.name + '-TEMPLATE.DE')
} }
const blob = new Blob([JSON.stringify(this.templateInfo)], { type: '' }) })
FileSaver.saveAs(blob, this.$store.state.panel.panelInfo.name + '-TEMPLATE.DE') }, 50)
}
})
}, },
downloadAsPDF() { downloadAsPDF() {
html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { this.dataLoading = true
const snapshot = canvas.toDataURL('image/jpeg', 1) // 0.2是图片质量 setTimeout(() => {
if (snapshot !== '') { html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => {
this.snapshotInfo = snapshot const snapshot = canvas.toDataURL('image/jpeg', 1) // 是图片质量
this.pdfExportShow = true this.dataLoading = false
} if (snapshot !== '') {
}) this.snapshotInfo = snapshot
this.pdfExportShow = true
}
})
}, 50)
}, },
refreshTemplateInfo() { refreshTemplateInfo() {
this.templateInfo = {} this.templateInfo = {}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论