Merge remote-tracking branch 'origin/master'
已修改26个文件
已删除4个文件
已重命名2个文件
已添加66个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <Configuration status="WARN"> |
| | | <Appenders> |
| | | <Console name="Console" target="SYSTEM_OUT"> |
| | | <PatternLayout pattern="[%-5p] %d{YYYY-MM-dd HH:mm:ss} [%t] %C{1}:%L - %msg%n" /> |
| | | </Console> |
| | | |
| | | <RollingFile name="RollingFile" filename="./logs/volume_log.log" filepattern="${logPath}/volume_%d{YYYYMMddHHmmss}.log"> |
| | | <PatternLayout pattern="[%-5p] %d{YYYY-MM-dd HH:mm:ss} [%t] %C{1}:%L - %msg%n" /> |
| | | <Policies> |
| | | <SizeBasedTriggeringPolicy size="10 MB" /> |
| | | </Policies> |
| | | <DefaultRolloverStrategy max="20" /> |
| | | </RollingFile> |
| | | |
| | | </Appenders> |
| | | <Loggers> |
| | | <Logger name="VolumeLog" level="DEBUG" additivity="true"> |
| | | <AppenderRef ref="RollingFile" /> |
| | | </Logger> |
| | | <Root level="DEBUG"> |
| | | <AppenderRef ref="Console" /> |
| | | </Root> |
| | | </Loggers> |
| | | </Configuration> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> |
| | | <hibernate-configuration> |
| | | <session-factory> |
| | | <property name="show_sql">true</property> |
| | | <property name="dialect">org.hibernate.dialect.OracleDialect</property> |
| | | <property name="connection.driver_class">oracle.jdbc.OracleDriver</property> |
| | | |
| | | <!--<property name="connection.url">jdbc:oracle:thin:@172.16.0.243:1521:orcl</property> |
| | | <property name="connection.username">vcimes</property> |
| | | <property name="connection.password">vcimes</property>--> |
| | | |
| | | <!-- <property name="connection.url">jdbc:oracle:thin:@dev.yunkeruida.top:1521:orcl</property> --> |
| | | <property name="connection.url">jdbc:oracle:thin:@192.168.0.66:1521:orcl</property> |
| | | <!-- <property name="connection.username">NMPM112</property> --> |
| | | <property name="connection.username">PLT2024</property> |
| | | <property name="connection.password">vcitest</property> |
| | | <!--<property name="connection.username">mpm112</property> |
| | | <property name="connection.password">vcitest</property>--> |
| | | |
| | | <!--property name="hibernate.connection.release_mode">auto</property --> |
| | | |
| | | <!-- 设置C3P0 --> |
| | | <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> |
| | | <property name="hibernate.c3p0.acquireRetryAttempts">30</property> |
| | | <property name="hibernate.c3p0.acquireIncrement">2</property> |
| | | <property name="hibernate.c3p0.checkoutTimeout">30000</property> |
| | | <property name="hibernate.c3p0.idleConnectionTestPeriod">120</property> |
| | | <property name="hibernate.c3p0.maxIdleTime">180</property> |
| | | <property name="hibernate.c3p0.initialPoolSize">3</property> |
| | | <property name="hibernate.c3p0.maxPoolSize">100</property> |
| | | <property name="hibernate.c3p0.minPoolSize">1</property> |
| | | <property name="hibernate.c3p0.maxStatements">100</property> |
| | | <property name="maxStatementsPerConnection">100</property> |
| | | <property name="hibernate.current_session_context_class">com.vci.server.mw.SessionContext4JBPM</property> |
| | | <property name="hibernate.connection.isolation">2</property> |
| | | |
| | | |
| | | <!-- ææ¶ç¦ç¨Hibernateçäºä»¶çå¬ |
| | | <listener type="post-insert" |
| | | class="com.vci.base.server.persistence.history.HistoryListener" /> |
| | | <listener type="post-update" |
| | | class="com.vci.base.server.persistence.history.HistoryListener" /> |
| | | <listener type="post-delete" |
| | | class="com.vci.base.server.persistence.history.HistoryListener" /> |
| | | --> |
| | | </session-factory> |
| | | </hibernate-configuration> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> |
| | | <hibernate-configuration> |
| | | <session-factory> |
| | | <property name="show_sql">true</property> |
| | | <property name="dialect">org.hibernate.dialect.OracleDialect</property> |
| | | <property name="connection.driver_class">oracle.jdbc.OracleDriver</property> |
| | | |
| | | <!--<property name="connection.url">jdbc:oracle:thin:@172.16.0.243:1521:orcl</property> |
| | | <property name="connection.username">vcimes</property> |
| | | <property name="connection.password">vcimes</property>--> |
| | | |
| | | <property name="connection.url">jdbc:oracle:thin:@192.168.0.66:1521:orcl</property> |
| | | <!-- <property name="connection.url">jdbc:oracle:thin:@dev.yunkeruida.top:1521:orcl</property> --> |
| | | <!-- <property name="connection.username">NMPM112</property> --> |
| | | <property name="connection.username">PLT2024</property> |
| | | <property name="connection.password">vcitest</property> |
| | | <!--<property name="connection.username">mpm112</property> |
| | | <property name="connection.password">vcitest</property>--> |
| | | |
| | | <!--property name="hibernate.connection.release_mode">auto</property --> |
| | | |
| | | <!-- 设置C3P0 --> |
| | | <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> |
| | | <property name="hibernate.c3p0.acquireRetryAttempts">30</property> |
| | | <property name="hibernate.c3p0.acquireIncrement">2</property> |
| | | <property name="hibernate.c3p0.checkoutTimeout">30000</property> |
| | | <property name="hibernate.c3p0.idleConnectionTestPeriod">120</property> |
| | | <property name="hibernate.c3p0.maxIdleTime">180</property> |
| | | <property name="hibernate.c3p0.initialPoolSize">3</property> |
| | | <property name="hibernate.c3p0.maxPoolSize">100</property> |
| | | <property name="hibernate.c3p0.minPoolSize">1</property> |
| | | <property name="hibernate.c3p0.maxStatements">100</property> |
| | | <property name="maxStatementsPerConnection">100</property> |
| | | <property name="hibernate.current_session_context_class">com.vci.server.mw.SessionContext4JBPM</property> |
| | | <property name="hibernate.connection.isolation">2</property> |
| | | |
| | | |
| | | <!-- ææ¶ç¦ç¨Hibernateçäºä»¶çå¬ |
| | | <listener type="post-insert" |
| | | class="com.vci.base.server.persistence.history.HistoryListener" /> |
| | | <listener type="post-update" |
| | | class="com.vci.base.server.persistence.history.HistoryListener" /> |
| | | <listener type="post-delete" |
| | | class="com.vci.base.server.persistence.history.HistoryListener" /> |
| | | --> |
| | | </session-factory> |
| | | </hibernate-configuration> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "hasChildren": true, |
| | | "children": [ |
| | | { |
| | | "hasChildren": true, |
| | | "children": [], |
| | | "id": "systemManagmentNode", |
| | | "name": "管çåè½æ¨¡å", |
| | | "parentId": "VCIBaseTreeNode", |
| | | "code": "systemManagmentNode", |
| | | "alias": "system", |
| | | "meta": { |
| | | "keepAlive": false |
| | | }, |
| | | "sort": 2, |
| | | "soruce": "", |
| | | "path": "views/systemModel/mangeModel/index" |
| | | }, |
| | | { |
| | | "hasChildren": true, |
| | | "children": [], |
| | | "id": "modelManagmentNode", |
| | | "name": "ä¸å¡åè½æ¨¡å", |
| | | "parentId": "VCIBaseTreeNode", |
| | | "code": "modelManagmentNode", |
| | | "alias": "model", |
| | | "meta": { |
| | | "keepAlive": false |
| | | }, |
| | | "sort": 3, |
| | | "soruce": "", |
| | | "path": "views/systemModel/businessModel/index" |
| | | }, |
| | | { |
| | | "hasChildren": true, |
| | | "children": [], |
| | | "id": "operateNode", |
| | | "name": "æä½ç±»å管ç", |
| | | "parentId": "VCIBaseTreeNode", |
| | | "code": "operateNode", |
| | | "alias": "operate", |
| | | "meta": { |
| | | "keepAlive": false |
| | | }, |
| | | "sort": 4, |
| | | "soruce": "", |
| | | "path": "views/systemModel/operateType/index" |
| | | }, |
| | | { |
| | | "hasChildren": false, |
| | | "children": [], |
| | | "id": "sysOptionNode", |
| | | "name": "ç³»ç»é
ç½®", |
| | | "parentId": "VCIBaseTreeNode", |
| | | "code": "sysOptionNode", |
| | | "alias": "sysOption", |
| | | "meta": { |
| | | "keepAlive": false |
| | | }, |
| | | "sort": 5, |
| | | "soruce": "", |
| | | "path": "views/systemModel/systemConfig/index" |
| | | }, |
| | | { |
| | | "hasChildren": false, |
| | | "children": [], |
| | | "id": "sysMonitorNode", |
| | | "name": "ç³»ç»è¿è¡çæ§", |
| | | "parentId": "VCIBaseTreeNode", |
| | | "code": "sysMonitorNode", |
| | | "alias": "sysMonitor", |
| | | "meta": { |
| | | "keepAlive": false |
| | | }, |
| | | "sort": 5, |
| | | "soruce": "", |
| | | "path": "views/systemModel/systemMonitor/index" |
| | | } |
| | | ], |
| | | "id": "VCIBaseTreeNode", |
| | | "name": "ç³»ç»æ¨¡åé
ç½®", |
| | | "parentId": "systemManagmentNode", |
| | | "code": "rootNode", |
| | | "alias": "root", |
| | | "meta": { |
| | | "keepAlive": false |
| | | }, |
| | | "sort": 0, |
| | | "soruce": "", |
| | | "path": "" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Actionåç±»ä¼ è¾å¯¹è±¡ |
| | | * @author yuxc |
| | | * @date 2024/8/16 15:50 |
| | | */ |
| | | @Data |
| | | public class PLActionClsDTO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 2009350578651813260L; |
| | | /** |
| | | *ä¸»é® |
| | | */ |
| | | public String id; |
| | | /** |
| | | *åç±»åç§° |
| | | */ |
| | | public String name; |
| | | /** |
| | | *ç¶ä¸»é® |
| | | */ |
| | | public String pid; |
| | | /** |
| | | *夿³¨ |
| | | */ |
| | | public String description; |
| | | /** |
| | | *å建人 |
| | | */ |
| | | public String creator; |
| | | /** |
| | | *å建æ¶é´ |
| | | */ |
| | | public long createTime; |
| | | /** |
| | | *åç±»åºå· |
| | | */ |
| | | public short serialno; |
| | | /** |
| | | * åèç¹ |
| | | */ |
| | | public List<PLActionClsDTO> childs = new ArrayList<>(); |
| | | |
| | | /** |
| | | * å½ååç±»ä¸çææaction |
| | | */ |
| | | public List<PLActionDTO> actionChilds = new ArrayList<>(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Actionä¼ è¾å¯¹è±¡ |
| | | * @author yuxc |
| | | * @date 2024/8/20 16:47 |
| | | */ |
| | | @Data |
| | | public class PLActionDTO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 2009350578651813260L; |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | private String plOId; |
| | | /** |
| | | * ç¼å· |
| | | */ |
| | | private String plCode; |
| | | /** |
| | | * åç§° |
| | | */ |
| | | private String plName; |
| | | /** |
| | | * B/Så°åï¼çé¢ç±»è·¯å¾ |
| | | */ |
| | | private String plBSUrl; |
| | | /** |
| | | * c/sç±»è·¯å¾ çé¢é¾æ¥å°å |
| | | */ |
| | | private String plCSClass; |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | private String plDesc; |
| | | /** |
| | | * ç±»å |
| | | */ |
| | | private String plTypeType; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | private long plCreateTime; |
| | | /** |
| | | * å建人 |
| | | */ |
| | | private String plCreateUser; |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | private long plModifyTime; |
| | | /** |
| | | * ä¿®æ¹äºº |
| | | */ |
| | | private String plModifyUser; |
| | | |
| | | private String plLicensOrs; |
| | | /** |
| | | * ç¶èç¹id |
| | | */ |
| | | private String plActionCls; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.dto; |
| | | |
| | | import lombok.Data; |
| | | /** |
| | | * Actionæ¥è¯¢ä¼ è¾å¯¹è±¡ |
| | | * @author yuxc |
| | | * @date 2024/8/20 14:45 |
| | | */ |
| | | @Data |
| | | public class PLActionQueryDTO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 2009350578651813260L; |
| | | /** |
| | | *ç¼å· |
| | | */ |
| | | private String plcode; |
| | | /** |
| | | *åç§° |
| | | */ |
| | | private String plname; |
| | | /** |
| | | *B/Sç±»è·¯å¾ |
| | | */ |
| | | private String plbsurl; |
| | | /** |
| | | *C/Sç±»è·¯å¾ |
| | | */ |
| | | private String plcsclass; |
| | | /** |
| | | *ä¸å¡ç±»å |
| | | */ |
| | | private String pltypetype; |
| | | /** |
| | | *æè¿° |
| | | */ |
| | | private String pldesc; |
| | | /** |
| | | *åç±»ID |
| | | */ |
| | | private String plactioncls; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.dto.PLActionClsDTO; |
| | | import com.vci.dto.PLActionDTO; |
| | | import com.vci.dto.PLActionQueryDTO; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.web.service.OsActionServiceI; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Action管ççæ§å¶å¨ |
| | | * @author yuxc |
| | | * @date 2024-8-16 |
| | | */ |
| | | @RequestMapping("/actionController") |
| | | @RestController |
| | | public class OsActionController { |
| | | |
| | | /** |
| | | * Actionæå¡ |
| | | */ |
| | | @Autowired |
| | | private OsActionServiceI osActionServiceI; |
| | | |
| | | /** |
| | | * ä¿åActionåç±»ä¿¡æ¯ |
| | | * @param pLActionCls Actionåç±»ä¿¡æ¯ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @PostMapping("/saveActionCls") |
| | | public BaseResult saveActionCls(@RequestBody PLActionClsDTO pLActionCls){ |
| | | try { |
| | | return osActionServiceI.saveActionCls(pLActionCls); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹Actionåç±»ä¿¡æ¯ |
| | | * @param pLActionCls Actionåç±»ä¿¡æ¯ |
| | | * @return ä¿®æ¹ç»æ |
| | | */ |
| | | @PostMapping("/updateActionCls") |
| | | public BaseResult updateActionCls(@RequestBody PLActionClsDTO pLActionCls){ |
| | | try { |
| | | return osActionServiceI.updateActionCls(pLActionCls); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åActionåç±»æ |
| | | * isExp æ¯å¦ç¨æ·å¯¼åº trueæ¯ï¼falseå¦ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @GetMapping("/getActionTree") |
| | | public BaseResult getActionTree(boolean isExp){ |
| | | try { |
| | | return osActionServiceI.getActionTree(isExp); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åActionè¡¨æ ¼æ°æ® |
| | | * dto æ¥è¯¢æ¡ä»¶ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @PostMapping("/getActionTableData") |
| | | public BaseResult getActionTableData(@RequestBody PLActionQueryDTO dto){ |
| | | try { |
| | | return osActionServiceI.getActionTableData(dto); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿åActionæ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @PostMapping("/saveAction") |
| | | public BaseResult saveAction(@RequestBody PLActionDTO dto){ |
| | | try { |
| | | return osActionServiceI.saveAction(dto); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹Actionæ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿®æ¹ç»æ |
| | | */ |
| | | @PostMapping("/updateAction") |
| | | public BaseResult updateAction(@RequestBody PLActionDTO dto){ |
| | | try { |
| | | return osActionServiceI.updateAction(dto); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤Actionæ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return å é¤ç»æ |
| | | */ |
| | | @DeleteMapping("/deleteAction") |
| | | public BaseResult deleteAction(@RequestBody PLActionDTO dto){ |
| | | try { |
| | | return osActionServiceI.deleteAction(dto); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导åºAction |
| | | * @return |
| | | */ |
| | | @PostMapping("/exportBeans") |
| | | public void exportBeans(@RequestBody List<String> actionOid, HttpServletResponse response) throws PLException, IOException { |
| | | osActionServiceI.exportBeans(actionOid, response); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.other; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | public class ExportActionLogBean implements IExportLogBean { |
| | | /** |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 10086L; |
| | | private String no = "1"; |
| | | private static int index = 1; |
| | | private String exportState = "æ£å¸¸"; |
| | | private String coding = ""; |
| | | private String name =""; |
| | | private String CSRegister = ""; |
| | | private String BSRegister = ""; |
| | | private String type = ""; |
| | | private String description = ""; |
| | | private String category = ""; |
| | | private Date date = null; |
| | | private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss "); |
| | | |
| | | public ExportActionLogBean() { |
| | | |
| | | this( "-1", "ExportActionLogBean 对象æå»º 使ªè®¾ç½®å¼", "null", |
| | | "null", "null", "null", "null", |
| | | "null", "null" ); |
| | | index = 1; |
| | | |
| | | } |
| | | public ExportActionLogBean(String exportState, String coding, |
| | | String name, String cSRegister, String bSRegister, String type, |
| | | String description, String category) { |
| | | this( ""+index++, exportState, coding, |
| | | name, cSRegister, bSRegister,type, |
| | | description,category); |
| | | } |
| | | public ExportActionLogBean(String no, String exportState, String coding, |
| | | String name, String cSRegister, String bSRegister, String type, |
| | | String description, String category) { |
| | | super(); |
| | | this.no = no; |
| | | if( exportState!=null || !no.equals("-1")){//é»è®¤ç¶æä¸ºæ£å¸¸ |
| | | this.exportState = exportState; |
| | | } |
| | | |
| | | this.coding = coding; |
| | | this.name = name; |
| | | CSRegister = cSRegister; |
| | | BSRegister = bSRegister; |
| | | this.type = type; |
| | | this.description = description; |
| | | this.category = category; |
| | | } |
| | | |
| | | @Override |
| | | public Object[] getLogRowObjcets() { |
| | | Object obj []= {no,exportState,coding,name,CSRegister,BSRegister,type,description,category}; |
| | | return obj; |
| | | } |
| | | |
| | | public Object[] getInportLogRowObjcets() { |
| | | Object obj []= {no,exportState,coding,name,CSRegister,BSRegister,type,description}; |
| | | return obj; |
| | | } |
| | | |
| | | public String getNo() { |
| | | return no; |
| | | } |
| | | |
| | | public String getExportState() { |
| | | return exportState; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public String getCSRegister() { |
| | | return CSRegister; |
| | | } |
| | | |
| | | public String getBSRegister() { |
| | | return BSRegister; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | |
| | | public String getCategory() { |
| | | return category; |
| | | } |
| | | |
| | | public void setNo(String no) { |
| | | this.no = no; |
| | | } |
| | | |
| | | public void setExportState(String exportState) { |
| | | this.exportState = exportState; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public void setCSRegister(String cSRegister) { |
| | | CSRegister = cSRegister; |
| | | } |
| | | |
| | | public void setBSRegister(String bSRegister) { |
| | | BSRegister = bSRegister; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | |
| | | public void setCategory(String category) { |
| | | this.category = category; |
| | | } |
| | | |
| | | @Override |
| | | public String getLogRowContent() { |
| | | date = new Date(); |
| | | String info =format.format(date)+"---------"; |
| | | return info+" [åºå·=" + no + ", 导åºç¶æ=" + exportState |
| | | + ", ç¼å·=" + coding + ", åç§°=" + name + ", CS注å=" |
| | | + CSRegister + ", BS注å=" + BSRegister + ", ç±»å=" + type |
| | | + ", æè¿°=" + description + ", æå±åç±»=" + category |
| | | + "]"; |
| | | |
| | | } |
| | | |
| | | public String getCoding() { |
| | | return coding; |
| | | } |
| | | |
| | | public void setCoding(String coding) { |
| | | this.coding = coding; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.other; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.Map.Entry; |
| | | import com.vci.corba.portal.data.PLAction; |
| | | import com.vci.corba.portal.data.PLActionCls; |
| | | import com.vci.corba.portal.data.PLActionParam; |
| | | |
| | | |
| | | public class ExportBeans implements Serializable{ |
| | | private static final long serialVersionUID = 10086L; |
| | | private HashMap<String/*ActionId*/,PLAction> PLActionBeans = new HashMap<String,PLAction>(); |
| | | private HashMap<String/*åç±»åç§°*/,String/*id*/> PLActionClsExt = new HashMap<String,String>(); |
| | | private HashMap<String/*id*/,PLActionCls> PLActionClsBeans = new HashMap<String,PLActionCls>(); |
| | | private HashMap<String/*Actionç¼ç */, ArrayList<PLActionParam> > PLActionParamBeans = new HashMap<String, ArrayList<PLActionParam> >(); |
| | | private HashMap<String/*ActionClsç¼ç */, ArrayList<PLAction> > PLActionListsMap = null; |
| | | private ExportActionLogBean logBean = null;//æ¥å¿æä»¶ |
| | | |
| | | public ExportBeans() { |
| | | |
| | | logBean = new ExportActionLogBean(); |
| | | } |
| | | public HashMap<String, PLActionCls> getPLActionClsBeans() { |
| | | return PLActionClsBeans; |
| | | } |
| | | public HashMap<String, PLAction> getPLActions() { |
| | | return PLActionBeans; |
| | | } |
| | | |
| | | public void addPLActionClsBean(PLActionCls pLActionCls){ |
| | | PLActionClsBeans.put(pLActionCls.id, pLActionCls); |
| | | PLActionClsExt.put(pLActionCls.name,pLActionCls.id); |
| | | |
| | | } |
| | | public PLActionCls getPLActionClsBeanById(String id){ |
| | | return PLActionClsBeans.get(id); |
| | | } |
| | | public PLActionCls getPLActionClsBeanByName(String name){ |
| | | if(PLActionClsExt.get(name) == null){ |
| | | return null; |
| | | } |
| | | return PLActionClsBeans.get(PLActionClsExt.get(name)); |
| | | } |
| | | /** |
| | | * æ·»å PLActionBeanå¹¶åæ¶æ·»å PLActionBean对åºåæ°è¿è¡è®°å½ |
| | | * @param pLAction |
| | | */ |
| | | // public void addPLActionBean(PLAction pLAction){ |
| | | // this.addPLActionBean(pLAction,null); |
| | | // } |
| | | /** |
| | | * æ·»å PLActionBeanå logBeanåå
¥å¼ |
| | | * |
| | | */ |
| | | public void setLogBean(ExportActionLogBean logBean) { |
| | | this.logBean = logBean; |
| | | } |
| | | /** |
| | | * æ·»å PLActionBeanå logBeanåå
¥å¼ |
| | | * |
| | | */ |
| | | public ExportActionLogBean getLogBean() { |
| | | return logBean; |
| | | } |
| | | |
| | | public PLAction getPLActionById(String pLActionId){ |
| | | return PLActionBeans.get(pLActionId); |
| | | } |
| | | public ArrayList<PLAction> getPLActionByPlActionClsId(String plActionClsId){ |
| | | if( PLActionListsMap == null){ |
| | | PLActionListsMap = new HashMap<String/*ActionClsç¼ç */,ArrayList<PLAction>>(); |
| | | for (Entry<String, PLAction> PLActionEntry : PLActionBeans.entrySet()) { |
| | | String PLActionListsMapKey = PLActionEntry.getValue().plActionCls ; |
| | | if(PLActionListsMapKey.equals("")){ |
| | | PLActionListsMapKey = "when key is null ,change the key to this"; |
| | | } |
| | | ArrayList<PLAction> actionList = PLActionListsMap.get(PLActionListsMapKey); |
| | | if( actionList == null){ |
| | | actionList = new ArrayList<PLAction>(); |
| | | actionList.add(PLActionEntry.getValue()); |
| | | PLActionListsMap.put(PLActionListsMapKey,actionList); |
| | | }else{ |
| | | actionList.add(PLActionEntry.getValue()); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | |
| | | if(plActionClsId.equals("")){ |
| | | plActionClsId = "when key is null ,change the key to this"; |
| | | } |
| | | return PLActionListsMap.get(plActionClsId); |
| | | } |
| | | public void addPLActionParamBean(PLActionParam pLActionParam){ |
| | | if(pLActionParam.action!=null && pLActionParam.action!=""){ |
| | | if(PLActionParamBeans.get(pLActionParam.action) == null){ |
| | | ArrayList<PLActionParam> arraylist = new ArrayList<PLActionParam>(); |
| | | PLActionParamBeans.put(pLActionParam.action, arraylist); |
| | | } |
| | | PLActionParamBeans.get(pLActionParam.action).add(pLActionParam); |
| | | } |
| | | |
| | | } |
| | | public PLActionParam[] getPLActionParamArrayByActionId(String paramString){ |
| | | ArrayList<PLActionParam> pLActionParams = PLActionParamBeans.get(paramString); |
| | | |
| | | if(pLActionParams != null && pLActionParams.size() > 0 ){ |
| | | PLActionParam[] actionParams = new PLActionParam[pLActionParams.size()]; |
| | | for (int i = 0; i < pLActionParams.size(); i++) { |
| | | actionParams[i] = pLActionParams.get(i); |
| | | } |
| | | return actionParams; |
| | | } |
| | | return null; |
| | | } |
| | | // /** |
| | | // * æ·»å PLActionBeanå¹¶åæ¶æ·»å PLActionBean对åºåæ°è¿è¡è®°å½ |
| | | // * è½è¿æ¹ä¾¿è·å¾categoryæ¶ç¨æ¤æ¹æ³. å¯ä»¥éä½ç³»ç»æ¶è |
| | | // * @param pLAction |
| | | // */ |
| | | // public void addPLActionBean(PLAction plAction, String category) { |
| | | // PLActionBeans.put(plAction.plOId, plAction); |
| | | // PLActionCls[] plActionCls = null; |
| | | // |
| | | // try { |
| | | // if(category == null ){ |
| | | // plActionCls = UITools.getService().getPLActionClsArray(); |
| | | // for (PLActionCls plActionCls2 : plActionCls) {//è·å¾åç±»åç§° |
| | | // if(plActionCls2.id.equals(plAction.plActionCls)){ |
| | | // category = plActionCls2.name ; |
| | | // } |
| | | // } |
| | | // } |
| | | // PLActionParam[] params = UITools.getService().getPLActionParamArrayByActionId(plAction.plOId); |
| | | // if(params != null && params.length > 0){//妿忰åå¨ |
| | | // for (PLActionParam plActionParam : params) {//æ·»å actionåæ° |
| | | // this.addPLActionParamBean(plActionParam); |
| | | // } |
| | | // } |
| | | // logBean = new ExportActionLogBean(ExportActionLogBean.RIGHT_STATE, |
| | | // plAction.plCode,plAction.plName,plAction.plCSClass,plAction.plBSUrl, |
| | | // plAction.plTypeType,plAction.plDesc,category); |
| | | // |
| | | // } catch (PLException e) { |
| | | // logBean = new ExportActionLogBean(e.getMessage(), |
| | | // plAction.plCode,plAction.plName,plAction.plCSClass,plAction.plBSUrl, |
| | | // plAction.plTypeType,plAction.plDesc,category); e.printStackTrace(); |
| | | // } |
| | | // } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.other; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public interface IExportLogBean extends Serializable{ |
| | | static final long serialVersionUID = 1L; |
| | | static String RIGHT_STATE = "æ£å¸¸"; |
| | | /** |
| | | * è¿åå符串æ°ç»å°å
容åå
¥å°JTableæä»¶ä¸ |
| | | * @return |
| | | */ |
| | | public abstract Object[] getLogRowObjcets(); |
| | | /** |
| | | * è¿åå符串å°å
容åå
¥å°logæä»¶ä¸ |
| | | * @return |
| | | */ |
| | | public abstract String getLogRowContent(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.service; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.dto.PLActionClsDTO; |
| | | import com.vci.dto.PLActionDTO; |
| | | import com.vci.dto.PLActionQueryDTO; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Action管ççæå¡ |
| | | * @author yuxc |
| | | * @date 2024-8-16 |
| | | */ |
| | | public interface OsActionServiceI { |
| | | /** |
| | | * ä¿åActionåç±»ä¿¡æ¯ |
| | | * @param pLActionCls Actionåç±»ä¿¡æ¯ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | BaseResult saveActionCls(PLActionClsDTO pLActionCls) throws PLException; |
| | | /** |
| | | * ä¿®æ¹Actionåç±»ä¿¡æ¯ |
| | | * @param pLActionCls Actionåç±»ä¿¡æ¯ |
| | | * @return ä¿®æ¹ç»æ |
| | | */ |
| | | BaseResult updateActionCls(PLActionClsDTO pLActionCls) throws PLException; |
| | | /** |
| | | * è·åActionåç±»æ |
| | | * isExp æ¯å¦ç¨æ·å¯¼åº trueæ¯ï¼falseå¦ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | BaseResult getActionTree(boolean isExp) throws PLException; |
| | | /** |
| | | * è·åActionè¡¨æ ¼æ°æ® |
| | | * dto æ¥è¯¢æ¡ä»¶ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | BaseResult getActionTableData(PLActionQueryDTO dto) throws PLException; |
| | | /** |
| | | * ä¿åActionæ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | BaseResult saveAction(PLActionDTO dto) throws PLException; |
| | | /** |
| | | * ä¿®æ¹Actionæ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿®æ¹ç»æ |
| | | */ |
| | | BaseResult updateAction(PLActionDTO dto) throws PLException; |
| | | /** |
| | | * å é¤Actionæ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return å é¤ç»æ |
| | | */ |
| | | BaseResult deleteAction(PLActionDTO dto) throws PLException; |
| | | /** |
| | | * 导åºAction |
| | | * @return |
| | | */ |
| | | void exportBeans(List<String> actionOid, HttpServletResponse response) throws PLException, IOException; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.service.impl; |
| | | import cn.hutool.core.io.FileUtil; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.corba.omd.qtm.QTInfo; |
| | | import com.vci.corba.portal.data.Constraint; |
| | | import com.vci.corba.portal.data.PLAction; |
| | | import com.vci.corba.portal.data.PLActionCls; |
| | | import com.vci.corba.portal.data.PLActionParam; |
| | | import com.vci.dto.PLActionClsDTO; |
| | | import com.vci.dto.PLActionDTO; |
| | | import com.vci.dto.PLActionQueryDTO; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.web.other.ExportActionLogBean; |
| | | import com.vci.web.other.ExportBeans; |
| | | import com.vci.web.other.LinkQTExportData; |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.util.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * Action管ççæå¡å®ç°ç±» |
| | | * @author yuxc |
| | | * @date 2024-8-16 |
| | | */ |
| | | @Service |
| | | public class OsActionServiceImpl implements OsActionServiceI { |
| | | |
| | | @Autowired |
| | | private PlatformClientUtil platformClientUtil; |
| | | /** |
| | | * ä¿åActionåç±»ä¿¡æ¯ |
| | | * @param pLActionCls Actionåç±»ä¿¡æ¯ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult saveActionCls(PLActionClsDTO pLActionCls) throws PLException { |
| | | |
| | | if (pLActionCls.getName() == null || pLActionCls.getName().trim().equals("")) { |
| | | throw new PLException("500", new String[]{"åç±»åç§°ä¸è½ä¸ºç©º!"}); |
| | | } |
| | | if (pLActionCls.getName().equals("æªåç±»")) { |
| | | throw new PLException("500", new String[]{"æªåç±»èç¹å·²ç»åå¨!"}); |
| | | } |
| | | PLActionCls pac = new PLActionCls(); |
| | | pac.id = WebUtil.getSnowflakePk(); |
| | | pac.name = pLActionCls.getName(); |
| | | pac.pid = pLActionCls.getPid(); |
| | | pac.description = pLActionCls.getDescription() == null ? "" : pLActionCls.getDescription(); |
| | | pac.creator = WebUtil.getCurrentUserId(); |
| | | pac.createTime = System.currentTimeMillis(); |
| | | pac.serialno = pLActionCls.getSerialno(); |
| | | // ä¿ååç±»ä¿¡æ¯ |
| | | String message = platformClientUtil.getUIService().creaetePLActionCls(pac); |
| | | if (message.startsWith("0")) { |
| | | if (message.equals("01")) { |
| | | message = "åç±»" + pac.name + "å·²ç»åå¨ï¼"; |
| | | } else if (message.equals("02")) { |
| | | message = "åä¸åç±»ä¸åºå·ä¸è½éå¤ï¼"; |
| | | } else { |
| | | message = "ä¿ååç±»æ¶åçå¼å¸¸ï¼" + message.substring(1); |
| | | } |
| | | throw new PLException("500", new String[]{message}); |
| | | } |
| | | return BaseResult.success("åç±»å建æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹Actionåç±»ä¿¡æ¯ |
| | | * @param pLActionCls Actionåç±»ä¿¡æ¯ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult updateActionCls(PLActionClsDTO pLActionCls) throws PLException { |
| | | |
| | | if (pLActionCls.getName() == null || pLActionCls.getName().trim().equals("")) { |
| | | throw new PLException("500", new String[]{"åç±»åç§°ä¸è½ä¸ºç©º!"}); |
| | | } |
| | | if (pLActionCls.getName().equals("æªåç±»")) { |
| | | throw new PLException("500", new String[]{"æªåç±»èç¹å·²ç»åå¨!"}); |
| | | } |
| | | if (pLActionCls.getId() == null || pLActionCls.getId().trim().equals("")) { |
| | | throw new PLException("500", new String[]{"主é®ä¸è½ä¸ºç©º!"}); |
| | | } |
| | | PLActionCls pac = new PLActionCls(); |
| | | pac.name = pLActionCls.getName(); |
| | | pac.pid = pLActionCls.getPid(); |
| | | pac.description = pLActionCls.getDescription() == null ? "" : pLActionCls.getDescription(); |
| | | pac.creator = WebUtil.getCurrentUserId(); |
| | | pac.createTime = System.currentTimeMillis(); |
| | | pac.serialno = pLActionCls.getSerialno(); |
| | | // ä¿®æ¹åç±»ä¿¡æ¯ |
| | | String message = platformClientUtil.getUIService().editPLActionCls(pac); |
| | | if (message.startsWith("0")) { |
| | | if (message.equals("01")) { |
| | | message = "åç±»" + pac.name + "å·²ç»åå¨ï¼"; |
| | | } else if (message.equals("02")) { |
| | | message = "åä¸åç±»ä¸åºå·ä¸è½éå¤ï¼"; |
| | | } else { |
| | | message = "ä¿®æ¹åç±»æ¶åçå¼å¸¸ï¼" + message.substring(1); |
| | | } |
| | | throw new PLException("500", new String[]{message}); |
| | | } |
| | | return BaseResult.success("åç±»ä¿®æ¹æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * è·åActionåç±»æ |
| | | * isExp æ¯å¦ç¨æ·å¯¼åº trueæ¯ï¼falseå¦ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult getActionTree(boolean isExp) throws PLException { |
| | | PLActionCls[] clses = platformClientUtil.getUIService().getPLActionClsArray(); |
| | | PLActionClsDTO treDto = new PLActionClsDTO(); |
| | | treDto.setName("Actionåç±»"); |
| | | Map<String, List<PLActionCls>> allDataMap = Arrays.stream(clses).collect(Collectors.groupingBy(pl -> pl.pid)); |
| | | |
| | | for (PLActionCls cls : clses) { |
| | | if (StringUtils.isBlank(cls.pid)) { |
| | | PLActionClsDTO parentDto = new PLActionClsDTO(); |
| | | parentDto.setId(cls.id); |
| | | parentDto.setName(cls.name); |
| | | parentDto.setPid(cls.pid); |
| | | parentDto.setDescription(cls.description); |
| | | parentDto.setCreator(cls.creator); |
| | | parentDto.setCreateTime(cls.createTime); |
| | | parentDto.setSerialno(cls.serialno); |
| | | //è¿éå¤çå¯¼åºæ çé»è¾ |
| | | if(isExp){ |
| | | Constraint[] consArray = new Constraint[1]; |
| | | consArray[0] = new Constraint("plactioncls", cls.id); |
| | | PLAction[] plActionsByConsArray = platformClientUtil.getUIService().getPLActionsByConsArray(consArray); |
| | | if(parentDto.getChilds().isEmpty() && plActionsByConsArray.length == 0){ |
| | | continue; |
| | | } |
| | | for (PLAction plAction : plActionsByConsArray) { |
| | | PLActionDTO plActionDTO = new PLActionDTO(); |
| | | plActionDTO.setPlName(plAction.plCode + "/" + plAction.plName); |
| | | plActionDTO.setPlCode(plAction.plCode); |
| | | plActionDTO.setPlOId(plAction.plOId); |
| | | parentDto.getActionChilds().add(plActionDTO); |
| | | } |
| | | } |
| | | addClsTreeNode(parentDto, allDataMap, isExp); |
| | | treDto.getChilds().add(parentDto); |
| | | } |
| | | } |
| | | PLActionClsDTO plac = new PLActionClsDTO(); |
| | | plac.setName("æªåç±»"); |
| | | if(isExp){ |
| | | Constraint[] consArray = new Constraint[1]; |
| | | consArray[0] = new Constraint("plactioncls", ""); |
| | | PLAction[] plActionsByConsArray = platformClientUtil.getUIService().getPLActionsByConsArray(consArray); |
| | | for (PLAction plAction : plActionsByConsArray) { |
| | | PLActionDTO plActionDTO = new PLActionDTO(); |
| | | plActionDTO.setPlName(plAction.plCode + "/" + plAction.plName); |
| | | plActionDTO.setPlCode(plAction.plCode); |
| | | plActionDTO.setPlOId(plAction.plOId); |
| | | plac.getActionChilds().add(plActionDTO); |
| | | } |
| | | } |
| | | treDto.getChilds().add(plac); |
| | | return BaseResult.success(treDto); |
| | | } |
| | | /** |
| | | * è·åActionè¡¨æ ¼æ°æ® |
| | | * dto æ¥è¯¢æ¡ä»¶ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult getActionTableData(PLActionQueryDTO dto) throws PLException { |
| | | Constraint[] consArray ; |
| | | if(StringUtils.isNotBlank(dto.getPlactioncls())){ |
| | | consArray = new Constraint[7]; |
| | | consArray[6] = new Constraint("plactioncls", dto.getPlactioncls()); |
| | | }else { |
| | | consArray = new Constraint[6]; |
| | | } |
| | | consArray[0] = new Constraint("plcode", dto.getPlcode()); |
| | | consArray[1] = new Constraint("plname", dto.getPlname()); |
| | | consArray[2] = new Constraint("plbsurl", dto.getPlbsurl()); |
| | | consArray[3] = new Constraint("plcsclass", dto.getPlcsclass()); |
| | | consArray[4] = new Constraint("pltypetype", dto.getPltypetype()); |
| | | consArray[5] = new Constraint("pldesc", dto.getPldesc()); |
| | | PLAction[] plActionsByConsArray = platformClientUtil.getUIService().getPLActionsByConsArray(consArray); |
| | | Arrays.sort(plActionsByConsArray, new Comparator<PLAction>() { |
| | | @Override |
| | | public int compare(PLAction o1, PLAction o2) { |
| | | String py1 = PinyinCommon.getPingYin(o1.plCode); |
| | | String py2 = PinyinCommon.getPingYin(o2.plCode); |
| | | return py1.compareTo(py2); |
| | | } |
| | | }); |
| | | return BaseResult.dataList(Arrays.asList(plActionsByConsArray)); |
| | | } |
| | | /** |
| | | * ä¿åActionæ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult saveAction(PLActionDTO dto) throws PLException { |
| | | if(StringUtils.isBlank(dto.getPlCode())){ |
| | | throw new PLException("500", new String[]{"请è¾å
¥ç¼å·"}); |
| | | } |
| | | PLAction[] actionsInDB= platformClientUtil.getUIService().getAllPLAction(); |
| | | for(int i =0;i<actionsInDB.length;i++){ |
| | | if (dto.getPlCode().equals(actionsInDB[i].plCode)) { |
| | | throw new PLException("500", new String[]{"æ°å»ºActionç¼å·éå¤ï¼è¯·éæ°è¾å
¥ç¼å·"}); |
| | | } |
| | | } |
| | | PLAction plAction = new PLAction(); |
| | | plAction.plOId = WebUtil.getSnowflakePk(); |
| | | plAction.plCode = StringUtils.defaultString(dto.getPlCode()); |
| | | plAction.plName = StringUtils.defaultString(dto.getPlName()); |
| | | plAction.plCSClass = StringUtils.defaultString(dto.getPlCSClass()); |
| | | plAction.plBSUrl = StringUtils.defaultString(dto.getPlBSUrl()); |
| | | plAction.plDesc = StringUtils.defaultString(dto.getPlDesc()); |
| | | plAction.plCreateUser = WebUtil.getCurrentUserId(); |
| | | plAction.plModifyUser = WebUtil.getCurrentUserId(); |
| | | plAction.plActionCls = StringUtils.defaultString(dto.getPlActionCls()); |
| | | plAction.plTypeType = StringUtils.defaultString(dto.getPlTypeType()); |
| | | boolean b = platformClientUtil.getUIService().savePLAction(plAction); |
| | | if(!b){ |
| | | throw new PLException("500", new String[]{"ä¿å失败ï¼ï¼"}); |
| | | } |
| | | return BaseResult.success("æä½æåï¼"); |
| | | } |
| | | /** |
| | | * ä¿®æ¹Actionæ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿®æ¹ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult updateAction(PLActionDTO dto) throws PLException { |
| | | if(StringUtils.isBlank(dto.getPlCode())){ |
| | | throw new PLException("500", new String[]{"ç¼å·ä¸è½ä¸ºç©º"}); |
| | | } |
| | | PLAction[] actionsInDB= platformClientUtil.getUIService().getAllPLAction(); |
| | | for(int i =0;i<actionsInDB.length;i++){ |
| | | if (dto.getPlCode().equals(actionsInDB[i].plCode) && !dto.getPlOId().equals(actionsInDB[i].plOId)) { |
| | | throw new PLException("500", new String[]{"ä¿®æ¹Actionç¼å·éå¤ï¼è¯·ç¡®è®¤ç¼å·"}); |
| | | } |
| | | } |
| | | PLAction plAction = new PLAction(); |
| | | plAction.plOId = StringUtils.defaultString(dto.getPlOId()); |
| | | plAction.plCode = StringUtils.defaultString(dto.getPlCode()); |
| | | plAction.plName = StringUtils.defaultString(dto.getPlName()); |
| | | plAction.plCSClass = StringUtils.defaultString(dto.getPlCSClass()); |
| | | plAction.plBSUrl = StringUtils.defaultString(dto.getPlBSUrl()); |
| | | plAction.plDesc = StringUtils.defaultString(dto.getPlDesc()); |
| | | plAction.plCreateUser = dto.getPlCreateUser(); |
| | | plAction.plModifyUser = WebUtil.getCurrentUserId(); |
| | | plAction.plActionCls = StringUtils.defaultString(dto.getPlActionCls()); |
| | | plAction.plTypeType = StringUtils.defaultString(dto.getPlTypeType()); |
| | | boolean b = platformClientUtil.getUIService().updatePLAction(plAction); |
| | | if(!b){ |
| | | throw new PLException("500", new String[]{"ä¿®æ¹å¤±è´¥ï¼ï¼"}); |
| | | } |
| | | return BaseResult.success("ä¿®æ¹æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * å é¤Actionæ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return å é¤ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult deleteAction(PLActionDTO dto) throws PLException { |
| | | PLAction plAction = new PLAction(); |
| | | plAction.plOId = StringUtils.defaultString(dto.getPlOId()); |
| | | plAction.plCode = StringUtils.defaultString(dto.getPlCode()); |
| | | plAction.plName = StringUtils.defaultString(dto.getPlName()); |
| | | plAction.plCSClass = StringUtils.defaultString(dto.getPlCSClass()); |
| | | plAction.plBSUrl = StringUtils.defaultString(dto.getPlBSUrl()); |
| | | plAction.plDesc = StringUtils.defaultString(dto.getPlDesc()); |
| | | plAction.plCreateUser = dto.getPlCreateUser(); |
| | | plAction.plModifyUser = WebUtil.getCurrentUserId(); |
| | | plAction.plActionCls = StringUtils.defaultString(dto.getPlActionCls()); |
| | | plAction.plTypeType = StringUtils.defaultString(dto.getPlTypeType()); |
| | | boolean b = platformClientUtil.getUIService().deletePLAction(plAction); |
| | | if(!b){ |
| | | throw new PLException("500", new String[]{"å é¤å¤±è´¥ï¼ï¼"}); |
| | | } |
| | | return BaseResult.success("å 餿åï¼"); |
| | | } |
| | | /** |
| | | * 导åºAction |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void exportBeans(List<String> actionOid, HttpServletResponse response) throws PLException, IOException { |
| | | String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); |
| | | String vciqtmfFileName = defaultTempFolder + File.separator + "actionTemplateExp" + new Date().getTime() + ".vciamf"; |
| | | HashMap exportBeans = new HashMap<String, Object>(); |
| | | getExportBeans(actionOid, exportBeans);// è·å¾å¯¼åºBeanåæ¶ï¼è®°å½log |
| | | |
| | | ObjectOutputStream vciamfFileStream = null; |
| | | try { |
| | | File vciqtmfFile = new File(vciqtmfFileName); |
| | | vciamfFileStream = new ObjectOutputStream(new FileOutputStream(vciqtmfFile)); |
| | | vciamfFileStream.writeObject(exportBeans); |
| | | }finally { |
| | | try { |
| | | if (vciamfFileStream != null) { |
| | | vciamfFileStream.flush(); |
| | | vciamfFileStream.close(); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new PLException("500",new String[]{"å¯¼åºæµå
³éå¼å¸¸ï¼"}); |
| | | } |
| | | } |
| | | ControllerUtil.writeFileToResponse(response,vciqtmfFileName); |
| | | FileUtil.del(defaultTempFolder + File.separator); |
| | | } |
| | | |
| | | /** |
| | | * å¤ç导åºç对象 |
| | | * @param actionOid çé¢éæ©çactionåè¡¨æ°æ® |
| | | * @param exportBeansMap 导åºå¯¹è±¡ |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | private void getExportBeans(List<String> actionOid, HashMap exportBeansMap) throws PLException { |
| | | PLActionCls[] plActionClsArray = platformClientUtil.getUIService().getPLActionClsArray(); |
| | | Map<String, PLActionCls> clsMap = Arrays.stream(plActionClsArray).collect(Collectors.toMap(e -> e.id, e -> e)); |
| | | ExportBeans exportBeans = new ExportBeans(); |
| | | for (String oid : actionOid) { |
| | | PLAction plAction = platformClientUtil.getUIService().getPLActionById(oid); |
| | | //æç¶èç¹åè¿è¡å¤ç |
| | | if(StringUtils.isNotBlank(plAction.plActionCls)){ |
| | | allPLActionClsParent(exportBeans, clsMap.get(plAction.plActionCls), clsMap); |
| | | } |
| | | exportBeans.getPLActions().put(plAction.plOId, plAction); |
| | | PLActionParam[] params = platformClientUtil.getUIService().getPLActionParamArrayByActionId(plAction.plOId); |
| | | if(params != null && params.length > 0){//妿忰åå¨ |
| | | for (PLActionParam plActionParam : params) {//æ·»å actionåæ° |
| | | exportBeans.addPLActionParamBean(plActionParam); |
| | | } |
| | | } |
| | | String category = clsMap.containsKey(plAction.plActionCls) ? clsMap.get(plAction.plActionCls).name : ""; |
| | | exportBeans.setLogBean(new ExportActionLogBean(ExportActionLogBean.RIGHT_STATE, |
| | | plAction.plCode,plAction.plName,plAction.plCSClass,plAction.plBSUrl, |
| | | plAction.plTypeType,plAction.plDesc,category)); |
| | | } |
| | | exportBeansMap.put("exportBeans", exportBeans); |
| | | } |
| | | //å¢å ç¶ç±»æ°æ® |
| | | private void allPLActionClsParent(ExportBeans exportBeans, PLActionCls cls, Map<String, PLActionCls> clsMap) { |
| | | if(cls.pid != ""){ |
| | | allPLActionClsParent(exportBeans, clsMap.get(cls.pid), clsMap); |
| | | } |
| | | exportBeans.addPLActionClsBean(cls); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å åèç¹ |
| | | * @param parentDto ç¶èç¹å¯¹è±¡ |
| | | * @param allDataMap ææåç»å¯¹è±¡ |
| | | * @param isExp true为导åºåè½çæ ï¼false为çé¢åç±»æ |
| | | */ |
| | | private void addClsTreeNode(PLActionClsDTO parentDto, Map<String, List<PLActionCls>> allDataMap, Boolean isExp) throws PLException { |
| | | if(allDataMap.containsKey(parentDto.id)){ |
| | | for (PLActionCls cls : allDataMap.get(parentDto.id)) { |
| | | PLActionClsDTO childDto = new PLActionClsDTO(); |
| | | childDto.setId(cls.id); |
| | | childDto.setName(cls.name); |
| | | childDto.setPid(cls.pid); |
| | | childDto.setDescription(cls.description); |
| | | childDto.setCreator(cls.creator); |
| | | childDto.setCreateTime(cls.createTime); |
| | | childDto.setSerialno(cls.serialno); |
| | | if(isExp){ |
| | | Constraint[] consArray = new Constraint[1]; |
| | | consArray[0] = new Constraint("plactioncls", cls.id); |
| | | PLAction[] plActionsByConsArray = platformClientUtil.getUIService().getPLActionsByConsArray(consArray); |
| | | if(parentDto.getChilds().isEmpty() && plActionsByConsArray.length == 0){ |
| | | continue; |
| | | } |
| | | for (PLAction plAction : plActionsByConsArray) { |
| | | PLActionDTO plActionDTO = new PLActionDTO(); |
| | | plActionDTO.setPlName(plAction.plCode + "/" + plAction.plName); |
| | | plActionDTO.setPlCode(plAction.plCode); |
| | | plActionDTO.setPlOId(plAction.plOId); |
| | | parentDto.getActionChilds().add(plActionDTO); |
| | | } |
| | | } |
| | | addClsTreeNode(childDto, allDataMap, isExp); |
| | | parentDto.getChilds().add(childDto); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.util; |
| | | |
| | | import net.sourceforge.pinyin4j.PinyinHelper; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; |
| | | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
| | | |
| | | /** |
| | | * |
| | | |
| | | * @author: ligang |
| | | |
| | | * @createtime: 2012-12-26 |
| | | |
| | | * @version: |
| | | |
| | | */ |
| | | public class PinyinCommon { |
| | | |
| | | /** |
| | | * å¾å° å
¨æ¼ |
| | | * @param src |
| | | * @return |
| | | */ |
| | | public static String getPingYin(String src){ |
| | | char[] t1 = null; |
| | | t1=src.toCharArray(); |
| | | String[] t2 = new String[t1.length]; |
| | | HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat(); |
| | | t3.setCaseType(HanyuPinyinCaseType.LOWERCASE); |
| | | t3.setToneType(HanyuPinyinToneType.WITHOUT_TONE); |
| | | t3.setVCharType(HanyuPinyinVCharType.WITH_V); |
| | | String t4=""; |
| | | int t0=t1.length; |
| | | try { |
| | | for (int i=0;i<t0;i++) { |
| | | //夿æ¯å¦ä¸ºæ±åå符 |
| | | if(Character.toString(t1[i]).matches("[\\u4E00-\\u9FA5]+")) { |
| | | t2 = PinyinHelper.toHanyuPinyinStringArray(t1[i], t3); |
| | | t4+=t2[0]; |
| | | } else { |
| | | t4+= Character.toString(t1[i]); |
| | | } |
| | | } |
| | | return t4; |
| | | } |
| | | catch (BadHanyuPinyinOutputFormatCombination e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | return t4; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ä¸æé¦åæ¯ |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static String getPinYinHeadChar(String str) { |
| | | |
| | | String convert = ""; |
| | | for (int j = 0; j < str.length(); j++) { |
| | | char word = str.charAt(j); |
| | | String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word); |
| | | if (pinyinArray != null) { |
| | | convert += pinyinArray[0].charAt(0); |
| | | }else { |
| | | convert += word; |
| | | } |
| | | } |
| | | return convert; |
| | | } |
| | | /** |
| | | * å°å符串转移为ASCIIç |
| | | * @param cnStr |
| | | * @return |
| | | */ |
| | | public static String getCnASCII(String cnStr) { |
| | | StringBuffer strBuf = new StringBuffer(); |
| | | byte[] bGBK = cnStr.getBytes(); |
| | | for(int i=0;i <bGBK.length;i++){ |
| | | //System.out.println(Integer.toHexString(bGBK[i]&0xff)); |
| | | strBuf.append(Integer.toHexString(bGBK[i]&0xff)); |
| | | } |
| | | return strBuf.toString(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | //ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | // 模æ¿å表æ¥è¯¢ |
| | | export function gridTemplate(params) { |
| | | return request({ |
| | | url: "/api/templateController/queryTemplateList", |
| | | method: "get", |
| | | params:{ |
| | | ...params |
| | | } |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | //龿¥ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | // å é¤ |
| | | export function deleteLinkTemplate(params) { |
| | | return request({ |
| | | url: "/api/templateController/deleteLinkTemplate", |
| | | method: "delete", |
| | | data:params |
| | | }); |
| | | } |
| | |
| | | import request from '@/router/axios'; |
| | | //æ¥è¯¢æ¨¡æ¿å®ä¹ |
| | | // 模æ¿å表æ¥è¯¢ |
| | | // 模æ¿å表å®ä¹ä¸ææ¡æ¥è¯¢ |
| | | export function gridTemplate(params) { |
| | | return request({ |
| | | url: "/api/templateController/queryTemplateList", |
| | |
| | | }); |
| | | } |
| | | |
| | | export function getObjTypeQTs(params) { |
| | | return request({ |
| | | url: "/api/templateController/getObjTypeQTs", |
| | | method: "get", |
| | | params:{ |
| | | ...params |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateTemplate(params) { |
| | | return request({ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // å表æ¥è¯¢ |
| | | export function getSysModelTreeMenuByPID(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/getSysModelTreeMenuByPID", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢ |
| | | export function addModel(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addModel", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateModel(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/updateModel", |
| | | method: "put", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // å é¤ |
| | | export function delModule(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/delModule", |
| | | method: "delete", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // 导åºsql |
| | | export function exportFunctionSql (params) { |
| | | return request({ |
| | | url: '/api/hmSysModConfigController/exportFunctionSql', |
| | | method: 'get', |
| | | headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | // å¢å æä½ç±»å |
| | | export function addOperationType(data) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addOperationType", |
| | | method: "post", |
| | | data |
| | | }); |
| | | } |
| | | |
| | |
| | | </el-button> |
| | | </div> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 300px);"> |
| | | <div style="height: calc(100vh - 260px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | |
| | | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div ref="TreeBox" style="height: calc(100vh - 144px);!important;"> |
| | | <div class="headerCon"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å建 |
| | | </el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">å¯¼åº |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导å
¥ |
| | | </el-button> |
| | | <el-button class="smallBtn" plain size="small" type="primary" |
| | | @click="checkViewClickHandler">æ¥ç使ç¨èå´ |
| | | </el-button> |
| | | </div> |
| | | <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 280px);"> |
| | | <div style="height: calc(100vh - 190px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud ref="crud" |
| | | :data="crudData" :option="crudOption" :table-loading="tableLoading" style="margin-top: 10px"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">å建</el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">ä¿®æ¹</el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">å é¤</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导åº</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导å
¥</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getBizTypes} from "@/api/modeling/businessType/api"; |
| | | import {gridTemplate,saveTemplate,updateTemplate,deleteTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import func from "@/util/func"; |
| | | import {dateFormat} from "@/util/date"; |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | treeOption: { |
| | | height: 'auto', |
| | | defaultExpandedKeys: ['topNode'], |
| | | menu: false, |
| | | addBtn: false, |
| | | props: { |
| | | label: 'label', |
| | | value: 'oid', |
| | | children: 'children' |
| | | } |
| | | }, |
| | | nodeRow: {}, |
| | | treeData: [ { |
| | | label: 'ä¸å¡ç±»åæ ', |
| | | oid: 'topNode', |
| | | children: [] |
| | | }], |
| | | templateForm: '', |
| | | templateData: [], |
| | | form: { |
| | | name: '' |
| | | }, |
| | | rules: { |
| | | name: [ |
| | | {required: true, message: '请è¾å
¥æ¥è¯¢æ¨¡æ¿åç§°', trigger: 'blur'} |
| | | ] |
| | | }, |
| | | title: '', |
| | | visible: false, |
| | | tableLoading: false, |
| | | crudData: [], |
| | | crudOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: true, |
| | | menu: false, |
| | | height: "auto", |
| | | calcHeight: -40, |
| | | tip: false, |
| | | column: [{ |
| | | label: 'æ¥è¯¢æ¨¡æ¿åç§°', |
| | | prop: 'name' |
| | | }, { |
| | | label: 'å建人', |
| | | prop: 'creator' |
| | | }, { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | formatter:function (row, value) { |
| | | return dateFormat(new Date(value)) |
| | | } |
| | | }] |
| | | }, |
| | | selectionRow: [], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | methods: { |
| | | //æ 表æ¥è¯¢ |
| | | getTreeList() { |
| | | const loading = this.$loading({}); |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.attributes.id; |
| | | return item; |
| | | }); |
| | | this.treeData[0].children = data; |
| | | loading.close(); |
| | | }) |
| | | }, |
| | | |
| | | // æ ç¹å» |
| | | nodeClick(row) { |
| | | this.nodeRow = row; |
| | | this.tableLoading = true; |
| | | this.getTemp(); |
| | | }, |
| | | getTemp() { |
| | | gridTemplate({btmName: this.nodeRow.label, linkFlag: false}).then(res => { |
| | | this.crudData = res.data.data; |
| | | this.tableLoading = false; |
| | | }) |
| | | }, |
| | | selectHandler(selection, row) { |
| | | |
| | | }, |
| | | changeTemp(data) { |
| | | this.$refs.queryCrud.clearSelection(); |
| | | if (data.value != '') { |
| | | let abNames = data.item.abNames.join(',').toLowerCase().split(',') |
| | | |
| | | } |
| | | }, |
| | | //å建 |
| | | addHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©è¦æ·»å çèç¹'); |
| | | return; |
| | | } |
| | | this.title = 'add'; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | }); |
| | | }, |
| | | //ä¿®æ¹ |
| | | editHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.form.name = this.templateForm; |
| | | this.title = 'edit'; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | }); |
| | | }, |
| | | // æ°å¢ç¼è¾ä¿å |
| | | addDialogSavaHandler() { |
| | | this.$refs.form.validate((valid) => { |
| | | const saveFunction = this.title === 'add' ? saveTemplate : updateTemplate; |
| | | if (valid) { |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.addDialogClose(); |
| | | } |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | // æ°å¢ç¼è¾å¯¹è¯æ¡åæ¶ |
| | | addDialogClose() { |
| | | this.form = { |
| | | name: '' |
| | | }; |
| | | this.$refs.form.clearValidate(); |
| | | this.visible = false; |
| | | }, |
| | | //å é¤ |
| | | delHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©æ°æ®'); |
| | | return; |
| | | } |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteTemplate({ |
| | | name: this.templateForm, |
| | | btmName: this.nodeRow.label, |
| | | linkFlag: false |
| | | }).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div ref="TreeBox" style="height: calc(100vh - 144px);!important;"> |
| | | <div class="headerCon"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å建 |
| | | </el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">å¯¼åº |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导å
¥ |
| | | </el-button> |
| | | <el-button class="smallBtn" plain size="small" type="primary" |
| | | @click="checkViewClickHandler">æ¥ç使ç¨èå´ |
| | | </el-button> |
| | | </div> |
| | | <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 280px);"> |
| | | <div style="height: calc(100vh - 190px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud ref="crud" |
| | | :data="crudData" :option="crudOption" :table-loading="tableLoading" style="margin-top: 10px"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">å建</el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">ä¿®æ¹</el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">å é¤</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导åº</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导å
¥</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {gridLink} from "@/api/modeling/linkType/api"; |
| | | import { gridTemplate, saveTemplate, updateTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import {deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import func from "@/util/func"; |
| | | import {dateFormat} from "@/util/date"; |
| | | import basicOption from "@/util/basic-option"; |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | treeOption: { |
| | | height: 'auto', |
| | | defaultExpandedKeys: ['topNode'], |
| | | menu: false, |
| | | addBtn: false, |
| | | props: { |
| | | label: 'label', |
| | | value: 'oid', |
| | | children: 'children' |
| | | } |
| | | }, |
| | | nodeRow: {}, |
| | | treeData: [{ |
| | | label: '龿¥ç±»å', |
| | | oid: 'topNode', |
| | | children: [] |
| | | }], |
| | | templateForm: '', |
| | | templateData: [], |
| | | form: { |
| | | name: '' |
| | | }, |
| | | rules: { |
| | | name: [ |
| | | {required: true, message: '请è¾å
¥æ¥è¯¢æ¨¡æ¿åç§°', trigger: 'blur'} |
| | | ] |
| | | }, |
| | | title: '', |
| | | visible: false, |
| | | tableLoading: false, |
| | | crudData: [], |
| | | crudOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: true, |
| | | menu: false, |
| | | height: "auto", |
| | | calcHeight: -40, |
| | | tip: false, |
| | | column: [{ |
| | | label: 'æ¥è¯¢æ¨¡æ¿åç§°', |
| | | prop: 'name' |
| | | }, { |
| | | label: 'å建人', |
| | | prop: 'creator' |
| | | }, { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | formatter:function (row, value) { |
| | | return dateFormat(new Date(value)) |
| | | } |
| | | }] |
| | | }, |
| | | selectionRow: [], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | methods: { |
| | | //æ 表æ¥è¯¢ |
| | | getTreeList() { |
| | | const loading = this.$loading({}); |
| | | gridLink().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label=item.name; |
| | | return item; |
| | | }); |
| | | this.treeData[0].children = data; |
| | | loading.close(); |
| | | }) |
| | | }, |
| | | |
| | | // æ ç¹å» |
| | | nodeClick(row) { |
| | | this.nodeRow = row; |
| | | this.tableLoading = true; |
| | | this.getTemp(); |
| | | }, |
| | | getTemp() { |
| | | gridTemplate({btmName: this.nodeRow.label, linkFlag: true}).then(res => { |
| | | this.crudData = res.data.data; |
| | | this.tableLoading = false; |
| | | }) |
| | | }, |
| | | selectHandler(selection, row) { |
| | | |
| | | }, |
| | | changeTemp(data) { |
| | | this.$refs.queryCrud.clearSelection(); |
| | | if (data.value != '') { |
| | | let abNames = data.item.abNames.join(',').toLowerCase().split(',') |
| | | |
| | | } |
| | | }, |
| | | //å建 |
| | | addHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©è¦æ·»å çèç¹'); |
| | | return; |
| | | } |
| | | this.title = 'add'; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | }); |
| | | }, |
| | | //ä¿®æ¹ |
| | | editHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.form.name = this.templateForm; |
| | | this.title = 'edit'; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | }); |
| | | }, |
| | | // æ°å¢ç¼è¾ä¿å |
| | | addDialogSavaHandler() { |
| | | this.$refs.form.validate((valid) => { |
| | | const saveFunction = this.title === 'add' ? saveTemplate : updateTemplate; |
| | | if (valid) { |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.addDialogClose(); |
| | | } |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | // æ°å¢ç¼è¾å¯¹è¯æ¡åæ¶ |
| | | addDialogClose() { |
| | | this.form = { |
| | | name: '' |
| | | }; |
| | | this.$refs.form.clearValidate(); |
| | | this.visible = false; |
| | | }, |
| | | //å é¤ |
| | | delHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©æ°æ®'); |
| | | return; |
| | | } |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteLinkTemplate({ |
| | | name: this.templateForm, |
| | | btmName: this.nodeRow.label, |
| | | linkFlag: false |
| | | }).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <el-main> |
| | | <basic-container> |
| | | 模æ¿å表ï¼<avue-select v-model="templateForm" placeholder="è¯·éæ©æ¨¡æ¿" type="tree" :dic="templateData" @change="changeTemp"></avue-select> |
| | | <h3>æ¥è¯¢å±æ§</h3> |
| | | <avue-crud ref="queryCrud" |
| | | :data="attrData" :option="attrOption" :table-loading="tableLoading" style="margin-top: 10px"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | |
| | | menu:false, |
| | | height: "auto", |
| | | calcHeight: -40, |
| | | title:'æ¥è¯¢å±æ§', |
| | | tip:false, |
| | | column: [{ |
| | | label: 'åæ®µç¼ç ', |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | | <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </span> |
| | | </avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <el-form ref="form" :model="form" label-width="85px" style="height: 79vh"> |
| | | <span v-if="form.childType !== 0"> |
| | | <el-form-item label="模ååï¼"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥æ¨¡åå"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="模åå«åï¼"> |
| | | <el-input v-model="form.alias" placeholder="模åå«åç¨æ¥è®°å½æ¥å¿ä½¿ç¨"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="C/Sï¼"> |
| | | <el-input v-model="form.pathC" :rows="3" placeholder="请è¾å
¥C/Sè·¯å¾" type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="B/Sï¼"> |
| | | <el-input v-model="form.path" :rows="3" placeholder="请è¾å
¥B/Sè·¯å¾" type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label=".NETï¼"> |
| | | <el-input v-model="form.resourceDotNet" :rows="3" placeholder="请è¾å
¥.NET" type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="Mobileï¼"> |
| | | <el-input v-model="form.resourceMobile" :rows="3" placeholder="请è¾å
¥Mobile" type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åºå·ï¼"> |
| | | <el-input v-model="form.sort" placeholder="æ°åï¼æè¿°è¯¥æ¨¡åå¨å
¶ç¶æ¨¡åä¸çæ¾ç¤ºé¡ºåº"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç®å¾ï¼"> |
| | | <el-input v-model="form.source"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.remark" :rows="3" placeholder="请è¾å
¥æè¿°" type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦ææï¼"> |
| | | <el-switch |
| | | v-model="form.isValid" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"> |
| | | </el-switch> |
| | | <el-link :underline="false" style="margin-left: 20px" type="danger">ä¸çæï¼ä¸éæ©ï¼æ¶ï¼è¯¥æ¨¡åå¨åè½æ¨¡åææé䏿¾ç¤º</el-link> |
| | | </el-form-item> |
| | | </span> |
| | | <span v-if="form.childType === 0"> |
| | | <el-form-item label="åç§°ï¼"> |
| | | <el-input v-model="form.name" :disabled="form.childType === 0" placeholder="请è¾å
¥åç§°"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ è¯ï¼"> |
| | | <el-input v-model="form.code" :disabled="form.childType === 0" placeholder="请è¾å
¥æ è¯"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å«åï¼"> |
| | | <el-input v-model="form.alias" placeholder="请è¾å
¥å«å"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¼å·ï¼"> |
| | | <el-input v-model="form.sort" :disabled="form.childType === 0" placeholder="请è¾å
¥ç¼å·"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.remark" :disabled="form.childType === 0" placeholder="请è¾å
¥æè¿°"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦ææï¼"> |
| | | <el-switch |
| | | v-model="form.isValid" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"> |
| | | </el-switch> |
| | | |
| | | </el-form-item> |
| | | </span> |
| | | </el-form> |
| | | <div v-if="form.childType && form.childType !== 0" class="btnBox"> |
| | | <el-button v-if="!addStatus" :disabled="mangeShowBtn ? false : !childTypeBtn" icon="el-icon-plus" plain |
| | | size="small" |
| | | type="primary" @click="addClickHandler">å¢å |
| | | </el-button> |
| | | <el-button v-if="addStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="addSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button v-if="!editStatus" :disabled="mangeShowBtn" icon="el-icon-edit" plain size="small" type="primary" |
| | | @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button v-if="editStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="editSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn" icon="el-icon-close" plain size="small" type="danger" |
| | | @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn ? true : childTypeBtn" icon="el-icon-circle-plus-outline" plain |
| | | size="small" |
| | | type="primary" @click="addMethodsClickHandler">å¢å æä½ç±»å |
| | | </el-button> |
| | | <el-button v-if="this.form.childType ? mangeShowBtn :true" icon="el-icon-circle-close" plain size="small" |
| | | type="danger" |
| | | @click="addClickHandler">å é¤éç³»ç»æ¨¡å |
| | | </el-button> |
| | | <el-button v-if="this.form.childType ? mangeShowBtn :true" icon="el-icon-circle-close" plain size="small" |
| | | type="danger" |
| | | @click="addClickHandler">å é¤ä¸å¡æ¨¡å |
| | | </el-button> |
| | | <el-button :disabled="!mangeShowBtn" icon="el-icon-upload2" plain size="small" type="primary" |
| | | @click="upLoadClickHandler">导å
¥ |
| | | </el-button> |
| | | <el-button :disabled="!mangeShowBtn" icon="el-icon-download" plain size="small" type="primary" |
| | | @click="exportClickHandler">å¯¼åº |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="sqlClickExportClick">导åºsql |
| | | </el-button> |
| | | </div> |
| | | <div v-if="form.childType === 0" class="btnBox"> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary">ä¿®æ¹å«å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger">å é¤ |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | | </el-main> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="methodsVisble" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="æä½åç±»" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | ref="methodsCrud" |
| | | :data="methodsData" |
| | | :option="methodsOption" |
| | | :table-loading="methodsLoading" |
| | | @row-click="rowMethodsClickHandler" |
| | | @selection-change="selectMethodsChange"> |
| | | |
| | | </avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="methodsVisble = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="methodsSaveClickHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | //管çåè½æ¨¡å |
| | | import { |
| | | getSysModelTreeMenuByPID, |
| | | addModel, |
| | | updateModel, |
| | | delModule, |
| | | exportFunctionSql, |
| | | addOperationType |
| | | } from "@/api/systemModel/mangeModel/api" |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | lastIndex: null, |
| | | methodsList: [], |
| | | methodsData: [], |
| | | methodsOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | menu: false, |
| | | height: 500, |
| | | column: [ |
| | | { |
| | | label: 'æä½åç±»', |
| | | prop: 'name', |
| | | sortable: true, |
| | | } |
| | | ] |
| | | }, |
| | | methodsLoading: false, |
| | | methodsVisble: false, |
| | | defalutName: ['name', 'alias', 'pathC', 'path', 'resourceDotNet', 'resourceMobile', 'sort', 'source', 'remark', 'code'], |
| | | refresh: Math.random(), |
| | | addStatus: false, |
| | | editStatus: false, |
| | | nodeRow: {}, |
| | | form: {}, |
| | | treeData: [], |
| | | treeOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | defaultExpandAll: false, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | }, |
| | | lazy: true, |
| | | treeLoad: (node, resolve) => { |
| | | const params = { |
| | | parentId: node.level === 0 ? "modelManagmentNode" : node.data.id, |
| | | modeType: node.level === 0 ? "firstNode" : node.data.modeType, |
| | | } |
| | | getSysModelTreeMenuByPID(params).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | id: item.id, |
| | | name: item.name, |
| | | leaf: !item.hasChildren |
| | | } |
| | | })) |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | /** |
| | | * childType |
| | | * 为-1 å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * ä¸ä¸º-1 éè å é¤éç³»ç»æ¨¡å å é¤ä¸å¡æ¨¡å |
| | | * 为1æ¶ ç¦ç¨æä½ç±»åã导å
¥ãå¯¼åº |
| | | * 为2æ¶ ç¦ç¨å¢å 导å
¥ å¯¼åº |
| | | * mangeShowBtn 为 true è¯´ææ¯é¡¶å±èç¹ å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * @returns {Number} |
| | | */ |
| | | mangeShowBtn() { |
| | | return this.form.childType === -1; |
| | | }, |
| | | childTypeBtn() { |
| | | return this.form.childType === 1; |
| | | } |
| | | }, |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row.childType); |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | this.resetFormValue(); |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | }, |
| | | |
| | | // æ°å¢ä¿åæé® |
| | | addSaveClickHandler() { |
| | | if (!this.form.name) { |
| | | this.$message.error('模ååä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathC && this.form.pathC.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | this.form.parentId = this.form.id; |
| | | addModel(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.addStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler() { |
| | | console.log(this.form); |
| | | this.editStatus = true; |
| | | this.addStatus = false; |
| | | }, |
| | | |
| | | // ä¿®æ¹ä¿å |
| | | editSaveClickHandler() { |
| | | if (!this.form.name) { |
| | | this.$message.error('模ååä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathC && this.form.pathC.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | |
| | | updateModel(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.editStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å é¤æé® |
| | | delClickHandler() { |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delModule(this.form).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 导åºsql |
| | | sqlClickExportClick() { |
| | | exportFunctionSql({isFunction: true}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }); |
| | | }, |
| | | |
| | | // æä½åç±»å¤é |
| | | selectMethodsChange(list) { |
| | | this.methodsList = list; |
| | | }, |
| | | |
| | | // å¢å æä½ç±»å |
| | | addMethodsClickHandler() { |
| | | this.methodsLoading = true; |
| | | getSysModelTreeMenuByPID({parentId: 'sysOptionNode'}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.methodsVisble = true; |
| | | const data = res.data.data[0].children; |
| | | this.methodsData = data; |
| | | this.methodsLoading = false; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å¢å æä½ç±»åä¿å |
| | | methodsSaveClickHandler() { |
| | | let list = this.methodsList.map(item => { |
| | | return { |
| | | funcId: this.nodeRow.id, |
| | | operId: item.id, |
| | | operName: item.name, |
| | | operIndentify: item.code, |
| | | operAlias: item.alias, |
| | | operDesc: item.remark |
| | | } |
| | | }) |
| | | addOperationType(list).then(res => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.methodsVisble = false; |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.resetFormValue(); |
| | | this.form.childType = null; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç¹å»è¡ |
| | | rowMethodsClickHandler(row) { |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.methodsCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.methodsList = []; |
| | | } |
| | | ); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .el-form-item .el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | .btnBox { |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | | <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </span> |
| | | </avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <el-form ref="form" :model="form" label-width="85px" style="height: 79vh"> |
| | | <span v-if="form.childType !== 0"> |
| | | <el-form-item label="模ååï¼"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥æ¨¡åå"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="模åå«åï¼"> |
| | | <el-input v-model="form.alias" placeholder="模åå«åç¨æ¥è®°å½æ¥å¿ä½¿ç¨"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="C/Sï¼"> |
| | | <el-input v-model="form.pathC" :rows="3" placeholder="请è¾å
¥C/Sè·¯å¾" type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="B/Sï¼"> |
| | | <el-input v-model="form.path" :rows="3" placeholder="请è¾å
¥B/Sè·¯å¾" type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label=".NETï¼"> |
| | | <el-input v-model="form.resourceDotNet" :rows="3" placeholder="请è¾å
¥.NET" type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="Mobileï¼"> |
| | | <el-input v-model="form.resourceMobile" :rows="3" placeholder="请è¾å
¥Mobile" type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åºå·ï¼"> |
| | | <el-input v-model="form.sort" placeholder="æ°åï¼æè¿°è¯¥æ¨¡åå¨å
¶ç¶æ¨¡åä¸çæ¾ç¤ºé¡ºåº"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç®å¾ï¼"> |
| | | <el-input v-model="form.source"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.remark" :rows="3" placeholder="请è¾å
¥æè¿°" type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦ææï¼"> |
| | | <el-switch |
| | | v-model="form.isValid" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"> |
| | | </el-switch> |
| | | <el-link :underline="false" style="margin-left: 20px" type="danger">ä¸çæï¼ä¸éæ©ï¼æ¶ï¼è¯¥æ¨¡åå¨åè½æ¨¡åææé䏿¾ç¤º</el-link> |
| | | </el-form-item> |
| | | </span> |
| | | <span v-if="form.childType === 0"> |
| | | <el-form-item label="åç§°ï¼"> |
| | | <el-input v-model="form.name" :disabled="form.childType === 0" placeholder="请è¾å
¥åç§°"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ è¯ï¼"> |
| | | <el-input v-model="form.code" :disabled="form.childType === 0" placeholder="请è¾å
¥æ è¯"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å«åï¼"> |
| | | <el-input v-model="form.alias" placeholder="请è¾å
¥å«å"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¼å·ï¼"> |
| | | <el-input v-model="form.sort" :disabled="form.childType === 0" placeholder="请è¾å
¥ç¼å·"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.remark" :disabled="form.childType === 0" placeholder="请è¾å
¥æè¿°"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦ææï¼"> |
| | | <el-switch |
| | | v-model="form.isValid" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"> |
| | | </el-switch> |
| | | |
| | | </el-form-item> |
| | | </span> |
| | | </el-form> |
| | | <div v-if="form.childType && form.childType !== 0" class="btnBox"> |
| | | <el-button v-if="!addStatus" :disabled="mangeShowBtn ? false : !childTypeBtn" icon="el-icon-plus" plain |
| | | size="small" |
| | | type="primary" @click="addClickHandler">å¢å |
| | | </el-button> |
| | | <el-button v-if="addStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="addSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button v-if="!editStatus" :disabled="mangeShowBtn" icon="el-icon-edit" plain size="small" type="primary" |
| | | @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button v-if="editStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="editSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn" icon="el-icon-close" plain size="small" type="danger" |
| | | @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn ? true : childTypeBtn" icon="el-icon-circle-plus-outline" plain |
| | | size="small" |
| | | type="primary" @click="addMethodsClickHandler">å¢å æä½ç±»å |
| | | </el-button> |
| | | <el-button v-if="this.form.childType ? mangeShowBtn :true" icon="el-icon-circle-close" plain size="small" |
| | | type="danger" |
| | | @click="addClickHandler">å é¤éç³»ç»æ¨¡å |
| | | </el-button> |
| | | <el-button v-if="this.form.childType ? mangeShowBtn :true" icon="el-icon-circle-close" plain size="small" |
| | | type="danger" |
| | | @click="addClickHandler">å é¤ä¸å¡æ¨¡å |
| | | </el-button> |
| | | <el-button :disabled="!mangeShowBtn" icon="el-icon-upload2" plain size="small" type="primary" |
| | | @click="upLoadClickHandler">导å
¥ |
| | | </el-button> |
| | | <el-button :disabled="!mangeShowBtn" icon="el-icon-download" plain size="small" type="primary" |
| | | @click="exportClickHandler">å¯¼åº |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="sqlClickExportClick">导åºsql |
| | | </el-button> |
| | | </div> |
| | | <div v-if="form.childType === 0" class="btnBox"> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary">ä¿®æ¹å«å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger">å é¤ |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | | </el-main> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="methodsVisble" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="æä½åç±»" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | ref="methodsCrud" |
| | | :data="methodsData" |
| | | :option="methodsOption" |
| | | :table-loading="methodsLoading" |
| | | @row-click="rowMethodsClickHandler" |
| | | @selection-change="selectMethodsChange"> |
| | | |
| | | </avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="methodsVisble = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="methodsSaveClickHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | //管çåè½æ¨¡å |
| | | import { |
| | | getSysModelTreeMenuByPID, |
| | | addModel, |
| | | updateModel, |
| | | delModule, |
| | | exportFunctionSql, |
| | | addOperationType |
| | | } from "@/api/systemModel/mangeModel/api" |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | lastIndex: null, |
| | | methodsList: [], |
| | | methodsData: [], |
| | | methodsOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | menu: false, |
| | | height: 500, |
| | | column: [ |
| | | { |
| | | label: 'æä½åç±»', |
| | | prop: 'name', |
| | | sortable: true, |
| | | } |
| | | ] |
| | | }, |
| | | methodsLoading: false, |
| | | methodsVisble: false, |
| | | defalutName: ['name', 'alias', 'pathC', 'path', 'resourceDotNet', 'resourceMobile', 'sort', 'source', 'remark', 'code'], |
| | | refresh: Math.random(), |
| | | addStatus: false, |
| | | editStatus: false, |
| | | nodeRow: {}, |
| | | form: {}, |
| | | treeData: [], |
| | | treeOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | defaultExpandAll: false, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | }, |
| | | lazy: true, |
| | | treeLoad: (node, resolve) => { |
| | | const params = { |
| | | parentId: node.level === 0 ? "systemManagmentNode" : node.data.id, |
| | | modeType: node.level === 0 ? "firstNode" : node.data.modeType, |
| | | } |
| | | getSysModelTreeMenuByPID(params).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | id: item.id, |
| | | name: item.name, |
| | | leaf: !item.hasChildren |
| | | } |
| | | })) |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | /** |
| | | * childType |
| | | * 为-1 å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * ä¸ä¸º-1 éè å é¤éç³»ç»æ¨¡å å é¤ä¸å¡æ¨¡å |
| | | * 为1æ¶ ç¦ç¨æä½ç±»åã导å
¥ãå¯¼åº |
| | | * 为2æ¶ ç¦ç¨å¢å 导å
¥ å¯¼åº |
| | | * mangeShowBtn 为 true è¯´ææ¯é¡¶å±èç¹ å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * @returns {Number} |
| | | */ |
| | | mangeShowBtn() { |
| | | return this.form.childType === -1; |
| | | }, |
| | | childTypeBtn() { |
| | | return this.form.childType === 1; |
| | | } |
| | | }, |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row.childType); |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | this.resetFormValue(); |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | }, |
| | | |
| | | // æ°å¢ä¿åæé® |
| | | addSaveClickHandler() { |
| | | if (!this.form.name) { |
| | | this.$message.error('模ååä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathC && this.form.pathC.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | this.form.parentId = this.form.id; |
| | | addModel(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.addStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler() { |
| | | console.log(this.form); |
| | | this.editStatus = true; |
| | | this.addStatus = false; |
| | | }, |
| | | |
| | | // ä¿®æ¹ä¿å |
| | | editSaveClickHandler() { |
| | | if (!this.form.name) { |
| | | this.$message.error('模ååä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathC && this.form.pathC.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | |
| | | updateModel(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.editStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å é¤æé® |
| | | delClickHandler() { |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delModule(this.form).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 导åºsql |
| | | sqlClickExportClick() { |
| | | exportFunctionSql({isFunction: true}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }); |
| | | }, |
| | | |
| | | // æä½åç±»å¤é |
| | | selectMethodsChange(list) { |
| | | this.methodsList = list; |
| | | }, |
| | | |
| | | // å¢å æä½ç±»å |
| | | addMethodsClickHandler() { |
| | | this.methodsLoading = true; |
| | | getSysModelTreeMenuByPID({parentId: 'sysOptionNode'}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.methodsVisble = true; |
| | | const data = res.data.data[0].children; |
| | | this.methodsData = data; |
| | | this.methodsLoading = false; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å¢å æä½ç±»åä¿å |
| | | methodsSaveClickHandler() { |
| | | let list = this.methodsList.map(item => { |
| | | return { |
| | | funcId: this.nodeRow.id, |
| | | operId: item.id, |
| | | operName: item.name, |
| | | operIndentify: item.code, |
| | | operAlias: item.alias, |
| | | operDesc: item.remark |
| | | } |
| | | }) |
| | | addOperationType(list).then(res => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.methodsVisble = false; |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.resetFormValue(); |
| | | this.form.childType = null; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç¹å»è¡ |
| | | rowMethodsClickHandler(row) { |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.methodsCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.methodsList = []; |
| | | } |
| | | ); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .el-form-item .el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | .btnBox { |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | | <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </span> |
| | | </avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <el-form ref="form" :model="form" label-width="85px" style="height: 79vh"> |
| | | <el-form-item label="åç§°ï¼"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥åç§°"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ è¯ï¼"> |
| | | <el-input v-model="form.code" placeholder="请è¾å
¥æ è¯"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å«åï¼"> |
| | | <el-input v-model="form.alias" placeholder="请è¾å
¥å«å"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¼å·ï¼"> |
| | | <el-input v-model="form.sort" placeholder="请è¾å
¥ç¼å·"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥æè¿°"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="btnBox"> |
| | | <el-button v-if="!addStatus" :disabled="mangeShowBtn ? false : !childTypeBtn" icon="el-icon-plus" plain |
| | | size="small" |
| | | type="primary" @click="addClickHandler">å¢å |
| | | </el-button> |
| | | <el-button v-if="addStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="addSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn" icon="el-icon-edit" plain size="small" type="primary" |
| | | @click="addClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn" icon="el-icon-close" plain size="small" type="danger" |
| | | @click="addClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导å
¥sql |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | | </el-main> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | //管çåè½æ¨¡å |
| | | import {getSysModelTreeMenuByPID, addModel} from "@/api/systemModel/mangeModel/api" |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | addStatus: false, |
| | | nodeRow: {}, |
| | | form: {}, |
| | | treeData: [], |
| | | treeOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | defaultExpandAll: false, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | }, |
| | | lazy: true, |
| | | treeLoad: (node, resolve) => { |
| | | const params = { |
| | | parentId: node.level === 0 ? "operateNode" : node.data.id, |
| | | modeType: node.level === 0 ? "firstNode" : node.data.modeType, |
| | | } |
| | | getSysModelTreeMenuByPID(params).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | id: item.id, |
| | | name: item.name, |
| | | leaf: !item.hasChildren |
| | | } |
| | | })) |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | /** |
| | | * childType |
| | | * 为-1 å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * ä¸ä¸º-1 éè å é¤éç³»ç»æ¨¡å å é¤ä¸å¡æ¨¡å |
| | | * 为1æ¶ ç¦ç¨æä½ç±»åã导å
¥ãå¯¼åº |
| | | * 为2æ¶ ç¦ç¨å¢å 导å
¥ å¯¼åº |
| | | * mangeShowBtn 为 true è¯´ææ¯é¡¶å±èç¹ å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * @returns {Number} |
| | | */ |
| | | mangeShowBtn() { |
| | | return this.form.childType === -1; |
| | | }, |
| | | childTypeBtn() { |
| | | return this.form.childType === 1; |
| | | } |
| | | }, |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row); |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.addStatus = false; |
| | | }, |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | for (const key in this.form) { |
| | | if (this.form.hasOwnProperty(key)) { |
| | | this.form[key] = null; |
| | | } |
| | | } |
| | | this.addStatus = true; |
| | | }, |
| | | |
| | | // ä¿åæé® |
| | | addSaveClickHandler() { |
| | | console.log(this.form) |
| | | if (!this.form.name) { |
| | | this.$message.error('模ååä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathc && this.form.pathc.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | console.log(this.nodeRow); |
| | | this.form.parentId = this.nodeRow.id; |
| | | this.form.modeType = this.nodeRow.modeType; |
| | | addModel(this.form).then(res => { |
| | | console.log(res) |
| | | this.addStatus = false; |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .el-form-item .el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | .btnBox { |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | </style> |