ai-search-basicinfo
v1.0.12
Published
基本信息(图片详情右侧)
Downloads
9
Readme
DemoTable
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { BasicInfo } from 'ai-search-basicinfo';
import { data, fields } from './dataSource';
class App extends Component {
render() {
const labelConfig = {
lableUrl: "POST /module/label/ps-label/getLabel",
tabConfigUrl: "/module/ps-module-data-config/getInputOutPutParam",
tableDataUrl: "POST /module/powersearch/api/module/data/get",
}
return (
<div>
<BasicInfo label={labelConfig} hlList={data.highlight} data={data} fields={fields}/>
<BasicInfo label={labelConfig} hlList={data.highlight} confUrl={'/mock/akDCghOZ1/basicinfo'} queryBody={{id: 1}} fields={fields} />
</div>
);
}
}
ReactDOM.render((
<App />
), mountNode);
props
| 参数 | 类型 | 说明 | 必填 | | :----------- | :--------------: | -----------: | ---- | | data | object | 传入的数据 | 否 | | fields | object |传入的展示数据对应的字段 | 否 | | confUrl | string | 请求数据的url | 否 | | queryBody | object | 请求数据的传参 | 否 | | hlList | object | 高亮数据 | 否 | | label | object | 标签组件配置项 | 否 |
data示例
{
"recordType": "preson",
"picUrl": "https://img.alicdn.com/tfs/TB1NmDCaCzqK1RjSZPcXXbTepXa-690-965.png",
"highlight":[
"362330199112138274"
],
"title":{
"age":"29",
"hyzk":"未婚",
"mz":"汉族",
"xb":"男性",
"xm":"李刚",
"zjhm":"362330199112138274"
},
"baseInfo":{
"hjd":"游城乡高坊村163号",
"jg":"江西省波阳县",
"jzd":"",
"lxfs":"15970302955,18270320870",
"whcd":"小学教育"
},
"labels": [
{
"labelName": "与吸毒人员出行次数", //标签名称
"labelType": 2, //标签类型 1布尔类型,2统计类型 3占比类型 4直接展示类型
"expression": "与吸毒人员出行value次", //表达式
"labelValue": "1", //标签值
"displayValue": "与吸毒人员出行1次", //
"orderNum": 2,
"labelDesc": "出行记录",
"remarks": null,
"zjhm": "1243",
"cphm": null,
"lgdm": null,
"labelCategoryId": 1,
"categoryCode": "ryjbxx",
"categoryName": "人员基本信息",
"parentCategoryId": "0",
"moduleCode": "xdry"
},
{
"labelName": "凌晨上网占比",
"labelType": 3,
"expression": "凌晨上网占比value",
"labelValue": "0.6",
"displayValue": "凌晨上网占比60%",
"orderNum": 1,
"labelDesc": "上网记录",
"remarks": null,
"zjhm": "1243",
"cphm": null,
"lgdm": null,
"labelCategoryId": 1,
"categoryCode": "ryjbxx",
"categoryName": "人员基本信息",
"parentCategoryId": "0",
"moduleCode": "swzb"
},
{
"labelName": "凌晨上网占比",
"labelType": 3,
"expression": "凌晨上网占比value",
"labelValue": "0.6",
"displayValue": "凌晨上网占比70%",
"orderNum": 1,
"labelDesc": "上网记录",
"remarks": null,
"zjhm": "1243",
"cphm": null,
"lgdm": null,
"labelCategoryId": 1,
"categoryCode": "ryjbxx",
"categoryName": "人员基本信息",
"parentCategoryId": "0",
"moduleCode": "swzb1"
},
{
"labelName": "与吸毒人员出行次数", //标签名称
"labelType": 2, //标签类型 1布尔类型,2统计类型 3占比类型 4直接展示类型
"expression": "与吸毒人员出行value次", //表达式
"labelValue": "1", //标签值
"displayValue": "与吸毒人员出行1次", //
"orderNum": 2,
"labelDesc": "出行记录",
"remarks": null,
"zjhm": "1243",
"cphm": null,
"lgdm": null,
"labelCategoryId": 1,
"categoryCode": "ryjbxx",
"categoryName": "人员基本信息",
"parentCategoryId": "0",
"moduleCode": "xdry"
},
{
"labelName": "凌晨上网占比",
"labelType": 3,
"expression": "凌晨上网占比value",
"labelValue": "0.6",
"displayValue": "凌晨上网占比60%",
"orderNum": 1,
"labelDesc": "上网记录",
"remarks": null,
"zjhm": "1243",
"cphm": null,
"lgdm": null,
"labelCategoryId": 1,
"categoryCode": "ryjbxx",
"categoryName": "人员基本信息",
"parentCategoryId": "0",
"moduleCode": "swzb"
},
{
"labelName": "凌晨上网占比",
"labelType": 3,
"expression": "凌晨上网占比value",
"labelValue": "0.6",
"displayValue": "凌晨上网占比70%",
"orderNum": 1,
"labelDesc": "上网记录",
"remarks": null,
"zjhm": "1243",
"cphm": null,
"lgdm": null,
"labelCategoryId": 1,
"categoryCode": "ryjbxx",
"categoryName": "人员基本信息",
"parentCategoryId": "0",
"moduleCode": "swzb1"
},
]
}
config示例
{
queryParams: {
subjectCode: 'recordType',
idValueCode: 'identifier',
},
imgCode: 'picUrl',
hlText: '',
title: {
titleCode: 'title',
nameCode: {
type: 'link',
value: 'xm',
onClick: (data) => {
console.log(data);
}
},
cardCode: {
type: 'link',
value: 'zjhm',
onClick: (data) => {
console.log(data);
}
},
codeList: [
{
type: 'text',
value: 'xb',
},
{
type: 'text',
value: 'age',
},
{
type: 'text',
value: 'mz',
},
{
type: 'text',
value: 'hyzk'
}
]
},
basic: [
{
basicCode: 'baseInfo',
basicTxet: '基本信息',
codeList: [
{
type: 'text',
value: 'lxfs',
label: '手机号',
fmt: (value) => {
return value && value.split(',')
}
},
{
type: 'text',
value: 'jg',
label: '籍贯'
},
{
type: 'text',
value: 'whcd',
label: '文化程度'
},
{
type: 'text',
value: 'jzd',
label: '居住地址'
},
{
type: 'text',
value: 'hjd',
label: '户籍地址'
},
],
},
{
basicCode: 'baseInfo',
basicTxet: '基本信息2',
codeList: [
{
type: 'link',
value: 'lxfs',
label: '手机号',
fmt: (value) => {
return value && value.split(',')
}
},
{
type: 'text',
value: 'jg',
label: '籍贯'
},
{
type: 'text',
value: 'whcd',
label: '文化程度'
},
{
type: 'text',
value: 'jzd',
label: '居住地址'
},
{
type: 'text',
value: 'hjd',
label: '户籍地址'
},
],
},
],
result: {
resultTxet: '结果命中',
},
}