Merge pull request #11074 from dataease/dev

merge v1.18.24
This commit is contained in:
fit2cloudrd 2024-07-22 15:24:29 +08:00 committed by GitHub
commit 1056b6ffd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 109 additions and 23 deletions

View File

@ -1035,6 +1035,10 @@ public class DataFillDataService {
datasourceRequest.setDatasource(ds); datasourceRequest.setDatasource(ds);
datasourceRequest.setTable(dataFillForm.getTableName()); datasourceRequest.setTable(dataFillForm.getTableName());
Provider datasourceProvider = ProviderFactory.getProvider(ds.getType()); Provider datasourceProvider = ProviderFactory.getProvider(ds.getType());
ExtDDLProvider extDDLProvider = ProviderFactory.gerExtDDLProvider(ds.getType());
setLowerCaseRequest(ds, datasourceProvider, extDDLProvider, datasourceRequest);
List<TableField> tableFields = datasourceProvider.getTableFields(datasourceRequest); List<TableField> tableFields = datasourceProvider.getTableFields(datasourceRequest);
for (TableField tableField : tableFields) { for (TableField tableField : tableFields) {

View File

@ -15,17 +15,20 @@
> >
<PasswordUpdateForm /> <PasswordUpdateForm />
</el-dialog> </el-dialog>
<ExportExcel ref="ExportExcelRef" />
</div> </div>
</template> </template>
<script> <script>
import ExportExcel from '@/views/dataset/exportExcel/index.vue'
import PluginCom from '@/views/system/plugin/PluginCom' import PluginCom from '@/views/system/plugin/PluginCom'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import PasswordUpdateForm from '@/views/system/user/PasswordUpdateForm.vue' import PasswordUpdateForm from '@/views/system/user/PasswordUpdateForm.vue'
import bus from '@/utils/bus'
export default { export default {
name: 'App', name: 'App',
components: { PluginCom, PasswordUpdateForm }, components: { PluginCom, PasswordUpdateForm, ExportExcel },
data() { data() {
return { return {
showPasswordModifiedDialog: false, showPasswordModifiedDialog: false,
@ -46,11 +49,20 @@ export default {
} }
}, },
mounted() { mounted() {
bus.$on('data-export-center', this.downloadClick)
const passwordModified = JSON.parse(localStorage.getItem('passwordModified')) const passwordModified = JSON.parse(localStorage.getItem('passwordModified'))
this.defaultPwd = localStorage.getItem('defaultPwd') this.defaultPwd = localStorage.getItem('defaultPwd')
if (typeof passwordModified === 'boolean') { if (typeof passwordModified === 'boolean') {
this.$store.commit('user/SET_PASSWORD_MODIFIED', passwordModified) this.$store.commit('user/SET_PASSWORD_MODIFIED', passwordModified)
} }
},
beforeDestroy() {
bus.$off('data-export-center', this.downloadClick)
},
methods: {
downloadClick() {
this.$refs.ExportExcelRef.init()
}
} }
} }
</script> </script>

View File

@ -489,8 +489,7 @@ export default {
this.$message({ this.$message({
message: h('p', null, [ message: h('p', null, [
this.$t('data_export.exporting'), this.$t('data_export.exporting'),
this.showEditPosition === 'bar-main-preview' h(
? h(
Button, Button,
{ {
props: { props: {
@ -504,7 +503,7 @@ export default {
} }
}, },
this.$t('data_export.export_center') this.$t('data_export.export_center')
) : this.$t('data_export.export_center'), ),
this.$t('data_export.export_info') this.$t('data_export.export_info')
]), ]),
iconClass, iconClass,

View File

@ -172,7 +172,7 @@
<el-button <el-button
v-if="showChartInfoType==='details' && showChartInfo.dataFrom !== 'template' && !userId && hasDataPermission('export',panelInfo.privileges)" v-if="showChartInfoType==='details' && showChartInfo.dataFrom !== 'template' && !userId && hasDataPermission('export',panelInfo.privileges)"
size="mini" size="mini"
:disabled="$store.getters.loadingMap[$store.getters.currentPath] || dialogLoading" :disabled="$store.getters.loadingMap[$store.getters.currentPath]"
@click="exportSourceDetails" @click="exportSourceDetails"
> >
<svg-icon <svg-icon
@ -191,12 +191,11 @@
:open-type="showChartInfoType" :open-type="showChartInfoType"
/> />
</el-dialog> </el-dialog>
<ExportExcel ref="ExportExcelRef" />
</div> </div>
</template> </template>
<script> <script>
import ExportExcel from '@/views/dataset/exportExcel/index.vue' import { Button } from 'element-ui'
import { getStyle } from '@/components/canvas/utils/style' import { getStyle } from '@/components/canvas/utils/style'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import ComponentWrapper from './ComponentWrapper' import ComponentWrapper from './ComponentWrapper'
@ -222,7 +221,7 @@ import LinkOptBar from '@/components/canvas/components/editor/LinkOptBar'
const erd = elementResizeDetectorMaker() const erd = elementResizeDetectorMaker()
export default { export default {
components: { LinkOptBar, UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport, ExportExcel }, components: { LinkOptBar, UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport },
model: { model: {
prop: 'show', prop: 'show',
event: 'change' event: 'change'
@ -564,10 +563,8 @@ export default {
bus.$on('trigger-search-button', this.triggerSearchButton) bus.$on('trigger-search-button', this.triggerSearchButton)
bus.$on('trigger-reset-button', this.triggerResetButton) bus.$on('trigger-reset-button', this.triggerResetButton)
this.initPdfTemplate() this.initPdfTemplate()
bus.$on('data-export-center', this.downloadClick)
}, },
beforeDestroy() { beforeDestroy() {
bus.$off('data-export-center', this.downloadClick)
if (this.$refs[this.previewTempRefId]) { if (this.$refs[this.previewTempRefId]) {
erd.uninstall(this.$refs[this.previewTempRefId]) erd.uninstall(this.$refs[this.previewTempRefId])
} }
@ -582,9 +579,6 @@ export default {
bus.$off('trigger-reset-button', this.triggerResetButton) bus.$off('trigger-reset-button', this.triggerResetButton)
}, },
methods: { methods: {
downloadClick() {
this.$refs.ExportExcelRef.init()
},
reloadWatermark() { reloadWatermark() {
if (this.screenShotStatues) { if (this.screenShotStatues) {
this.initWatermark('preview-temp-canvas-main') this.initWatermark('preview-temp-canvas-main')
@ -881,11 +875,89 @@ export default {
this.$nextTick(() => (eventBus.$emit('resizing', ''))) this.$nextTick(() => (eventBus.$emit('resizing', '')))
} }
}, },
openMessageLoading(cb) {
const h = this.$createElement
const iconClass = `el-icon-loading`
const customClass = `de-message-loading de-message-export`
this.$message({
message: h('p', null, [
this.$t('data_export.exporting'),
h(
Button,
{
props: {
type: 'text',
},
class: 'btn-text',
on: {
click: () => {
cb()
}
}
},
this.$t('data_export.export_center')
),
this.$t('data_export.export_info')
]),
iconClass,
showClose: true,
customClass
})
},
openMessageSuccess(text, type, cb) {
const h = this.$createElement
const iconClass = `el-icon-${type || 'success'}`
const customClass = `de-message-${type || 'success'} de-message-export`
this.$message({
message: h('p', null, [
h('span', null, text),
h(
Button,
{
props: {
type: 'text',
},
class: 'btn-text',
on: {
click: () => {
cb()
}
}
},
this.$t('data_export.export_center')
)
]),
iconClass,
showClose: true,
customClass
})
},
exportData() {
bus.$emit('data-export-center')
},
exportExcel() { exportExcel() {
this.$refs['userViewDialog-canvas-main'].exportExcel() this.$refs['userViewDialog-canvas-main'].exportExcel((val) => {
if (val && val.success) {
this.openMessageLoading(this.exportData)
}
if (val && val.success === false) {
this.openMessageSuccess(`${this.showChartTableInfo.title ? this.showChartTableInfo.title : this.showChartTableInfo.name} 导出失败,前往`, 'error', this.exportData)
}
this.dialogLoading = false
})
}, },
exportSourceDetails() { exportSourceDetails() {
this.$refs['userViewDialog-canvas-main'].exportExcel() this.$refs['userViewDialog-canvas-main'].exportExcel((val) => {
if (val && val.success) {
this.openMessageLoading(this.exportData)
}
if (val && val.success === false) {
this.openMessageSuccess(`${this.showChartTableInfo.title ? this.showChartTableInfo.title : this.showChartTableInfo.name} 导出失败,前往`, 'error', this.exportData)
}
this.dialogLoading = false
})
}, },
exportViewImg() { exportViewImg() {
this.imageDownloading = true this.imageDownloading = true

View File

@ -778,8 +778,7 @@ export default {
this.$message({ this.$message({
message: h('p', null, [ message: h('p', null, [
this.$t('data_export.exporting'), this.$t('data_export.exporting'),
this.editMode === 'preview' h(
? h(
Button, Button,
{ {
props: { props: {
@ -793,7 +792,7 @@ export default {
} }
}, },
this.$t('data_export.export_center') this.$t('data_export.export_center')
) : this.$t('data_export.export_center'), ),
this.$t('data_export.export_info') this.$t('data_export.export_info')
]), ]),
iconClass, iconClass,
@ -986,8 +985,8 @@ export default {
this.scale = Math.min(this.previewCanvasScale.scalePointWidth, this.previewCanvasScale.scalePointHeight) * this.scaleCoefficient this.scale = Math.min(this.previewCanvasScale.scalePointWidth, this.previewCanvasScale.scalePointHeight) * this.scaleCoefficient
const customAttrChart = JSON.parse(this.sourceCustomAttrStr) const customAttrChart = JSON.parse(this.sourceCustomAttrStr)
const customStyleChart = JSON.parse(this.sourceCustomStyleStr) const customStyleChart = JSON.parse(this.sourceCustomStyleStr)
recursionTransObj(customAttrTrans, customAttrChart, this.scale, this.scaleCoefficientType) recursionTransObj(customAttrTrans, customAttrChart, this.scale, this.scaleCoefficientType, this.chart?.render)
recursionTransObj(customStyleTrans, customStyleChart, this.scale, this.scaleCoefficientType) recursionTransObj(customStyleTrans, customStyleChart, this.scale, this.scaleCoefficientType, this.chart?.render)
// //
if (this.chart.type === 'map' && this.scaleCoefficientType === 'mobile') { if (this.chart.type === 'map' && this.scaleCoefficientType === 'mobile') {
customAttrChart.label.show = false customAttrChart.label.show = false

View File

@ -296,14 +296,14 @@ export function getScaleValue(propValue, scale) {
return propValueTemp > 1 ? propValueTemp : 1 return propValueTemp > 1 ? propValueTemp : 1
} }
export function recursionTransObj(template, infoObj, scale, terminal) { export function recursionTransObj(template, infoObj, scale, terminal, render) {
for (const templateKey in template) { for (const templateKey in template) {
// 如果是数组 进行赋值计算 // 如果是数组 进行赋值计算
if (template[templateKey] instanceof Array) { if (template[templateKey] instanceof Array) {
template[templateKey].forEach(templateProp => { template[templateKey].forEach(templateProp => {
if (infoObj[templateKey] && infoObj[templateKey][templateProp]) { if (infoObj[templateKey] && infoObj[templateKey][templateProp]) {
// 移动端特殊属性值设置 // 移动端特殊属性值设置
if (terminal === 'mobile' && mobileSpecialProps[templateProp] !== undefined) { if (terminal === 'mobile' && mobileSpecialProps[templateProp] !== undefined && render !== 'antv') {
infoObj[templateKey][templateProp] = mobileSpecialProps[templateProp] infoObj[templateKey][templateProp] = mobileSpecialProps[templateProp]
} else { } else {
infoObj[templateKey][templateProp] = getScaleValue(infoObj[templateKey][templateProp], scale) infoObj[templateKey][templateProp] = getScaleValue(infoObj[templateKey][templateProp], scale)
@ -313,7 +313,7 @@ export function recursionTransObj(template, infoObj, scale, terminal) {
} else { } else {
// 如果是对象 继续进行递归 // 如果是对象 继续进行递归
if (infoObj[templateKey]) { if (infoObj[templateKey]) {
recursionTransObj(template[templateKey], infoObj[templateKey], scale, terminal) recursionTransObj(template[templateKey], infoObj[templateKey], scale, terminal, render)
} }
} }
} }