king
2022-10-28 aa41be24e83653077d85860cb70882551912af24
src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -557,36 +557,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="确定删除吗?"
                      onConfirm={() => this.handleDelete(item)
                    }>
                      <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span>
                    </Popconfirm>
                  </div>
                </div>
              )
                )
              }
            })}
          </div>
          <div className="script-button">