From 5046d0d13dc6a8563b8e54e31913bc44cfa1072f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 26 四月 2022 19:23:18 +0800 Subject: [PATCH] 2022-04-26 --- src/menu/datasource/verifycard/index.jsx | 33 +++++++++++++++++++++++++++++---- 1 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx index 549d3fa..51338af 100644 --- a/src/menu/datasource/verifycard/index.jsx +++ b/src/menu/datasource/verifycard/index.jsx @@ -51,6 +51,10 @@ editable: true, unique: true, copy: true, + rules: [{ + pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig, + message: '瀛楁鍚嶅彧鍏佽鍖呭惈鏁板瓧銆佸瓧姣嶃�佹眽瀛椾互鍙奯' + }], width: '28%' }, { @@ -101,12 +105,12 @@ render: (text) => { let title = text.match(/^\s*\/\*.+\*\//) title = title && title[0] ? title[0] : '' - text = title ? text.replace(title, '') : text + let _text = title ? text.replace(title, '') : text return ( <div> - {title ? <span style={{color: '#a50'}}>{title}</span> : null} - <Paragraph copyable ellipsis={{ rows: 4, expandable: true }}>{text}</Paragraph> + {title ? <span style={{color: '#a50'}}>{title}<span style={{fontSize: '12px', marginLeft: '5px'}}>{_text.length}</span></span> : null} + <Paragraph copyable={{ text: text }} ellipsis={{ rows: 4, expandable: true }}>{_text}</Paragraph> </div> ) } @@ -375,6 +379,18 @@ this.setState({loading: false}) }) } else if (activeKey === 'columns') { + if (this.datasource && this.datasource.state.editingKey) { + notification.warning({ + top: 92, + message: '瀛楁鏈繚瀛橈紝璇蜂繚瀛樺悗鍒囨崲锛�', + duration: 5 + }) + this.setState({ + loading: false + }) + return + } + this.setState({ activeKey: val, loading: false @@ -504,6 +520,15 @@ reject() }) } else if (activeKey === 'columns') { + if (this.datasource && this.datasource.state.editingKey) { + notification.warning({ + top: 92, + message: '瀛楁鏈繚瀛橈紝璇蜂繚瀛樺悗鎻愪氦锛�', + duration: 5 + }) + reject() + return + } this.sqlverify(() => { resolve({setting, columns, scripts }) }, reject, false) } else if (activeKey === 'scripts') { let _loading = false @@ -670,7 +695,7 @@ updatefield={this.updatefields} /> <CopyOutlined title="浠ラ�楀彿鎷兼帴褰㈠紡澶嶅埗瀛楁" onClick={this.copyColumns} style={{position: 'absolute', cursor: 'pointer', zIndex: 1, top: '-35px', right: '0px', color: '#1890ff'}} /> - <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} type="datasourcefield" data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> + <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> </TabPane> <TabPane tab={ <span> -- Gitblit v1.8.0