# abc-filter-search

> 筛选条件因子组件

Latest version **0.0.6** (published 2019-03-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install abc-filter-search
pnpm add abc-filter-search
yarn add abc-filter-search
bun add abc-filter-search
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2019-03-29 |
| First published | 2019-03-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 20 |
| Unpacked size | 3.4 MB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | sunlight01 |

## Links

- npm: https://www.npmjs.com/package/abc-filter-search
- npm.io page: https://npm.io/package/abc-filter-search

## Dependencies (20)

- [opn](https://npm.io/package/opn.md) ^5.3.0
- [antd](https://npm.io/package/antd.md) ^3.15.2
- [react](https://npm.io/package/react.md) ^16.4.2
- [jquery](https://npm.io/package/jquery.md) ^3.3.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [moment](https://npm.io/package/moment.md) ^2.24.0
- [address](https://npm.io/package/address.md) ^1.0.3
- [react-dom](https://npm.io/package/react-dom.md) 16.3.2
- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [css-loader](https://npm.io/package/css-loader.md) ^1.0.0
- [file-saver](https://npm.io/package/file-saver.md) ^2.0.0
- [pdfjs-dist](https://npm.io/package/pdfjs-dist.md) ^2.0.943
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [url-loader](https://npm.io/package/url-loader.md) ^1.1.1
- [style-loader](https://npm.io/package/style-loader.md) ^0.23.0
- [postcss-loader](https://npm.io/package/postcss-loader.md) ^3.0.0
- [styled-components](https://npm.io/package/styled-components.md) ^3.4.5
- [postcss-flexbugs-fixes](https://npm.io/package/postcss-flexbugs-fixes.md) ^4.1.0
- [react-infinite-scroller](https://npm.io/package/react-infinite-scroller.md) ^1.2.4
- [extract-text-webpack-plugin](https://npm.io/package/extract-text-webpack-plugin.md) ^3.0.2

## Recent versions

- 0.0.6 (latest) — 2019-03-29
- 0.0.4 — 2019-03-29
- 0.0.3 — 2019-03-29
- 0.0.2 — 2019-03-29
- 0.0.1 — 2019-03-29

## README

## 说明
安装依赖
yarn add abc-filter-search --save

## abc-filter-search组件
  组件参数

| 参数 | 说明 | 默认值 |
|--|--|--|
| themeStyle | 组件主题 | 默认black |
| showDateStatus| 是否显示日期选取组件 boolean| 默认true |
| type_list| 预警因子数据| [] |
| caheFactorTags| 已选取预警因子 | [] |
| throughData| 穿透数据 | 
| emotion_list| 情绪因子数据 |
| industryData | 行业数据 |
| industryCode | 行业code  |
| hasFeedBackCount | 反馈数量 | 
| totalCount | list总数 |
| callback | 预警因子选取回调函数 |
| setHasFeedbacks | 反馈选取回调 |
| caheFactorTagsCallback | 存储已选预警因子回调 |
| caheIndustryTagsCallback | 存储已选行业因子回调 |
| caheIndustryTags | 存储的行业选中因子 |
| filterRequest | 接口请求状态 |
| emotion_data | 情绪数据 |
| filter_emotion | 默认选中的情绪因子 |
| date_range | 默认日期范围 （'day','week','month'）| 
| fetchSearchTagFn | 预警因子搜索回调 |
| dataSource | 搜索的预警因子结果 |



## 组件使用demo
  功能: 添加搜索过滤因子

  具体使用如下：
```javascript
  import NewFilterSearch from 'abc-filter-search'

  // 预警因子搜索
  fetchSearchTag(value){
    const self = this;
    let params = {
        wd: value,
        howmany: 5
    }
    ask(url, { params: params }).then(function (response) {
        const res_data = response.data.map((item) => {
            return ({
                content: item.name
            });
        });
        self.setState({
            dataSource: value ? res_data : [],
        });
    });
  }

  // 存储过滤搜索的预警因子
  caheFactorTagsCallback(data) {

      this.setState({
          caheFactorTags: data
      });
  }

  // 存储行业选中的标签
  caheIndustryTagsCallback(data){
      this.setState({
          caheIndustryTags:data
      });
  }

  //  存储图谱穿透选中的标签
  caheThroughTagsCallback(data) {
      this.setState({
          caheThroughTags: data
      });
  }

  //  存储图谱穿透选中的标签
  caheThroughTagsCallback(data) {
      this.setState({
          caheThroughTags: data
      });
  }

  const filterList = [{"type_title":"预警因子","type_id":2,"type_list_item":[{"id":1,"text":"利润增加","num":9212,"checked":false},{"id":2,"text":"营收增加","num":8327,"checked":false},{"id":3,"text":"兼并收购","num":6081,"checked":false},{"id":4,"text":"开展合作","num":5333,"checked":false},{"id":5,"text":"产品创新","num":4035,"checked":false}]}];

  const emotion_list = [{"name":"正面","count":38558},{"name":"负面高","count":405},{"name":"负面中","count":5850},       {"name":"负面低","count":10833},{"name":"中性","count":312871}]

  const industryData  = [{"typeName":"行业","typeId":3,"data":[{"name":"电子","count":9489,"id":"industry_0"},       {"name":"汽车","count":9324,"id":"industry_1"},{"name":"传媒","count":8376,"id":"industry_2"},{"name":"化工","count":10272,"id":"industry_3"},{"name":"银行","count":8020,"id":"industry_4"},{"name":"国防军工","count":1580,"id":"industry_5"},{"name":"食品饮料","count":4573,"id":"industry_6"},{"name":"轻工制造","count":4370,"id":"industry_7"},{"name":"计算机","count":17848,"id":"industry_8"},{"name":"机械设备","count":10398,"id":"industry_9"},{"name":"医药生物","count":10402,"id":"industry_10"},{"name":"通信","count":5338,"id":"industry_11"},{"name":"综合","count":2324,"id":"industry_12"},{"name":"钢铁","count":1141,"id":"industry_13"},{"name":"休闲服务","count":1198,"id":"industry_14"},{"name":"公用事业","count":4814,"id":"industry_15"},{"name":"有色金属","count":4089,"id":"industry_16"},{"name":"电气设备","count":8552,"id":"industry_17"},{"name":"家用电器","count":3467,"id":"industry_18"},{"name":"建筑装饰","count":4383,"id":"industry_19"},{"name":"纺织服装","count":2410,"id":"industry_20"},{"name":"非银金融","count":12312,"id":"industry_21"},{"name":"农林牧渔","count":3667,"id":"industry_22"},{"name":"商业贸易","count":4957,"id":"industry_23"},{"name":"建筑材料","count":2152,"id":"industry_24"},{"name":"采掘","count":3017,"id":"industry_25"},{"name":"交通运输","count":4064,"id":"industry_26"},{"name":"房地产","count":8417,"id":"industry_27"}]}]

  <NewFilterSearch
      themeStyle={'light'}
      filters={filterList}
      hasFeedBackCount = {104}
      totalCount = {383516}
      emotion_list = {emotion_list}
      industryData = {industryData}
      dataSource = {this.state.dataSource}
      caheFactorTags = {[]}
      caheThroughTags = {[]}
      caheIndustryTags = {[]}
      industryCode = {[]}
      filterRequest = {true}
      fetchSearchTagFn = {this.fetchSearchTag.bind(this)}
      callback = {()=>{}}
      caheFactorTagsCallback = {()=>{}}
      caheIndustryTagsCallback = {()=>{}}
      caheThroughTagsCallback={this.caheThroughTagsCallback.bind(this)}

  />
```

---
_Source: https://npm.io/package/abc-filter-search · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
