Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wangjiahao
2021-07-28 17:47:56 +08:00
12 changed files with 66 additions and 77 deletions

View File

@@ -507,14 +507,20 @@
<!--编辑视图使用的数据集的字段-->
<el-dialog
v-dialogDrag
:visible="editDsField"
:show-close="false"
class="dialog-css"
:destroy-on-close="true"
:fullscreen="true"
>
<field-edit :param="table" @switchComponent="closeEditDsField" />
<field-edit :param="table" />
<div slot="title" class="dialog-footer">
<span style="font-size: 14px;">
{{ $t('dataset.field_manage') }}
<span v-if="table">[{{ table.name }}]</span>
</span>
<el-button size="mini" style="float: right;" @click="closeEditDsField">{{ $t('chart.close') }}</el-button>
</div>
</el-dialog>
</el-row>
</template>

View File

@@ -270,7 +270,7 @@ export default {
type: 'excel',
mode: parseInt(this.mode),
// info: '{"data":"' + this.path + '"}',
info: JSON.stringify({ data: this.path }),
info: JSON.stringify({ data: this.path, sheets: [this.sheets[0]] }),
editType: this.param.editType ? this.param.editType : 0
}
}

View File

@@ -16,7 +16,7 @@
<el-form-item class="form-item">
<el-button v-if="hasDataPermission('manage',param.privileges)" size="mini" @click="addCalcField">{{ $t('dataset.add_calc_field') }}</el-button>
</el-form-item>
<el-form-item class="form-item" style="float: right;">
<el-form-item class="form-item" style="float: right;margin-right: 0;">
<el-input
v-model="searchField"
size="mini"
@@ -241,6 +241,7 @@
class="dialog-css"
:destroy-on-close="true"
:title="$t('dataset.add_calc_field')"
append-to-body
>
<calc-field-edit :param="param" :table-fields="tableFields" />
<div slot="footer" class="dialog-footer">
@@ -324,10 +325,6 @@ export default {
})
},
closeEdit() {
this.$emit('switchComponent', { name: 'ViewTable', param: this.param })
},
dqTrans(item, val) {
if (val === 'd') {
item.groupType = 'q'

View File

@@ -1,7 +1,7 @@
<template>
<el-col>
<el-row>
<el-button v-if="hasDataPermission('manage',param.privileges) || table.type !== 'excel'" icon="el-icon-setting" size="mini" @click="showConfig">
<el-button v-if="hasDataPermission('manage',param.privileges) && table.type !== 'excel'" icon="el-icon-setting" size="mini" @click="showConfig">
{{ $t('dataset.update_setting') }}
</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="refreshLog">
@@ -96,7 +96,7 @@
append-to-body
>
<el-col>
<el-form ref="taskForm" :form="taskForm" :model="taskForm" label-width="100px" size="mini" :rules="taskFormRules">
<el-form :form="taskForm" :model="taskForm" label-width="100px" size="mini" ref="taskForm" :rules="taskFormRules">
<el-form-item :label="$t('dataset.task_name')" prop="name">
<el-input
v-model="taskForm.name"
@@ -143,15 +143,15 @@
<el-form-item v-if="taskForm.rate === 'SIMPLE_CRON'" label="">
<el-form :inline="true">
<el-form-item :label="$t('cron.every')">
<el-input v-model="taskForm.extraData.simple_cron_value" size="mini" type="number" min="1" @change="onSimpleCronChange()" />
<el-form-item :label="$t('cron.every')" >
<el-input v-model="taskForm.extraData.simple_cron_value" size="mini" type="number" min="1" @change="onSimpleCronChange()" />
</el-form-item>
<el-form-item class="form-item">
<el-select v-model="taskForm.extraData.simple_cron_type" filterable size="mini" @change="onSimpleCronChange()">
<el-option :label="$t('cron.minute')" value="minute" />
<el-option :label="$t('cron.hour')" value="hour" />
<el-option :label="$t('cron.day')" value="day" />
<el-select v-model="taskForm.extraData.simple_cron_type" filterable size="mini" @change="onSimpleCronChange()" >
<el-option :label="$t('cron.minute_default')" value="minute" />
<el-option :label="$t('cron.hour_default')" value="hour" />
<el-option :label="$t('cron.day_default')" value="day" />
</el-select>
</el-form-item>
<el-form-item class="form-item" :label="$t('cron.every_exec')" />
@@ -534,7 +534,7 @@ export default {
}
this.incrementalConfig.tableId = this.table.id
let startTime = new Date(task.startTime).getTime()
if (startTime < new Date().getTime()) {
if(startTime < new Date().getTime()){
startTime = new Date().getTime()
}
task.startTime = startTime
@@ -558,9 +558,10 @@ export default {
this.listTask()
this.listTaskLog()
})
} else {
}else {
return false
}
})
},
deleteTask(task) {
@@ -588,27 +589,27 @@ export default {
},
onSimpleCronChange() {
if (this.taskForm.extraData.simple_cron_type === 'minute') {
if (this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 59) {
this.$message({ message: this.$t('cron.minute_limit'), type: 'warning', showClose: true })
if(this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 59){
this.$message({message: this.$t('cron.minute_limit'), type: 'warning', showClose: true})
this.taskForm.extraData.simple_cron_value = 59
}
this.taskForm.cron = '0 0/' + this.taskForm.extraData.simple_cron_value + ' * * * ? *'
this.taskForm.cron = '0 0/'+ this.taskForm.extraData.simple_cron_value + ' * * * ? *'
return
}
if (this.taskForm.extraData.simple_cron_type === 'hour') {
if (this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 23) {
this.$message({ message: this.$t('cron.hour_limit'), type: 'warning', showClose: true })
if(this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 23){
this.$message({message: this.$t('cron.hour_limit'), type: 'warning', showClose: true})
this.taskForm.extraData.simple_cron_value = 23
}
this.taskForm.cron = '0 0 0/' + this.taskForm.extraData.simple_cron_value + ' * * ? *'
this.taskForm.cron = '0 0 0/'+ this.taskForm.extraData.simple_cron_value + ' * * ? *'
return
}
if (this.taskForm.extraData.simple_cron_type === 'day') {
if (this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 31) {
this.$message({ message: this.$t('cron.day_limit'), type: 'warning', showClose: true })
if(this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 31){
this.$message({message: this.$t('cron.day_limit'), type: 'warning', showClose: true})
this.taskForm.extraData.simple_cron_value = 31
}
this.taskForm.cron = '0 0 0 1/' + this.taskForm.extraData.simple_cron_value + ' * ? *'
this.taskForm.cron = '0 0 0 1/'+ this.taskForm.extraData.simple_cron_value + ' * ? *'
return
}
},
@@ -618,16 +619,16 @@ export default {
this.taskForm.endTime = ''
this.taskForm.cron = ''
}
if (this.taskForm.rate === 'SIMPLE_CRON') {
if (this.taskForm.rate === 'SIMPLE_CRON'){
this.taskForm.cron = '0 0 0/1 * * ? *'
}
if (this.taskForm.rate === 'CRON') {
if (this.taskForm.rate === 'CRON'){
this.taskForm.cron = '00 00 * ? * * *'
}
},
listTaskLog(loading = true) {
const params = { 'conditions': [{ 'field': 'dataset_table_task_log.table_id', 'operator': 'eq', 'value': this.table.id }], 'orders': [] }
post('/dataset/taskLog/list/' + this.table.type + '/' + this.page.currentPage + '/' + this.page.pageSize, params, loading).then(response => {
const params = {"conditions":[{"field":"dataset_table_task_log.table_id","operator":"eq","value": this.table.id}],"orders":[]}
post('/dataset/taskLog/list/' + this.table.type + '/' + this.page.currentPage + '/' + this.page.pageSize, params, loading).then(response => {
this.taskLogData = response.data.listObject
this.page.total = response.data.itemCount
})

View File

@@ -93,7 +93,7 @@ export default {
rule: {
username: [
{ required: true, message: this.$t('user.input_id'), trigger: 'blur' },
{ min: 1, max: 50, message: this.$t('commons.input_limit', [1, 50]), trigger: 'blur' },
{ min: 2, max: 10, message: this.$t('commons.input_limit', [2, 10]), trigger: 'blur' },
{
required: true,
pattern: '^[^\u4e00-\u9fa5]+$',
@@ -103,7 +103,7 @@ export default {
],
nickName: [
{ required: true, message: this.$t('user.input_name'), trigger: 'blur' },
{ min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur' },
{ min: 2, max: 10, message: this.$t('commons.input_limit', [2, 10]), trigger: 'blur' },
{
required: true,
message: this.$t('user.special_characters_are_not_supported'),