`

richfaces3.3.1中树的节点的拖动

阅读更多

前段时间,因为公司分配了这样的任务,开始研究了richfaces3.3.1的demo。其中关于树的拖动部分,通过研究demo的例子,我做了一些修改,实现了下面的功能:

1.树的动态加载;

2.一棵树内的节点的拖动,只能从叶子节点拖动到非叶子节点。

 

不过,我想实现更复杂的拖动树在这基础上修改也不会太难。

 

下面贴代码吧:

/pages/tree/下的jsp:

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>tree demo</title>
        
    </head>
    <style>
        .col1, .col2 {
        width:50%;
        vertical-align:top;
        }
        .rich-table-cell, .rich-table{
        border:none;
        }
    </style>
    <body>
        <f:view>
            <div id="top">
                <h3>tree demo about drag and drop</h3>
            </div>
            <rich:dragIndicator id="indicator1" />
            <h:form>	
                <h:panelGrid columns="1" width="100%" columnClasses="col1">
                    
                    <rich:tree style="width:300px"
                               switchType="ajax" value="#{treesBean.treeNode}" var="item" id="tree" 
                               treeNodeVar="treeNode"
                               nodeFace="#{item.type == 1 ? 'node' : 'leaf'}">
                        <rich:treeNode type="node" acceptedTypes="all"  dropListener="#{evntBean.processDrop}" 
                                       dropValue="#{treeNode}" icon="#{treeNode.icon}" iconLeaf="#{treeNode.leafIcon}"
                                       changeExpandListener="#{treesBean.processExpansion}" data="#{treeNode}" reRender="tree"> 
                            <h:outputText value="#{item.nodeName}"/>
                        </rich:treeNode>
                        <rich:treeNode type="leaf" dragType="all" dragValue="#{treeNode}" icon="#{treeNode.icon}" iconLeaf="#{treeNode.leafIcon}"  dragIndicator="indicator1" dragListener="#{evntBean.processDrag}">
                            <rich:dndParam name="label" type="drag" value="#{item.nodeName}"></rich:dndParam>
                            
                            <h:outputText value="#{item.nodeName}"/>
                        </rich:treeNode>
                    </rich:tree>
                </h:panelGrid>
                
            </h:form>
        </f:view>
        
    </body>
</html>

package demo下的hibernate.cfg.xml:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
	<session-factory>
		<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
		<property name="hibernate.connection.url">jdbc:mysql://127.0.0.1:3306/richfaces_demo</property>
		<property name="hibernate.connection.username">root</property>
		<property name="hibernate.connection.password">mysql51</property>
		<property name="hibernate.connection.pool_size">10</property>
		<property name="show_sql">true</property>
		<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
                <mapping resource="/demo/grid/Person.hbm.xml"/>
                <mapping resource="/demo/tree/NodeVo.hbm.xml"/>
	</session-factory>
</hibernate-configuration>

package demo.tree下的class和*.hbm.xml:

package demo.tree;

import org.richfaces.model.TreeNodeImpl;

public class DemoTreeNodeImpl extends TreeNodeImpl{
    
    private String icon;//节点icon
    private String leafIcon;//叶子节点icon
    private int nodeId;//节点id
    
    private int type;//节点类型:1-节点  2-叶子节点
    
    private int status;//节点的状态: 1-展开状态  0-折叠状态
    
    
    public String getIcon() {
        return icon;
    }
    
    public void setIcon(String icon) {
        this.icon = icon;
    }
    
    public String getLeafIcon() {
        return leafIcon;
    }
    
    public void setLeafIcon(String leafIcon) {
        this.leafIcon = leafIcon;
    }
    
    
    public int getNodeId() {
        return nodeId;
    }
    
    public void setNodeId(int nodeId) {
        this.nodeId = nodeId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }


    
}

 

package demo.tree;


import org.richfaces.component.Dropzone;
import org.richfaces.component.Draggable;
import org.richfaces.event.DropEvent;
import org.richfaces.event.DragEvent;
import org.richfaces.event.DropListener;
import org.richfaces.event.DragListener;
import org.richfaces.component.UITree;
import org.richfaces.component.UITreeNode;

import org.ajax4jsf.context.AjaxContext;


public class EventBean implements DropListener,DragListener{//,NodeExpandedListener{
    private TreesBean treesBean;
    private Object dragValue;
    
    /**
     * 处理树内子节点拖动(到节点)操作
     */
    public void processDrop(DropEvent dropEvent) {
        Dropzone dropzone = (Dropzone) dropEvent.getComponent();
        treesBean.move(dragValue, dropzone.getDropValue());
        
        UITree destTree = null;
        if(dropEvent.getSource() instanceof UITreeNode){
            UITreeNode destNode = (UITreeNode)dropEvent.getSource();
            destTree = destNode.getUITree();
        }else if(dropEvent.getSource() instanceof UITree){
            destTree = (UITree)dropEvent.getSource();
        }

        AjaxContext ac = AjaxContext.getCurrentInstance();
        // Add destination tree to reRender
        try {
            ac.addComponentToAjaxRender(destTree);
        } catch (Exception e) {
            System.err.print("ac.addComponentToAjaxRender(destTree):" + e.getMessage());
        }
    }
    
    public void processDrag(DragEvent dragEvent){
        Draggable draggable = (Draggable)dragEvent.getComponent();
        dragValue = draggable.getDragValue();
    }
    
    
    public TreesBean getTreesBean() {
        return treesBean;
    }
    
    public void setTreesBean(TreesBean treesBean) {
        this.treesBean = treesBean;
    }
    
    
}

 

/*
 * NodeVo.java
 * pojo类 hibernate entitybean
 */

package demo.tree;

public class NodeVo{
    private int id;
    private int nodeId;//节点id
    private String nodeName;//节点名
    private int parentNodeId;//父节点id
    private int type;//节点类型:1-节点 0-子节点
    private String icon;//节点icon
    private String leafIcon;//子节点icon

    /**
     * Creates a new instance of NodeVo
     */
    public NodeVo() {
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the nodeId
     */
    public int getNodeId() {
        return nodeId;
    }

    /**
     * @param nodeId the nodeId to set
     */
    public void setNodeId(int nodeId) {
        this.nodeId = nodeId;
    }

    /**
     * @return the nodeName
     */
    public String getNodeName() {
        return nodeName;
    }

    /**
     * @param nodeName the nodeName to set
     */
    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    /**
     * @return the parentNodeId
     */
    public int getParentNodeId() {
        return parentNodeId;
    }

    /**
     * @param parentNodeId the parentNodeId to set
     */
    public void setParentNodeId(int parentNodeId) {
        this.parentNodeId = parentNodeId;
    }

    /**
     * @return the type
     */
    public int getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(int type) {
        this.type = type;
    }

    /**
     * @return the icon
     */
    public String getIcon() {
        return icon;
    }

    /**
     * @param icon the icon to set
     */
    public void setIcon(String icon) {
        this.icon = icon;
    }

    /**
     * @return the leafIcon
     */
    public String getLeafIcon() {
        return leafIcon;
    }

    /**
     * @param leafIcon the leafIcon to set
     */
    public void setLeafIcon(String leafIcon) {
        this.leafIcon = leafIcon;
    }

}

 

package demo.tree;

import java.util.List;

import org.richfaces.model.TreeNode;
import org.richfaces.event.NodeExpandedEvent;
import org.richfaces.component.html.HtmlTreeNode;
import javax.faces.context.FacesContext;

import org.hibernate.Session;

import demo.util.DBUtil;

public class TreesBean {
    
    private DemoTreeNodeImpl rootNode = null;
    
    private static final String ICONS_PATH = "/images/tree/dnd/";
    
    public TreesBean(){
        loadTree(1000);//load tree which root node Id is 1000
    }
    
    /**
     * 为节点node加载第一层子节点
     */
    private void addNodes(DemoTreeNodeImpl node) {
        
        String sql = "from NodeVo where parentNodeId=:nodeId";
        Session ss = DBUtil.getSf().openSession();
        List list = ss.createQuery(sql).setInteger("nodeId", node.getNodeId()).list();
        ss.close();
        
        node.removeChild("fakeNode");
        
        if(null != list && list.size() > 0){
            for(int i=0;i<list.size();i++){
                NodeVo o = (NodeVo)list.get(i);
                DemoTreeNodeImpl tmpNode = new DemoTreeNodeImpl();
                tmpNode.setNodeId(o.getNodeId());
                tmpNode.setType(o.getType());
                tmpNode.setData(o);
                if(o.getType() == 1){//node
                    if("Unsorted".equalsIgnoreCase(o.getNodeName())){
                        tmpNode.setIcon(ICONS_PATH + "image.gif");
                        tmpNode.setLeafIcon(ICONS_PATH + "image.gif");
                    }else if("Favorites".equalsIgnoreCase(o.getNodeName())){
                        tmpNode.setIcon(ICONS_PATH + "favorites.gif");
                        tmpNode.setLeafIcon(ICONS_PATH + "favorites.gif");
                    }else if("Trash".equalsIgnoreCase(o.getNodeName())){
                        tmpNode.setIcon(ICONS_PATH + "trash.gif");
                        tmpNode.setLeafIcon(ICONS_PATH + "trash.gif");
                    }else{
                        tmpNode.setIcon(ICONS_PATH + "iconFolder.gif");
                        tmpNode.setLeafIcon(ICONS_PATH + "iconFolder.gif");
                    }
                }else if(o.getType() == 0){//leaf
                    tmpNode.setLeafIcon(ICONS_PATH + "disc.gif");
                }
                
                
                tmpNode.setParent(node);
                node.addChild(new Integer(tmpNode.getNodeId()), tmpNode);
                
                if(tmpNode.getType() == 1){
                    //构造一个假的的子结点
                    DemoTreeNodeImpl fakeNode = new DemoTreeNodeImpl();
                    NodeVo vo = new NodeVo();
                    vo.setNodeName("loading...");
                    vo.setType(1);
                    fakeNode.setData(vo);
                    fakeNode.setIcon(ICONS_PATH + "loading.gif");
                    fakeNode.setLeafIcon(ICONS_PATH + "loading.gif");
                    fakeNode.setType(1);
                    tmpNode.addChild("fakeNode",fakeNode);
                }
                
            }
        }
        
    }
    
    /**
     * 加载节点id为nodeId的树
     */
    private void loadTree(int nodeId) {
        Session ss = DBUtil.getSf().openSession();
        String sql = "from NodeVo where parentNodeId = 0 and nodeId=:nodeId";
        Object o = ss.createQuery(sql).setInteger("nodeId", nodeId).uniqueResult();
        ss.close();
        
        if (null != o) {
            NodeVo nodeVo = (NodeVo) o;
            rootNode = new DemoTreeNodeImpl();
            rootNode.setNodeId(nodeVo.getNodeId());
            rootNode.setData(nodeVo);
            rootNode.setParent(null);
            
            addNodes(rootNode);
        }
        
    }
    
    
    /**
     * 拖动树的叶子节点到节点
     */
    public void move(Object dragObj,Object dropObj){
        DemoTreeNodeImpl dragNode = (DemoTreeNodeImpl)dragObj;
        DemoTreeNodeImpl dropNode = (DemoTreeNodeImpl)dropObj;
        
        TreeNode dragParentNode = dragNode.getParent();
        if(null != dragParentNode){
            if(((DemoTreeNodeImpl)dragParentNode).getNodeId() == dropNode.getNodeId()){
                //在父结点内拖动无操作
                return;
            }
        }
        
        String sql = "from NodeVo where nodeId=:nodeId";
        Session ss = DBUtil.getSf().openSession();
        Object o = ss.createQuery(sql).setInteger("nodeId",dragNode.getNodeId()).uniqueResult();
        
        if(null != o){
            NodeVo nodeVo = (NodeVo)o;
            nodeVo.setParentNodeId(dropNode.getNodeId());
            ss.beginTransaction().begin();
            ss.update(nodeVo);
            ss.beginTransaction().commit();
            ss.flush();
        }
        ss.close();
        
        NodeVo vo = (NodeVo)dragNode.getData();
        vo.setParentNodeId(dropNode.getNodeId());
        dragNode.setData(vo);
        dragParentNode.removeChild(new Integer(dragNode.getNodeId()));//这里必须先做删除操作,之后再做setParent()和addChild()操作,这与richfaces的具体实现有关
        dragNode.setParent(dropNode);
        dropNode.addChild(new Integer(dragNode.getNodeId()),dragNode);
        
        FacesContext.getCurrentInstance().renderResponse();
        
    }
    
     /**
      * 处理展开与折叠操作
      */
    public void processExpansion(NodeExpandedEvent e){
        HtmlTreeNode tNode = (HtmlTreeNode)e.getComponent();
        
        DemoTreeNodeImpl o = (DemoTreeNodeImpl)tNode.getData();
        if(o.getStatus() == 0){//当该结点处于折叠状态下,则加载该结点的第一次子结点
            addNodes(o);
            o.setStatus(1);
        }
    }
    
    
    public DemoTreeNodeImpl getTreeNode() {
        
        return rootNode;
    }
    
    public void setTreeNode(DemoTreeNodeImpl rootNode){
        this.rootNode = rootNode;
    }
}

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="demo.tree">
  <class name="NodeVo" table="tree">
    <id column="id" name="id">
      <generator class="native"/>
    </id>
    <property name="nodeId" not-null="true"/>
    <property name="nodeName" not-null="true" type="java.lang.String"/>
    <property name="parentNodeId" not-null="true"/>
    <property name="type" not-null="true"/>
  </class>
</hibernate-mapping>

 package demo.util下的class:

package demo.util;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.hibernate.cfg.Configuration;
import org.hibernate.SessionFactory;

import javax.servlet.ServletContextListener;
/**
 *
 * @author SailingLee
 */
public class DBUtil implements ServletContextListener{

    private static SessionFactory sf = null;
    public DBUtil() {
    }
    



    public void contextInitialized(ServletContextEvent servletContextEvent) {
        sf = new Configuration().configure("/demo/hibernate.cfg.xml").buildSessionFactory();
    }

    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        sf.close();
    }

    public static SessionFactory getSf() {
        return sf;
    }

}

 package demo.phase下的class:

package demo.phase;

import java.util.Map;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;

public class PostbackPhaseListener implements PhaseListener {
    
    public static final String POSTBACK_ATTRIBUTE_NAME = PostbackPhaseListener.class.getName();
    
    public void afterPhase(PhaseEvent event) {
    }
    
    public void beforePhase(PhaseEvent event) {
        FacesContext facesContext = event.getFacesContext();
        Map requestMap = facesContext.getExternalContext().getRequestMap();
        requestMap.put(POSTBACK_ATTRIBUTE_NAME, Boolean.TRUE);
    }
    
    public PhaseId getPhaseId() {
        return PhaseId.APPLY_REQUEST_VALUES;
    }
    
    public static boolean isPostback() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        if (facesContext != null) {
            ExternalContext externalContext = facesContext.getExternalContext();
            if (externalContext != null) {
                return Boolean.TRUE.equals(
                        externalContext.getRequestMap().get(POSTBACK_ATTRIBUTE_NAME));
            }
        }
        
        return false;
    }
    
}

 /WEB-INF/下的xml:

<?xml version='1.0' encoding='UTF-8'?>


<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<!-- =========== FULL CONFIGURATION FILE ================================== -->

<faces-config>
        <!--(down) add by SailingLee about tree demo-->
    <managed-bean>
        <managed-bean-name>treesBean</managed-bean-name>
        <managed-bean-class>demo.tree.TreesBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>evntBean</managed-bean-name>
        <managed-bean-class>demo.tree.EventBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <managed-property>
            <property-name>treesBean</property-name>
            <property-class>demo.tree.TreesBean</property-class>
            <value>#{treesBean}</value>
        </managed-property>
    </managed-bean>
    <!--(up) add by SailingLee about tree demo-->
    <factory>
        <application-factory>org.richfaces.ui.application.StateApplicationFactory</application-factory>
    </factory>
    <lifecycle>
        <phase-listener>demo.phase.PostbackPhaseListener</phase-listener>
    </lifecycle>
</faces-config>

 

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <!-- RichFaces Skin -->
    <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>blueSky</param-value>
    </context-param>
    <!-- Faces Servlet -->
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>-1</load-on-startup>
    </servlet>
    <!-- Faces Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <!-- RichFaces Filter -->
    <filter>
        <display-name>RichFaces Filter</display-name>
        <filter-name>richfaces</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>richfaces</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>
            index.jsp
        </welcome-file>
    </welcome-file-list>
    <listener>
        <listener-class>demo.util.DBUtil</listener-class>
    </listener>
</web-app>

 

用到的类库见图片附件lib.jpg   :)

  • 大小: 83.1 KB
1
2
分享到:
评论

相关推荐

    richfaces3.3.1实现表格的行拖动、分页加载等功能

    在`richfaces3.3.1`中,`treeGrid`可以通过设置`nodeType`属性来定义节点类型,通过`onNodeExpand`、`onNodeCollapse`等事件来处理用户操作。 在实际应用中,`richfaces3.3.1`提供的这些组件和功能通常需要与后端...

    实时监控体系:基于Prometheus的API性能指标可视化方案.pdf

    在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!

    5个提升DeepSeekAPI生成质量的调参技巧,开发者必看!.pdf

    在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!

    ACM动态规划模板-区间修改线段树问题模板

    ACM动态规划模板-区间修改线段树问题模板

    深度解析C语言调试技巧:VSCode+GDB实战排错指南.pdf

    # 踏入C语言的奇妙编程世界 在编程的广阔宇宙中,C语言宛如一颗璀璨恒星,以其独特魅力与强大功能,始终占据着不可替代的地位。无论你是编程小白,还是有一定基础想进一步提升的开发者,C语言都值得深入探索。 C语言的高效性与可移植性令人瞩目。它能直接操控硬件,执行速度快,是系统软件、嵌入式开发的首选。同时,代码可在不同操作系统和硬件平台间轻松移植,极大节省开发成本。 学习C语言,能让你深入理解计算机底层原理,培养逻辑思维和问题解决能力。掌握C语言后,再学习其他编程语言也会事半功倍。 现在,让我们一起开启C语言学习之旅。这里有丰富教程、实用案例、详细代码解析,助你逐步掌握C语言核心知识和编程技巧。别再犹豫,加入我们,在C语言的海洋中尽情遨游,挖掘无限可能,为未来的编程之路打下坚实基础!

    10个高效调用DeepSeekAPI的技巧:从请求优化到缓存策略.pdf

    在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!

    基于Python语言的PersonRelationKnowledgeGraph设计源码

    本项目为Python语言开发的PersonRelationKnowledgeGraph设计源码,总计包含49个文件,涵盖19个.pyc字节码文件、12个.py源代码文件、8个.txt文本文件、3个.xml配置文件、3个.png图片文件、2个.md标记文件、1个.iml项目配置文件、1个.cfg配置文件。该源码库旨在构建一个用于表示和查询人物关系的知识图谱系统。

    成本优化指南:通过Token计算模型将API费用降低57%的秘诀.pdf

    在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!

    大华智能物联平台,的对接其他接口的API,可以获得视频拉流的flv/hls/rstp 的拉流地址,demo项目为springBoot项目,可以通过摄像头的视频通道,获取到实时拉流的uRl

    rtsp实时预览接口URL:/evo-apigw/admin/API/MTS/Video/StartVideo HLS、FLV、RTMP实时预览接口方式 :接口URL/evo-apigw/admin/API/video/stream/realtime 参数名 必选 类型 说明 data true string Json串 +channelId true string 视频通道编码 +streamType true string 码流类型:1=主码流, 2=辅码流,3=辅码流2 +type true string 协议类型:hls,hlss,flv,flvs,ws_flv,wss_flv,rtmp hls:http协议,m3u8格式,端口7086; hlss:https协议,m3u8格式,端口是7096; flv:http协议,flv格式,端口7886; flvs:https协议,flv格式,端口是7896; ws_flv:ws协议,flv格式,端口是7886; wss_flv:wss协议,flv格式,端口是7896; rtmp:rtmp协议,端口是1975;

    Simulink永磁风机飞轮储能系统二次调频技术研究:频率特性分析与参数优化,Simulink永磁风机飞轮储能二次调频技术:系统频率特性详解及参数优化研究参考详实文献及两区域系统应用,simulink

    Simulink永磁风机飞轮储能系统二次调频技术研究:频率特性分析与参数优化,Simulink永磁风机飞轮储能二次调频技术:系统频率特性详解及参数优化研究参考详实文献及两区域系统应用,simulink永磁风机飞轮储能二次调频,系统频率特性如下,可改变调频参数改善频率。 参考文献详细,两区域系统二次调频。 ,核心关键词: 1. Simulink 2. 永磁风机 3. 飞轮储能 4. 二次调频 5. 系统频率特性 6. 调频参数 7. 改善频率 8. 参考文献 9. 两区域系统 以上关键词用分号(;)分隔,结果为:Simulink;永磁风机;飞轮储能;二次调频;系统频率特性;调频参数;改善频率;参考文献;两区域系统。,基于Simulink的永磁风机与飞轮储能系统二次调频研究:频率特性及调频参数优化

    MATLAB驱动的ASR防滑转模型:PID与对照控制算法对比,冰雪路面条件下滑移率与车速轮速对照展示,MATLAB驱动的ASR防滑转模型:PID与对照控制算法对比,冰雪路面条件下滑移率与车速轮速对照图

    MATLAB驱动的ASR防滑转模型:PID与对照控制算法对比,冰雪路面条件下滑移率与车速轮速对照展示,MATLAB驱动的ASR防滑转模型:PID与对照控制算法对比,冰雪路面条件下滑移率与车速轮速对照图展示,MATLAB驱动防滑转模型ASR模型 ASR模型驱动防滑转模型 ?牵引力控制系统模型 选择PID控制算法以及对照控制算法,共两种控制算法,可进行选择。 选择冰路面以及雪路面,共两种路面条件,可进行选择。 控制目标为滑移率0.2,出图显示车速以及轮速对照,出图显示车辆轮胎滑移率。 模型简单,仅供参考。 ,MATLAB; ASR模型; 防滑转模型; 牵引力控制系统模型; PID控制算法; 对照控制算法; 冰路面; 雪路面; 控制目标; 滑移率; 车速; 轮速。,MATLAB驱动的ASR模型:PID与对照算法在冰雪路面的滑移率控制研究

    芯片失效分析方法介绍 -深入解析芯片故障原因及预防措施.pptx

    芯片失效分析方法介绍 -深入解析芯片故障原因及预防措施.pptx

    4131_127989170.html

    4131_127989170.html

    PostgreSQL自动化部署与优化脚本:智能化安装、安全加固与监控集成

    内容概要:本文提供了一个全面的PostgreSQL自动化部署解决方案,涵盖智能环境适应、多平台支持、内存与性能优化以及安全性加强等重要方面。首先介绍了脚本的功能及其调用方法,随后详细阐述了操作系统和依赖软件包的准备过程、配置项的自动生成机制,还包括对实例的安全性和监控功能的强化措施。部署指南给出了具体的命令操作指导,便于新手理解和执行。最后强调了该工具对于不同硬件条件和服务需求的有效应对能力,特别是针对云计算环境下应用的支持特点。 适合人群:对PostgreSQL集群运维有一定基础并渴望提高效率和安全性的数据库管理员及工程师。 使用场景及目标:本脚本能够帮助企业在大规模部署时减少人工介入时间,确保系统的稳定性与高性能,适用于各类需要稳定可靠的数据库解决方案的企业或机构,特别是在大数据量和高并发事务处理场合。 其他说明:文中还提及了一些高级功能如自动备份、流复制等设置步骤,使得该方案不仅可以快速上线而且能满足后续维护和发展阶段的要求。同时提到的技术性能数据也为用户评估其能否满足业务需求提供了直观参考。

    房地产开发合同[示范文本].doc

    房地产开发合同[示范文本].doc

    成本优化实战:DeepSeekAPI的Tokens计算与计费策略拆解.pdf

    在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!

    安全必读:DeepSeek接口调用中的数据加密与合规实践.pdf

    在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!

    工程技术承包合同[示范文本].doc

    工程技术承包合同[示范文本].doc

    蓝桥杯开发赛作品源码【基于C语言】

    蓝桥杯开发赛【作品源码】

Global site tag (gtag.js) - Google Analytics