feat: 自定义数据源检测间隔

This commit is contained in:
taojinlong 2022-09-14 16:37:32 +08:00
commit 6132e129e3
69 changed files with 3812 additions and 315 deletions

View File

@ -68,6 +68,7 @@ public class ShiroServiceImpl implements ShiroService {
filterChainDefinitionMap.put("/**/*.json", ANON);
filterChainDefinitionMap.put("/system/ui/**", ANON);
filterChainDefinitionMap.put("/system/file/**", ANON);
filterChainDefinitionMap.put("/**/*.js", ANON);
filterChainDefinitionMap.put("/**/*.css", ANON);
filterChainDefinitionMap.put("/**/*.map", ANON);

View File

@ -0,0 +1,66 @@
package io.dataease.controller.panel;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.controller.handler.annotation.I18n;
import io.dataease.controller.request.panel.PanelAppTemplateRequest;
import io.dataease.plugins.common.base.domain.PanelAppTemplate;
import io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs;
import io.dataease.service.panel.PanelAppTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* Author: wangjiahao
* Date: 2022/9/8
* Description:
*/
@Api(tags = "仪表板:应该关系")
@ApiSupport(order = 170)
@RestController
@RequestMapping("templateApp")
public class PanelAppTemplateController {
@Resource
private PanelAppTemplateService panelAppTemplateService;
@ApiOperation("查询")
@PostMapping("/find")
@I18n
public List<PanelAppTemplateWithBLOBs> templateAppList(@RequestBody PanelAppTemplateRequest request) {
return panelAppTemplateService.list(request);
}
@ApiOperation("保存")
@PostMapping("/save")
@I18n
public void save(@RequestBody PanelAppTemplateRequest request) {
panelAppTemplateService.save(request);
}
@ApiOperation("更新")
@PostMapping("/update")
@I18n
public void update(@RequestBody PanelAppTemplateRequest request) {
panelAppTemplateService.update(request);
}
@ApiOperation("更新")
@DeleteMapping("/delete/{templateAppId}")
@I18n
public void delete(@PathVariable String templateAppId) {
panelAppTemplateService.delete(templateAppId);
}
@ApiOperation("名称校验")
@PostMapping("/nameCheck")
@I18n
public String nameCheck(@RequestBody PanelAppTemplateRequest request) {
return panelAppTemplateService.nameCheck(request);
}
}

View File

@ -15,6 +15,7 @@ import io.dataease.controller.request.panel.PanelGroupRequest;
import io.dataease.controller.request.panel.PanelViewDetailsRequest;
import io.dataease.dto.PermissionProxy;
import io.dataease.dto.authModel.VAuthModelDTO;
import io.dataease.dto.panel.PanelExport2App;
import io.dataease.dto.panel.PanelGroupDTO;
import io.dataease.service.panel.PanelGroupService;
import io.swagger.annotations.Api;
@ -191,4 +192,8 @@ public class PanelGroupController {
public Object findPanelElementInfo(@PathVariable String viewId){
return panelGroupService.findPanelElementInfo(viewId);
}
@GetMapping("/export2AppCheck/{panelId}")
public PanelExport2App export2AppCheck(@PathVariable String panelId){
return panelGroupService.panelExport2AppCheck(panelId);
}
}

View File

@ -0,0 +1,14 @@
package io.dataease.controller.request.panel;
import io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs;
import lombok.Data;
/**
* Author: wangjiahao
* Date: 2022/9/8
* Description:
*/
@Data
public class PanelAppTemplateRequest extends PanelAppTemplateWithBLOBs {
private String optType;
}

View File

@ -1,5 +1,6 @@
package io.dataease.controller.sys;
import io.dataease.plugins.common.base.domain.FileMetadata;
import io.dataease.plugins.common.base.domain.SystemParameter;
import io.dataease.commons.constants.ParamConstants;
import io.dataease.controller.sys.response.BasicInfo;
@ -13,16 +14,15 @@ import io.dataease.service.system.EmailService;
import io.dataease.service.system.SystemParameterService;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.http.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -108,6 +108,23 @@ public class SystemParameterController {
return new ResponseEntity<>(bytes, headers, HttpStatus.OK);
}
@GetMapping("/file/down/{fileId}/{fileName}")
public ResponseEntity<ByteArrayResource> down(@PathVariable("fileId") String fileId, @PathVariable("fileName") String fileName) throws Exception{
FileMetadata fileMetadata = fileService.getFileMetadataById(fileId);
String type = fileMetadata.getType();
if (!StringUtils.endsWith(fileName.toUpperCase(), type.toUpperCase())) {
fileName += ("." + type);
}
byte[] bytes = fileService.loadFileAsBytes(fileId);
ByteArrayResource bar = new ByteArrayResource(bytes);
final HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
ContentDisposition contentDisposition = ContentDisposition.parse("attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
headers.setContentDisposition(contentDisposition);
return new ResponseEntity<>(bar, headers, HttpStatus.OK);
}
@PostMapping(value = "/save/ui", consumes = {"multipart/form-data"})
public void saveUIInfo(@RequestPart("request") Map<String, List<SystemParameterDTO>> systemParameterMap, @RequestPart(value = "files", required = false) List<MultipartFile> bodyFiles) throws IOException {
systemParameterService.saveUIInfo(systemParameterMap, bodyFiles);

View File

@ -0,0 +1,22 @@
package io.dataease.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class TaskInstance implements Serializable{
private String taskId;
private Long executeTime;
private Long finishTime;
private String status;
private String info;
private String qrtzInstance;
}

View File

@ -0,0 +1,12 @@
package io.dataease.dto.panel;
import io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs;
/**
* Author: wangjiahao
* Date: 2022/9/8
* Description:
*/
public class PanelAppTemplateDTO extends PanelAppTemplateWithBLOBs {
}

View File

@ -0,0 +1,61 @@
package io.dataease.dto.panel;
import com.alibaba.fastjson.JSON;
import io.dataease.dto.DatasourceDTO;
import io.dataease.dto.dataset.DataSetTaskDTO;
import io.dataease.plugins.common.base.domain.ChartViewField;
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
import io.dataease.plugins.common.base.domain.DatasetTable;
import io.dataease.plugins.common.base.domain.DatasetTableField;
import lombok.Data;
import org.apache.commons.lang3.ArrayUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Author: wangjiahao
* Date: 2022/9/8
* Description:
*/
@Data
public class PanelExport2App {
private Boolean checkStatus = false;
private String checkMes;
private String panelInfo;
private String chartViewsInfo;
private String chartViewFieldsInfo;
private String datasetTablesInfo;
private String datasetTableFieldsInfo;
private String dataSetTasksInfo;
private String datasourceDTOS;
public PanelExport2App() {
}
public PanelExport2App(String checkMes) {
this.checkMes = checkMes;
}
public PanelExport2App(List<ChartViewWithBLOBs> chartViewsInfo, List<ChartViewField> chartViewFieldsInfo, List<DatasetTable> datasetTablesInfo, List<DatasetTableField> datasetTableFieldsInfo, List<DataSetTaskDTO> dataSetTasksInfo, List<DatasourceDTO> datasourceDTOS) {
List empty = new ArrayList();
this.checkStatus = true;
this.checkMes = "success";
this.chartViewsInfo = JSON.toJSONString(chartViewsInfo!=null?chartViewsInfo:empty);
this.chartViewFieldsInfo = JSON.toJSONString(chartViewFieldsInfo!=null?chartViewFieldsInfo:empty);
this.datasetTablesInfo = JSON.toJSONString(datasetTablesInfo!=null?datasetTablesInfo:empty);
this.datasetTableFieldsInfo = JSON.toJSONString(datasetTableFieldsInfo!=null?datasetTableFieldsInfo:empty);
this.dataSetTasksInfo = JSON.toJSONString(dataSetTasksInfo!=null?dataSetTasksInfo:empty);
this.datasourceDTOS = JSON.toJSONString(datasourceDTOS!=null?datasourceDTOS:empty);
}
}

View File

@ -0,0 +1,25 @@
package io.dataease.dto.panel;
import lombok.Data;
/**
* Author: wangjiahao
* Date: 2022/9/8
* Description:
*/
@Data
public class PanelGroupAppInfo{
private String id;
private String name;
private String snapshot;
private String panelStyle;
private String panelData;
private String staticResource;
}

View File

@ -0,0 +1,14 @@
package io.dataease.ext;
import io.dataease.plugins.common.base.domain.ChartViewField;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ExtChartViewFieldMapper {
List<ChartViewField> findByPanelId(@Param("panelId") String panelId);
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.dataease.ext.ExtChartViewFieldMapper">
<resultMap id="BaseResultMapDTO" type="io.dataease.plugins.common.base.domain.ChartViewField" extends="io.dataease.plugins.common.base.mapper.ChartViewFieldMapper.ResultMapWithBLOBs">
</resultMap>
<select id ="findByPanelId" resultMap="BaseResultMapDTO">
SELECT
chart_view_field.*
FROM
chart_view_field
LEFT JOIN panel_view ON chart_view_field.chart_id = panel_view.chart_view_id
WHERE
panel_view.panel_id = #{panelId}
</select>
</mapper>

View File

@ -3,6 +3,7 @@ package io.dataease.ext;
import io.dataease.controller.request.chart.ChartViewRequest;
import io.dataease.dto.chart.ChartViewDTO;
import io.dataease.dto.chart.ViewOption;
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@ -55,4 +56,7 @@ public interface ExtChartViewMapper {
void initPanelChartViewCache(@Param("panelId") String panelId);
List<ViewOption> chartOptions(@Param("panelId") String panelId);
List<ChartViewWithBLOBs> findByPanelId(@Param("panelId") String panelId);
}

View File

@ -8,6 +8,16 @@
<result column="privileges" property="privileges"/>
</resultMap>
<select id ="findByPanelId" resultMap="BaseResultMapDTO">
SELECT
chart_view.*
FROM
chart_view
LEFT JOIN panel_view ON chart_view.id = panel_view.chart_view_id
WHERE
panel_view.panel_id = #{panelId}
</select>
<select id="searchOneWithPrivileges" resultMap="BaseResultMapDTO">
select chart_view.*
from chart_view

View File

@ -0,0 +1,11 @@
package io.dataease.ext;
import io.dataease.plugins.common.base.domain.DatasetTableField;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtDataSetTableFieldMapper {
List<DatasetTableField> findByPanelId(@Param("panelId") String panelId);
}

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.dataease.ext.ExtDataSetTableFieldMapper">
<resultMap id="BaseResultMapDTO" type="io.dataease.plugins.common.base.domain.DatasetTableField"
extends="io.dataease.plugins.common.base.mapper.DatasetTableFieldMapper.BaseResultMap">
</resultMap>
<select id="findByPanelId" resultMap="BaseResultMapDTO">
select
dataset_table_field.*
from dataset_table_field
where table_id in (
SELECT
table_id
FROM
chart_view
WHERE
id IN (
SELECT
chart_view_id
FROM
panel_view
WHERE
panel_id = #{panelId}
)
)
</select>
</mapper>

View File

@ -2,6 +2,7 @@ package io.dataease.ext;
import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.dto.dataset.DataSetTableDTO;
import io.dataease.plugins.common.base.domain.DatasetTable;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -12,5 +13,6 @@ public interface ExtDataSetTableMapper {
DataSetTableDTO searchOne(DataSetTableRequest request);
List<DataSetTableDTO> searchDataSetTableWithPanelId(@Param("panelId") String panelId, @Param("userId") String userId);
List<DatasetTable> findByPanelId(@Param("panelId") String panelId);
}

View File

@ -124,4 +124,24 @@
)
</select>
<select id="findByPanelId" resultMap="BaseResultMapDTO">
select
dataset_table.*
from dataset_table
where id in (
SELECT
table_id
FROM
chart_view
WHERE
id IN (
SELECT
chart_view_id
FROM
panel_view
WHERE
panel_id = #{panelId}
)
)
</select>
</mapper>

View File

@ -4,6 +4,7 @@ import io.dataease.ext.query.GridExample;
import io.dataease.dto.dataset.DataSetTaskDTO;
import io.dataease.dto.dataset.DataSetTaskLogDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -22,4 +23,6 @@ public interface ExtDataSetTaskMapper {
List<DataSetTaskDTO> userTaskList(GridExample example);
List<DataSetTaskDTO> taskWithTriggers(GridExample example);
List<DataSetTaskDTO> findByPanelId(@Param("panelId") String panelId);
}

View File

@ -94,6 +94,27 @@
</if>
</select>
<select id="findByPanelId" resultMap="TaskResult">
select
dataset_table_task.*
from dataset_table_task
where id in (
SELECT
table_id
FROM
chart_view
WHERE
id IN (
SELECT
chart_view_id
FROM
panel_view
WHERE
panel_id = #{panelId}
)
)
</select>
</mapper>

View File

@ -3,6 +3,7 @@ package io.dataease.ext;
import io.dataease.ext.query.GridExample;
import io.dataease.controller.request.DatasourceUnionRequest;
import io.dataease.dto.DatasourceDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -12,6 +13,9 @@ public interface ExtDataSourceMapper {
List<DatasourceDTO> queryUnion(DatasourceUnionRequest request);
List<DatasourceDTO> findByPanelId(@Param("panelId") String panelId);
}

View File

@ -118,5 +118,20 @@
</if>
</select>
<select id="findByPanelId" resultMap="BaseResultMapDTO">
SELECT DISTINCT
datasource.id,
datasource.`name`,
datasource.DESC,
datasource.type
FROM
chart_view
INNER JOIN panel_view ON chart_view.id = panel_view.chart_view_id
INNER JOIN dataset_table ON chart_view.table_id = dataset_table.id
INNER JOIN datasource ON dataset_table.data_source_id = datasource.id
WHERE
panel_view.panel_id = #{panelId}
</select>
</mapper>

View File

@ -0,0 +1,17 @@
package io.dataease.ext;
import io.dataease.dto.TaskInstance;
import java.util.List;
public interface ExtTaskInstanceMapper {
int runningCount(String taskId);
void resetRunnings(String taskId);
void update(TaskInstance taskInstance);
List<TaskInstance> select();
}

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="io.dataease.ext.ExtTaskInstanceMapper">
<select id="runningCount" resultType="java.lang.Integer">
select count(*) from task_instance where task_id = #{taskId} and status = 'RUNNING'
</select>
<update id="resetRunnings">
update task_instance set status = 'ERROR', info = 'System Interrupt Error' where task_id = #{taskId} and 'RUNNING'
</update>
<update id="update" parameterType="io.dataease.dto.TaskInstance">
update task_instance
set `task_id` = #{taskId,jdbcType=VARCHAR},
`execute_time` = #{executeTime,jdbcType=BIGINT},
`finish_time` = #{finishTime,jdbcType=BIGINT},
status = #{status,jdbcType=VARCHAR},
info = #{info,jdbcType=VARCHAR},
qrtz_instance = #{qrtzInstance,jdbcType=VARCHAR}
where task_id = #{taskId,jdbcType=VARCHAR}
</update>
<select id="select" resultType="io.dataease.dto.TaskInstance">
select * from task_instance where task_id = 'Datasource_check_status' and status = 'RUNNING'
</select>
</mapper>

View File

@ -0,0 +1,101 @@
package io.dataease.job.sechedule.strategy.impl;
import com.google.gson.Gson;
import io.dataease.commons.utils.CommonBeanFactory;
import io.dataease.commons.utils.LogUtil;
import io.dataease.dto.TaskInstance;
import io.dataease.ext.ExtTaskInstanceMapper;
import io.dataease.job.sechedule.ScheduleManager;
import io.dataease.job.sechedule.strategy.TaskHandler;
import io.dataease.plugins.common.entity.GlobalTaskEntity;
import io.dataease.service.datasource.DatasourceService;
import org.quartz.*;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service("dsTaskHandler")
public class DsTaskHandler extends TaskHandler implements Job {
private static final String RUNNING = "RUNNING";
private static final String SUCCESS = "SUCCESS";
private static final String ERROR = "ERROR";
@Override
protected JobDataMap jobDataMap(GlobalTaskEntity taskEntity) {
JobDataMap jobDataMap = new JobDataMap();
jobDataMap.put("taskEntity", taskEntity);
return jobDataMap;
}
@Override
public void resetRunningInstance(Long taskId) {
}
@Override
protected Boolean taskIsRunning(Long taskId) {
return null;
}
@Override
public void addTask(ScheduleManager scheduleManager, GlobalTaskEntity taskEntity) throws Exception {
JobKey jobKey = new JobKey(taskEntity.getJobKey());
TriggerKey triggerKey = new TriggerKey(taskEntity.getJobKey());
Date start = new Date(taskEntity.getStartTime());
Date end = null;
Class<? extends TaskHandler> executor = this.getClass();
scheduleManager.addOrUpdateCronJob(jobKey, triggerKey, executor, taskEntity.getCron(), start, end, jobDataMap(taskEntity));
}
@Override
public void removeTask(ScheduleManager scheduleManager, GlobalTaskEntity taskEntity) {
JobKey jobKey = new JobKey(taskEntity.getJobKey());
TriggerKey triggerKey = new TriggerKey(taskEntity.getJobKey());
scheduleManager.removeJob(jobKey, triggerKey);
}
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
GlobalTaskEntity taskEntity = (GlobalTaskEntity) jobDataMap.get("taskEntity");
System.out.println(new Gson().toJson(taskEntity));
taskEntity.getJobKey();
if (isRunning(taskEntity.getJobKey())) {
LogUtil.info("Skip synchronization task: {} ,due to task status is {}", taskEntity.getJobKey(), "running");
return;
}
LogUtil.info("start check datasource status...");
TaskInstance taskInstance = new TaskInstance();
taskInstance.setTaskId("Datasource_check_status");
taskInstance.setExecuteTime(System.currentTimeMillis());
taskInstance.setFinishTime(null);
taskInstance.setStatus(RUNNING);
taskInstance.setQrtzInstance(context.getFireInstanceId());
ExtTaskInstanceMapper extTaskInstanceMapper = CommonBeanFactory.getBean(ExtTaskInstanceMapper.class);
extTaskInstanceMapper.update(taskInstance);
DatasourceService datasourceService = CommonBeanFactory.getBean(DatasourceService.class);
datasourceService.updateDatasourceStatus();
taskInstance.setFinishTime(System.currentTimeMillis());
taskInstance.setStatus(SUCCESS);
extTaskInstanceMapper.update(taskInstance);
LogUtil.info("end check datasource status.");
}
private Boolean isRunning(String taskId) {
ExtTaskInstanceMapper extTaskInstanceMapper = CommonBeanFactory.getBean(ExtTaskInstanceMapper.class);
System.out.println(extTaskInstanceMapper.runningCount(taskId));
return extTaskInstanceMapper.runningCount(taskId) > 0;
}
}

View File

@ -0,0 +1,29 @@
package io.dataease.plugins.common.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class PanelAppTemplate implements Serializable {
private String id;
private String name;
private String nodeType;
private Integer level;
private String pid;
private String version;
private Long updateTime;
private String updateUser;
private Long createTime;
private String createUser;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,870 @@
package io.dataease.plugins.common.base.domain;
import java.util.ArrayList;
import java.util.List;
public class PanelAppTemplateExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public PanelAppTemplateExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNodeTypeIsNull() {
addCriterion("node_type is null");
return (Criteria) this;
}
public Criteria andNodeTypeIsNotNull() {
addCriterion("node_type is not null");
return (Criteria) this;
}
public Criteria andNodeTypeEqualTo(String value) {
addCriterion("node_type =", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeNotEqualTo(String value) {
addCriterion("node_type <>", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeGreaterThan(String value) {
addCriterion("node_type >", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeGreaterThanOrEqualTo(String value) {
addCriterion("node_type >=", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeLessThan(String value) {
addCriterion("node_type <", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeLessThanOrEqualTo(String value) {
addCriterion("node_type <=", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeLike(String value) {
addCriterion("node_type like", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeNotLike(String value) {
addCriterion("node_type not like", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeIn(List<String> values) {
addCriterion("node_type in", values, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeNotIn(List<String> values) {
addCriterion("node_type not in", values, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeBetween(String value1, String value2) {
addCriterion("node_type between", value1, value2, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeNotBetween(String value1, String value2) {
addCriterion("node_type not between", value1, value2, "nodeType");
return (Criteria) this;
}
public Criteria andLevelIsNull() {
addCriterion("`level` is null");
return (Criteria) this;
}
public Criteria andLevelIsNotNull() {
addCriterion("`level` is not null");
return (Criteria) this;
}
public Criteria andLevelEqualTo(Integer value) {
addCriterion("`level` =", value, "level");
return (Criteria) this;
}
public Criteria andLevelNotEqualTo(Integer value) {
addCriterion("`level` <>", value, "level");
return (Criteria) this;
}
public Criteria andLevelGreaterThan(Integer value) {
addCriterion("`level` >", value, "level");
return (Criteria) this;
}
public Criteria andLevelGreaterThanOrEqualTo(Integer value) {
addCriterion("`level` >=", value, "level");
return (Criteria) this;
}
public Criteria andLevelLessThan(Integer value) {
addCriterion("`level` <", value, "level");
return (Criteria) this;
}
public Criteria andLevelLessThanOrEqualTo(Integer value) {
addCriterion("`level` <=", value, "level");
return (Criteria) this;
}
public Criteria andLevelIn(List<Integer> values) {
addCriterion("`level` in", values, "level");
return (Criteria) this;
}
public Criteria andLevelNotIn(List<Integer> values) {
addCriterion("`level` not in", values, "level");
return (Criteria) this;
}
public Criteria andLevelBetween(Integer value1, Integer value2) {
addCriterion("`level` between", value1, value2, "level");
return (Criteria) this;
}
public Criteria andLevelNotBetween(Integer value1, Integer value2) {
addCriterion("`level` not between", value1, value2, "level");
return (Criteria) this;
}
public Criteria andPidIsNull() {
addCriterion("pid is null");
return (Criteria) this;
}
public Criteria andPidIsNotNull() {
addCriterion("pid is not null");
return (Criteria) this;
}
public Criteria andPidEqualTo(String value) {
addCriterion("pid =", value, "pid");
return (Criteria) this;
}
public Criteria andPidNotEqualTo(String value) {
addCriterion("pid <>", value, "pid");
return (Criteria) this;
}
public Criteria andPidGreaterThan(String value) {
addCriterion("pid >", value, "pid");
return (Criteria) this;
}
public Criteria andPidGreaterThanOrEqualTo(String value) {
addCriterion("pid >=", value, "pid");
return (Criteria) this;
}
public Criteria andPidLessThan(String value) {
addCriterion("pid <", value, "pid");
return (Criteria) this;
}
public Criteria andPidLessThanOrEqualTo(String value) {
addCriterion("pid <=", value, "pid");
return (Criteria) this;
}
public Criteria andPidLike(String value) {
addCriterion("pid like", value, "pid");
return (Criteria) this;
}
public Criteria andPidNotLike(String value) {
addCriterion("pid not like", value, "pid");
return (Criteria) this;
}
public Criteria andPidIn(List<String> values) {
addCriterion("pid in", values, "pid");
return (Criteria) this;
}
public Criteria andPidNotIn(List<String> values) {
addCriterion("pid not in", values, "pid");
return (Criteria) this;
}
public Criteria andPidBetween(String value1, String value2) {
addCriterion("pid between", value1, value2, "pid");
return (Criteria) this;
}
public Criteria andPidNotBetween(String value1, String value2) {
addCriterion("pid not between", value1, value2, "pid");
return (Criteria) this;
}
public Criteria andVersionIsNull() {
addCriterion("version is null");
return (Criteria) this;
}
public Criteria andVersionIsNotNull() {
addCriterion("version is not null");
return (Criteria) this;
}
public Criteria andVersionEqualTo(String value) {
addCriterion("version =", value, "version");
return (Criteria) this;
}
public Criteria andVersionNotEqualTo(String value) {
addCriterion("version <>", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThan(String value) {
addCriterion("version >", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThanOrEqualTo(String value) {
addCriterion("version >=", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThan(String value) {
addCriterion("version <", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThanOrEqualTo(String value) {
addCriterion("version <=", value, "version");
return (Criteria) this;
}
public Criteria andVersionLike(String value) {
addCriterion("version like", value, "version");
return (Criteria) this;
}
public Criteria andVersionNotLike(String value) {
addCriterion("version not like", value, "version");
return (Criteria) this;
}
public Criteria andVersionIn(List<String> values) {
addCriterion("version in", values, "version");
return (Criteria) this;
}
public Criteria andVersionNotIn(List<String> values) {
addCriterion("version not in", values, "version");
return (Criteria) this;
}
public Criteria andVersionBetween(String value1, String value2) {
addCriterion("version between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andVersionNotBetween(String value1, String value2) {
addCriterion("version not between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Long value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Long value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Long value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Long value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Long value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Long> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Long> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Long value1, Long value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Long value1, Long value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateUserIsNull() {
addCriterion("update_user is null");
return (Criteria) this;
}
public Criteria andUpdateUserIsNotNull() {
addCriterion("update_user is not null");
return (Criteria) this;
}
public Criteria andUpdateUserEqualTo(String value) {
addCriterion("update_user =", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotEqualTo(String value) {
addCriterion("update_user <>", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserGreaterThan(String value) {
addCriterion("update_user >", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserGreaterThanOrEqualTo(String value) {
addCriterion("update_user >=", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLessThan(String value) {
addCriterion("update_user <", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLessThanOrEqualTo(String value) {
addCriterion("update_user <=", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLike(String value) {
addCriterion("update_user like", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotLike(String value) {
addCriterion("update_user not like", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserIn(List<String> values) {
addCriterion("update_user in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotIn(List<String> values) {
addCriterion("update_user not in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserBetween(String value1, String value2) {
addCriterion("update_user between", value1, value2, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotBetween(String value1, String value2) {
addCriterion("update_user not between", value1, value2, "updateUser");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateUserIsNull() {
addCriterion("create_user is null");
return (Criteria) this;
}
public Criteria andCreateUserIsNotNull() {
addCriterion("create_user is not null");
return (Criteria) this;
}
public Criteria andCreateUserEqualTo(String value) {
addCriterion("create_user =", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotEqualTo(String value) {
addCriterion("create_user <>", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThan(String value) {
addCriterion("create_user >", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThanOrEqualTo(String value) {
addCriterion("create_user >=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThan(String value) {
addCriterion("create_user <", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThanOrEqualTo(String value) {
addCriterion("create_user <=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLike(String value) {
addCriterion("create_user like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotLike(String value) {
addCriterion("create_user not like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserIn(List<String> values) {
addCriterion("create_user in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotIn(List<String> values) {
addCriterion("create_user not in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserBetween(String value1, String value2) {
addCriterion("create_user between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotBetween(String value1, String value2) {
addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,29 @@
package io.dataease.plugins.common.base.domain;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class PanelAppTemplateWithBLOBs extends PanelAppTemplate implements Serializable {
private String applicationInfo;
private String panelInfo;
private String viewsInfo;
private String datasetInfo;
private String datasetFieldsInfo;
private String datasetTasksInfo;
private String datasourceInfo;
private String snapshot;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,37 @@
package io.dataease.plugins.common.base.mapper;
import io.dataease.plugins.common.base.domain.PanelAppTemplate;
import io.dataease.plugins.common.base.domain.PanelAppTemplateExample;
import io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PanelAppTemplateMapper {
long countByExample(PanelAppTemplateExample example);
int deleteByExample(PanelAppTemplateExample example);
int deleteByPrimaryKey(String id);
int insert(PanelAppTemplateWithBLOBs record);
int insertSelective(PanelAppTemplateWithBLOBs record);
List<PanelAppTemplateWithBLOBs> selectByExampleWithBLOBs(PanelAppTemplateExample example);
List<PanelAppTemplate> selectByExample(PanelAppTemplateExample example);
PanelAppTemplateWithBLOBs selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") PanelAppTemplateWithBLOBs record, @Param("example") PanelAppTemplateExample example);
int updateByExampleWithBLOBs(@Param("record") PanelAppTemplateWithBLOBs record, @Param("example") PanelAppTemplateExample example);
int updateByExample(@Param("record") PanelAppTemplate record, @Param("example") PanelAppTemplateExample example);
int updateByPrimaryKeySelective(PanelAppTemplateWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(PanelAppTemplateWithBLOBs record);
int updateByPrimaryKey(PanelAppTemplate record);
}

View File

@ -0,0 +1,470 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.dataease.plugins.common.base.mapper.PanelAppTemplateMapper">
<resultMap id="BaseResultMap" type="io.dataease.plugins.common.base.domain.PanelAppTemplate">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="node_type" jdbcType="VARCHAR" property="nodeType" />
<result column="level" jdbcType="INTEGER" property="level" />
<result column="pid" jdbcType="VARCHAR" property="pid" />
<result column="version" jdbcType="VARCHAR" property="version" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs">
<result column="application_info" jdbcType="LONGVARCHAR" property="applicationInfo" />
<result column="panel_info" jdbcType="LONGVARCHAR" property="panelInfo" />
<result column="views_info" jdbcType="LONGVARCHAR" property="viewsInfo" />
<result column="dataset_info" jdbcType="LONGVARCHAR" property="datasetInfo" />
<result column="dataset_fields_info" jdbcType="LONGVARCHAR" property="datasetFieldsInfo" />
<result column="dataset_tasks_info" jdbcType="LONGVARCHAR" property="datasetTasksInfo" />
<result column="datasource_info" jdbcType="LONGVARCHAR" property="datasourceInfo" />
<result column="snapshot" jdbcType="LONGVARCHAR" property="snapshot" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, node_type, `level`, pid, version, update_time, update_user, create_time,
create_user
</sql>
<sql id="Blob_Column_List">
application_info, panel_info, views_info, dataset_info, dataset_fields_info, dataset_tasks_info,
datasource_info, snapshot
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.dataease.plugins.common.base.domain.PanelAppTemplateExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from panel_app_template
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.dataease.plugins.common.base.domain.PanelAppTemplateExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from panel_app_template
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from panel_app_template
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from panel_app_template
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.plugins.common.base.domain.PanelAppTemplateExample">
delete from panel_app_template
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs">
insert into panel_app_template (id, `name`, node_type,
`level`, pid, version,
update_time, update_user, create_time,
create_user, application_info, panel_info,
views_info, dataset_info, dataset_fields_info,
dataset_tasks_info, datasource_info,
snapshot)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{nodeType,jdbcType=VARCHAR},
#{level,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, #{version,jdbcType=VARCHAR},
#{updateTime,jdbcType=BIGINT}, #{updateUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{createUser,jdbcType=VARCHAR}, #{applicationInfo,jdbcType=LONGVARCHAR}, #{panelInfo,jdbcType=LONGVARCHAR},
#{viewsInfo,jdbcType=LONGVARCHAR}, #{datasetInfo,jdbcType=LONGVARCHAR}, #{datasetFieldsInfo,jdbcType=LONGVARCHAR},
#{datasetTasksInfo,jdbcType=LONGVARCHAR}, #{datasourceInfo,jdbcType=LONGVARCHAR},
#{snapshot,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs">
insert into panel_app_template
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
`name`,
</if>
<if test="nodeType != null">
node_type,
</if>
<if test="level != null">
`level`,
</if>
<if test="pid != null">
pid,
</if>
<if test="version != null">
version,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="updateUser != null">
update_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="applicationInfo != null">
application_info,
</if>
<if test="panelInfo != null">
panel_info,
</if>
<if test="viewsInfo != null">
views_info,
</if>
<if test="datasetInfo != null">
dataset_info,
</if>
<if test="datasetFieldsInfo != null">
dataset_fields_info,
</if>
<if test="datasetTasksInfo != null">
dataset_tasks_info,
</if>
<if test="datasourceInfo != null">
datasource_info,
</if>
<if test="snapshot != null">
snapshot,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="nodeType != null">
#{nodeType,jdbcType=VARCHAR},
</if>
<if test="level != null">
#{level,jdbcType=INTEGER},
</if>
<if test="pid != null">
#{pid,jdbcType=VARCHAR},
</if>
<if test="version != null">
#{version,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="updateUser != null">
#{updateUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="applicationInfo != null">
#{applicationInfo,jdbcType=LONGVARCHAR},
</if>
<if test="panelInfo != null">
#{panelInfo,jdbcType=LONGVARCHAR},
</if>
<if test="viewsInfo != null">
#{viewsInfo,jdbcType=LONGVARCHAR},
</if>
<if test="datasetInfo != null">
#{datasetInfo,jdbcType=LONGVARCHAR},
</if>
<if test="datasetFieldsInfo != null">
#{datasetFieldsInfo,jdbcType=LONGVARCHAR},
</if>
<if test="datasetTasksInfo != null">
#{datasetTasksInfo,jdbcType=LONGVARCHAR},
</if>
<if test="datasourceInfo != null">
#{datasourceInfo,jdbcType=LONGVARCHAR},
</if>
<if test="snapshot != null">
#{snapshot,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.plugins.common.base.domain.PanelAppTemplateExample" resultType="java.lang.Long">
select count(*) from panel_app_template
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update panel_app_template
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.nodeType != null">
node_type = #{record.nodeType,jdbcType=VARCHAR},
</if>
<if test="record.level != null">
`level` = #{record.level,jdbcType=INTEGER},
</if>
<if test="record.pid != null">
pid = #{record.pid,jdbcType=VARCHAR},
</if>
<if test="record.version != null">
version = #{record.version,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.updateUser != null">
update_user = #{record.updateUser,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.applicationInfo != null">
application_info = #{record.applicationInfo,jdbcType=LONGVARCHAR},
</if>
<if test="record.panelInfo != null">
panel_info = #{record.panelInfo,jdbcType=LONGVARCHAR},
</if>
<if test="record.viewsInfo != null">
views_info = #{record.viewsInfo,jdbcType=LONGVARCHAR},
</if>
<if test="record.datasetInfo != null">
dataset_info = #{record.datasetInfo,jdbcType=LONGVARCHAR},
</if>
<if test="record.datasetFieldsInfo != null">
dataset_fields_info = #{record.datasetFieldsInfo,jdbcType=LONGVARCHAR},
</if>
<if test="record.datasetTasksInfo != null">
dataset_tasks_info = #{record.datasetTasksInfo,jdbcType=LONGVARCHAR},
</if>
<if test="record.datasourceInfo != null">
datasource_info = #{record.datasourceInfo,jdbcType=LONGVARCHAR},
</if>
<if test="record.snapshot != null">
snapshot = #{record.snapshot,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update panel_app_template
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
node_type = #{record.nodeType,jdbcType=VARCHAR},
`level` = #{record.level,jdbcType=INTEGER},
pid = #{record.pid,jdbcType=VARCHAR},
version = #{record.version,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=BIGINT},
update_user = #{record.updateUser,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR},
application_info = #{record.applicationInfo,jdbcType=LONGVARCHAR},
panel_info = #{record.panelInfo,jdbcType=LONGVARCHAR},
views_info = #{record.viewsInfo,jdbcType=LONGVARCHAR},
dataset_info = #{record.datasetInfo,jdbcType=LONGVARCHAR},
dataset_fields_info = #{record.datasetFieldsInfo,jdbcType=LONGVARCHAR},
dataset_tasks_info = #{record.datasetTasksInfo,jdbcType=LONGVARCHAR},
datasource_info = #{record.datasourceInfo,jdbcType=LONGVARCHAR},
snapshot = #{record.snapshot,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update panel_app_template
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
node_type = #{record.nodeType,jdbcType=VARCHAR},
`level` = #{record.level,jdbcType=INTEGER},
pid = #{record.pid,jdbcType=VARCHAR},
version = #{record.version,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=BIGINT},
update_user = #{record.updateUser,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs">
update panel_app_template
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="nodeType != null">
node_type = #{nodeType,jdbcType=VARCHAR},
</if>
<if test="level != null">
`level` = #{level,jdbcType=INTEGER},
</if>
<if test="pid != null">
pid = #{pid,jdbcType=VARCHAR},
</if>
<if test="version != null">
version = #{version,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="updateUser != null">
update_user = #{updateUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="applicationInfo != null">
application_info = #{applicationInfo,jdbcType=LONGVARCHAR},
</if>
<if test="panelInfo != null">
panel_info = #{panelInfo,jdbcType=LONGVARCHAR},
</if>
<if test="viewsInfo != null">
views_info = #{viewsInfo,jdbcType=LONGVARCHAR},
</if>
<if test="datasetInfo != null">
dataset_info = #{datasetInfo,jdbcType=LONGVARCHAR},
</if>
<if test="datasetFieldsInfo != null">
dataset_fields_info = #{datasetFieldsInfo,jdbcType=LONGVARCHAR},
</if>
<if test="datasetTasksInfo != null">
dataset_tasks_info = #{datasetTasksInfo,jdbcType=LONGVARCHAR},
</if>
<if test="datasourceInfo != null">
datasource_info = #{datasourceInfo,jdbcType=LONGVARCHAR},
</if>
<if test="snapshot != null">
snapshot = #{snapshot,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs">
update panel_app_template
set `name` = #{name,jdbcType=VARCHAR},
node_type = #{nodeType,jdbcType=VARCHAR},
`level` = #{level,jdbcType=INTEGER},
pid = #{pid,jdbcType=VARCHAR},
version = #{version,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT},
update_user = #{updateUser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR},
application_info = #{applicationInfo,jdbcType=LONGVARCHAR},
panel_info = #{panelInfo,jdbcType=LONGVARCHAR},
views_info = #{viewsInfo,jdbcType=LONGVARCHAR},
dataset_info = #{datasetInfo,jdbcType=LONGVARCHAR},
dataset_fields_info = #{datasetFieldsInfo,jdbcType=LONGVARCHAR},
dataset_tasks_info = #{datasetTasksInfo,jdbcType=LONGVARCHAR},
datasource_info = #{datasourceInfo,jdbcType=LONGVARCHAR},
snapshot = #{snapshot,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.plugins.common.base.domain.PanelAppTemplate">
update panel_app_template
set `name` = #{name,jdbcType=VARCHAR},
node_type = #{nodeType,jdbcType=VARCHAR},
`level` = #{level,jdbcType=INTEGER},
pid = #{pid,jdbcType=VARCHAR},
version = #{version,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT},
update_user = #{updateUser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,32 @@
package io.dataease.service.message.service.strategy;
import io.dataease.auth.entity.SysUserEntity;
import io.dataease.auth.service.AuthUserService;
import io.dataease.plugins.config.SpringContextUtil;
import io.dataease.plugins.xpack.dingtalk.service.DingtalkXpackService;
import io.dataease.service.message.service.SendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service("sendDingtalk")
public class SendDingtalk implements SendService {
@Autowired
private AuthUserService authUserService;
@Override
public void sendMsg(Long userId, Long typeId, String content, String param) {
SysUserEntity userEntity = authUserService.getUserById(userId);
if (userEntity.getFrom() == 5 && authUserService.supportDingtalk()) {
String username = userEntity.getUsername();
DingtalkXpackService dingtalkXpackService = SpringContextUtil.getBean(DingtalkXpackService.class);
List<String> userIds = new ArrayList<>();
userIds.add(username);
dingtalkXpackService.pushMsg(userIds, content);
}
}
}

View File

@ -0,0 +1,32 @@
package io.dataease.service.message.service.strategy;
import io.dataease.auth.entity.SysUserEntity;
import io.dataease.auth.service.AuthUserService;
import io.dataease.plugins.config.SpringContextUtil;
import io.dataease.plugins.xpack.lark.service.LarkXpackService;
import io.dataease.service.message.service.SendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service("sendLark")
public class SendLark implements SendService {
@Autowired
private AuthUserService authUserService;
@Override
public void sendMsg(Long userId, Long typeId, String content, String param) {
SysUserEntity userEntity = authUserService.getUserById(userId);
if (userEntity.getFrom() == 6 && authUserService.supportLark()) {
String username = userEntity.getUsername();
LarkXpackService larkXpackService = SpringContextUtil.getBean(LarkXpackService.class);
List<String> userIds = new ArrayList<>();
userIds.add(username);
larkXpackService.pushMsg(userIds, content);
}
}
}

View File

@ -0,0 +1,31 @@
package io.dataease.service.message.service.strategy;
import io.dataease.auth.entity.SysUserEntity;
import io.dataease.auth.service.AuthUserService;
import io.dataease.plugins.config.SpringContextUtil;
import io.dataease.plugins.xpack.wecom.service.WecomXpackService;
import io.dataease.service.message.service.SendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service("sendWecom")
public class SendWecom implements SendService {
@Autowired
private AuthUserService authUserService;
@Override
public void sendMsg(Long userId, Long typeId, String content, String param) {
SysUserEntity userEntity = authUserService.getUserById(userId);
if (userEntity.getFrom() == 4 && authUserService.supportWecom()) {
String username = userEntity.getUsername();
WecomXpackService wecomXpackService = SpringContextUtil.getBean(WecomXpackService.class);
List<String> userIds = new ArrayList<>();
userIds.add(username);
wecomXpackService.pushMsg(userIds, content);
}
}
}

View File

@ -0,0 +1,80 @@
package io.dataease.service.panel;
import io.dataease.commons.constants.CommonConstants;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.BeanUtils;
import io.dataease.controller.request.panel.PanelAppTemplateRequest;
import io.dataease.controller.request.panel.PanelTemplateRequest;
import io.dataease.dto.panel.PanelAppTemplateDTO;
import io.dataease.plugins.common.base.domain.*;
import io.dataease.plugins.common.base.mapper.PanelAppTemplateMapper;
import org.pentaho.di.core.util.UUIDUtil;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.List;
/**
* Author: wangjiahao
* Date: 2022/9/8
* Description:
*/
@Service
public class PanelAppTemplateService {
@Resource
private PanelAppTemplateMapper panelAppTemplateMapper;
public List<PanelAppTemplateWithBLOBs> list(PanelAppTemplateRequest request){
PanelAppTemplateExample example = new PanelAppTemplateExample();
example.createCriteria().andPidEqualTo(request.getPid());
return panelAppTemplateMapper.selectByExampleWithBLOBs(example);
}
public void save(PanelAppTemplateRequest request){
request.setId(UUIDUtil.getUUIDAsString());
request.setCreateUser(AuthUtils.getUser().getUsername());
request.setCreateTime(System.currentTimeMillis());
PanelAppTemplateWithBLOBs requestTemplate = new PanelAppTemplateWithBLOBs();
BeanUtils.copyBean(requestTemplate,request);
panelAppTemplateMapper.insertSelective(requestTemplate);
}
public void update(PanelAppTemplateRequest request){
request.setUpdateUser(AuthUtils.getUser().getUsername());
request.setUpdateTime(System.currentTimeMillis());
PanelAppTemplateWithBLOBs requestTemplate = new PanelAppTemplateWithBLOBs();
BeanUtils.copyBean(requestTemplate,request);
panelAppTemplateMapper.updateByPrimaryKeySelective(requestTemplate);
}
public void delete(String templateAppId){
panelAppTemplateMapper.deleteByPrimaryKey(templateAppId);
}
public String nameCheck(PanelAppTemplateRequest request) {
return nameCheck(request.getOptType(), request.getName(), request.getPid(), request.getId());
}
//名称检查
public String nameCheck(String optType, String name, String pid, String id) {
PanelAppTemplateExample example = new PanelAppTemplateExample();
if (CommonConstants.OPT_TYPE.INSERT.equals(optType)) {
example.createCriteria().andPidEqualTo(pid).andNameEqualTo(name);
} else if (CommonConstants.OPT_TYPE.UPDATE.equals(optType)) {
example.createCriteria().andPidEqualTo(pid).andNameEqualTo(name).andIdNotEqualTo(id);
}
List<PanelAppTemplate> panelTemplates = panelAppTemplateMapper.selectByExample(example);
if (CollectionUtils.isEmpty(panelTemplates)) {
return CommonConstants.CHECK_RESULT.NONE;
} else {
return CommonConstants.CHECK_RESULT.EXIST_ALL;
}
}
}

View File

@ -11,11 +11,15 @@ import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.controller.request.panel.*;
import io.dataease.dto.DatasourceDTO;
import io.dataease.dto.PanelGroupExtendDataDTO;
import io.dataease.dto.SysLogDTO;
import io.dataease.dto.authModel.VAuthModelDTO;
import io.dataease.dto.chart.ChartViewDTO;
import io.dataease.dto.dataset.DataSetTableDTO;
import io.dataease.dto.dataset.DataSetTaskDTO;
import io.dataease.dto.panel.PanelExport2App;
import io.dataease.dto.panel.PanelGroupAppInfo;
import io.dataease.dto.panel.PanelGroupDTO;
import io.dataease.dto.panel.PanelTemplateFileDTO;
import io.dataease.dto.panel.po.PanelViewInsertDTO;
@ -106,6 +110,14 @@ public class PanelGroupService {
private ExtPanelGroupExtendDataMapper extPanelGroupExtendDataMapper;
@Resource
private StaticResourceService staticResourceService;
@Resource
private ExtChartViewFieldMapper extChartViewFieldMapper;
@Resource
private ExtDataSetTableFieldMapper extDataSetTableFieldMapper;
@Resource
private ExtDataSetTaskMapper extDataSetTaskMapper;
@Resource
private ExtDataSourceMapper extDataSourceMapper;
public List<PanelGroupDTO> tree(PanelGroupRequest panelGroupRequest) {
String userId = String.valueOf(AuthUtils.getUser().getUserId());
@ -402,9 +414,9 @@ public class PanelGroupService {
dynamicData = request.getDynamicData();
staticResource = request.getStaticResource();
mobileLayout = panelViewService.havaMobileLayout(templateData);
} else if (PanelConstants.NEW_PANEL_FROM.NEW_MARKET_TEMPLATE.equals(newFrom)){
PanelTemplateFileDTO templateFileInfo = getTemplateFromMarket(request.getTemplateUrl());
if(templateFileInfo == null){
} else if (PanelConstants.NEW_PANEL_FROM.NEW_MARKET_TEMPLATE.equals(newFrom)) {
PanelTemplateFileDTO templateFileInfo = getTemplateFromMarket(request.getTemplateUrl());
if (templateFileInfo == null) {
DataEaseException.throwException("Can't find the template's info from market,please check");
}
templateStyle = templateFileInfo.getPanelStyle();
@ -414,7 +426,7 @@ public class PanelGroupService {
mobileLayout = panelViewService.havaMobileLayout(templateData);
}
Map<String, String> dynamicDataMap = gson.fromJson(dynamicData, Map.class);
if(dynamicDataMap == null){
if (dynamicDataMap == null) {
DataEaseException.throwException("Please use the template after v1.9");
}
@ -588,15 +600,15 @@ public class PanelGroupService {
cell.setCellStyle(cellStyle);
//设置列的宽度
detailsSheet.setColumnWidth(j, 255 * 20);
}else{
} else {
// with DataType
if((excelTypes[j]== DeTypeConstants.DE_INT || excelTypes[j]== DeTypeConstants.DE_FLOAT)&& StringUtils.isNotEmpty(rowData[j])){
try{
if ((excelTypes[j] == DeTypeConstants.DE_INT || excelTypes[j] == DeTypeConstants.DE_FLOAT) && StringUtils.isNotEmpty(rowData[j])) {
try {
cell.setCellValue(Double.valueOf(rowData[j]));
}catch (Exception e){
} catch (Exception e) {
LogUtil.warn("export excel data transform error");
}
}else{
} else {
cell.setCellValue(rowData[j]);
}
}
@ -631,7 +643,7 @@ public class PanelGroupService {
String viewId = request.getViewId();
ChartViewWithBLOBs chartViewWithBLOBs = chartViewService.get(viewId);
String pid = chartViewWithBLOBs.getSceneId();
DeLogUtils.save(SysLogConstants.OPERATE_TYPE.EXPORT, SysLogConstants.SOURCE_TYPE.VIEW, viewId,pid, null, null);
DeLogUtils.save(SysLogConstants.OPERATE_TYPE.EXPORT, SysLogConstants.SOURCE_TYPE.VIEW, viewId, pid, null, null);
}
}
@ -645,54 +657,55 @@ public class PanelGroupService {
}
public PanelTemplateFileDTO getTemplateFromMarket(String templateUrl){
if(StringUtils.isNotEmpty(templateUrl)){
public PanelTemplateFileDTO getTemplateFromMarket(String templateUrl) {
if (StringUtils.isNotEmpty(templateUrl)) {
Gson gson = new Gson();
String templateInfo = HttpClientUtil.get(templateUrl,null);
String templateInfo = HttpClientUtil.get(templateUrl, null);
return gson.fromJson(templateInfo, PanelTemplateFileDTO.class);
}else{
} else {
return null;
}
}
/**
* @Description: Automatically save panel data to cache when editing
* */
public void autoCache(PanelGroupRequest request){
String cacheName = JdbcConstants.PANEL_CACHE_KEY+request.getId();
String cacheId = AuthUtils.getUser().getUserId()+"&"+request.getId();
*/
public void autoCache(PanelGroupRequest request) {
String cacheName = JdbcConstants.PANEL_CACHE_KEY + request.getId();
String cacheId = AuthUtils.getUser().getUserId() + "&" + request.getId();
CacheUtils.put(cacheName, cacheId, request, null, null);
}
/**
* @Description: Remove panel cache for specific user
* */
public void removePanelCache(String panelId){
String cacheName = JdbcConstants.PANEL_CACHE_KEY+panelId;
String cacheId = AuthUtils.getUser().getUserId()+"&"+panelId;
CacheUtils.remove(cacheName,cacheId);
*/
public void removePanelCache(String panelId) {
String cacheName = JdbcConstants.PANEL_CACHE_KEY + panelId;
String cacheId = AuthUtils.getUser().getUserId() + "&" + panelId;
CacheUtils.remove(cacheName, cacheId);
}
public void removePanelAllCache(String panelId){
String cacheName = JdbcConstants.PANEL_CACHE_KEY+panelId;
public void removePanelAllCache(String panelId) {
String cacheName = JdbcConstants.PANEL_CACHE_KEY + panelId;
CacheUtils.removeAll(cacheName);
}
public PanelGroupDTO findUserPanelCache(String panelId){
String cacheName = JdbcConstants.PANEL_CACHE_KEY+panelId;
String cacheId = AuthUtils.getUser().getUserId()+"&"+panelId;
Object cache = CacheUtils.get(cacheName,cacheId);
if(cache==null){
public PanelGroupDTO findUserPanelCache(String panelId) {
String cacheName = JdbcConstants.PANEL_CACHE_KEY + panelId;
String cacheId = AuthUtils.getUser().getUserId() + "&" + panelId;
Object cache = CacheUtils.get(cacheName, cacheId);
if (cache == null) {
return null;
}else{
return (PanelGroupRequest)cache;
} else {
return (PanelGroupRequest) cache;
}
}
public Boolean checkUserCache(String panelId){
String cacheName = JdbcConstants.PANEL_CACHE_KEY+panelId;
String cacheId = AuthUtils.getUser().getUserId()+"&"+panelId;
Object cache = CacheUtils.get(cacheName,cacheId);
return cache!=null;
public Boolean checkUserCache(String panelId) {
String cacheName = JdbcConstants.PANEL_CACHE_KEY + panelId;
String cacheId = AuthUtils.getUser().getUserId() + "&" + panelId;
Object cache = CacheUtils.get(cacheName, cacheId);
return cache != null;
}
public void viewLog(PanelViewLogRequest request) {
@ -706,15 +719,15 @@ public class PanelGroupService {
DeLogUtils.save(operateType, sourceType, panelId, panel.getPid(), null, null);
}
public Object findPanelElementInfo(String viewId){
public Object findPanelElementInfo(String viewId) {
PanelView panelView = panelViewService.findByViewId(viewId);
if(panelView!=null){
if (panelView != null) {
PanelGroupWithBLOBs panelGroupWithBLOBs = panelGroupMapper.selectByPrimaryKey(panelView.getPanelId());
if(panelGroupWithBLOBs != null){
JSONArray panelData = JSONObject.parseArray(panelGroupWithBLOBs.getPanelData());
for(int i = 0;i<panelData.size();i++){
if (panelGroupWithBLOBs != null) {
JSONArray panelData = JSONObject.parseArray(panelGroupWithBLOBs.getPanelData());
for (int i = 0; i < panelData.size(); i++) {
JSONObject element = panelData.getJSONObject(i);
if("user-view".equals(element.getString("component"))){
if ("user-view".equals(element.getString("component"))) {
return element;
}
}
@ -722,4 +735,46 @@ public class PanelGroupService {
}
return null;
}
public PanelExport2App panelExport2AppCheck(String panelId) {
//TODO 1.获取所有视图信息
List<ChartViewWithBLOBs> chartViewsInfo = panelViewService.findByPanelId(panelId);
//TODO 2.获取视图扩展字段信息
List<ChartViewField> chartViewFieldsInfo = extChartViewFieldMapper.findByPanelId(panelId);
//TODO 3.获取所有数据集信息
List<DatasetTable> datasetTablesInfo = extDataSetTableMapper.findByPanelId(panelId);
//TODO 4.获取所有数据集字段信息
List<DatasetTableField> datasetTableFieldsInfo = extDataSetTableFieldMapper.findByPanelId(panelId);
//TODO 5.获取所有任务信息
List<DataSetTaskDTO> dataSetTasksInfo = extDataSetTaskMapper.findByPanelId(panelId);
//TODO 6.获取所有数据源信息
List<DatasourceDTO> datasourceDTOS = extDataSourceMapper.findByPanelId(panelId);
//校验标准 1.存在视图且所有视图的数据来源必须是dataset 2.存在数据集且没有excel数据集 3.存在数据源且是单数据源
//1.view check
if (CollectionUtils.isEmpty(chartViewsInfo)) {
return new PanelExport2App("this panel don't have views");
} else if (chartViewsInfo.stream().filter(chartView -> chartView.getDataFrom().equals("template")).collect(Collectors.toList()).size() > 0) {
return new PanelExport2App("this panel have view from template");
}
// dataset check
if (CollectionUtils.isEmpty(datasetTablesInfo)) {
return new PanelExport2App("this panel don't have dataset");
} else if (datasetTablesInfo.stream().filter(datasetTable -> datasetTable.getType().equals("excel")).collect(Collectors.toList()).size() > 0) {
return new PanelExport2App("this panel have dataset witch type is excel");
}
//datasource check
if (CollectionUtils.isEmpty(datasourceDTOS)) {
return new PanelExport2App("this panel don't have datasource");
} else if (datasourceDTOS.size() > 1) {
return new PanelExport2App("this panel should hava only one dataset");
}
return new PanelExport2App(chartViewsInfo, chartViewFieldsInfo, datasetTablesInfo, datasetTableFieldsInfo, dataSetTasksInfo, datasourceDTOS);
}
public void appApply(PanelExport2App appApplyInfo){
}
}

View File

@ -11,6 +11,7 @@ import io.dataease.dto.panel.PanelViewDto;
import io.dataease.dto.panel.PanelViewTableDTO;
import io.dataease.dto.panel.po.PanelViewInsertDTO;
import io.dataease.dto.panel.po.PanelViewPo;
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
import io.dataease.plugins.common.base.domain.PanelGroupWithBLOBs;
import io.dataease.plugins.common.base.domain.PanelView;
import io.dataease.plugins.common.base.domain.PanelViewExample;
@ -168,4 +169,8 @@ public class PanelViewService {
return null;
}
}
public List<ChartViewWithBLOBs> findByPanelId(String panelId) {
return extChartViewMapper.findByPanelId(panelId);
}
}

View File

@ -9,7 +9,6 @@ CREATE TABLE `sys_external_token` (
UPDATE `sys_menu` set `component` = 'system/datasource/DsForm' where `component` = 'system/datasource/form';
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('basic.dsCheckInterval', 20, 'text', 1);
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('basic.dsCheckIntervalType', 'minute', 'text', 1);
@ -25,3 +24,37 @@ CREATE TABLE `task_instance` (
INSERT INTO `task_instance` (`task_id`) VALUES ('Datasource_check_status');
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (41, 1, 1, 1, '应用管理', 'system-template-app', 'panel/templateApp/index', 13, 'display-setting', 'panel/templateApp/index', 0, 0, 0, 'template:read', NULL, NULL, NULL, 1620444227389);
DROP TABLE IF EXISTS `panel_app_template`;
CREATE TABLE `panel_app_template` (
`id` varchar(50) NOT NULL,
`name` varchar(255) DEFAULT NULL COMMENT '名称',
`node_type` varchar(255) DEFAULT NULL COMMENT '节点类型',
`level` int(8) DEFAULT NULL,
`pid` varchar(255) DEFAULT NULL COMMENT '父级ID',
`version` varchar(255) DEFAULT NULL COMMENT '版本',
`application_info` longtext COMMENT '应用信息',
`panel_info` longtext COMMENT '仪表板信息',
`views_info` longtext COMMENT '视图信息',
`dataset_info` longtext COMMENT '数据集信息',
`dataset_fields_info` longtext COMMENT '数据集字段信息',
`dataset_tasks_info` longtext COMMENT '数据集任务信息',
`datasource_info` longtext COMMENT '数据源信息',
`snapshot` longtext,
`update_time` bigint(13) DEFAULT NULL,
`update_user` varchar(255) DEFAULT NULL,
`create_time` bigint(13) DEFAULT NULL,
`create_user` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `sys_menu` VALUES (800, 0, 0, 1, '数据集表单', 'dataset-form', 'dataset/form', 999, NULL, '/dataset-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_msg_channel` VALUES (3, 'webmsg.channel_wecom_msg', 'sendWecom');
INSERT INTO `sys_msg_channel` VALUES (4, 'webmsg.channel_dingtalk_msg', 'sendDingtalk');
INSERT INTO `sys_msg_channel` VALUES (5, 'webmsg.channel_lark_msg', 'sendLark');
UPDATE `dataset_table_function` SET `func` = 'CONCAT(s1,s2,...)' WHERE `id` = 29;
UPDATE `dataset_table_function` SET `func` = 'CONCAT(s1,s2,...)' WHERE `id` = 78;

View File

@ -63,8 +63,8 @@
<!-- <table tableName="de_engine">-->
<!-- <columnOverride column="configuration" property="configuration" javaType="java.lang.String"/>-->
<!-- </table>-->
<table tableName="panel_link_jump"/>
<table tableName="panel_link_jump_info"/>
<table tableName="panel_app_template"/>
<!-- <table tableName="panel_link_jump_info"/>-->
<!-- <table tableName="panel_outer_params_info"/>-->
<!-- <table tableName="panel_outer_params_target_view_info"/>-->
</context>

View File

@ -84,7 +84,7 @@ i18n_cst_ds_tb_or_field_deleted=Custom dataset union data is deleted or field ch
i18n_no_all_delete_privilege_folder=This folder have sources which have no manage or view privilege,Can Not Be Deleted.
i18n_excel_field_repeat=Duplicate fields exist, please modify and try again.
i18n_schema_is_empty=Database schema is empty
\u7AD9\u5185\u6D88\u606F=Internal Messages
\u7AD9\u5185\u6D88\u606F=Messages Center
\u6240\u6709\u6D88\u606F=All Messages
\u672A\u8BFB\u6D88\u606F=Unread Messages
\u5DF2\u8BFB\u6D88\u606F==Read Messages

View File

@ -84,7 +84,7 @@ i18n_cst_ds_tb_or_field_deleted=\u81EA\u5B9A\u4E49\u6570\u636E\u96C6\u6240\u5173
i18n_no_all_delete_privilege_folder=\u8BE5\u76EE\u5F55\u4E0B\u5B58\u5728\u6CA1\u6709\u7BA1\u7406\u6743\u9650\u6216\u67E5\u770B\u6743\u9650\u7684\u8D44\u6E90\uFF0C\u65E0\u6CD5\u5220\u9664
i18n_excel_field_repeat=\u5B58\u5728\u91CD\u590D\u5B57\u6BB5\uFF0C\u8BF7\u4FEE\u6539\u540E\u91CD\u8BD5
i18n_schema_is_empty=\u6570\u636E\u5E93 Schema \u4E3A\u7A7A
\u7AD9\u5185\u6D88\u606F=\u7AD9\u5185\u6D88\u606F
\u7AD9\u5185\u6D88\u606F=\u6D88\u606F\u4E2D\u5FC3
\u6240\u6709\u6D88\u606F=\u6240\u6709\u6D88\u606F
\u672A\u8BFB\u6D88\u606F=\u672A\u8BFB\u6D88\u606F
\u5DF2\u8BFB\u6D88\u606F=\u5DF2\u8BFB\u6D88\u606F
@ -219,5 +219,5 @@ I18N_USER_DONOT_EXIST=\u7528\u6237\u4E0D\u5B58\u5728
I18N_USER_SOURCE_PWD_ERROR=\u539F\u59CB\u5BC6\u7801\u9519\u8BEF
I18N_USER_PWD_FORMAT_ERROR=\u5BC6\u7801\u683C\u5F0F\u9519\u8BEF
I18N_DS_INVALID=数据源无效.
I18N_DS_INVALID_TABLE=数据源中有无效的表
I18N_DS_INVALID=\u6570\u636E\u6E90\u65E0\u6548.
I18N_DS_INVALID_TABLE=\u6570\u636E\u6E90\u4E2D\u6709\u65E0\u6548\u7684\u8868

View File

@ -84,7 +84,7 @@ i18n_cst_ds_tb_or_field_deleted=\u81EA\u5B9A\u7FA9\u6578\u64DA\u96C6\u6240\u95DC
i18n_no_all_delete_privilege_folder=\u8A72\u76EE\u9304\u4E0B\u5B58\u5728\u6C92\u6709\u7BA1\u7406\u6B0A\u9650\u6216\u67E5\u770B\u6B0A\u9650\u7684\u8CC7\u6E90\uFF0C\u7121\u6CD5\u522A\u9664
i18n_excel_field_repeat=\u5B58\u5728\u91CD\u5FA9\u5B57\u6BB5\uFF0C\u8ACB\u4FEE\u6539\u5F8C\u91CD\u8BD5
i18n_schema_is_empty=\u6578\u64DA\u5EAB Schema \u70BA\u7A7A
\u7AD9\u5185\u6D88\u606F=\u7AD9\u5167\u6D88\u606F
\u7AD9\u5185\u6D88\u606F=\u6D88\u606F\u4E2D\u5FC3
\u6240\u6709\u6D88\u606F=\u6240\u6709\u6D88\u606F
\u672A\u8BFB\u6D88\u606F=\u672A\u8B80\u6D88\u606F
\u5DF2\u8BFB\u6D88\u606F=\u5DF2\u8B80\u6D88\u606F
@ -215,5 +215,5 @@ I18N_USER_DONOT_EXIST=\u7528\u6236\u4E0D\u5B58\u5728
I18N_USER_SOURCE_PWD_ERROR=\u539F\u59CB\u5BC6\u78BC\u932F\u8AA4
I18N_USER_PWD_FORMAT_ERROR=\u5BC6\u78BC\u683C\u5F0F\u932F\u8AA4
I18N_DS_INVALID=數據源無效.
I18N_DS_INVALID_TABLE=數據源中有無效的表
I18N_DS_INVALID=\u6578\u64DA\u6E90\u7121\u6548.
I18N_DS_INVALID_TABLE=\u6578\u64DA\u6E90\u4E2D\u6709\u7121\u6548\u7684\u8868

View File

@ -299,3 +299,11 @@ export function findPanelElementInfo(viewId) {
loading: false
})
}
export function export2AppCheck(panelId){
return request({
url: 'panel/group/export2AppCheck/'+panelId,
method: 'get',
loading: false
})
}

View File

@ -0,0 +1,48 @@
import request from '@/utils/request'
export function save(data) {
return request({
url: '/templateApp/save',
data: data,
method: 'post',
loading: true
})
}
export function templateDelete(id) {
return request({
url: '/templateApp/delete/' + id,
method: 'delete'
})
}
export function showtemplateAppList(data) {
return request({
url: '/templateApp/templateAppList',
data: data,
method: 'post'
})
}
export function findOne(id) {
return request({
url: '/templateApp/findOne/' + id,
method: 'get'
})
}
export function find(data) {
return request({
url: '/templateApp/find',
data: data,
loading: true,
method: 'post'
})
}
export function nameCheck(data) {
return request({
url: '/templateApp/nameCheck',
data: data,
method: 'post'
})
}

View File

@ -1840,6 +1840,7 @@ export default {
sys_template: 'System Template',
user_template: 'User Template',
add_category: 'Add Category',
add_app_category: 'Add App Category',
filter_keywords: 'Enter keywords to filter',
dashboard_theme: 'Dashboard Theme',
table: 'Table',
@ -1859,6 +1860,7 @@ export default {
export_to_panel: 'Export to template',
export_to_pdf: 'Export to PDF',
export_to_img: 'Export to Image',
export_to_app: 'Export to App',
preview: 'Preview',
fullscreen_preview: 'Fullscreen Preview',
new_tab_preview: 'New Tab Preview',
@ -2221,8 +2223,11 @@ export default {
i18n_msg_type_dataset_sync_faild: 'Dataset synchronization failed',
i18n_msg_type_all: 'All type',
i18n_msg_type_ds_invalid: 'Datasource invalid',
channel_inner_msg: 'On site news',
channel_email_msg: 'Mail notification'
channel_inner_msg: 'On site',
channel_email_msg: 'Email',
channel_wecom_msg: 'Wecom',
channel_dingtalk_msg: 'Dingtalk',
channel_lark_msg: 'Lark'
},
denumberrange: {
label: 'Number range',

View File

@ -1840,6 +1840,7 @@ export default {
sys_template: '繫統模闆',
user_template: '用戶模闆',
add_category: '添加分類',
add_app_category: '添加应用分類',
filter_keywords: '輸入關鍵字進行過濾',
dashboard_theme: '儀錶闆主題',
table: '錶格',
@ -1859,6 +1860,7 @@ export default {
export_to_panel: '導出爲模闆',
export_to_pdf: '導出爲PDF',
export_to_img: '導出爲圖片',
export_to_app: '導出爲应用',
preview: '預覽',
fullscreen_preview: '全屏預覽',
new_tab_preview: '新Tab頁預覽',
@ -2223,7 +2225,10 @@ export default {
i18n_msg_type_ds_invalid: '數據源失效',
i18n_msg_type_all: '全部類型',
channel_inner_msg: '站內消息',
channel_email_msg: '郵件提醒'
channel_email_msg: '郵件提醒',
channel_wecom_msg: '企業微信',
channel_dingtalk_msg: '釘釘提醒',
channel_lark_msg: '飛書提醒'
},
denumberrange: {
label: '數值區間',

View File

@ -1840,6 +1840,7 @@ export default {
sys_template: '系统模板',
user_template: '用户模板',
add_category: '添加分类',
add_app_category: '添加应用分类',
filter_keywords: '输入关键字进行过滤',
dashboard_theme: '仪表板主题',
table: '表格',
@ -1859,6 +1860,7 @@ export default {
export_to_panel: '导出为模板',
export_to_pdf: '导出为PDF',
export_to_img: '导出为图片',
export_to_app: '导出为应用',
preview: '预览',
fullscreen_preview: '全屏预览',
new_tab_preview: '新Tab页预览',
@ -2223,7 +2225,10 @@ export default {
i18n_msg_type_ds_invalid: '数据源失效',
i18n_msg_type_all: '全部类型',
channel_inner_msg: '站内消息',
channel_email_msg: '邮件提醒'
channel_email_msg: '邮件提醒',
channel_wecom_msg: '企业微信',
channel_dingtalk_msg: '钉钉提醒',
channel_lark_msg: '飞书提醒'
},
denumberrange: {
label: '数值区间',

View File

@ -29,7 +29,7 @@ const actions = {
commit('SET_CURRENT_PATH', path)
}
}
export const fullScreenRouters = ['XpackThemeForm', 'system/datasource/DsForm']
export const fullScreenRouters = ['XpackThemeForm', 'system/datasource/DsForm', 'dataset/form']
export const filterAsyncRouter = (routers) => { // 遍历后台传来的路由字符串,转换为组件对象
return routers.map(router => {
if (!fullScreenRouters.includes(router.component) && router.type === 1 && router.pid === 0 && router.component && router.component !== 'Layout') {

View File

@ -3,8 +3,8 @@
<head>
<meta charset="utf-8"/>
<title>iconfont Demo</title>
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i2/O1CN01ZyAlrn1MwaMhqz36G_!!6000000001499-73-tps-64-64.ico" type="image/x-icon"/>
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01EYTRnJ297D6vehehJ_!!6000000008020-55-tps-64-64.svg"/>
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/>
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
<link rel="stylesheet" href="demo.css">
<link rel="stylesheet" href="iconfont.css">
@ -54,6 +54,12 @@
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe89e;</span>
<div class="name">application</div>
<div class="code-name">&amp;#xe89e;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6ef;</span>
<div class="name">data-source-24</div>
@ -780,9 +786,9 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1660024163434') format('woff2'),
url('iconfont.woff?t=1660024163434') format('woff'),
url('iconfont.ttf?t=1660024163434') format('truetype');
src: url('iconfont.woff2?t=1662616551987') format('woff2'),
url('iconfont.woff?t=1662616551987') format('woff'),
url('iconfont.ttf?t=1662616551987') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@ -808,6 +814,15 @@
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-application"></span>
<div class="name">
application
</div>
<div class="code-name">.icon-application
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-datasource-select"></span>
<div class="name">
@ -1897,6 +1912,14 @@
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-application"></use>
</svg>
<div class="name">application</div>
<div class="code-name">#icon-application</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-datasource-select"></use>

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2459092 */
src: url('iconfont.woff2?t=1660024163434') format('woff2'),
url('iconfont.woff?t=1660024163434') format('woff'),
url('iconfont.ttf?t=1660024163434') format('truetype');
src: url('iconfont.woff2?t=1662616551987') format('woff2'),
url('iconfont.woff?t=1662616551987') format('woff'),
url('iconfont.ttf?t=1662616551987') format('truetype');
}
.iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-application:before {
content: "\e89e";
}
.icon-datasource-select:before {
content: "\e6ef";
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "12253601",
"name": "application",
"font_class": "application",
"unicode": "e89e",
"unicode_decimal": 59550
},
{
"icon_id": "586829",
"name": "data-source-24",

View File

@ -231,7 +231,12 @@ export function seniorCfg(chart_option, chart) {
if (customStyle.yAxis) {
yAxis = JSON.parse(JSON.stringify(customStyle.yAxis))
}
senior.assistLine.forEach(ele => {
const fixedLines = senior.assistLine.filter(ele => ele.field === '0')
const dynamicLines = chart.data.dynamicAssistLines
const lines = fixedLines.concat(dynamicLines)
lines.forEach(ele => {
if (chart.type.includes('horizontal')) {
chart_option.series[0].markLine.data.push({
symbol: 'none',

View File

@ -658,7 +658,12 @@ export function getAnalyse(chart) {
const a = JSON.parse(JSON.stringify(customStyle.yAxis))
yAxisPosition = transAxisPosition(chart, a)
}
senior.assistLine.forEach(ele => {
const fixedLines = senior.assistLine.filter(ele => ele.field === '0')
const dynamicLines = chart.data.dynamicAssistLines
const lines = fixedLines.concat(dynamicLines)
lines.forEach(ele => {
const content = ele.name + ' : ' + parseFloat(ele.value)
assistLine.push({
type: 'line',

View File

@ -259,6 +259,10 @@ export default {
resultFormat() {
if (!this.chart.data) return
const value = this.chart.data.series[0].data[0]
if (value === null || value === undefined) {
this.result = '-'
return
}
let yAxis = []
try {
yAxis = JSON.parse(this.chart.yaxis)

View File

@ -16,10 +16,14 @@
</el-col>
<el-col :span="8">
<span v-if="item.field === '0'" :title="$t('chart.field_fixed')">{{ $t('chart.field_fixed') }}</span>
<span v-if="item.field === '1'" :title="$t('chart.field_dynamic')">{{ $t('chart.field_dynamic') }}</span>
</el-col>
<el-col :span="8">
<el-col v-if="item.field === '0'" :span="8">
<span :title="item.value">{{ item.value }}</span>
</el-col>
<el-col v-if="item.field === '1'" :span="8">
<span :title="item.curField.name + '(' + $t('chart.' + item.summary) + ')'">{{ item.curField.name + '(' + $t('chart.' + item.summary) + ')' }}</span>
</el-col>
</el-row>
</el-col>
</el-col>
@ -34,7 +38,7 @@
width="70%"
class="dialog-css"
>
<assist-line-edit :line="assistLine" @onAssistLineChange="lineChange" />
<assist-line-edit :line="assistLine" :quota-fields="quotaData" @onAssistLineChange="lineChange" />
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeEditLine">{{ $t('chart.cancel') }}</el-button>
<el-button type="primary" size="mini" @click="changeLine">{{ $t('chart.confirm') }}</el-button>
@ -52,13 +56,18 @@ export default {
chart: {
type: Object,
required: true
},
quotaData: {
type: Array,
required: true
}
},
data() {
return {
assistLine: [],
editLineDialog: false,
lineArr: []
lineArr: [],
quotaFields: []
}
},
watch: {
@ -114,21 +123,40 @@ export default {
})
return
}
if (!ele.value) {
this.$message({
message: this.$t('chart.value_can_not_empty'),
type: 'error',
showClose: true
})
return
}
if (parseFloat(ele.value).toString() === 'NaN') {
this.$message({
message: this.$t('chart.value_error'),
type: 'error',
showClose: true
})
return
if (ele.field === '0') {
if (!ele.value) {
this.$message({
message: this.$t('chart.value_can_not_empty'),
type: 'error',
showClose: true
})
return
}
if (parseFloat(ele.value).toString() === 'NaN') {
this.$message({
message: this.$t('chart.value_error'),
type: 'error',
showClose: true
})
return
}
} else {
if (!ele.fieldId || ele.fieldId === '') {
this.$message({
message: this.$t('chart.field_not_empty'),
type: 'error',
showClose: true
})
return
}
if (!ele.summary || ele.summary === '') {
this.$message({
message: this.$t('chart.summary_not_empty'),
type: 'error',
showClose: true
})
return
}
}
}
this.assistLine = JSON.parse(JSON.stringify(this.lineArr))

View File

@ -3,7 +3,7 @@
<el-button icon="el-icon-plus" circle size="mini" style="margin-bottom: 10px;" @click="addLine" />
<div style="max-height: 50vh;overflow-y: auto;">
<el-row v-for="(item,index) in lineArr" :key="index" class="line-item">
<el-col :span="6">
<el-col :span="4">
<el-input v-model="item.name" class="value-item" :placeholder="$t('chart.name')" size="mini" clearable @change="changeAssistLine" />
</el-col>
<el-col :span="4">
@ -16,9 +16,37 @@
/>
</el-select>
</el-col>
<el-col :span="6">
<el-col v-if="item.field === '0'" :span="8">
<el-input v-model="item.value" class="value-item" :placeholder="$t('chart.drag_block_label_value')" size="mini" clearable @change="changeAssistLine" />
</el-col>
<el-col v-if="item.field === '1'" :span="8">
<el-select v-model="item.fieldId" size="mini" class="select-item" :placeholder="$t('chart.field')" @change="changeAssistLineField(item)">
<el-option
v-for="quota in quotaData"
:key="quota.id"
:label="quota.name"
:value="quota.id"
>
<span style="float: left">
<svg-icon v-if="quota.deType === 0" icon-class="field_text" class="field-icon-text" />
<svg-icon v-if="quota.deType === 1" icon-class="field_time" class="field-icon-time" />
<svg-icon v-if="quota.deType === 2 || quota.deType === 3" icon-class="field_value" class="field-icon-value" />
<svg-icon v-if="quota.deType === 5" icon-class="field_location" class="field-icon-location" />
</span>
<span style="float: left; color: #8492a6; font-size: 12px">{{ quota.name }}</span>
</el-option>
</el-select>
<el-select v-model="item.summary" size="mini" class="select-item" :placeholder="$t('chart.summary')" @change="changeAssistLine">
<el-option v-if="item.curField && item.curField.id && item.curField.deType !== 0 && item.curField.deType !== 1 && item.curField.deType !== 5" key="sum" value="sum" :label="$t('chart.sum')" />
<el-option v-if="item.curField && item.curField.id && item.curField.deType !== 0 && item.curField.deType !== 1 && item.curField.deType !== 5" key="avg" value="avg" :label="$t('chart.avg')" />
<el-option v-if="item.curField && item.curField.id && item.curField.deType !== 0 && item.curField.deType !== 1 && item.curField.deType !== 5" key="max" value="max" :label="$t('chart.max')" />
<el-option v-if="item.curField && item.curField.id && item.curField.deType !== 0 && item.curField.deType !== 1 && item.curField.deType !== 5" key="min" value="min" :label="$t('chart.min')" />
<el-option v-if="item.curField && item.curField.id && item.curField.deType !== 0 && item.curField.deType !== 1 && item.curField.deType !== 5" key="stddev_pop" value="stddev_pop" :label="$t('chart.stddev_pop')" />
<el-option v-if="item.curField && item.curField.id && item.curField.deType !== 0 && item.curField.deType !== 1 && item.curField.deType !== 5" key="var_pop" value="var_pop" :label="$t('chart.var_pop')" />
<el-option key="count" value="count" :label="$t('chart.count')" />
<el-option v-if="item.curField && item.curField.id" key="count_distinct" value="count_distinct" :label="$t('chart.count_distinct')" />
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="item.lineType" size="mini" class="select-item" @change="changeAssistLine">
<el-option
@ -49,6 +77,10 @@ export default {
line: {
type: Array,
required: true
},
quotaFields: {
type: Array,
required: true
}
},
data() {
@ -57,26 +89,40 @@ export default {
lineObj: {
name: '辅助线',
field: '0', //
fieldId: '',
summary: 'count',
axis: 'y', //
value: '0',
lineType: 'solid',
color: '#ff0000'
color: '#ff0000',
curField: {}
},
fieldOptions: [
{ label: this.$t('chart.field_fixed'), value: '0' }
{ label: this.$t('chart.field_fixed'), value: '0' },
{ label: this.$t('chart.field_dynamic'), value: '1' }
],
lineOptions: [
{ label: this.$t('chart.line_type_solid'), value: 'solid' },
{ label: this.$t('chart.line_type_dashed'), value: 'dashed' },
{ label: this.$t('chart.line_type_dotted'), value: 'dotted' }
],
predefineColors: COLOR_PANEL
predefineColors: COLOR_PANEL,
quotaData: []
}
},
watch: {
'quotaFields': function() {
this.initField()
}
},
mounted() {
this.initField()
this.init()
},
methods: {
initField() {
this.quotaData = this.quotaFields.filter(ele => !ele.chartId && ele.id !== 'count')
},
init() {
this.lineArr = JSON.parse(JSON.stringify(this.line))
},
@ -91,6 +137,23 @@ export default {
changeAssistLine() {
this.$emit('onAssistLineChange', this.lineArr)
},
changeAssistLineField(item) {
item.curField = this.getQuotaField(item.fieldId)
this.changeAssistLine()
},
getQuotaField(id) {
if (!id) {
return {}
}
const fields = this.quotaData.filter(ele => {
return ele.id === id
})
if (fields.length === 0) {
return {}
} else {
return fields[0]
}
}
}
}
@ -119,7 +182,7 @@ span {
.value-item {
position: relative;
display: inline-block;
width: 120px !important;
width: 100px !important;
}
.select-item {

View File

@ -803,6 +803,7 @@
:param="param"
class="attr-selector"
:chart="chart"
:quota-data="quotaData"
@onAssistLineChange="onAssistLineChange"
/>
</el-collapse-item>
@ -2029,7 +2030,7 @@ export default {
onAssistLineChange(val) {
this.view.senior.assistLine = val
this.calcStyle()
this.calcData()
},
onThresholdChange(val) {
@ -2294,6 +2295,8 @@ export default {
closeEditDsField() {
this.editDsField = false
this.initTableField(this.table.id)
//
this.calcData()
},
editChartField() {
@ -2751,6 +2754,8 @@ export default {
this.editChartCalcField = false
this.currEditField = {}
this.initTableField(this.table.id)
//
this.calcData()
},
deleteChartCalcField(item) {
this.$confirm(this.$t('dataset.confirm_delete'), this.$t('chart.tips'), {

View File

@ -0,0 +1,17 @@
<template>
<div>this is dataset form</div>
</template>
<script>
export default {
name: 'DatasetForm',
data() {
return {
}
},
methods: {
}
}
</script>

View File

@ -60,6 +60,7 @@
<el-dropdown-item icon="el-icon-copy-document" @click.native="downloadToTemplate">{{ $t('panel.export_to_panel') }}</el-dropdown-item>
<el-dropdown-item icon="el-icon-notebook-2" @click.native="downloadAsPDF">{{ $t('panel.export_to_pdf') }}</el-dropdown-item>
<el-dropdown-item icon="el-icon-picture-outline" @click.native="downloadAsImage">{{ $t('panel.export_to_img') }}</el-dropdown-item>
<el-dropdown-item icon="el-icon-s-data" @click.native="downLoadToApp">{{ $t('panel.export_to_app') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
@ -164,7 +165,7 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine'
import bus from '@/utils/bus'
import { queryAll } from '@/api/panel/pdfTemplate'
import ShareHead from '@/views/panel/GrantAuth/ShareHead'
import { initPanelData, updatePanelStatus } from '@/api/panel/panel'
import {export2AppCheck, initPanelData, updatePanelStatus} from '@/api/panel/panel'
import { proxyInitPanelData } from '@/api/panel/shareProxy'
import { dataURLToBlob } from '@/components/canvas/utils/utils'
import { findResourceAsBase64 } from '@/api/staticResource/staticResource'
@ -326,6 +327,48 @@ export default {
_this.dataLoading = false
}
},
saveAppFile(appAttachInfo) {
const _this = this
_this.dataLoading = true
try {
_this.findStaticSource(function(staticResource) {
html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => {
_this.dataLoading = false
const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.1
if (snapshot !== '') {
const panelInfo = {
name: _this.$store.state.panel.panelInfo.name,
id: _this.$store.state.panel.panelInfo.id,
snapshot: snapshot,
panelStyle: JSON.stringify(_this.canvasStyleData),
panelData: JSON.stringify(_this.componentData),
staticResource: JSON.stringify(staticResource || {})
}
appAttachInfo['panelInfo'] = JSON.stringify(panelInfo)
const blob = new Blob([JSON.stringify(appAttachInfo)], { type: '' })
FileSaver.saveAs(blob, _this.$store.state.panel.panelInfo.name + '-APP.DEAPP')
}
})
})
} catch (e) {
console.error(e)
_this.dataLoading = false
}
},
downLoadToApp(){
this.dataLoading = true
export2AppCheck(this.$store.state.panel.panelInfo.id).then(rsp=>{
if(rsp.data.checkStatus){
this.saveAppFile(rsp.data)
}else{
this.dataLoading = false
this.$message({
message: rsp.data.checkMes,
type: 'error'
})
}
})
},
//
findStaticSource(callBack) {
const staticResource = []

View File

@ -414,4 +414,4 @@ export default {
}
}
}
</style>
</style>

View File

@ -0,0 +1,222 @@
<template>
<div
class="template-import"
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
>
<el-form
ref="templateImportForm"
class="de-form-item"
:model="templateInfo"
:rules="templateInfoRules"
>
<el-form-item :label="'应用名称'" prop="name">
<div class="flex-template">
<el-input v-model="templateInfo.name" clearable size="small" />
<deBtn
style="margin-left: 10px"
class="el-icon-upload2"
secondary
@click="goFile"
>上传应用</deBtn
>
<input
id="input"
ref="files"
type="file"
accept=".DEAPP"
hidden
@change="handleFileChange"
/>
</div>
</el-form-item>
</el-form>
<el-row class="preview" :style="classBackground" />
<el-row class="de-root-class">
<deBtn secondary @click="cancel()">{{
$t("commons.cancel")
}}</deBtn>
<deBtn type="primary" @click="save()">{{
$t("commons.confirm")
}}</deBtn>
</el-row>
</div>
</template>
<script>
import { save, nameCheck } from "@/api/system/templateApp";
import msgCfm from "@/components/msgCfm/index";
import { find } from "@/api/system/template";
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default {
mixins: [msgCfm],
props: {
pid: {
type: String,
required: true,
},
},
data() {
return {
appResultInfo:null,
importTemplateInfo: {
snapshot: "",
},
templateInfoRules: {
name: [
{
required: true,
message: this.$t("commons.input_content"),
trigger: "change",
},
],
},
recover: false,
templateInfo: {
level: "1",
pid: this.pid,
name: "",
templateStyle: null,
templateData: null,
dynamicData: null,
staticResource: null,
snapshot: "",
},
};
},
computed: {
classBackground() {
if (this.importTemplateInfo.snapshot) {
return {
background: `url(${imgUrlTrans(this.importTemplateInfo.snapshot)}) no-repeat`,
};
} else {
return {};
}
},
},
created() {
this.showCurrentTemplate(this.pid);
},
methods: {
showCurrentTemplate(pid) {
find({ pid }).then((response) => {
this.nameList = response.data;
});
},
cancel() {
this.$emit("closeEditTemplateDialog");
},
save() {
if (!this.templateInfo.name) {
this.$warning(this.$t("chart.name_can_not_empty"));
return false;
}
if (!this.templateInfo.templateData) {
this.$warning(this.$t("chart.template_can_not_empty"));
return false;
}
const nameCheckRequest = {
pid: this.templateInfo.pid,
name: this.templateInfo.name,
optType: "insert",
};
this.appResultInfo['pid'] =this.templateInfo.pid,
this.appResultInfo['name'] =this.templateInfo.name,
this.appResultInfo['level'] =this.templateInfo.level
this.appResultInfo['snapshot'] =this.templateInfo.snapshot
const _this = this
nameCheck(nameCheckRequest).then((response) => {
if (response.data.indexOf("exist") > -1) {
const options = {
title: 'commons.prompt',
content: "system_parameter_setting.to_overwrite_them",
type: "primary",
cb: () => save(_this.appResultInfo).then((response) => {
this.openMessageSuccess("system_parameter_setting.import_succeeded");
this.$emit("refresh");
this.$emit("closeEditTemplateDialog");
}),
confirmButtonText: this.$t('template.override')
};
this.handlerConfirm(options);
} else {
save(_this.appResultInfo).then((response) => {
this.openMessageSuccess("system_parameter_setting.import_succeeded");
this.$emit("refresh");
this.$emit("closeEditTemplateDialog");
});
}
});
},
handleFileChange(e) {
const file = e.target.files[0];
const reader = new FileReader();
const _this = this
reader.onload = (res) => {
_this.appResultInfo = JSON.parse(res.target.result);
_this.importTemplateInfo = JSON.parse(this.appResultInfo.panelInfo)
_this.templateInfo.name = this.importTemplateInfo.name;
_this.templateInfo.templateStyle = this.importTemplateInfo.panelStyle;
_this.templateInfo.templateData = this.importTemplateInfo.panelData;
_this.templateInfo.snapshot = this.importTemplateInfo.snapshot;
_this.templateInfo.dynamicData = this.importTemplateInfo.dynamicData;
_this.templateInfo.staticResource =
_this.importTemplateInfo.staticResource;
_this.templateInfo.nodeType = "template";
};
reader.readAsText(file);
},
goFile() {
this.$refs.files.click();
},
},
};
</script>
<style scoped>
.my_table ::v-deep .el-table__row > td {
/* 去除表格线 */
border: none;
padding: 0 0;
}
.my_table ::v-deep .el-table th.is-leaf {
/* 去除上边框 */
border: none;
}
.my_table ::v-deep .el-table::before {
/* 去除下边框 */
height: 0;
}
.de-root-class {
margin-top: 24px;
text-align: right;
}
.preview {
margin-top: -12px;
border: 1px solid #e6e6e6;
height: 300px !important;
overflow: auto;
background-size: 100% 100% !important;
border-radius: 4px;
}
.preview-show {
border-left: 1px solid #e6e6e6;
height: 300px;
background-size: 100% 100% !important;
}
</style>
<style lang="scss">
.flex-template {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.el-input {
margin-right: 2px;
flex: 1;
}
}
</style>

View File

@ -0,0 +1,145 @@
<template>
<div :style="classBackground" class="de-card-model">
<div class="card-img-model" :style="classImg">
<img :src="model.snapshot" alt="" />
</div>
<div class="card-info">
<el-tooltip
class="item"
effect="dark"
:content="model.name"
placement="top"
>
<span class="de-model-text">{{ model.name }}</span>
</el-tooltip>
<el-dropdown size="medium" trigger="click" @command="handleCommand">
<i class="el-icon-more"></i>
<el-dropdown-menu class="de-card-dropdown" slot="dropdown">
<slot>
<!-- <el-dropdown-item command="rename">-->
<!-- <i class="el-icon-edit"></i>-->
<!-- {{ $t('chart.rename')}}-->
<!-- </el-dropdown-item>-->
<el-dropdown-item command="delete">
<i class="el-icon-delete"></i>
卸载
</el-dropdown-item>
</slot>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</template>
<script>
export default {
props: {
model: {
type: Object,
default: () => {},
},
width: {
type: Number
}
},
computed: {
classBackground() {
return {
width: this.width + 'px',
height: this.width * 0.714 + 'px',
}
},
classImg() {
return {
width: this.width + 'px',
height: this.width * 0.576 + 'px',
// background: `url(${this.model.snapshot}) no-repeat`,
// 'background-size': `100% 100%`
}
},
},
methods: {
handleCommand(key) {
this.$emit("command", key);
},
},
};
</script>
<style lang="scss">
.de-card-model {
box-sizing: border-box;
background: #ffffff;
border: 1px solid var(--deCardStrokeColor, #dee0e3);
border-radius: 4px;
margin: 0 24px 25px 0;
.card-img-model {
border-bottom: 1px solid var(--deCardStrokeColor, #dee0e3);
height: 144px;
width: 100%;
overflow: hidden;
img {
width: 100%;
height: 100%;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
}
.card-info {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px 9px 12px;
box-sizing: border-box;
.el-icon-more {
width: 24px;
height: 24px;
line-height: 24px;
text-align: center;
font-size: 12px;
color: #646a73;
cursor: pointer;
}
.el-icon-more:hover {
background: rgba(31, 35, 41, 0.1);
border-radius: 4px;
}
.el-icon-more:active {
background: rgba(31, 35, 41, 0.2);
border-radius: 4px;
}
}
.de-model-text {
font-family: "PingFang SC";
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 22px;
color: #1f2329;
display: inline-block;
width: 90%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
margin-right: 10px;
}
}
.de-card-model:hover {
box-shadow: 0px 6px 24px rgba(31, 35, 41, 0.08);
}
.de-card-dropdown {
margin-top: 0 !important;
.popper__arrow {
display: none !important;
}
}
</style>

View File

@ -0,0 +1,235 @@
<template xmlns:el-col="http://www.w3.org/1999/html">
<div class="de-template-list">
<el-input
v-model="templateFilterText"
:placeholder="$t('system_parameter_setting.search_keywords')"
size="small"
class="de-input-search"
clearable
>
<svg-icon slot="prefix" icon-class="de-search"></svg-icon>
</el-input>
<el-empty
:image="noneImg"
v-if="!templateListComputed.length && templateFilterText === ''"
:description="$t('components.no_classification')"
></el-empty>
<el-empty
:image="nothingImg"
v-if="!templateListComputed.length && templateFilterText !== ''"
:description="$t('components.relevant_content_found')"
></el-empty>
<ul>
<li
:class="[{ select: activeTemplate === ele.id }]"
@click="nodeClick(ele)"
v-for="ele in templateListComputed"
:key="ele.name"
>
<svg-icon icon-class="scene" class="ds-icon-scene" />
<span>{{ ele.name }}</span>
<span @click.stop class="more">
<el-dropdown
trigger="click"
size="small"
@command="(type) => clickMore(type, ele)"
>
<span class="el-dropdown-link">
<i class="el-icon-more"></i>
</span>
<el-dropdown-menu class="de-template-dropdown" slot="dropdown">
<el-dropdown-item icon="el-icon-upload2" command="import">
{{ $t("panel.import") }}
</el-dropdown-item>
<el-dropdown-item icon="el-icon-edit" command="edit">
{{ $t("panel.rename") }}
</el-dropdown-item>
<el-dropdown-item icon="el-icon-delete" command="delete">
{{ $t("panel.delete") }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
</li>
</ul>
<deBtn
v-if="templateFilterText === ''"
style="width: 100%"
icon="el-icon-plus"
secondary
@click="add()"
>
{{ $t("panel.add_app_category") }}
</deBtn>
</div>
</template>
<script>
import msgCfm from "@/components/msgCfm/index";
export default {
name: "TemplateList",
mixins: [msgCfm],
components: {},
props: {
templateType: {
type: String,
default: "",
},
templateList: {
type: Array,
default: function () {
return [];
},
},
},
data() {
return {
templateFilterText: "",
activeTemplate: "",
noneImg: require("@/assets/None.png"),
nothingImg: require("@/assets/nothing.png"),
};
},
computed: {
templateListComputed() {
// if (!this.templateFilterText)
// return [
// ...this.templateList,
// ...this.templateList,
// ...this.templateList,
// ...this.templateList,
// ];
if (!this.templateFilterText) return [...this.templateList];
return this.templateList.filter((ele) =>
ele.name.includes(this.templateFilterText)
);
},
},
methods: {
clickMore(type, data) {
switch (type) {
case "edit":
this.templateEdit(data);
break;
case "delete":
this.templateDelete(data);
break;
case "import":
this.templateImport(data);
break;
}
},
nodeClick({ id, name }) {
this.activeTemplate = id;
this.$emit("showCurrentTemplate", id, name);
},
add() {
this.$emit("showTemplateEditDialog", "new");
},
templateDelete(template) {
const options = {
title: "system_parameter_setting.delete_this_category",
content: "system_parameter_setting.also_be_deleted",
type: "primary",
cb: () => this.$emit("templateDelete", template.id),
};
this.handlerConfirm(options);
},
templateEdit(template) {
this.$emit("templateEdit", template);
},
templateImport(template) {
this.$emit("templateImport", template.id);
},
},
};
</script>
<style scoped lang="scss">
.de-template-list {
height: 100%;
position: relative;
ul {
margin: 16px 0 20px 0;
padding: 0;
overflow-y: auto;
max-height: calc(100% - 90px);
}
li {
list-style: none;
width: 100%;
box-sizing: border-box;
height: 40px;
padding: 0 30px 0 12px;
display: flex;
align-items: center;
border-radius: 4px;
color: var(--deTextPrimary, #1f2329);
font-family: "PingFang SC";
font-style: normal;
font-weight: 500;
font-size: 14px;
cursor: pointer;
position: relative;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.folder {
color: #8f959e;
margin-right: 9px;
}
.more {
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
display: none;
.el-icon-more {
width: 24px;
height: 24px;
line-height: 24px;
text-align: center;
font-size: 12px;
color: #646a73;
cursor: pointer;
}
.el-icon-more:hover {
background: rgba(31, 35, 41, 0.1);
border-radius: 4px;
}
.el-icon-more:active {
background: rgba(31, 35, 41, 0.2);
border-radius: 4px;
}
}
&:hover {
background: rgba(31, 35, 41, 0.1);
.more {
display: block;
}
}
}
li.select {
background: var(--deWhiteHover, #3370ff);
color: var(--primary, #3370ff);
}
.de-btn-fix {
position: absolute;
bottom: 0;
left: 0;
}
}
.de-template-dropdown {
margin-top: 0 !important;
.popper__arrow {
display: none !important;
}
}
</style>

View File

@ -0,0 +1,405 @@
<template>
<de-layout-content>
<div class="de-template">
<div
class="tabs-container flex-tabs"
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
>
<div class="de-tabs-left">
<template-list
ref="templateList"
:template-type="currentTemplateType"
:template-list="templateList"
@templateDelete="templateDelete"
@templateEdit="templateEdit"
@showCurrentTemplate="showCurrentTemplate"
@templateImport="templateImport"
@showTemplateEditDialog="showTemplateEditDialog"
/>
</div>
<div class="de-tabs-right">
<div v-if="currentTemplateLabel" class="active-template">
{{ currentTemplateLabel }}&nbsp;&nbsp;({{
currentTemplateShowList.length
}})
<deBtn
type="primary"
@click="templateImport(currentTemplateId)"
icon="el-icon-upload2"
>
上传应用
</deBtn>
</div>
<el-empty
:image="noneImg"
v-if="!currentTemplateShowList.length"
:description="$t('components.no_template')"
></el-empty>
<div
id="template-box"
v-show="currentTemplateId !== ''"
class="template-box"
>
<template-item
v-for="item in currentTemplateShowList"
:key="item.id"
:width="templateCurWidth"
:model="item"
@command="(key) => handleCommand(key, item)"
/>
</div>
</div>
</div>
</div>
<el-dialog
:title="dialogTitle"
:visible.sync="editTemplate"
append-to-body
class="de-dialog-form"
width="600px"
>
<el-form
ref="templateEditForm"
class="de-form-item"
:model="templateEditForm"
:rules="templateEditFormRules"
>
<el-form-item :label="dialogTitleLabel" prop="name">
<el-input v-model="templateEditForm.name" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<deBtn secondary @click="close()">{{ $t("commons.cancel") }}</deBtn>
<deBtn type="primary" @click="saveTemplateEdit(templateEditForm)"
>{{ $t("commons.confirm") }}
</deBtn>
</div>
</el-dialog>
<!--导入templatedialog-->
<el-dialog
:title="templateDialog.title"
:visible.sync="templateDialog.visible"
:show-close="true"
class="de-dialog-form"
width="600px"
>
<template-import
v-if="templateDialog.visible"
:pid="templateDialog.pid"
@refresh="showCurrentTemplate(currentTemplateId,
currentTemplateLabel)"
@closeEditTemplateDialog="closeEditTemplateDialog"
/>
</el-dialog>
</de-layout-content>
</template>
<script>
import DeLayoutContent from "@/components/business/DeLayoutContent";
import TemplateList from "./component/TemplateList";
import TemplateItem from "./component/TemplateItem";
import TemplateImport from "./component/TemplateImport";
import { save, templateDelete, find } from "@/api/system/templateApp";
import elementResizeDetectorMaker from "element-resize-detector";
import msgCfm from "@/components/msgCfm/index";
export default {
name: "TemplateApp",
mixins: [msgCfm],
components: { DeLayoutContent, TemplateList, TemplateItem, TemplateImport },
data() {
return {
showShare: false,
currentTemplateShowList: [],
noneImg: require('@/assets/None.png'),
currentPid: "",
currentTemplateType: "self",
templateEditFormRules: {
name: [
{ required: true, trigger: "blur", validator: this.roleValidator },
{
required: true,
message: this.$t("commons.input_content"),
trigger: "blur",
},
{
max: 50,
message: this.$t("commons.char_can_not_more_50"),
trigger: "change",
},
],
},
templateEditForm: {},
editTemplate: false,
dialogTitle: "",
dialogTitleLabel: "",
currentTemplateLabel: "",
currentTemplateId: "",
templateList: [],
templateMiniWidth: 286,
templateCurWidth: 286,
formType: "",
originName: "",
templateDialog: {
title: '导入应用',
visible: false,
pid: "",
},
};
},
computed: {
nameList() {
const { nodeType } = this.templateEditForm || {};
if ("template" === nodeType) {
return this.currentTemplateShowList.map((ele) => ele.name);
}
if ("folder" === nodeType) {
return this.templateList.map((ele) => ele.name);
}
return [];
},
},
mounted() {
this.getTree();
const _this = this;
const erd = elementResizeDetectorMaker();
const templateMainDom = document.getElementById("template-box");
// div
erd.listenTo(templateMainDom, (element) => {
_this.$nextTick(() => {
const curSeparator = Math.trunc(
templateMainDom.offsetWidth / _this.templateMiniWidth
);
_this.templateCurWidth =
Math.trunc(templateMainDom.offsetWidth / curSeparator) - 24 - curSeparator;
});
});
},
methods: {
roleValidator(rule, value, callback) {
if (this.nameRepeat(value)) {
const { nodeType } = this.templateEditForm || {};
callback(
new Error(
this.$t(
`system_parameter_setting.${
"folder" === nodeType
? "name_already_exists_type"
: "the_same_category"
}`
)
)
);
} else {
callback();
}
},
nameRepeat(value) {
if (!this.nameList || this.nameList.length === 0) {
return false;
}
//
if (this.formType === "edit" && this.originName === value) {
return false;
}
return this.nameList.some((name) => name === value);
},
handleCommand(key, data) {
switch (key) {
case "rename":
this.templateEdit(data);
break;
case "delete":
this.templateDeleteConfirm(data);
break;
default:
break;
}
},
templateDeleteConfirm(template) {
const options = {
title: "system_parameter_setting.delete_this_template",
type: "primary",
cb: () => this.templateDelete(template.id),
};
this.handlerConfirm(options);
},
handleClick(tab, event) {
this.getTree();
},
showCurrentTemplate(pid, name) {
this.currentTemplateId = pid;
this.currentTemplateLabel = name;
if (this.currentTemplateId) {
find({ pid: this.currentTemplateId }).then((response) => {
this.currentTemplateShowList = response.data;
});
}
},
templateDelete(id) {
if (id) {
templateDelete(id).then((response) => {
this.openMessageSuccess("commons.delete_success");
this.showCurrentTemplate(this.currentTemplateId, this.currentTemplateLabel);
});
}
},
showTemplateEditDialog(type, templateInfo) {
this.templateEditForm = null;
this.formType = type;
if (type === "edit") {
this.templateEditForm = JSON.parse(JSON.stringify(templateInfo));
this.dialogTitle = this.$t(
`system_parameter_setting.${
"folder" === this.templateEditForm.nodeType
? "edit_classification"
: "edit_template"
}`
);
this.originName = this.templateEditForm.label;
} else {
this.dialogTitle = this.$t("panel.add_app_category");
this.templateEditForm = {
name: "",
nodeType: "folder",
templateType: this.currentTemplateType,
level: 0,
pid: 0,
};
}
this.dialogTitleLabel = this.$t(
`system_parameter_setting.${
"folder" === this.templateEditForm.nodeType
? "classification_name"
: "template_name"
}`
);
this.editTemplate = true;
},
templateEdit(templateInfo) {
this.showTemplateEditDialog("edit", templateInfo);
},
saveTemplateEdit(templateEditForm) {
this.$refs["templateEditForm"].validate((valid) => {
if (valid) {
save(templateEditForm).then((response) => {
this.close();
this.openMessageSuccess(
`system_parameter_setting.${
this.templateEditForm.id
? "rename_succeeded"
: "added_successfully"
}`
);
this.getTree();
});
} else {
return false;
}
});
},
close() {
this.$refs["templateEditForm"].resetFields();
this.editTemplate = false;
},
getTree() {
const request = {
templateType: this.currentTemplateType,
pid: "0",
};
find(request).then((res) => {
this.templateList = res.data;
this.showFirst();
});
},
showFirst() {
//
if (this.templateList && this.templateList.length > 0) {
let showFirst = true;
this.templateList.forEach((template) => {
if (template.id === this.currentTemplateId) {
showFirst = false;
}
});
if (showFirst) {
this.$nextTick().then(() => {
const [obj = {}] = this.templateList;
this.$refs.templateList.nodeClick(obj);
});
} else {
this.showCurrentTemplate(this.currentTemplateId, this.currentTemplateLabel);
}
} else {
this.currentTemplateShowList = [];
}
},
closeEditTemplateDialog() {
this.templateDialog.visible = false;
},
templateImport(pid) {
this.templateDialog.visible = true;
this.templateDialog.pid = pid;
},
},
};
</script>
<style lang="scss" scoped>
.de-template {
height: 100%;
background-color: var(--MainBG, #f5f6f7);
.tabs-container {
height: 100%;
background: var(--ContentBG, #ffffff);
overflow-x: auto;
}
.flex-tabs {
display: flex;
background: #f5f6f7;
}
.de-tabs-left {
background: #fff;
width: 269px;
border-right: 1px solid rgba(31, 35, 41, 0.15);
padding: 24px;
}
.de-tabs-right {
flex: 1;
background: #fff;
padding: 24px 0 24px 24px;
overflow: hidden;
.template-box {
display: flex;
flex-wrap: wrap;
overflow-y: auto;
box-sizing: border-box;
align-content: flex-start;
height: calc(100% - 10px);
width: 100%;
padding-bottom: 24px;
}
.active-template {
margin: 4px 0 20px 0;
padding-right: 24px;
font-family: "PingFang SC";
font-style: normal;
font-weight: 500;
font-size: 16px;
display: flex;
align-items: center;
justify-content: space-between;
color: var(--deTextPrimary, #1f2329);
}
}
}
::v-deep .container-wrapper{
padding: 0px!important;
}
</style>

View File

@ -3,96 +3,92 @@
<el-row class="top-operate">
<el-col :span="12">
<el-button
v-permission="['user:add']"
class="btn"
type="primary"
v-permission="['user:add']"
icon="el-icon-plus"
@click="create"
>{{ $t("user.create") }}</el-button
>
>{{ $t("user.create") }}</el-button>
<plugin-com v-if="isPluginLoaded" ref="ImportUserCom" component-name="ImportUser" />
</el-col>
<el-col :span="12" class="right-user">
<el-input
ref="search"
v-model="nikeName"
:placeholder="$t('role.search_by_name_email')"
prefix-icon="el-icon-search"
class="name-email-search"
size="small"
clearable
ref="search"
v-model="nikeName"
@blur="initSearch"
@clear="initSearch"
>
</el-input>
/>
<el-button
class="normal btn"
v-btnPress="filterColor"
class="normal btn"
:class="[filterTexts.length ? 'active-btn filter-not-null' : 'filter-zero']"
icon="iconfont icon-icon-filter"
@click="filterShow"
>{{ $t('user.filter') }}<template v-if="filterTexts.length">
({{ filterTexts.length }})
</template>
>{{ $t('user.filter') }}<template v-if="filterTexts.length">
({{ filterTexts.length }})
</template>
</el-button>
<el-dropdown trigger="click" :hide-on-click="false">
<el-button v-btnPress class="normal btn filter-zero" icon="el-icon-setting"
>{{ $t('user.list') }}</el-button
>
<el-dropdown-menu class="list-colums-slect" slot="dropdown">
<el-button
v-btnPress
class="normal btn filter-zero"
icon="el-icon-setting"
>{{ $t('user.list') }}</el-button>
<el-dropdown-menu slot="dropdown" class="list-colums-slect">
<p class="title">{{ $t('user.list_info') }}</p>
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAll"
:indeterminate="isIndeterminate"
@change="handleCheckAllChange"
>{{ $t('dataset.check_all')}}</el-checkbox
>
>{{ $t('dataset.check_all') }}</el-checkbox>
<el-checkbox-group
v-model="checkedColumnNames"
@change="handleCheckedColumnNamesChange"
>
<el-checkbox
v-for="column in columnNames"
:label="column.props"
:key="column.props"
>{{ $t(column.label) }}</el-checkbox
>
:label="column.props"
>{{ $t(column.label) }}</el-checkbox>
</el-checkbox-group>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-row>
<div class="filter-texts" v-if="filterTexts.length">
<div v-if="filterTexts.length" class="filter-texts">
<span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{$t('user.result_one')}}</span>
<el-divider direction="vertical"></el-divider>
<i @click="scrollPre" v-if="showScroll" class="el-icon-arrow-left arrow-filter"></i>
<span class="title">{{ $t('user.result_one') }}</span>
<el-divider direction="vertical" />
<i v-if="showScroll" class="el-icon-arrow-left arrow-filter" @click="scrollPre" />
<div class="filter-texts-container">
<p class="text" v-for="(ele, index) in filterTexts" :key="ele">
{{ ele }} <i @click="clearOneFilter(index)" class="el-icon-close"></i>
<p v-for="(ele, index) in filterTexts" :key="ele" class="text">
{{ ele }} <i class="el-icon-close" @click="clearOneFilter(index)" />
</p>
</div>
<i @click="scrollNext" v-if="showScroll" class="el-icon-arrow-right arrow-filter"></i>
<i v-if="showScroll" class="el-icon-arrow-right arrow-filter" @click="scrollNext" />
<el-button
type="text"
class="clear-btn"
icon="el-icon-delete"
@click="clearFilter"
>{{$t('user.clear_filter')}}</el-button
>
>{{ $t('user.clear_filter') }}</el-button>
</div>
<div
class="table-container"
id="resize-for-filter"
class="table-container"
:class="[filterTexts.length ? 'table-container-filter' : '']"
>
<grid-table
v-if="canLoadDom"
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
:tableData="data"
:table-data="data"
:columns="checkedColumnNames"
:pagination="paginationConfig"
@sort-change="sortChange"
@ -101,8 +97,8 @@
>
<el-table-column prop="username" label="ID" />
<el-table-column
show-overflow-tooltip
key="nickName"
show-overflow-tooltip
prop="nickName"
sortable="custom"
:label="$t('commons.nick_name')"
@ -115,23 +111,32 @@
scope.row.from === 0
? "LOCAL"
: scope.row.from === 1
? "LDAP"
: "OIDC"
? "LDAP"
: scope.row.from === 2
? "OIDC"
: scope.row.from === 3
? "CAS"
: scope.row.from === 4
? "Wecom"
: scope.row.from === 5
? "Dingtalk"
: scope.row.from === 6
? "Lark" : '-'
}}
</div>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
key="email"
show-overflow-tooltip
prop="email"
:label="$t('commons.email')"
/>
<el-table-column
v-if="isPluginLoaded"
show-overflow-tooltip
key="dept"
show-overflow-tooltip
prop="dept"
sortable="custom"
:label="$t('commons.organization')"
@ -142,13 +147,12 @@
</el-table-column>
<el-table-column
v-if="isPluginLoaded"
key="roles"
prop="roles"
:formatter="filterRoles"
key="roles"
show-overflow-tooltip
:label="$t('commons.role')"
>
</el-table-column>
/>
<el-table-column
key="status"
prop="status"
@ -168,9 +172,9 @@
</template>
</el-table-column>
<el-table-column
key="createTime"
show-overflow-tooltip
prop="createTime"
key="createTime"
sortable="custom"
:label="$t('commons.create_time')"
width="180"
@ -189,20 +193,19 @@
<template slot-scope="scope">
<el-button
v-permission="['user:edit']"
@click="edit(scope.row)"
class="text-btn mr2"
type="text"
>{{ $t("commons.edit") }}</el-button
>
@click="edit(scope.row)"
>{{ $t("commons.edit") }}</el-button>
<el-popover
:ref="'initPwd' + scope.row.userId"
placement="left"
width="321"
:ref="'initPwd' + scope.row.userId"
popper-class="reset-pwd"
trigger="click"
>
<i class="el-icon-warning"></i>
<div class="tips">{{$t('user.recover_pwd')}}</div>
<i class="el-icon-warning" />
<div class="tips">{{ $t('user.recover_pwd') }}</div>
<div class="editer-form-title">
<span class="pwd" type="text">{{
$t("commons.default_pwd") + "" + defaultPWD
@ -222,11 +225,10 @@
$t("fu.search_bar.cancel")
}}</el-button> -->
<el-button
@click="resetPwd(scope.row.userId)"
type="primary"
class="btn"
>{{ $t("fu.search_bar.ok") }}</el-button
>
@click="resetPwd(scope.row.userId)"
>{{ $t("fu.search_bar.ok") }}</el-button>
</div>
<el-button
@ -234,67 +236,65 @@
v-permission="['user:editPwd']"
class="text-btn mar16"
type="text"
>{{ $t("member.edit_password") }}</el-button
>
>{{ $t("member.edit_password") }}</el-button>
</el-popover>
<el-button
v-permission="['user:del']"
@click="del(scope.row)"
v-if="scope.row.id !== 1"
v-permission="['user:del']"
class="text-btn"
type="text"
>{{ $t("commons.delete") }}</el-button
>
@click="del(scope.row)"
>{{ $t("commons.delete") }}</el-button>
</template>
</el-table-column>
</grid-table>
</div>
<keep-alive>
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
<filterUser ref="filterUser" @search="filterDraw" />
</keep-alive>
<user-editer @saved="search" ref="userEditer"></user-editer>
<user-editer ref="userEditer" @saved="search" />
</de-layout-content>
</template>
<script>
import userEditer from "./userEditer.vue";
import userEditer from './userEditer.vue'
const columnOptions = [
{
label: "ID",
props: "username",
label: 'ID',
props: 'username'
},
{
label: "commons.nick_name",
props: "nickName",
label: 'commons.nick_name',
props: 'nickName'
},
{
label: "user.source",
props: "from",
label: 'user.source',
props: 'from'
},
{
label: "commons.email",
props: "email",
label: 'commons.email',
props: 'email'
},
{
label: "commons.organization",
props: "dept",
label: 'commons.organization',
props: 'dept'
},
{
label: "commons.role",
props: "roles",
label: 'commons.role',
props: 'roles'
},
{
label: "commons.status",
props: "status",
label: 'commons.status',
props: 'status'
},
{
label: "commons.create_time",
props: "createTime",
},
];
import DeLayoutContent from "@/components/business/DeLayoutContent";
import { addOrder, formatOrders } from "@/utils/index";
import { pluginLoaded, defaultPwd } from "@/api/user";
label: 'commons.create_time',
props: 'createTime'
}
]
import DeLayoutContent from '@/components/business/DeLayoutContent'
import { addOrder, formatOrders } from '@/utils/index'
import { pluginLoaded, defaultPwd } from '@/api/user'
import bus from '@/utils/bus'
/* import { ldapStatus, pluginLoaded } from '@/api/user' */
import {
@ -302,13 +302,13 @@ import {
delUser,
editPassword,
editStatus,
allRoles,
} from "@/api/system/user";
import { mapGetters } from "vuex";
import filterUser from "./filterUser.vue";
import GridTable from "@/components/gridTable/index.vue";
import PluginCom from '@/views/system/plugin/PluginCom';
import _ from 'lodash';
allRoles
} from '@/api/system/user'
import { mapGetters } from 'vuex'
import filterUser from './filterUser.vue'
import GridTable from '@/components/gridTable/index.vue'
import PluginCom from '@/views/system/plugin/PluginCom'
import _ from 'lodash'
export default {
components: { DeLayoutContent, GridTable, filterUser, userEditer, PluginCom },
data() {
@ -320,7 +320,7 @@ export default {
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0,
total: 0
},
data: [],
filterTexts: [],
@ -328,41 +328,41 @@ export default {
form: {
roles: [
{
id: "",
},
],
id: ''
}
]
},
ruleForm: {},
rule: {
newPassword: [
{
required: true,
message: this.$t("user.input_password"),
trigger: "blur",
message: this.$t('user.input_password'),
trigger: 'blur'
},
{
required: true,
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,30}$/,
message: this.$t("member.password_format_is_incorrect"),
trigger: "blur",
},
],
message: this.$t('member.password_format_is_incorrect'),
trigger: 'blur'
}
]
},
cacheCondition: [],
depts: null,
roles: [],
nikeName: "",
nikeName: '',
userRoles: [],
orderConditions: [],
isPluginLoaded: false,
defaultPWD: "DataEase123..",
defaultPWD: 'DataEase123..',
canLoadDom: false,
showScroll: false,
resizeForFilter: null,
};
resizeForFilter: null
}
},
computed: {
...mapGetters(["user"]),
...mapGetters(['user']),
filterColor() {
return this.filterTexts.length ? 'rgba(51, 112, 255, 0.15)' : '#EFF0F1'
}
@ -370,61 +370,61 @@ export default {
watch: {
filterTexts: {
handler() {
this.getScrollStatus();
this.getScrollStatus()
},
deep: true,
},
deep: true
}
},
mounted() {
bus.$on('reload-user-grid', this.search)
this.allRoles();
this.search();
document.addEventListener("keypress", this.entryKey);
this.resizeObserver();
this.allRoles()
this.search()
document.addEventListener('keypress', this.entryKey)
this.resizeObserver()
},
beforeCreate() {
pluginLoaded()
.then((res) => {
this.isPluginLoaded = res.success && res.data;
this.isPluginLoaded = res.success && res.data
if (!this.isPluginLoaded) {
this.checkedColumnNames = this.checkedColumnNames.filter(ele => !['dept', 'roles'].includes(ele))
this.columnNames = this.columnNames.filter(ele => !['dept', 'roles'].includes(ele.props))
}
this.canLoadDom = true;
this.canLoadDom = true
})
.catch((e) => {
this.canLoadDom = true;
});
this.canLoadDom = true
})
defaultPwd().then((res) => {
if (res && res.data) {
this.defaultPWD = res.data;
this.defaultPWD = res.data
}
});
})
},
destroyed() {
document.removeEventListener("keypress", this.entryKey);
document.removeEventListener('keypress', this.entryKey)
bus.$off('reload-user-grid', this.search)
},
methods: {
resizeObserver() {
this.resizeForFilter = new ResizeObserver(entries => {
if (!this.filterTexts.length) return;
this.layoutResize();
});
this.resizeForFilter.observe(document.querySelector('#resize-for-filter'));
if (!this.filterTexts.length) return
this.layoutResize()
})
this.resizeForFilter.observe(document.querySelector('#resize-for-filter'))
},
layoutResize: _.debounce(function () {
layoutResize: _.debounce(function() {
this.getScrollStatus()
}, 200),
scrollPre() {
const dom = document.querySelector('.filter-texts-container');
const dom = document.querySelector('.filter-texts-container')
dom.scrollLeft -= 10
if (dom.scrollLeft <= 0) {
dom.scrollLeft = 0
}
},
scrollNext() {
const dom = document.querySelector('.filter-texts-container');
const dom = document.querySelector('.filter-texts-container')
dom.scrollLeft += 10
const width = dom.scrollWidth - dom.offsetWidth
if (dom.scrollLeft > width) {
@ -432,168 +432,168 @@ export default {
}
},
clearFilter() {
this.$refs.filterUser.clearFilter();
this.$refs.filterUser.clearFilter()
},
clearOneFilter(index) {
this.$refs.filterUser.clearOneFilter(index);
this.$refs.filterUser.search();
this.$refs.filterUser.clearOneFilter(index)
this.$refs.filterUser.search()
},
entryKey(event) {
const keyCode = event.keyCode;
const keyCode = event.keyCode
if (keyCode === 13) {
this.$refs.search.blur();
this.$refs.search.blur()
}
},
filterRoles(row, column, cellValue) {
const roleNames = cellValue.map((ele) => ele.roleName);
return roleNames.length ? roleNames.join() : "-";
const roleNames = cellValue.map((ele) => ele.roleName)
return roleNames.length ? roleNames.join() : '-'
},
initSearch() {
this.handleCurrentChange(1);
this.handleCurrentChange(1)
},
filterShow() {
this.$refs.filterUser.init();
this.$refs.filterUser.init()
},
handleCheckAllChange(val) {
this.checkedColumnNames = val
? columnOptions.map((ele) => ele.props)
: [];
: []
if (!this.isPluginLoaded) {
this.checkedColumnNames = this.checkedColumnNames.filter(ele => !['dept', 'roles'].includes(ele))
}
this.isIndeterminate = false;
this.checkedColumnNames = this.checkedColumnNames.filter(ele => !['dept', 'roles'].includes(ele))
}
this.isIndeterminate = false
},
handleCheckedColumnNamesChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.columnNames.length;
const checkedCount = value.length
this.checkAll = checkedCount === this.columnNames.length
this.isIndeterminate =
checkedCount > 0 && checkedCount < this.columnNames.length;
checkedCount > 0 && checkedCount < this.columnNames.length
},
resetPwd(userId) {
editPassword({ userId, newPassword: this.defaultPWD })
.then((res) => {
this.$success(this.$t("commons.modify_success"));
this.initSearch();
this.$success(this.$t('commons.modify_success'))
this.initSearch()
})
.finally(() => {
this.$refs["initPwd" + userId].doClose();
});
this.$refs['initPwd' + userId].doClose()
})
},
sortChange({ column, prop, order }) {
this.orderConditions = [];
this.orderConditions = []
if (!order) {
this.initSearch();
return;
this.initSearch()
return
}
if (prop === "dept") {
prop = "u.deptId";
if (prop === 'dept') {
prop = 'u.deptId'
}
if (prop === "status") {
prop = "u.enabled";
if (prop === 'status') {
prop = 'u.enabled'
}
this.orderConditions = [];
addOrder({ field: prop, value: order }, this.orderConditions);
this.initSearch();
this.orderConditions = []
addOrder({ field: prop, value: order }, this.orderConditions)
this.initSearch()
},
onCopy(e) {
this.openMessageSuccess("commons.copy_success");
this.openMessageSuccess('commons.copy_success')
},
onError(e) {},
handleSizeChange(pageSize) {
this.paginationConfig.currentPage = 1;
this.paginationConfig.pageSize = pageSize;
this.search();
this.paginationConfig.currentPage = 1
this.paginationConfig.pageSize = pageSize
this.search()
},
handleCurrentChange(currentPage) {
this.paginationConfig.currentPage = currentPage;
this.search();
this.paginationConfig.currentPage = currentPage
this.search()
},
filterDraw(condition, filterTexts = []) {
this.cacheCondition = condition;
this.filterTexts = filterTexts;
this.initSearch();
this.cacheCondition = condition
this.filterTexts = filterTexts
this.initSearch()
},
getScrollStatus() {
this.$nextTick(() => {
const dom = document.querySelector(".filter-texts-container");
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth;
});
const dom = document.querySelector('.filter-texts-container')
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth
})
},
search() {
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
conditions: [...this.cacheCondition]
}
if (this.nikeName) {
param.conditions.push({
field: `concat(nick_name, ',' , email)`,
operator: "like",
value: this.nikeName,
});
operator: 'like',
value: this.nikeName
})
}
const { currentPage, pageSize } = this.paginationConfig;
const { currentPage, pageSize } = this.paginationConfig
userLists(currentPage, pageSize, param).then((response) => {
this.data = response.data.listObject;
this.paginationConfig.total = response.data.itemCount;
});
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
},
create() {
this.$refs.userEditer.init();
this.$refs.userEditer.init()
},
edit(row) {
this.$refs.userEditer.init(row);
this.$refs.userEditer.init(row)
},
del(row) {
this.$confirm(this.$t("user.sure_delete"), "", {
confirmButtonText: this.$t("commons.delete"),
cancelButtonText: this.$t("commons.cancel"),
cancelButtonClass: "de-confirm-fail-btn de-confirm-fail-cancel",
confirmButtonClass: "de-confirm-fail-btn de-confirm-fail-confirm",
customClass: "de-confirm de-confirm-fail",
iconClass: "el-icon-warning",
this.$confirm(this.$t('user.sure_delete'), '', {
confirmButtonText: this.$t('commons.delete'),
cancelButtonText: this.$t('commons.cancel'),
cancelButtonClass: 'de-confirm-fail-btn de-confirm-fail-cancel',
confirmButtonClass: 'de-confirm-fail-btn de-confirm-fail-confirm',
customClass: 'de-confirm de-confirm-fail',
iconClass: 'el-icon-warning'
})
.then(() => {
delUser(encodeURIComponent(row.userId)).then((res) => {
this.openMessageSuccess("commons.delete_success");
this.initSearch();
});
this.openMessageSuccess('commons.delete_success')
this.initSearch()
})
})
.catch(() => {
this.$info(this.$t("commons.delete_cancel"));
});
this.$info(this.$t('commons.delete_cancel'))
})
},
openMessageSuccess(text) {
const h = this.$createElement;
const h = this.$createElement
this.$message({
message: h("p", null, [
h("span", null, this.$t(text)),
message: h('p', null, [
h('span', null, this.$t(text))
]),
iconClass: "el-icon-success",
customClass: "de-message-success de-message",
});
iconClass: 'el-icon-success',
customClass: 'de-message-success de-message'
})
},
handleClose() {
this.depts = null;
this.formType = "add";
this.form = {};
this.editPasswordVisible = false;
this.dialogVisible = false;
this.depts = null
this.formType = 'add'
this.form = {}
this.editPasswordVisible = false
this.dialogVisible = false
},
changeSwitch(row) {
const { userId, enabled } = row;
const param = { userId: userId, enabled: enabled };
const { userId, enabled } = row
const param = { userId: userId, enabled: enabled }
editStatus(param).then((res) => {
this.$success(this.$t("commons.modify_success"));
});
this.$success(this.$t('commons.modify_success'))
})
},
allRoles() {
allRoles().then((res) => {
this.roles = res.data;
});
},
},
};
this.roles = res.data
})
}
}
}
</script>
<style scoped lang="scss">
@ -754,8 +754,6 @@ export default {
background: #F5F6F7 !important;
}
.right-user {
text-align: right;
display: flex;

View File

@ -8,10 +8,8 @@
<span v-html="details.content"></span>
</el-row>
<el-row class="card_bottom">
<a target="_blank" :href="details.href">
{{$t('wizard.click_show') }}
<i class="el-icon-arrow-right" />
</a>
</el-row >
</el-col>
<svg-icon class="img-position" :icon-class="details.img"></svg-icon>

View File

@ -8,10 +8,8 @@
<span v-html="details.content"></span>
</el-row>
<el-row class="card_bottom">
<a target="_blank" :href="details.href">
{{$t('wizard.apply') }}
<i class="el-icon-arrow-right" />
</a>
</el-row >
</el-col>
<svg-icon class="img-position" :icon-class="details.img"></svg-icon>