From 95afd40fc2741ac0ce59c2091f6cfce1f98877d4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 24 六月 2021 09:15:45 +0800 Subject: [PATCH] 2021-06-24 --- src/templates/sharecomponent/searchcomponent/index.jsx | 29 +++++++++++++++++++++-------- 1 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index fbaf4e2..2352d66 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Icon, Tooltip, Modal, notification } from 'antd' +import { Icon, Tooltip, Modal, notification, Switch } from 'antd' import moment from 'moment' import Api from '@/api' @@ -23,10 +23,11 @@ } state = { - dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, searchlist: null, // 鎼滅储鏉′欢闆� sqlVerifing: false, // sql楠岃瘉涓� visible: false, // 妯℃�佹鎺у埗 + showField: false, card: null // 缂栬緫涓厓绱� } @@ -174,26 +175,27 @@ if (fieldrepet) { notification.warning({ top: 92, - message: this.state.dict['model.field.exist'] + ' !', + message: '瀛楁宸插瓨鍦�!', duration: 5 }) return } else if (labelrepet) { notification.warning({ top: 92, - message: this.state.dict['model.name.exist'] + ' !', + message: '鍚嶇О宸插瓨鍦�!', duration: 5 }) return } - if ((res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && res.resourceType === '1' && /\s/.test(res.dataSource)) { + if (['checkcard', 'select', 'multiselect', 'link'].includes() && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true }) let param = { func: 's_debug_sql', + exec_type: 'y', LText: res.dataSource } @@ -201,7 +203,7 @@ param.LText = Utils.formatOptions(param.LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) + param.secretkey = Utils.encrypt('', param.timestamp) if (window.GLOB.mainSystemApi && res.database === 'sso') { param.rduri = window.GLOB.mainSystemApi @@ -260,6 +262,15 @@ }) } + onFieldChange = () => { + const { showField } = this.state + + this.setState({ + showField: !showField + }) + } + + /** * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 */ @@ -274,15 +285,17 @@ } render() { - const { dict, searchlist, visible, sqlVerifing, card } = this.state + const { dict, searchlist, visible, sqlVerifing, card, showField } = this.state return ( <div className={'model-table-search-list length' + searchlist.length}> <Tooltip placement="bottomLeft" overlayClassName="middle" title={dict['model.tooltip.search.guide']}> <Icon type="question-circle" /> </Tooltip> + <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} /> <DragElement list={searchlist} + showField={showField} handleList={this.handleList} handleMenu={this.handleSearch} deleteMenu={this.deleteElement} @@ -290,7 +303,7 @@ /> {/* 缂栬緫鎼滅储鏉′欢 */} <Modal - title={dict['model.searchCriteria'] + '-' + (card && card.copyType === 'search' ? dict['model.copy'] : dict['model.edit'])} + title={card && card.copyType === 'search' ? '鎼滅储鏉′欢-澶嶅埗' : '鎼滅储鏉′欢-缂栬緫'} visible={visible} width={850} maskClosable={false} -- Gitblit v1.8.0