From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 18 十一月 2021 20:47:04 +0800 Subject: [PATCH] 2021-11-18 --- src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 44 ++++++++++++++++++++++++++++++++++---------- 1 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index ea18718..1fef86d 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -2,6 +2,7 @@ import PropTypes from 'prop-types' import { fromJS } from 'immutable' import { Form, Tabs, Row, Col, Input, Button, Table, Popconfirm, Icon, Tooltip, notification, Modal, message, InputNumber, Radio, Typography } from 'antd' +import { QuestionCircleOutlined } from '@ant-design/icons' import moment from 'moment' import Api from '@/api' @@ -170,9 +171,18 @@ title: 'SQL', dataIndex: 'sql', width: '60%', - render: (text) => ( - <Paragraph copyable ellipsis={{ rows: 5, expandable: true }}>{text}</Paragraph> - ) + render: (text) => { + let title = text.match(/^\s*\/\*.+\*\//) + title = title && title[0] ? title[0] : '' + 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> + </div> + ) + } }, { title: '鎵ц浣嶇疆', @@ -290,7 +300,7 @@ systemScripts: res.data.map(item => { return { name: item.funcname, - value: Utils.UnformatOptions(item.longparam) + value: window.decodeURIComponent(window.atob(item.longparam)) } }) }) @@ -419,6 +429,22 @@ changeColumns = (columns) => { const { verify } = this.state + + if (columns[0] && (columns[0].type === 'image' || columns[0].type === 'text')) { + columns = columns.map(col => { + let _cell = { + uuid: Utils.getuuid(), + Column: col.Column, + Text: col.Text, + type: 'Nvarchar(50)', + limit: '50', + import: 'true', + required: 'true' + } + + return _cell + }) + } columns = columns.map(col => { if (/^Nvarchar/ig.test(col.type)) { @@ -664,9 +690,7 @@ if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true this.setState({activeKey: 'scripts'}) - } - - if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true this.setState({activeKey: 'scripts'}) } @@ -794,7 +818,7 @@ <Col span={8}> <Form.Item label={ <Tooltip placement="bottomLeft" title="蹇界暐棣栬鏃讹紝浼氭牎楠宔xcel涓〃澶村悕绉颁笌excel鍒楄缃槸鍚︿竴鑷淬��"> - <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}}/> + <QuestionCircleOutlined className="mk-form-tip" /> 蹇界暐琛� </Tooltip> }> @@ -828,7 +852,7 @@ 娓呯┖Excel鍒� </Button> <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>娉細鏁板�肩被鍨嬶紙int 鎴� decimal锛夛紝鍐呭涓哄繀濉紱鏈�澶у�煎拰鏈�灏忓�煎湪绫诲瀷涓烘暟鍊兼椂鏈夋晥銆�</Col> - <EditTable data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> + <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> </TabPane> {card.intertype === 'system' ? <TabPane tab={ <span> @@ -837,7 +861,7 @@ </span> } key="unique"> <UniqueForm fields={verify.columns} dict={this.props.dict} uniqueChange={this.uniqueChange}/> - <EditTable data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/> + <EditTable actions={['edit', 'move', 'del']} data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/> </TabPane> : null} {card.intertype === 'system' ? <TabPane tab={ <span> -- Gitblit v1.8.0