| | |
| | | 'header.menu.action.configurable': 'Button Configurable', |
| | | 'header.menu.tab.configurable': 'Tab Configurable', |
| | | 'header.menu.column': 'Column', |
| | | 'header.menu.column.add': 'Add columns', |
| | | 'model.menu.column.add': 'Add columns', |
| | | 'model.menu.field.add': 'Add fields', |
| | | 'header.menu.page.configurable': 'Configuration Page', |
| | | 'header.menu.viewName': 'The name of the page', |
| | | 'header.menu.tabName': 'Tag name', |
| | |
| | | 'header.menu.action.configurable': '按钮配置', |
| | | 'header.menu.tab.configurable': '标签配置', |
| | | 'header.menu.column': '显示列', |
| | | 'header.menu.column.add': '添加显示列', |
| | | 'model.menu.column.add': '添加显示列', |
| | | 'model.menu.field.add': '添加字段', |
| | | 'header.menu.page.configurable': '页面配置', |
| | | 'header.menu.viewName': '页面名称', |
| | | 'header.menu.tabName': '标签名称', |
| | |
| | | destroyOnClose |
| | | > |
| | | {config.tab ? <SubTabTable |
| | | type="calendar" |
| | | BID={triggerTime} |
| | | Tab={config.tab} |
| | | SupMenuID={this.props.MenuID} |
| | |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (!is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let datelist = this.mountdata(this.state.datelist, nextProps.data || []) |
| | | let datelist = this.getDateList(this.state.selectYear) |
| | | let monthlist = null |
| | | |
| | | datelist = this.mountdata(datelist, nextProps.data || []) |
| | | |
| | | if (this.state.levels.includes('month') || this.state.levels.includes('year')) { |
| | | monthlist = datelist.filter(item => item.month === this.state.selectMonth)[0] |
| | |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | return !is(fromJS(this.props.loading), fromJS(nextProps.loading)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | mountdata = (datelist, data) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 批量添加,更新配置信息 |
| | | */ |
| | | updatefield = (config) => { |
| | | this.setState({ |
| | | config: config |
| | | }) |
| | | } |
| | | |
| | | // 年切换时重新生成数据 |
| | | changeDate = (year) => { |
| | | this.setState({ |
| | |
| | | config={config} |
| | | type="search" |
| | | tableFields={this.state.tableFields} |
| | | updatefield={this.updatefield} |
| | | updatefield={this.updateconfig} |
| | | /> |
| | | </Panel> |
| | | </Collapse> |
| | |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | <SettingComponent |
| | | type="subtable" |
| | | config={config} |
| | | MenuID={config.uuid} |
| | | menuformRef={this.menuformRef} |
| | | tableFields={this.state.tableFields} |
| | | permFuncField={this.props.permFuncField} |
| | | updateConfig={this.updateconfig} |
| | | /> |
| | |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import mainsubtable from '@/assets/img/mainsubtable.jpg' |
| | | import treepage from '@/assets/img/treepage.jpg' |
| | | import calendar from '@/assets/img/calendar.jpg' |
| | | |
| | | import Preview from './preview' |
| | | import MenuForm from './menuform' |
| | |
| | | const illust = { // 模板图片,用于已使用模板 |
| | | CommonTable: mainsubtable, |
| | | TreePage: treepage, |
| | | CalendarPage: treepage |
| | | CalendarPage: calendar |
| | | } |
| | | |
| | | class EditMenu extends Component { |
| | |
| | | class DataSource extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.any, |
| | | MenuID: PropTypes.string, |
| | | tableFields: PropTypes.any, |
| | | permFuncField: PropTypes.any, |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | |
| | | <VerifyCard |
| | | dict={dict} |
| | | config={config} |
| | | tableFields={this.props.tableFields} |
| | | permFuncField={this.props.permFuncField} |
| | | menuId={this.props.config.uuid} |
| | | searches={config.search} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import ColForm from './columnform' |
| | | import CustomScriptsForm from './customscript' |
| | | import SettingForm from './settingform' |
| | |
| | | const { TabPane } = Tabs |
| | | const { Paragraph } = Typography |
| | | |
| | | const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) |
| | | |
| | | class VerifyCard extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | config: PropTypes.object, // 数据源信息 |
| | | menuId: PropTypes.string, // 菜单Id |
| | | searches: PropTypes.array, // 搜索条件 |
| | | dict: PropTypes.object, // 字典项 |
| | | tableFields: PropTypes.any, // 数据源信息 |
| | | permFuncField: PropTypes.any, // 数据源信息 |
| | | config: PropTypes.object, // 数据源信息 |
| | | menuId: PropTypes.string, // 菜单Id |
| | | searches: PropTypes.array, // 搜索条件 |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | } |
| | | |
| | | updatefields = (columns) => { |
| | | this.setState({ |
| | | columns: columns |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | <SettingForm |
| | | menuId={this.props.menuId} |
| | | dict={this.props.dict} |
| | | permFuncField={this.props.permFuncField} |
| | | columns={columns} |
| | | setting={setting} |
| | | scripts={scripts} |
| | |
| | | columnChange={this.columnChange} |
| | | wrappedComponentRef={(inst) => this.contrastForm = inst} |
| | | /> |
| | | <FieldsComponent |
| | | config={{...this.props.config, columns}} |
| | | type="fields" |
| | | tableFields={this.props.tableFields} |
| | | updatefield={this.updatefields} |
| | | /> |
| | | <Table |
| | | bordered |
| | | rowKey="uuid" |
| | |
| | | word-wrap: break-word; |
| | | word-break: break-word; |
| | | } |
| | | .quickly-add { |
| | | position: relative; |
| | | width: 100px; |
| | | float: right; |
| | | top: -5px; |
| | | z-index: 2; |
| | | } |
| | | .verify-form { |
| | | .ant-input-number { |
| | | width: 100%; |
| | |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import { formRule } from '@/utils/option.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import './index.scss' |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | menuId: PropTypes.string, // 菜单Id |
| | | setting: PropTypes.object, // 数据源配置 |
| | | columns: PropTypes.array, // 列设置 |
| | | scripts: PropTypes.array, // 自定义脚本 |
| | | dict: PropTypes.object, // 字典项 |
| | | menuId: PropTypes.string, // 菜单Id |
| | | permFuncField: PropTypes.any, // 菜单Id |
| | | setting: PropTypes.object, // 数据源配置 |
| | | columns: PropTypes.array, // 列设置 |
| | | scripts: PropTypes.array, // 自定义脚本 |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { setting } = this.props |
| | | const { setting, permFuncField } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { interType } = this.state |
| | | |
| | |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | |
| | | let tooltip = null |
| | | let rules = [] |
| | | |
| | | if (permFuncField && permFuncField.length > 0) { |
| | | tooltip = '开头可用字符:' + permFuncField.join(', ') |
| | | let str = '^(' + permFuncField.join('|') + ')' |
| | | let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') |
| | | |
| | | rules.push({ |
| | | pattern: _patten, |
| | | message: formRule.func.innerMessage |
| | | }) |
| | | } |
| | | |
| | | return ( |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | {interType === 'inner' ? <Col span={8}> |
| | | <Form.Item label="内部函数"> |
| | | <Form.Item label={tooltip ? |
| | | <Tooltip placement="topLeft" title={tooltip}> |
| | | <Icon type="question-circle" /> |
| | | 内部函数 |
| | | </Tooltip> : '内部函数' |
| | | }> |
| | | {getFieldDecorator('innerFunc', { |
| | | initialValue: setting.innerFunc || '', |
| | | rules: [ |
| | | |
| | | ] |
| | | rules: rules |
| | | })(<Input placeholder={''} autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | |
| | | <div className="common-modal-edit-card"> |
| | | <Row className="search-row"> |
| | | <Col span={8}> |
| | | {!loading ? <Search placeholder={dict['form.required.input'] + dict['header.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} |
| | | {!loading ? <Search placeholder={dict['form.required.input'] + dict['model.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} |
| | | </Col> |
| | | <Col span={8}> |
| | | <Button onClick={this.reset}> |
| | |
| | | columns.set(item.field, {...item, selected: true, datatype: _datatype}) |
| | | } |
| | | }) |
| | | } else if (type === 'fields') { |
| | | config.columns.forEach(item => { |
| | | if (columns.has(item.field)) { |
| | | let _datatype = columns.get(item.field).datatype |
| | | columns.set(item.field, {...item, selected: true, datatype: _datatype}) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 显示字段集弹窗 |
| | |
| | | items.push(newcard) |
| | | } |
| | | }) |
| | | } else if (type === 'fields') { |
| | | config.columns.forEach(item => { |
| | | if (columnsMap.has(item.field)) { |
| | | let cell = columnsMap.get(item.field) |
| | | |
| | | if (cell.selected) { |
| | | items.push(item) |
| | | } |
| | | columnsMap.delete(item.field) |
| | | } else { |
| | | items.push(item) |
| | | } |
| | | }) |
| | | |
| | | let _columns = [...columnsMap.values()] |
| | | |
| | | _columns.forEach(item => { |
| | | if (item.selected) { |
| | | let newcard = { |
| | | uuid: Utils.getuuid(), |
| | | label: item.label, |
| | | field: item.field, |
| | | datatype: item.type === 'number' ? 'Decimal(18,0)' : 'Nvarchar(50)' |
| | | } |
| | | |
| | | items.push(newcard) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | let _config = null |
| | | |
| | | if (type === 'search') { |
| | | _config = {...this.props.config, search: items} |
| | | |
| | | this.props.updatefield(_config) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '操作成功', |
| | | duration: 2 |
| | | }) |
| | | } else if (type === 'columns') { |
| | | _config = {...this.props.config, columns: items} |
| | | } |
| | | |
| | | if (_config) { |
| | | this.props.updatefield(_config) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '操作成功', |
| | | duration: 2 |
| | | }) |
| | | } else if (type === 'fields') { |
| | | this.props.updatefield(items) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | |
| | | if (type === 'search') { |
| | | label = dict['header.menu.search.add'] |
| | | } else if (type === 'columns') { |
| | | label = dict['header.menu.column.add'] |
| | | label = dict['model.menu.column.add'] |
| | | } else if (type === 'fields') { |
| | | label = dict['model.menu.field.add'] |
| | | } |
| | | |
| | | return ( |
| | | <div> |
| | | <div className="quickly-add"> |
| | | <Button type="primary" block onClick={this.queryField}>{label}</Button> |
| | | {/* 根据字段名添加显示列及搜索条件 */} |
| | | <Modal |
| | |
| | | }, |
| | | { |
| | | type: 'action', |
| | | label: CommonDict['model.form.popview'], |
| | | subType: 'popview', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'action', |
| | | label: CommonDict['model.form.prompt'], |
| | | subType: 'prompt', |
| | | url: '' |
| | |
| | | }, |
| | | { |
| | | type: 'action', |
| | | label: CommonDict['model.form.popview'], |
| | | subType: 'popview', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'action', |
| | | label: CommonDict['model.form.tab'], |
| | | subType: 'tab', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'action', |
| | | label: CommonDict['model.form.newpage'], |
| | | subType: 'innerpage', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'action', |
| | | label: CommonDict['model.form.funcbutton'], |
| | | subType: 'funcbutton', |
| | | url: '' |
| | |
| | | <div className="common-modal-edit-card"> |
| | | <Row className="search-row"> |
| | | <Col span={8}> |
| | | {!loading ? <Search placeholder={dict['form.required.input'] + dict['header.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} |
| | | {!loading ? <Search placeholder={dict['form.required.input'] + dict['model.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} |
| | | </Col> |
| | | <Col span={8}> |
| | | <Button onClick={this.reset}> |
| | |
| | | import nortable from '@/assets/img/normaltable.jpg' |
| | | import mainsubtable from '@/assets/img/mainsubtable.jpg' |
| | | import treepage from '@/assets/img/treepage.jpg' |
| | | import calendar from '@/assets/img/calendar.jpg' |
| | | import rolemanage from '@/assets/img/rolemanage.jpg' |
| | | |
| | | const _dict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | |
| | | { |
| | | title: '日历', |
| | | type: 'CalendarPage', |
| | | url: treepage, |
| | | url: calendar, |
| | | baseconfig: '', |
| | | isSystem: true |
| | | }, |