From 106263ec10e60ce6c406e4fd5eb76d195772d0f0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 18 十二月 2020 18:07:05 +0800 Subject: [PATCH] 2020-12-18 --- src/tabviews/custom/components/card/data-card/index.jsx | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 348ed3f..dce1567 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -4,6 +4,7 @@ import { Spin, Empty, notification, Col, Pagination } from 'antd' import Api from '@/api' +import Utils from '@/utils/utils.js' import UtilsDM from '@/utils/utils-datamanage.js' import preImg from '@/assets/img/prev.png' import nextImg from '@/assets/img/next.png' @@ -13,6 +14,7 @@ const CardItem = asyncComponent(() => import('../cardItem')) const MainAction = asyncComponent(() => import('@/tabviews/zshare/actionList')) +const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) class DataCard extends Component { static propTpyes = { @@ -27,6 +29,7 @@ BID: '', // 涓婄骇ID BData: '', // 涓婄骇琛屾暟鎹� config: null, // 鍥捐〃閰嶇疆淇℃伅 + search: null, // 鎼滅储鏉′欢 pageIndex: 1, // 椤电爜 activeKey: '', // 閫変腑鍗� selectKeys: [], // 澶氶�夋椂閫変腑鍗$墖 @@ -87,6 +90,7 @@ BID: BID || '', config: _config, card: _card, + search: Utils.initMainSearch(_config.search), arr_field: _config.columns.map(col => col.field).join(','), }, () => { if (_config.setting.sync !== 'true' && _config.setting.onload === 'true') { @@ -163,7 +167,7 @@ async loadData () { const { mainSearch, menuType } = this.props - const { config, arr_field, pageIndex, BID } = this.state + const { config, arr_field, pageIndex, search, BID } = this.state if (config.setting.supModule && !BID) { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇� this.setState({ @@ -178,7 +182,7 @@ return } - let searches = [] + let searches = fromJS(search).toJS() if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢 let keys = searches.map(item => item.key) mainSearch.forEach(item => { @@ -268,6 +272,15 @@ this.loadData() }) } + + refreshSearch = (list) => { + this.setState({ + search: list, + pageIndex: 1 + }, () => { + this.loadData() + }) + } changeCard = (index, item) => { const { config, selectKeys, selectedData, activeKey } = this.state @@ -337,6 +350,7 @@ <Spin /> </div> : null } + <NormalHeader config={config} BID={BID} menuType={this.props.menuType} refresh={this.refreshSearch} /> {config.action && config.action.length > 0 ? <MainAction BID={BID} -- Gitblit v1.8.0