| | |
| | | 1585192949946f3et2ts8tn82krmumdf,15855615451212m12ip23vpcm79kloro,1587005717541lov40vg61q7l1rbveon,1590458676585agbbr63t6ihighg2i1g,1602315375262ikd33ii0nii34pt861o,1582771068837vsv54a089lgp45migbg, |
| | | 1582777675954ifu05upurs465omoth7,158294809668898cklbv6c5bou8e1fpu,1584676379094iktph45fb8imhg96bql,1584695125339vo5g7iqgfn01qmrd6s2,1584699661372vhmpp9dn9foo0eob722,15848421131551gg04ie8sitsd3f7467, |
| | | 1589782279158ngr675kk3oksin35sul,1589788042787ffdt9hle4s45k9r1nvs,15900310928174dro07ihfckghpb5h13,1594095599055qicg2eb642v5qglhnuo,1599613340050c8nu6rbst9d4emnnbsq,1577972969199lei1g0qkvlh4tkc908m, |
| | | 1578479100252lfbp29v1kafk4s4q4ig,1577971621421tg4v0i1ur8873k7e0ob,1577929944419lgc5h3hepum765e2k7u,1588493493409k9guqp067d31lu7blsv` |
| | | 1578479100252lfbp29v1kafk4s4q4ig,1577971621421tg4v0i1ur8873k7e0ob,1577929944419lgc5h3hepum765e2k7u,1588493493409k9guqp067d31lu7blsv,15827879285193g85m3i2uprektpgmpf` |
| | | |
| | | if (window.openDatabase) { |
| | | CacheUtils.openWebSql(options.sysType) |
| | |
| | | let modules = MenuUtils.getLinkModules(fromJS(window.GLOB.customMenu).toJS().components) || [] |
| | | let supmodules = MenuUtils.getSupModules(fromJS(window.GLOB.customMenu).toJS().components, '') || [] |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | |
| | | if (roleList) { |
| | | try { |
| | |
| | | label: '黑名单', |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | |
| | | label: '黑名单', |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | |
| | | label: '黑名单', |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | | if (roleList) { |
| | |
| | | label: '黑名单', |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, columns) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | | if (roleList) { |
| | |
| | | label: '黑名单', |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | |
| | | import React from 'react' |
| | | import { fromJS } from 'immutable' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Icon, Popover } from 'antd' |
| | | |
| | | import getForm from './options' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import './index.scss' |
| | | |
| | | const Card = ({ id, card, active, moveCard, findCard, editCard, closeCard, selectCard }) => { |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | |
| | | const Card = ({ id, card, active, moveCard, findCard, closeCard, selectCard, updateGroup }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: 'form', id, originalIndex }, |
| | |
| | | }) |
| | | const opacity = isDragging ? 0 : 1 |
| | | |
| | | const edit = () => { |
| | | editCard(id) |
| | | } |
| | | |
| | | const close = () => { |
| | | closeCard(id) |
| | | } |
| | |
| | | selectCard(id) |
| | | } |
| | | |
| | | const getForms = () =>{ |
| | | return getForm(card) |
| | | } |
| | | |
| | | const updateSetting = (res) => { |
| | | let _card = fromJS(card).toJS() |
| | | |
| | | if (res.prevEnable) { |
| | | _card.prevButton.enable = res.prevEnable |
| | | delete res.prevEnable |
| | | } |
| | | if (res.subEnable) { |
| | | _card.subButton.enable = res.subEnable |
| | | delete res.subEnable |
| | | } |
| | | if (res.nextEnable) { |
| | | _card.nextButton.enable = res.nextEnable |
| | | delete res.nextEnable |
| | | } |
| | | |
| | | _card.setting = res |
| | | |
| | | updateGroup(_card) |
| | | } |
| | | |
| | | return ( |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="edit" type="edit" onClick={edit} /> |
| | | <NormalForm title="分组编辑" width={850} update={updateSetting} getForms={getForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <Icon className="close" type="close" onClick={close} /> |
| | | </div> |
| | | } trigger="hover"> |
| | |
| | | } |
| | | } |
| | | |
| | | const editCard = id => { |
| | | const { card } = findCard(id) |
| | | handleGroup(card) |
| | | } |
| | | |
| | | const closeCard = id => { |
| | | const { card } = findCard(id) |
| | | closeGroup(card) |
| | |
| | | active={card.uuid === selectId} |
| | | card={card} |
| | | moveCard={moveCard} |
| | | editCard={editCard} |
| | | closeCard={closeCard} |
| | | updateGroup={handleGroup} |
| | | findCard={findCard} |
| | | selectCard={selectCard} |
| | | /> |
New file |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (group) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let fields = [{field: '', label: '空'}] |
| | | |
| | | if (appType === 'mob') { |
| | | group.fields.forEach(f => { |
| | | if (f.field && ['text', 'number'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | } |
| | | }) |
| | | } else { |
| | | group.fields.forEach(f => { |
| | | if (f.field && ['select', 'link', 'text', 'number'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const groupForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'title', |
| | | label: '标题', |
| | | initval: group.setting.title || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'status', |
| | | label: '状态值', |
| | | initval: group.setting.status || '', |
| | | tooltip: '用于表单加载时的状态控制。', |
| | | required: false, |
| | | forbid: !group.prevButton |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'focus', |
| | | label: '焦点', |
| | | initval: group.setting.focus || '', |
| | | required: false, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'align', |
| | | label: '表单排列', |
| | | initval: group.setting.align || 'left_right', |
| | | required: false, |
| | | options: [ |
| | | {value: 'left_right', label: '左右'}, |
| | | {value: 'up_down', label: '上下'}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'prevEnable', |
| | | label: '上一步', |
| | | initval: group.prevButton ? group.prevButton.enable || 'false' : 'false', |
| | | tooltip: '第一组不显示。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | | {value: 'false', label: '隐藏'}, |
| | | ], |
| | | forbid: !group.prevButton |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'subEnable', |
| | | label: '提交', |
| | | initval: group.subButton.enable || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | | {value: 'false', label: '隐藏'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'nextEnable', |
| | | label: '跳过', |
| | | initval: group.nextButton ? group.nextButton.enable || 'false' : 'false', |
| | | tooltip: '最后一组不显示。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | | {value: 'false', label: '隐藏'}, |
| | | ], |
| | | forbid: !group.nextButton |
| | | }, |
| | | ] |
| | | |
| | | return groupForm |
| | | } |
| | |
| | | tooltip: '执行成功后需要刷新的组件。', |
| | | required: false, |
| | | options: modules |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // key: 'enable', |
| | | // label: '是否显示', |
| | | // initVal: card.enable || 'true', |
| | | // required: false, |
| | | // options: [{ |
| | | // value: 'true', |
| | | // text: '显示' |
| | | // }, { |
| | | // value: 'false', |
| | | // text: '隐藏' |
| | | // }] |
| | | // } |
| | | } |
| | | ] |
| | | } |
| | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from './options' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import './index.scss' |
| | | |
| | | const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) |
| | | const WrapComponent = asyncIconComponent(() => import('@/menu/components/form/wrapsetting')) |
| | | const CardComponent = asyncComponent(() => import('@/templates/modalconfig/dragelement')) |
| | | const MobCardComponent = asyncComponent(() => import('@/mob/components/formdragelement')) |
| | | const FormTitle = asyncComponent(() => import('../dragtitle')) |
| | | const GroupForm = asyncComponent(() => import('./groupform')) |
| | | const FormAction = asyncComponent(() => import('../formaction')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) |
| | |
| | | sort: 1, |
| | | style: {}, |
| | | fields: [], |
| | | prevButton: {label: '上一步', type: 'prev', enable: 'true', style: {marginRight: '15px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | prevButton: {label: '上一步', type: 'prev', enable: 'false', style: {marginRight: '15px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | subButton: {label: '提交', type: 'submit', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | nextButton: {label: '跳过', type: 'next', enable: 'false', style: {paddingTop: '5px', paddingBottom: '5px'}} |
| | | }] |
| | |
| | | sort: card.subcards.length + 1, |
| | | style: {}, |
| | | fields: [], |
| | | prevButton: {label: '上一步', type: 'prev', enable: 'true', style: {marginRight: '15px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | prevButton: {label: '上一步', type: 'prev', enable: 'false', style: {marginRight: '15px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | subButton: {label: '提交', type: 'submit', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | nextButton: {label: '跳过', type: 'next', enable: 'false', style: {paddingTop: '5px', paddingBottom: '5px'}} |
| | | } |
| | |
| | | |
| | | this.setState({ |
| | | card, |
| | | group: newcard, |
| | | groupvisible: true |
| | | group: newcard |
| | | }) |
| | | this.props.updateConfig(card) |
| | | } |
| | |
| | | } |
| | | |
| | | changeGroup = (item) => { |
| | | this.setState({ |
| | | group: item, |
| | | groupvisible: true |
| | | }) |
| | | this.updateGroup(item) |
| | | } |
| | | |
| | | closeGroup = (cell) => { |
| | |
| | | |
| | | this.setState({card, group}) |
| | | this.props.updateConfig(card) |
| | | } |
| | | |
| | | handleGroupSubmit = () => { |
| | | let group = fromJS(this.state.group).toJS() |
| | | |
| | | this.groupRef.handleConfirm().then(res => { |
| | | group.prevButton.enable = res.prevEnable |
| | | group.subButton.enable = res.subEnable |
| | | group.nextButton.enable = res.nextEnable |
| | | |
| | | delete res.prevEnable |
| | | delete res.subEnable |
| | | delete res.nextEnable |
| | | |
| | | group.setting = res |
| | | |
| | | this.setState({groupvisible: false}) |
| | | this.updateGroup(group) |
| | | }) |
| | | } |
| | | |
| | | changecols = (type) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | return getWrapForm(this.state.card) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加分组" onClick={this.addCard} type="plus" /> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | | <NormalForm title="表单设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="propcard" card={card}/> |
| | | <PasteComponent config={card} options={['form']} updateConfig={this.pasteForm} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | |
| | | />} |
| | | <FormAction config={card} group={group} updateconfig={this.updateGroup}/> |
| | | </div> : null} |
| | | <Modal |
| | | title="分组编辑" |
| | | visible={this.state.groupvisible} |
| | | width={850} |
| | | maskClosable={false} |
| | | onCancel={() => this.setState({groupvisible: false})} |
| | | onOk={this.handleGroupSubmit} |
| | | destroyOnClose |
| | | > |
| | | <GroupForm |
| | | dict={dict} |
| | | group={group} |
| | | inputSubmit={this.handleGroupSubmit} |
| | | wrappedComponentRef={(inst) => this.groupRef = inst} |
| | | /> |
| | | </Modal> |
| | | <Modal |
| | | title={this.state.dict['model.edit']} |
| | | visible={this.state.visible} |
New file |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (config) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let wrap = config.wrap |
| | | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | const wrapForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initval: wrap.name || '', |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initval: wrap.width || 24, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'datatype', |
| | | label: '初始值', |
| | | initval: wrap.datatype || 'static', |
| | | tooltip: '初始值来源于数据源或表单默认值。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'dynamic', label: '动态'}, |
| | | {value: 'static', label: '静态'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'statusControl', |
| | | label: '状态控制', |
| | | initval: wrap.statusControl || '', |
| | | tooltip: '表单加载时的状态,当字段值与表单组的状态值一致时,启用对应的表单组。', |
| | | required: false, |
| | | options: config.columns, |
| | | forbid: config.subtype === 'tabform' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'groupLabel', |
| | | label: '分组名称', |
| | | initval: wrap.groupLabel || 'show', |
| | | tooltip: '加载时是否显示分组名称。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', label: '显示'}, |
| | | {value: 'hidden', label: '隐藏'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'tabtype', |
| | | label: '分组风格', |
| | | initval: wrap.tabtype || 'mktab', |
| | | required: false, |
| | | options: [ |
| | | {value: 'mktab', label: 'tab页'}, |
| | | {value: 'mkbtn', label: '按钮组'}, |
| | | ], |
| | | forbid: config.subtype !== 'tabform' |
| | | }, |
| | | { |
| | | type: 'color', |
| | | field: 'color', |
| | | label: '颜色控制', |
| | | initval: wrap.color || '#1890ff', |
| | | tooltip: '完成后的颜色', |
| | | required: false, |
| | | forbid: config.subtype === 'tabform' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | | return wrapForm |
| | | } |
| | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from '../normal-form/options' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import './index.scss' |
| | | |
| | | const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) |
| | | const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) |
| | | const WrapComponent = asyncIconComponent(() => import('@/menu/components/form/wrapsetting')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const CardComponent = asyncComponent(() => import('@/templates/modalconfig/dragelement')) |
| | | const MobCardComponent = asyncComponent(() => import('@/mob/components/formdragelement')) |
| | | const FormTitle = asyncComponent(() => import('../dragtitle')) |
| | | const GroupForm = asyncComponent(() => import('./groupform')) |
| | | const FormAction = asyncComponent(() => import('../formaction')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) |
| | |
| | | |
| | | this.setState({ |
| | | card, |
| | | group: newcard, |
| | | groupvisible: true |
| | | group: newcard |
| | | }) |
| | | this.props.updateConfig(card) |
| | | } |
| | |
| | | selectGroup = (item) => { |
| | | this.setState({ |
| | | group: item |
| | | }) |
| | | } |
| | | |
| | | changeGroup = (item) => { |
| | | this.setState({ |
| | | group: item, |
| | | groupvisible: true |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | this.setState({card, group}) |
| | | this.props.updateConfig(card) |
| | | } |
| | | |
| | | handleGroupSubmit = () => { |
| | | let group = fromJS(this.state.group).toJS() |
| | | |
| | | this.groupRef.handleConfirm().then(res => { |
| | | group.subButton.enable = res.subEnable |
| | | |
| | | delete res.subEnable |
| | | |
| | | group.setting = res |
| | | |
| | | this.setState({groupvisible: false}) |
| | | this.updateGroup(group) |
| | | }) |
| | | } |
| | | |
| | | changecols = (type) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | return getWrapForm(this.state.card) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加分组" onClick={this.addCard} type="plus" /> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | | <NormalForm title="表单设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="propcard" card={card}/> |
| | | <PasteComponent config={card} options={['form']} updateConfig={this.pasteForm} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | |
| | | tabtype={card.wrap.tabtype || ''} |
| | | selectId={group ? group.uuid : ''} |
| | | handleList={this.changecards} |
| | | handleGroup={this.changeGroup} |
| | | handleGroup={this.updateGroup} |
| | | closeGroup={this.closeGroup} |
| | | selectGroup={this.selectGroup} |
| | | /> |
| | |
| | | />} |
| | | <FormAction config={card} group={group} updateconfig={this.updateGroup}/> |
| | | </div> : null} |
| | | <Modal |
| | | title="分组编辑" |
| | | visible={this.state.groupvisible} |
| | | width={850} |
| | | maskClosable={false} |
| | | onCancel={() => this.setState({groupvisible: false})} |
| | | onOk={this.handleGroupSubmit} |
| | | destroyOnClose |
| | | > |
| | | <GroupForm |
| | | dict={dict} |
| | | group={group} |
| | | inputSubmit={this.handleGroupSubmit} |
| | | wrappedComponentRef={(inst) => this.groupRef = inst} |
| | | /> |
| | | </Modal> |
| | | <Modal |
| | | title={this.state.dict['model.edit']} |
| | | visible={this.state.visible} |
| | |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | const menuWrapForm = [ |
| | | { |
| | | type: 'text', |
| | |
| | | max: 24, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | | }, |
| | | } |
| | | ] |
| | | |
| | | return menuWrapForm |
| | |
| | | } |
| | | |
| | | state = { |
| | | roleList: [], |
| | | msgTemps: [], |
| | | appMenus: [], |
| | | link: this.props.wrap.link || 'menu' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let msgTemps = sessionStorage.getItem('msgTemplate') |
| | | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | if (msgTemps) { |
| | | try { |
| | |
| | | appMenus = [] |
| | | } |
| | | |
| | | this.setState({roleList, msgTemps, appMenus}) |
| | | this.setState({msgTemps, appMenus}) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | render() { |
| | | const { wrap } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { roleList, msgTemps, appMenus, link } = this.state |
| | | const { msgTemps, appMenus, link } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | > |
| | | {msgTemps.map(option => |
| | | <Select.Option key={option.ID} value={option.ID}>{option.SignName + ' - ' + option.TemplateCode}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="黑名单"> |
| | | {getFieldDecorator('blacklist', { |
| | | initialValue: wrap.blacklist || [] |
| | | })( |
| | | <Select |
| | | showSearch |
| | | mode="multiple" |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {roleList.map(option => |
| | | <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | | <div style={{color: '#959595', fontSize: '13px', paddingTop: '30px', float: 'right'}}>执行成功后的回调函数。</div> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label={'sql'}> |
| | | {getFieldDecorator('sql', { |
| | |
| | | // MenuID: '1606794243739c5ihs58lucpskp3r4s2', |
| | | // MenuNo: 's_custom_componentsM', |
| | | // MenuName: '自定义组件', |
| | | }, { |
| | | src: '', |
| | | systems: ['production', 'local'], |
| | | PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, |
| | | type: 'ManageTable', |
| | | MenuID: '15827879285193g85m3i2uprektpgmpf', |
| | | MenuNo: 'bd_mes_techM', |
| | | MenuName: '工艺主数据', |
| | | }] |
| | | }, { |
| | | MenuID: 'systemManageViewInterface', |
| | |
| | | title: item.name, |
| | | children: [] |
| | | } |
| | | if (item.type === 'tabs') { |
| | | |
| | | if (item.type === 'topbar' || item.type === 'login') { |
| | | return null |
| | | } else if (item.type === 'tabs') { |
| | | let tabs = [] |
| | | item.subtabs.forEach(tab => { |
| | | let s = traversal(tab.components) |
| | |
| | | title: menu.setting.name |
| | | } |
| | | }) |
| | | } else if (item.type === 'form') { |
| | | m.children = item.subcards.map(m => { |
| | | return { |
| | | key: m.uuid, |
| | | title: m.setting.title |
| | | } |
| | | }) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | item.action && item.action.forEach(btn => { |
| | | this.checkBtn(btn) |
| | |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | if (m.children.length === 0) return null |
| | | |
| | | return m |
| | | }) |
| | |
| | | title: item.name, |
| | | children: [] |
| | | } |
| | | if (item.type === 'tabs') { |
| | | if (item.type === 'login') { |
| | | return null |
| | | } else if (item.type === 'tabs') { |
| | | let tabs = [] |
| | | item.subtabs.forEach(tab => { |
| | | let s = traversal(tab.components) |
| | |
| | | title: menu.setting.name |
| | | } |
| | | }) |
| | | } else if (item.type === 'form') { |
| | | m.children = item.subcards.map(m => { |
| | | return { |
| | | key: m.uuid, |
| | | title: m.setting.title |
| | | } |
| | | }) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | item.action && item.action.forEach(btn => { |
| | | this.checkBtn(btn) |
| | |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | if (m.children.length === 0) return null |
| | | |
| | | return m |
| | | }) |