From 62d87ef3f2ca154763020279f4eb0113fce81903 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 09 九月 2024 10:30:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java |  359 ++++++--------
 /dev/null                                                                                                                            |  728 ------------------------------
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java                            |   14 
 Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js                                                                 |    8 
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue                                          |   64 +-
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue                                     |   41 -
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java                                |   43 -
 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/RoleRightParamDTO.java                                           |   34 +
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java                                |    2 
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java                 |   27 
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java                             |   45 +
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue                                      |   69 +-
 12 files changed, 372 insertions(+), 1,062 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/RoleRightParamDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/RoleRightParamDTO.java
new file mode 100644
index 0000000..3e78a67
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/RoleRightParamDTO.java
@@ -0,0 +1,34 @@
+package com.vci.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 淇濆瓨鏉冮檺浼犺緭瀵硅薄
+ * @author yuxc
+ * @date 2024-09-06
+ */
+@Data
+public class RoleRightParamDTO implements Serializable {
+
+
+    /**
+     * 绂佹淇敼杩欎釜鍊�
+     */
+    private static final long serialVersionUID = 2492852474710986720L;
+    /**
+     * 鐖惰妭鐐圭殑涓婚敭
+     */
+    public String parentId;
+    /**
+     * 涓婚敭
+     */
+    public String id;
+    /**
+     * 褰撳墠鑺傜偣鐨勭被鍨� 1琛ㄧず妯″潡锛�2琛ㄧず鎿嶄綔
+     */
+    public int type;
+
+    public long number;
+}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java
index 9f04b2f..89cc712 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java
@@ -2,14 +2,13 @@
 
 import com.vci.common.exception.VciException;
 import com.vci.corba.common.PLException;
+import com.vci.dto.RoleRightDTO;
+import com.vci.dto.RoleRightParamDTO;
 import com.vci.frameworkcore.enumpck.ResourceControlTypeEnum;
 import com.vci.pagemodel.MenuVO;
 import com.vci.pagemodel.SmFunctionVO;
 import com.vci.starter.web.exception.VciBaseException;
-import com.vci.starter.web.pagemodel.DataGrid;
-import com.vci.starter.web.pagemodel.PageHelper;
-import com.vci.starter.web.pagemodel.Tree;
-import com.vci.starter.web.pagemodel.TreeQueryObject;
+import com.vci.starter.web.pagemodel.*;
 import com.vci.pagemodel.UIContentVO;
 import com.vci.web.service.OsBaseServiceI;
 
@@ -64,13 +63,11 @@
     List<MenuVO> getSysModelTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException;
     /**
      * 閫氳繃妯″潡ID鑾峰彇瀛愮骇鍒楄〃
-     * @param parentId
-     * @param modeType 妯″潡绫诲瀷
      * @param isAll 鏄惁鍖呮嫭鏃犳晥鐨勬ā鍧楋紝true鍒欏寘鎷�
      * @return
      * @throws VciBaseException
      */
-    List<MenuVO> getSysModelAuthTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException, PLException;
+    List<MenuVO> getSysModelAuthTreeMenuByPID(boolean isAll) throws VciBaseException, PLException;
 
     int checkChildObject(String moduleId) throws VciException;
 
@@ -163,4 +160,20 @@
     DataGrid<SmFunctionVO> gridFunctionByRoleOids(Collection<String> roleOidCollection, Map<String, String> queryMap, PageHelper pageHelper, ResourceControlTypeEnum resourceControlTypeEnum);
 
     UIContentVO getUIContentByBtmTypeAndId(TreeQueryObject treeQueryObject, ResourceControlTypeEnum bs) throws PLException;
+    /**
+     * 鑾峰彇鎺堟潈鐨勬ā鍧�
+     * @param roleId 瑙掕壊涓婚敭
+     * @return 鎵�鍏锋湁鏉冮檺鐨勪富閿�
+     * @throws PLException
+     */
+    List<String> getSysModelAuth(String roleId) throws PLException;
+
+    /**
+     * 淇濆瓨鎺堟潈鐨勬ā鍧�
+     * @param roleRightDTOS 鐢ㄦ埛閫夋嫨鎺堟潈妯″潡淇℃伅
+     * @param roleId 瑙掕壊涓婚敭
+     * @return 鎺堟潈缁撴灉
+     * @throws PLException
+     */
+    BaseResult saveRoleRight(List<RoleRightParamDTO> roleRightDTOS, String roleId) throws PLException;
 }
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
index daa7f5c..a420aad 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
@@ -8,11 +8,15 @@
 import com.vci.common.exception.VciException;
 import com.vci.common.locale.LocaleDisplay;
 import com.vci.corba.common.PLException;
+import com.vci.corba.common.data.UserEntityInfo;
 import com.vci.corba.framework.data.*;
 import com.vci.corba.omd.data.BusinessObject;
 import com.vci.corba.portal.data.PLUILayout;
+import com.vci.dto.RoleRightDTO;
+import com.vci.dto.RoleRightParamDTO;
 import com.vci.frameworkcore.compatibility.ISmFunctionQueryService;
 import com.vci.frameworkcore.enumpck.ResourceControlTypeEnum;
+import com.vci.model.RoleRightDO;
 import com.vci.model.SmFunctionForPlatform1;
 import com.vci.model.SmRoleForPlatform1;
 import com.vci.pagemodel.MenuVO;
@@ -567,6 +571,163 @@
     }
 
     /**
+     * 鑾峰彇鎺堟潈鐨勬ā鍧�
+     * @param roleId 瑙掕壊涓婚敭
+     * @return 鎵�鍏锋湁鏉冮檺鐨勪富閿�
+     * @throws PLException
+     */
+    @Override
+    public List<String> getSysModelAuth(String roleId) throws PLException {
+
+        RoleRightInfo[] roleRightList = platformClientUtil.getFrameworkService().getRoleRightList(roleId, WebUtil.getCurrentUserId());
+        Map<String, Long> authMap = Arrays.stream(roleRightList).collect(Collectors.toMap(e -> e.funcId, e -> e.rightValue));
+        String parentId;
+        SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException();
+        boolean adminOrDeveloperOrRoot = rightControlUtil.isAdminOrDeveloperOrRoot(sessionInfo.getUserId());
+        if (adminOrDeveloperOrRoot) {
+            //绯荤粺鑿滃崟
+            parentId = SYSTEMMANAGMENTNODE;
+        } else if (rightControlUtil.isThreeAdminCurUser()) {
+            //涓夊憳杩斿洖绠$悊鍔熻兘妯″潡鐩稿叧鐨勮彍鍗�
+            parentId = SYSTEMMANAGMENTNODE;
+        } else {
+            //鏅�氱敤鎴峰彧杩斿洖涓氬姟鍔熻兘妯″潡鐩稿叧鐨勮彍鍗�
+            parentId = ROOT_MENU_ID;
+        }
+        FunctionInfo[] moduleListByParentId = getModuleListByParentId(parentId, false);
+        List<String> authList = new ArrayList<>();
+        for (FunctionInfo functionInfo : moduleListByParentId) {
+            if(authMap.containsKey(functionInfo.id)){
+                authList.add(functionInfo.id);
+                getChildAuthNode(functionInfo, authMap, authList);
+            }
+        }
+        return authList;
+    }
+
+    public BaseResult saveRoleRight(List<RoleRightParamDTO> roleRightDTOS, String roleId) throws PLException {
+        /**
+         * 瀛樺偍闇�瑕佷繚瀛樼殑鏉冮檺
+         */
+        Map<String,RoleRightInfo> rightMap = new HashMap<String,RoleRightInfo>();
+
+        Map<String, List<RoleRightParamDTO>> parentMap = roleRightDTOS.stream().collect(Collectors.groupingBy(e -> e.parentId));
+
+        for (RoleRightParamDTO dto : roleRightDTOS) {
+            RoleRightInfo obj = null;
+            //鍒ゆ柇绫诲瀷
+            if(dto.getType() == 1 && !dto.getParentId().equals(ROOT_MENU_ID)
+                    && !dto.getParentId().equals(SYSTEMMANAGMENTNODE)
+                    && !dto.getParentId().equals(OPERATENODE)){
+                if(!rightMap.containsKey(dto.getParentId())){
+                    obj = new RoleRightInfo();
+                    obj.funcId = dto.getParentId();
+                    obj.rightType = (short)1;
+                    obj.rightValue = 1;//娌℃湁鎿嶄綔鐨勬ā鍧楁潈闄愬�煎瓨鍌ㄤ负0
+                    obj.roleId = roleId;
+                    obj.createUser = WebUtil.getCurrentUserId();
+                    obj.createTime = new Date().getTime();
+                    obj.modifyUser = WebUtil.getCurrentUserId();
+                    obj.modifyTime = new Date().getTime();
+                    obj.licensor = "";
+                }else{
+                    obj = rightMap.get(dto.getParentId());
+                    if (obj == null) {
+                        obj = new RoleRightInfo();
+                        obj.funcId = dto.getParentId();
+                        obj.rightType = (short)1;
+                        obj.rightValue = 1;//娌℃湁鎿嶄綔鐨勬ā鍧楁潈闄愬�煎瓨鍌ㄤ负0
+                        obj.roleId = roleId;
+                        obj.createUser = WebUtil.getCurrentUserId();
+                        obj.createTime = new Date().getTime();
+                        obj.modifyUser = WebUtil.getCurrentUserId();
+                        obj.modifyTime = new Date().getTime();
+                        obj.licensor = "";
+                    }else {
+                        obj.rightValue = 1;
+                    }
+                }
+                rightMap.put(dto.getParentId(), obj);
+            }else if (dto.getType() == 2){
+//                RoleRightInfo roleRightObj = new RoleRightInfo();
+                if(!rightMap.containsKey(dto.getParentId())) {
+                    obj = new RoleRightInfo();
+                    obj.funcId = dto.getParentId();
+                    obj.rightType = (short)1;
+                    obj.rightValue = countRightValue(parentMap.get(dto.getParentId()));//娌℃湁鎿嶄綔鐨勬ā鍧楁潈闄愬�煎瓨鍌ㄤ负0
+                    obj.roleId = roleId;
+                    obj.createUser = WebUtil.getCurrentUserId();
+                    obj.createTime = new Date().getTime();
+                    obj.modifyUser = WebUtil.getCurrentUserId();
+                    obj.modifyTime = new Date().getTime();
+                    obj.licensor = "";
+                    rightMap.put(dto.getParentId(), obj);
+                }
+
+            }
+        }
+        /**涓婇潰澶勭悊瀹屾垚鍚庯紝寰幆閬嶅巻鍙栧嚭MAP閲岀殑瀵硅薄杩涜淇濆瓨**/
+        RoleRightInfo[] roleRightObjs =	new RoleRightInfo[rightMap.size()];
+        Set<String> objSet = rightMap.keySet();
+        Iterator<String> it = objSet.iterator();
+        int i = 0;
+        while(it.hasNext()){
+            roleRightObjs[i++] = rightMap.get(it.next());
+        }
+        UserEntityInfo userEntityInfo = new UserEntityInfo();
+        userEntityInfo.setModules("com.vci.client.framework.rightdistribution.roleRight.RoleRightPanel");
+        userEntityInfo.setUserName(WebUtil.getCurrentUserId());
+        boolean res =  platformClientUtil.getFrameworkService()
+                .saveRoleRight(roleRightObjs,roleId,WebUtil.getCurrentUserId(), userEntityInfo);
+        if(!res){
+            throw new PLException("500", new String[]{"鍔熻兘妯″潡鎺堟潈澶辫触锛�"});
+        }
+        return BaseResult.success();
+    }
+
+    private long countRightValue(List<RoleRightParamDTO> dtos){
+        long value = 0;
+        for (RoleRightParamDTO dto : dtos) {
+            value += (long)Math.pow(2, dto.getNumber());//绱鍔犱笂鍚勪釜鎿嶄綔鐨勬潈闄愬��
+        }
+        return value;
+    }
+
+    /**
+     *
+     * @param funcObj 妯″潡瀵硅薄
+     * @param authMap 璇ヨ鑹蹭笅鎵�鏈夌殑鏉冮檺鏁版嵁
+     * @param authList 璇ヨ鑹蹭笅鎵�鍏锋湁鐨勬潈闄�
+     * @throws PLException
+     */
+    private void getChildAuthNode(FunctionInfo funcObj, Map<String, Long> authMap, List<String> authList) throws PLException {
+        /**0琛ㄧず璇ユā鍧椾笅浠�涔堥兘娌℃湁锛�1琛ㄧず鏈夋ā鍧楋紝2琛ㄧず鏈夋搷浣�**/
+        long funcType = platformClientUtil.getFrameworkService().checkChildObject(funcObj.id);
+        if(funcType == 1){
+            FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(funcObj.id, false);
+            for(int i=0;i<funcInfos.length;i++){
+                if(authMap.containsKey(funcInfos[i].id)){
+                    authList.add(funcInfos[i].id);
+                    getChildAuthNode(funcInfos[i], authMap, authList);
+                }
+            }
+        }else if(funcType == 2){
+            FuncOperationInfo[] funcOperates = platformClientUtil.getFrameworkService().getFuncOperationByModule(funcObj.id, "", true);
+            for (int j = 0; j < funcOperates.length; j++) {
+                if(authMap.containsKey(funcOperates[j].funcId)){
+                    long rightValue = authMap.get(funcOperates[j].funcId);
+                    long nodeValue = funcOperates[j].number;
+                    long preValue = (rightValue >> nodeValue) & 1;
+                    //杩涜浣嶄笌鎿嶄綔锛屽鏋滅浉绛夊垯琛ㄧず鍏锋湁褰撳墠鎿嶄綔鐨勬潈闄�
+                    if (preValue == 1) {
+                        authList.add(funcOperates[j].id);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
      * 鑾峰彇鎵�鏈夌殑鍔熻兘鑿滃崟
      *
      * @param treeQueryObject     鏍戞煡璇㈠璞�
@@ -903,20 +1064,15 @@
 
     /**
      * 閫氳繃妯″潡ID鑾峰彇瀛愮骇鍒楄〃
-     * @param parentId
-     * @param modeType 妯″潡绫诲瀷
      * @param isAll 鏄惁鍖呮嫭鏃犳晥鐨勬ā鍧楋紝true鍒欏寘鎷�
      * @return
      * @throws VciBaseException
      */
     @Override
-    public List<MenuVO> getSysModelAuthTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException, PLException {
-        List<MenuVO> menuVOList = new ArrayList<>();
-//        if(Func.isBlank(parentId)){
-//            return menuVOList;
-//        }
+    public List<MenuVO> getSysModelAuthTreeMenuByPID(boolean isAll) throws VciBaseException, PLException {
         SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException();
         boolean adminOrDeveloperOrRoot = rightControlUtil.isAdminOrDeveloperOrRoot(sessionInfo.getUserId());
+        String parentId;
         if (adminOrDeveloperOrRoot) {
             //绯荤粺鑿滃崟
             parentId = SYSTEMMANAGMENTNODE;
@@ -928,7 +1084,7 @@
             parentId = ROOT_MENU_ID;
         }
         List<MenuVO> functionVOList = new ArrayList<>();
-        FunctionInfo[] moduleListByParentId = getModuleListByParentId(parentId, false);
+        FunctionInfo[] moduleListByParentId = getModuleListByParentId(parentId, isAll);
         for (FunctionInfo menu : moduleListByParentId) {
             if(!menu.isValid){
                 continue;
@@ -944,14 +1100,6 @@
             functionVO.getMeta().put("keepAlive",false);
             functionVO.setSort((int) menu.seq);
             findChildAuthFunctionVO(functionVO, isAll);
-//            try {
-//                functionVO.setChildren(findChildAuthFunctionVO(menu.id));
-//            } catch (PLException e) {
-//                e.printStackTrace();
-//                String errorMsg = "鑿滃崟鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
-//                logger.error(errorMsg);
-//                throw new VciBaseException(errorMsg);
-//            }
             if(functionVO.getChildren().size() > 0){
                 functionVO.setHasChildren(true);
             }else {
@@ -960,185 +1108,6 @@
             functionVOList.add(functionVO);
         }
         return functionVOList;
-
-
-
-//        RoleRightInfo[] userRoleRights = rightControlUtil.getRoleRightByUserName(sessionInfo.getUserId());
-//        Map<String, List<FunctionInfo>> map = rightControlUtil.getAllChildrenFunctionsByUserName(
-//                parentId, sessionInfo.getUserId(), userRoleRights);
-//
-//        if(Func.isEmpty(map.get(parentId))) {
-//            return functionVOList;
-//        }
-//        for (FunctionInfo menu : map.get(parentId)) {
-//            if(!menu.isValid){
-//                continue;
-//            }
-//            MenuVO functionVO = new MenuVO();
-//            functionVO.setId(menu.id);
-//            functionVO.setSource(menu.image);
-//            //if(StringUtils.isBlank(menu.resourceB)){
-//            //    continue;
-//            //}
-//            functionVO.setPath(menu.resourceB);
-//            functionVO.setParentId(menu.parentId);
-//            functionVO.setCode(menu.aliasName);
-//            functionVO.setAlias(menu.aliasName);
-//            functionVO.setName(menu.name);
-//            functionVO.getMeta().put("keepAlive",false);
-//            functionVO.setSort((int) menu.seq);
-////            try {
-////                functionVO.setChildren(findChildAuthFunctionVO(menu.id, map));
-////            } catch (PLException e) {
-////                e.printStackTrace();
-////                String errorMsg = "鑿滃崟鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
-////                logger.error(errorMsg);
-////                throw new VciBaseException(errorMsg);
-////            }
-//            if(functionVO.getChildren().size() > 0){
-//                functionVO.setHasChildren(true);
-//            }else {
-//                functionVO.setHasChildren(false);
-//            }
-//            functionVOList.add(functionVO);
-//        }
-//        //濡傛灉鏄紑鍙戞垨鑰呮祴璇曠敤鎴凤紝闇�鍝熻幏鍙栫郴缁熸ā鍧楅厤缃彍鍗�
-//        if(adminOrDeveloperOrRoot){
-//            //鑾峰彇棣栭〉绯荤粺妯″潡閰嶇疆鑿滃崟
-//            MenuVO menuVO = JsonConfigReader.getSysModuleConf().getSysModuleNode();
-//            if(Func.isNotEmpty(menuVO)){
-//                functionVOList.add(menuVO);
-//            }
-//        }
-//        return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
-
-
-
-
-
-//
-//
-//
-//
-//        boolean isFunctionObject = Func.isNotBlank(modeType) && modeType.equalsIgnoreCase("FunctionObject");
-//        if(parentId.equals("systemManagmentNode") || parentId.equals("modelManagmentNode") || isFunctionObject){
-//            int childType = this.checkChildObject(parentId);
-//            if(isFunctionObject){
-//                try {
-//                    /**鍒ゆ柇璇ユā鍧椾笅瀛愬璞℃槸妯″潡杩樻槸鎿嶄綔锛�0琛ㄧず鏃犲瓙鑺傜偣锛�1琛ㄧず鏄ā鍧楋紝2琛ㄧず鏄搷浣�**/
-//                    if(childType == 2){
-//                        try{
-//                            FuncOperationInfo[] infos = platformClientUtil.getFrameworkService().getFuncOperationByModule(parentId, "", false);
-//                            if(Func.isNotEmpty(infos.length)){
-//                                childType = this.checkChildObject(infos[0].id); //閮芥槸鍚屼竴灞傛墍浠ュ彇绗竴涓嵆鍙煡璇㈡槸浠�涔堢被鍨�
-//                                for(int i = 0;i < infos.length ;i++){
-//                                    FuncOperationInfo info = infos[i];
-//                                    MenuVO menuVO = new MenuVO();
-//                                    menuVO.setChildType(childType);
-//                                    menuVO.setId(info.id);
-//                                    menuVO.setFuncId(info.funcId);
-//                                    menuVO.setCode(info.operIndentify);
-//                                    menuVO.setOperId(info.operId);
-//                                    menuVO.setName(info.operName);
-//                                    menuVO.setAlias(info.operAlias);
-//                                    menuVO.setRemark(info.operDesc);
-//                                    menuVO.setSort((int) info.number);
-//                                    menuVO.setModeType("FunctionObject");
-//                                    menuVO.setIsValid(info.isValid);
-//                                    menuVO.setHasChildren(false);
-//                                    menuVOList.add(menuVO);
-//                                }
-//                            }
-//                        }catch (PLException e) {
-//                            e.printStackTrace();
-//                            throw new VciBaseException(String.valueOf(e.code), e.messages);
-//                        }
-//                    }else if(childType == 1){
-//                        try{
-//                            FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll);
-//                            if(Func.isNotEmpty(funcInfos.length)){
-//                                childType = this.checkChildObject(funcInfos[0].id); //閮芥槸鍚屼竴灞傛墍浠ュ彇绗竴涓嵆鍙煡璇㈡槸浠�涔堢被鍨�
-//                                for(int i = 0;i < funcInfos.length; i++){
-//                                    FunctionInfo funcInfo = funcInfos[i];
-//                                    MenuVO menuVO = this.functionInfoToMenuVO(funcInfo);
-//                                    menuVO.setChildType(childType);
-//                                    menuVO.setModeType("FunctionObject");
-//                                    menuVOList.add(menuVO);
-//                                }
-//                            }
-//                        }catch (PLException e) {
-//                            e.printStackTrace();
-//                            throw new VciBaseException(String.valueOf(e.code),e.messages);
-//                        }
-//                    }
-//                } catch (Exception e) {
-//                    e.printStackTrace();
-//                    throw new VciBaseException("妯″潡鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+VciBaseUtil.getExceptionMessage(e));
-//                }
-//            }else{
-//                try{
-//                    MenuVO parentNode = null;
-//                    //灏嗚繑鍥炵殑鑺傜偣澶栧眰濂椾笂褰撳墠鐖惰妭鐐�
-//                    if("systemManagmentNode".equals(parentId)){
-//                        parentNode = JsonConfigReader.getSysModuleConf().getSystemManagmentNode();
-//                    }else if("modelManagmentNode".equals(parentId)){
-//                        parentNode = JsonConfigReader.getSysModuleConf().getModelManagmentNode();
-//                    }
-//                    //濡傛灉鏌ヨ鐨勬槸绗竴灞傝妭鐐瑰氨闇�瑕佺洿鎺ヨ繑鍥瀞ystemManagmentNode鎴杕odelManagmentNode鑺傜偣
-//                    if(Func.isNotBlank(modeType) && modeType.equals("firstNode")){
-//                        menuVOList.add(parentNode);
-//                        return menuVOList;
-//                    }
-//                    //鏌ヨ鐨勪笁绾ц妭鐐�
-//                    FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll);
-//                    for(int i = 0;i < funcInfos.length; i++){
-//                        FunctionInfo funcInfo = funcInfos[i];
-//                        MenuVO menuVO = this.functionInfoToMenuVO(funcInfo);
-//                        menuVO.setModeType("FunctionObject");
-//                        menuVO.setChildType(childType);
-//                        menuVOList.add(menuVO);
-//                    }
-//                    return menuVOList;
-//                }catch (PLException e) {
-//                    e.printStackTrace();
-//                    throw new VciBaseException(String.valueOf(e.code),e.messages);
-//                }
-//            }
-//        }
-//        else if(parentId.equals("operateNode")){
-//            //鍔犺浇鎵�鏈夋搷浣�
-//            try{
-//                //灏嗚繑鍥炵殑鑺傜偣澶栧眰濂椾笂褰撳墠鐖惰妭鐐�
-//                MenuVO parentNode = JsonConfigReader.getSysModuleConf().getOperateNode();
-//                //濡傛灉鏌ヨ鐨勬槸绗竴灞傝妭鐐瑰氨闇�瑕佺洿鎺ヨ繑鍥瀞ysOptionNode鑺傜偣
-//                if(Func.isNotBlank(modeType) && modeType.equals("firstNode")){
-//                    menuVOList.add(parentNode);
-//                    return menuVOList;
-//                }
-//                OperateInfo[] operateInfos = platformClientUtil.getFrameworkService().getOperateTreeList(parentId);
-//                for(int i = 0; i < operateInfos.length;i++ ){
-//                    OperateInfo operateInfo = operateInfos[i];
-//                    MenuVO menuVO = new MenuVO();
-//                    menuVO.setId(operateInfo.id);
-//                    menuVO.setName(operateInfo.name);
-//                    menuVO.setCode(operateInfo.identify);
-//                    menuVO.setAlias(operateInfo.alias);
-//                    menuVO.setCategory(2);
-//                    menuVO.setChildType(0);
-//                    menuVO.setRemark(operateInfo.desc);
-//                    menuVO.getMeta().put("keepAlive",false);
-//                    menuVO.setSort((int) operateInfo.seq);
-//                    menuVO.setModeType("operateObject");
-//                    menuVO.setHasChildren(false);
-//                    menuVOList.add(menuVO);
-//                }
-//            }catch (PLException e) {
-//                e.printStackTrace();
-//                throw new VciBaseException(String.valueOf(e.code),new String[]{VciBaseUtil.getExceptionMessage(e)});
-//            }
-//        }
-//        return null;
-//        return menuVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
     }
 
 
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java
index 8f42517..858f465 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java
@@ -1,8 +1,11 @@
 package com.vci.web.controller;
 
 import com.vci.constant.FrameWorkLangCodeConstant;
+import com.vci.corba.common.PLException;
 import com.vci.corba.framework.data.FuncOperationInfo;
 import com.vci.corba.framework.data.OperateInfo;
+import com.vci.dto.RoleRightDTO;
+import com.vci.dto.RoleRightParamDTO;
 import com.vci.frameworkcore.compatibility.ISmFunctionQueryService;
 import com.vci.frameworkcore.compatibility.SmHMSysModConfigServiceI;
 import com.vci.pagemodel.AppConfigDetailInfoVO;
@@ -75,14 +78,12 @@
 
     /**
      * 鑾峰彇褰撳墠妯″潡涓嬬殑瀛愭ā鍧�
-     * @param parentId
-     * @param modeType
      * @return
      */
     @GetMapping("/getSysModelAuthTreeMenuByPID")
-    public BaseResult<List<MenuVO>> getSysModelAuthTreeMenuByPID(String parentId, String modeType) {
+    public BaseResult<List<MenuVO>> getSysModelAuthTreeMenuByPID() {
         try {
-            return BaseResult.dataList(functionQueryService.getSysModelAuthTreeMenuByPID(parentId,modeType,true));
+            return BaseResult.dataList(functionQueryService.getSysModelAuthTreeMenuByPID(false));
         }catch (Exception e){
             e.printStackTrace();
             String errorMsg = "鏌ヨ瀛愭ā鍧楁椂鍑虹幇閿欒锛屽師鍥狅細"+ VciBaseUtil.getExceptionMessage(e);
@@ -92,6 +93,42 @@
     }
 
     /**
+     * 鑾峰彇鎵�鎺堟潈鐨勬ā鍧楁潈闄�
+     * @param roleId 瑙掕壊
+     * @return
+     */
+    @GetMapping("/getSysModelAuth")
+    public BaseResult<List<String>> getSysModelAuth(String roleId) {
+        try {
+            return BaseResult.dataList(functionQueryService.getSysModelAuth(roleId));
+        }catch (Exception e){
+            e.printStackTrace();
+            String errorMsg = "鏌ヨ瀛愭ā鍧楁椂鍑虹幇閿欒锛屽師鍥狅細"+ VciBaseUtil.getExceptionMessage(e);
+            logger.error(errorMsg);
+            throw new VciBaseException(errorMsg);
+        }
+    }
+
+    /**
+     * 淇濆瓨鎺堟潈鐨勬ā鍧�
+     * @param roleRightDTOS 鐢ㄦ埛閫夋嫨鎺堟潈妯″潡淇℃伅
+     * @param roleId 瑙掕壊涓婚敭
+     * @return 鎺堟潈缁撴灉
+     * @throws PLException
+     */
+    @PostMapping("/saveRoleRight")
+    public BaseResult<List<String>> saveRoleRight(@RequestBody List<RoleRightParamDTO> roleRightDTOS, String roleId) {
+        try {
+            return functionQueryService.saveRoleRight(roleRightDTOS, roleId);
+        }catch (Exception e){
+            e.printStackTrace();
+            String errorMsg = "淇濆瓨妯″潡鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e);
+            logger.error(errorMsg);
+            throw new VciBaseException(errorMsg);
+        }
+    }
+
+    /**
      * 娣诲姞妯″潡
      * @param menuVO
      * @return
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java
index e00dd3b..84971f3 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java
@@ -1,18 +1,12 @@
 package com.vci.web.controller;
 
-import cn.hutool.core.io.FileUtil;
 import com.vci.corba.common.PLException;
 import com.vci.corba.omd.qtm.QTD;
 import com.vci.dto.QTInfoDTO;
-import com.vci.pagemodel.QtQueryVO;
 import com.vci.starter.web.exception.VciBaseException;
 import com.vci.starter.web.pagemodel.BaseResult;
-import com.vci.starter.web.util.ControllerUtil;
-import com.vci.starter.web.util.LocalFileUtil;
 import com.vci.starter.web.util.VciBaseUtil;
 import com.vci.web.service.OsQuereyTemplateServiceI;
-import com.vci.web.util.Func;
-import org.apache.commons.lang3.StringUtils;
 import org.dom4j.DocumentException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -23,7 +17,9 @@
 import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.IOException;
-import java.util.*;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 鏌ヨ妯℃澘鐨勬帶鍒跺櫒
@@ -269,8 +265,8 @@
      * @return
      */
     @PostMapping("/expLinkTemplate")
-    public void expLinkTemplate(@RequestBody List<String> names,HttpServletResponse response) throws PLException, IOException {
-        quereyTemplateServiceI.expLinkTemplate(names, response);
+    public void expLinkTemplate(@RequestBody Map qtNames, HttpServletResponse response) throws PLException, IOException {
+        quereyTemplateServiceI.expLinkTemplate(String.valueOf(qtNames.get("qtNames")), response);
     }
 
     /**
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java
index 02c1327..e3fa3dc 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java
@@ -93,7 +93,7 @@
      * names 鏌ヨ妯℃澘鍚�
      * @return
      */
-    void expLinkTemplate(List<String> names, HttpServletResponse response) throws PLException, IOException ;
+    void expLinkTemplate(String names, HttpServletResponse response) throws PLException, IOException ;
     /**
      * 瀵煎叆閾炬帴绫诲瀷鏌ヨ妯℃澘
      * @param file 涓婁紶鐨勬枃浠�
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java
index 8f2a7fa..b9a7ab8 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java
@@ -265,6 +265,9 @@
                 if(column.contains(".")){
                     column = StringUtils.substringAfterLast(column, ".");
                 }
+                if(column.contains(" ")){
+                    column = StringUtils.substringBefore(column, " ");
+                }
                 AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(column);
                 if(att == null || "".equals(att.oid)){
                     att = allSysAttr.get(column.toLowerCase());
@@ -321,6 +324,7 @@
                 HashMap<String, String> data = new HashMap<>();
                 data.put("column",child.getText().trim());
                 data.put("type",att.vtDataType);
+                childList.add(data);
             }
         }
         treeMap.put("child",childList);
@@ -998,34 +1002,6 @@
         return qt;
     }
 
-//    /**
-//     * 缁勮鏌ヨ妯℃澘
-//     * @return
-//     */
-//    public QueryTemplate getQT(HashMap<String,Object> dataMap){
-//        QueryTemplate qt = new QueryTemplate();
-//        qt.setType(QTConstants.TYPE_LINK);
-//        //TODO String qtId =
-//        qt.setLinkType((String) dataMap.get("linkTypeName"));
-//        qt.setDirection( (Boolean)dataMap.get("rdPositive") ? QTConstants.DIRECTION_POSITIVE : QTConstants.DIRECTION_OPPOSITE);
-//        qt.setBtmType((String) dataMap.get("btmName"));
-//        if("鎵�鏈夌被鍨�".equals(dataMap.get("combRelaType"))){
-//            qt.setBtmType("*");
-//        }
-//        qt.setVersion(getVersion((String) dataMap.get("versionValue")));
-//        qt.setQueryISLeaf((Boolean) dataMap.get("isQueryIsLeaf"));
-//        qt.setLevel(StringUtils.isBlank((CharSequence) dataMap.get("level")) ? 1 : Integer.valueOf(String.valueOf(dataMap.get("level"))));
-//        List<String> clauseList = new ArrayList<String>();
-//        //TODO 鏌ヨ鍒� 鏄剧ず鍒�
-//        clauseList.add("*");
-//        qt.setClauseList(clauseList);
-//        Condition con = new Condition();
-//        qt.setCondition(con);
-//        HashMap<String, ConditionItem> ciMap = getCIMap();
-//        con.setCIMap(ciMap);
-//        con.setRootCIName(con.getRootCINameByCIMap(ciMap));
-//        return qt;
-//    }
 
     /**
      * 杩斿洖鏌ヨ鐨勭増鏈�
@@ -1074,11 +1050,12 @@
      * @return
      */
     @Override
-    public void expLinkTemplate(List<String> names, HttpServletResponse response) throws PLException, IOException {
+    public void expLinkTemplate(String names, HttpServletResponse response) throws PLException, IOException {
         String defaultTempFolder = LocalFileUtil.getDefaultTempFolder();
         String vciqtmfFileName = defaultTempFolder + File.separator + "LinkTemplateExp" + new Date().getTime() + ".vciqtf";
         LinkQTExportData exportData = new LinkQTExportData();
-        for (String name : names) {
+        String[] splits = names.split(",");
+        for (String name : splits) {
             QTInfo qt = platformClientUtil.getQTDService().getQT(name);
             exportData.getAllQTs().put(qt.qtName,qt);
             LinkType linkType = platformClientUtil.getLinkTypeService().getLinkType(qt.btmName);
@@ -1703,12 +1680,14 @@
                 if(direction != null) {
                     if (direction.equals(QTConstants.DIRECTION_POSITIVE)) {
                         if(att == null ){
-                            throw new PLException("500",new String[]{"灞炴�у瓧娈�:"+ abName +"鏈煡璇㈠埌锛岃纭锛�"});
+                            continue;
+//                            throw new PLException("500",new String[]{"灞炴�у瓧娈�:"+ abName +"鏈煡璇㈠埌锛岃纭锛�"});
                         }
                         att.name = "T_OID." + abName;
                     } else if (direction.equals(QTConstants.DIRECTION_OPPOSITE)) {
                         if(att == null ){
-                            throw new PLException("500",new String[]{"灞炴�у瓧娈�:"+ abName +"鏈煡璇㈠埌锛岃纭锛�"});
+                            continue;
+//                            throw new PLException("500",new String[]{"灞炴�у瓧娈�:"+ abName +"鏈煡璇㈠埌锛岃纭锛�"});
                         }
                         att.name = "F_OID." + abName;
                     }
diff --git a/Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js b/Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js
index 852c6bd..80d1bb2 100644
--- a/Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js
+++ b/Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js
@@ -1,9 +1,9 @@
 import request from '@/router/axios';
 //涓氬姟绫诲瀷鏌ヨ妯℃澘
 // 鍒涘缓
-export function linkSave(params) {
+export function btmSave(params) {
   return request({
-    url: "/api/templateController/linkSave",
+    url: "/api/templateController/btmSave",
     method: "post",
     data:params
   });
@@ -17,9 +17,9 @@
   });
 }
 // 鏌ヨ鏉′欢鐨勬煡璇㈡帴鍙o紝鎺ュ彛鏂瑰紡POST锛屽弬鏁颁笌淇濆瓨鎺ュ彛浼犲弬涓�鑷�
-export function getCriteria(params) {
+export function getCriteriaBtm(params) {
   return request({
-    url: "/api/templateController/getCriteria",
+    url: "/api/templateController/getCriteriaBtm",
     method: "post",
     data:params
   });
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
index e11d0a9..f30d66c 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
@@ -60,6 +60,7 @@
                                :queryCondition="queryCondition"
                                :queryTree="queryTree"
                                :levelFlag.sync="form.levelFlag"
+                               @queryHandler="queryHandler"
             ></form-query-dialog>
           </fieldset>
         </el-main>
@@ -73,10 +74,10 @@
 </template>
 
 <script>
-import {linkSave,getBizTypeQTDs} from "@/api/queryTemplate/businessTypeQuery";
+import {btmSave,getBizTypeQTDs,getCriteriaBtm} from "@/api/queryTemplate/businessTypeQuery";
 import basicOption from "@/util/basic-option";
 import {queryTemplateListByAttr} from "@/api/queryTemplate/queryDefine";
-import formQueryDialog from "./formQueryDialog.vue";
+import formQueryDialog from "@/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue";
 export default {
   name: "formDialog",
   components:{formQueryDialog},
@@ -201,9 +202,18 @@
         allowDrop: () => {
           return false;
         },
-        allowDrag: () => {
-          return true;
+        allowDrag: (dropNode) => {
+          if (dropNode.data.attrs && dropNode.data.attrs.length>0) {
+            return false;
+          } else {
+            return true;
+          }
         },
+        props:{
+          label:'name',
+          value:'name',
+          children:'attrs'
+        }
       },
       businessQueryDefineForm:'',//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑鍊�
       businessQueryDefineDic:[],//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁
@@ -227,7 +237,6 @@
       if (data.selectData) {
         this.selectData = data.selectData;
         this.form.qtName = this.selectData.qtName;
-        this.form.level = this.selectData.queryTemplate.level;
         if (data.selectData.queryTemplate.orderInfoList && data.selectData.queryTemplate.orderInfoList.length > 0) {
           this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//宸叉湁鎺掑簭
         }
@@ -244,6 +253,7 @@
         };
       }
       this.dialog.showDialog = true;
+      this.treeOption.defaultExpandedKeys=[data.treeData.label]
       this.getTemp(data.treeData.label)
       this.getAllAttr();
     },
@@ -268,7 +278,7 @@
         if (valid) {
           const formData=this.initFormData();
           console.log(formData)
-          linkSave(formData).then(res => {
+          btmSave(formData).then(res => {
             if (res.data.success) {
               this.$message.success("淇濆瓨鎴愬姛");
               this.cancelDialog();
@@ -288,16 +298,7 @@
         qtName: this.form.qtName,
         levelFlag: this.form.levelFlag,
         queryTemplate: {
-          clauseList: ['*'],
-          direction: this.form.direction,
-          id: this.form.qtName,
-          linkType: this.form.btmName,
           orderInfoList: this.orderInfoList,
-          recReturnMode: 1,//閫掑綊杩斿洖鏁版嵁妯″紡:1锛歊ECRETURNMODE_FLAT, 2锛歊ECRETURNMODE_FILTER
-          rightFlag: true,
-          secretFlag: true,
-          type: 'link',
-          version: this.form.version
         }
       }
       if (formData.levelFlag == 1) {
@@ -341,7 +342,6 @@
     },
     // 琛屽垹闄�
     rowDeleteHandler(data) {
-      debugger;
       this.orderInfoList.splice(data.index,1);
       this.orderFieldList.unshift({
         id: data.row.orderField
@@ -390,31 +390,22 @@
     //鑾峰彇鏌ヨ妯℃澘瀹氫箟涓嬫媺
     getTemp(btmName) {
       if (btmName) {
-        queryTemplateListByAttr({btmName: btmName}).then(res => {
+        queryTemplateListByAttr({btmName: btmName,linkFlag:false}).then(res => {
           const data = res.data.data.map(item => {
-            item.label = item.name + '-' + (item.linkTypeName || item.btmName);
+            item.label = item.name + '-' + item.btmName;
             item.value = item.name;
             return item;
           });
             this.businessQueryDefineDic=data;
             data.length>0 && (this.businessQueryDefineForm= data[0].value);
-
         })
       }
     },
     businessQueryDefineChange(data) {
       if (data.value) {
-        const childData = data.item.attrs.map(item => {
-          return {
-            label: item.name,
-            value: item.name,
-            atttributes:item
-          };
-        });
         this.businessTreeData = [{
-          label: data.value,
-          value: data.value,
-          children: childData
+          name: data.value,
+          attrs: data.item.attrs
         }]
       }
     },
@@ -430,7 +421,25 @@
       if(this.form.levelFlag==1) {
         this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-end', ev);
       }
-    }
+    },
+    //鏌ヨ
+    queryHandler(){
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.$refs.formQuery.queryResultDialog.loading=true;
+          const formData=this.initFormData();
+          getCriteriaBtm(formData).then(res => {
+            if (res.data.success) {
+              this.resultData=res.data.data;
+              this.$refs.formQuery.queryResultDialog.showDialog=true;
+              this.$refs.formQuery.queryResultDialog.loading=false;
+            }
+          });
+        } else {
+          return false;
+        }
+      });
+    },
   },
 }
 </script>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue
deleted file mode 100644
index 38ff8db..0000000
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue
+++ /dev/null
@@ -1,728 +0,0 @@
-<template>
-  <div style="padding: 0 10px">
-    <div style="text-align: center;margin-bottom: 10px">
-      <avue-radio v-model="radioForm"  :dic="radioDic" style="margin: 0 20px 0 0;display: inline-block"></avue-radio>
-      <el-button  plain size="mini" type="primary" @click="clearValue">娓呯┖鍊�</el-button>
-      <el-button  plain size="mini" type="primary" @click="delAll">鍒犻櫎鍏ㄩ儴鏉′欢</el-button>
-    </div>
-    <div v-if="radioForm==0" @drop="drop" @dragover.prevent style="height: 220px;text-align: center;">
-      <div v-for="(condition,index) in conditionList" :key="index" class="el-input--small" style="margin-bottom: 5px; text-align:left">
-        <span style="width: 200px;display: inline-block;text-align: right" :title="condition.clause">{{condition.clause}}</span>
-        <avue-select v-model="condition.operator" type="tree" :dic="condition.operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
-        <el-date-picker v-if="condition.type=='VTDate'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;" value-format="YYYY-MM-DD"
-                        type="date">
-        </el-date-picker>
-        <el-date-picker v-else-if="condition.type=='VTDateTime'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"
-                        type="datetime">
-        </el-date-picker>
-        <el-time-select v-else-if="condition.type=='VTTime'" v-model="condition.ordinaryValue" value-format="HH:mm:ss" style="width:300px;margin-right: 5px;display: inline-block;">
-        </el-time-select>
-        <avue-input-number v-else-if="condition.type=='VTInteger'" precision="0" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"></avue-input-number>
-        <avue-input-number v-else-if="condition.type=='VTLong' || condition.type=='VTDouble'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"></avue-input-number>
-        <avue-input v-else v-model="condition.ordinaryValue" placeholder="" style="width: 300px;margin-right: 5px;"></avue-input>
-        <el-button  plain size="mini" type="primary" @click="checkTemp(index)">閫夋嫨鏌ヨ妯℃澘</el-button>
-        <el-button  size="mini" type="danger" icon="el-icon-delete" @click="delCondition(index)" style="padding: 7px 8px"></el-button>
-      </div>
-    </div>
-    <div v-else @drop="drop" @dragover.prevent style="height: 220px;text-align: left">
-      <avue-tree ref="tree" @node-drag-end="handleDragEnd" @node-drag-leave="handleDragLeave"  @node-drag-over="handleDragOver"
-                  style="height: 220px" :data="treeData" :option="treeOption"  @node-click="nodeClick" node-key="value"></avue-tree>
-    </div>
-    <div style="text-align: right;margin-top: 10px;">
-      <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="addHandler">澧炲姞閫昏緫</el-button>
-      <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="editHandler">淇敼鏉′欢</el-button>
-      <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="delHandler">鍒犻櫎</el-button>
-      <el-button  plain size="mini" type="primary" @click="queryHandler">鏌ヨ</el-button>
-      <el-button  plain size="mini" type="primary" @click="">鍙栨秷</el-button>
-    </div>
-
-    <!--淇敼鏉′欢-->
-    <el-dialog v-dialogDrag
-               :title="dialog.title"
-               :visible.sync="dialog.showDialog"
-               width="550px"
-               :append-to-body="true"
-               class="avue-dialog"
-               :destroy-on-close="true"
-               :close-on-click-modal="false"
-               @close="dialog.showDialog=false">
-      <div style="height: 200px;">
-        {{clickNode.showLabel}}
-        <avue-select v-if="['VTInteger','VTDouble','VTLong'].includes(clickNode.type)" v-model="clickNode.operator" type="tree" :dic="operatorIntDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
-        <avue-select v-else-if="['VTDateTime','VTDate','VTTime'].includes(clickNode.type)" v-model="clickNode.operator" type="tree" :dic="operatorDateDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
-        <avue-select v-else v-model="clickNode.operator" type="tree" :dic="operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
-        <el-date-picker v-if="clickNode.type=='VTDate'" v-model="clickNode.inputValue" style="width:300px;display: inline-block;" value-format="YYYY-MM-DD"
-          type="date">
-        </el-date-picker>
-        <el-date-picker v-else-if="clickNode.type=='VTDateTime'" v-model="clickNode.inputValue" style="width:350px;display: inline-block;"
-          type="datetime">
-        </el-date-picker>
-        <el-time-select v-else-if="clickNode.type=='VTTime'" v-model="clickNode.inputValue" value-format="HH:mm:ss" style="width:300px;display: inline-block;">
-        </el-time-select>
-        <avue-input-number v-else-if="clickNode.type=='VTInteger'" precision="0" v-model="clickNode.inputValue" style="width:300px;display: inline-block;"></avue-input-number>
-        <avue-input-number v-else-if="clickNode.type=='VTLong' || clickNode.type=='VTDouble'" v-model="clickNode.inputValue" style="width:300px;display: inline-block;"></avue-input-number>
-        <avue-input v-else v-model="clickNode.inputValue" type="textarea" style="width: 300px;margin-right: 5px;vertical-align: top;"></avue-input>
-      </div>
-      <div class="dialog-footer avue-dialog__footer">
-        <el-button size="small" @click="checkTemp" v-if="!['VTInteger','VTDouble','VTLong','VTDateTime','VTDate','VTTime'].includes(clickNode.type)">閫夋嫨鏌ヨ妯℃澘</el-button>
-        <el-button type="primary" plain size="small" @click="submitDialog" >淇� 瀛�</el-button>
-        <el-button size="small" @click="dialog.showDialog=false">鍙� 娑�</el-button>
-      </div>
-    </el-dialog>
-    <el-dialog v-dialogDrag
-               :title="queryDialog.title"
-               :visible.sync="queryDialog.showDialog"
-               width="800px"
-               :append-to-body="true"
-               class="avue-dialog"
-               :destroy-on-close="true"
-               :close-on-click-modal="false"
-               @close="cancleQueryDialog">
-      <div class="el-input--small">
-        杈撳叆鏌ヨ瀛楁锛�<avue-input v-model="queryField" style="width: 500px;margin-bottom: 10px"></avue-input>
-        <avue-crud  ref="crud" :data="crudData" :option="crudOption"
-                    :page.sync="page"
-                    :table-loading="tableLoading"
-                    @selection-change="selectionChange"
-                    @row-click="rowClick"
-                    @size-change="sizeChange"
-                    @current-change="currentChange">
-        </avue-crud>
-      </div>
-      <div class="dialog-footer avue-dialog__footer">
-        <el-button type="primary" plain size="small" @click="submitQueryDialog" >纭� 瀹�</el-button>
-        <el-button size="small" @click="cancleQueryDialog">鍙� 娑�</el-button>
-      </div>
-    </el-dialog>
-    <el-dialog v-dialogDrag
-               :title="queryResultDialog.title"
-               :visible.sync="queryResultDialog.showDialog"
-               width="900px"
-               :append-to-body="true"
-               class="avue-dialog"
-               :destroy-on-close="true"
-               :close-on-click-modal="false"
-               @close="queryResultDialog.showDialog='false'">
-      <div class="el-input--small">
-        <avue-crud  ref="crud" :data="resultData" :option="resultOption"
-                    :table-loading="queryResultDialog.loading">
-        </avue-crud>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import basicOption from "@/util/basic-option";
-import {getAllQTs} from "@/api/queryTemplate/queryDefine";
-import {getCriteria} from "@/api/queryTemplate/linkTypeQuery";
-import {dateFormat} from "@/util/date"
-export default {
-name: "formQueryDialog",
-  props: {
-    queryCondition: {
-      type: Array,
-      default: []
-    },
-    queryTree: {
-      type: Object,
-      default: {}
-    },
-    levelFlag:{
-      type: Number,
-      default: 0
-    }
-  },
-  data() {
-    return {
-      dialog: {
-        showDialog: false,
-        title: "鏌ヨ鏉′欢璁剧疆妗�",
-        loading: false
-      },
-      queryDialog: {
-        showDialog: false,
-        title: "閫夋嫨鏌ヨ妯℃澘",
-        loading: false
-      },
-      queryResultDialog: {
-        showDialog: false,
-        title: "鏌ヨ缁撴灉",
-        loading: false
-      },
-      radioDic: [{
-        label: '鏅��',
-        value: 0
-      }, {
-        label: '楂樼骇',
-        value: 1
-      }],
-      conditionList:[],
-      treeData:[],
-      treeOption:{
-        defaultExpandAll:true,
-        menu: false,
-        addBtn: false,
-        filter:false,
-        draggable: true,
-        allowDrop: (draggingNode, dropNode, type) => {
-          debugger;
-          if (dropNode.data.label === '骞朵笖' || dropNode.data.label === '鎴栬��') {
-            return true;
-          } else {
-            this.$message.error('璇烽�変腑閫昏緫鏉′欢娣诲姞鏌ヨ椤�');
-            return false;
-          }
-        },
-        allowDrag: (draggingNode) => {
-          return false;
-        },
-      },
-      page: {
-        currentPage: 1,
-        pageSize: 10,
-        total: 0,
-        pageSizes: [10, 30, 50, 100],
-      },
-      crudData:[],
-      crudOption: {
-        ...basicOption,
-        addBtn: false,
-        editBtn: false,
-        delBtn: false,
-        tip: false,
-        header: false,
-        height: window.innerHeight-220,
-        menu: false,
-        column: [{
-          label: '鏌ヨ妯℃澘鍚嶇О',
-          prop: 'qtName',
-          sortable: true,
-        }, {
-          label: '閾炬帴绫诲瀷鎴栦笟鍔$被鍨�',
-          prop: 'btmName',
-          sortable: true,
-        }]
-      },
-      tableLoading: false,
-      selectionRow:[],
-      queryField:'',
-      resultData:[],
-      resultOption: {
-        ...basicOption,
-        addBtn: false,
-        editBtn: false,
-        delBtn: false,
-        tip: false,
-        header: false,
-        height: window.innerHeight-220,
-        menu: false,
-        column: [{
-          label: 'OID',
-          prop: 'OID',
-        }, {
-          label: 'CREATOR',
-          prop: 'CREATOR'
-        }, {
-          label: 'CREATETIME',
-          prop: 'CREATETIME'
-        }]
-      },
-      clickNode:{},
-      operatorIntDic:[{
-        label: '=',
-        value: '='
-      }, {
-        label: '!=',
-        value: '!='
-      }, {
-        label: '鍖呭惈',
-        value: '鍖呭惈'
-      }, {
-        label: 'in',
-        value: 'in'
-      }, {
-        label: 'not in',
-        value: 'not in'
-      }, {
-        label: '>=',
-        value: '>='
-      }, {
-        label: '>',
-        value: '>'
-      }, {
-        label: '<=',
-        value: '<='
-      }, {
-        label: '<',
-        value: '<'
-      }],
-      operatorDateDic : [{
-        label: '=',
-        value: '='
-      }, {
-        label: '!=',
-        value: '!='
-      }, {
-        label: 'in',
-        value: 'in'
-      }, {
-        label: 'not in',
-        value: 'not in'
-      }, {
-        label: '>=',
-        value: '>='
-      }, {
-        label: '<=',
-        value: '<='
-      }],
-      operatorDic : [{
-        label: '=',
-        value: '='
-      }, {
-        label: '!=',
-        value: '!='
-      }, {
-        label: '鍖呭惈',
-        value: '鍖呭惈'
-      }, {
-        label: 'in',
-        value: 'in'
-      }, {
-        label: 'not in',
-        value: 'not in'
-      }]
-    }
-  },
-  computed: {
-    radioForm:{
-      get() {
-        return this.levelFlag;
-      },
-      set(value) {
-        this.$emit('update:levelFlag', value);
-      }
-    }
-  },
-  watch: {
-    queryCondition:{
-      handler(val) {
-        if(val && val.cIMap){
-          let list=[];
-          let that=this;
-          let getValue =function(queryTemplate,item) {
-            for (let key in queryTemplate.condition.cIMap) {
-              if (queryTemplate.condition.cIMap[key].leaf) {
-                item.clause += '.' + queryTemplate.condition.cIMap[key].leafInfo.clause;
-                if (queryTemplate.condition.cIMap[key].leafInfo.value.queryTemplate) {
-                  getValue(queryTemplate.condition.cIMap[key].leafInfo.value.queryTemplate, item)
-                } else {
-                  item.ordinaryValue = queryTemplate.condition.cIMap[key].leafInfo.value.ordinaryValue;
-                  item.type=queryTemplate.condition.cIMap[key].leafInfo.type;
-                  if(['VTInteger','VTDouble','VTLong'].includes(item.type)){
-                    item.operatorDic=that.operatorIntDic;
-                  }else if(['VTDateTime','VTDate','VTTime'].includes(item.type)){
-                    item.operatorDic=that.operatorDateDic;
-                  }else{
-                    item.operatorDic=that.operatorDic;
-                  }
-                }
-              }
-            }
-          }
-          for (let key in val.cIMap) {
-            if (this.queryCondition.cIMap[key].leaf) {
-              let clause=this.queryCondition.cIMap[key].leafInfo.clause;
-              let operator= this.queryCondition.cIMap[key].leafInfo.operator;
-              let item={
-                clause: clause,
-                operator: operator,
-                ordinaryValue: '',
-                operatorDic :[]
-              }
-              if(this.queryCondition.cIMap[key].leafInfo.value.queryTemplate) {
-                getValue(this.queryCondition.cIMap[key].leafInfo.value.queryTemplate, item)
-              }else {
-                item.ordinaryValue=this.queryCondition.cIMap[key].leafInfo.value.ordinaryValue;
-                item.type=this.queryCondition.cIMap[key].leafInfo.type;
-                if(['VTInteger','VTDouble','VTLong'].includes(item.type)){
-                  item.operatorDic=that.operatorIntDic;
-                }else if(['VTDateTime','VTDate','VTTime'].includes(item.type)){
-                  item.operatorDic=that.operatorDateDic;
-                }else{
-                  item.operatorDic=that.operatorDic;
-                }
-              }
-              list.push(item)
-            }
-          }
-          this.conditionList= list;
-        }else{
-          this.conditionList=[]
-        }
-      },
-      immediate: true,
-      deep:true
-    },
-    queryTree:{
-      handler(val) {
-        this.treeIndex=0;
-        if(val && Object.keys(val).length>0){
-          let treeData = [];
-          let that=this;
-          function initValue(nodeChild) {
-            let children=[];
-            if(nodeChild){
-              nodeChild.forEach((item,index)=>{
-                that.treeIndex++;
-                if(item.column !=null && item.column != undefined){
-                  const values= item.column.split(' ');
-                  let inputValue='';
-                  let operator='';
-                  let showLabel=''
-                  if(item.column.indexOf('not in')!=-1){
-                    operator='not in';
-                    if(values.length>3){
-                      inputValue=values[3];
-                    }
-                  }else{
-                    if(values.length>1){
-                      operator=values[1];
-                      if(values.length>2){
-                        inputValue=values[2];
-                      }
-                    }
-                  }
-
-                  if(values[0].indexOf('.')!=-1){
-                    const labels=values[0].split('.')
-                    showLabel=labels[labels.length-1];
-                  }else {
-                    showLabel=values[0];
-                  }
-                  children.push({
-                    label:item.column,
-                    value:item.column+that.treeIndex,
-                    type:item.type,
-                    valueIndex:'v'+that.treeIndex,
-                    inputValue:inputValue,
-                    operator:operator,
-                    showLabel:showLabel
-                  })
-                }else {
-                  children.push({
-                    label:item.connector,
-                    value:item.connector+that.treeIndex,
-                    valueIndex:'v'+that.treeIndex,
-                    children:initValue(item.child)
-                  })
-                }
-              })
-            }
-            return children;
-          }
-          const node={
-            label:val.connector,
-            value:val.connector+this.treeIndex,
-            valueIndex:'v'+this.treeIndex,
-            children:initValue(val.child)
-          }
-          treeData.push(node)
-          this.treeData = treeData;
-        }else {
-          this.treeData=[{
-            label: '骞朵笖',
-            value: '骞朵笖' + this.treeIndex,
-            valueIndex: 'v' + this.treeIndex,
-            connector: '骞朵笖',
-            children: []
-          }]
-        }
-      },
-      immediate: true,
-      deep:true
-    }
-  },
-  created() {
-    this.getTemp();
-  },
-  methods: {
-    // 鎷栨嫿鍒版椂
-    drop(event) {
-      // 浣跨敤 getData 鏂规硶鑾峰彇鏁版嵁
-      const data = JSON.parse(event.dataTransfer.getData('item'));
-      if (this.radioForm == 0) {
-        const params = {
-          clause: data.value,
-          operator: '=',
-          ordinaryValue: ''
-        }
-        if (data.atttributes.vtDataType == 'VTInteger' || data.atttributes.vtDataType == 'VTDouble' || data.atttributes.vtDataType == 'VTLong') {
-          params.operatorDic =JSON.parse(JSON.stringify(this.operatorIntDic)) ;
-        } else if (data.atttributes.vtDataType == 'VTDateTime' || data.atttributes.vtDataType == 'VTDate' || data.atttributes.vtDataType == 'VTTime') {
-          params.operatorDic = JSON.parse(JSON.stringify(this.operatorDateDic))
-        } else {
-          params.operatorDic = JSON.parse(JSON.stringify(this.operatorDic))
-        }
-        params.type=data.atttributes.vtDataType;
-        this.conditionList.push(params)
-      }else {
-        if (this.clickNode.label != '骞朵笖' && this.clickNode.label != '鎴栬��') {
-          this.$message.error('璇烽�変腑閫昏緫鏉′欢娣诲姞鏌ヨ椤�');
-          return;
-        }
-        this.$refs.tree.append(this.initItem(data), this.clickNode);
-      }
-    },
-    initItem(data){
-      this.treeIndex++;
-      let item={
-        label: data.value,
-        value: data.value + this.treeIndex,
-        valueIndex: 'v' + this.treeIndex,
-        type:data.vtDataType,
-        children: [],
-        inputValue:data.value,
-        operator:'=',
-        showLabel:data.value
-      };
-      let showLabel='';
-      if(data.value.indexOf('.')!=-1){
-        const labels=data.value.split('.')
-        showLabel=labels[labels.length-1];
-      }else {
-        showLabel=data.value;
-      }
-      item.showLabel=showLabel;
-      return item
-    },
-    handleDragEnd(draggingNode, dropNode, dropType, ev) {
-      debugger;
-      console.log('tree drag end: ', dropNode && dropNode.label, dropType);
-    },
-    handleDragOver({event}) {
-      // 闃绘榛樿浜嬩欢锛屽厑璁告斁缃�
-      event.preventDefault();
-    },
-    handleDragLeave({event}) {
-      // 娓呴櫎鏀剧疆鏁堟灉
-      event.preventDefault();
-    },
-    //鍒犻櫎鏅�氭煡璇㈡潯浠�
-    delCondition(index) {
-      this.conditionList.splice(index, 1);
-    },
-    //娓呯┖鍊�
-    clearValue() {
-      if (this.radioForm == 0) {
-        this.conditionList.map(item => {
-          item.ordinaryValue = '';
-          return item;
-        })
-        this.conditionList = this.conditionList
-      } else {
-        if(this.treeData[0] && this.treeData[0].children) {
-          this.clearTreeValue(this.treeData[0].children)
-        }
-      }
-    },
-    clearTreeValue(nodes){
-      nodes.forEach((node,index)=>{
-        if(node.children){
-          this.clearTreeValue(node.children)
-        }else {
-          if(node.label.indexOf('not in')!=-1){
-            node.label=node.label.split(' ')[0]+' not in'
-          }else {
-            let values = node.label.split(' ');
-            if (values.length > 2) {
-              node.label = values[0] + ' ' + values[1];
-            }
-          }
-        }
-      })
-    },
-    //鍒犻櫎鍏ㄩ儴鏉′欢
-    delAll() {
-      if (this.radioForm == 0) {
-        this.conditionList = [];
-      } else {
-        this.treeIndex = 0;
-        this.treeData = [];
-        this.clickNode={};
-      }
-    },
-    nodeClick(data) {
-      this.clickNode = data
-    },
-    //鏍� 澧炲姞閫昏緫鏉′欢
-    addHandler() {
-      if (Object.keys(this.clickNode).length>0) {
-        if (this.clickNode.label == '骞朵笖' || this.clickNode.label == '鎴栬��') {
-          this.treeIndex++;
-          this.$refs.tree.append({
-            label: '骞朵笖',
-            value: '骞朵笖' + this.treeIndex,
-            valueIndex: 'v' + this.treeIndex,
-            children: []
-          }, this.$refs.tree.getCurrentNode());
-        } else {
-          this.$message.error("鍙兘瀵归�昏緫鏉′欢澧炲姞閫昏緫鏉′欢");
-        }
-      } else {
-        if(this.treeData.length==0){
-          this.treeIndex = 0;
-          this.treeData = [{
-            label: '骞朵笖',
-            value: '骞朵笖' + this.treeIndex,
-            valueIndex: 'v' + this.treeIndex,
-            connector: '骞朵笖',
-            children: []
-          }]
-        }else {
-          this.$message.warning("璇烽�夋嫨鏌ヨ鏉′欢");
-        }
-      }
-    },
-    //鏍� 淇敼鏉′欢
-    editHandler() {
-      if (Object.keys(this.clickNode).length>0) {
-        if (this.clickNode.label == '骞朵笖') {
-          this.clickNode.label = '鎴栬��'
-        } else if (this.clickNode.label == '鎴栬��') {
-          this.clickNode.label = '骞朵笖'
-        } else {
-          this.dialog.showDialog = true;
-        }
-      } else {
-        this.$message.warning("璇烽�夋嫨鏌ヨ鏉′欢");
-      }
-    },
-    //鏍� 鍒犻櫎鏉′欢
-    delHandler() {
-      if (Object.keys(this.clickNode).length>0) {
-        this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬潯浠跺悧锛�', '鎻愮ず', {
-          confirmButtonText: '纭畾',
-          cancelButtonText: '鍙栨秷',
-          type: 'warning'
-        }).then(() => {
-          this.$refs.tree.remove(this.clickNode);
-          this.clickNode = {};
-        })
-      } else {
-        this.$message.warning("璇烽�夋嫨鏌ヨ鏉′欢");
-      }
-    },
-    //鏌ヨ
-    queryHandler(){
-      this.$parent.$parent.$parent.$parent.$refs.form.validate((valid) => {
-        if (valid) {
-          this.queryResultDialog.loading=true;
-          const formData=this.$parent.$parent.$parent.$parent.initFormData();
-          getCriteria(formData).then(res => {
-            if (res.data.success) {
-              this.resultData=res.data.data;
-              this.queryResultDialog.showDialog=true;
-              this.queryResultDialog.loading=false;
-            }
-          });
-        } else {
-          return false;
-        }
-      });
-    },
-    //閫夋嫨鏌ヨ妯℃澘
-    checkTemp(index) {
-      if(index>=0){
-        if(['VTInteger','VTDouble','VTLong','VTDateTime','VTDate','VTTime'].includes(this.conditionList[index].type)){
-          return false;
-        }
-      }
-      this.queryIndex=index;
-      this.queryDialog.showDialog=true;
-      this.$nextTick(()=>{
-        this.$refs.crud.doLayout();
-      });
-    },
-    //鏌ヨ鏉′欢淇濆瓨
-    submitDialog() {
-      const values= this.clickNode.label.split(' ');
-      this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+this.clickNode.inputValue;
-      try{
-        if(['VTDateTime'].includes(this.clickNode.type)){
-          this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue);
-        }else  if(['VTDate'].includes(this.clickNode.type)){
-          this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue ,'yyyy-MM-dd');
-        }else  if(['VTTime'].includes(this.clickNode.type)){
-          this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue ,'hh:mm:ss');
-        }
-      }catch (e) {
-
-      }
-
-      this.dialog.showDialog = false;
-    },
-    //鑾峰彇鏌ヨ妯℃澘鍒楄〃
-    getTemp() {
-      getAllQTs(this.page.currentPage, this.page.pageSize).then(res => {
-        this.crudData = res.data.data;
-        this.tableLoading = false;
-      })
-    },
-    rowClick(row) {
-      this.$refs.crud.toggleSelection();
-      this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛�
-      this.selectionRow = [row];
-    },
-    selectionChange(list) {
-      this.selectionRow = list;
-    },
-    selectionClear() {
-      this.selectionRow = [];
-      this.$refs.crud.toggleSelection();
-    },
-    //閫夋嫨鏌ヨ妯℃澘
-    submitQueryDialog() {
-      if (this.selectionRow.length == 0) {
-        this.$message.error('璇烽�夋嫨鏌ヨ妯℃澘鍐嶈繘琛屾搷浣�');
-        return;
-      }
-      if (this.queryField == '') {
-        this.$message.error('璇峰~鍐欒緭鍏ユ煡璇㈠瓧娈�');
-        return;
-      }
-      const value = this.selectionRow[0].qtName + ';' + this.queryField
-      if (this.radioForm == 0) {
-        //鏅��
-        this.conditionList[this.queryIndex].ordinaryValue = value;
-      } else {
-        this.clickNode.inputValue = value;
-      }
-      this.cancleQueryDialog();
-    },
-    cancleQueryDialog(){
-      this.queryDialog.showDialog = false;
-      this.selectionClear();
-      this.queryField='';
-      this.queryIndex=null;
-    },
-    sizeChange(val) {
-      this.page.pageSize = val;
-      this.getTemp();
-    },
-
-    // 椤电爜
-    currentChange(val) {
-      this.page.currentPage = val;
-      this.getTemp();
-    },
-  }
-}
-</script>
-
-<style scoped>
-::v-deep .el-input--small .el-input__inner{
-  height: 28px;
-  line-height: 28px;
-}
-</style>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
index d37c1d1..0561cfc 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
@@ -60,6 +60,7 @@
                                :queryCondition="queryCondition"
                                :queryTree="queryTree"
                                :levelFlag.sync="form.levelFlag"
+                               @queryHandler="queryHandler"
             ></form-query-dialog>
           </fieldset>
         </el-main>
@@ -85,7 +86,7 @@
 
 <script>
 import {getAllOrderbyAttributeByLink} from "@/api/modeling/linkType/api";
-import {linkSave} from "@/api/queryTemplate/linkTypeQuery";
+import {linkSave,getCriteria} from "@/api/queryTemplate/linkTypeQuery";
 import basicOption from "@/util/basic-option";
 import {queryTemplateListByAttr} from "@/api/queryTemplate/queryDefine";
 import formQueryDialog from "./formQueryDialog.vue";
@@ -268,12 +269,21 @@
         addBtn: false,
         filter:false,
         draggable: true,
-        allowDrop: () => {
+        allowDrop: (node) => {
           return false;
         },
-        allowDrag: () => {
-          return true;
+        allowDrag: (dropNode) => {
+          if (dropNode.data.attrs && dropNode.data.attrs.length>0) {
+            return false;
+          } else {
+            return true;
+          }
         },
+        props:{
+          label:'name',
+          value:'name',
+          children:'attrs'
+        }
       },
       linkQueryDefineForm:'',//閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑鍊�
       linkQueryDefineDic:[],//閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁
@@ -369,7 +379,9 @@
         };
       }
       this.dialog.showDialog = true;
+      this.treeOption.defaultExpandedKeys=[data.treeData.label]
       this.getTemp(data.treeData.label, true)
+
     },
     cancelDialog() {
       this.dialog.loading = false;
@@ -534,33 +546,17 @@
     },
     linkQueryDefineChange(data) {
       if (data.value) {
-        const childData = data.item.attrs.map(item => {
-          return {
-            label: item.name,
-            value: item.name,
-            atttributes:item
-          };
-        });
         this.linkTreeData = [{
-          label: data.value,
-          value: data.value,
-          children: childData
+          name: data.value,
+          attrs: data.item.attrs
         }]
       }
     },
     businessQueryDefineChange(data) {
       if (data.value) {
-        const childData = data.item.attrs.map(item => {
-          return {
-            label: item.name,
-            value: item.name,
-            atttributes:item
-          };
-        });
         this.businessTreeData = [{
-          label: data.value,
-          value: data.value,
-          children: childData
+          name: data.value,
+          attrs: data.item.attrs
         }]
       }
     },
@@ -576,7 +572,25 @@
       if(this.form.levelFlag==1) {
         this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-end', ev);
       }
-    }
+    },
+    //鏌ヨ
+    queryHandler(){
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.$refs.formQuery.queryResultDialog.loading=true;
+          const formData=this.initFormData();
+          getCriteria(formData).then(res => {
+            if (res.data.success) {
+              this.resultData=res.data.data;
+              this.$refs.formQuery.queryResultDialog.showDialog=true;
+              this.$refs.formQuery.queryResultDialog.loading=false;
+            }
+          });
+        } else {
+          return false;
+        }
+      });
+    },
   },
 }
 </script>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
index 38ff8db..237f483 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
@@ -94,6 +94,7 @@
         <el-button size="small" @click="cancleQueryDialog">鍙� 娑�</el-button>
       </div>
     </el-dialog>
+    <!--鏌ヨ-->
     <el-dialog v-dialogDrag
                :title="queryResultDialog.title"
                :visible.sync="queryResultDialog.showDialog"
@@ -102,7 +103,7 @@
                class="avue-dialog"
                :destroy-on-close="true"
                :close-on-click-modal="false"
-               @close="queryResultDialog.showDialog='false'">
+               @close="queryResultDialog.showDialog=false">
       <div class="el-input--small">
         <avue-crud  ref="crud" :data="resultData" :option="resultOption"
                     :table-loading="queryResultDialog.loading">
@@ -453,18 +454,18 @@
       const data = JSON.parse(event.dataTransfer.getData('item'));
       if (this.radioForm == 0) {
         const params = {
-          clause: data.value,
+          clause: data.name,
           operator: '=',
           ordinaryValue: ''
         }
-        if (data.atttributes.vtDataType == 'VTInteger' || data.atttributes.vtDataType == 'VTDouble' || data.atttributes.vtDataType == 'VTLong') {
+        if (data.vtDataType == 'VTInteger' || data.vtDataType == 'VTDouble' || data.vtDataType == 'VTLong') {
           params.operatorDic =JSON.parse(JSON.stringify(this.operatorIntDic)) ;
-        } else if (data.atttributes.vtDataType == 'VTDateTime' || data.atttributes.vtDataType == 'VTDate' || data.atttributes.vtDataType == 'VTTime') {
+        } else if (data.vtDataType == 'VTDateTime' || data.vtDataType == 'VTDate' || data.vtDataType == 'VTTime') {
           params.operatorDic = JSON.parse(JSON.stringify(this.operatorDateDic))
         } else {
           params.operatorDic = JSON.parse(JSON.stringify(this.operatorDic))
         }
-        params.type=data.atttributes.vtDataType;
+        params.type=data.vtDataType;
         this.conditionList.push(params)
       }else {
         if (this.clickNode.label != '骞朵笖' && this.clickNode.label != '鎴栬��') {
@@ -477,21 +478,21 @@
     initItem(data){
       this.treeIndex++;
       let item={
-        label: data.value,
-        value: data.value + this.treeIndex,
+        label: data.name,
+        value: data.name + this.treeIndex,
         valueIndex: 'v' + this.treeIndex,
         type:data.vtDataType,
         children: [],
-        inputValue:data.value,
+        inputValue:'',
         operator:'=',
-        showLabel:data.value
+        showLabel:data.name
       };
       let showLabel='';
-      if(data.value.indexOf('.')!=-1){
-        const labels=data.value.split('.')
+      if(data.name.indexOf('.')!=-1){
+        const labels=data.name.split('.')
         showLabel=labels[labels.length-1];
       }else {
-        showLabel=data.value;
+        showLabel=data.name;
       }
       item.showLabel=showLabel;
       return item
@@ -615,21 +616,7 @@
     },
     //鏌ヨ
     queryHandler(){
-      this.$parent.$parent.$parent.$parent.$refs.form.validate((valid) => {
-        if (valid) {
-          this.queryResultDialog.loading=true;
-          const formData=this.$parent.$parent.$parent.$parent.initFormData();
-          getCriteria(formData).then(res => {
-            if (res.data.success) {
-              this.resultData=res.data.data;
-              this.queryResultDialog.showDialog=true;
-              this.queryResultDialog.loading=false;
-            }
-          });
-        } else {
-          return false;
-        }
-      });
+      this.$emit('queryHandler');
     },
     //閫夋嫨鏌ヨ妯℃澘
     checkTemp(index) {

--
Gitblit v1.9.3