forked from github/dataease
Merge branch 'dev' into pr@dev_eslint_auto_fix
This commit is contained in:
commit
59eef06a6f
@ -75,6 +75,10 @@ public interface AuthApi {
|
||||
@PostMapping("/isOpenLark")
|
||||
boolean isOpenLark();
|
||||
|
||||
@ApiOperation("是否开启国际飞书")
|
||||
@PostMapping("/isOpenLarksuite")
|
||||
boolean isOpenLarksuite();
|
||||
|
||||
@ApiIgnore
|
||||
@PostMapping("/isPluginLoaded")
|
||||
boolean isPluginLoaded();
|
||||
|
@ -337,6 +337,14 @@ public class AuthServer implements AuthApi {
|
||||
return authUserService.supportLark();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpenLarksuite() {
|
||||
Boolean licValid = PluginUtils.licValid();
|
||||
if (!licValid)
|
||||
return false;
|
||||
return authUserService.supportLarksuite();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPluginLoaded() {
|
||||
Boolean licValid = PluginUtils.licValid();
|
||||
|
@ -23,6 +23,8 @@ public interface AuthUserService {
|
||||
SysUserEntity getUserByDingtalkId(String dingtalkId);
|
||||
SysUserEntity getUserByLarkId(String larkId);
|
||||
|
||||
SysUserEntity getUserByLarksuiteId(String larksuiteId);
|
||||
|
||||
List<String> roles(Long userId);
|
||||
|
||||
List<String> permissions(Long userId);
|
||||
@ -43,6 +45,8 @@ public interface AuthUserService {
|
||||
|
||||
Boolean supportLark();
|
||||
|
||||
Boolean supportLarksuite();
|
||||
|
||||
Boolean supportLoginLimit();
|
||||
|
||||
Boolean pluginLoaded();
|
||||
|
@ -21,6 +21,7 @@ import io.dataease.plugins.util.PluginUtils;
|
||||
import io.dataease.plugins.xpack.cas.service.CasXpackService;
|
||||
import io.dataease.plugins.xpack.dingtalk.service.DingtalkXpackService;
|
||||
import io.dataease.plugins.xpack.lark.service.LarkXpackService;
|
||||
import io.dataease.plugins.xpack.larksuite.service.LarksuiteXpackService;
|
||||
import io.dataease.plugins.xpack.ldap.service.LdapXpackService;
|
||||
import io.dataease.plugins.xpack.loginlimit.dto.response.LoginLimitInfo;
|
||||
import io.dataease.plugins.xpack.loginlimit.service.LoginLimitXpackService;
|
||||
@ -108,6 +109,11 @@ public class AuthUserServiceImpl implements AuthUserService {
|
||||
return authMapper.findLarkUser(larkId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysUserEntity getUserByLarksuiteId(String larksuiteId) {
|
||||
return authMapper.findLarksuiteUser(larksuiteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> roles(Long userId) {
|
||||
return authMapper.roleCodes(userId);
|
||||
@ -221,6 +227,15 @@ public class AuthUserServiceImpl implements AuthUserService {
|
||||
return larkXpackService.isOpen();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean supportLarksuite() {
|
||||
Map<String, LarksuiteXpackService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((LarksuiteXpackService.class));
|
||||
if (beansOfType.keySet().size() == 0) return false;
|
||||
LarksuiteXpackService larkXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class);
|
||||
if (ObjectUtils.isEmpty(larkXpackService)) return false;
|
||||
return larkXpackService.isOpen();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean supportLoginLimit() {
|
||||
Map<String, LoginLimitXpackService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((LoginLimitXpackService.class));
|
||||
|
@ -86,6 +86,7 @@ public class ShiroServiceImpl implements ShiroService {
|
||||
filterChainDefinitionMap.put("/api/auth/isOpenWecom", ANON);
|
||||
filterChainDefinitionMap.put("/api/auth/isOpenDingtalk", ANON);
|
||||
filterChainDefinitionMap.put("/api/auth/isOpenLark", ANON);
|
||||
filterChainDefinitionMap.put("/api/auth/isOpenLarksuite", ANON);
|
||||
filterChainDefinitionMap.put("/api/auth/getPublicKey", ANON);
|
||||
filterChainDefinitionMap.put("/api/pluginCommon/component/*", ANON);
|
||||
filterChainDefinitionMap.put("/api/pluginCommon/staticInfo/**", ANON);
|
||||
@ -101,6 +102,9 @@ public class ShiroServiceImpl implements ShiroService {
|
||||
filterChainDefinitionMap.put("/plugin/lark/callBack*", ANON);
|
||||
filterChainDefinitionMap.put("/plugin/lark/bind*", ANON);
|
||||
filterChainDefinitionMap.put("/plugin/lark/getQrParam", ANON);
|
||||
filterChainDefinitionMap.put("/plugin/larksuite/callBack*", ANON);
|
||||
filterChainDefinitionMap.put("/plugin/larksuite/bind*", ANON);
|
||||
filterChainDefinitionMap.put("/plugin/larksuite/getQrParam", ANON);
|
||||
filterChainDefinitionMap.put("/cas/reset/**", ANON);
|
||||
|
||||
filterChainDefinitionMap.put("/unauth", ANON);
|
||||
|
@ -56,6 +56,8 @@ public class SysUserController {
|
||||
private static final String DINGTALK = "dingtalk";
|
||||
private static final String LARK = "lark";
|
||||
|
||||
private static final String LARKSUITE = "larksuite";
|
||||
|
||||
@Resource
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@ -246,13 +248,16 @@ public class SysUserController {
|
||||
AuthBindDTO dto = new AuthBindDTO();
|
||||
if (ObjectUtils.isEmpty(sysUserAssist)) return dto;
|
||||
if (authUserService.supportWecom() && StringUtils.isNotBlank(sysUserAssist.getWecomId())) {
|
||||
dto.setWecomBinded(true);
|
||||
dto.setWecomBound(true);
|
||||
}
|
||||
if (authUserService.supportDingtalk() && StringUtils.isNotBlank(sysUserAssist.getDingtalkId())) {
|
||||
dto.setDingtalkBinded(true);
|
||||
dto.setDingtalkBound(true);
|
||||
}
|
||||
if (authUserService.supportLark() && StringUtils.isNotBlank(sysUserAssist.getLarkId())) {
|
||||
dto.setLarkBinded(true);
|
||||
dto.setLarkBound(true);
|
||||
}
|
||||
if (authUserService.supportLarksuite() && StringUtils.isNotBlank(sysUserAssist.getLarksuiteId())) {
|
||||
dto.setLarksuiteBound(true);
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
@ -260,9 +265,9 @@ public class SysUserController {
|
||||
@PostMapping("/unbindAssist/{type}")
|
||||
public void unbindAssist(@PathVariable("type") String type) {
|
||||
|
||||
Boolean valid = StringUtils.equals(WECOM, type) || StringUtils.equals(DINGTALK, type) || StringUtils.equals(LARK, type);
|
||||
Boolean valid = StringUtils.equals(WECOM, type) || StringUtils.equals(DINGTALK, type) || StringUtils.equals(LARK, type) || StringUtils.equals(LARKSUITE, type);
|
||||
if (!valid) {
|
||||
DEException.throwException("only [wecom, dingtalk, lark] is valid");
|
||||
DEException.throwException("only [wecom, dingtalk, lark, larksuite] is valid");
|
||||
}
|
||||
Long userId = AuthUtils.getUser().getUserId();
|
||||
SysUserAssist sysUserAssist = sysUserService.assistInfo(userId);
|
||||
@ -275,10 +280,13 @@ public class SysUserController {
|
||||
if (StringUtils.equals(LARK, type)) {
|
||||
sysUserAssist.setLarkId(null);
|
||||
}
|
||||
if (StringUtils.isBlank(sysUserAssist.getWecomId()) && StringUtils.isBlank(sysUserAssist.getDingtalkId()) && StringUtils.isBlank(sysUserAssist.getLarkId())) {
|
||||
if (StringUtils.equals(LARKSUITE, type)) {
|
||||
sysUserAssist.setLarksuiteId(null);
|
||||
}
|
||||
if (StringUtils.isBlank(sysUserAssist.getWecomId()) && StringUtils.isBlank(sysUserAssist.getDingtalkId()) && StringUtils.isBlank(sysUserAssist.getLarkId()) && StringUtils.isBlank(sysUserAssist.getLarksuiteId())) {
|
||||
sysUserService.changeUserFrom(userId, 0);
|
||||
}
|
||||
sysUserService.saveAssist(userId, sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId());
|
||||
sysUserService.saveAssist(userId, sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId());
|
||||
|
||||
}
|
||||
|
||||
|
@ -7,9 +7,11 @@ import java.io.Serializable;
|
||||
@Data
|
||||
public class AuthBindDTO implements Serializable {
|
||||
|
||||
private Boolean wecomBinded = false;
|
||||
private Boolean wecomBound = false;
|
||||
|
||||
private Boolean dingtalkBinded = false;
|
||||
private Boolean dingtalkBound = false;
|
||||
|
||||
private Boolean larkBinded = false;
|
||||
private Boolean larkBound = false;
|
||||
|
||||
private Boolean larksuiteBound = false;
|
||||
}
|
||||
|
@ -37,5 +37,6 @@ public interface AuthMapper {
|
||||
SysUserEntity findWecomUser(@Param("wecomId") String wecomId);
|
||||
SysUserEntity findDingtalkUser(@Param("dingtalkId") String dingtalkId);
|
||||
SysUserEntity findLarkUser(@Param("larkId") String larkId);
|
||||
SysUserEntity findLarksuiteUser(@Param("larksuiteId") String larksuiteId);
|
||||
|
||||
}
|
||||
|
@ -23,8 +23,7 @@
|
||||
|
||||
|
||||
<select id="findUser" resultMap="baseMap">
|
||||
select
|
||||
sys_user.user_id,
|
||||
select sys_user.user_id,
|
||||
sys_user.username,
|
||||
sys_user.nick_name,
|
||||
sys_user.dept_id,
|
||||
@ -37,104 +36,172 @@
|
||||
sys_user.`from`,
|
||||
sys_dept.name as dept_name
|
||||
from sys_user
|
||||
left join sys_dept on sys_user.dept_id=sys_dept.dept_id
|
||||
left join sys_dept on sys_user.dept_id = sys_dept.dept_id
|
||||
where user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="findUserByName" resultMap="baseMap">
|
||||
select user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from` from sys_user where username = #{username}
|
||||
select user_id,
|
||||
username,
|
||||
nick_name,
|
||||
dept_id,
|
||||
password,
|
||||
enabled,
|
||||
email,
|
||||
phone, language, is_admin, `from`
|
||||
from sys_user
|
||||
where username = #{username}
|
||||
</select>
|
||||
|
||||
<select id="findLdapUserByName" resultMap="baseMap">
|
||||
select user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from` from sys_user a where username = #{username} and a.from = 1
|
||||
select user_id,
|
||||
username,
|
||||
nick_name,
|
||||
dept_id,
|
||||
password,
|
||||
enabled,
|
||||
email,
|
||||
phone, language, is_admin, `from`
|
||||
from sys_user a
|
||||
where username = #{username} and a.from = 1
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findCasUserByName" resultMap="baseMap">
|
||||
select user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from` from sys_user a where username = #{username} and a.from = 3
|
||||
select user_id,
|
||||
username,
|
||||
nick_name,
|
||||
dept_id,
|
||||
password,
|
||||
enabled,
|
||||
email,
|
||||
phone, language, is_admin, `from`
|
||||
from sys_user a
|
||||
where username = #{username} and a.from = 3
|
||||
</select>
|
||||
|
||||
<select id="findUserBySub" resultMap="baseMap">
|
||||
select user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from` from sys_user where sub = #{sub} and `from` = #{userFrom}
|
||||
select user_id,
|
||||
username,
|
||||
nick_name,
|
||||
dept_id,
|
||||
password,
|
||||
enabled,
|
||||
email,
|
||||
phone, language, is_admin, `from`
|
||||
from sys_user
|
||||
where sub = #{sub}
|
||||
and `from` = #{userFrom}
|
||||
</select>
|
||||
|
||||
<select id="roleCodes" resultType="String">
|
||||
select r.role_id from sys_role r
|
||||
left join sys_users_roles sur on sur.role_id = r.role_id
|
||||
where sur.user_id = #{userId}
|
||||
select r.role_id
|
||||
from sys_role r
|
||||
left join sys_users_roles sur on sur.role_id = r.role_id
|
||||
where sur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="permissions" resultType="String">
|
||||
SELECT
|
||||
sys_menu.permission
|
||||
FROM
|
||||
( SELECT GET_V_AUTH_MODEL_ID_P_USE ( #{userId}, 'menu' ) cids ) t,
|
||||
sys_menu
|
||||
WHERE
|
||||
FIND_IN_SET( sys_menu.menu_id, cids ) UNION ALL
|
||||
SELECT
|
||||
plugin_sys_menu.permission
|
||||
FROM
|
||||
( SELECT GET_V_AUTH_MODEL_ID_P_USE ( #{userId}, 'menu' ) cids ) t,
|
||||
plugin_sys_menu
|
||||
WHERE
|
||||
FIND_IN_SET( plugin_sys_menu.menu_id, cids )
|
||||
SELECT sys_menu.permission
|
||||
FROM (SELECT GET_V_AUTH_MODEL_ID_P_USE(#{userId}, 'menu') cids) t,
|
||||
sys_menu
|
||||
WHERE FIND_IN_SET(sys_menu.menu_id, cids)
|
||||
UNION ALL
|
||||
SELECT plugin_sys_menu.permission
|
||||
FROM (SELECT GET_V_AUTH_MODEL_ID_P_USE(#{userId}, 'menu') cids) t,
|
||||
plugin_sys_menu
|
||||
WHERE FIND_IN_SET(plugin_sys_menu.menu_id, cids)
|
||||
</select>
|
||||
|
||||
<select id="userMenuIds" resultType="Long">
|
||||
select srm.menu_id
|
||||
from sys_roles_menus srm
|
||||
left join sys_users_roles sur on sur.role_id = srm.role_id
|
||||
left join sys_users_roles sur on sur.role_id = srm.role_id
|
||||
where sur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="roles" resultMap="roleMap">
|
||||
select r.role_id, r.name
|
||||
from sys_role r
|
||||
left join sys_users_roles sur on sur.role_id = r.role_id
|
||||
left join sys_users_roles sur on sur.role_id = r.role_id
|
||||
where sur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="permissionsAll" resultType="String">
|
||||
SELECT
|
||||
sys_menu.permission
|
||||
FROM
|
||||
sys_menu UNION ALL
|
||||
SELECT
|
||||
plugin_sys_menu.permission
|
||||
FROM
|
||||
plugin_sys_menu
|
||||
SELECT sys_menu.permission
|
||||
FROM sys_menu
|
||||
UNION ALL
|
||||
SELECT plugin_sys_menu.permission
|
||||
FROM plugin_sys_menu
|
||||
</select>
|
||||
|
||||
<select id="findWecomUser" resultMap="baseMap">
|
||||
select
|
||||
u.user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from`
|
||||
select u.user_id,
|
||||
username,
|
||||
nick_name,
|
||||
dept_id,
|
||||
password,
|
||||
enabled,
|
||||
email,
|
||||
phone, language, is_admin, `from`
|
||||
from
|
||||
sys_user_assist a
|
||||
left join
|
||||
sys_user u on u.user_id = a.user_id
|
||||
left join
|
||||
sys_user u
|
||||
on u.user_id = a.user_id
|
||||
where a.wecom_id = #{wecomId}
|
||||
</select>
|
||||
|
||||
<select id="findDingtalkUser" resultMap="baseMap">
|
||||
select
|
||||
u.user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from`
|
||||
select u.user_id,
|
||||
username,
|
||||
nick_name,
|
||||
dept_id,
|
||||
password,
|
||||
enabled,
|
||||
email,
|
||||
phone, language, is_admin, `from`
|
||||
from
|
||||
sys_user_assist a
|
||||
left join
|
||||
sys_user u on u.user_id = a.user_id
|
||||
sys_user u
|
||||
on u.user_id = a.user_id
|
||||
where a.dingtalk_id = #{dingtalkId}
|
||||
</select>
|
||||
|
||||
<select id="findLarkUser" resultMap="baseMap">
|
||||
select
|
||||
u.user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from`
|
||||
select u.user_id,
|
||||
username,
|
||||
nick_name,
|
||||
dept_id,
|
||||
password,
|
||||
enabled,
|
||||
email,
|
||||
phone, language, is_admin, `from`
|
||||
from
|
||||
sys_user_assist a
|
||||
left join
|
||||
sys_user u on u.user_id = a.user_id
|
||||
sys_user u
|
||||
on u.user_id = a.user_id
|
||||
where a.lark_id = #{larkId}
|
||||
</select>
|
||||
|
||||
<select id="findLarksuiteUser" resultMap="baseMap">
|
||||
select u.user_id,
|
||||
username,
|
||||
nick_name,
|
||||
dept_id,
|
||||
password,
|
||||
enabled,
|
||||
email,
|
||||
phone, language, is_admin, `from`
|
||||
from
|
||||
sys_user_assist a
|
||||
left join
|
||||
sys_user u
|
||||
on u.user_id = a.user_id
|
||||
where a.larksuite_id = #{larksuiteId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -25,6 +25,8 @@ import io.dataease.plugins.xpack.email.dto.response.XpackEmailTemplateDTO;
|
||||
import io.dataease.plugins.xpack.email.service.EmailXpackService;
|
||||
import io.dataease.plugins.xpack.lark.dto.entity.LarkMsgResult;
|
||||
import io.dataease.plugins.xpack.lark.service.LarkXpackService;
|
||||
import io.dataease.plugins.xpack.larksuite.dto.response.LarksuiteMsgResult;
|
||||
import io.dataease.plugins.xpack.larksuite.service.LarksuiteXpackService;
|
||||
import io.dataease.plugins.xpack.wecom.dto.entity.WecomMsgResult;
|
||||
import io.dataease.plugins.xpack.wecom.service.WecomXpackService;
|
||||
import io.dataease.service.chart.ViewExportExcel;
|
||||
@ -297,6 +299,30 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case "larksuite":
|
||||
if (SpringContextUtil.getBean(AuthUserService.class).supportLarksuite()) {
|
||||
List<String> larksuiteUsers = new ArrayList<>();
|
||||
for (int j = 0; j < reciLists.size(); j++) {
|
||||
String reci = reciLists.get(j);
|
||||
SysUserEntity userBySub = userService.getUserByName(reci);
|
||||
if (ObjectUtils.isEmpty(userBySub)) continue;
|
||||
Long userId = userBySub.getUserId();
|
||||
SysUserAssist sysUserAssist = sysUserService.assistInfo(userId);
|
||||
if (ObjectUtils.isEmpty(sysUserAssist) || StringUtils.isBlank(sysUserAssist.getLarksuiteId()))
|
||||
continue;
|
||||
larksuiteUsers.add(sysUserAssist.getLarksuiteId());
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(larksuiteUsers)) {
|
||||
LarksuiteXpackService larksuiteXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class);
|
||||
LarksuiteMsgResult larksuiteMsgResult = larksuiteXpackService.pushOaMsg(larksuiteUsers, emailTemplateDTO.getTitle(), contentStr, bytes, files);
|
||||
if (larksuiteMsgResult.getCode() != 0) {
|
||||
errorMsgs.add("larksuite: " + larksuiteMsgResult.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -185,7 +185,7 @@ public class XDingtalkServer {
|
||||
sysUserAssist.setUserId(Long.parseLong(state));
|
||||
}
|
||||
sysUserAssist.setDingtalkId(userId);
|
||||
sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId());
|
||||
sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId());
|
||||
response.sendRedirect(url);
|
||||
} catch (Exception e) {
|
||||
|
||||
|
@ -185,7 +185,7 @@ public class XLarkServer {
|
||||
sysUserAssist.setUserId(Long.parseLong(state));
|
||||
}
|
||||
sysUserAssist.setLarkId(userId);
|
||||
sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId());
|
||||
sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId());
|
||||
response.sendRedirect(url);
|
||||
} catch (Exception e) {
|
||||
|
||||
|
@ -0,0 +1,206 @@
|
||||
package io.dataease.plugins.server;
|
||||
|
||||
import io.dataease.auth.entity.SysUserEntity;
|
||||
import io.dataease.auth.entity.TokenInfo;
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.auth.util.JWTUtils;
|
||||
import io.dataease.commons.constants.SysLogConstants;
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.commons.utils.DeLogUtils;
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import io.dataease.commons.utils.ServletUtils;
|
||||
import io.dataease.plugins.common.base.domain.SysUserAssist;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.display.dto.response.SysSettingDto;
|
||||
import io.dataease.plugins.xpack.lark.dto.entity.LarkQrResult;
|
||||
import io.dataease.plugins.xpack.lark.dto.response.LarkInfo;
|
||||
import io.dataease.plugins.xpack.larksuite.dto.entity.UserData;
|
||||
import io.dataease.plugins.xpack.larksuite.dto.response.LarksuiteUserResult;
|
||||
import io.dataease.plugins.xpack.larksuite.service.LarksuiteXpackService;
|
||||
import io.dataease.service.sys.SysUserService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiIgnore
|
||||
@RequestMapping("/plugin/larksuite")
|
||||
@Controller
|
||||
public class XLarksuiteServer {
|
||||
|
||||
@Resource
|
||||
private AuthUserService authUserService;
|
||||
@Resource
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@ResponseBody
|
||||
@GetMapping("/info")
|
||||
public LarkInfo getLarkInfo() {
|
||||
LarksuiteXpackService larkXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class);
|
||||
return larkXpackService.info();
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequiresPermissions("sysparam:read")
|
||||
@PostMapping("/save")
|
||||
public void save(@RequestBody List<SysSettingDto> settings) {
|
||||
LarksuiteXpackService larkXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class);
|
||||
larkXpackService.save(settings);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping("/testConn")
|
||||
public void testConn(@RequestBody LarkInfo larkInfo) {
|
||||
LarksuiteXpackService larkXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class);
|
||||
try {
|
||||
larkXpackService.testConn(larkInfo);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping("/getQrParam")
|
||||
public LarkQrResult getQrParam() {
|
||||
LarksuiteXpackService larkXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class);
|
||||
return larkXpackService.getQrParam();
|
||||
}
|
||||
|
||||
@GetMapping("/callBack")
|
||||
public ModelAndView callBack(@RequestParam("code") String code, @RequestParam("state") String state) {
|
||||
ModelAndView modelAndView = new ModelAndView("redirect:/");
|
||||
HttpServletResponse response = ServletUtils.response();
|
||||
LarksuiteXpackService larksuiteXpackService = null;
|
||||
try {
|
||||
Map<String, LarksuiteXpackService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((LarksuiteXpackService.class));
|
||||
if (beansOfType.keySet().size() == 0) {
|
||||
DEException.throwException("缺少国际飞书插件");
|
||||
}
|
||||
larksuiteXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class);
|
||||
Boolean isOpen = larksuiteXpackService.isOpen();
|
||||
if (!isOpen) {
|
||||
DEException.throwException("未开启国际飞书");
|
||||
}
|
||||
LarksuiteUserResult larksuiteUserResult = larksuiteXpackService.userInfo(code, state, false);
|
||||
UserData larkUserInfo = larksuiteUserResult.getData();
|
||||
String username = larkUserInfo.getUser_id();
|
||||
SysUserEntity sysUserEntity = authUserService.getUserByLarksuiteId(username);
|
||||
if (null == sysUserEntity) {
|
||||
String email = StringUtils.isNotBlank(larkUserInfo.getEmail()) ? larkUserInfo.getEmail() : (username + "@larksuite.work");
|
||||
sysUserService.validateExistUser(username, larkUserInfo.getName(), email);
|
||||
sysUserService.saveLarksuiteCUser(larkUserInfo, email);
|
||||
sysUserEntity = authUserService.getUserByLarksuiteId(username);
|
||||
}
|
||||
TokenInfo tokenInfo = TokenInfo.builder().userId(sysUserEntity.getUserId()).username(sysUserEntity.getUsername()).build();
|
||||
String realPwd = sysUserEntity.getPassword();
|
||||
String token = JWTUtils.sign(tokenInfo, realPwd);
|
||||
ServletUtils.setToken(token);
|
||||
|
||||
DeLogUtils.save(SysLogConstants.OPERATE_TYPE.LOGIN, SysLogConstants.SOURCE_TYPE.USER, sysUserEntity.getUserId(), null, null, null);
|
||||
|
||||
Cookie cookie_token = new Cookie("Authorization", token);
|
||||
cookie_token.setPath("/");
|
||||
|
||||
response.addCookie(cookie_token);
|
||||
} catch (Exception e) {
|
||||
|
||||
String msg = e.getMessage();
|
||||
if (null != e.getCause()) {
|
||||
msg = e.getCause().getMessage();
|
||||
}
|
||||
try {
|
||||
msg = URLEncoder.encode(msg, "UTF-8");
|
||||
LogUtil.error(e);
|
||||
Cookie cookie_error = new Cookie("LarksuiteError", msg);
|
||||
cookie_error.setPath("/");
|
||||
response.addCookie(cookie_error);
|
||||
return modelAndView;
|
||||
} catch (UnsupportedEncodingException e1) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
private void bindError(HttpServletResponse response, String url, String errorMsg) {
|
||||
Cookie cookie_error = new Cookie("LarksuiteError", errorMsg);
|
||||
cookie_error.setPath("/");
|
||||
response.addCookie(cookie_error);
|
||||
try {
|
||||
response.sendRedirect(url);
|
||||
} catch (IOException e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
DEException.throwException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/bind")
|
||||
public void bind(@RequestParam("code") String code, @RequestParam("state") String state) {
|
||||
|
||||
HttpServletResponse response = ServletUtils.response();
|
||||
String url = "/#person-info/index";
|
||||
|
||||
LarksuiteXpackService larksuiteXpackService = null;
|
||||
try {
|
||||
SysUserEntity userEntity = authUserService.getUserById(Long.parseLong(state));
|
||||
if (ObjectUtils.isEmpty(userEntity)) {
|
||||
bindError(response, url, "绑定用户不存在");
|
||||
return;
|
||||
}
|
||||
SysUserAssist sysUserAssist = sysUserService.assistInfo(Long.parseLong(state));
|
||||
if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getLarksuiteId())) {
|
||||
bindError(response, url, "目标用户已绑定其他国际飞书账号");
|
||||
return;
|
||||
}
|
||||
|
||||
Boolean isOpen = authUserService.supportLarksuite();
|
||||
if (!isOpen) {
|
||||
DEException.throwException("未开启国际飞书");
|
||||
}
|
||||
larksuiteXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class);
|
||||
LarksuiteUserResult larksuiteUserResult = larksuiteXpackService.userInfo(code, state, true);
|
||||
UserData larkUserInfo = larksuiteUserResult.getData();
|
||||
String userId = larkUserInfo.getUser_id();
|
||||
|
||||
|
||||
SysUserEntity sysUserEntity = authUserService.getUserByLarksuiteId(userId);
|
||||
if (null != sysUserEntity) {
|
||||
bindError(response, url, "当前国际飞书账号已绑定其他DE用户");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isEmpty(sysUserAssist)) {
|
||||
sysUserAssist = new SysUserAssist();
|
||||
sysUserAssist.setUserId(Long.parseLong(state));
|
||||
}
|
||||
sysUserAssist.setLarksuiteId(userId);
|
||||
sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId());
|
||||
response.sendRedirect(url);
|
||||
} catch (Exception e) {
|
||||
|
||||
String msg = e.getMessage();
|
||||
if (null != e.getCause()) {
|
||||
msg = e.getCause().getMessage();
|
||||
}
|
||||
try {
|
||||
msg = URLEncoder.encode(msg, "UTF-8");
|
||||
LogUtil.error(e);
|
||||
bindError(response, url, msg);
|
||||
} catch (UnsupportedEncodingException e1) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -193,7 +193,7 @@ public class XWecomServer {
|
||||
sysUserAssist.setUserId(Long.parseLong(state));
|
||||
}
|
||||
sysUserAssist.setWecomId(userId);
|
||||
sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId());
|
||||
sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId());
|
||||
|
||||
response.sendRedirect(url);
|
||||
} catch (Exception e) {
|
||||
|
@ -0,0 +1,39 @@
|
||||
package io.dataease.service.message.service.strategy;
|
||||
|
||||
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.plugins.common.base.domain.SysUserAssist;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.larksuite.service.LarksuiteXpackService;
|
||||
import io.dataease.service.message.service.SendService;
|
||||
import io.dataease.service.sys.SysUserService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service("sendLarksuite")
|
||||
public class SendLarksuite implements SendService {
|
||||
|
||||
@Autowired
|
||||
private AuthUserService authUserService;
|
||||
|
||||
@Resource
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Override
|
||||
public void sendMsg(Long userId, Long typeId, String content, String param) {
|
||||
SysUserAssist sysUserAssist = sysUserService.assistInfo(userId);
|
||||
if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getLarksuiteId()) && authUserService.supportLarksuite()) {
|
||||
String username = sysUserAssist.getLarksuiteId();
|
||||
LarksuiteXpackService larksuiteXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class);
|
||||
List<String> userIds = new ArrayList<>();
|
||||
userIds.add(username);
|
||||
larksuiteXpackService.pushMsg(userIds, content);
|
||||
}
|
||||
}
|
||||
}
|
@ -21,6 +21,7 @@ import io.dataease.plugins.common.base.mapper.SysUsersRolesMapper;
|
||||
import io.dataease.plugins.common.entity.XpackLdapUserEntity;
|
||||
import io.dataease.plugins.xpack.dingtalk.dto.response.DingUserEntity;
|
||||
import io.dataease.plugins.xpack.lark.dto.entity.LarkUserInfo;
|
||||
import io.dataease.plugins.xpack.larksuite.dto.entity.UserData;
|
||||
import io.dataease.plugins.xpack.oidc.dto.SSOUserInfo;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@ -107,7 +108,7 @@ public class SysUserService {
|
||||
|
||||
SysUserAssist sysUserAssist = request.getSysUserAssist();
|
||||
if (ObjectUtils.isNotEmpty(sysUserAssist) && (StringUtils.isNotBlank(sysUserAssist.getWecomId()) || StringUtils.isNotBlank(sysUserAssist.getDingtalkId()) || StringUtils.isNotBlank(sysUserAssist.getLarkId()))) {
|
||||
saveAssist(userId, sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId());
|
||||
saveAssist(userId, sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId());
|
||||
}
|
||||
|
||||
return insert;
|
||||
@ -157,7 +158,7 @@ public class SysUserService {
|
||||
sysUser.setIsAdmin(false);
|
||||
sysUser.setSub(userId);
|
||||
sysUserMapper.insert(sysUser);
|
||||
Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), u.getUsername(), null, null));
|
||||
Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), u.getUsername(), null, null, null));
|
||||
|
||||
}
|
||||
|
||||
@ -180,7 +181,7 @@ public class SysUserService {
|
||||
sysUser.setSub(dingUserEntity.getUnionid());
|
||||
sysUser.setPhone(dingUserEntity.getMobile());
|
||||
sysUserMapper.insert(sysUser);
|
||||
Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), null, u.getUsername(), null));
|
||||
Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), null, u.getUsername(), null, null));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@ -202,7 +203,29 @@ public class SysUserService {
|
||||
sysUser.setSub(larkUserInfo.getSub());
|
||||
sysUser.setPhone(larkUserInfo.getMobile());
|
||||
sysUserMapper.insert(sysUser);
|
||||
Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), null, null, u.getUsername()));
|
||||
Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), null, null, u.getUsername(), null));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void saveLarksuiteCUser(UserData larkUserInfo, String email) {
|
||||
long now = System.currentTimeMillis();
|
||||
SysUser sysUser = new SysUser();
|
||||
|
||||
sysUser.setUsername(larkUserInfo.getUser_id());
|
||||
sysUser.setNickName(larkUserInfo.getName());
|
||||
sysUser.setEmail(email);
|
||||
sysUser.setPassword(CodingUtil.md5(DEFAULT_PWD));
|
||||
sysUser.setCreateTime(now);
|
||||
sysUser.setUpdateTime(now);
|
||||
|
||||
sysUser.setEnabled(1L);
|
||||
sysUser.setLanguage("zh_CN");
|
||||
sysUser.setFrom(7);
|
||||
sysUser.setIsAdmin(false);
|
||||
sysUser.setSub(larkUserInfo.getUnion_id());
|
||||
sysUser.setPhone(larkUserInfo.getMobile());
|
||||
sysUserMapper.insert(sysUser);
|
||||
Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), null, null, null, u.getUsername()));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@ -299,7 +322,7 @@ public class SysUserService {
|
||||
|
||||
SysUserAssist sysUserAssist = request.getSysUserAssist();
|
||||
if (ObjectUtils.isNotEmpty(sysUserAssist) && (StringUtils.isNotBlank(sysUserAssist.getWecomId()) || StringUtils.isNotBlank(sysUserAssist.getDingtalkId()) || StringUtils.isNotBlank(sysUserAssist.getLarkId()))) {
|
||||
saveAssist(user.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId());
|
||||
saveAssist(user.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -550,12 +573,13 @@ public class SysUserService {
|
||||
sysUserAssistMapper.insertSelective(sysUserAssist);
|
||||
}
|
||||
|
||||
public void saveAssist(Long userId, String wecomId, String dingtlkId, String larkId) {
|
||||
public void saveAssist(Long userId, String wecomId, String dingtlkId, String larkId, String larksuiteId) {
|
||||
SysUserAssist existAssist = sysUserAssistMapper.selectByPrimaryKey(userId);
|
||||
if (ObjectUtils.isNotEmpty(existAssist)) {
|
||||
existAssist.setWecomId(wecomId);
|
||||
existAssist.setDingtalkId(dingtlkId);
|
||||
existAssist.setLarkId(larkId);
|
||||
existAssist.setLarksuiteId(larksuiteId);
|
||||
sysUserAssistMapper.updateByPrimaryKey(existAssist);
|
||||
return;
|
||||
}
|
||||
@ -564,6 +588,7 @@ public class SysUserService {
|
||||
sysUserAssist.setWecomId(wecomId);
|
||||
sysUserAssist.setDingtalkId(dingtlkId);
|
||||
sysUserAssist.setLarkId(larkId);
|
||||
sysUserAssist.setLarksuiteId(larksuiteId);
|
||||
sysUserAssistMapper.insert(sysUserAssist);
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,44 @@
|
||||
UPDATE `sys_menu` set `component` = REPLACE(`component`, 'SysParam', 'sysParam') where (`component` like '%SysParam%');
|
||||
UPDATE `sys_menu`
|
||||
set `component` = REPLACE(`component`, 'SysParam', 'sysParam')
|
||||
where (`component` like '%SysParam%');
|
||||
|
||||
UPDATE `sys_menu` set `component` = REPLACE(`component`, 'privateForm', 'PrivateForm') where (`component` like '%privateForm%');
|
||||
UPDATE `sys_menu`
|
||||
set `component` = REPLACE(`component`, 'privateForm', 'PrivateForm')
|
||||
where (`component` like '%privateForm%');
|
||||
|
||||
UPDATE `sys_menu` set `component` = REPLACE(`component`, 'personPwd', 'PersonPwd') where (`component` like '%personPwd%');
|
||||
UPDATE `sys_menu`
|
||||
set `component` = REPLACE(`component`, 'personPwd', 'PersonPwd')
|
||||
where (`component` like '%personPwd%');
|
||||
|
||||
UPDATE `sys_menu` set `component` = REPLACE(`component`, 'dataset', 'Dataset') where (`component` = 'system/task/dataset');
|
||||
UPDATE `sys_menu`
|
||||
set `component` = REPLACE(`component`, 'dataset', 'Dataset')
|
||||
where (`component` = 'system/task/dataset');
|
||||
|
||||
UPDATE `sys_menu` set `component` = REPLACE(`component`, 'form', 'Form') where (`component` = 'system/task/form');
|
||||
UPDATE `sys_menu`
|
||||
set `component` = REPLACE(`component`, 'form', 'Form')
|
||||
where (`component` = 'system/task/form');
|
||||
|
||||
ALTER TABLE `dataset_table_field` ADD COLUMN `date_format` VARCHAR(255) NULL AFTER `accuracy`;
|
||||
ALTER TABLE `dataset_table_field`
|
||||
ADD COLUMN `date_format` VARCHAR(255) NULL AFTER `accuracy`;
|
||||
|
||||
ALTER TABLE `sys_task_email` ADD COLUMN `view_data_range` VARCHAR(255) NULL DEFAULT 'view' AFTER `reci_users`;
|
||||
ALTER TABLE `sys_task_email`
|
||||
ADD COLUMN `view_data_range` VARCHAR(255) NULL DEFAULT 'view' AFTER `reci_users`;
|
||||
|
||||
|
||||
UPDATE `sys_msg_type` set `type_name` = 'i18n_msg_type_dataset_sync_failed' WHERE (`msg_type_id` = 6);
|
||||
UPDATE `sys_msg_type`
|
||||
set `type_name` = 'i18n_msg_type_dataset_sync_failed'
|
||||
WHERE (`msg_type_id` = 6);
|
||||
|
||||
ALTER TABLE `sys_user_assist`
|
||||
ADD COLUMN `larksuite_id` VARCHAR(255) NULL DEFAULT NULL AFTER `lark_id`;
|
||||
|
||||
ALTER TABLE `dataset_table_field` CHANGE COLUMN `type` `type` VARCHAR(255) NOT NULL COMMENT '原始字段类型' ;
|
||||
|
||||
INSERT INTO `my_plugin` (`name`, `store`, `free`, `cost`, `category`, `descript`, `version`, `creator`, `load_mybatis`,
|
||||
`install_time`, `module_name`, `ds_type`)
|
||||
VALUES ('Apache Kylin 数据源插件', 'default', '0', '0', 'datasource', 'Apache Kylin 数据源插件', '1.0-SNAPSHOT', 'DATAEASE', '0',
|
||||
'1650765903630', 'kylin-backend', 'kylin');
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_msg_channel` (`msg_channel_id`, `channel_name`, `service_name`) VALUES ('6', 'webmsg.channel_larksuite_msg', 'sendLarksuite');
|
||||
|
@ -121,6 +121,13 @@ export function larkStatus() {
|
||||
})
|
||||
}
|
||||
|
||||
export function larksuiteStatus() {
|
||||
return request({
|
||||
url: '/api/auth/isOpenLarksuite',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function pluginLoaded() {
|
||||
return request({
|
||||
url: '/api/auth/isPluginLoaded',
|
||||
|
@ -677,7 +677,9 @@ export default {
|
||||
'tabMoveInActiveId',
|
||||
'tabActiveTabNameMap',
|
||||
'mousePointShadowMap',
|
||||
'tabMoveOutComponentId'
|
||||
'tabMoveOutComponentId',
|
||||
'tabCollisionActiveId',
|
||||
'tabMoveInActiveId'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
@ -1920,8 +1922,8 @@ export default {
|
||||
const left = this.left
|
||||
const width = this.width
|
||||
const height = this.height
|
||||
// tab 移入检测开启
|
||||
if (this.isTabMoveCheck) {
|
||||
// tab 移入检测开启 tab组件不能相互移入另一个tab组件
|
||||
if (this.isTabMoveCheck && this.element.type !== 'de-tabs') {
|
||||
const nodes = this.$el.parentNode.childNodes // 获取当前父节点下所有子节点
|
||||
for (const item of nodes) {
|
||||
if (
|
||||
@ -1951,7 +1953,7 @@ export default {
|
||||
const brAndBr = (collisionT + collisionH) >= (top + height) && (collisionL + collisionW) >= (left + width)
|
||||
if (tfAndTf && bfAndBf && trAndTr && brAndBr) {
|
||||
this.$store.commit('setTabCollisionActiveId', item.getAttribute('component-id'))
|
||||
} else {
|
||||
} else if (this.tabCollisionActiveId === item.getAttribute('component-id')) {
|
||||
this.$store.commit('setTabCollisionActiveId', null)
|
||||
}
|
||||
|
||||
@ -1972,7 +1974,7 @@ export default {
|
||||
const activeBrAndBr = (activeT + activeH) >= (top + height) && (activeL + activeW) >= (left + width)
|
||||
if (activeTfAndTf && activeBfAndBf && activeTrAndTr && activeBrAndBr) {
|
||||
this.$store.commit('setTabMoveInActiveId', item.getAttribute('component-id'))
|
||||
} else {
|
||||
} else if (this.tabMoveInActiveId === item.getAttribute('component-id')) {
|
||||
this.$store.commit('setTabMoveInActiveId', null)
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ export const colorCases = [
|
||||
export const gradientColorCases = [
|
||||
{
|
||||
name: '渐变色1',
|
||||
value: 'gradient1',
|
||||
value: 'gradient1_continuous_gradient',
|
||||
colors: [
|
||||
['rgba(144,202,249,0.5)', 'rgba(1,87,155,0.9)'],
|
||||
['rgba(127,222,234,1)', 'rgba(0,77,65,1)'],
|
||||
@ -101,3 +101,72 @@ export const gradientColorCases = [
|
||||
export const isGradientValue = value => {
|
||||
return value && gradientColorCases.some(item => item.value === value)
|
||||
}
|
||||
|
||||
export const getColorType = value => {
|
||||
if (value.endsWith('_split_gradient')) {
|
||||
return 'split_gradient'
|
||||
}
|
||||
const cloneColorCases = JSON.parse(JSON.stringify(colorCases))
|
||||
if (cloneColorCases.some(item => item.value === value)) {
|
||||
return 'simple'
|
||||
}
|
||||
return 'gradient'
|
||||
}
|
||||
|
||||
export const getMapColorCases = () => {
|
||||
const cloneColorCases = JSON.parse(JSON.stringify(colorCases))
|
||||
return cloneColorCases.map(colorItem => {
|
||||
const curColors = colorItem.colors
|
||||
const len = curColors.length
|
||||
const start = curColors[0]
|
||||
const end = curColors[len - 1]
|
||||
const itemResult = {
|
||||
name: colorItem.name,
|
||||
value: colorItem.value + '_split_gradient',
|
||||
baseColors: [start, end],
|
||||
colors: stepsColor(start, end, 9, 1)
|
||||
}
|
||||
return itemResult
|
||||
})
|
||||
}
|
||||
|
||||
export function stepsColor(start, end, steps, gamma) {
|
||||
var i; var j; var ms; var me; var output = []; var so = []
|
||||
gamma = gamma || 1
|
||||
var normalize = function(channel) {
|
||||
return Math.pow(channel / 255, gamma)
|
||||
}
|
||||
start = parseColor(start).map(normalize)
|
||||
end = parseColor(end).map(normalize)
|
||||
for (i = 0; i < steps; i++) {
|
||||
ms = (steps - 1) === 0 ? 0 : (i / (steps - 1))
|
||||
me = 1 - ms
|
||||
for (j = 0; j < 3; j++) {
|
||||
so[j] = pad(
|
||||
Math.round(
|
||||
Math.pow(start[j] * me + end[j] * ms, 1 / gamma) * 255
|
||||
).toString(16)
|
||||
)
|
||||
}
|
||||
output.push('#' + so.join(''))
|
||||
}
|
||||
function parseColor(hexStr) {
|
||||
return hexStr.length === 4
|
||||
? hexStr
|
||||
.substr(1)
|
||||
.split('')
|
||||
.map(function(s) {
|
||||
return 0x11 * parseInt(s, 16)
|
||||
})
|
||||
: [hexStr.substr(1, 2), hexStr.substr(3, 2), hexStr.substr(5, 2)].map(
|
||||
function(s) {
|
||||
return parseInt(s, 16)
|
||||
}
|
||||
)
|
||||
}
|
||||
function pad(s) {
|
||||
return s.length === 1 ? '0' + s : s
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
<el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
content="重置"
|
||||
:content="$t('commons.reset')"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-refresh" />
|
||||
@ -38,7 +38,7 @@
|
||||
<div class="custom-switch-div">
|
||||
<el-switch
|
||||
v-model="enableCustom"
|
||||
active-text="自定义"
|
||||
:active-text="$t('commons.reset')"
|
||||
inactive-text=""
|
||||
/>
|
||||
</div>
|
||||
@ -47,7 +47,7 @@
|
||||
@tab-click="handleClick"
|
||||
>
|
||||
<el-tab-pane
|
||||
v-for="(pane, i) in tabPanes"
|
||||
v-for="(pane, i) in tabPanes.filter(item => item.name === 'simple' || (showIndex === 1 && item.name === 'split_gradient') || (showIndex === 2 && item.name === 'gradient'))"
|
||||
:key="i"
|
||||
:label="pane.label"
|
||||
:name="pane.name"
|
||||
@ -84,22 +84,29 @@
|
||||
v-for="(co,index) in option.colors"
|
||||
v-else
|
||||
:key="index"
|
||||
class="color-span-base is-editor"
|
||||
class="color-span-base"
|
||||
:class="option.value.endsWith('_split_gradient') && index % 8 !== 0 ? 'static-editor' : 'is-editor'"
|
||||
>
|
||||
<el-color-picker
|
||||
v-if="i === 0"
|
||||
v-model="option.colors[index]"
|
||||
@change="switchColorItem(option.colors, index)"
|
||||
<span
|
||||
v-if="option.value.endsWith('_split_gradient') && index % 8 !== 0"
|
||||
class="color-span-base-split"
|
||||
:style="{background: formatBgColor(co)}"
|
||||
/>
|
||||
|
||||
<de-color-picker
|
||||
v-else
|
||||
v-else-if="option.value.endsWith('_continuous_gradient')"
|
||||
:id="option.value + index"
|
||||
ref="de-color-picker"
|
||||
v-model="option.colors[index]"
|
||||
:base-id="option.value + index"
|
||||
show-alpha
|
||||
color-format="rgb"
|
||||
@change="switchColorItem(option.colors, index)"
|
||||
@change="switchColorItem(option.colors, option.value)"
|
||||
/>
|
||||
<el-color-picker
|
||||
v-else
|
||||
v-model="option.colors[index]"
|
||||
@change="switchColorItem(option.colors, option.value)"
|
||||
/>
|
||||
</span>
|
||||
|
||||
@ -132,7 +139,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { colorCases, gradientColorCases } from './base'
|
||||
import { colorCases, gradientColorCases, getMapColorCases, getColorType, stepsColor } from './base'
|
||||
import DeColorPicker from './DeColorPicker'
|
||||
export default {
|
||||
name: 'GradientColorSelector',
|
||||
@ -148,6 +155,10 @@ export default {
|
||||
colors: []
|
||||
}
|
||||
}
|
||||
},
|
||||
showIndex: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -161,12 +172,17 @@ export default {
|
||||
activeName: 'simple',
|
||||
tabPanes: [
|
||||
{
|
||||
label: '纯色',
|
||||
label: this.$t('chart.solid_color'),
|
||||
name: 'simple',
|
||||
data: JSON.parse(JSON.stringify(colorCases))
|
||||
},
|
||||
{
|
||||
label: '渐变',
|
||||
label: this.$t('chart.split_gradient'),
|
||||
name: 'split_gradient',
|
||||
data: JSON.parse(JSON.stringify(getMapColorCases()))
|
||||
},
|
||||
{
|
||||
label: this.$t('chart.continuous_gradient'),
|
||||
name: 'gradient',
|
||||
data: JSON.parse(JSON.stringify(gradientColorCases))
|
||||
}
|
||||
@ -200,10 +216,27 @@ export default {
|
||||
parents.scrollTo(0, top)
|
||||
}
|
||||
},
|
||||
switchColorItem(colors, index) {
|
||||
this.colorDto.colors = JSON.parse(JSON.stringify(colors))
|
||||
switchColorItem(colors, value) {
|
||||
const activeName = getColorType(value)
|
||||
if (activeName === 'split_gradient') {
|
||||
const start = colors[0]
|
||||
const end = colors[colors.length - 1]
|
||||
const targetColors = stepsColor(start, end, 9, 1)
|
||||
this.colorDto.colors = JSON.parse(JSON.stringify(targetColors))
|
||||
this.fillSplitGradientPanel()
|
||||
} else {
|
||||
this.colorDto.colors = JSON.parse(JSON.stringify(colors))
|
||||
}
|
||||
|
||||
this.$emit('color-change', JSON.parse(JSON.stringify(this.colorDto)))
|
||||
},
|
||||
fillSplitGradientPanel() {
|
||||
this.tabPanes[1].data.forEach(item => {
|
||||
if (item.value === this.colorDto.value) {
|
||||
item.colors = this.colorDto.colors
|
||||
}
|
||||
})
|
||||
},
|
||||
initcolorDto() {
|
||||
let haspPropValue = true
|
||||
if (!this.colorDto.value) {
|
||||
@ -211,9 +244,9 @@ export default {
|
||||
this.colorDto.colors = this.colorCases[0].colors
|
||||
haspPropValue = false
|
||||
}
|
||||
this.activeName = this.colorCases.some(item => item.value === this.colorDto.value) ? 'simple' : 'gradient'
|
||||
this.activeName = getColorType(this.colorDto.value)
|
||||
if (haspPropValue) {
|
||||
this.tabPanes[this.activeName === 'simple' ? 0 : 1].data.forEach(item => {
|
||||
this.tabPanes[this.activeName === 'simple' ? 0 : this.activeName === 'split_gradient' ? 1 : 2].data.forEach(item => {
|
||||
if (item.value === this.colorDto.value) {
|
||||
item.colors = JSON.parse(JSON.stringify(this.colorDto.colors))
|
||||
}
|
||||
@ -270,14 +303,15 @@ export default {
|
||||
return str
|
||||
})
|
||||
})
|
||||
this.tabPanes[1].data = JSON.parse(JSON.stringify(this.gradientColorCases))
|
||||
const len = this.tabPanes.length
|
||||
this.tabPanes[len - 1].data = JSON.parse(JSON.stringify(this.gradientColorCases))
|
||||
},
|
||||
formatBgColor(color, useValue) {
|
||||
let activeName = this.activeName
|
||||
if (useValue) {
|
||||
activeName = this.colorCases.some(item => item.value === this.colorDto.value) ? 'simple' : 'gradient'
|
||||
activeName = getColorType(this.colorDto.value)
|
||||
}
|
||||
if (activeName === 'simple') {
|
||||
if (activeName === 'simple' || activeName === 'split_gradient') {
|
||||
return color
|
||||
}
|
||||
return 'linear-gradient(0.0deg,' + color[0] + ' 0.0,' + color[1] + ' 100.0%)'
|
||||
@ -296,11 +330,8 @@ export default {
|
||||
},
|
||||
reset() {
|
||||
if (this.colorDto.value) {
|
||||
let activeName = 'simple'
|
||||
if (this.gradientColorCases.some(item => item.value === this.colorDto.value)) {
|
||||
activeName = 'gradient'
|
||||
}
|
||||
(activeName === 'simple' ? colorCases : gradientColorCases).forEach(curcase => {
|
||||
const activeName = getColorType(this.colorDto.value);
|
||||
(activeName === 'simple' ? colorCases : activeName === 'split_gradient' ? getMapColorCases() : gradientColorCases).forEach(curcase => {
|
||||
if (curcase.value === this.colorDto.value) {
|
||||
this.colorDto.colors = JSON.parse(JSON.stringify(curcase.colors))
|
||||
this.$emit('color-change', JSON.parse(JSON.stringify(this.colorDto)))
|
||||
@ -318,7 +349,7 @@ export default {
|
||||
}
|
||||
.gradient-popper {
|
||||
background: #fff;
|
||||
padding: 0 10px;
|
||||
padding: 0 10px !important;
|
||||
margin-top: 1px !important;
|
||||
border-top: none;
|
||||
height: 300px;
|
||||
@ -340,7 +371,8 @@ export default {
|
||||
.color-span-base {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display:inline-block;
|
||||
display:flex;
|
||||
align-items: center;
|
||||
}
|
||||
.is-editor {
|
||||
width:23px !important;
|
||||
@ -352,7 +384,11 @@ export default {
|
||||
align-items: center !important;
|
||||
cursor: pointer;
|
||||
padding-left: 5px !important;
|
||||
.static-editor:nth-child(2) {
|
||||
margin-left: 5px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-switch-div {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
@ -380,4 +416,11 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.is-split {
|
||||
width: 28px !important;
|
||||
}
|
||||
.color-span-base-split {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
</style>
|
||||
|
@ -282,7 +282,6 @@ export default {
|
||||
})
|
||||
},
|
||||
handleDragOver(e) {
|
||||
// console.log("handleDragOver-"+this.canvasId)
|
||||
e.preventDefault()
|
||||
e.dataTransfer.dropEffect = 'copy'
|
||||
this.$refs[this.editorRefName].handleDragOver(e)
|
||||
|
@ -41,12 +41,14 @@
|
||||
:in-screen="inScreen"
|
||||
:edit-mode="'preview'"
|
||||
:h="config.style.height"
|
||||
:canvas-id="canvasId"
|
||||
/>
|
||||
<component
|
||||
:is="config.component"
|
||||
v-else
|
||||
ref="wrapperChild"
|
||||
class="component"
|
||||
:canvas-id="canvasId"
|
||||
:out-style="config.style"
|
||||
:style="getComponentStyleDefault(config.style)"
|
||||
:prop-value="config.propValue"
|
||||
@ -83,6 +85,10 @@ export default {
|
||||
components: { CloseBar, MobileCheckBar, DeOutWidget, EditBar },
|
||||
mixins: [mixins],
|
||||
props: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
sourceConfig: {
|
||||
type: Object,
|
||||
require: true,
|
||||
|
@ -65,6 +65,7 @@
|
||||
<de-out-widget
|
||||
v-if="renderOk && item.type==='custom'"
|
||||
:id="'component' + item.id"
|
||||
:canvas-id="canvasId"
|
||||
ref="wrapperChild"
|
||||
class="component"
|
||||
:style="getComponentStyleDefault(item.style)"
|
||||
@ -79,6 +80,7 @@
|
||||
:is="item.component"
|
||||
v-else-if="renderOk && item.type==='other'"
|
||||
:id="'component' + item.id"
|
||||
:canvas-id="canvasId"
|
||||
ref="wrapperChild"
|
||||
class="component"
|
||||
:style="getComponentStyle(item.style)"
|
||||
@ -91,6 +93,7 @@
|
||||
:is="item.component"
|
||||
v-else-if="renderOk"
|
||||
:id="'component' + item.id"
|
||||
:canvas-id="canvasId"
|
||||
ref="wrapperChild"
|
||||
class="component"
|
||||
:filters="filterMap[item.propValue && item.propValue.viewId]"
|
||||
@ -1433,10 +1436,12 @@ export default {
|
||||
matrixStyleOriginWidth: this.matrixStyle.originWidth,
|
||||
matrixStyleOriginHeight: this.matrixStyle.originHeight
|
||||
})
|
||||
this.$store.commit('setPreviewCanvasScale', {
|
||||
scaleWidth: this.scalePointWidth,
|
||||
scaleHeight: this.scalePointHeight
|
||||
})
|
||||
if(this.canvasId === 'canvas-main'){
|
||||
this.$store.commit('setPreviewCanvasScale', {
|
||||
scaleWidth: this.scalePointWidth,
|
||||
scaleHeight: this.scalePointHeight
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
getShapeStyleIntDeDrag(style, prop, item) {
|
||||
@ -1499,7 +1504,6 @@ export default {
|
||||
}
|
||||
},
|
||||
handleDragOver(e) {
|
||||
console.log('handleDragOver--x=' + e.pageX + ';y=' + e.pageY)
|
||||
this.dragComponentInfo.shadowStyle.x = e.pageX - 220
|
||||
this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop
|
||||
this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth
|
||||
@ -1645,7 +1649,6 @@ export default {
|
||||
let newY = Math.round((item.style.top * this.scalePointHeight) / this.matrixStyle.height) + 1
|
||||
newX = newX > 0 ? newX : 1
|
||||
newY = newY > 0 ? newY : 1
|
||||
console.log('moveTabCollisionActive=' + this.moveTabCollisionActive)
|
||||
if (this.moveTabCollisionActive) {
|
||||
return
|
||||
}
|
||||
|
@ -43,6 +43,7 @@
|
||||
:key="index"
|
||||
ref="viewWrapperChild"
|
||||
:config="item"
|
||||
:canvas-id="canvasId"
|
||||
:source-config="componentData[index]"
|
||||
:search-count="searchCount"
|
||||
:in-screen="inScreen"
|
||||
@ -438,7 +439,9 @@ export default {
|
||||
} else {
|
||||
this.scaleHeight = canvasHeight * 100 / this.canvasStyleData.height// 获取高度比
|
||||
}
|
||||
this.$store.commit('setPreviewCanvasScale', { scaleWidth: (this.scaleWidth / 100), scaleHeight: (this.scaleHeight / 100) })
|
||||
if(this.canvasId === 'canvas-main'){
|
||||
this.$store.commit('setPreviewCanvasScale', { scaleWidth: (this.scaleWidth / 100), scaleHeight: (this.scaleHeight / 100) })
|
||||
}
|
||||
this.handleScaleChange()
|
||||
},
|
||||
resetID(data) {
|
||||
|
@ -216,6 +216,10 @@ export default {
|
||||
name: 'UserView',
|
||||
components: { UserViewDialog, DeRichTextView, LabelNormalText, PluginCom, ChartComponentS2, EditBarView, ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 },
|
||||
props: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
default: null
|
||||
|
@ -39,6 +39,7 @@
|
||||
:is="element.component"
|
||||
v-if="element.type==='custom'"
|
||||
:id="'component' + element.id"
|
||||
:canvas-id="canvasId"
|
||||
ref="deOutWidget"
|
||||
class="component-custom"
|
||||
:out-style="element.style"
|
||||
@ -63,6 +64,10 @@ export default {
|
||||
name: 'DeOutWidget',
|
||||
mixins: [inputStyleMixin],
|
||||
props: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
|
@ -35,6 +35,10 @@ import customInput from '@/components/widget/DeWidget/customInput'
|
||||
export default {
|
||||
mixins: [customInput],
|
||||
props: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
default: null
|
||||
@ -221,6 +225,7 @@ export default {
|
||||
},
|
||||
getCondition() {
|
||||
const param = {
|
||||
canvasId: this.canvasId,
|
||||
component: this.element,
|
||||
value: this.formatFilterValue(),
|
||||
operator: this.operator
|
||||
|
@ -27,6 +27,10 @@ import bus from '@/utils/bus'
|
||||
export default {
|
||||
|
||||
props: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
default: null
|
||||
@ -104,6 +108,7 @@ export default {
|
||||
},
|
||||
getCondition() {
|
||||
const param = {
|
||||
canvasId: this.canvasId,
|
||||
component: this.element,
|
||||
value: !this.value ? [] : Array.isArray(this.value) ? this.value : [this.value],
|
||||
operator: this.operator
|
||||
|
@ -47,6 +47,10 @@ import bus from '@/utils/bus'
|
||||
export default {
|
||||
|
||||
props: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
default: null
|
||||
@ -230,6 +234,7 @@ export default {
|
||||
},
|
||||
getCondition() {
|
||||
const param = {
|
||||
canvasId: this.canvasId,
|
||||
component: this.element,
|
||||
value: [this.form.min, this.form.max],
|
||||
operator: this.operator
|
||||
|
@ -52,6 +52,10 @@ export default {
|
||||
components: { ElVisualSelect },
|
||||
mixins: [customInput],
|
||||
props: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
@ -311,6 +315,7 @@ export default {
|
||||
},
|
||||
getCondition() {
|
||||
const param = {
|
||||
canvasId: this.canvasId,
|
||||
component: this.element,
|
||||
value: this.formatFilterValue(),
|
||||
operator: this.operator
|
||||
|
@ -73,6 +73,10 @@ import { attrsMap, styleAttrs, textSelectGridWidget } from '@/components/widget/
|
||||
|
||||
export default {
|
||||
props: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
default: null
|
||||
@ -312,6 +316,7 @@ export default {
|
||||
},
|
||||
getCondition() {
|
||||
const param = {
|
||||
canvasId: this.canvasId,
|
||||
component: this.element,
|
||||
value: this.formatFilterValue(),
|
||||
operator: this.operator
|
||||
|
@ -36,6 +36,10 @@ export default {
|
||||
components: { ElTreeSelect },
|
||||
mixins: [customInput],
|
||||
props: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
@ -298,6 +302,7 @@ export default {
|
||||
const val = this.formatFilterValue()
|
||||
|
||||
const param = {
|
||||
canvasId: this.canvasId,
|
||||
component: this.element,
|
||||
value: val,
|
||||
operator: this.operator,
|
||||
|
@ -45,14 +45,6 @@
|
||||
{{ $t('detabs.eidttitle') }}
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item :command="beforeHandleCommand('selectView', item)">
|
||||
{{ $t('detabs.selectview') }}
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item :command="beforeHandleCommand('selectOthers', item)">
|
||||
{{ $t('detabs.selectOthers') }}
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item
|
||||
v-if=" element.options.tabList.length > 1"
|
||||
:command="beforeHandleCommand('deleteCur', item)"
|
||||
|
@ -912,6 +912,9 @@ export default {
|
||||
password_input_error: 'Original password input error'
|
||||
},
|
||||
chart: {
|
||||
solid_color: 'Solid color',
|
||||
split_gradient: 'Split gradient',
|
||||
continuous_gradient: 'Continuous gradient',
|
||||
map_center_lost: 'The graph is missing the centroid or center attribute, please complete it and try again',
|
||||
margin_model: 'Model',
|
||||
margin_model_auto: 'Auto',
|
||||
@ -2362,7 +2365,8 @@ export default {
|
||||
channel_email_msg: 'Email',
|
||||
channel_wecom_msg: 'Wecom',
|
||||
channel_dingtalk_msg: 'Dingtalk',
|
||||
channel_lark_msg: 'Lark'
|
||||
channel_lark_msg: 'Lark',
|
||||
channel_larksuite_msg: 'Larksuite'
|
||||
},
|
||||
denumberrange: {
|
||||
label: 'Number range',
|
||||
@ -2478,6 +2482,7 @@ export default {
|
||||
wecom: 'Wecom',
|
||||
dingtalk: 'Dingtalk',
|
||||
lark: 'Lark',
|
||||
larksuite: 'Larksuite',
|
||||
pixel: 'Pixel',
|
||||
default: 'Default',
|
||||
custom: 'Custom',
|
||||
|
@ -912,6 +912,9 @@ export default {
|
||||
password_input_error: '原始密碼輸入錯誤'
|
||||
},
|
||||
chart: {
|
||||
solid_color: '純色',
|
||||
split_gradient: '分離漸變',
|
||||
continuous_gradient: '連續漸變',
|
||||
map_center_lost: '圖形缺失中心點centroid或center屬性,請補全後再試',
|
||||
margin_model: '模式',
|
||||
margin_model_auto: '自動',
|
||||
@ -2363,7 +2366,8 @@ export default {
|
||||
channel_email_msg: '郵件提醒',
|
||||
channel_wecom_msg: '企業微信',
|
||||
channel_dingtalk_msg: '釘釘提醒',
|
||||
channel_lark_msg: '飛書提醒'
|
||||
channel_lark_msg: '飛書提醒',
|
||||
channel_larksuite_msg: '國際飛書'
|
||||
},
|
||||
denumberrange: {
|
||||
label: '數值區間',
|
||||
@ -2479,6 +2483,7 @@ export default {
|
||||
wecom: '企業微信',
|
||||
dingtalk: '釘釘',
|
||||
lark: '飛書',
|
||||
larksuite: '國際飛書',
|
||||
pixel: '分辨率',
|
||||
default: '默認',
|
||||
custom: '自定義',
|
||||
|
@ -911,6 +911,9 @@ export default {
|
||||
password_input_error: '原始密码输入错误'
|
||||
},
|
||||
chart: {
|
||||
solid_color: '纯色',
|
||||
split_gradient: '分离渐变',
|
||||
continuous_gradient: '连续渐变',
|
||||
map_center_lost: '图形缺失中心点centroid或center属性,请补全后再试',
|
||||
margin_model: '模式',
|
||||
margin_model_auto: '自动',
|
||||
@ -2363,7 +2366,8 @@ export default {
|
||||
channel_email_msg: '邮件提醒',
|
||||
channel_wecom_msg: '企业微信',
|
||||
channel_dingtalk_msg: '钉钉提醒',
|
||||
channel_lark_msg: '飞书提醒'
|
||||
channel_lark_msg: '飞书提醒',
|
||||
channel_larksuite_msg: '国际飞书'
|
||||
},
|
||||
denumberrange: {
|
||||
label: '数值区间',
|
||||
@ -2479,6 +2483,7 @@ export default {
|
||||
wecom: '企业微信',
|
||||
dingtalk: '钉钉',
|
||||
lark: '飞书',
|
||||
larksuite: '国际飞书',
|
||||
pixel: '分辨率',
|
||||
default: '默认',
|
||||
custom: '自定义',
|
||||
|
@ -229,7 +229,6 @@ const data = {
|
||||
if (height || height === 0) curComponent.style.height = (height / curCanvasScaleSelf.scalePointHeight) + 0.0000001
|
||||
if (rotate || rotate === 0) curComponent.style.rotate = rotate
|
||||
}
|
||||
// console.log("setShapeStyle==="+curComponent.style.width)
|
||||
},
|
||||
|
||||
setShapeSingleStyle({ curComponent }, { key, value }) {
|
||||
@ -289,6 +288,13 @@ const data = {
|
||||
const vValid = valueValid(condition)
|
||||
// 1.根据componentId过滤
|
||||
const filterComponentId = condition.componentId
|
||||
const canvasId = data.canvasId
|
||||
|
||||
//过滤时 主画布的过滤组件可以过滤所有的视图
|
||||
const canvasViewIds = state.componentData.filter(item => item.type === 'view' && (canvasId === 'canvas-main' || item.canvasId === canvasId)).map((itemView) => {
|
||||
return itemView.propValue.viewId
|
||||
})
|
||||
const canvasViewIdMatch = (viewId) => canvasViewIds && canvasViewIds.length > 0 && canvasViewIds.includes(viewId)
|
||||
|
||||
// 2.循环每个Component 得到 三种情况 a增加b删除c无操作
|
||||
const viewIdMatch = (viewIds, viewId) => !viewIds || viewIds.length === 0 || viewIds.includes(viewId)
|
||||
@ -318,7 +324,7 @@ const data = {
|
||||
}
|
||||
if (!element.type || element.type !== 'view') continue
|
||||
const currentFilters = element.filters || []
|
||||
const vidMatch = viewIdMatch(condition.viewIds, element.propValue.viewId)
|
||||
const vidMatch = viewIdMatch(condition.viewIds, element.propValue.viewId) && canvasViewIdMatch(element.propValue.viewId)
|
||||
let j = currentFilters.length
|
||||
while (j--) {
|
||||
const filter = currentFilters[j]
|
||||
@ -485,12 +491,8 @@ const data = {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
deleteComponent(state, index) {
|
||||
if (index === undefined) {
|
||||
index = state.curComponentIndex
|
||||
}
|
||||
state.componentData.splice(index, 1)
|
||||
deleteComponent(state) {
|
||||
this.commit('deleteComponentWithId',state.curComponent.id)
|
||||
},
|
||||
setLinkageInfo(state, targetLinkageInfo) {
|
||||
state.linkageSettingStatus = true
|
||||
@ -764,7 +766,6 @@ const data = {
|
||||
state.mousePointShadowMap.mouseY = mousePoint.mouseY
|
||||
state.mousePointShadowMap.width = mousePoint.width
|
||||
state.mousePointShadowMap.height = mousePoint.height
|
||||
// console.log("mousePointMap:"+JSON.stringify(state.mousePointMap))
|
||||
}
|
||||
},
|
||||
modules: {
|
||||
|
@ -75,6 +75,11 @@
|
||||
:label="2"
|
||||
size="mini"
|
||||
>OIDC</el-radio>
|
||||
<el-radio
|
||||
v-if="loginTypes.includes(7)"
|
||||
:label="7"
|
||||
size="mini"
|
||||
>Larksuite</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="username">
|
||||
@ -187,6 +192,12 @@
|
||||
component-name="SSOComponent"
|
||||
/>
|
||||
|
||||
<plugin-com
|
||||
v-if="loginTypes.includes(7) && loginForm.loginType === 7"
|
||||
ref="LarksuiteQr"
|
||||
component-name="LarksuiteQr"
|
||||
/>
|
||||
|
||||
</div>
|
||||
<div
|
||||
v-if="showFoot"
|
||||
@ -199,7 +210,7 @@
|
||||
<script>
|
||||
|
||||
import { encrypt } from '@/utils/rsaEncrypt'
|
||||
import { ldapStatus, oidcStatus, getPublicKey, pluginLoaded, defaultLoginType, wecomStatus, dingtalkStatus, larkStatus } from '@/api/user'
|
||||
import { ldapStatus, oidcStatus, getPublicKey, pluginLoaded, defaultLoginType, wecomStatus, dingtalkStatus, larkStatus, larksuiteStatus } from '@/api/user'
|
||||
import { getSysUI } from '@/utils/auth'
|
||||
import { changeFavicon } from '@/utils/index'
|
||||
import { initTheme } from '@/utils/ThemeUtil'
|
||||
@ -248,10 +259,10 @@ export default {
|
||||
return this.$store.state.user.loginMsg
|
||||
},
|
||||
qrTypes() {
|
||||
return this.loginTypes && this.loginTypes.filter(item => item > 3) || []
|
||||
return this.loginTypes && this.loginTypes.filter(item => item > 3 && item < 7) || []
|
||||
},
|
||||
radioTypes() {
|
||||
return this.loginTypes && this.loginTypes.filter(item => item < 4) || []
|
||||
return this.loginTypes && this.loginTypes.filter(item => item < 4 || item > 6) || []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -312,6 +323,13 @@ export default {
|
||||
this.setDefaultType()
|
||||
})
|
||||
|
||||
larksuiteStatus().then(res => {
|
||||
if (res.success && res.data) {
|
||||
this.loginTypes.push(7)
|
||||
}
|
||||
this.setDefaultType()
|
||||
})
|
||||
|
||||
getPublicKey().then(res => {
|
||||
if (res.success && res.data) {
|
||||
// 保存公钥
|
||||
@ -361,6 +379,11 @@ export default {
|
||||
this.switchCodeIndex(6)
|
||||
}
|
||||
this.clearLarkMsg()
|
||||
|
||||
if (Cookies.get('LarksuiteError')) {
|
||||
this.$error(Cookies.get('LarksuiteError'))
|
||||
}
|
||||
this.clearLarksuiteMsg()
|
||||
},
|
||||
|
||||
methods: {
|
||||
@ -391,6 +414,9 @@ export default {
|
||||
clearLarkMsg() {
|
||||
Cookies.remove('LarkError')
|
||||
},
|
||||
clearLarksuiteMsg() {
|
||||
Cookies.remove('LarksuiteError')
|
||||
},
|
||||
showLoginImage(uiInfo) {
|
||||
this.uiInfo = getSysUI()
|
||||
if (!this.uiInfo || Object.keys(this.uiInfo).length === 0) {
|
||||
@ -427,6 +453,7 @@ export default {
|
||||
this.clearWecomMsg()
|
||||
this.clearDingtalkMsg()
|
||||
this.clearLarkMsg()
|
||||
this.clearLarksuiteMsg()
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
@ -447,8 +474,9 @@ export default {
|
||||
})
|
||||
},
|
||||
changeLoginType(val) {
|
||||
if (val !== 2) return
|
||||
if (val !== 2 && val !== 7) return
|
||||
this.clearOidcMsg()
|
||||
this.clearLarksuiteMsg()
|
||||
this.$nextTick(() => {
|
||||
|
||||
})
|
||||
|
@ -1294,6 +1294,8 @@ export default {
|
||||
component.x = 1
|
||||
component.y = 1
|
||||
}
|
||||
component['canvasId'] = 'canvas-main'
|
||||
component['canvasPid'] = '0'
|
||||
component.id = newComponentId
|
||||
// 统一设置背景信息
|
||||
component.commonBackground = deepCopy(COMMON_BACKGROUND)
|
||||
|
@ -58,7 +58,7 @@ const util = {
|
||||
/**
|
||||
* 关键字颜色变化
|
||||
*/
|
||||
serachNmme(val, name) {
|
||||
searchNmme(val, name) {
|
||||
let namestr = new RegExp(val);
|
||||
let nameresult =
|
||||
`<div style="font-size: 14px;color: #333;line-height: 1.5;">
|
||||
@ -94,7 +94,7 @@ const util = {
|
||||
dataHandle(item, val) {
|
||||
// 改变字体颜色
|
||||
if (val) {
|
||||
item.nameNodes = util.serachNmme(val, item.name);
|
||||
item.nameNodes = util.searchNmme(val, item.name);
|
||||
} else {
|
||||
item.nameNodes = `<div style="font-size: 14px;color: #333;line-height: 1.5;">${item.name}</div>`;
|
||||
|
||||
@ -130,9 +130,9 @@ const util = {
|
||||
setHistory(val) {
|
||||
let searchHistory = uni.getStorageSync('search:history');
|
||||
if (!searchHistory) searchHistory = [];
|
||||
let serachData = {};
|
||||
let searchData = {};
|
||||
if (typeof(val) === 'string') {
|
||||
serachData = {
|
||||
searchData = {
|
||||
adcode: [],
|
||||
address: [],
|
||||
city: [],
|
||||
@ -143,18 +143,18 @@ const util = {
|
||||
typecode: []
|
||||
};
|
||||
} else {
|
||||
serachData = val
|
||||
searchData = val
|
||||
}
|
||||
|
||||
// 判断数组是否存在,如果存在,那么将放到最前面
|
||||
for (var i = 0; i < searchHistory.length; i++) {
|
||||
if (searchHistory[i].name === serachData.name) {
|
||||
if (searchHistory[i].name === searchData.name) {
|
||||
searchHistory.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
searchHistory.unshift(util.dataHandle(serachData));
|
||||
searchHistory.unshift(util.dataHandle(searchData));
|
||||
uni.setStorage({
|
||||
key: 'search:history',
|
||||
data: searchHistory,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=1182
|
||||
* @property {String} href 点击后打开的外部网页url
|
||||
* @property {String} text 显示的文字
|
||||
* @property {String} downlaod H5平台下载文件名
|
||||
* @property {String} download H5平台下载文件名
|
||||
* @property {Boolean} showUnderLine 是否显示下划线
|
||||
* @property {String} copyTips 在小程序端复制链接时显示的提示语
|
||||
* @property {String} color 链接文字颜色
|
||||
|
@ -116,7 +116,7 @@
|
||||
index: 1
|
||||
})
|
||||
this.loadStarStatus()
|
||||
this.caclViewHeight()
|
||||
this.calcViewHeight()
|
||||
|
||||
|
||||
},
|
||||
@ -194,7 +194,7 @@
|
||||
})
|
||||
|
||||
},
|
||||
caclViewHeight() {
|
||||
calcViewHeight() {
|
||||
let systemInfo = uni.getSystemInfoSync()
|
||||
const h5Height = systemInfo.windowHeight - systemInfo.statusBarHeight
|
||||
if(systemInfo.navigationBarHeight) {
|
||||
|
@ -113,9 +113,9 @@
|
||||
}
|
||||
|
||||
requestHome({type: index, lastTime: activeTab.lastTime}).then(res => {
|
||||
var datas = res.data.listObject
|
||||
if(datas.length > 0) {
|
||||
datas.forEach(item => {
|
||||
var data = res.data.listObject
|
||||
if(data.length > 0) {
|
||||
data.forEach(item => {
|
||||
item.article_type = 1
|
||||
item.image_url = '../../../static/yibiaobans.png'
|
||||
if(item.nickName) {
|
||||
@ -124,11 +124,11 @@
|
||||
if(item.time)
|
||||
item.rightText = formatHistoryDate(item.time)
|
||||
})
|
||||
activeTab.lastTime = datas[datas.length - 1].time
|
||||
activeTab.lastTime = data[data.length - 1].time
|
||||
if(replace) {
|
||||
activeTab.data = datas
|
||||
activeTab.data = data
|
||||
}else {
|
||||
activeTab.data = activeTab.data.concat(datas)
|
||||
activeTab.data = activeTab.data.concat(data)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user