2.1.4 • Published 2 years ago

aiit_sdk v2.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

aiit_sdk

https://www.npmjs.com/package/aiit_sdk

ChangeButton API

参数说明类型
startText点击前的 button 参数string
endText点击后的 button 参数string

AlarmModel

参数说明类型
alarmStatus任务状态 0 未设置 1 已设置string
owner任务类型 参数string
taskName任务名称 参数string
AlarmUsrListUrl报警列表用户接口 ipstring
AlarmMangeUrl报警任务相关功能 ipstring
onClose关闭弹窗 事件callback

PageTable

参数说明类型
columns表格列的配置描述array
dataSource数据数组array
total总共的行数int
showSizeChanger是否可以改变页面大小 pageSizeBoolean
onShowSizeChange页面大小改变的回调function
onChange页面改变的回调function

VirtualLayer

参数说明类型
returnData选择完成后,返回的数据object
setReturnData和 returnData 一起作为 useState 的一对 hooksfunction
store确定是数据源还是存储源,false 为存储源,ture 为数据源,默认为 falseBoolean
showSizeChanger是否可以改变页面大小 pageSizeBoolean
baseApiapi 生成工具的 api,默认为 api 生成工具的正式服 apistring
baseLayer虚拟层的 api,默认为虚拟层的正式服 apistring
returnData的返回格式为{

    "db_name": 表名,
    "url": 表名相应的api,
    "databaseId": 数据库id,
    "databaseName": 数据库名字,
    "databaseType": 数据库类型

}

Login

登录界面

参数说明类型
tokentoken 参数string
setToken将 token 存入func
loginUrl登录参数传递的 url 接口string
redirectUrl登录成功后跳转的界面的 urlstring
例子
const [returnData, setReturnData] = useState({});
########################################
<BrowserRouter>
    <Routes>
        <Route
        path="/"
        element={<Login redirectUrl="/bar" setToken={setToken} loginUrl="127.0.0.1:8000/login" token={token}/> }
        />
        <Route path="/bar" element={<div>1235</div>} />
    </Routes>
</BrowserRouter>

ForceNetworkGraph

基于 d3 的力导向图

参数说明类型
nameNeed(必选)力导向图名字string
pointOnclick(可选)点击节点的回调函数func
width (必选)画布宽,支持 px/vw/vhstring
height (必选)画布高,支持 px/vw/vhstring
nodeEdgeSource (必选)传入力导向图的参数Object
style (可选)可以写"dark"或"light"表示在不同背景下的效果string
scale (可选)初始缩放比例默认为 1string
position (可选)初始位置Object

nodeEdgeSource 参数 | 参数 | 说明 | 类型 | | -------------------- | -------------------: | -----: | | nodes_labels(必选) | 代表节点列表 | array | | relation_types (必选) | 代表关系边列表 | array |

nodes_labels 参数 | 参数 | 说明 | 类型 | | -------------------- | -------------------: | -----: | | name(必选) | 节点名称 | string | | index (必选) | 节点 index | number | | propery (必选) | 节点属性 | array | | color (可选) | 节点颜色 | string | | radius (可选) | 节点大小半径 | number | | fontSize (可选) | 字体大小 | number |

relation_types 参数 | 参数 | 说明 | 类型 | | -------------------- | -------------------: | -----: | | source(必选) | 起始节点的 index | number | | target (必选) | 目标节点 index | number | | value (必选) | 关系边的长 | number | | color (可选) | 关系边的颜色 | string | | relation (必选) | 关系的名称标注 | string | | fontSize (可选) | 字体大小 | number |

// nodeEdgeSource格式如下
const nodeEdgeA = {
    nodes_labels: [
      {
        name: "Patent_type",
        index: 0,
        propery: ["name"],
      },
      {
        name: "国家",
        index: 1,
        propery: ["专利名", "发明人", "瑞", "专业"],
        // color: "#a0d911",
      },

      {
        name: "人物",
        index: 2,
        propery: ["专利名", "发明人", "瑞", "专业"],
        color: "#87e8de",
        radius: 20,
      },

      {
        name: "Patent_temp",
        index: 3,
        propery: [
          "优先权",
          "代理人",
          "国际申请",
          "分类号",
          "摘要",
          "专利类型",
          "申请日",
          "专利申请号",
          "专利代理机构",
          "进入国家阶段日期",
          "主分类号",
          "公开\\(公告\\)号",
          "国际公布",
          "name",
          "公开(公告)日",
          "分案原申请号",
          "发明(设计)人",
          "地址",
          "申请(专利权)人",
        ],
        color: "#87e8de",
      },
    ],
    relation_types: [
      {
        source: 1,
        target: 0,
        value: 1.3,
        relation: "is in type    ",
        color: "red",
      },
      {
        source: 2,
        target: 3,
        value: 1.3,
        relation: "是公民",
      },
      {
        source: 3,
        target: 2,
        value: 1.3,
        relation: "miumiu",
      },
    ],
  };
  const clickPoint = (element, e, d) => {
    console.log(element, d, e);
    d3.select(element).attr("fill", "blue");
  };
  return(
      <div>
        <ForceNetworkGraph
            nodeEdgeSource={nodeEdgeA}
            nameNeed="TupuA"
            pointOnclick={clickPoint}
            width="50vw"
            height="40vh"
            scale="1.2"
          position={{ top: -100, bottom: 10, left: -100, right: 10 }}
            />
        </div>
  )
1.1.1

2 years ago

1.1.0

2 years ago

1.8.2

2 years ago

1.6.4

2 years ago

1.9.0

2 years ago

1.8.1

2 years ago

1.7.2

2 years ago

1.6.3

2 years ago

1.8.0

2 years ago

1.7.1

2 years ago

1.6.2

2 years ago

1.7.0

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.6.7

2 years ago

1.8.4

2 years ago

1.6.6

2 years ago

1.8.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago