| | |
| | | { |
| | | "short_name": "React App", |
| | | "name": "Create React App Sample", |
| | | "short_name": "MingKeOS", |
| | | "name": "MingKe Operating System 6.0", |
| | | "icons": [ |
| | | { |
| | | "src": "favicon.ico", |
| | |
| | | MenuName: '外部接口', |
| | | text: '外部接口' |
| | | }] |
| | | }, { |
| | | MenuID: 'systemManageViewParam', |
| | | text: '系统参数', |
| | | PageParam: {Icon: 'folder'}, |
| | | children: [{ |
| | | src: '', |
| | | PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, |
| | | type: 'ManageTable', |
| | | MenuID: '1577972969199lei1g0qkvlh4tkc908m', |
| | | MenuNo: 'sModularM', |
| | | MenuName: '系统模块', |
| | | text: '系统模块' |
| | | }] |
| | | }] |
| | | } |
| | |
| | | if (view.type === 'Home') { |
| | | return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'CommonTable') { |
| | | return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | } else if (view.type === 'VerupTable') { |
| | | return (<VerupTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'TabManage') { |
| | |
| | | 'header.form.paste': '粘贴', |
| | | 'header.form.ratio': '比例', |
| | | 'header.form.blacklist': '黑名单', |
| | | 'header.form.linkmenu': '关联菜单', |
| | | 'header.form.clickscale': '点击缩放', |
| | | 'header.modal.form.edit': '表单-编辑', |
| | | 'header.modal.search.edit': '搜索条件-编辑', |
| | | 'header.modal.action.edit': '按钮-编辑', |
| | |
| | | 'main.excel.content.limitmin': '小于最小值', |
| | | 'main.excel.content.limitmax': '大于最大值', |
| | | 'main.form.link.error': '关联菜单设置错误!', |
| | | 'main.form.picture.check': '查看图片', |
| | | 'form.required.input': 'Please input ', |
| | | 'form.required.select': 'Please select ' |
| | | } |
| | |
| | | 'header.form.paste': '粘贴', |
| | | 'header.form.ratio': '比例', |
| | | 'header.form.blacklist': '黑名单', |
| | | 'header.form.linkmenu': '关联菜单', |
| | | 'header.form.clickscale': '点击缩放', |
| | | 'header.modal.form.edit': '表单-编辑', |
| | | 'header.modal.search.edit': '搜索条件-编辑', |
| | | 'header.modal.action.edit': '按钮-编辑', |
| | |
| | | 'main.excel.content.limitmin': '小于最小值', |
| | | 'main.excel.content.limitmax': '大于最大值', |
| | | 'main.form.link.error': '关联菜单设置错误!', |
| | | 'main.form.picture.check': '查看图片', |
| | | 'form.required.input': '请输入', |
| | | 'form.required.select': '请选择' |
| | | } |
| | |
| | | |
| | | class NormalTable extends Component { |
| | | static propTpyes = { |
| | | param: PropTypes.any, // 其他页面传递的搜索条件等参数 |
| | | MenuID: PropTypes.string, // 菜单Id |
| | | MenuNo: PropTypes.string, // 菜单参数 |
| | | MenuName: PropTypes.string, // 菜单参数 |
| | | MenuID: PropTypes.string // 菜单Id |
| | | MenuName: PropTypes.string // 菜单名称 |
| | | } |
| | | |
| | | state = { |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction } = this.props |
| | | const { permAction, param } = this.props |
| | | |
| | | let param = { |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: this.props.MenuID |
| | | } |
| | | let result = await Api.getSystemCacheConfig(param) |
| | | let result = await Api.getSystemCacheConfig(_param) |
| | | |
| | | if (result.status) { |
| | | let config = '' |
| | |
| | | config.columns.forEach(col => { |
| | | if (_hideCol.includes(col.uuid)) return |
| | | |
| | | // if (col.linkThdMenu && !permAction[col.linkThdMenu.MenuID]) { |
| | | // col.linkThdMenu = '' |
| | | // } |
| | | |
| | | if (col.type === 'colspan' && col.sublist) { |
| | | let _col = JSON.parse(JSON.stringify(col)) |
| | | let subColumn = [] |
| | |
| | | } |
| | | |
| | | let valid = true // 搜索条件必填验证 |
| | | config.search.forEach(field => { |
| | | if (field.required === 'true' && !field.initval) { |
| | | config.search.forEach(item => { |
| | | if (item.type === 'text' && param && param.searchkey === item.field) { |
| | | item.initval = param.searchval |
| | | } |
| | | |
| | | if (item.required === 'true' && !item.initval) { |
| | | valid = false |
| | | } |
| | | }) |
| | |
| | | this.setState({userParam: param}) |
| | | } |
| | | |
| | | linkTrigger = (menu) => { |
| | | const { tabviews, MenuID } = this.props |
| | | |
| | | menu.selected = true |
| | | |
| | | let index = 0 |
| | | let isexit = false |
| | | let tabs = tabviews.map((tab, i) => { |
| | | tab.selected = false |
| | | |
| | | if (tab.MenuID === MenuID) { |
| | | index = i |
| | | } else if (tab.MenuID === menu.MenuID) { |
| | | tab.param = menu.param |
| | | tab.selected = true |
| | | isexit = true |
| | | } |
| | | |
| | | return tab |
| | | }) |
| | | |
| | | if (!isexit) { |
| | | tabs.splice(index + 1, 0, menu) |
| | | } |
| | | |
| | | this.props.modifyTabview(tabs) |
| | | } |
| | | |
| | | settingSubmit = () => { |
| | | const { userParam } = this.state |
| | | let _LongParam = '' |
| | |
| | | if (selectTab && selectTab.MenuID === this.props.MenuID) { |
| | | this.setShortcut() |
| | | } |
| | | } else if (nextProps.param && !is(fromJS(this.props.param), fromJS(nextProps.param))) { |
| | | let search = this.state.search.map(item => { |
| | | if (item.type === 'text' && item.key === nextProps.param.searchkey) { |
| | | item.value = nextProps.param.searchval |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | this.refreshbysearch(search) |
| | | } |
| | | } |
| | | |
| | |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | buttonTrigger={this.buttonTrigger} |
| | | linkTrigger={this.linkTrigger} |
| | | handleTableId={this.handleTableId} |
| | | /> |
| | | </div> : null |
| | |
| | | title = execAction.setting.title |
| | | width = execAction.setting.width + 'vw' |
| | | |
| | | if (execAction.setting.container === 'tab' && this.props.ContainerId) { |
| | | if (this.props.type === 'main' && execAction.setting.container === 'tab' && this.props.ContainerId) { |
| | | width = execAction.setting.width + '%' |
| | | container = () => document.getElementById(this.props.ContainerId) |
| | | } |
| | |
| | | |
| | | class FileUpload extends Component { |
| | | static propTpyes = { |
| | | value: PropTypes.array // 按钮信息、表单列表 |
| | | value: PropTypes.array, // 按钮信息、表单列表 |
| | | maxFile: PropTypes.any, // 最大文件数 |
| | | fileType: PropTypes.string // 文件显示类型 |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { value } = this.props |
| | | const { value, maxFile, fileType } = this.props |
| | | const { showprogress, percent, baseUrl } = this.state |
| | | |
| | | let uploadable = '' |
| | | |
| | | if (maxFile && maxFile > 0 && value && value.length >= maxFile) { |
| | | uploadable = 'limit-fileupload' |
| | | } |
| | | |
| | | const props = { |
| | | name: 'file', |
| | | disabled: showprogress, |
| | | listType: fileType, |
| | | fileList: value, |
| | | action: baseUrl, |
| | | method: 'post', |
| | |
| | | onRemove: this.onRemove, |
| | | data: this.getExtraData, |
| | | beforeUpload: this.beforeUpload, |
| | | className: uploadable |
| | | } |
| | | |
| | | return ( |
| | | <Upload {...props}> |
| | | <Button> |
| | |
| | | .main-form-field .ant-progress-small.ant-progress-line { |
| | | .main-form-field { |
| | | .ant-progress-small.ant-progress-line { |
| | | position: absolute; |
| | | bottom: -20px; |
| | | left: 0px; |
| | | } |
| | | .limit-fileupload { |
| | | > .ant-upload { |
| | | display: none; |
| | | } |
| | | } |
| | | .ant-upload-list-picture-card .ant-upload-list-item { |
| | | width: 90px; |
| | | height: 90px; |
| | | } |
| | | .ant-upload.ant-upload-select-picture-card { |
| | | width: 90px; |
| | | height: 90px; |
| | | } |
| | | } |
| | |
| | | callback() |
| | | } |
| | | |
| | | getFields() { |
| | | getFields(formlist) { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { cols } = this.state |
| | | |
| | | const fields = [] |
| | | |
| | | this.state.formlist.forEach((item, index) => { |
| | | if ((!item.field && item.type !== 'title') || item.hidden === 'true') return |
| | | formlist.forEach((item, index) => { |
| | | // if ((!item.field && item.type !== 'title') || item.hidden === 'true') return |
| | | |
| | | if (item.supField && !item.supvalue.includes(this.props.form.getFieldValue(item.supField))) return |
| | | // if (item.supField && !item.supvalue.includes(this.props.form.getFieldValue(item.supField))) return |
| | | |
| | | if (item.type === 'title') { |
| | | fields.push( |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <FileUpload /> |
| | | <FileUpload maxFile={item.maxfile} fileType={item.fileType || 'text'} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { formlist, cols } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | |
| | | let _formlist = [] |
| | | let rowIndex = 0 |
| | | let colIndex = 0 |
| | | |
| | | formlist.forEach(item => { |
| | | if ((!item.field && item.type !== 'title') || item.hidden === 'true' || item.type === 'funcvar') return |
| | | |
| | | if (item.supField && !item.supvalue.includes(this.props.form.getFieldValue(item.supField))) return |
| | | |
| | | _formlist[rowIndex] = _formlist[rowIndex] || [] |
| | | if (item.type === 'textarea' || item.type === 'title') { |
| | | if (colIndex === 0) { |
| | | _formlist[rowIndex].push(item) |
| | | } else { |
| | | rowIndex++ |
| | | _formlist[rowIndex] = [item] |
| | | } |
| | | rowIndex++ |
| | | colIndex = 0 |
| | | } else { |
| | | _formlist[rowIndex].push(item) |
| | | colIndex++ |
| | | } |
| | | if (colIndex >= cols) { |
| | | rowIndex++ |
| | | colIndex = 0 |
| | | } |
| | | }) |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="ant-advanced-search-form main-form-field" id="main-form-box"> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | {/* <Row gutter={24}>{this.getFields(formlist)}</Row> */} |
| | | {_formlist.map((formrow, index) => <Row key={index} gutter={24}>{this.getFields(formrow)}</Row>)} |
| | | </Form> |
| | | ) |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Table, message, Affix, Button, Typography } from 'antd' |
| | | import { Table, message, Affix, Button, Typography, Icon, Modal } from 'antd' |
| | | import './index.scss' |
| | | |
| | | const { Paragraph } = Typography |
| | |
| | | loading: PropTypes.bool, // 表格加载中 |
| | | refreshdata: PropTypes.func, // 表格中排序列、页码的变化时刷新 |
| | | buttonTrigger: PropTypes.func, // 表格中按钮触发操作 |
| | | linkTrigger: PropTypes.func, // 字段透视 |
| | | handleTableId: PropTypes.func // 数据切换 |
| | | } |
| | | |
| | |
| | | selectedRowKeys: [], // 表格中选中行 |
| | | pageIndex: 1, // 初始页面索引 |
| | | pageSize: 10, // 每页数据条数 |
| | | columns: null // 显示列 |
| | | columns: null, // 显示列 |
| | | imgShow: false, // 图片放大模态框 |
| | | imgSrc: '' // 图片路径 |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | let cell = { |
| | | align: item.Align, |
| | | dataIndex: item.field || item.uuid, |
| | | title: item.label, |
| | | title: <span>{item.label}{item.linkThdMenu ? <Icon type="link"/> : null}</span>, |
| | | sorter: item.field && item.IsSort === 'true', |
| | | width: item.Width || 120, |
| | | render: (text, record) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | triggerLink = (item, record) => { |
| | | let tabmenu = item.linkThdMenu |
| | | let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt'] |
| | | |
| | | if (tabmenu.LinkUrl === 'CommonTable') { |
| | | tabmenu.type = 'CommonTable' |
| | | } else if (tabmenu.LinkUrl === 'DataManage') { |
| | | tabmenu.type = 'DataManage' |
| | | } else if (tabmenu.LinkUrl && iframes.includes(tabmenu.LinkUrl.split('?')[0])) { |
| | | tabmenu.type = 'iframe' |
| | | } |
| | | |
| | | if (tabmenu.type !== 'iframe') { |
| | | try { |
| | | tabmenu.PageParam = JSON.parse(tabmenu.PageParam) |
| | | } catch (e) { |
| | | tabmenu.PageParam = {} |
| | | } |
| | | tabmenu.type = tabmenu.PageParam.Template || tabmenu.type |
| | | } |
| | | |
| | | tabmenu.param = { |
| | | searchkey: item.field, |
| | | searchval: record[item.field] || '' |
| | | } |
| | | |
| | | this.props.linkTrigger(tabmenu) |
| | | } |
| | | |
| | | getContent = (item, record) => { |
| | | if (item.type === 'text') { |
| | | let content = '' |
| | |
| | | |
| | | content = (item.prefix || '') + content + (item.postfix || '') |
| | | |
| | | if (item.linkThdMenu) { |
| | | return ( |
| | | <div className={match ? item.color : ''}> |
| | | <div className="background link-menu" onDoubleClick={() => this.triggerLink(item, record)}></div> |
| | | <div className="content link-menu" style={{ minWidth: (item.Width || 120) + 'px' }} onDoubleClick={() => this.triggerLink(item, record)}> |
| | | {content} |
| | | </div> |
| | | </div> |
| | | ) |
| | | } else { |
| | | return ( |
| | | <div className={match ? item.color : ''}> |
| | | <div className="background"></div> |
| | |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | } else if (item.type === 'number') { |
| | | let content = '' |
| | | let match = false |
| | |
| | | |
| | | content = (item.prefix || '') + content + (item.postfix || '') |
| | | |
| | | if (item.linkThdMenu) { |
| | | return ( |
| | | <div className={match ? item.color : ''}> |
| | | <div className="background link-menu" onDoubleClick={() => this.triggerLink(item, record)}></div> |
| | | <div className="content link-menu" style={{ minWidth: (item.Width || 120) + 'px' }} onDoubleClick={() => this.triggerLink(item, record)}> |
| | | {content} |
| | | </div> |
| | | </div> |
| | | ) |
| | | } else { |
| | | return ( |
| | | <div className={match ? item.color : ''}> |
| | | <div className={'background'}></div> |
| | |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | } else if (item.type === 'picture') { |
| | | let photos = '' |
| | | if (item.field && record.hasOwnProperty(item.field)) { |
| | |
| | | return ( |
| | | <div className="picture-col" style={{ minWidth: (item.Width || 120) + 'px' }}> |
| | | {photos && photos.map((url, i) => { |
| | | if (item.scale === 'true') { |
| | | return <img className="image-scale" onClick={this.imgScale} key={`${i}`} src={url} alt=""/> |
| | | } else { |
| | | return <img key={`${i}`} src={url} alt=""/> |
| | | } |
| | | })} |
| | | </div> |
| | | ) |
| | |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | imgScaleClose = () => { |
| | | this.setState({ |
| | | imgShow: false |
| | | }) |
| | | } |
| | | imgScale = (e) => { |
| | | if (e.target.nodeName === 'IMG') { |
| | | this.setState({ |
| | | imgShow: true, |
| | | imgSrc: e.target.src |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} ${this.props.dict['main.pagination.of']} ${total} ${this.props.dict['main.pagination.items']}` |
| | | }} |
| | | /> |
| | | <Modal |
| | | className="image-scale-modal" |
| | | visible={this.state.imgShow} |
| | | width="70vw" |
| | | maskClosable={true} |
| | | onCancel={this.imgScaleClose} |
| | | title={this.props.dict['main.form.picture.check']} |
| | | footer={[<span key="close" onClick={this.imgScaleClose}>{this.props.dict['main.close']}</span>]} |
| | | destroyOnClose |
| | | > |
| | | <img style={{maxWidth:'100%'}} src={this.state.imgSrc} alt="" /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | table { |
| | | max-width: 100%; |
| | | width: 100%; |
| | | .ant-table-thead { |
| | | tr { |
| | | th { |
| | | position: relative; |
| | | |
| | | .ant-table-column-title { |
| | | white-space: nowrap; |
| | | position: static!important; |
| | | .anticon-link { |
| | | // color: #1890ff; |
| | | opacity: 0.5; |
| | | position: absolute; |
| | | left: 0px; |
| | | bottom: 0px; |
| | | font-size: 12px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .ant-table-selection-column { |
| | | width: 60px; |
| | |
| | | img { |
| | | max-width: 100%; |
| | | } |
| | | .image-scale { |
| | | cursor: zoom-in; |
| | | } |
| | | } |
| | | .text { |
| | | .ant-btn > .anticon + span { |
| | |
| | | left: 0px; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | } |
| | | .link-menu { |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .content { |
| | |
| | | } |
| | | } |
| | | } |
| | | .image-scale-modal { |
| | | width: 70vw; |
| | | min-height: 80vh; |
| | | top: 10vh; |
| | | .ant-modal-body { |
| | | min-height: calc(80vh - 110px); |
| | | line-height: calc(80vh - 160px); |
| | | text-align: center; |
| | | } |
| | | .ant-modal-footer { |
| | | text-align: center; |
| | | span { |
| | | display: inline-block; |
| | | color: #1890ff; |
| | | padding: 5px 15px; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import zhCN from '@/locales/zh-CN/comtable.js' |
| | | import enUS from '@/locales/en-US/comtable.js' |
| | | import { getSearchForm, getActionForm, getColumnForm } from '@/templates/zshare/formconfig' |
| | |
| | | const { menu } = this.props |
| | | |
| | | if (card.type !== 'colspan') { |
| | | let menulist = menu.fstMenuList.map(item => { |
| | | return { |
| | | value: item.MenuID, |
| | | label: item.text, |
| | | isLeaf: false |
| | | } |
| | | }) |
| | | |
| | | if ((card.type === 'text' || card.type === 'number') && card.linkmenu && card.linkmenu.length > 0) { |
| | | let _param = { |
| | | func: 'sPC_Get_FunMenu', |
| | | ParentID: card.linkmenu[0], |
| | | systemType: options.systemType, |
| | | debug: 'Y' |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | | if (result.status) { |
| | | menulist = menulist.map(item => { |
| | | if (item.value === card.linkmenu[0]) { |
| | | item.children = result.data.map(item => { |
| | | let submenu = { |
| | | value: item.ParentID, |
| | | label: item.MenuNameP, |
| | | children: item.FunMenu.map(cell => { |
| | | return { |
| | | value: cell.MenuID, |
| | | label: cell.MenuName, |
| | | MenuID: cell.MenuID, |
| | | MenuName: cell.MenuName, |
| | | MenuNo: cell.MenuNo, |
| | | Ot: cell.Ot, |
| | | PageParam: cell.PageParam, |
| | | LinkUrl: cell.LinkUrl |
| | | } |
| | | }) |
| | | } |
| | | |
| | | submenu.children = submenu.children.filter(cell => cell.MenuID !== menu.MenuID) |
| | | |
| | | return submenu |
| | | }) |
| | | } |
| | | return item |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: false, |
| | | modaltype: 'columns', |
| | | card: card, |
| | | formlist: getColumnForm(card, menu.roleList, menulist) |
| | | }) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | modaltype: 'columns', |
| | | card: card, |
| | | formlist: getColumnForm(card, menu.roleList) |
| | | formlist: getColumnForm(card, menu.roleList, menulist) |
| | | }) |
| | | } |
| | | } else { |
| | | this.setState({ |
| | | modaltype: 'colspan', |
| | |
| | | }) |
| | | } |
| | | |
| | | let fieldrepet = false // 字段重复 |
| | | let labelrepet = false // 提示文字重复 |
| | | |
| | | let _search = config.search.map(item => { |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepet = true |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | |
| | | if (fieldrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (labelrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '名称已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | _search = _search.filter(item => !item.origin) |
| | | |
| | | this.setState({ |
| | |
| | | }) |
| | | } else if (modaltype === 'columns' || modaltype === 'colspan') { |
| | | this.columnFormRef.handleConfirm().then(res => { |
| | | let fieldrepet = false // 字段重复 |
| | | let labelrepet = false // 提示文字重复 |
| | | |
| | | let _columns = config.columns.map(item => { |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepet = true |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | |
| | | if (fieldrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (labelrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '名称已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | _columns = _columns.filter(item => !item.origin) |
| | | |
| | | this.setState({ |
| | |
| | | <ColumnForm |
| | | dict={this.state.dict} |
| | | card={this.state.card} |
| | | MenuID={this.props.menu.MenuID} |
| | | inputSubmit={this.handleSubmit} |
| | | formlist={this.state.formlist} |
| | | wrappedComponentRef={(inst) => this.columnFormRef = inst} |
| | |
| | | let oInput = document.createElement('input') |
| | | let val = JSON.parse(JSON.stringify(_card)) |
| | | val.copyType = 'form' |
| | | val.uuid = Utils.getuuid() |
| | | |
| | | delete val.originUuid |
| | | delete val.iscopy |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | | document.body.appendChild(oInput) |
| | |
| | | |
| | | let _groups = null |
| | | let fieldrepet = false // 字段重复 |
| | | let labelrepeat = false // 提示文字重复 |
| | | |
| | | if (card.iscopy) { |
| | | _groups = _config.groups.map(group => { |
| | |
| | | |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepeat = true |
| | | } |
| | | }) |
| | | |
| | |
| | | group.sublist = group.sublist.map(item => { |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepeat = true |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | |
| | | if (fieldrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段名重复!', |
| | | message: '字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (labelrepeat) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '名称已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (res.copyType === 'form') { |
| | | let repeat = false |
| | | |
| | | _config.groups.forEach(group => { |
| | | let item = group.sublist.filter(cell => cell.field === res.field)[0] |
| | | if (item) { |
| | | repeat = true |
| | | } |
| | | |
| | | if (group.isDefault) { |
| | | group.sublist.push(res) |
| | | } |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '不支持此表单类型!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (repeat) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '此表单字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | |
| | | <TextArea defaultValue={card.initval} autosize={{ minRows: 2, maxRows: 6 }} /> |
| | | } |
| | | {card.type === 'fileupload' && |
| | | <Button> |
| | | <Button style={{marginTop: '3px'}}> |
| | | <Icon type="upload" /> 点击上传 |
| | | </Button> |
| | | } |
| | |
| | | let oInput = document.createElement('input') |
| | | let val = JSON.parse(JSON.stringify(card)) |
| | | val.copyType = 'form' |
| | | val.uuid = Utils.getuuid() |
| | | |
| | | delete val.originUuid |
| | | |
| | |
| | | } |
| | | |
| | | let fieldrepet = false // 字段重复 |
| | | let labelrepet = false // 提示文字重复 |
| | | |
| | | if (modalType === 'copy' && card.originUuid) { |
| | | if (_config.groups.length > 0) { |
| | |
| | | |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepet = true |
| | | } |
| | | }) |
| | | |
| | |
| | | |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepet = true |
| | | } |
| | | }) |
| | | |
| | |
| | | group.sublist = group.sublist.map(item => { |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepet = true |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | |
| | | _config.fields = _config.fields.map(item => { |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepet = true |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | |
| | | if (fieldrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段名重复!', |
| | | message: '字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (labelrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '名称已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (res.copyType === 'form') { |
| | | let repeat = false |
| | | if (_config.groups.length > 0) { |
| | | _config.groups.forEach(group => { |
| | | let item = group.sublist.filter(cell => cell.field === res.field)[0] |
| | | if (item) { |
| | | repeat = true |
| | | } |
| | | |
| | | if (group.default) { |
| | | group.sublist.push(res) |
| | | } |
| | | }) |
| | | } else { |
| | | let item = _config.fields.filter(cell => cell.field === res.field)[0] |
| | | if (item) { |
| | | repeat = true |
| | | } |
| | | _config.fields.push(res) |
| | | } |
| | | |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '不支持此表单类型!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (repeat) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '此表单字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | <Icon type="setting" onClick={this.changeSetting} /> |
| | | <Icon type="snippets" title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} /> |
| | | <div className="ant-modal-content" style={{width: config.setting.width + '%'}}> |
| | | <button type="button" className="ant-modal-close"> |
| | | <span className="ant-modal-close-x"><Icon type="close"/></span> |
| | |
| | | <div className="ant-modal-title">{config.setting.title}</div> |
| | | </div> |
| | | <div className="ant-modal-body"> |
| | | <Icon className="paste-Icon" type="snippets" title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} /> |
| | | <div className="modal-form"> |
| | | {config.groups.length > 0 && |
| | | config.groups.map(group => { |
| | |
| | | <SettingForm |
| | | config={config} |
| | | dict={this.state.dict} |
| | | isSubTab={!!this.props.editTab} |
| | | inputSubmit={this.settingSave} |
| | | wrappedComponentRef={(inst) => this.settingRef = inst} |
| | | /> |
| | |
| | | right: 15px; |
| | | top: 10px; |
| | | } |
| | | > .anticon-snippets { |
| | | .paste-Icon { |
| | | position: absolute; |
| | | font-size: 16px; |
| | | right: 15px; |
| | | top: 40px; |
| | | top: 65px; |
| | | } |
| | | } |
| | | } |
| | |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | config: PropTypes.object, // 表单配置信息 |
| | | isSubTab: PropTypes.bool, // 是否为子标签 |
| | | inputSubmit: PropTypes.any // 回车提交事件 |
| | | } |
| | | |
| | |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.container = values.container || 'view' |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | {!this.props.isSubTab ? <Col span={12}> |
| | | <Form.Item label="挂载对象"> |
| | | {getFieldDecorator('container', { |
| | | initialValue: config.setting.container || 'tab' |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | <Col span={12}> |
| | | <Form.Item label="显示方式"> |
| | | {getFieldDecorator('display', { |
| | |
| | | }) |
| | | } |
| | | |
| | | let fieldrepet = false // 字段重复 |
| | | let labelrepet = false // 提示文字重复 |
| | | |
| | | let _search = config.search.map(item => { |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepet = true |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | |
| | | if (fieldrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (labelrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '名称已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | _search = _search.filter(item => !item.origin) |
| | | |
| | | this.setState({ |
| | |
| | | }) |
| | | } else if (modaltype === 'columns' || modaltype === 'colspan') { |
| | | this.columnFormRef.handleConfirm().then(res => { |
| | | let fieldrepet = false // 字段重复 |
| | | let labelrepet = false // 提示文字重复 |
| | | |
| | | let _columns = config.columns.map(item => { |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepet = true |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | |
| | | if (fieldrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (labelrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '名称已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | _columns = _columns.filter(item => !item.origin) |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | } |
| | | return ( |
| | | <Form {...formItemLayout} className="ant-advanced-search-form commontable-column-form" id="columncolspan"> |
| | | <Form {...formItemLayout} className="commontable-cospan-column-form" id="columncolspan"> |
| | | <Row gutter={24}> |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['header.form.name']}> |
| | |
| | | .ant-advanced-search-form.commontable-column-form { |
| | | .commontable-cospan-column-form { |
| | | min-height: 190px; |
| | | .ant-form-item { |
| | | .ant-input-number { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Icon } from 'antd' |
| | | import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Icon, Cascader, notification } from 'antd' |
| | | |
| | | import { formRule } from '@/utils/option.js' |
| | | import options from '@/store/options.js' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | MenuID: PropTypes.any, |
| | | formlist: PropTypes.any, |
| | | card: PropTypes.any, |
| | | inputSubmit: PropTypes.any // 回车提交事件 |
| | | } |
| | | |
| | | state = { |
| | | formlist: null |
| | | formlist: null, |
| | | menulist: null |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let _type = this.props.formlist.filter(form => form.key === 'type')[0].initVal |
| | | let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist'] |
| | | let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || '' |
| | | |
| | | let _options = null |
| | | |
| | | if (_type === 'text') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist', 'linkmenu'] |
| | | } else if (_type === 'number') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist'] |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist', 'linkmenu'] |
| | | } else if (_type === 'textarea') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] |
| | | } else if (_type === 'picture') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale'] |
| | | } |
| | | |
| | | this.setState({ |
| | | menulist: _menulist.options || [], |
| | | formlist: this.props.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | | if (item.key === 'matchVal' && (_type === 'text' || _type === 'textarea')) { |
| | |
| | | |
| | | typeChange = (key, value) => { |
| | | if (key === 'type') { |
| | | let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist'] |
| | | let _options = null |
| | | |
| | | if (value === 'text') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist', 'linkmenu'] |
| | | } else if (value === 'number') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist'] |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist', 'linkmenu'] |
| | | } else if (value === 'textarea') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] |
| | | } else if (value === 'picture') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale'] |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'cascader') { // 多选 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [] |
| | | })( |
| | | <Cascader |
| | | options={this.state.menulist} |
| | | loadData={this.loadData} |
| | | placeholder="" |
| | | getPopupContainer={() => document.getElementById('columnwinter')} |
| | | /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |
| | | } |
| | | |
| | | loadData = selectedOptions => { |
| | | const { MenuID } = this.props |
| | | const targetOption = selectedOptions[selectedOptions.length - 1] |
| | | targetOption.loading = true |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_FunMenu', |
| | | ParentID: targetOption.value, |
| | | systemType: options.systemType, |
| | | debug: 'Y' |
| | | } |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | | if (result.status) { |
| | | targetOption.loading = false |
| | | targetOption.children = result.data.map(item => { |
| | | let submenu = { |
| | | value: item.ParentID, |
| | | label: item.MenuNameP, |
| | | children: item.FunMenu.map(cell => { |
| | | return { |
| | | value: cell.MenuID, |
| | | label: cell.MenuName, |
| | | MenuID: cell.MenuID, |
| | | MenuName: cell.MenuName, |
| | | MenuNo: cell.MenuNo, |
| | | Ot: cell.Ot, |
| | | PageParam: cell.PageParam, |
| | | LinkUrl: cell.LinkUrl |
| | | } |
| | | }) |
| | | } |
| | | |
| | | submenu.children = submenu.children.filter(cell => cell.MenuID !== MenuID) |
| | | |
| | | return submenu |
| | | }) |
| | | |
| | | this.setState({ |
| | | menulist: [...this.state.menulist] |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | targetOption.loading = false |
| | | } |
| | | }) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { menulist } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.id = this.props.card.id |
| | | values.uuid = this.props.card.uuid |
| | | |
| | | if ((values.type === 'text' || values.type === 'number') && values.linkmenu && values.linkmenu.length > 0) { |
| | | let linkThdMenu = '' |
| | | menulist.forEach(menu => { |
| | | if (menu.value === values.linkmenu[0]) { |
| | | menu.children.forEach(item => { |
| | | if (item.value === values.linkmenu[1]) { |
| | | item.children.forEach(cell => { |
| | | if (cell.value === values.linkmenu[2]) { |
| | | linkThdMenu = cell |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | values.linkThdMenu = linkThdMenu |
| | | } |
| | | |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | |
| | | } |
| | | } |
| | | return ( |
| | | <Form {...formItemLayout} className="ant-advanced-search-form commontable-column-form" id="columnwinter"> |
| | | <Form {...formItemLayout} className="commontable-column-form" id="columnwinter"> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |
| | |
| | | .ant-advanced-search-form.commontable-column-form { |
| | | .commontable-column-form { |
| | | min-height: 190px; |
| | | .ant-form-item { |
| | | .ant-input-number { |
| | |
| | | position: relative; |
| | | left: -3px; |
| | | } |
| | | .ant-cascader-menus { |
| | | padding: 5px 0px; |
| | | .ant-cascader-menu:last-child { |
| | | padding-right: 3px; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | copycard.originCard = card |
| | | |
| | | let _val = '' |
| | | let _val = JSON.parse(JSON.stringify(copycard)) |
| | | |
| | | try { |
| | | copycard.copyType = 'action' |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(copycard))) |
| | | _val.copyType = 'action' |
| | | _val.uuid = Utils.getuuid() |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) |
| | | } catch { |
| | | console.warn('Stringify Failure') |
| | | _val = '' |
| | |
| | | * @description 获取显示列表单配置信息 |
| | | * @param {*} card |
| | | */ |
| | | export function getColumnForm (card, roleList = []) { |
| | | export function getColumnForm (card, roleList = [], menulist = []) { |
| | | return [ |
| | | { |
| | | type: 'text', |
| | |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | key: 'linkmenu', |
| | | label: Formdict['header.form.linkmenu'], |
| | | initVal: card.linkmenu || [], |
| | | required: false, |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'scale', |
| | | label: Formdict['header.form.clickscale'], |
| | | initVal: card.scale || 'false', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | } |
| | | ] |
| | | } |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'regular', |
| | | label: Formdict['header.form.regular'], |
| | | initVal: card.regular || '', |
| | | options: [{ |
| | | value: '', |
| | | text: Formdict['header.form.empty'] |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['header.form.number'] |
| | | }, { |
| | | value: 'letter', |
| | | text: Formdict['header.form.letter'] |
| | | }, { |
| | | value: 'letter&number', |
| | | text: Formdict['header.form.letter&number'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'readonly', |
| | | label: Formdict['header.form.readonly'], |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'fieldlength', |
| | | label: Formdict['header.form.field.length'], |
| | | tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512', |
| | | initVal: card.fieldlength || _fieldlength, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'readin', |
| | | label: Formdict['header.form.readin'], |
| | |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'fieldlength', |
| | | label: Formdict['header.form.field.length'], |
| | | tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512', |
| | | initVal: card.fieldlength || _fieldlength, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'maxRows', |
| | | label: Formdict['header.form.maxRows'], |
| | | initVal: card.maxRows || 6, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'regular', |
| | | label: Formdict['header.form.regular'], |
| | | initVal: card.regular || '', |
| | | options: [{ |
| | | value: '', |
| | | text: Formdict['header.form.empty'] |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['header.form.number'] |
| | | }, { |
| | | value: 'letter', |
| | | text: Formdict['header.form.letter'] |
| | | }, { |
| | | value: 'letter&number', |
| | | text: Formdict['header.form.letter&number'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | options: inputfields |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'fileType', |
| | | label: '显示方式', |
| | | initVal: card.fileType || 'text', |
| | | options: [{ |
| | | value: 'picture', |
| | | text: '图文信息' |
| | | }, { |
| | | value: 'picture-card', |
| | | text: '图片卡' |
| | | }, { |
| | | value: 'text', |
| | | text: '文件' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'maxfile', |
| | | label: '最大文件数', |
| | | initVal: card.maxfile || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | |
| | | <Select |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | getPopupContainer={() => document.getElementById('columnwinter')} |
| | | getPopupContainer={() => document.getElementById('gridbtncolumnwinter')} |
| | | > |
| | | {item.options.map(option => |
| | | <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}> |
| | |
| | | } |
| | | } |
| | | return ( |
| | | <Form {...formItemLayout} className="ant-advanced-search-form commontable-column-form" id="columnwinter"> |
| | | <Form {...formItemLayout} className="commontable-gridbtn-column-form" id="gridbtncolumnwinter"> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |
| | |
| | | .ant-advanced-search-form.commontable-column-form { |
| | | .commontable-gridbtn-column-form { |
| | | min-height: 190px; |
| | | .ant-form-item { |
| | | .ant-input-number { |
| | |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | const modalTypeOptions = { |
| | | text: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'fieldlength', 'regular'], |
| | | number: ['label', 'field', 'initval', 'type', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'blacklist'], |
| | | select: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'setAll', 'linkSubField'], |
| | | multiselect: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'fieldlength'], |
| | | link: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'setAll', 'linkField'], |
| | | fileupload: ['label', 'field', 'type', 'readonly', 'required', 'readin', 'fieldlength', 'blacklist', 'maxfile', 'fileType'], |
| | | date: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'], |
| | | datemonth: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'], |
| | | datetime: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'], |
| | | textarea: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'fieldlength', 'maxRows'], |
| | | funcvar: ['label', 'field', 'type', 'blacklist'], |
| | | linkMain: ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength', 'blacklist'] |
| | | } |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | |
| | | } |
| | | }) |
| | | |
| | | let _options = ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'] // 默认显示项 |
| | | let _options = modalTypeOptions[type] |
| | | |
| | | if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '0') { // 选择类型、自定义资源 |
| | | _options = [..._options, 'resourceType', 'options', 'quick'] |
| | | _options = [..._options, 'options', 'quick'] |
| | | } else if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '1') { // 选择类型、数据源 |
| | | _options = [..._options, 'resourceType', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'database'] |
| | | } else if (type === 'number') { |
| | | _options = ['label', 'field', 'initval', 'type', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'blacklist'] |
| | | } else if (type === 'fileupload') { |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'readin', 'fieldlength', 'blacklist'] |
| | | } else if (type === 'textarea') { |
| | | _options = [..._options, 'fieldlength', 'maxRows'] |
| | | } else if (type === 'text') { |
| | | _options = [..._options, 'fieldlength', 'regular'] |
| | | } |
| | | |
| | | if (type === 'select') { |
| | | _options = [..._options, 'setAll', 'linkSubField'] |
| | | } else if (type === 'multiselect') { |
| | | _options = [..._options, 'fieldlength'] |
| | | } else if (type === 'link') { // 关联类型、增加关联字段 |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } else if (type === 'funcvar') { // 设置为函数变量时,不需要其他信息 |
| | | _options = ['label', 'field', 'type', 'blacklist'] |
| | | } else if (type === 'linkMain') { |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength', 'blacklist'] |
| | | _options = [..._options, 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'database'] |
| | | } |
| | | |
| | | if (type !== 'funcvar' && type !== 'linkMain') { |
| | |
| | | } |
| | | |
| | | openTypeChange = (key, value) => { |
| | | |
| | | if (key === 'type') { |
| | | let _options = ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'] |
| | | let _options = modalTypeOptions[value] |
| | | |
| | | if ((value === 'multiselect' || value === 'select' || value === 'link') && this.state.resourceType === '0') { // 选择类型、自定义资源 |
| | | _options = [..._options, 'resourceType', 'options', 'quick'] |
| | | _options = [..._options, 'options', 'quick'] |
| | | } else if ((value === 'multiselect' || value === 'select' || value === 'link') && this.state.resourceType === '1') { // 选择类型、数据源 |
| | | _options = [..._options, 'resourceType', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'database'] |
| | | } else if (value === 'number') { |
| | | _options = ['label', 'field', 'initval', 'type', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'blacklist'] |
| | | } else if (value === 'fileupload') { |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'readin', 'fieldlength', 'blacklist'] |
| | | } else if (value === 'textarea') { |
| | | _options = [..._options, 'fieldlength', 'maxRows'] |
| | | } else if (value === 'text') { |
| | | _options = [..._options, 'fieldlength', 'regular'] |
| | | } |
| | | |
| | | if (value === 'select') { |
| | | _options = [..._options, 'setAll', 'linkSubField'] |
| | | } else if (value === 'multiselect') { |
| | | _options = [..._options, 'fieldlength'] |
| | | } else if (value === 'link') { |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } else if (value === 'funcvar') { |
| | | _options = ['label', 'field', 'type', 'blacklist'] |
| | | } else if (value === 'linkMain') { |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength', 'blacklist'] |
| | | _options = [..._options, 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'database'] |
| | | } |
| | | |
| | | if (value !== 'funcvar' && value !== 'linkMain') { |
| | |
| | | const { openType } = this.state |
| | | let value = e.target.value |
| | | if (key === 'resourceType') { |
| | | let _options = ['label', 'field', 'initval', 'type', 'resourceType', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'supField'] |
| | | let _options = modalTypeOptions[openType] |
| | | |
| | | if (value === '0') { |
| | | _options = [..._options, 'options', 'quick'] |
| | | } else if (value === '1') { |
| | | _options = [..._options, 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'database'] |
| | | } |
| | | |
| | | if (openType === 'select') { |
| | | _options = [..._options, 'setAll', 'linkSubField'] |
| | | } else if (openType === 'link') { |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } else if (openType === 'multiselect') { |
| | | _options = [..._options, 'fieldlength'] |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.key === 'fieldlength') { |
| | | } else if (item.key === 'fieldlength' || item.key === 'maxfile') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | |
| | | componentDidMount() { |
| | | // 获取生成单号一级菜单 |
| | | let defer1 = new Promise(resolve => { |
| | | let _orderSql = 'select ID,ModularCode+ModularName+ModularNo as NameNO from sModular where deleted=0 order by ID asc' |
| | | let _orderSql = `select distinct ModularCode as ID,ModularCode+ModularName+ModularNo as NameNO from sModular where deleted=0 and Appkey=case when Appkey='' then '' else @Appkey@ end order by ID asc` |
| | | _orderSql = Utils.formatOptions(_orderSql) |
| | | |
| | | let orderParam = { |
| | |
| | | |
| | | // 获取生成单号二级菜单 |
| | | let defer2 = new Promise(resolve => { |
| | | let _orderDetailSql = 'select ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,BID,Type from sModularDetail where Deleted=0' |
| | | let _orderDetailSql = `select distinct ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID,Type from sModularDetail where Deleted=0 and Appkey=case when Appkey='' then '' else @Appkey@ end order by ModularDetailCode` |
| | | _orderDetailSql = Utils.formatOptions(_orderDetailSql) |
| | | |
| | | let orderDetailParam = { |
| | |
| | | |
| | | update ${param.name} set ${field3},modifydate=getdate(),modifyuserid=@UserID |
| | | ` |
| | | } else if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { |
| | | form = ` |
| | | update ${param.name} set ModifyDate=getdate(),ModifyUserID=@UserID where ${primaryKey}=@${primaryKey} |
| | | ` |
| | | } |
| | | |
| | | if (columns) { |