From f36141f3075edf9d41928d64f759ad6bd1b1ac60 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 14 七月 2020 17:43:34 +0800 Subject: [PATCH] 2020-07-14 --- src/templates/sharecomponent/searchcomponent/index.jsx | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index 9068bf8..d8855cd 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -27,7 +27,7 @@ } state = { - dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS, + dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, searchlist: null, // 鎼滅储鏉′欢闆� sqlVerifing: false, // sql楠岃瘉涓� visible: false, // 妯℃�佹鎺у埗 @@ -77,10 +77,22 @@ * @description 鎼滅储鏉′欢缂栬緫锛岃幏鍙栨悳绱㈡潯浠惰〃鍗曚俊鎭� */ handleSearch = (card) => { + const { searchlist } = this.state + let linkableFields = [] + + searchlist.forEach(item => { + if (item.uuid !== card.uuid && (item.type === 'select' || item.type === 'link')) { + linkableFields.push({ + value: item.field, + text: item.label + }) + } + }) + this.setState({ visible: true, card: card, - formlist: getSearchForm(card, this.props.sysRoles) + formlist: getSearchForm(card, this.props.sysRoles, linkableFields) }) } @@ -246,7 +258,7 @@ confirm({ content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, okText: dict['model.confirm'], - cancelText: this.state.dict['header.cancel'], + cancelText: this.state.dict['model.cancel'], onOk() { let _searchlist = fromJS(_this.state.searchlist).toJS() @@ -271,6 +283,10 @@ } } + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.state), fromJS(nextState)) + } + render() { const { dict, searchlist, visible, sqlVerifing, card } = this.state -- Gitblit v1.8.0