forked from github/dataease
Merge branch 'dev' into pr@dev_st_fix
This commit is contained in:
commit
20bbef6c50
@ -1,10 +1,11 @@
|
||||
package io.dataease.commons.license;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.plugins.common.base.domain.License;
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import io.dataease.plugins.common.base.domain.License;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -12,6 +13,7 @@ import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class DefaultLicenseService {
|
||||
@ -22,13 +24,21 @@ public class DefaultLicenseService {
|
||||
private static final String validatorUtil = "/usr/bin/validator";
|
||||
private static final String product = "DataEase";
|
||||
|
||||
@Value("${dataease.use_process_lic:false}")
|
||||
private boolean useProcessLic;
|
||||
|
||||
public F2CLicenseResponse validateLicense(String product, String licenseKey) {
|
||||
List<String> command = new ArrayList<String>();
|
||||
StringBuilder result = new StringBuilder();
|
||||
command.add(validatorUtil);
|
||||
command.add(licenseKey);
|
||||
try {
|
||||
execCommand(result, command);
|
||||
if (useProcessLic) {
|
||||
execCommand(result, command);
|
||||
} else {
|
||||
runtimeExecCommand(result, command);
|
||||
}
|
||||
|
||||
LogUtil.info("read lic content is : " + result.toString());
|
||||
F2CLicenseResponse f2CLicenseResponse = new Gson().fromJson(result.toString(), F2CLicenseResponse.class);
|
||||
if (f2CLicenseResponse.getStatus() != F2CLicenseResponse.Status.valid) {
|
||||
@ -47,8 +57,17 @@ public class DefaultLicenseService {
|
||||
}
|
||||
}
|
||||
|
||||
private static void runtimeExecCommand(StringBuilder result, List<String> command) throws Exception {
|
||||
Process proc = Runtime.getRuntime().exec(command.stream().collect(Collectors.joining(" ")));
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream(), "utf-8"));
|
||||
String line = null;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
result.append(line).append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
private static int execCommand(StringBuilder result, List<String> command) throws Exception {
|
||||
|
||||
private static void execCommand(StringBuilder result, List<String> command) throws Exception {
|
||||
ProcessBuilder builder = new ProcessBuilder();
|
||||
builder.command(command);
|
||||
Process process = builder.start();
|
||||
@ -57,9 +76,7 @@ public class DefaultLicenseService {
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
result.append(line).append("\n");
|
||||
}
|
||||
int exitCode = process.waitFor();
|
||||
command.clear();
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
public F2CLicenseResponse validateLicense() {
|
||||
|
@ -154,7 +154,6 @@ public class SysUserController {
|
||||
@ApiOperation("更新当前用户密码")
|
||||
@PostMapping("/updatePwd")
|
||||
public void updatePwd(@RequestBody SysUserPwdRequest request) {
|
||||
|
||||
sysUserService.updatePwd(request);
|
||||
}
|
||||
|
||||
|
@ -18,9 +18,6 @@ public class PanelViewLinkageDTO extends PanelViewLinkage {
|
||||
@ApiModelProperty("目标视图名称")
|
||||
//目标视图名称
|
||||
private String targetViewName;
|
||||
@ApiModelProperty("启用联动")
|
||||
//关联状态
|
||||
private boolean linkageActive = false;
|
||||
@ApiModelProperty("联动字段")
|
||||
private List<PanelViewLinkageField> linkageFields = new ArrayList<>();
|
||||
|
||||
@ -60,17 +57,8 @@ public class PanelViewLinkageDTO extends PanelViewLinkage {
|
||||
}
|
||||
|
||||
public PanelViewLinkageDTO(boolean linkageActive) {
|
||||
this.linkageActive = linkageActive;
|
||||
super.setLinkageActive(linkageActive);
|
||||
}
|
||||
|
||||
public boolean isLinkageActive() {
|
||||
return linkageActive;
|
||||
}
|
||||
|
||||
public void setLinkageActive(boolean linkageActive) {
|
||||
this.linkageActive = linkageActive;
|
||||
}
|
||||
|
||||
public List<PanelViewLinkageField> getLinkageFields() {
|
||||
return linkageFields;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
<result column="target_view_id" jdbcType="VARCHAR" property="targetViewId"/>
|
||||
<result column="table_id" jdbcType="VARCHAR" property="tableId"/>
|
||||
<result column="targetViewName" jdbcType="VARCHAR" property="targetViewName"/>
|
||||
<result column="sourceViewId" jdbcType="VARCHAR" property="sourceViewId"/>
|
||||
<result column="linkageActive" property="linkageActive"/>
|
||||
<collection property="targetViewFields" ofType="io.dataease.plugins.common.base.domain.DatasetTableField" column="table_id"
|
||||
select="queryTableField">
|
||||
@ -37,7 +38,8 @@
|
||||
chart_view.`name` as 'targetViewName',
|
||||
chart_view.id as 'target_view_id',
|
||||
chart_view.table_id,
|
||||
(case when panel_view_linkage.target_view_id is null then 0 else 1 end) as 'linkageActive',
|
||||
panel_view_linkage.source_view_id as 'sourceViewId',
|
||||
(case when panel_view_linkage.target_view_id is null then 0 else panel_view_linkage.linkage_active end) as 'linkageActive',
|
||||
panel_view_linkage_field.source_field,
|
||||
panel_view_linkage_field.target_field
|
||||
FROM
|
||||
@ -109,6 +111,8 @@
|
||||
LEFT JOIN panel_view_linkage_field ON panel_view_linkage.id = panel_view_linkage_field.linkage_id
|
||||
WHERE
|
||||
panel_view_linkage.panel_id = #{panelId}
|
||||
and panel_view_linkage.linkage_active=1
|
||||
and panel_view_linkage_field.id is not null
|
||||
</select>
|
||||
|
||||
<insert id="copyViewLinkage">
|
||||
@ -119,6 +123,7 @@
|
||||
target_view_id,
|
||||
update_time,
|
||||
update_people,
|
||||
linkage_active,
|
||||
ext1,
|
||||
ext2,
|
||||
copy_from,
|
||||
@ -130,6 +135,7 @@
|
||||
pv_target_copy.t_chart_view_id target_view_id,
|
||||
update_time,
|
||||
update_people,
|
||||
linkage_active,
|
||||
ext1,
|
||||
ext2,
|
||||
id as copy_from,
|
||||
|
@ -35,7 +35,10 @@ import io.dataease.service.system.EmailService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.*;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.util.HtmlUtils;
|
||||
@ -173,10 +176,6 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
String url = panelUrl(panelId);
|
||||
token = tokenByUser(user);
|
||||
XpackPixelEntity xpackPixelEntity = buildPixel(emailTemplateDTO);
|
||||
LogUtil.info("url is " + url);
|
||||
LogUtil.info("token is " + token);
|
||||
byte[] bytes = emailXpackService.printData(url, token, xpackPixelEntity);
|
||||
LogUtil.info("picture of " + url + " is finished");
|
||||
// 下面继续执行发送邮件的
|
||||
String recipients = emailTemplateDTO.getRecipients();
|
||||
String reciUsers = emailTemplateDTO.getReciUsers();
|
||||
@ -232,7 +231,15 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
case "email":
|
||||
if (StringUtils.isNotBlank(recipients))
|
||||
try {
|
||||
emailService.sendWithImageAndFiles(recipients, emailTemplateDTO.getTitle(), contentStr, bytes, files);
|
||||
Integer panelFormat = emailTemplateDTO.getPanelFormat();
|
||||
if (ObjectUtils.isEmpty(panelFormat) || panelFormat == 0) {
|
||||
byte[] bytes = emailXpackService.printData(url, token, xpackPixelEntity);
|
||||
emailService.sendWithImageAndFiles(recipients, emailTemplateDTO.getTitle(), contentStr, bytes, files);
|
||||
} else {
|
||||
byte[] bytes = emailXpackService.printPdf(url, token, xpackPixelEntity, false, true);
|
||||
emailService.sendPdfWithFiles(recipients, emailTemplateDTO.getTitle(), contentStr, bytes, files);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
errorMsgs.add("email: " + e.getMessage());
|
||||
}
|
||||
@ -253,6 +260,7 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
|
||||
if (CollectionUtils.isNotEmpty(wecomUsers)) {
|
||||
WecomXpackService wecomXpackService = SpringContextUtil.getBean(WecomXpackService.class);
|
||||
byte[] bytes = emailXpackService.printData(url, token, xpackPixelEntity);
|
||||
WecomMsgResult wecomMsgResult = wecomXpackService.pushOaMsg(wecomUsers, emailTemplateDTO.getTitle(), contentStr, bytes, files);
|
||||
if (wecomMsgResult.getErrcode() != 0) {
|
||||
errorMsgs.add("wecom: " + wecomMsgResult.getErrmsg());
|
||||
@ -277,6 +285,7 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
|
||||
if (CollectionUtils.isNotEmpty(dingTalkUsers)) {
|
||||
DingtalkXpackService dingtalkXpackService = SpringContextUtil.getBean(DingtalkXpackService.class);
|
||||
byte[] bytes = emailXpackService.printData(url, token, xpackPixelEntity);
|
||||
DingtalkMsgResult dingtalkMsgResult = dingtalkXpackService.pushOaMsg(dingTalkUsers, emailTemplateDTO.getTitle(), contentStr, bytes, files);
|
||||
if (dingtalkMsgResult.getErrcode() != 0) {
|
||||
errorMsgs.add("dingtalk: " + dingtalkMsgResult.getErrmsg());
|
||||
@ -301,6 +310,7 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
|
||||
if (CollectionUtils.isNotEmpty(larkUsers)) {
|
||||
LarkXpackService larkXpackService = SpringContextUtil.getBean(LarkXpackService.class);
|
||||
byte[] bytes = emailXpackService.printData(url, token, xpackPixelEntity);
|
||||
LarkMsgResult larkMsgResult = larkXpackService.pushOaMsg(larkUsers, emailTemplateDTO.getTitle(), contentStr, bytes, files);
|
||||
if (larkMsgResult.getCode() != 0) {
|
||||
errorMsgs.add("lark: " + larkMsgResult.getMsg());
|
||||
@ -325,6 +335,7 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
|
||||
if (CollectionUtils.isNotEmpty(larksuiteUsers)) {
|
||||
LarksuiteXpackService larksuiteXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class);
|
||||
byte[] bytes = emailXpackService.printData(url, token, xpackPixelEntity);
|
||||
LarksuiteMsgResult larksuiteMsgResult = larksuiteXpackService.pushOaMsg(larksuiteUsers, emailTemplateDTO.getTitle(), contentStr, bytes, files);
|
||||
if (larksuiteMsgResult.getCode() != 0) {
|
||||
errorMsgs.add("larksuite: " + larksuiteMsgResult.getMsg());
|
||||
|
@ -174,7 +174,7 @@ public class XEmailTaskServer {
|
||||
String currentToken = ServletUtils.getToken();
|
||||
Future<?> future = priorityExecutor.submit(() -> {
|
||||
try {
|
||||
return emailXpackService.printPdf(url, currentToken, buildPixel(request.getPixel()), request.isShowPageNo());
|
||||
return emailXpackService.printPdf(url, currentToken, buildPixel(request.getPixel()), request.isShowPageNo(), false);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
DEException.throwException("预览失败,请联系管理员");
|
||||
|
@ -112,9 +112,9 @@ public class ExtractDataService {
|
||||
private Long extractPageSize;
|
||||
|
||||
|
||||
private static final String shellScript = "result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n" +
|
||||
private static final String shellScript = "result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"Expect:100-continue\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n" +
|
||||
"if [ $? -eq 0 ] ; then\n" +
|
||||
" failstatus=$(echo $result | grep '\"Status\": \"Fail\"')\n" +
|
||||
" failstatus=$(echo $result | grep '\"status\":\"FAILED\"')\n" +
|
||||
" if [ \"x${failstatus}\" != \"x\" ];then" +
|
||||
" echo $result\n" +
|
||||
" exit 1\n" +
|
||||
@ -124,10 +124,10 @@ public class ExtractDataService {
|
||||
" exit 1\n" +
|
||||
"fi\n";
|
||||
|
||||
private static final String shellScriptForDeleteFile = "result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n" +
|
||||
private static final String shellScriptForDeleteFile = "result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"Expect:100-continue\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n" +
|
||||
"rm -rf %s \n" +
|
||||
"if [ $? -eq 0 ] ; then\n" +
|
||||
" failstatus=$(echo $result | grep '\"Status\": \"Fail\"')\n" +
|
||||
" failstatus=$(echo $result | grep '\"status\":\"FAILED\"')\n" +
|
||||
" if [ \"x${failstatus}\" != \"x\" ];then" +
|
||||
" echo $result\n" +
|
||||
" exit 1\n" +
|
||||
|
@ -72,18 +72,17 @@ public class PanelViewLinkageService {
|
||||
String targetViewId = entry.getKey();
|
||||
PanelViewLinkageDTO linkageDTO = entry.getValue();
|
||||
List<PanelViewLinkageField> linkageFields = linkageDTO.getLinkageFields();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(linkageFields) && linkageDTO.isLinkageActive()) {
|
||||
String linkageId = UUID.randomUUID().toString();
|
||||
PanelViewLinkage linkage = new PanelViewLinkage();
|
||||
linkage.setId(linkageId);
|
||||
linkage.setPanelId(panelId);
|
||||
linkage.setSourceViewId(sourceViewId);
|
||||
linkage.setTargetViewId(targetViewId);
|
||||
linkage.setUpdatePeople(AuthUtils.getUser().getUsername());
|
||||
linkage.setUpdateTime(updateTime);
|
||||
panelViewLinkageMapper.insert(linkage);
|
||||
|
||||
String linkageId = UUID.randomUUID().toString();
|
||||
PanelViewLinkage linkage = new PanelViewLinkage();
|
||||
linkage.setId(linkageId);
|
||||
linkage.setPanelId(panelId);
|
||||
linkage.setSourceViewId(sourceViewId);
|
||||
linkage.setTargetViewId(targetViewId);
|
||||
linkage.setUpdatePeople(AuthUtils.getUser().getUsername());
|
||||
linkage.setUpdateTime(updateTime);
|
||||
linkage.setLinkageActive(linkageDTO.getLinkageActive());
|
||||
panelViewLinkageMapper.insert(linkage);
|
||||
if (CollectionUtils.isNotEmpty(linkageFields) && linkageDTO.getLinkageActive()) {
|
||||
linkageFields.forEach(linkageField -> {
|
||||
linkageField.setId(UUID.randomUUID().toString());
|
||||
linkageField.setLinkageId(linkageId);
|
||||
|
@ -383,6 +383,8 @@ public class SysUserService {
|
||||
*/
|
||||
@CacheEvict(value = AuthConstants.USER_CACHE_NAME, key = "'user' + #request.userId")
|
||||
public int updatePwd(SysUserPwdRequest request) {
|
||||
request.setPassword(new String(java.util.Base64.getDecoder().decode(request.getPassword())));
|
||||
request.setNewPassword(new String(java.util.Base64.getDecoder().decode(request.getNewPassword())));
|
||||
CurrentUserDto user = AuthUtils.getUser();
|
||||
|
||||
if (ObjectUtils.isEmpty(user)) {
|
||||
@ -407,7 +409,7 @@ public class SysUserService {
|
||||
public int adminUpdatePwd(SysUserPwdRequest request) {
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserId(request.getUserId());
|
||||
sysUser.setPassword(CodingUtil.md5(request.getNewPassword()));
|
||||
sysUser.setPassword(CodingUtil.md5(new String(java.util.Base64.getDecoder().decode(request.getNewPassword()))));
|
||||
return sysUserMapper.updateByPrimaryKeySelective(sysUser);
|
||||
}
|
||||
|
||||
|
@ -83,8 +83,35 @@ public class EmailService {
|
||||
}
|
||||
|
||||
|
||||
public void sendPdfWithFiles(String to, String title, String content, byte[] bytes, List<File> files) {
|
||||
if (ArrayUtil.isEmpty(bytes)) {
|
||||
send(to, title, content);
|
||||
return;
|
||||
}
|
||||
if (StringUtils.isBlank(to))
|
||||
return;
|
||||
MailInfo mailInfo = proxy().mailInfo();
|
||||
checkMailInfo(mailInfo);
|
||||
JavaMailSenderImpl driver = driver(mailInfo);
|
||||
|
||||
|
||||
MimeMultipart multipart = new MimeMultipart();
|
||||
MimeMessage mimeMessage = driver.createMimeMessage();
|
||||
try {
|
||||
multipart = addContent(multipart, content);
|
||||
multipart = addPdf(multipart, bytes);
|
||||
if (CollectionUtils.isNotEmpty(files)) {
|
||||
multipart = addFiles(multipart, files);
|
||||
}
|
||||
mimeMessage.setSubject(title);
|
||||
mimeMessage.setFrom(driver.getUsername());
|
||||
mimeMessage.setRecipients(Message.RecipientType.TO, to);
|
||||
mimeMessage.setContent(multipart);
|
||||
driver.send(mimeMessage);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
DEException.throwException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendWithImageAndFiles(String to, String title, String content, byte[] bytes, List<File> files) {
|
||||
if (StringUtils.isBlank(to))
|
||||
@ -116,7 +143,14 @@ public class EmailService {
|
||||
}
|
||||
}
|
||||
|
||||
private MimeMultipart addImage(MimeMultipart multipart, byte[] bytes, String content) throws Exception{
|
||||
private MimeMultipart addContent(MimeMultipart multipart, String content) throws Exception {
|
||||
MimeBodyPart text = new MimeBodyPart();
|
||||
text.setContent(content, "text/html; charset=gb2312");
|
||||
multipart.addBodyPart(text);
|
||||
return multipart;
|
||||
}
|
||||
|
||||
private MimeMultipart addImage(MimeMultipart multipart, byte[] bytes, String content) throws Exception {
|
||||
MimeBodyPart image = new MimeBodyPart();
|
||||
DataHandler png = new DataHandler(new ByteArrayDataSource(bytes, "image/png"));
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
@ -131,7 +165,17 @@ public class EmailService {
|
||||
return multipart;
|
||||
}
|
||||
|
||||
private MimeMultipart addFiles(MimeMultipart multipart, List<File> files) throws Exception{
|
||||
private MimeMultipart addPdf(MimeMultipart multipart, byte[] bytes) throws Exception {
|
||||
MimeBodyPart attach = new MimeBodyPart();
|
||||
ByteArrayDataSource fileDataSource = new ByteArrayDataSource(bytes, "application/pdf");
|
||||
attach.setDataHandler(new DataHandler(fileDataSource));
|
||||
attach.setFileName(MimeUtility.encodeText("panel.pdf", "gb2312", null));
|
||||
multipart.addBodyPart(attach);
|
||||
multipart.setSubType("related");
|
||||
return multipart;
|
||||
}
|
||||
|
||||
private MimeMultipart addFiles(MimeMultipart multipart, List<File> files) throws Exception {
|
||||
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
File file = files.get(i);
|
||||
|
@ -2,3 +2,42 @@ UPDATE `my_plugin`
|
||||
SET `version` = '1.18.8'
|
||||
where `plugin_id` > 0
|
||||
and `version` = '1.18.7';
|
||||
|
||||
ALTER TABLE `sys_task_email`
|
||||
ADD COLUMN `panel_format` INT(1) NOT NULL DEFAULT 0 COMMENT '仪表板格式0:jpeg,1:pdf' AFTER `panel_id`;
|
||||
|
||||
|
||||
DROP FUNCTION IF EXISTS `GET_CHART_VIEW_COPY_NAME`;
|
||||
delimiter ;;
|
||||
CREATE FUNCTION `GET_CHART_VIEW_COPY_NAME`(chartId varchar(255),pid varchar(255))
|
||||
RETURNS varchar(255) CHARSET utf8mb4
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
|
||||
DECLARE chartName varchar(255);
|
||||
|
||||
DECLARE regexpInfo varchar(255);
|
||||
|
||||
DECLARE chartNameCount INTEGER;
|
||||
|
||||
select (case when `type`='richTextView' then 'RICH_TEXT_VIEW' else `name` end) into chartName from chart_view where id =chartId;
|
||||
/**
|
||||
因为名称存在()等特殊字符,所以不能直接用REGEXP进行查找
|
||||
1.用like 'chartName%' 过滤可能的数据项
|
||||
2.REPLACE(name,chartName,'') REGEXP '-([0-9])+$' 过滤去掉chartName后的字符以 -/d 结尾的数据
|
||||
3.(LENGTH(REPLACE(name,chartName,''))-LENGTH(replace(REPLACE(name,chartName,''),'-',''))=1) 确定只出现一次 ‘-’ 防止多次copy
|
||||
**/
|
||||
select (count(1)+1) into chartNameCount from chart_view
|
||||
where (LENGTH(REPLACE(name,chartName,''))-LENGTH(replace(REPLACE(name,chartName,''),'-',''))=1)
|
||||
and REPLACE(name,chartName,'') REGEXP '-([0-9])+$' and name like CONCAT(chartName,'%') and chart_view.scene_id=pid ;
|
||||
|
||||
RETURN concat(chartName,'-',chartNameCount);
|
||||
|
||||
END
|
||||
;;
|
||||
delimiter ;
|
||||
|
||||
ALTER TABLE `panel_view_linkage`
|
||||
ADD COLUMN `linkage_active` tinyint(1) NULL DEFAULT 0 COMMENT '是否启用关联' AFTER `update_people`;
|
||||
|
||||
update panel_view_linkage set linkage_active=1;
|
@ -192,12 +192,13 @@ export function initPanelData(panelId, useCache = false, callback) {
|
||||
watermarkOpen: response.data.watermarkOpen,
|
||||
watermarkInfo: watermarkInfo
|
||||
})
|
||||
const targetPanelId = response.data.panelType==='system'?response.data.source:panelId
|
||||
// 刷新联动信息
|
||||
getPanelAllLinkageInfo(panelId).then(rsp => {
|
||||
getPanelAllLinkageInfo(targetPanelId).then(rsp => {
|
||||
store.commit('setNowPanelTrackInfo', rsp.data)
|
||||
})
|
||||
// 刷新跳转信息
|
||||
queryPanelJumpInfo(panelId).then(rsp => {
|
||||
queryPanelJumpInfo(targetPanelId).then(rsp => {
|
||||
store.commit('setNowPanelJumpInfo', rsp.data)
|
||||
})
|
||||
} else {
|
||||
|
@ -223,6 +223,7 @@ export default {
|
||||
'curComponent',
|
||||
'componentGap',
|
||||
'isClickComponent',
|
||||
'linkageSettingStatus',
|
||||
'pcMatrixCount',
|
||||
'pcTabMatrixCount',
|
||||
'dragComponentInfo',
|
||||
@ -282,7 +283,7 @@ export default {
|
||||
},
|
||||
|
||||
deselectCurComponent(e) {
|
||||
if (!this.isClickComponent) {
|
||||
if (!this.isClickComponent && !this.linkageSettingStatus) {
|
||||
this.$store.commit('setCurComponent', { component: null, index: null })
|
||||
}
|
||||
|
||||
|
@ -371,6 +371,20 @@ export default {
|
||||
'panelViewDetailsInfo'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
linkageAreaShow: {
|
||||
handler(val) {
|
||||
// 1.当前正在进行联动设置(val) 2.当前视图联动未启用!this.linkageInfo.linkageActive
|
||||
// 3.当前视图没有设置过当前目标联动!this.linkageInfo.sourceViewId
|
||||
// 4.数据集相同 this.linkageInfo.tableId === this.targetLinkageInfo[this.curLinkageView.propValue.viewId].tableId)
|
||||
// 满足以上条件自动勾选
|
||||
if (val && !this.linkageInfo.linkageActive && !this.linkageInfo.sourceViewId && this.linkageInfo.tableId === this.targetLinkageInfo[this.curLinkageView.propValue.viewId].tableId) {
|
||||
this.linkageInfo.linkageActive = true
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (navigator.platform.indexOf('Mac') === -1) {
|
||||
this.systemOS = 'Other'
|
||||
|
@ -192,7 +192,6 @@ export default {
|
||||
'gauge',
|
||||
'text',
|
||||
'label',
|
||||
'word-cloud',
|
||||
'flow-map',
|
||||
'bidirectional-bar'
|
||||
],
|
||||
@ -202,7 +201,6 @@ export default {
|
||||
'gauge',
|
||||
'text',
|
||||
'label',
|
||||
'word-cloud',
|
||||
'flow-map',
|
||||
'bidirectional-bar'
|
||||
],
|
||||
|
@ -2711,6 +2711,7 @@ export default {
|
||||
preview: 'Preview',
|
||||
emial_preview: 'Report preview',
|
||||
chart_data_range: 'View data range',
|
||||
panel_format: 'Panel format',
|
||||
simple_repeat: 'Simple repeat',
|
||||
once_a_day: 'Once a day',
|
||||
once_a_week: 'Once a week',
|
||||
|
@ -2705,6 +2705,7 @@ export default {
|
||||
preview: '預覽',
|
||||
emial_preview: '報告預覽',
|
||||
chart_data_range: '視圖數據範圍',
|
||||
panel_format: '儀表板格式',
|
||||
simple_repeat: '簡單重複',
|
||||
once_a_day: '每天',
|
||||
once_a_week: '每周',
|
||||
|
@ -2720,6 +2720,7 @@ export default {
|
||||
preview: '预览',
|
||||
emial_preview: '报告预览',
|
||||
chart_data_range: '视图数据范围',
|
||||
panel_format: '仪表板格式',
|
||||
simple_repeat: '简单重复',
|
||||
once_a_day: '每天',
|
||||
once_a_week: '每周',
|
||||
|
@ -38,6 +38,7 @@ export function baseWordCloudOptionAntV(plot, container, chart, action) {
|
||||
plot.destroy()
|
||||
}
|
||||
plot = new WordCloud(container, options)
|
||||
|
||||
plot.off('point:click')
|
||||
plot.on('point:click', action)
|
||||
return plot
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.myChart && !equalsAny(chart.type ,'liquid','flow-map') && this.searchCount > 0) {
|
||||
if (this.myChart && !equalsAny(chart.type, 'liquid', 'flow-map') && this.searchCount > 0) {
|
||||
this.myChart.options.animation = false
|
||||
}
|
||||
if (this.myChart?.options?.legend) {
|
||||
@ -319,10 +319,18 @@ export default {
|
||||
},
|
||||
|
||||
antVAction(param) {
|
||||
if (this.chart.type === 'treemap') {
|
||||
this.pointParam = param.data.data
|
||||
} else {
|
||||
this.pointParam = param.data
|
||||
switch (this.chart.type) {
|
||||
case 'treemap':
|
||||
this.pointParam = param.data.data
|
||||
break
|
||||
case 'word-cloud':
|
||||
this.pointParam = {
|
||||
data: param.data.data.datum
|
||||
}
|
||||
break
|
||||
default:
|
||||
this.pointParam = param.data
|
||||
break
|
||||
}
|
||||
this.linkageActiveParam = {
|
||||
category: this.pointParam.data.category ? this.pointParam.data.category : 'NO_DATA',
|
||||
|
@ -27,6 +27,7 @@
|
||||
<script>
|
||||
import { updatePersonPwd } from '@/api/system/user'
|
||||
import dePwd from '@/components/deCustomCm/DePwd.vue'
|
||||
import { Base64 } from 'js-base64'
|
||||
export default {
|
||||
name: 'PasswordUpdateForm',
|
||||
components: { dePwd },
|
||||
@ -89,8 +90,8 @@ export default {
|
||||
this.$refs.createUserForm.validate((valid) => {
|
||||
if (valid) {
|
||||
const param = {
|
||||
password: this.form.oldPwd,
|
||||
newPassword: this.form.newPwd
|
||||
password: Base64.encode(this.form.oldPwd),
|
||||
newPassword: Base64.encode(this.form.newPwd)
|
||||
}
|
||||
updatePersonPwd(param).then((res) => {
|
||||
this.$success(this.$t('commons.save_success'))
|
||||
@ -108,4 +109,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
@ -334,6 +334,7 @@ import DeLayoutContent from '@/components/business/DeLayoutContent'
|
||||
import { addOrder, formatOrders } from '@/utils/index'
|
||||
import { pluginLoaded, defaultPwd } from '@/api/user'
|
||||
import bus from '@/utils/bus'
|
||||
import { Base64 } from 'js-base64'
|
||||
/* import { ldapStatus, pluginLoaded } from '@/api/user' */
|
||||
import {
|
||||
userLists,
|
||||
@ -510,7 +511,7 @@ export default {
|
||||
checkedCount > 0 && checkedCount < this.columnNames.length
|
||||
},
|
||||
resetPwd(userId) {
|
||||
editPassword({ userId, newPassword: this.defaultPWD })
|
||||
editPassword({ userId, newPassword: Base64.encode(this.defaultPWD) })
|
||||
.then((res) => {
|
||||
this.$success(this.$t('commons.modify_success'))
|
||||
this.initSearch()
|
||||
|
Loading…
Reference in New Issue
Block a user