| | |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "debugger": false, |
| | | "licenseKey": "E1A8FE", |
| | | "licenseKey": "", |
| | | "probation": "", |
| | | "host": "http://bms-test.kresstools.cn", |
| | | "service": "oc/" |
| | |
| | | color: $color6; |
| | | } |
| | | } |
| | | // .anticon-eye { |
| | | // color: $color6; |
| | | // } |
| | | .anticon-eye { |
| | | color: #1890ff; |
| | | } |
| | | .ant-input:hover { |
| | | border-color: #1890ff!important; |
| | | } |
| | | .ant-input:focus, .ant-input:active { |
| | | border-color: #40a9ff; |
| | | box-shadow: 0 0 0 2px #bae7ff; |
| | | } |
| | | .ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled) { |
| | | border-color: #40a9ff; |
| | | } |
| | | } |
| | | .login-bottom { |
| | | color: $font1; |
| | |
| | | } |
| | | } |
| | | .custom-data-card-box, .custom-prop-card-box { |
| | | .data-zoom.radio .card-row-list > .ant-col:not(.active):not(.selected):not(.extend-card):hover > .card-item-box, .data-zoom.checkbox .card-row-list > .ant-col:not(.active):not(.selected):not(.extend-card):hover > .card-item-box { |
| | | border-color: $color4 !important; |
| | | box-shadow: 0 0 4px $color4 !important; |
| | | .data-zoom.radio, .data-zoom.checkbox { |
| | | .card-row-list > .ant-col:not(.active):not(.backFont):not(.font):not(.selected):not(.extend-card):hover > .card-item-box { |
| | | border-color: $color4 !important; |
| | | box-shadow: 0 0 4px $color4 !important; |
| | | } |
| | | } |
| | | .card-row-list.radio, .card-row-list.checkbox { |
| | | >.ant-col:not(.active):not(.selected):hover { |
| | | >.ant-col:not(.active):not(.backFont):not(.font):not(.selected):hover { |
| | | >.card-item-box { |
| | | border-color: $color4!important; |
| | | box-shadow: 0 0 4px $color4!important; |
| | |
| | | >.active >.card-item-box { |
| | | border-color: $color6!important; |
| | | box-shadow: 0 0 4px $color6!important; |
| | | } |
| | | >.backFont >.card-item-box { |
| | | border-color: $color6!important; |
| | | background-color: $color1!important; |
| | | .ant-mk-text { |
| | | color: $color6; |
| | | } |
| | | } |
| | | >.font >.card-item-box { |
| | | border-color: $color6!important; |
| | | .ant-mk-text { |
| | | color: $color6; |
| | | } |
| | | } |
| | | >.selected >.card-item-box { |
| | | border-color: $color4!important; |
| | |
| | | } |
| | | |
| | | // 系统样式修改 |
| | | // .ant-select-dropdown-menu-item:hover:not(.ant-select-dropdown-menu-item-disabled) { |
| | | // background-color: $color1; |
| | | // } |
| | | // .ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled) { |
| | | // background-color: $color1; |
| | | // } |
| | | // // 复选框 |
| | | // .ant-checkbox-checked .ant-checkbox-inner { |
| | | // background-color: $color6; |
| | | // border-color: $color6; |
| | | // } |
| | | // .ant-checkbox-checked::after { |
| | | // border: 1px solid $color6; |
| | | // } |
| | | // .ant-checkbox-indeterminate .ant-checkbox-inner::after { |
| | | // background-color: $color6; |
| | | // } |
| | | // .ant-checkbox-wrapper:hover .ant-checkbox-inner, .ant-checkbox:hover .ant-checkbox-inner, .ant-checkbox-input:focus + .ant-checkbox-inner { |
| | | // border-color: $color6; |
| | | // } |
| | | // // 下拉框 |
| | | // .ant-select-selection:hover { |
| | | // border-color: $color5; |
| | | // } |
| | | // .ant-select-focused .ant-select-selection, .ant-select-selection:focus, .ant-select-selection:active { |
| | | // border-color: $color5; |
| | | // box-shadow: 0 0 0 2px $color2; |
| | | // } |
| | | // // 切换 |
| | | // .ant-switch-checked { |
| | | // background-color: $color6; |
| | | // } |
| | | // // 输入框 |
| | | // .ant-input:hover { |
| | | // border-color: $color5; |
| | | // } |
| | | // .ant-input:focus, .ant-input:active { |
| | | // border-color: $color5; |
| | | // box-shadow: 0 0 0 2px $color2; |
| | | // } |
| | | // .ant-input-number-focused { |
| | | // border-color: $color5; |
| | | // box-shadow: 0 0 0 2px $color2; |
| | | // } |
| | | // .ant-input-number:hover, .ant-input-number:focus, .ant-input-number:active, .ant-input-number-input:hover, .ant-input-number-input:focus, .ant-input-number-input:active, .ant-input-number-focused:hover, .ant-input-number-focused:focus, .ant-input-number-focused:active { |
| | | // border-color: $color5; |
| | | // } |
| | | // .ant-input-number:focus, .ant-input-number:active { |
| | | // box-shadow: 0 0 0 2px $color2; |
| | | // } |
| | | // .ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled) { |
| | | // border-color: $color5; |
| | | // } |
| | | // // 日历 |
| | | // .ant-calendar-picker:hover .ant-calendar-picker-input:not(.ant-input-disabled) { |
| | | // border-color: $color5; |
| | | // } |
| | | .ant-select-dropdown-menu-item:hover:not(.ant-select-dropdown-menu-item-disabled) { |
| | | background-color: $color1; |
| | | } |
| | | .ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled) { |
| | | background-color: $color1; |
| | | } |
| | | // 复选框 |
| | | .ant-checkbox-checked .ant-checkbox-inner { |
| | | background-color: $color6; |
| | | border-color: $color6; |
| | | } |
| | | .ant-checkbox-checked::after { |
| | | border: 1px solid $color6; |
| | | } |
| | | .ant-checkbox-indeterminate .ant-checkbox-inner::after { |
| | | background-color: $color6; |
| | | } |
| | | .ant-checkbox-wrapper:hover .ant-checkbox-inner, .ant-checkbox:hover .ant-checkbox-inner, .ant-checkbox-input:focus + .ant-checkbox-inner { |
| | | border-color: $color6; |
| | | } |
| | | // 下拉框 |
| | | .ant-select-selection:hover { |
| | | border-color: $color5; |
| | | } |
| | | .ant-select-focused .ant-select-selection, .ant-select-selection:focus, .ant-select-selection:active { |
| | | border-color: $color5; |
| | | box-shadow: 0 0 0 2px $color2; |
| | | } |
| | | // 切换 |
| | | .ant-switch-checked { |
| | | background-color: $color6; |
| | | } |
| | | // 输入框 |
| | | .ant-input:hover { |
| | | border-color: $color5; |
| | | } |
| | | .ant-input:focus, .ant-input:active { |
| | | border-color: $color5; |
| | | box-shadow: 0 0 0 2px $color2; |
| | | } |
| | | .ant-input-number-focused { |
| | | border-color: $color5; |
| | | box-shadow: 0 0 0 2px $color2; |
| | | } |
| | | .ant-input-number:hover, .ant-input-number:focus, .ant-input-number:active, .ant-input-number-input:hover, .ant-input-number-input:focus, .ant-input-number-input:active, .ant-input-number-focused:hover, .ant-input-number-focused:focus, .ant-input-number-focused:active { |
| | | border-color: $color5; |
| | | } |
| | | .ant-input-number:focus, .ant-input-number:active { |
| | | box-shadow: 0 0 0 2px $color2; |
| | | } |
| | | .ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled) { |
| | | border-color: $color5; |
| | | } |
| | | // 日历 |
| | | .ant-calendar-picker:hover .ant-calendar-picker-input:not(.ant-input-disabled) { |
| | | border-color: $color5; |
| | | } |
| | | // 分页 |
| | | // .ant-pagination { |
| | | // .ant-pagination-item-active { |
| | | // border-color: $color6; |
| | | // a { |
| | | // color: $color6; |
| | | // } |
| | | // } |
| | | // .ant-pagination-item:hover a { |
| | | // color: $color6; |
| | | // } |
| | | // .ant-pagination-prev:hover .ant-pagination-item-link { |
| | | // color: $color6; |
| | | // } |
| | | // .ant-pagination-next:hover .ant-pagination-item-link { |
| | | // color: $color6; |
| | | // } |
| | | // } |
| | | // // 表格排序图标 |
| | | // .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner .ant-table-column-sorter-up.on, .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner .ant-table-column-sorter-down.on { |
| | | // color: $color6; |
| | | // } |
| | | // .mk-water-mark { |
| | | // color: $color4; |
| | | // } |
| | | // .mk-form-split-line { |
| | | // color: $color6; |
| | | // } |
| | | .ant-pagination { |
| | | .ant-pagination-item-active { |
| | | border-color: $color6; |
| | | a { |
| | | color: $color6; |
| | | } |
| | | } |
| | | .ant-pagination-item:hover a { |
| | | color: $color6; |
| | | } |
| | | .ant-pagination-prev:hover .ant-pagination-item-link { |
| | | color: $color6; |
| | | } |
| | | .ant-pagination-next:hover .ant-pagination-item-link { |
| | | color: $color6; |
| | | } |
| | | } |
| | | // 表格排序图标 |
| | | .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner .ant-table-column-sorter-up.on, .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner .ant-table-column-sorter-down.on { |
| | | color: $color6; |
| | | } |
| | | .mk-water-mark { |
| | | color: $color4; |
| | | } |
| | | .mk-form-split-line { |
| | | color: $color6; |
| | | } |
| | | .system-color { |
| | | color: $color6; |
| | | } |
| | |
| | | sessionStorage.setItem('dataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | if (param.remember) { |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | |
| | | localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: param.password})))) |
| | | } |
| | | |
| | | this.setSystemFuncs() |
| | | this.props.modifyMainMenu(null) |
| | | this.props.history.replace('/design') |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Icon, Input } from 'antd' |
| | | import { Form, Icon, Input, Checkbox } from 'antd' |
| | | import zhCN from '@/locales/zh-CN/login.js' |
| | | import enUS from '@/locales/en-US/login.js' |
| | | import './index.scss' |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | remember: false, |
| | | username: '', |
| | | password: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | let _user = localStorage.getItem(_url) |
| | | |
| | | if (_user) { |
| | | try { |
| | | _user = JSON.parse(window.decodeURIComponent(window.atob(_user))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _user = '' |
| | | } |
| | | } |
| | | |
| | | if (_user && new Date().getTime() - _user.time > 1000 * 7 * 24 * 60 * 60) { |
| | | _user = '' |
| | | localStorage.removeItem(_url) |
| | | } |
| | | |
| | | this.setState({ |
| | | remember: _user ? true : false, |
| | | username: _user ? _user.username : '', |
| | | password: _user ? _user.password : '' |
| | | }) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | } |
| | | } |
| | | |
| | | rememberChange = (e) => { |
| | | let val = e.target.checked |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | |
| | | if (!val) { |
| | | localStorage.removeItem(_url) |
| | | } |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const input = document.getElementById('username') |
| | | input && input.focus() |
| | |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { remember, username, password } = this.state |
| | | |
| | | return ( |
| | | <Form style={{margin: '0px 10px'}}> |
| | | <Form.Item> |
| | | {getFieldDecorator('username', { |
| | | rules: [{ required: true, message: this.state.dict['login.username.empty'] }], |
| | | initialValue: '', |
| | | initialValue: username, |
| | | })( |
| | | <Input |
| | | prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} |
| | |
| | | /> |
| | | )} |
| | | </Form.Item> |
| | | <Form.Item> |
| | | <Form.Item style={{marginBottom: '15px'}}> |
| | | {getFieldDecorator('password', { |
| | | initialValue: '', |
| | | initialValue: password, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | ] |
| | | })(<Input.Password onPressEnter={(e) => {this.handleSubmit(e, 'username')}} placeholder={this.state.dict['login.password']} prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} />)} |
| | | </Form.Item> |
| | | <Form.Item style={{marginBottom: '10px'}}> |
| | | {getFieldDecorator('remember', { |
| | | valuePropName: 'checked', |
| | | initialValue: remember, |
| | | })( |
| | | <Checkbox onChange={this.rememberChange}>记住密码</Checkbox>)} |
| | | </Form.Item> |
| | | </Form> |
| | | ) |
| | | } |
| | |
| | | 'main.action.primarykey.required': 'Primary key not set!', |
| | | 'main.action.primarykey.repetition': 'There are multiple primary keys!', |
| | | 'main.action.primarykey.repetitionbid': 'There are multiple BID!', |
| | | 'main.view.unenabled': '抱歉,你访问的页面未启用,请联系管理员。', |
| | | 'main.view.unenabled': '抱歉,您访问的页面未启用,请联系管理员。', |
| | | 'main.excel.line': 'line', |
| | | 'main.excel.column': 'column', |
| | | 'main.excel.includekey': ' Contain keywords ', |
| | |
| | | 'main.form.link.error': '联动菜单设置错误!', |
| | | 'main.form.picture.check': '查看图片', |
| | | 'main.role.title': 'The role list', |
| | | 'main.view.notFound': '抱歉,你访问的页面不存在,请联系管理员。', |
| | | 'main.view.notFound': '抱歉,您访问的页面不存在,请联系管理员。', |
| | | 'form.required.input': 'Please enter the ', |
| | | 'form.required.select': 'Please select a ' |
| | | } |
| | |
| | | 'main.action.primarykey.required': '未设置主键!', |
| | | 'main.action.primarykey.repetition': '存在多个主键!', |
| | | 'main.action.primarykey.repetitionbid': '存在多个BID!', |
| | | 'main.view.unenabled': '抱歉,你访问的页面未启用,请联系管理员。', |
| | | 'main.view.unenabled': '抱歉,您访问的页面未启用,请联系管理员。', |
| | | 'main.excel.line': '行', |
| | | 'main.excel.column': '列', |
| | | 'main.excel.includekey': '含有关键字', |
| | |
| | | 'main.form.link.error': '联动菜单设置错误!', |
| | | 'main.form.picture.check': '查看图片', |
| | | 'main.role.title': '角色列表', |
| | | 'main.view.notFound': '抱歉,你访问的页面不存在,请联系管理员。', |
| | | 'main.view.notFound': '抱歉,您访问的页面不存在,请联系管理员。', |
| | | 'form.required.input': '请输入', |
| | | 'form.required.select': '请选择' |
| | | } |
| | |
| | | let _elements = elements.map(cell => { |
| | | if (cell.uuid === res.uuid) { |
| | | res.style = cell.style || {} |
| | | res.$type = cell.$type || '' |
| | | if (res.eleType === 'splitline' && cell.eleType !== 'splitline') { |
| | | res.style.paddingTop = '5px' |
| | | res.style.paddingBottom = '5px' |
| | |
| | | controlFields: [ |
| | | {field: 'checkAll', values: ['checkbox']}, |
| | | {field: 'selected', values: ['radio', 'checkbox']}, |
| | | {field: 'selStyle', values: ['radio', 'checkbox']}, |
| | | ], |
| | | forbid: subtype === 'tablecard' |
| | | }, |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'selStyle', |
| | | label: '选中风格', |
| | | initval: wrap.selStyle || 'active', |
| | | tooltip: '存在边框时,边框会使用系统色。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'active', label: '外阴影'}, |
| | | {value: 'backFont', label: '背景+文字'}, |
| | | {value: 'font', label: '文字'}, |
| | | ], |
| | | forbid: subtype !== 'propcard' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'checkAll', |
| | | label: '全选', |
| | | initval: wrap.checkAll || 'hidden', |
| | |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'resetPageIndex', 'pagination', 'search', 'width'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement', 'syncComponent'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width'] |
| | |
| | | let _intertype = card.intertype || 'system' // 接口类型 |
| | | let _funcType = card.funcType || '' // 功能按钮默认类型 |
| | | let _procMode = card.procMode || 'system' |
| | | let _Ot = card.Ot || 'requiredSgl' |
| | | let _Ot = card.Ot |
| | | let _pageTemplate = card.pageTemplate || '' |
| | | let control = card.control || '' |
| | | |
| | |
| | | let iscustom = ['pop', 'prompt', 'exec'].includes(_opentype) |
| | | item.options = this.state.interTypeOptions.filter(op => (iscustom || op.value !== 'custom')) |
| | | } else if (item.key === 'Ot') { |
| | | if (type === 'card') { |
| | | if (card.sqlType === 'insert') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value)) |
| | | } else { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } |
| | | if (card.sqlType === 'insert') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value)) |
| | | } else if (type === 'card') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } else if (_pageTemplate === 'pay') { // 行级按钮、支付按钮,只能选单行 |
| | | item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | | } else if (['innerpage', 'tab', 'popview', 'excelIn'].includes(_opentype)) { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } else if (card.sqlType === 'insert') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value)) |
| | | } else { |
| | | item.options = this.state.requireOptions |
| | | } |
| | |
| | | * 3、切换标签类型,重置可选标签 |
| | | */ |
| | | optionChange = (key, value) => { |
| | | const { card, type } = this.props |
| | | const { type } = this.props |
| | | const { openType, procMode, Ot, pageTemplate, control } = this.state |
| | | |
| | | if (key === 'OpenType') { |
| | |
| | | let _fieldval = {} |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'Ot' && type === 'card') { |
| | | if (item.key === 'Ot') { |
| | | if (value === 'insert') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value)) |
| | | } else { |
| | | } else if (type === 'card') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } else { |
| | | item.options = this.state.requireOptions |
| | | } |
| | | } else if (item.key === 'Ot' && value === 'insert') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value)) |
| | | } else if (item.key === 'Ot') { |
| | | item.options = this.state.requireOptions |
| | | } |
| | | return item |
| | | }) |
| | |
| | | _fieldval.label = '删除' |
| | | _fieldval.class = 'danger' |
| | | _fieldval.Ot = 'requiredSgl' |
| | | } |
| | | |
| | | if (card.$type === 'tableButton') { // 表格按钮 |
| | | delete _fieldval.Ot |
| | | } |
| | | |
| | | this.props.form.setFieldsValue(_fieldval) |
| | |
| | | { value: 'logout', text: '退出' }, |
| | | { value: 'mkBinding', text: '开通扫码登录' }, |
| | | { value: 'mkUnBinding', text: '用户解绑' }, |
| | | { value: 'reAuth', text: '切换系统' }, |
| | | { value: 'reAuth', text: '切换系统(清空缓存-小程序)' }, |
| | | { value: 'goBack', text: '返回' }, |
| | | ] |
| | | pageTemps = [ |
| | |
| | | type: 'select', |
| | | key: 'Ot', |
| | | label: Formdict['header.form.isRequired'], |
| | | initVal: card.Ot || 'requiredSgl', |
| | | initVal: card.Ot || (card.sqlType === 'insert' ? 'notRequired' : 'requiredSgl'), |
| | | required: true, |
| | | forbid: card.$type === 'tableButton', |
| | | options: [] |
| | | }, |
| | | { |
| | |
| | | key: 'syncComponent', |
| | | label: '刷新组件', |
| | | initVal: card.syncComponent || [], |
| | | tooltip: '执行成功后,需要同步刷新的组件', |
| | | tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件', |
| | | required: false, |
| | | options: modules |
| | | }, |
| | |
| | | title = ' ' |
| | | } |
| | | |
| | | if (!title && (!config.search || config.search.length === 0)) { |
| | | if (!title && (!config.search || config.search.length === 0 || hideSearch === 'true')) { |
| | | show = false |
| | | } |
| | | let _style = resetStyle(config.headerStyle) |
| | |
| | | intertype: 'system', |
| | | execSuccess: 'grid', |
| | | execError: 'never', |
| | | show: 'link', |
| | | $type: 'tableButton' |
| | | show: 'link' |
| | | } |
| | | |
| | | // 注册事件-添加元素 |
| | |
| | | intertype: 'system', |
| | | execSuccess: 'grid', |
| | | execError: 'never', |
| | | show: 'link', |
| | | $type: 'tableButton' |
| | | show: 'link' |
| | | } |
| | | |
| | | // 注册事件-添加元素 |
| | |
| | | _sort++ |
| | | }) |
| | | }) |
| | | } else if (item.type === 'line' || item.type === 'bar') { |
| | | } else if (item.type === 'carousel' || item.type === 'timeline') { |
| | | item.subcards.forEach(card => { |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | this.checkBtn(cell) |
| | | buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort`) |
| | | _sort++ |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements && item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | this.checkBtn(cell) |
| | | buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort`) |
| | | _sort++ |
| | | }) |
| | | } else if (item.type === 'line' || item.type === 'bar' || item.type === 'chart') { |
| | | item.action && item.action.forEach(btn => { |
| | | this.checkBtn(btn) |
| | | buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`) |
| | | _sort++ |
| | | }) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) { |
| | | item.action && item.action.forEach(btn => { |
| | | this.checkBtn(btn) |
| | | buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`) |
| | |
| | | const { config } = this.state |
| | | let error = '' |
| | | |
| | | config.components.forEach(item => { |
| | | if (error) return |
| | | if (['propcard', 'brafteditor', 'sandbox'].includes(item.subtype) && item.wrap.datatype === 'static') return |
| | | let check = (components) => { |
| | | components.forEach(item => { |
| | | if (error) return |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | check(tab.components) |
| | | }) |
| | | return |
| | | } else if (item.type === 'group') { |
| | | check(item.components) |
| | | return |
| | | } |
| | | if (['propcard', 'brafteditor', 'sandbox', 'stepform', 'tabform'].includes(item.subtype) && item.wrap.datatype === 'static') return |
| | | if (['balcony'].includes(item.type) && item.wrap.datatype === 'static') return |
| | | |
| | | if (item.setting) { |
| | | if (item.setting.interType === 'system' && item.setting.execute !== 'false' && !item.setting.dataresource) { |
| | | error = `组件《${item.name}》未设置数据源!` |
| | | } else if (item.setting.interType === 'system' && item.setting.execute === 'false' && item.scripts.length === 0) { |
| | | error = `组件《${item.name}》未设置数据源!` |
| | | } else if (!item.setting.primaryKey) { |
| | | error = `组件《${item.name}》未设置主键!` |
| | | } else if (!item.setting.supModule && item.type !== 'balcony') { |
| | | error = `组件《${item.name}》未设置上级组件!` |
| | | } |
| | | } |
| | | if (item.type === 'bar' || item.type === 'line' || item.type === 'pie') { |
| | | if (!item.plot.Xaxis) { |
| | | error = `组件《${item.name}》图表字段尚未设置!` |
| | | } |
| | | } else if (item.type === 'dashboard' && !item.plot.valueField) { |
| | | error = `组件《${item.name}》显示值尚未设置!` |
| | | } else if (item.type === 'scatter' && (!item.plot.Xaxis || !item.plot.Yaxis || !item.plot.gender)) { |
| | | error = `组件《${item.name}》坐标轴尚未设置!` |
| | | } else if (item.type === 'tree' && (!item.wrap.valueField || !item.wrap.labelField || !item.wrap.parentField)) { |
| | | error = `组件《${item.name}》基本信息尚未设置!` |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (item.setting) { |
| | | if (item.setting.interType === 'system' && item.setting.execute !== 'false' && !item.setting.dataresource) { |
| | | error = `组件《${item.name}》未设置数据源!` |
| | | } else if (item.setting.interType === 'system' && item.setting.execute === 'false' && item.scripts.length === 0) { |
| | | error = `组件《${item.name}》未设置数据源!` |
| | | } else if (item.setting.interType && !item.setting.primaryKey) { |
| | | error = `组件《${item.name}》未设置主键!` |
| | | } else if (!item.setting.supModule) { |
| | | error = `组件《${item.name}》未设置上级组件!` |
| | | } |
| | | } |
| | | if (item.type === 'bar' || item.type === 'line' || item.type === 'pie') { |
| | | if (!item.plot.Xaxis) { |
| | | error = `组件《${item.name}》图表字段尚未设置!` |
| | | } |
| | | } |
| | | }) |
| | | check(config.components) |
| | | |
| | | if (show && error) { |
| | | notification.warning({ |
| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Icon, Button, Popover, Switch, Checkbox, Form } from 'antd' |
| | | import { Icon, Button, Popover, Switch, Checkbox, Form, Rate } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | </div> |
| | | </div> |
| | | </div>) |
| | | } else if (card.type === 'rate') { |
| | | formItem = (<div className={'am-list-item ' + (card.place || '')}><div className="am-list-line"><div className="am-input-label">{card.label}</div><div style={{textAlign: 'left'}} className={'am-input-control ' + (card.place === 'up_down' ? 'left' : '')}> |
| | | <Rate value={card.initval || 0} count={card.rateCount || 5} character={card.character ? <Icon type={card.character}/> : <Icon type="star" theme="filled"/>} allowHalf={card.allowHalf === 'true'} /> |
| | | </div></div></div>) |
| | | } else if (card.type === 'fileupload') { |
| | | formItem = ( |
| | | <div className="am-list-item checkbox"> |
| | |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: '评分', |
| | | subType: 'rate', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['header.form.funcvar'], |
| | | subType: 'funcvar', |
| | | url: '' |
| | |
| | | }, 200) |
| | | } |
| | | |
| | | _config.wrap.selStyle = _config.wrap.selStyle || 'active' |
| | | |
| | | this.setState({ |
| | | sync: _sync, |
| | | data: _data, |
| | |
| | | <NormalHeader config={config}/> |
| | | <Row className={`card-row-list ${config.wrap.cardType || ''} ${config.wrap.scale || ''}`}> |
| | | {config.subcards.map((item, index) => ( |
| | | <Col className={(activeKey === index ? 'active' : '') + (item.setting.click ? ' pointer' : '')} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}> |
| | | <Col className={(activeKey === index ? config.wrap.selStyle : '') + (item.setting.click ? ' pointer' : '')} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}> |
| | | <CardItem card={item} cards={config} data={data}/> |
| | | </Col> |
| | | ))} |
| | |
| | | logMap.set(val, true) |
| | | if (pval === config.wrap.mark) { |
| | | parentNodes.push({ |
| | | // ...item, |
| | | ...item, |
| | | $title: item[config.wrap.labelField] || '', |
| | | $key: val, |
| | | $parentId: '' |
| | | }) |
| | | } else if (pval) { |
| | | _options.push({ |
| | | // ...item, |
| | | ...item, |
| | | $title: item[config.wrap.labelField] || '', |
| | | $key: val, |
| | | $parentId: pval |
| | |
| | | } |
| | | |
| | | if (selected) { |
| | | delete _data.children |
| | | MKEmitter.emit('resetSelectLine', config.uuid, (_data ? _data.$key : ''), _data) |
| | | } |
| | | |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction, permMenus, Tab, BID, BData } = this.props |
| | | const { permAction, permMenus, Tab } = this.props |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | |
| | | this.setState({ |
| | | pageSize: config.setting.pageSize || 10, |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | BID: this.props.BID || '', |
| | | BData: this.props.BData || '', |
| | | loadingview: false, |
| | | chartId, |
| | | config, |
| | |
| | | search: Utils.initMainSearch(config.search), |
| | | hasReqFields |
| | | }, () => { |
| | | if (config.setting.onload !== 'false' && (!Tab.supMenu || BID || Tab.isTreeNode)) { // 初始化可加载 |
| | | if (config.setting.onload !== 'false' && (!Tab.supMenu || this.props.BID || Tab.isTreeNode)) { // 初始化可加载 |
| | | this.loadData() |
| | | } |
| | | }) |
| | |
| | | |
| | | if (['date', 'datemonth', 'datetime'].includes(_type) && item.declareType === 'nvarchar(50)') { |
| | | _type = 'text' |
| | | } else if (item.type === 'rate') { |
| | | item.rateCount = item.rateCount || 5 |
| | | let allowHalf = item.allowHalf === 'true' |
| | | |
| | | if (allowHalf) { |
| | | _initval = parseFloat(_initval) |
| | | if (_initval % 0.5 !== 0) { |
| | | _initval = parseInt(_initval) |
| | | } |
| | | } else { |
| | | _initval = parseInt(_initval) |
| | | } |
| | | |
| | | if (isNaN(_initval) || _initval < 0) { |
| | | _initval = 0 |
| | | } else if (_initval > item.rateCount) { |
| | | _initval = item.rateCount |
| | | } |
| | | } |
| | | |
| | | result.push({ |
| | |
| | | _fieldlen = item.fieldlength || 512 |
| | | } else if (item.type === 'number') { |
| | | _fieldlen = item.decimal ? item.decimal : 0 |
| | | } else if (item.type === 'rate') { |
| | | item.rateCount = item.rateCount || 5 |
| | | let allowHalf = item.allowHalf === 'true' |
| | | |
| | | if (allowHalf) { |
| | | _initval = parseFloat(_initval) |
| | | if (_initval % 0.5 !== 0) { |
| | | _initval = parseInt(_initval) |
| | | } |
| | | } else { |
| | | _initval = parseInt(_initval) |
| | | } |
| | | |
| | | if (isNaN(_initval) || _initval < 0) { |
| | | _initval = 0 |
| | | } else if (_initval > item.rateCount) { |
| | | _initval = item.rateCount |
| | | } |
| | | } |
| | | |
| | | if (_initval === undefined) { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, notification, Tooltip } from 'antd' |
| | | import { Form, Row, Col, notification, Tooltip, Icon, Rate } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | |
| | | if (item.type === 'split' || item.type === 'hint') return true |
| | | |
| | | if (!item.field || !['text', 'number', 'switch', 'select', 'link', 'linkMain', 'funcvar', 'date', 'datemonth', 'datetime', 'radio', 'checkbox', 'checkcard', 'fileupload', 'textarea', 'multiselect', 'brafteditor', 'color'].includes(item.type)) return false |
| | | if (!item.field || !['text', 'number', 'switch', 'rate', 'select', 'link', 'linkMain', 'funcvar', 'date', 'datemonth', 'datetime', 'radio', 'checkbox', 'checkcard', 'fileupload', 'textarea', 'multiselect', 'brafteditor', 'color'].includes(item.type)) return false |
| | | |
| | | // 数据自动填充 |
| | | let readin = item.readin !== 'false' |
| | |
| | | |
| | | if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type) && item.resourceType === '1') { |
| | | deForms.push(item) |
| | | } else if (item.type === 'rate') { |
| | | item.rateCount = item.rateCount || 5 |
| | | item.allowHalf = item.allowHalf === 'true' |
| | | |
| | | if (item.allowHalf) { |
| | | item.initval = parseFloat(item.initval) |
| | | if (item.initval % 0.5 !== 0) { |
| | | item.initval = parseInt(item.initval) |
| | | } |
| | | } else { |
| | | item.initval = parseInt(item.initval) |
| | | } |
| | | |
| | | if (isNaN(item.initval) || item.initval < 0) { |
| | | item.initval = 0 |
| | | } else if (item.initval > item.rateCount) { |
| | | item.initval = item.rateCount |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'text') { |
| | |
| | | content = (<MKFileUpload config={item} onChange={(val) => this.recordChange({[item.field]: val})} />) |
| | | } else if (item.type === 'textarea') { |
| | | content = (<MKTextArea config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})}/>) |
| | | } else if (item.type === 'rate') { |
| | | content = (<Rate count={item.rateCount} disabled={item.readonly} onChange={(val) => this.recordChange({[item.field]: val})} character={item.character ? <Icon type={item.character}/> : <Icon type="star" theme="filled"/>} allowHalf={item.allowHalf}/>) |
| | | } else if (item.type === 'brafteditor') { |
| | | content = (<MKEditor config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) |
| | | label = item.hidelabel !== 'true' ? label : '' |
| | |
| | | const { defaultChecked } = this.state |
| | | |
| | | return ( |
| | | <Switch checkedChildren={config.openText || ''} unCheckedChildren={config.closeText || ''} defaultChecked={defaultChecked} onChange={this.onChange}/> |
| | | <Switch checkedChildren={config.openText || ''} disabled={config.readonly} unCheckedChildren={config.closeText || ''} defaultChecked={defaultChecked} onChange={this.onChange}/> |
| | | ) |
| | | } |
| | | } |
| | |
| | | {/* 设置全局配置及列表数据源 */} |
| | | <Modal |
| | | wrapClassName="model-calendar-setting-modal" |
| | | title={dict['model.edit']} |
| | | title="日历关联字段" |
| | | visible={visible} |
| | | width={700} |
| | | maskClosable={false} |
| | |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | // } |
| | | resolve() |
| | | }).then(() => { |
| | | let reload = _config.isAdd |
| | | |
| | | // 保存时删除配置类型,system 、user |
| | | delete _config.type |
| | | delete _config.isAdd |
| | |
| | | config: _config, |
| | | openEdition: response.open_edition || '', |
| | | originMenu: fromJS(_config).toJS() |
| | | }, () => { |
| | | reload && MKEmitter.emit('revert') |
| | | }) |
| | | |
| | | this.props.reloadmenu() |
| | |
| | | } |
| | | }) |
| | | |
| | | let calvaild = true |
| | | if (!cols.includes(config.calendar.startfield)) { |
| | | calvaild = false |
| | | } else if (!cols.includes(config.calendar.endfield)) { |
| | | calvaild = false |
| | | } else if (!cols.includes(config.calendar.colorfield)) { |
| | | calvaild = false |
| | | } else if (!cols.includes(config.calendar.remarkfield)) { |
| | | calvaild = false |
| | | } |
| | | |
| | | if (config.setting.interType === 'system' && config.setting.default !== 'false' && !config.setting.dataresource) { |
| | | return '菜单尚未设置数据源,不可启用!' |
| | | } else if (config.columns.length === 0) { |
| | | return '菜单尚未设置数据字段,不可启用!' |
| | | } else if (!calvaild) { |
| | | return '菜单尚未设置字段集,不可启用!' |
| | | } else if (!config.calendar.startfield) { |
| | | return '日历关联字段未设置,不可启用!' |
| | | } else if (!cols.includes(config.calendar.startfield)) { |
| | | return '开始时间字段已删除,不可启用!' |
| | | } else if (!cols.includes(config.calendar.endfield)) { |
| | | return '结束时间字段已删除,不可启用!' |
| | | } else if (config.calendar.colorfield && !cols.includes(config.calendar.colorfield)) { |
| | | return '颜色字段已删除,不可启用!' |
| | | } else if (!cols.includes(config.calendar.remarkfield)) { |
| | | return '信息字段已删除,不可启用!' |
| | | } else { |
| | | return true |
| | | } |
| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { updateCommonTable } from '@/utils/utils-update.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | |
| | | }) |
| | | } |
| | | |
| | | let _LongParam = '' |
| | | let reload = _config.isAdd |
| | | |
| | | // 保存时删除配置类型,system 、user |
| | | delete _config.type |
| | | delete _config.isAdd |
| | | |
| | | let _LongParam = '' |
| | | |
| | | try { |
| | | _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config))) |
| | |
| | | config: _config, |
| | | openEdition: response.open_edition || '', |
| | | originMenu: fromJS(_config).toJS() |
| | | }, () => { |
| | | reload && MKEmitter.emit('revert') |
| | | }) |
| | | |
| | | localParam.func = 'sPC_TrdMenu_AddUpt_For_Local' |
| | |
| | | onOk={this.memuHandleSubmit} |
| | | confirmLoading={this.state.confirmLoading} |
| | | onCancel={this.memuHandleCancel} |
| | | destroyOnClose |
| | | > |
| | | {this.state.formlist ? |
| | | <MenuForm |
| | |
| | | onOk={this.thawMemuSubmit} |
| | | confirmLoading={this.state.confirmLoading} |
| | | onCancel={this.thawMemuCancel} |
| | | destroyOnClose |
| | | > |
| | | {!this.state.thawmenulist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} |
| | | {this.state.thawmenulist && <TransferForm onChange={(vals) => this.setState({targetKeys: vals})} menulist={this.state.thawmenulist}/>} |
| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Select, DatePicker, Input, InputNumber, Button, Popover, Switch, Radio, Checkbox, Form } from 'antd' |
| | | import { Select, DatePicker, Input, InputNumber, Button, Popover, Switch, Radio, Checkbox, Form, Rate, Icon } from 'antd' |
| | | import { QuestionCircleOutlined, UploadOutlined, EditOutlined, CopyOutlined, CloseOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | formItem = (<Input style={{marginTop: '4px'}} value={card.linkfield} />) |
| | | } else if (card.type === 'linkMain') { |
| | | formItem = (<Input style={{marginTop: '4px'}} />) |
| | | } else if (card.type === 'rate') { |
| | | formItem = (<Rate value={card.initval || 0} count={card.rateCount || 5} character={card.character ? <Icon type={card.character}/> : <Icon type="star" theme="filled"/>} allowHalf={card.allowHalf === 'true'} />) |
| | | } else if (card.type === 'switch') { |
| | | formItem = (<Switch checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''} style={{marginTop: '8px'}} checked={card.initval}/>) |
| | | } else if (card.type === 'radio') { |
| | |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: '评分', |
| | | subType: 'rate', |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['model.form.color'], |
| | | subType: 'color', |
| | | }, |
| | |
| | | |
| | | componentDidMount () { |
| | | this.getBillPrintTemp() |
| | | MKEmitter.addListener('revert', this.revert) |
| | | MKEmitter.addListener('pasteButton', this.pasteButton) |
| | | } |
| | | |
| | | revert = () => { |
| | | this.setState({ |
| | | actionlist: fromJS(this.props.config.action).toJS() |
| | | }) |
| | | } |
| | | |
| | | pasteButton = (MenuId, btn) => { |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('revert', this.revert) |
| | | MKEmitter.removeListener('pasteButton', this.pasteButton) |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | revert = () => { |
| | | this.setState({ |
| | | columnlist: fromJS(this.props.config.columns).toJS() |
| | | }) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('revert', this.revert) |
| | | MKEmitter.addListener('plusColumns', this.plusColumns) |
| | | } |
| | | |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('revert', this.revert) |
| | | MKEmitter.removeListener('plusColumns', this.plusColumns) |
| | | } |
| | | |
| | |
| | | if (lastItem && lastItem.span) { |
| | | span = lastItem.span |
| | | } |
| | | |
| | | selectCards.forEach(item => { // 循环添加新增字段 |
| | | let newcard = { |
| | | uuid: Utils.getuuid(), |
| | | label: item.label, |
| | | field: item.field, |
| | | initval: '', |
| | | initval: item.type === 'number' ? 0 : '', |
| | | type: item.type, |
| | | resourceType: '0', |
| | | setAll: 'false', |
| | |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('plusSearch', this.plusSearch) |
| | | MKEmitter.addListener('revert', this.revert) |
| | | } |
| | | |
| | | revert = () => { |
| | | this.setState({searchlist: fromJS(this.props.config.search).toJS()}) |
| | | } |
| | | |
| | | plusSearch = (MenuId, item, type) => { |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('revert', this.revert) |
| | | MKEmitter.removeListener('plusSearch', this.plusSearch) |
| | | } |
| | | |
| | |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { updateSubTable } from '@/utils/utils-update.js' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | }) |
| | | } |
| | | |
| | | let _LongParam = '' |
| | | let reload = _config.isAdd |
| | | |
| | | // 保存时删除配置类型,system 、user |
| | | delete _config.type |
| | | delete _config.isAdd |
| | | |
| | | let _LongParam = '' |
| | | |
| | | try { |
| | | _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config))) |
| | |
| | | config: _config, |
| | | originConfig: fromJS(_config).toJS() |
| | | }, () => { |
| | | reload && MKEmitter.emit('revert') |
| | | this.setState({ |
| | | menuloading: false, |
| | | menucloseloading: false |
| | |
| | | _fieldtype = 'datetime' |
| | | } else if (_field.type === 'number') { |
| | | _fieldtype = `decimal(18,${_fieldlen})` |
| | | } else if (_field.type === 'rate') { |
| | | _fieldtype = `decimal(18,2)` |
| | | } |
| | | |
| | | _field.fieldtype = _fieldtype |
| | |
| | | _type = 'datetime' |
| | | } else if (form.type === 'number') { |
| | | _type = `decimal(18,${form.fieldlen})` |
| | | } else if (form.type === 'rate') { |
| | | _type = `decimal(18,2)` |
| | | } |
| | | |
| | | _declarefields.push(`@${_key} ${_type}`) |
| | |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | }, { |
| | | value: 'rate', |
| | | text: '评分' |
| | | }, { |
| | | value: 'color', |
| | | text: Formdict['model.form.color'] |
| | | }, { |
| | |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | }, { |
| | | value: 'rate', |
| | | text: '评分' |
| | | }, { |
| | | value: 'funcvar', |
| | | text: Formdict['header.form.funcvar'] |
| | |
| | | value: '0', |
| | | text: '当天' |
| | | }, { |
| | | value: '1', |
| | | text: '后一天' |
| | | }, { |
| | | value: '2', |
| | | text: '后两天' |
| | | }, { |
| | | value: '3', |
| | | text: '后三天' |
| | | }, { |
| | | value: '7', |
| | | text: '后七天' |
| | | }, { |
| | | value: '30', |
| | | text: '后30天' |
| | | }, { |
| | | value: '90', |
| | | text: '后90天' |
| | | }, { |
| | | value: '-1', |
| | | text: '前一天' |
| | | }, { |
| | |
| | | }, { |
| | | value: '90', |
| | | text: '后90天' |
| | | }, { |
| | | value: '-1', |
| | | text: '前一天' |
| | | }, { |
| | | value: '-2', |
| | | text: '前两天' |
| | | }, { |
| | | value: '-3', |
| | | text: '前三天' |
| | | }, { |
| | | value: '-7', |
| | | text: '前七天' |
| | | }, { |
| | | value: '-30', |
| | | text: '前30天' |
| | | }, { |
| | | value: '-90', |
| | | text: '前90天' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | initVal: card.maxfile || '', |
| | | tooltip: '等于0时不做限制。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'allowHalf', |
| | | label: '半选', |
| | | initVal: card.allowHalf || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '支持' |
| | | }, { |
| | | value: 'false', |
| | | text: '不支持' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | min: 1, |
| | | max: 100, |
| | | precision: 0, |
| | | key: 'rateCount', |
| | | label: '总数', |
| | | initVal: card.rateCount || 5, |
| | | tooltip: '默认值为5。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'icon', |
| | | key: 'character', |
| | | label: '自定义图标', |
| | | initVal: card.character || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'dropdown', |
| | | label: '下拉框', |
| | |
| | | // forbid: appType !== 'mob' |
| | | // }, |
| | | { |
| | | type: 'number', |
| | | key: 'span', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '表单宽度', |
| | | initVal: card.span || (['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type) ? 24 : 12), |
| | | tooltip: '栅格布局整行24等分。', |
| | | required: true, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'labelwidth', |
| | | min: 1, |
| | | max: 100, |
| | | precision: 1, |
| | | label: '名称宽度', |
| | | initVal: card.labelwidth || 33.3, |
| | | tooltip: '名称占据表单宽度的百分比。注:存在多列表单时,当前表单如果想要占据整行可参照以下比例,两列(16.2)、三列(10.5)、四列(7.7)', |
| | | required: true, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'compress', |
| | | label: '压缩', |
| | | initVal: card.compress || 'false', |
| | | tooltip: '文件压缩必须为图片,图片格式为jpg、png、gif 或 jpeg', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'limit', |
| | | min: 0.01, |
| | | max: 1000, |
| | | precision: 2, |
| | | label: '起点(M)', |
| | | initVal: card.limit || 2, |
| | | tooltip: '压缩起点,小于起点值的文件不进行压缩。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'rduri', |
| | | label: '转存接口', |
| | | rows: 1, |
| | | initVal: card.rduri || '', |
| | | tooltip: '图片转存在同一单点服务器下的其他业务系统。', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'proRduri', |
| | | label: '正式接口', |
| | | rows: 1, |
| | | initVal: card.proRduri || '', |
| | | tooltip: '正式系统转存接口,图片转存在同一单点服务器下的其他业务系统。', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'suffix', |
| | | label: '后缀名', |
| | | tooltip: '可以上传文件的后缀名,多个类型用逗号分隔,空值时不校验。', |
| | | initVal: card.suffix || '', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'encryption', |
| | | label: '加密传输', |
| | |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'compress', |
| | | label: '压缩', |
| | | initVal: card.compress || 'false', |
| | | tooltip: '文件压缩必须为图片,图片格式为jpg、png、gif 或 jpeg', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'limit', |
| | | min: 0.01, |
| | | max: 1000, |
| | | precision: 2, |
| | | label: '起点(M)', |
| | | initVal: card.limit || 2, |
| | | tooltip: '压缩起点,小于起点值的文件不进行压缩。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'span', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '表单宽度', |
| | | initVal: card.span || (['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type) ? 24 : 12), |
| | | tooltip: '栅格布局整行24等分。', |
| | | required: true, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'labelwidth', |
| | | min: 1, |
| | | max: 100, |
| | | precision: 1, |
| | | label: '名称宽度', |
| | | initVal: card.labelwidth || 33.3, |
| | | tooltip: '名称占据表单宽度的百分比。注:存在多列表单时,当前表单如果想要占据整行可参照以下比例,两列(16.2)、三列(10.5)、四列(7.7)', |
| | | required: true, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'rduri', |
| | | label: '转存接口', |
| | | rows: 1, |
| | | initVal: card.rduri || '', |
| | | tooltip: '图片转存在同一单点服务器下的其他业务系统。', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'proRduri', |
| | | label: '正式接口', |
| | | rows: 1, |
| | | initVal: card.proRduri || '', |
| | | tooltip: '正式系统转存接口,图片转存在同一单点服务器下的其他业务系统。', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'suffix', |
| | | label: '后缀名', |
| | | tooltip: '可以上传文件的后缀名,多个类型用逗号分隔,空值时不校验。', |
| | | initVal: card.suffix || '', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | |
| | | { |
| | | type: 'select', |
| | | key: 'supField', |
| | | label: '上级表单', |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, Select, Icon, Radio, notification, InputNumber, Tooltip } from 'antd' |
| | | import { Form, Row, Col, Input, Select, Radio, notification, InputNumber, Tooltip } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import { formRule } from '@/utils/option.js' |
| | |
| | | const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) |
| | | const FieldsTable = asyncComponent(() => import('./fieldtable')) |
| | | const DataTable = asyncComponent(() => import('./datatable')) |
| | | const MkIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | | const modalTypeOptions = { |
| | | text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom'], |
| | |
| | | datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'], |
| | | textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count', 'placeholder', 'marginTop', 'marginBottom'], |
| | | color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'], |
| | | rate: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'splitline', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'allowHalf', 'rateCount', 'character', 'place'], |
| | | hint: ['label', 'type', 'blacklist', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | split: ['label', 'type', 'marginTop', 'marginBottom'], |
| | | brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption', 'marginTop', 'marginBottom'], |
| | |
| | | resourceType: resourceType, |
| | | linkSubFields: linkSubFields, |
| | | formlist: formlist.map(form => { |
| | | if (dateOptions.hasOwnProperty(type) && form.key === 'initval') { |
| | | form.options = dateOptions[type] |
| | | form.type = 'select' |
| | | } else if (type === 'switch' && form.key === 'initval') { |
| | | form.initVal = !!form.initVal |
| | | form.options = [ |
| | | {value: true, text: '开'}, |
| | | {value: false, text: '关'} |
| | | ] |
| | | form.type = 'radio' |
| | | } else if (type === 'number' && form.key === 'initval') { |
| | | form.type = 'number' |
| | | form.initVal = form.initVal || 0 |
| | | form.required = true |
| | | if (form.key === 'initval') { |
| | | if (dateOptions.hasOwnProperty(type)) { |
| | | form.options = dateOptions[type] |
| | | form.type = 'select' |
| | | } else if (type === 'switch') { |
| | | form.initVal = !!form.initVal |
| | | form.options = [ |
| | | {value: true, text: '开'}, |
| | | {value: false, text: '关'} |
| | | ] |
| | | form.type = 'radio' |
| | | } |
| | | if (type === 'number') { |
| | | form.type = 'number' |
| | | form.initVal = form.initVal || 0 |
| | | form.required = true |
| | | } else if (type === 'rate') { |
| | | form.type = 'number' |
| | | form.initVal = form.initVal || 0 |
| | | form.required = false |
| | | } |
| | | } else if (form.key === 'label') { |
| | | form.required = true |
| | | if (type === 'hint') { |
| | |
| | | } else if (value === 'number') { |
| | | form.type = 'number' |
| | | form.required = true |
| | | form.initVal = 0 |
| | | } else if (value === 'rate') { |
| | | form.type = 'number' |
| | | form.required = false |
| | | form.initVal = 0 |
| | | } else { |
| | | form.type = 'text' |
| | |
| | | > |
| | | {item.options.map((option, i) => |
| | | <Select.Option key={`${i}`} value={option.value || option.field || ''}> |
| | | {item.key === 'icon' && <Icon type={option.text} />} {option.text || option.label} |
| | | {option.text || option.label} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'icon') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [{ |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.select'] + item.label + '!' |
| | | }] |
| | | })( |
| | | <MkIcon allowClear /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | |
| | |
| | | } else if (_f.type === 'number') { |
| | | _type = `decimal(18,${_fieldlen})` |
| | | _select.push(`@${_f.field}=0`) |
| | | } else if (_f.type === 'rate') { |
| | | _type = `decimal(18,2)` |
| | | _select.push(`@${_f.field}=0`) |
| | | } else { |
| | | _select.push(`@${_f.field}=''`) |
| | | } |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (verify.invalid === 'true' && setting.maxScript && setting.maxScript >= 100) { |
| | | } else if (verify.invalid === 'true' && setting.maxScript && setting.maxScript >= 300) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '数据源中自定义脚本过于复杂,不能使用失效验证!', |
| | |
| | | if (!_initvars.includes(_key)) { |
| | | _initvars.push(_key) |
| | | |
| | | if (form.type === 'number') { |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | let val = form.value |
| | | if (typeof(val) !== 'number') { |
| | | val = parseFloat(val) |
| | |
| | | } |
| | | } |
| | | _initFormfields.push(`@${_key}=${val}`) |
| | | } else if (['date', 'datemonth', 'datetime'].includes(form.type)) { |
| | | _initFormfields.push(`@${_key}='${form.value || '1900-01-01'}'`) |
| | | } else { |
| | | _initFormfields.push(`@${_key}='${form.value}'`) |
| | | } |
| | |
| | | _type = 'datetime' |
| | | } else if (form.type === 'number') { |
| | | _type = `decimal(18,${form.fieldlen})` |
| | | } else if (form.type === 'rate') { |
| | | _type = `decimal(18,2)` |
| | | } |
| | | |
| | | _declarefields.push(`@${_key} ${_type}`) |
| | |
| | | type = 'datetime=null' |
| | | } else if (item.type === 'number') { |
| | | type = `decimal(18,${item.decimal})=0` |
| | | } else if (item.type === 'rate') { |
| | | type = `decimal(18,2)=0` |
| | | } else { |
| | | type = 'nvarchar(50)=\'\'' |
| | | } |
| | |
| | | <Lostsvg /> |
| | | </div> |
| | | <div className="ant-result-title">404</div> |
| | | <div className="ant-result-subtitle">抱歉,你访问的页面不存在,请联系管理员。</div> |
| | | <div className="ant-result-subtitle">抱歉,您访问的页面不存在,请联系管理员。</div> |
| | | <div className="ant-result-extra"> |
| | | <Button onClick={() => {this.tomain()}} type="primary">返回主页</Button> |
| | | </div> |
| | |
| | | |
| | | if (config.components.findIndex(item => item.type === 'login') > -1) { |
| | | roleParam.login = true |
| | | config.loginview = true |
| | | } else { |
| | | config.loginview = false |
| | | } |
| | | |
| | | let param = { |