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.setTable(dataFillForm.getTableName());
Provider datasourceProvider = ProviderFactory.getProvider(ds.getType());
ExtDDLProvider extDDLProvider = ProviderFactory.gerExtDDLProvider(ds.getType());
setLowerCaseRequest(ds, datasourceProvider, extDDLProvider, datasourceRequest);
List<TableField> tableFields = datasourceProvider.getTableFields(datasourceRequest);
for (TableField tableField : tableFields) {

View File

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

View File

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

View File

@ -172,7 +172,7 @@
<el-button
v-if="showChartInfoType==='details' && showChartInfo.dataFrom !== 'template' && !userId && hasDataPermission('export',panelInfo.privileges)"
size="mini"
:disabled="$store.getters.loadingMap[$store.getters.currentPath] || dialogLoading"
:disabled="$store.getters.loadingMap[$store.getters.currentPath]"
@click="exportSourceDetails"
>
<svg-icon
@ -191,12 +191,11 @@
:open-type="showChartInfoType"
/>
</el-dialog>
<ExportExcel ref="ExportExcelRef" />
</div>
</template>
<script>
import ExportExcel from '@/views/dataset/exportExcel/index.vue'
import { Button } from 'element-ui'
import { getStyle } from '@/components/canvas/utils/style'
import { mapState } from 'vuex'
import ComponentWrapper from './ComponentWrapper'
@ -222,7 +221,7 @@ import LinkOptBar from '@/components/canvas/components/editor/LinkOptBar'
const erd = elementResizeDetectorMaker()
export default {
components: { LinkOptBar, UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport, ExportExcel },
components: { LinkOptBar, UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport },
model: {
prop: 'show',
event: 'change'
@ -564,10 +563,8 @@ export default {
bus.$on('trigger-search-button', this.triggerSearchButton)
bus.$on('trigger-reset-button', this.triggerResetButton)
this.initPdfTemplate()
bus.$on('data-export-center', this.downloadClick)
},
beforeDestroy() {
bus.$off('data-export-center', this.downloadClick)
if (this.$refs[this.previewTempRefId]) {
erd.uninstall(this.$refs[this.previewTempRefId])
}
@ -582,9 +579,6 @@ export default {
bus.$off('trigger-reset-button', this.triggerResetButton)
},
methods: {
downloadClick() {
this.$refs.ExportExcelRef.init()
},
reloadWatermark() {
if (this.screenShotStatues) {
this.initWatermark('preview-temp-canvas-main')
@ -881,11 +875,89 @@ export default {
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() {
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() {
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() {
this.imageDownloading = true

View File

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

View File

@ -296,14 +296,14 @@ export function getScaleValue(propValue, scale) {
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) {
// 如果是数组 进行赋值计算
if (template[templateKey] instanceof Array) {
template[templateKey].forEach(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]
} else {
infoObj[templateKey][templateProp] = getScaleValue(infoObj[templateKey][templateProp], scale)
@ -313,7 +313,7 @@ export function recursionTransObj(template, infoObj, scale, terminal) {
} else {
// 如果是对象 继续进行递归
if (infoObj[templateKey]) {
recursionTransObj(template[templateKey], infoObj[templateKey], scale, terminal)
recursionTransObj(template[templateKey], infoObj[templateKey], scale, terminal, render)
}
}
}