1 | import _extends from "@babel/runtime/helpers/extends";
|
2 | import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
3 | import _createClass from "@babel/runtime/helpers/createClass";
|
4 | import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
5 | import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
6 | import _inherits from "@babel/runtime/helpers/inherits";
|
7 | import React, { Component } from 'react';
|
8 | import Search from '@beisen-platform/search';
|
9 | import SelectedList from '@beisen-platform/selected-list';
|
10 | import BaseButton from '@beisen-platform/base-button';
|
11 | import debounce from '@beisen/es6-promise-debounce';
|
12 | import { getBtnData, getSearchData } from './constant';
|
13 |
|
14 | var FindAll_pop =
|
15 |
|
16 | function (_Component) {
|
17 | _inherits(FindAll_pop, _Component);
|
18 |
|
19 | function FindAll_pop(props) {
|
20 | var _this;
|
21 |
|
22 | _classCallCheck(this, FindAll_pop);
|
23 |
|
24 | _this = _possibleConstructorReturn(this, _getPrototypeOf(FindAll_pop).call(this, props));
|
25 |
|
26 | _this.debounceChange = function (e) {
|
27 | e.event.persist();
|
28 |
|
29 | _this.onChange(e);
|
30 | };
|
31 |
|
32 | _this.onChange = function (event) {
|
33 | _this.props.self.handleChange(event);
|
34 | };
|
35 |
|
36 | _this.onChange = debounce(_this.onChange, 300);
|
37 | return _this;
|
38 | }
|
39 |
|
40 | _createClass(FindAll_pop, [{
|
41 | key: "render",
|
42 | value: function render() {
|
43 | var _this$props = this.props,
|
44 | self = _this$props.self,
|
45 | popUl = _this$props.popUl,
|
46 | single = _this$props.single,
|
47 | findAll_cancle = _this$props.findAll_cancle,
|
48 | findAll_submit = _this$props.findAll_submit;
|
49 | var _self$state = self.state,
|
50 | searchValue = _self$state.searchValue,
|
51 | hasCount = _self$state.hasCount,
|
52 | resultsData = _self$state.resultsData;
|
53 | var totalCount = self.props.totalCount;
|
54 | var selected__Data = {
|
55 | totalCount: totalCount,
|
56 | hasCount: hasCount,
|
57 | resultsData: resultsData,
|
58 | clearResultsData: self.clearResultsData
|
59 | };
|
60 | var isSingle_select = single ? 'single_select' : 'muti_select';
|
61 | var closeBtn_style = single ? 'closeBtn_single' : 'closeBtn';
|
62 | return React.createElement("div", {
|
63 | className: "searchContainer recruit-auto-tree",
|
64 | onKeyDown: self.handleKeyDown
|
65 | }, React.createElement("div", {
|
66 | className: isSingle_select
|
67 | }, React.createElement(Search, _extends({}, getSearchData(searchValue, false, false), {
|
68 | onChange: this.debounceChange
|
69 | })), popUl), single ? '' : React.createElement(SelectedList, selected__Data), React.createElement("div", {
|
70 | className: "findAll_footer"
|
71 | }, React.createElement("div", {
|
72 | className: closeBtn_style
|
73 | }, React.createElement(BaseButton, getBtnData("weaken", 'default', '取消', findAll_cancle))), single ? '' : React.createElement("div", {
|
74 | className: "submitBtn"
|
75 | }, React.createElement(BaseButton, getBtnData("default", 'default', '确定', findAll_submit)))));
|
76 | }
|
77 | }]);
|
78 |
|
79 | return FindAll_pop;
|
80 | }(Component);
|
81 |
|
82 | export { FindAll_pop as default }; |
\ | No newline at end of file |