forked from github/dataease
Merge branch 'dev' of github.com:dataease/dataease into dev
This commit is contained in:
commit
db249689c7
@ -19,5 +19,7 @@ public class VAuthModel implements Serializable {
|
|||||||
|
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
||||||
|
private Long level;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
@ -593,6 +593,66 @@ public class VAuthModelExample {
|
|||||||
addCriterion("create_by not between", value1, value2, "createBy");
|
addCriterion("create_by not between", value1, value2, "createBy");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelIsNull() {
|
||||||
|
addCriterion("`level` is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelIsNotNull() {
|
||||||
|
addCriterion("`level` is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelEqualTo(Long value) {
|
||||||
|
addCriterion("`level` =", value, "level");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelNotEqualTo(Long value) {
|
||||||
|
addCriterion("`level` <>", value, "level");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelGreaterThan(Long value) {
|
||||||
|
addCriterion("`level` >", value, "level");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelGreaterThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("`level` >=", value, "level");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelLessThan(Long value) {
|
||||||
|
addCriterion("`level` <", value, "level");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelLessThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("`level` <=", value, "level");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelIn(List<Long> values) {
|
||||||
|
addCriterion("`level` in", values, "level");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelNotIn(List<Long> values) {
|
||||||
|
addCriterion("`level` not in", values, "level");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("`level` between", value1, value2, "level");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andLevelNotBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("`level` not between", value1, value2, "level");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Criteria extends GeneratedCriteria {
|
public static class Criteria extends GeneratedCriteria {
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
<result column="model_inner_type" jdbcType="VARCHAR" property="modelInnerType" />
|
<result column="model_inner_type" jdbcType="VARCHAR" property="modelInnerType" />
|
||||||
<result column="auth_type" jdbcType="VARCHAR" property="authType" />
|
<result column="auth_type" jdbcType="VARCHAR" property="authType" />
|
||||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||||
|
<result column="level" jdbcType="BIGINT" property="level" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.VAuthModelWithBLOBs">
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.VAuthModelWithBLOBs">
|
||||||
<result column="name" jdbcType="LONGVARCHAR" property="name" />
|
<result column="name" jdbcType="LONGVARCHAR" property="name" />
|
||||||
@ -73,7 +74,7 @@
|
|||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, pid, node_type, model_type, model_inner_type, auth_type, create_by
|
id, pid, node_type, model_type, model_inner_type, auth_type, create_by, `level`
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Blob_Column_List">
|
<sql id="Blob_Column_List">
|
||||||
`name`, `label`
|
`name`, `label`
|
||||||
@ -117,12 +118,12 @@
|
|||||||
<insert id="insert" parameterType="io.dataease.base.domain.VAuthModelWithBLOBs">
|
<insert id="insert" parameterType="io.dataease.base.domain.VAuthModelWithBLOBs">
|
||||||
insert into v_auth_model (id, pid, node_type,
|
insert into v_auth_model (id, pid, node_type,
|
||||||
model_type, model_inner_type, auth_type,
|
model_type, model_inner_type, auth_type,
|
||||||
create_by, `name`, `label`
|
create_by, `level`, `name`,
|
||||||
)
|
`label`)
|
||||||
values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{nodeType,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{nodeType,jdbcType=VARCHAR},
|
||||||
#{modelType,jdbcType=VARCHAR}, #{modelInnerType,jdbcType=VARCHAR}, #{authType,jdbcType=VARCHAR},
|
#{modelType,jdbcType=VARCHAR}, #{modelInnerType,jdbcType=VARCHAR}, #{authType,jdbcType=VARCHAR},
|
||||||
#{createBy,jdbcType=VARCHAR}, #{name,jdbcType=LONGVARCHAR}, #{label,jdbcType=LONGVARCHAR}
|
#{createBy,jdbcType=VARCHAR}, #{level,jdbcType=BIGINT}, #{name,jdbcType=LONGVARCHAR},
|
||||||
)
|
#{label,jdbcType=LONGVARCHAR})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="io.dataease.base.domain.VAuthModelWithBLOBs">
|
<insert id="insertSelective" parameterType="io.dataease.base.domain.VAuthModelWithBLOBs">
|
||||||
insert into v_auth_model
|
insert into v_auth_model
|
||||||
@ -148,6 +149,9 @@
|
|||||||
<if test="createBy != null">
|
<if test="createBy != null">
|
||||||
create_by,
|
create_by,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="level != null">
|
||||||
|
`level`,
|
||||||
|
</if>
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
`name`,
|
`name`,
|
||||||
</if>
|
</if>
|
||||||
@ -177,6 +181,9 @@
|
|||||||
<if test="createBy != null">
|
<if test="createBy != null">
|
||||||
#{createBy,jdbcType=VARCHAR},
|
#{createBy,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="level != null">
|
||||||
|
#{level,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
#{name,jdbcType=LONGVARCHAR},
|
#{name,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -215,6 +222,9 @@
|
|||||||
<if test="record.createBy != null">
|
<if test="record.createBy != null">
|
||||||
create_by = #{record.createBy,jdbcType=VARCHAR},
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.level != null">
|
||||||
|
`level` = #{record.level,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
<if test="record.name != null">
|
<if test="record.name != null">
|
||||||
`name` = #{record.name,jdbcType=LONGVARCHAR},
|
`name` = #{record.name,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -235,6 +245,7 @@
|
|||||||
model_inner_type = #{record.modelInnerType,jdbcType=VARCHAR},
|
model_inner_type = #{record.modelInnerType,jdbcType=VARCHAR},
|
||||||
auth_type = #{record.authType,jdbcType=VARCHAR},
|
auth_type = #{record.authType,jdbcType=VARCHAR},
|
||||||
create_by = #{record.createBy,jdbcType=VARCHAR},
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||||
|
`level` = #{record.level,jdbcType=BIGINT},
|
||||||
`name` = #{record.name,jdbcType=LONGVARCHAR},
|
`name` = #{record.name,jdbcType=LONGVARCHAR},
|
||||||
`label` = #{record.label,jdbcType=LONGVARCHAR}
|
`label` = #{record.label,jdbcType=LONGVARCHAR}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
@ -249,7 +260,8 @@
|
|||||||
model_type = #{record.modelType,jdbcType=VARCHAR},
|
model_type = #{record.modelType,jdbcType=VARCHAR},
|
||||||
model_inner_type = #{record.modelInnerType,jdbcType=VARCHAR},
|
model_inner_type = #{record.modelInnerType,jdbcType=VARCHAR},
|
||||||
auth_type = #{record.authType,jdbcType=VARCHAR},
|
auth_type = #{record.authType,jdbcType=VARCHAR},
|
||||||
create_by = #{record.createBy,jdbcType=VARCHAR}
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||||
|
`level` = #{record.level,jdbcType=BIGINT}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
|
@ -75,10 +75,7 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
<if test="sort != null">
|
ORDER BY CONVERT(`name` using gbk)
|
||||||
order by ${sort}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -74,10 +74,7 @@
|
|||||||
and name like CONCAT('%', #{name},'%')
|
and name like CONCAT('%', #{name},'%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
<if test="sort != null">
|
ORDER BY CONVERT(`name` using gbk)
|
||||||
order by ${sort}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -75,9 +75,7 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
<if test="sort != null">
|
ORDER BY CONVERT(`name` using gbk)
|
||||||
order by ${sort}
|
|
||||||
</if>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="searchIds" resultType="java.util.Map">
|
<select id="searchIds" resultType="java.util.Map">
|
||||||
|
@ -92,8 +92,6 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
<if test="sort != null">
|
ORDER BY CONVERT(`name` using gbk)
|
||||||
order by ${sort}
|
|
||||||
</if>
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -12,14 +12,11 @@ public interface ExtPanelGroupMapper {
|
|||||||
|
|
||||||
List<PanelGroupDTO> panelGroupListDefault(PanelGroupRequest request);
|
List<PanelGroupDTO> panelGroupListDefault(PanelGroupRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//会级联删除pid 下的所有数据
|
//会级联删除pid 下的所有数据
|
||||||
int deleteCircle(@Param("pid") String pid);
|
int deleteCircle(@Param("pid") String pid);
|
||||||
|
|
||||||
PanelGroupDTO panelGroup(String id);
|
PanelGroupDTO panelGroup(String id);
|
||||||
|
|
||||||
|
|
||||||
void copyPanelView(@Param("pid") String panelId);
|
void copyPanelView(@Param("pid") String panelId);
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
and panel_group.level = #{level}
|
and panel_group.level = #{level}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by panel_group.name asc,panel_group.create_time desc
|
ORDER BY CONVERT(panel_group.name using gbk)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="panelGroupList" resultMap="BaseResultMapDTO">
|
<select id="panelGroupList" resultMap="BaseResultMapDTO">
|
||||||
@ -160,7 +160,7 @@
|
|||||||
and panel_group.level = #{level}
|
and panel_group.level = #{level}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by panel_group.name asc,panel_group.create_time desc
|
ORDER BY CONVERT(panel_group.name using gbk)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<delete id="deleteCircle">
|
<delete id="deleteCircle">
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package io.dataease.base.mapper.ext;
|
||||||
|
|
||||||
|
import io.dataease.controller.request.authModel.VAuthModelRequest;
|
||||||
|
import io.dataease.dto.authModel.VAuthModelDTO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ExtVAuthModelMapper {
|
||||||
|
|
||||||
|
List<VAuthModelDTO> queryAuthModel (@Param("request") VAuthModelRequest request);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="io.dataease.base.mapper.ext.ExtVAuthModelMapper">
|
||||||
|
<resultMap extends="io.dataease.base.mapper.VAuthModelMapper.ResultMapWithBLOBs" id="ExtResultMap"
|
||||||
|
type="io.dataease.dto.authModel.VAuthModelDTO">
|
||||||
|
<result column="privileges" jdbcType="VARCHAR" property="privileges"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="queryAuthModel" resultMap="ExtResultMap">
|
||||||
|
SELECT
|
||||||
|
v_auth_model.id,
|
||||||
|
v_auth_model.name,
|
||||||
|
v_auth_model.label,
|
||||||
|
v_auth_model.pid,
|
||||||
|
v_auth_model.node_type,
|
||||||
|
v_auth_model.model_type,
|
||||||
|
v_auth_model.model_inner_type,
|
||||||
|
v_auth_model.auth_type,
|
||||||
|
v_auth_model.create_by,
|
||||||
|
v_auth_model.level,
|
||||||
|
authInfo.PRIVILEGES AS `privileges`
|
||||||
|
FROM
|
||||||
|
( SELECT GET_V_AUTH_MODEL_ID_P_USE ( #{request.userId}, #{request.modelType} ) cids ) t,
|
||||||
|
v_auth_model
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
auth_source,
|
||||||
|
group_concat( DISTINCT sys_auth_detail.privilege_extend ) AS `privileges`
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
`sys_auth`
|
||||||
|
LEFT JOIN `sys_auth_detail` ON ((
|
||||||
|
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
|
||||||
|
)))
|
||||||
|
WHERE
|
||||||
|
sys_auth_detail.privilege_value = #{request.userId}
|
||||||
|
AND sys_auth.auth_source_type = #{request.modelType}
|
||||||
|
AND (
|
||||||
|
(
|
||||||
|
sys_auth.auth_target_type = 'dept'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{request.userId} )
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'user'
|
||||||
|
AND sys_auth.auth_target = #{request.userId}
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'role'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{request.userId} )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
`sys_auth`.`auth_source`
|
||||||
|
) authInfo ON v_auth_model.id = authInfo.auth_source
|
||||||
|
WHERE
|
||||||
|
FIND_IN_SET( v_auth_model.id, cids )
|
||||||
|
ORDER BY CONVERT(v_auth_model.label using gbk) asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -1,10 +1,18 @@
|
|||||||
package io.dataease.controller.authModel;
|
package io.dataease.controller.authModel;
|
||||||
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||||
|
import io.dataease.controller.request.authModel.VAuthModelRequest;
|
||||||
|
import io.dataease.dto.authModel.VAuthModelDTO;
|
||||||
|
import io.dataease.service.authModel.VAuthModelService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: wangjiahao
|
* Author: wangjiahao
|
||||||
* Date: 2021/11/5
|
* Date: 2021/11/5
|
||||||
@ -16,4 +24,12 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@RequestMapping("authModel")
|
@RequestMapping("authModel")
|
||||||
public class VAuthModelController {
|
public class VAuthModelController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private VAuthModelService vAuthModelService;
|
||||||
|
|
||||||
|
@PostMapping("/queryAuthModel")
|
||||||
|
public List<VAuthModelDTO> queryAuthModel(@RequestBody VAuthModelRequest request){
|
||||||
|
return vAuthModelService.queryAuthModel(request);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package io.dataease.controller.request.authModel;
|
||||||
|
|
||||||
|
import io.dataease.dto.authModel.VAuthModelDTO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author: wangjiahao
|
||||||
|
* Date: 2021/11/24
|
||||||
|
* Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class VAuthModelRequest extends VAuthModelDTO {
|
||||||
|
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,20 @@
|
|||||||
package io.dataease.dto.authModel;
|
package io.dataease.dto.authModel;
|
||||||
|
|
||||||
import io.dataease.base.domain.VAuthModel;
|
import io.dataease.base.domain.VAuthModelWithBLOBs;
|
||||||
|
import io.dataease.commons.model.ITreeBase;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: wangjiahao
|
* Author: wangjiahao
|
||||||
* Date: 2021/11/5
|
* Date: 2021/11/5
|
||||||
* Description:
|
* Description:
|
||||||
*/
|
*/
|
||||||
public class VAuthModelDTO extends VAuthModel {
|
@Data
|
||||||
|
public class VAuthModelDTO extends VAuthModelWithBLOBs implements ITreeBase<VAuthModelDTO> {
|
||||||
|
|
||||||
|
private String privileges;
|
||||||
|
|
||||||
|
private List<VAuthModelDTO> children;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
package io.dataease.service.authModel;
|
||||||
|
|
||||||
|
import io.dataease.base.mapper.ext.ExtVAuthModelMapper;
|
||||||
|
import io.dataease.commons.utils.AuthUtils;
|
||||||
|
import io.dataease.commons.utils.TreeUtils;
|
||||||
|
import io.dataease.controller.request.authModel.VAuthModelRequest;
|
||||||
|
import io.dataease.dto.authModel.VAuthModelDTO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author: wangjiahao
|
||||||
|
* Date: 2021/11/24
|
||||||
|
* Description:
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class VAuthModelService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExtVAuthModelMapper extVAuthModelMapper;
|
||||||
|
|
||||||
|
public List<VAuthModelDTO> queryAuthModel(VAuthModelRequest request){
|
||||||
|
request.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
|
||||||
|
List<VAuthModelDTO> result = extVAuthModelMapper.queryAuthModel(request);
|
||||||
|
return TreeUtils.mergeTree(result );
|
||||||
|
}
|
||||||
|
}
|
@ -65,7 +65,7 @@
|
|||||||
<!--要生成的数据库表 -->
|
<!--要生成的数据库表 -->
|
||||||
|
|
||||||
|
|
||||||
<table tableName="sys_msg_channel"/>
|
<table tableName="v_auth_model"/>
|
||||||
|
|
||||||
|
|
||||||
</context>
|
</context>
|
||||||
|
11
frontend/src/api/authModel/authModel.js
Normal file
11
frontend/src/api/authModel/authModel.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function queryAuthModel(data) {
|
||||||
|
return request({
|
||||||
|
url: 'authModel/queryAuthModel',
|
||||||
|
method: 'post',
|
||||||
|
loading: true,
|
||||||
|
timeout: 30000,
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
@ -60,3 +60,14 @@ export function checkSameDataSet(viewIdSource, viewIdTarget) {
|
|||||||
loading: false
|
loading: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function ajaxGetDataOnly(id, data) {
|
||||||
|
return request({
|
||||||
|
url: '/chart/view/getData/' + id,
|
||||||
|
method: 'post',
|
||||||
|
loading: true,
|
||||||
|
hideMsg: true,
|
||||||
|
timeout: 30000,
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<template xmlns:el-col="http://www.w3.org/1999/html">
|
<template xmlns:el-col="http://www.w3.org/1999/html">
|
||||||
<el-col class="tree-style">
|
<el-col class="tree-style">
|
||||||
<!-- group -->
|
<el-col>
|
||||||
<el-col v-if="!sceneMode">
|
|
||||||
<el-row class="title-css">
|
<el-row class="title-css">
|
||||||
<span class="title-text">
|
<span class="title-text">
|
||||||
{{ $t('chart.datalist') }}
|
{{ $t('chart.datalist') }}
|
||||||
@ -9,44 +8,55 @@
|
|||||||
<el-button icon="el-icon-plus" type="text" size="mini" style="float: right;" @click="add('group')" />
|
<el-button icon="el-icon-plus" type="text" size="mini" style="float: right;" @click="add('group')" />
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-divider />
|
<el-divider />
|
||||||
<el-row>
|
<el-row style="margin-bottom: 10px">
|
||||||
<el-form>
|
<el-col :span="16">
|
||||||
<el-form-item class="form-item">
|
<el-input
|
||||||
<el-input
|
v-model="filterText"
|
||||||
v-model="search"
|
size="mini"
|
||||||
size="mini"
|
:placeholder="$t('commons.search')"
|
||||||
:placeholder="$t('chart.search')"
|
prefix-icon="el-icon-search"
|
||||||
prefix-icon="el-icon-search"
|
clearable
|
||||||
clearable
|
class="main-area-input"
|
||||||
class="main-area-input"
|
/>
|
||||||
/>
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span="8">
|
||||||
</el-form>
|
<el-dropdown>
|
||||||
|
<el-button size="mini" type="primary">
|
||||||
|
{{ searchMap[searchType] }}<i class="el-icon-arrow-down el-icon--right" />
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item @click.native="searchTypeClick('all')">{{ $t('commons.all') }}</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click.native="searchTypeClick('folder')">{{ this.$t('commons.folder') }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-col class="custom-tree-container">
|
<el-col class="custom-tree-container">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="asyncTree"
|
ref="chartTreeRef"
|
||||||
:default-expanded-keys="expandedArray"
|
:default-expanded-keys="expandedArray"
|
||||||
:data="tData"
|
:data="tData"
|
||||||
node-key="id"
|
node-key="id"
|
||||||
:expand-on-click-node="true"
|
|
||||||
:load="loadNode"
|
|
||||||
lazy
|
|
||||||
:props="treeProps"
|
|
||||||
highlight-current
|
highlight-current
|
||||||
|
:expand-on-click-node="true"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
@node-click="nodeClick"
|
@node-click="nodeClick"
|
||||||
>
|
>
|
||||||
<span v-if="data.type ==='group'" slot-scope="{ node, data }" class="custom-tree-node father">
|
<span v-if="data.modelInnerType ==='group'" slot-scope="{ node, data }" class="custom-tree-node father">
|
||||||
<span style="display: flex;flex: 1;width: 0;">
|
<span style="display: flex;flex: 1;width: 0;">
|
||||||
<span>
|
<span>
|
||||||
<i class="el-icon-folder" />
|
<i class="el-icon-folder" />
|
||||||
</span>
|
</span>
|
||||||
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" :title="data.name">{{ data.name }}</span>
|
<span
|
||||||
|
style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
|
||||||
|
:title="data.name"
|
||||||
|
>{{ data.name }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="hasDataPermission('manage',data.privileges)" class="child">
|
<span v-if="hasDataPermission('manage',data.privileges)" class="child">
|
||||||
<span v-if="data.type ==='group'" @click.stop>
|
<span v-if="data.modelInnerType ==='group'" @click.stop>
|
||||||
<el-dropdown trigger="click" size="small" @command="clickAdd">
|
<el-dropdown trigger="click" size="small" @command="clickAdd">
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
<el-button
|
<el-button
|
||||||
@ -91,8 +101,11 @@
|
|||||||
</span>
|
</span>
|
||||||
<span v-else slot-scope="{ node, data }" class="custom-tree-node-list father">
|
<span v-else slot-scope="{ node, data }" class="custom-tree-node-list father">
|
||||||
<span style="display: flex;flex: 1;width: 0;">
|
<span style="display: flex;flex: 1;width: 0;">
|
||||||
<span><svg-icon :icon-class="data.type" /></span>
|
<span><svg-icon :icon-class="data.modelInnerType" /></span>
|
||||||
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" :title="data.name">{{ data.name }}</span>
|
<span
|
||||||
|
style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
|
||||||
|
:title="data.name"
|
||||||
|
>{{ data.name }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="hasDataPermission('manage',data.privileges)" class="child">
|
<span v-if="hasDataPermission('manage',data.privileges)" class="child">
|
||||||
<span style="margin-left: 12px;" @click.stop>
|
<span style="margin-left: 12px;" @click.stop>
|
||||||
@ -125,7 +138,12 @@
|
|||||||
|
|
||||||
<!--group add/edit-->
|
<!--group add/edit-->
|
||||||
<el-dialog v-dialogDrag :title="dialogTitle" :visible="editGroup" :show-close="false" width="30%">
|
<el-dialog v-dialogDrag :title="dialogTitle" :visible="editGroup" :show-close="false" width="30%">
|
||||||
<el-form ref="groupForm" :model="groupForm" :rules="groupFormRules" @keypress.enter.native="saveGroup(groupForm)">
|
<el-form
|
||||||
|
ref="groupForm"
|
||||||
|
:model="groupForm"
|
||||||
|
:rules="groupFormRules"
|
||||||
|
@keypress.enter.native="saveGroup(groupForm)"
|
||||||
|
>
|
||||||
<el-form-item :label="$t('commons.name')" prop="name">
|
<el-form-item :label="$t('commons.name')" prop="name">
|
||||||
<el-input v-model="groupForm.name" />
|
<el-input v-model="groupForm.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -219,28 +237,60 @@
|
|||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="mini" @click="closeCreateChart">{{ $t('chart.cancel') }}</el-button>
|
<el-button size="mini" @click="closeCreateChart">{{ $t('chart.cancel') }}</el-button>
|
||||||
<el-button v-if="createActive === 2" type="primary" size="mini" @click="createPreview">{{ $t('chart.preview') }}</el-button>
|
<el-button v-if="createActive === 2" type="primary" size="mini" @click="createPreview">{{ $t('chart.preview')
|
||||||
<el-button v-if="createActive === 1" type="primary" size="mini" :disabled="!table.id || !currGroup.id" @click="createNext">{{ $t('chart.next') }}</el-button>
|
}}
|
||||||
<el-button v-if="createActive === 2" type="primary" size="mini" :disabled="!table.id || !currGroup.id || !view.type" @click="createChart">{{ $t('chart.confirm') }}</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="createActive === 1"
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
:disabled="!table.id || !currGroup.id"
|
||||||
|
@click="createNext"
|
||||||
|
>{{ $t('chart.next') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="createActive === 2"
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
:disabled="!table.id || !currGroup.id || !view.type"
|
||||||
|
@click="createChart"
|
||||||
|
>{{ $t('chart.confirm') }}
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!--移动分组-->
|
<!--移动分组-->
|
||||||
<el-dialog v-dialogDrag :title="moveDialogTitle" :visible="moveGroup" :show-close="false" width="30%" class="dialog-css">
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
:title="moveDialogTitle"
|
||||||
|
:visible="moveGroup"
|
||||||
|
:show-close="false"
|
||||||
|
width="30%"
|
||||||
|
class="dialog-css"
|
||||||
|
>
|
||||||
<group-move-selector :item="groupForm" @targetGroup="targetGroup" />
|
<group-move-selector :item="groupForm" @targetGroup="targetGroup" />
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="mini" @click="closeMoveGroup()">{{ $t('dataset.cancel') }}</el-button>
|
<el-button size="mini" @click="closeMoveGroup()">{{ $t('dataset.cancel') }}</el-button>
|
||||||
<el-button :disabled="groupMoveConfirmDisabled" type="primary" size="mini" @click="saveMoveGroup(tGroup)">{{ $t('dataset.confirm') }}
|
<el-button :disabled="groupMoveConfirmDisabled" type="primary" size="mini" @click="saveMoveGroup(tGroup)">{{
|
||||||
|
$t('dataset.confirm') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!--移动视图-->
|
<!--移动视图-->
|
||||||
<el-dialog v-dialogDrag :title="moveDialogTitle" :visible="moveDs" :show-close="false" width="30%" class="dialog-css">
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
:title="moveDialogTitle"
|
||||||
|
:visible="moveDs"
|
||||||
|
:show-close="false"
|
||||||
|
width="30%"
|
||||||
|
class="dialog-css"
|
||||||
|
>
|
||||||
<chart-move-selector :item="dsForm" @targetDs="targetDs" />
|
<chart-move-selector :item="dsForm" @targetDs="targetDs" />
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="mini" @click="closeMoveDs()">{{ $t('dataset.cancel') }}</el-button>
|
<el-button size="mini" @click="closeMoveDs()">{{ $t('dataset.cancel') }}</el-button>
|
||||||
<el-button :disabled="dsMoveConfirmDisabled" type="primary" size="mini" @click="saveMoveDs(tDs)">{{ $t('dataset.confirm') }}
|
<el-button :disabled="dsMoveConfirmDisabled" type="primary" size="mini" @click="saveMoveDs(tDs)">{{
|
||||||
|
$t('dataset.confirm') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -249,6 +299,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { post, chartGroupTree } from '@/api/chart/chart'
|
import { post, chartGroupTree } from '@/api/chart/chart'
|
||||||
|
import { queryAuthModel } from '@/api/authModel/authModel'
|
||||||
import TableSelector from '../view/TableSelector'
|
import TableSelector from '../view/TableSelector'
|
||||||
import GroupMoveSelector from '../components/TreeSelector/GroupMoveSelector'
|
import GroupMoveSelector from '../components/TreeSelector/GroupMoveSelector'
|
||||||
import ChartMoveSelector from '../components/TreeSelector/ChartMoveSelector'
|
import ChartMoveSelector from '../components/TreeSelector/ChartMoveSelector'
|
||||||
@ -359,41 +410,34 @@ export default {
|
|||||||
renderOptions: [
|
renderOptions: [
|
||||||
{ name: 'AntV', value: 'antv' },
|
{ name: 'AntV', value: 'antv' },
|
||||||
{ name: 'ECharts', value: 'echarts' }
|
{ name: 'ECharts', value: 'echarts' }
|
||||||
]
|
],
|
||||||
|
searchPids: [], // 查询命中的pid
|
||||||
|
filterText: '',
|
||||||
|
searchType: 'all',
|
||||||
|
searchMap: {
|
||||||
|
all: this.$t('commons.all'),
|
||||||
|
folder: this.$t('commons.folder')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
// sceneData: function() {
|
|
||||||
// this.reviewChartList()
|
|
||||||
// return this.$store.state.chart.chartSceneData
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
search(val) {
|
|
||||||
// if (val && val !== '') {
|
|
||||||
// this.chartData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.name.includes(val) })))
|
|
||||||
// } else {
|
|
||||||
// this.chartData = JSON.parse(JSON.stringify(this.tables))
|
|
||||||
// }
|
|
||||||
this.$emit('switchComponent', { name: '' })
|
|
||||||
this.tData = []
|
|
||||||
this.expandedArray = []
|
|
||||||
if (this.timer) {
|
|
||||||
clearTimeout(this.timer)
|
|
||||||
}
|
|
||||||
this.timer = setTimeout(() => {
|
|
||||||
this.getTreeData(val)
|
|
||||||
}, (val && val !== '') ? 500 : 0)
|
|
||||||
},
|
|
||||||
saveStatus() {
|
saveStatus() {
|
||||||
this.refreshNodeBy(this.saveStatus.sceneId)
|
|
||||||
},
|
},
|
||||||
adviceGroupId() {
|
adviceGroupId() {
|
||||||
// 仪表板新建视图建议的存放路径
|
// 仪表板新建视图建议的存放路径
|
||||||
if (this.optFrom === 'panel') {
|
if (this.optFrom === 'panel') {
|
||||||
this.currGroup['id'] = this.adviceGroupId
|
this.currGroup['id'] = this.adviceGroupId
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
filterText(val) {
|
||||||
|
this.searchPids = []
|
||||||
|
this.$refs.chartTreeRef.filter(val)
|
||||||
|
},
|
||||||
|
searchType(val) {
|
||||||
|
this.searchPids = []
|
||||||
|
this.$refs.chartTreeRef.filter(this.filterText)
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.treeNode(this.groupForm)
|
this.treeNode(this.groupForm)
|
||||||
@ -424,7 +468,7 @@ export default {
|
|||||||
clickMore(param) {
|
clickMore(param) {
|
||||||
switch (param.type) {
|
switch (param.type) {
|
||||||
case 'rename':
|
case 'rename':
|
||||||
this.add(param.data.type)
|
this.add(param.data.modelInnerType)
|
||||||
this.groupForm = JSON.parse(JSON.stringify(param.data))
|
this.groupForm = JSON.parse(JSON.stringify(param.data))
|
||||||
break
|
break
|
||||||
case 'move':
|
case 'move':
|
||||||
@ -479,15 +523,9 @@ export default {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
showClose: true
|
showClose: true
|
||||||
})
|
})
|
||||||
// this.treeNode(this.groupForm)
|
this.treeNode()
|
||||||
this.refreshNodeBy(group.pid)
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// this.$message({
|
|
||||||
// message: this.$t('commons.input_content'),
|
|
||||||
// type: 'error',
|
|
||||||
// showClose: true
|
|
||||||
// })
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -504,10 +542,7 @@ export default {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
showClose: true
|
showClose: true
|
||||||
})
|
})
|
||||||
// this.chartTree()
|
this.treeNode()
|
||||||
this.refreshNodeBy(view.sceneId)
|
|
||||||
// this.$router.push('/chart/home')
|
|
||||||
// this.$emit('switchComponent', { name: '' })
|
|
||||||
this.$store.dispatch('chart/setTable', null)
|
this.$store.dispatch('chart/setTable', null)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -533,8 +568,7 @@ export default {
|
|||||||
message: this.$t('chart.delete_success'),
|
message: this.$t('chart.delete_success'),
|
||||||
showClose: true
|
showClose: true
|
||||||
})
|
})
|
||||||
// this.treeNode(this.groupForm)
|
this.treeNode()
|
||||||
this.refreshNodeBy(data.pid)
|
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
@ -552,9 +586,7 @@ export default {
|
|||||||
message: this.$t('chart.delete_success'),
|
message: this.$t('chart.delete_success'),
|
||||||
showClose: true
|
showClose: true
|
||||||
})
|
})
|
||||||
// this.chartTree()
|
this.treeNode()
|
||||||
this.refreshNodeBy(data.sceneId)
|
|
||||||
// this.$router.push('/chart/home')
|
|
||||||
this.$emit('switchComponent', { name: '' })
|
this.$emit('switchComponent', { name: '' })
|
||||||
this.$store.dispatch('chart/setTable', null)
|
this.$store.dispatch('chart/setTable', null)
|
||||||
})
|
})
|
||||||
@ -589,7 +621,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
treeNode(group) {
|
treeNode(group) {
|
||||||
post('/chart/group/treeNode', group).then(res => {
|
queryAuthModel({ modelType: 'chart' }).then(res => {
|
||||||
this.tData = res.data
|
this.tData = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -609,9 +641,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
nodeClick(data, node) {
|
nodeClick(data, node) {
|
||||||
if (data.type !== 'group') {
|
if (data.modelInnerType !== 'group') {
|
||||||
this.$emit('switchComponent', { name: 'ChartEdit', param: data })
|
this.$emit('switchComponent', { name: 'ChartEdit', param: data })
|
||||||
}
|
}
|
||||||
|
if (node.expanded) {
|
||||||
|
this.expandedArray.push(data.id)
|
||||||
|
} else {
|
||||||
|
const index = this.expandedArray.indexOf(data.id)
|
||||||
|
if (index > -1) {
|
||||||
|
this.expandedArray.splice(index, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
back() {
|
back() {
|
||||||
@ -704,18 +744,18 @@ export default {
|
|||||||
view.customFilter = JSON.stringify([])
|
view.customFilter = JSON.stringify([])
|
||||||
view.drillFields = JSON.stringify([])
|
view.drillFields = JSON.stringify([])
|
||||||
view.extBubble = JSON.stringify([])
|
view.extBubble = JSON.stringify([])
|
||||||
|
const _this = this
|
||||||
post('/chart/view/save', view).then(response => {
|
post('/chart/view/save', view).then(response => {
|
||||||
this.closeCreateChart()
|
this.closeCreateChart()
|
||||||
this.$store.dispatch('chart/setTableId', null)
|
this.$store.dispatch('chart/setTableId', null)
|
||||||
this.$store.dispatch('chart/setTableId', this.table.id)
|
this.$store.dispatch('chart/setTableId', this.table.id)
|
||||||
// this.$router.push('/chart/chart-edit')
|
|
||||||
if (this.optFrom === 'panel') {
|
if (this.optFrom === 'panel') {
|
||||||
this.$emit('newViewInfo', { 'id': response.data.id })
|
this.$emit('newViewInfo', { 'id': response.data.id })
|
||||||
} else {
|
} else {
|
||||||
this.$emit('switchComponent', { name: 'ChartEdit', param: response.data })
|
_this.expandedArray.push(response.data.sceneId)
|
||||||
// this.$store.dispatch('chart/setViewId', response.data.id)
|
_this.$refs.chartTreeRef.setCurrentKey(response.data.id)
|
||||||
// this.chartTree()
|
_this.$emit('switchComponent', { name: 'ChartEdit', param: response.data })
|
||||||
this.refreshNodeBy(view.sceneId)
|
_this.treeNode()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -767,22 +807,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
refreshNodeBy(id) {
|
|
||||||
if (this.isTreeSearch) {
|
|
||||||
this.tData = []
|
|
||||||
this.expandedArray = []
|
|
||||||
this.searchTree(this.search)
|
|
||||||
} else {
|
|
||||||
if (!id || id === '0') {
|
|
||||||
this.treeNode(this.groupForm)
|
|
||||||
} else {
|
|
||||||
const node = this.$refs.asyncTree.getNode(id) // 通过节点id找到对应树节点对象
|
|
||||||
node.loaded = false
|
|
||||||
node.expand() // 主动调用展开节点方法,重新查询该节点下的所有子节点
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
moveTo(data) {
|
moveTo(data) {
|
||||||
this.moveGroup = true
|
this.moveGroup = true
|
||||||
this.moveDialogTitle = this.$t('dataset.m1') + (data.name.length > 10 ? (data.name.substr(0, 10) + '...') : data.name) + this.$t('dataset.m2')
|
this.moveDialogTitle = this.$t('dataset.m1') + (data.name.length > 10 ? (data.name.substr(0, 10) + '...') : data.name) + this.$t('dataset.m2')
|
||||||
@ -802,8 +826,7 @@ export default {
|
|||||||
this.groupForm.pid = this.tGroup.id
|
this.groupForm.pid = this.tGroup.id
|
||||||
post('/chart/group/save', this.groupForm).then(res => {
|
post('/chart/group/save', this.groupForm).then(res => {
|
||||||
this.closeMoveGroup()
|
this.closeMoveGroup()
|
||||||
// this.tree(this.groupForm)
|
this.treeNode()
|
||||||
this.refreshNodeBy(this.groupForm.pid)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
targetGroup(val) {
|
targetGroup(val) {
|
||||||
@ -827,17 +850,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
saveMoveDs() {
|
saveMoveDs() {
|
||||||
// if (this.tDs && this.tDs.type === 'group') {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
const oldSceneId = this.dsForm.sceneId
|
|
||||||
const newSceneId = this.tDs.id
|
const newSceneId = this.tDs.id
|
||||||
this.dsForm.sceneId = newSceneId
|
this.dsForm.sceneId = newSceneId
|
||||||
post('/chart/view/save', this.dsForm).then(res => {
|
post('/chart/view/save', this.dsForm).then(res => {
|
||||||
this.closeMoveDs()
|
this.closeMoveDs()
|
||||||
// this.tableTree()
|
this.expandedArray.push(newSceneId)
|
||||||
this.refreshNodeBy(oldSceneId)
|
this.treeNode()
|
||||||
this.refreshNodeBy(newSceneId)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
targetDs(val) {
|
targetDs(val) {
|
||||||
@ -849,72 +867,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
searchTree(val) {
|
|
||||||
const queryCondition = {
|
|
||||||
// withExtend: 'parent',
|
|
||||||
// modelType: 'chart',
|
|
||||||
name: val
|
|
||||||
}
|
|
||||||
// authModel(queryCondition).then(res => {
|
|
||||||
// // this.highlights(res.data)
|
|
||||||
// this.tData = this.buildTree(res.data)
|
|
||||||
// // console.log(this.tData)
|
|
||||||
// })
|
|
||||||
|
|
||||||
post('/chart/view/search', queryCondition).then(res => {
|
|
||||||
this.tData = this.buildTree(res.data)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
buildTree(arrs) {
|
|
||||||
const idMapping = arrs.reduce((acc, el, i) => {
|
|
||||||
acc[el[this.treeProps.id]] = i
|
|
||||||
return acc
|
|
||||||
}, {})
|
|
||||||
const roots = []
|
|
||||||
arrs.forEach(el => {
|
|
||||||
// 判断根节点 ###
|
|
||||||
// el.type = el.modelInnerType
|
|
||||||
// el.isLeaf = el.leaf
|
|
||||||
if (el[this.treeProps.parentId] === null || el[this.treeProps.parentId] === 0 || el[this.treeProps.parentId] === '0') {
|
|
||||||
roots.push(el)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 用映射表找到父元素
|
|
||||||
const parentEl = arrs[idMapping[el[this.treeProps.parentId]]]
|
|
||||||
// 把当前元素添加到父元素的`children`数组中
|
|
||||||
parentEl.children = [...(parentEl.children || []), el]
|
|
||||||
|
|
||||||
// 设置展开节点 如果没有子节点则不进行展开
|
|
||||||
if (parentEl.children.length > 0) {
|
|
||||||
this.expandedArray.push(parentEl[this.treeProps.id])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return roots
|
|
||||||
},
|
|
||||||
|
|
||||||
// 高亮显示搜索内容
|
|
||||||
highlights(data) {
|
|
||||||
if (data && this.search && this.search.length > 0) {
|
|
||||||
const replaceReg = new RegExp(this.search, 'g')// 匹配关键字正则
|
|
||||||
const replaceString = '<span style="color: #0a7be0">' + this.search + '</span>' // 高亮替换v-html值
|
|
||||||
data.forEach(item => {
|
|
||||||
item.name = item.name.replace(replaceReg, replaceString) // 开始替换
|
|
||||||
item.label = item.label.replace(replaceReg, replaceString) // 开始替换
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getTreeData(val) {
|
|
||||||
if (val) {
|
|
||||||
this.isTreeSearch = true
|
|
||||||
this.searchTree(val)
|
|
||||||
} else {
|
|
||||||
this.isTreeSearch = false
|
|
||||||
this.treeNode(this.groupForm)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getChartGroupTree() {
|
getChartGroupTree() {
|
||||||
chartGroupTree({}).then(res => {
|
chartGroupTree({}).then(res => {
|
||||||
this.chartGroupTreeAvailable = res.data
|
this.chartGroupTreeAvailable = res.data
|
||||||
@ -936,6 +888,27 @@ export default {
|
|||||||
if (this.createActive < 2) {
|
if (this.createActive < 2) {
|
||||||
this.createActive++
|
this.createActive++
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
filterNode(value, data) {
|
||||||
|
if (!value) return true
|
||||||
|
if (this.searchType === 'folder') {
|
||||||
|
if (data.modelInnerType === 'group' && data.label.indexOf(value) !== -1) {
|
||||||
|
this.searchPids.push(data.id)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (this.searchPids.indexOf(data.pid) !== -1) {
|
||||||
|
if (data.modelInnerType === 'group') {
|
||||||
|
this.searchPids.push(data.id)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return data.label.indexOf(value) !== -1
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
searchTypeClick(searchTypeInfo) {
|
||||||
|
this.searchType = searchTypeInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -950,7 +923,7 @@ export default {
|
|||||||
padding: 12px 0;
|
padding: 12px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-tree-container{
|
.custom-tree-container {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -960,7 +933,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding-right:8px;
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-tree-node-list {
|
.custom-tree-node-list {
|
||||||
@ -969,10 +942,10 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding:0 8px;
|
padding: 0 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-list>>>.el-tree-node__expand-icon.is-leaf{
|
.tree-list >>> .el-tree-node__expand-icon.is-leaf {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1004,63 +977,73 @@ export default {
|
|||||||
padding: 10px 20px 20px;
|
padding: 10px 20px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-item>>>.el-form-item__label{
|
.form-item >>> .el-form-item__label {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scene-title{
|
.scene-title {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.scene-title-name{
|
|
||||||
|
.scene-title-name {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.father .child {
|
.father .child {
|
||||||
/*display: none;*/
|
/*display: none;*/
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.father:hover .child {
|
.father:hover .child {
|
||||||
/*display: inline;*/
|
/*display: inline;*/
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-style {
|
.tree-style {
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
/deep/ .vue-treeselect__control{
|
|
||||||
|
/deep/ .vue-treeselect__control {
|
||||||
height: 28px;
|
height: 28px;
|
||||||
}
|
}
|
||||||
/deep/ .vue-treeselect__single-value{
|
|
||||||
color:#606266;
|
/deep/ .vue-treeselect__single-value {
|
||||||
line-height: 28px!important;
|
color: #606266;
|
||||||
|
line-height: 28px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.render-select>>>.el-input__suffix{
|
.render-select >>> .el-input__suffix {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
}
|
}
|
||||||
.render-select>>>.el-input__inner{
|
|
||||||
|
.render-select >>> .el-input__inner {
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
padding-left: 6px;
|
padding-left: 6px;
|
||||||
}
|
}
|
||||||
.dialog-css>>>.el-step__title{
|
|
||||||
|
.dialog-css >>> .el-step__title {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
.chart-icon{
|
|
||||||
|
.chart-icon {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
}
|
}
|
||||||
.chart-box{
|
|
||||||
box-sizing:border-box;
|
.chart-box {
|
||||||
-moz-box-sizing:border-box;
|
box-sizing: border-box;
|
||||||
-webkit-box-sizing:border-box;
|
-moz-box-sizing: border-box;
|
||||||
width:50%;
|
-webkit-box-sizing: border-box;
|
||||||
float:left;
|
width: 50%;
|
||||||
|
float: left;
|
||||||
height: 380px;
|
height: 380px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,6 @@
|
|||||||
<panel-main v-show="componentName==='PanelMain'" ref="panel_main" />
|
<panel-main v-show="componentName==='PanelMain'" ref="panel_main" />
|
||||||
<chart-edit v-if="componentName==='ChartEdit'" :param="param" />
|
<chart-edit v-if="componentName==='ChartEdit'" :param="param" />
|
||||||
<panel-edit v-if="componentName==='PanelEdit'" />
|
<panel-edit v-if="componentName==='PanelEdit'" />
|
||||||
<!-- <component :is="component" :param="param" />-->
|
|
||||||
</de-main-container>
|
</de-main-container>
|
||||||
</de-container>
|
</de-container>
|
||||||
</template>
|
</template>
|
||||||
@ -47,34 +46,11 @@ export default {
|
|||||||
this.param = c.param
|
this.param = c.param
|
||||||
this.componentName = c.name
|
this.componentName = c.name
|
||||||
this.$store.dispatch('panel/setMainActiveName', c.name)
|
this.$store.dispatch('panel/setMainActiveName', c.name)
|
||||||
// switch (c.name) {
|
|
||||||
// case 'PanelEdit':
|
|
||||||
// this.component = PanelEdit
|
|
||||||
// this.componentName = 'PanelEdit'
|
|
||||||
// break
|
|
||||||
// case 'ChartEdit':
|
|
||||||
// this.component = ChartEdit
|
|
||||||
// this.componentName = 'ChartEdit'
|
|
||||||
// break
|
|
||||||
// default:
|
|
||||||
// this.component = PanelMain
|
|
||||||
// this.componentName = 'PanelMain'
|
|
||||||
// break
|
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$store.dispatch('app/toggleSideBarHide', true)
|
this.$store.dispatch('app/toggleSideBarHide', true)
|
||||||
const routerParam = this.$router.currentRoute.params
|
const routerParam = this.$router.currentRoute.params
|
||||||
// if ((routerParam = this.$router.currentRoute.params) !== null && routerParam.msgNotification) {
|
|
||||||
// // 说明是从消息通知跳转过来的
|
|
||||||
// if (routerParam.msgType === 0) { // 是仪表板分享
|
|
||||||
// this.componentName = 'PanelMain'
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.$refs.panel_main.msg2Current(routerParam.sourceParam)
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
this.toMsgShare(routerParam)
|
this.toMsgShare(routerParam)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
Loading…
Reference in New Issue
Block a user