| | |
| | | UserDeleteOutlined, |
| | | UserSwitchOutlined, |
| | | VideoCameraOutlined, |
| | | WifiOutlined |
| | | WifiOutlined, |
| | | TableOutlined |
| | | } from '@ant-design/icons' |
| | | |
| | | const MkIcons = { |
| | |
| | | 'user-switch': (props) => <UserSwitchOutlined {...props} />, |
| | | 'video-camera': (props) => <VideoCameraOutlined {...props} />, |
| | | 'wifi': (props) => <WifiOutlined {...props} />, |
| | | 'table': (props) => <TableOutlined {...props} />, |
| | | } |
| | | |
| | | class MkIcon extends Component { |
| | |
| | | readonly: false |
| | | }, |
| | | { // 菜单图标 |
| | | type: 'select', |
| | | type: 'icon', |
| | | key: 'icon', |
| | | label: dict['model.icon'], |
| | | initVal: menu.card.PageParam.Icon, |
| | | required: true, |
| | | options: [{ |
| | | MenuID: 'folder', |
| | | text: 'folder' |
| | | }, { |
| | | MenuID: 'api', |
| | | text: 'api' |
| | | }] |
| | | initVal: menu.card.PageParam.Icon || 'folder', |
| | | required: true |
| | | } |
| | | ] |
| | | }) |
| | |
| | | readonly: false |
| | | }, |
| | | { // 菜单图标 |
| | | type: 'select', |
| | | type: 'icon', |
| | | key: 'icon', |
| | | label: dict['model.icon'], |
| | | initVal: 'folder', |
| | | required: true, |
| | | options: [{ |
| | | MenuID: 'folder', |
| | | text: 'folder' |
| | | }, { |
| | | MenuID: 'api', |
| | | text: 'api' |
| | | }] |
| | | required: true |
| | | } |
| | | ] |
| | | }) |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Select } from 'antd' |
| | | |
| | | import MkIcon from '@/components/mk-icon' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | |
| | | const { getFieldDecorator } = this.props.form |
| | | const fields = [] |
| | | this.props.formlist.forEach((item, index) => { |
| | | if (item.type === 'text') { // 文本搜索 |
| | | if (item.type === 'text') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <Form.Item label={item.label}> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'select') { // 下拉搜索 |
| | | } else if (item.type === 'select') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <Form.Item label={item.label}> |
| | |
| | | > |
| | | {item.options.map(option => |
| | | <Select.Option id={option.MenuID} key={option.MenuID} value={option.MenuID}> |
| | | {item.key === 'icon' && <MkIcon type={option.text} />} {option.text || option.MenuName} |
| | | {option.text || option.MenuName} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'icon') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <Form.Item label={item.label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.select'] + item.label + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <MkEditIcon options={['normal', 'data', 'direction', 'edit', 'hint']} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |
| | |
| | | import { Form, Row, Col, Input, Select, Radio, notification, Tooltip, InputNumber, Cascader } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import { btnIcons, btnClasses, formRule } from '@/utils/option.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import { btnClasses, formRule } from '@/utils/option.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | | const { TextArea } = Input |
| | | const actionTypeOptions = { |
| | |
| | | item.options = btnClasses |
| | | } else if (item.key === 'innerFunc' && _procMode === 'inner') { |
| | | item.required = true |
| | | } else if (item.key === 'icon') { |
| | | item.options = btnIcons |
| | | } else if (item.key === 'intertype') { |
| | | let iscustom = ['pop', 'prompt', 'exec'].includes(_opentype) |
| | | item.options = this.state.interTypeOptions.filter(op => (iscustom || op.value !== 'custom')) |
| | |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value) => {this.optionChange(item.key, value)}} |
| | | allowClear={item.key === 'icon'} |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | | > |
| | | {item.options.map((option, index) => |
| | | <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value || option.field}> |
| | | {item.key === 'icon' && option.value ? <MkIcon type={option.value} /> : null} {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" overlayClassName={item.tooltipClass} 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 + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <MkEditIcon options={['edit', 'direction', 'normal', 'data', 'hint']} allowClear/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'radio') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import { formRule } from '@/utils/option.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | // import './index.scss' |
| | | |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | | class MainTab extends Component { |
| | | static propTpyes = { |
| | |
| | | > |
| | | {item.options.map((option, i) => |
| | | <Select.Option id={'mk' + i} title={option.text} key={'mk' + i} value={option.value}> |
| | | {item.key === 'icon' && i !== 0 ? <MkIcon type={option.text} /> : option.text} |
| | | {option.text} |
| | | </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 + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <MkEditIcon options={['data', 'normal', 'edit', 'direction', 'hint']} allowClear/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'mutilselect') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | type: 'icon', |
| | | key: 'icon', |
| | | label: Formdict['model.icon'], |
| | | initVal: card.icon, |
| | | required: false, |
| | | options: [] |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | type: 'icon', |
| | | key: 'icon', |
| | | label: Formdict['model.icon'], |
| | | initVal: card.icon || '', |
| | | required: false, |
| | | options: [{ |
| | | value: '', |
| | | text: Formdict['model.empty'] |
| | | }, { |
| | | value: 'table', |
| | | text: 'table' |
| | | }, { |
| | | value: 'bar-chart', |
| | | text: 'bar-chart' |
| | | }, { |
| | | value: 'pie-chart', |
| | | text: 'pie-chart' |
| | | }, { |
| | | value: 'line-chart', |
| | | text: 'line-chart' |
| | | }], |
| | | forbid: type === 'CalendarPage' |
| | | }, |
| | | { |
| | |
| | | 'user-switch', |
| | | 'video-camera', |
| | | 'wifi', |
| | | |
| | | 'table', |
| | | 'apple', |
| | | 'dingding', |
| | | 'weibo', |