From c7aece35a62b6e91fd98a625bf0e53f64bfbd18d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 17 八月 2023 16:22:15 +0800 Subject: [PATCH] 2023-08-17 --- src/templates/sharecomponent/settingcomponent/settingform/index.jsx | 78 ++++++++++++++++++++++----------------- 1 files changed, 44 insertions(+), 34 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index 3ae2a2c..5e8df8d 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -20,7 +20,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, // 鑿滃崟淇℃伅 config: PropTypes.object, // 椤甸潰閰嶇疆淇℃伅 search: PropTypes.array, // 鎼滅储鏉′欢 @@ -364,10 +363,9 @@ if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { notification.warning({ top: 92, - message: '瀛樺湪鏈繚瀛樿剼鏈紝璇风偣鍑荤‘瀹氫繚瀛橈紝鎴栫偣鍑诲彇娑堟斁寮冧慨鏀癸紒', + message: '瀛樺湪鏈繚瀛樼殑鑴氭湰锛�', duration: 5 }) - return } if (activeKey === 'setting') { @@ -496,7 +494,7 @@ } render() { - const { config, menu, dict } = this.props + const { config, menu } = this.props const { loading, activeKey, setting, defaultSql, columns, scripts, status, visible, script, scriptValue } = this.state return ( @@ -506,7 +504,6 @@ <TabPane tab="鏁版嵁婧�" key="setting"> <DataSource menu={menu} - dict={dict} config={config} columns={columns} setting={setting} @@ -533,7 +530,6 @@ this.setState({visible: true, script: null, scriptValue: ''}) }}/> : null} <CustomScript - dict={dict} setting={setting} scripts={scripts} defaultSql={defaultSql} @@ -560,36 +556,50 @@ title = title && title[0] ? title[0] : '' let _text = title ? item.sql.replace(title, '') : item.sql - return ( - <div className={'script-item ' + (script && script.uuid === item.uuid ? 'active' : '') } key={item.uuid}> - <div style={{cursor: 'pointer'}} onClick={() => { - this.setState({script: item, scriptValue: item.sql}) - }}> - {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} - <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> - <div>{item.status === 'false' ? - <span style={{color: '#ff4d4f', marginLeft: '20px'}}> - 绂佺敤 - <StopOutlined style={{marginLeft: '5px'}} /> - </span> : - <span style={{color: '#26C281', marginLeft: '20px'}}> - 鍚敤 - <CheckCircleOutlined style={{marginLeft: '5px'}}/> - </span>} + if (item.status === 'false') { + return ( + <div className="script-item" key={item.uuid}> + <div style={{cursor: 'not-allowed'}}> + {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} + <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> + <div> + <span style={{color: '#ff4d4f', marginLeft: '20px'}}> + 绂佺敤 + <StopOutlined style={{marginLeft: '5px'}} /> + </span> + </div> + </div> + <div style={{height: '24px'}}></div> + </div> + ) + } else { + return ( + <div className={'script-item ' + (script && script.uuid === item.uuid ? 'active' : '') } key={item.uuid}> + <div style={{cursor: 'pointer'}} onClick={() => { + this.setState({script: item, scriptValue: item.sql}) + }}> + {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} + <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> + <div> + <span style={{color: '#26C281', marginLeft: '20px'}}> + 鍚敤 + <CheckCircleOutlined style={{marginLeft: '5px'}}/> + </span> + </div> + </div> + <div style={{textAlign: 'right'}}> + <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <Popconfirm + overlayClassName="popover-confirm" + title="纭畾鍒犻櫎鍚�?" + onConfirm={() => this.handleDelete(item) + }> + <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> + </Popconfirm> </div> </div> - <div style={{textAlign: 'right'}}> - <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span> - <Popconfirm - overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} - onConfirm={() => this.handleDelete(item) - }> - <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> - </Popconfirm> - </div> - </div> - ) + ) + } })} </div> <div className="script-button"> -- Gitblit v1.8.0