forked from github/dataease
Merge branch 'main' of github.com:dataease/dataease into main
This commit is contained in:
commit
11956c8745
@ -1,13 +1,12 @@
|
||||
package io.dataease.base.mapper.ext;
|
||||
|
||||
import io.dataease.base.mapper.ext.query.GridExample;
|
||||
import io.dataease.dto.panel.po.PanelViewPo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ExtPanelViewMapper {
|
||||
|
||||
List<PanelViewPo> groups(GridExample example);
|
||||
List<PanelViewPo> groups(String userId);
|
||||
|
||||
List<PanelViewPo> views(GridExample example);
|
||||
List<PanelViewPo> views(String userId);
|
||||
}
|
||||
|
@ -11,32 +11,23 @@
|
||||
|
||||
|
||||
|
||||
<select id="groups" parameterType="io.dataease.base.mapper.ext.query.GridExample" resultMap="treeNodeMap">
|
||||
<select id="groups" resultMap="treeNodeMap">
|
||||
select id, pid, name, `type`
|
||||
from chart_group
|
||||
<if test="_parameter != null">
|
||||
<include refid="io.dataease.base.mapper.ext.query.GridSql.gridCondition" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="orderByClause == null">
|
||||
order by create_time desc
|
||||
</if>
|
||||
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t,chart_group
|
||||
<where>
|
||||
FIND_IN_SET(chart_group.id,cids)
|
||||
</where>
|
||||
order by create_time desc
|
||||
|
||||
</select>
|
||||
|
||||
<select id="views" parameterType="io.dataease.base.mapper.ext.query.GridExample" resultMap="treeNodeMap">
|
||||
select id, scene_id as pid ,title as name, `type`
|
||||
from chart_view
|
||||
<if test="_parameter != null">
|
||||
<include refid="io.dataease.base.mapper.ext.query.GridSql.gridCondition" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="orderByClause == null">
|
||||
order by create_time desc
|
||||
</if>
|
||||
<select id="views" resultMap="treeNodeMap">
|
||||
select id, scene_id as pid , name, `type`
|
||||
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t, chart_view
|
||||
<where>
|
||||
FIND_IN_SET(chart_view.id,cids)
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
|
@ -18,9 +18,13 @@ import java.util.List;
|
||||
public interface ViewApi {
|
||||
|
||||
|
||||
@ApiOperation("视图树")
|
||||
// @ApiOperation("视图树")
|
||||
// @PostMapping("/tree")
|
||||
// List<PanelViewDto> tree(BaseGridRequest request);
|
||||
|
||||
@ApiOperation("授权的视图树")
|
||||
@PostMapping("/tree")
|
||||
List<PanelViewDto> tree(BaseGridRequest request);
|
||||
List<PanelViewDto> treeWithAuth();
|
||||
|
||||
|
||||
@ApiOperation("根据仪表板Id查询视图")
|
||||
|
@ -34,16 +34,9 @@ public class ViewServer implements ViewApi {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PanelViewDto> tree(@RequestBody BaseGridRequest request) {
|
||||
List<ConditionEntity> conditions = new ArrayList<>();
|
||||
ConditionEntity condition = new ConditionEntity();
|
||||
condition.setField("create_by");
|
||||
condition.setOperator("eq");
|
||||
condition.setValue(AuthUtils.getUser().getUsername());
|
||||
conditions.add(condition);
|
||||
request.setConditions(conditions);
|
||||
List<PanelViewPo> groups = panelViewService.groups(request);
|
||||
List<PanelViewPo> views = panelViewService.views(request);
|
||||
public List<PanelViewDto> treeWithAuth() {
|
||||
List<PanelViewPo> groups = panelViewService.groups();
|
||||
List<PanelViewPo> views = panelViewService.views();
|
||||
List<PanelViewDto> panelViewDtos = panelViewService.buildTree(groups, views);
|
||||
return panelViewDtos;
|
||||
}
|
||||
|
@ -2,9 +2,16 @@ package io.dataease.job.sechedule;
|
||||
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import org.quartz.*;
|
||||
import org.quartz.impl.triggers.CronTriggerImpl;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -73,7 +80,9 @@ public class ScheduleManager {
|
||||
|
||||
triggerBuilder.withIdentity(triggerKey);
|
||||
|
||||
triggerBuilder.startAt(startTime);
|
||||
if (startTime.before(new Date())) {
|
||||
triggerBuilder.startAt(getNTimeByCron(cron));
|
||||
}
|
||||
|
||||
if (endTime != null) {
|
||||
triggerBuilder.endAt(endTime);
|
||||
@ -149,7 +158,9 @@ public class ScheduleManager {
|
||||
|
||||
triggerBuilder.withIdentity(triggerKey);// 触发器名,触发器组
|
||||
|
||||
triggerBuilder.startAt(startTime);
|
||||
if (startTime.before(new Date())) {
|
||||
triggerBuilder.startAt(getNTimeByCron(cron));
|
||||
}
|
||||
|
||||
if (endTime != null) {
|
||||
triggerBuilder.endAt(endTime);
|
||||
@ -395,4 +406,23 @@ public class ScheduleManager {
|
||||
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
public static Date getNTimeByCron(String cron) {
|
||||
try {
|
||||
CronTriggerImpl cronTriggerImpl = new CronTriggerImpl();
|
||||
cronTriggerImpl.setCronExpression(cron);
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
Date now = calendar.getTime();
|
||||
// calendar.add(java.util.Calendar.YEAR, 1);
|
||||
calendar.add(Calendar.MONTH, 2);
|
||||
|
||||
List<Date> dates = TriggerUtils.computeFireTimesBetween(cronTriggerImpl, null, now, calendar.getTime());
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String nextTime = dateFormat.format(dates.get(0));
|
||||
Date date = dateFormat.parse(nextTime);
|
||||
return date;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -228,11 +228,11 @@ i18n_auth_manage=Manage
|
||||
i18n_auth_grant=Grant
|
||||
i18n_template_system=System Template
|
||||
i18n_template_self=Self Template
|
||||
i18n_name_cant_repeat_same_group=Name is already exists in the same group
|
||||
i18n_name_cant_repeat_same_group=Name is already used in the same group
|
||||
i18n_chart_count=Count*
|
||||
i18n_excel_have_merge_region=Excel has merged region
|
||||
i18n_cron_expression_error=Cron expression error
|
||||
i18n_same_folder_can_not_repeat=Same Folder Can Not Repeat
|
||||
i18n_same_folder_can_not_repeat=Name is already used in the same folder
|
||||
i18n_default_panel=Default Dashboard
|
||||
i18n_panel_list=Dashboard
|
||||
i18n_processing_data=Processing data now, Refresh later
|
||||
|
@ -230,11 +230,11 @@ i18n_auth_manage=管理
|
||||
i18n_auth_grant=授权
|
||||
i18n_template_system=系统模板
|
||||
i18n_template_self=用户模板
|
||||
i18n_name_cant_repeat_same_group=同一分组下名称不能重复
|
||||
i18n_name_cant_repeat_same_group=同一分组下该名称已被使用
|
||||
i18n_chart_count=记录数*
|
||||
i18n_excel_have_merge_region=Excel 存在合并单元格
|
||||
i18n_cron_expression_error=Cron 表达式校验错误
|
||||
i18n_same_folder_can_not_repeat=相同的目录下名称不能重复
|
||||
i18n_same_folder_can_not_repeat=同一目录下该名称已被使用
|
||||
i18n_default_panel=默认仪表板
|
||||
i18n_panel_list=仪表板
|
||||
i18n_processing_data=正在处理数据,稍后刷新
|
||||
|
@ -230,11 +230,11 @@ i18n_auth_manage=管理
|
||||
i18n_auth_grant=授權
|
||||
i18n_template_system=系統模板
|
||||
i18n_template_self=用戶模板
|
||||
i18n_name_cant_repeat_same_group=同一分組下名稱不能重復
|
||||
i18n_name_cant_repeat_same_group=同一分組下該名稱已被使用
|
||||
i18n_chart_count=記錄數*
|
||||
i18n_excel_have_merge_region=Excel存在合並單元格
|
||||
i18n_cron_expression_error=Cron表達式校驗錯誤
|
||||
i18n_same_folder_can_not_repeat=相同的目錄下名稱不能重復
|
||||
i18n_same_folder_can_not_repeat=同一目錄下該名稱已被使用
|
||||
i18n_default_panel=默認儀表板
|
||||
i18n_panel_list=儀表板
|
||||
i18n_processing_data=正在處理數據,稍後刷新
|
||||
|
@ -90,11 +90,15 @@ div:focus {
|
||||
width: 50% !important;
|
||||
|
||||
.el-dialog__header{
|
||||
background-color: #f4f4f5;
|
||||
// background-color: #f4f4f5;
|
||||
padding: 10px 20px !important;
|
||||
|
||||
.el-dialog__headerbtn {
|
||||
top: 15px !important;
|
||||
}
|
||||
}
|
||||
.el-dialog__body{
|
||||
padding: 1px 20px !important;
|
||||
padding: 1px 15px !important;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -445,6 +445,7 @@ export default {
|
||||
},
|
||||
|
||||
close() {
|
||||
this.$refs['groupForm'].resetFields()
|
||||
this.editGroup = false
|
||||
this.groupForm = {
|
||||
name: '',
|
||||
|
@ -458,6 +458,7 @@ export default {
|
||||
},
|
||||
|
||||
close() {
|
||||
this.$refs['groupForm'].resetFields()
|
||||
this.editGroup = false
|
||||
this.groupForm = {
|
||||
name: '',
|
||||
|
@ -127,7 +127,7 @@
|
||||
:in-draw="false"
|
||||
/>
|
||||
</filter-dialog>
|
||||
<div style="text-align: end !important;margin: 0 15px !important;">
|
||||
<div style="text-align: end !important;margin: 0 15px 10px !important;">
|
||||
<span slot="footer">
|
||||
<el-button size="mini" @click="cancelFilter">{{ $t('commons.cancel') }}</el-button>
|
||||
<el-button :disabled="!currentFilterCom.options.attrs.fieldId" type="primary" size="mini" @click="sureFilter">{{ $t('commons.confirm') }}</el-button>
|
||||
|
@ -521,7 +521,7 @@ export default {
|
||||
.ms-main-container {
|
||||
height: 100%;
|
||||
min-height: 400px;
|
||||
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.filter-field {
|
||||
@ -588,13 +588,14 @@ export default {
|
||||
}
|
||||
|
||||
.filter-content {
|
||||
height: calc(50vh - 130px);
|
||||
height: calc(50vh - 120px);
|
||||
top: 160px;
|
||||
|
||||
}
|
||||
|
||||
.filter-dialog-tabs {
|
||||
border: 1px solid #E6E6E6;
|
||||
padding: 10px;
|
||||
height: 100%;
|
||||
>>> div.el-tabs__content {
|
||||
height: calc(100% - 55px);
|
||||
@ -602,12 +603,12 @@ export default {
|
||||
}
|
||||
|
||||
.filter-common {
|
||||
margin: 10px 10px;
|
||||
margin: 10px 5px;
|
||||
|
||||
}
|
||||
|
||||
.component-header {
|
||||
margin: 20px 10px !important;
|
||||
margin: 5px 5px 15px;
|
||||
}
|
||||
|
||||
.component-result-content {
|
||||
|
@ -309,8 +309,16 @@ export default {
|
||||
|
||||
methods: {
|
||||
sortChange({ column, prop, order }) {
|
||||
this.orderConditions = []
|
||||
if (!order) {
|
||||
this.search(this.last_condition)
|
||||
return
|
||||
}
|
||||
if (prop === 'dept') {
|
||||
prop = 'deptId'
|
||||
prop = 'u.deptId'
|
||||
}
|
||||
if (prop === 'status') {
|
||||
prop = 'u.enabled'
|
||||
}
|
||||
this.orderConditions = []
|
||||
addOrder({ field: prop, value: order }, this.orderConditions)
|
||||
|
Loading…
Reference in New Issue
Block a user