| | |
| | | import Api from '@/api' |
| | | import options from '@/store/options.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import { queryTableSql } from '@/utils/option.js' |
| | | |
| | | import './index.scss' |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | tables: [], // 系统表 |
| | | tableFields: [], // 已选表字段集 |
| | | selectedTables: [], // 已选表 |
| | |
| | | |
| | | render() { |
| | | const { containerId } = this.props |
| | | const { dict, tables, selectedTables } = this.state |
| | | const { tables, selectedTables } = this.state |
| | | |
| | | return ( |
| | | <div className="model-table-tablemanage-view"> |
| | | <div className="model-tablename-manage-view"> |
| | | {/* 表名添加 */} |
| | | <div className="ant-col ant-form-item-label"> |
| | | <label> |
| | | <Tooltip placement="topLeft" title={dict['model.tooltip.table.guide']}> |
| | | <Tooltip placement="topLeft" title="此处可以添加页面配置相关的常用表,可通过工具栏中的添加按钮,可批量添加表格相关字段。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {dict['header.menu.table.add']} |
| | | 表名 |
| | | </Tooltip> |
| | | </label> |
| | | </div> |
| | |
| | | className="tables" |
| | | style={{ width: '100%' }} |
| | | optionFilterProp="children" |
| | | value={dict['header.menu.table.placeholder']} |
| | | onChange={this.onTableChange} |
| | | value="请选择表名" |
| | | onSelect={this.onTableChange} |
| | | dropdownClassName="mk-tables" |
| | | showArrow={false} |
| | | getPopupContainer={() => containerId ? document.getElementById(containerId) : document.body} |
| | | filterOption={(input, option) => { |
| | | return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 || |
| | | option.props.value.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | return option.props.children[0].toLowerCase().indexOf(input.toLowerCase()) >= 0 || |
| | | option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | }} |
| | | > |
| | | {tables.map((table, index) => ( |
| | | <Option key={index} title={table.TbName} value={table.TbName}>{table.Remark}</Option> |
| | | <Option key={index} title={table.TbName} value={table.TbName}>{table.Remark}<br/>{table.TbName}</Option> |
| | | ))} |
| | | </Select> |
| | | {selectedTables.length > 0 && <List |
| | |
| | | renderItem={(item, index) => <List.Item key={index} title={item.Remark + ' (' + item.TbName + ')'}> |
| | | {item.Remark + ' (' + item.TbName + ')'} |
| | | <CloseOutlined onClick={() => this.deleteTable(item)}/> |
| | | <div className="bottom-mask"></div> |
| | | </List.Item>} |
| | | />} |
| | | </div> |