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

This commit is contained in:
taojinlong 2021-12-30 14:50:48 +08:00
commit 7ffe5514a9
13 changed files with 132 additions and 58 deletions

View File

@ -20,7 +20,6 @@ import io.dataease.service.system.EmailService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.quartz.*;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -67,13 +66,10 @@ public class EmailTaskHandler extends TaskHandler implements Job {
XpackEmailTemplateDTO emailTemplate = (XpackEmailTemplateDTO) jobDataMap.get("emailTemplate");
SysUserEntity creator = (SysUserEntity) jobDataMap.get("creator");
proxy().sendReport(taskInstance, emailTemplate, creator);
sendReport(taskInstance, emailTemplate, creator);
}
public EmailTaskHandler proxy() {
return CommonBeanFactory.getBean(EmailTaskHandler.class);
}
public Long saveInstance(GlobalTaskInstance taskInstance) {
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
@ -102,7 +98,7 @@ public class EmailTaskHandler extends TaskHandler implements Job {
emailXpackService.saveInstance(taskInstance);
}
@Async
public void sendReport(GlobalTaskInstance taskInstance, XpackEmailTemplateDTO emailTemplateDTO,
SysUserEntity user) {
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
@ -122,6 +118,7 @@ public class EmailTaskHandler extends TaskHandler implements Job {
} catch (Exception e) {
error(taskInstance, e);
LogUtil.error(e.getMessage(), e);
e.printStackTrace();
}
}

View File

@ -114,7 +114,7 @@ public class DorisQueryProvider extends QueryProvider {
} else if (f.getDeType() == 3) {
fieldName = String.format(DorisConstants.CAST, originField, DorisConstants.DEFAULT_FLOAT_FORMAT);
} else if (f.getDeType() == 1) {
fieldName = String.format(DorisConstants.DATE_FORMAT, originField, DorisConstants.DEFAULT_DATE_FORMAT);
fieldName = String.format(DorisConstants.STR_TO_DATE, originField, DorisConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = originField;
}

View File

@ -106,7 +106,7 @@ public class HiveQueryProvider extends QueryProvider {
} else if (f.getDeType() == DeTypeConstants.DE_FLOAT) {
fieldName = String.format(HiveConstants.CAST, originField, HiveConstants.DEFAULT_FLOAT_FORMAT);
} else if (f.getDeType() == DeTypeConstants.DE_TIME) {
fieldName = String.format(HiveConstants.DATE_FORMAT, originField, HiveConstants.DEFAULT_DATE_FORMAT);
fieldName = String.format(HiveConstants.STR_TO_DATE, originField, HiveConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = originField;
}

View File

@ -113,7 +113,7 @@ public class MysqlQueryProvider extends QueryProvider {
} else if (f.getDeType() == 3) {
fieldName = String.format(MySQLConstants.CAST, originField, MySQLConstants.DEFAULT_FLOAT_FORMAT);
} else if (f.getDeType() == 1) {
fieldName = String.format(MySQLConstants.DATE_FORMAT, originField, MySQLConstants.DEFAULT_DATE_FORMAT);
fieldName = String.format(MySQLConstants.STR_TO_DATE, originField, MySQLConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = originField;
}

View File

@ -535,7 +535,7 @@ export default {
return this.$store.state.curComponent
},
curGap() {
return this.element.auxiliaryMatrix && this.element.type !== 'custom' ? this.componentGap : 0
return (this.canvasStyleData.panel.gap === 'yes' && this.element.auxiliaryMatrix && this.element.type !== 'custom') ? this.componentGap : 0
},
...mapState([
'editor',

View File

@ -85,7 +85,7 @@ export default {
return (this.curComponent && this.config === this.curComponent) && !this.previewVisible
},
curGap() {
return this.config.auxiliaryMatrix ? this.componentGap : 0
return (this.canvasStyleData.panel.gap === 'yes' && this.config.auxiliaryMatrix) ? this.componentGap : 0
},
...mapState([
'mobileLayoutStatus',

View File

@ -4,7 +4,7 @@
<div
id="canvasInfoTemp"
ref="canvasInfoTemp"
:style="[{height:mainHeight},screenShotStyle]"
:style="[canvasInfoTempStyle,screenShotStyle]"
class="main-class"
@mouseup="deselectCurComponent"
@mousedown="handleMouseDown"
@ -144,6 +144,19 @@ export default {
}
}
},
canvasInfoTempStyle() {
if (this.screenShot) {
return {
width: '100%',
height: this.mainHeight
}
} else {
return {
width: '100%',
height: '100%'
}
}
},
customStyle() {
let style = {
width: '100%'

View File

@ -84,12 +84,20 @@ export default {
])
},
created() {
this.pOption = this.element.videoLinks[this.element.videoLinks.videoType]
this.pOption.height = this.h - (this.curGap * 2)
this.initOption()
},
watch: {
h(newVal, oldVla) {
this.initOption()
}
},
mounted() {
},
methods: {
initOption() {
this.pOption = this.element.videoLinks[this.element.videoLinks.videoType]
this.pOption.height = this.h - (this.curGap * 2)
},
// listen event
onPlayerPlay(player) {
// console.log('player play!', player)

View File

@ -261,6 +261,10 @@ export default {
if (!this.preCanvasPanel || this.preCanvasPanel.resultCount !== newVal.panel.resultCount || this.preCanvasPanel.resultMode !== newVal.panel.resultMode) {
this.getData(this.element.propValue.viewId, false)
}
// gap
if (this.preCanvasPanel && this.preCanvasPanel.gap !== newVal.panel.gap) {
this.$refs[this.element.propValue.id].chartResize()
}
this.preCanvasPanel = deepCopy(newVal.panel)
},
deep: true

View File

@ -145,6 +145,7 @@
:model="groupForm"
:rules="groupFormRules"
@keypress.enter.native="saveGroup(groupForm)"
@submit.native.prevent
>
<el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="groupForm.name" />
@ -159,7 +160,7 @@
<!--rename chart-->
<el-dialog v-dialogDrag :title="$t('chart.chart')" :visible="editTable" :show-close="false" width="30%">
<el-form ref="tableForm" :model="tableForm" :rules="tableFormRules" @keypress.enter.native="saveTable(tableForm)">
<el-form ref="tableForm" :model="tableForm" :rules="tableFormRules" @submit.native.prevent @keypress.enter.native="saveTable(tableForm)">
<el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="tableForm.name" />
</el-form-item>

View File

@ -174,7 +174,7 @@
</el-col>
<el-dialog v-dialogDrag :title="dialogTitle" :visible="editGroup" :show-close="false" width="30%">
<el-form ref="groupForm" :model="groupForm" :rules="groupFormRules" @keypress.enter.native="saveGroup(groupForm)">
<el-form ref="groupForm" :model="groupForm" :rules="groupFormRules" @submit.native.prevent @keypress.enter.native="saveGroup(groupForm)">
<el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="groupForm.name" />
</el-form-item>
@ -188,7 +188,7 @@
</el-col>
<el-dialog v-dialogDrag :title="$t('dataset.table')" :visible="editTable" :show-close="false" width="30%">
<el-form ref="tableForm" :model="tableForm" :rules="tableFormRules" @keypress.enter.native="saveTable(tableForm)">
<el-form ref="tableForm" :model="tableForm" :rules="tableFormRules" @submit.native.prevent @keypress.enter.native="saveTable(tableForm)">
<el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="tableForm.name" />
</el-form-item>

View File

@ -15,11 +15,7 @@
<el-link class="de-link" style="width: 370px;" disabled>{{ $t('panel.link_share_desc') }}</el-link>
</el-form-item>
<el-form-item v-if="valid" :label="$t('panel.link')">
<el-input
v-model.number="form.uri"
disabled
style="width: 370px;"
/>
<el-input v-model.number="form.uri" disabled style="width: 370px;" />
</el-form-item>
<el-form-item v-if="valid" :label="$t('panel.over_time')" prop="overTime">
@ -37,17 +33,34 @@
</el-form-item>
<el-form-item v-if="valid" label=" ">
<el-checkbox v-model="form.enablePwd" @change="resetEnablePwd">{{ $t('panel.passwd_protect') }} </el-checkbox>
<el-checkbox v-model="form.enablePwd" @change="resetEnablePwd">{{ $t('panel.passwd_protect') }} </el-checkbox>
<span v-if="form.enablePwd" class="de-span">{{ form.pwd }}</span>
<span v-if="form.enablePwd" class="de-span" @click="resetPwd"><el-link :underline="false" type="primary">{{ $t('commons.reset') }}</el-link></span>
<span v-if="form.enablePwd" class="de-span" @click="resetPwd">
<el-link :underline="false" type="primary">{{ $t('commons.reset') }}</el-link>
</span>
</el-form-item>
<div v-if="valid" class="auth-root-class">
<span slot="footer">
<el-button v-if="!form.enablePwd" v-clipboard:copy="form.uri" v-clipboard:success="onCopy" v-clipboard:error="onError" size="mini" type="primary">{{ $t('panel.copy_link') }}</el-button>
<el-button v-if="form.enablePwd" v-clipboard:copy="form.uri + ' Password: '+ form.pwd" v-clipboard:success="onCopy" v-clipboard:error="onError" size="mini" type="primary">{{ $t('panel.copy_link_passwd') }}</el-button>
<el-button
v-if="!form.enablePwd"
v-clipboard:copy="form.uri"
v-clipboard:success="onCopy"
v-clipboard:error="onError"
size="mini"
type="primary"
>{{ $t('panel.copy_link') }}</el-button>
<el-button
v-if="form.enablePwd"
v-clipboard:copy="form.uri + ' Password: '+ form.pwd"
v-clipboard:success="onCopy"
v-clipboard:error="onError"
size="mini"
type="primary"
>
{{ $t('panel.copy_link_passwd') }}</el-button>
</span>
</div>
@ -56,8 +69,14 @@
</div>
</template>
<script>
import { loadGenerate, setPwd, switchValid, switchEnablePwd, shortUrl, setOverTime } from '@/api/link'
import {
loadGenerate,
setPwd,
switchValid,
switchEnablePwd,
shortUrl,
setOverTime
} from '@/api/link'
export default {
name: 'LinkGenerate',
@ -75,7 +94,11 @@ export default {
pwdNums: 4,
valid: false,
form: {},
defaultForm: { enablePwd: false, pwd: null, uri: null },
defaultForm: {
enablePwd: false,
pwd: null,
uri: null
},
pickerOptions: {
disabledDate: time => {
return time.getTime() < (Date.now() - 8.64e7)
@ -103,9 +126,11 @@ export default {
minTime: '15:51'
},
rules: {
overTime: [
{ required: false, validator: this.validateMin, trigger: 'blur' }
]
overTime: [{
required: false,
validator: this.validateMin,
trigger: 'blur'
}]
}
}
},
@ -122,7 +147,13 @@ export default {
currentGenerate() {
loadGenerate(this.resourceId).then(res => {
const { valid, enablePwd, pwd, uri, overTime } = res.data
const {
valid,
enablePwd,
pwd,
uri,
overTime
} = res.data
this.valid = valid
this.form.enablePwd = enablePwd
this.form.uri = uri ? (this.origin + uri) : uri
@ -183,7 +214,7 @@ export default {
overTime: value
}
setOverTime(param).then(res => {
// this.form.overTime = value
// this.form.overTime = value
this.$forceUpdate()
})
})
@ -192,8 +223,7 @@ export default {
onCopy(e) {
this.$success(this.$t('commons.copy_success'))
},
onError(e) {
},
onError(e) {},
onChange(value) {
const param = {
resourceId: this.resourceId,
@ -207,7 +237,9 @@ export default {
const url = this.form.uri
if (!url) return
shortUrl({ resourceId: this.resourceId }).then(res => {
shortUrl({
resourceId: this.resourceId
}).then(res => {
if (res.success) {
this.form.uri = this.origin + res.data
}
@ -228,15 +260,19 @@ export default {
return new Date(tom.format('yyyy-MM-dd') + ' 23:59:59')
}
if (type === 'month') {
const result = new Date()
const curMonth = now.getMonth() + 1
if (curMonth === 12) {
result.setYear(now.getYear() + 1)
result.setMonth(0)
} else {
result.setMonth(curMonth)
}
return new Date(result.format('yyyy-MM-dd') + ' 23:59:59')
const nowMonth = now.getMonth()
const nowYear = now.getFullYear()
let nowDate = now.getDate()
const tarYear = nowYear
const deffMonth = nowMonth + 1
const diffYear = deffMonth / 12
const targetMonth = deffMonth % 12
const days = this.getMonthDays(targetMonth)
nowDate = nowDate > days ? days : nowDate
return new Date(tarYear + diffYear, deffMonth % 12, nowDate, 23, 59, 59)
}
return null
},
@ -247,21 +283,32 @@ export default {
return callback(new Error('不能小于当前时间'))
}
return callback()
},
getMonthDays(nowMonth) {
var now = new Date()
var monthStartDate = new Date(now.getFullYear(), nowMonth, 1)
var monthEndDate = new Date(now.getFullYear(), nowMonth + 1, 1)
var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24)
return days
}
}
}
</script>
<style lang="scss" scoped>
.de-link{
justify-content: left !important;
}
.de-span {
margin: 0 15px;
}
.auth-root-class {
margin: 15px 0px 5px;
text-align: right;
}
.de-link {
justify-content: left !important;
}
.de-span {
margin: 0 15px;
}
.auth-root-class {
margin: 15px 0px 5px;
text-align: right;
}
</style>

View File

@ -22,7 +22,7 @@
:style="getComponentStyleDefault(config.style)"
:is-edit="false"
:element="config"
:h="itemHeight"
:h="outItemHeight"
/>
</div>
</template>
@ -53,6 +53,9 @@ export default {
}
},
computed: {
outItemHeight() {
return this.itemHeight - (4 * this.componentGap)
},
//
mobileCheckBarShow() {
// 1.
@ -74,7 +77,8 @@ export default {
},
...mapState([
'mobileLayoutStatus',
'componentData'
'componentData',
'componentGap'
])
},
methods: {