18个文件已修改
5个文件已添加
12个文件已删除
| | |
| | | html, body { |
| | | width: 100%; |
| | | font-size: 14px; |
| | | // .ant-table, .ant-dropdown { |
| | | // color: rgba(0, 0, 0, 0.85); |
| | | // } |
| | | } |
| | | #root { |
| | | height: 100%; |
| | |
| | | const { TextArea } = Input |
| | | |
| | | const MKRadio = asyncComponent(() => import('./mkRadio')) |
| | | const MKCheckbox = asyncComponent(() => import('./mkCheckbox')) |
| | | const StyleInput = asyncComponent(() => import('./styleInput')) |
| | | const MKFileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload')) |
| | | const MKColor = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkColor')) |
| | |
| | | |
| | | current.controlFields.forEach(cell => { |
| | | let m = map.get(cell.field) |
| | | m.hidden = current.hidden || !cell.values.includes(val) |
| | | |
| | | if (current.hidden) { |
| | | m.hidden = true |
| | | } else if (current.type === 'checkbox') { |
| | | let vals = [...val, ...cell.values] |
| | | if (vals.length !== new Set(vals).size) { |
| | | m.hidden = false |
| | | } else { |
| | | m.hidden = true |
| | | } |
| | | } else { |
| | | m.hidden = !cell.values.includes(val) |
| | | } |
| | | |
| | | if (m.hidden) { |
| | | m.initval = this.record[m.field] |
| | |
| | | content = (<StyleInput config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) |
| | | } else if (item.type === 'radio') { |
| | | content = (<MKRadio config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>) |
| | | } else if (item.type === 'checkbox') { |
| | | content = (<MKCheckbox config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>) |
| | | } else if (item.type === 'fileupload') { |
| | | content = (<MKFileUpload config={item} onChange={(val) => this.recordChange({[item.field]: val})} />) |
| | | } else if (item.type === 'cascader') { |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Checkbox } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | | class MKCheckbox extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, |
| | | onChange: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | value: this.props.config.initval, |
| | | config: fromJS(this.props.config).toJS(), |
| | | options: fromJS(this.props.config.options).toJS(), |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | } |
| | | |
| | | onChange = (value) => { |
| | | this.setState({value}) |
| | | this.props.onChange(value) |
| | | } |
| | | |
| | | render() { |
| | | const { value, options } = this.state |
| | | |
| | | return ( |
| | | <Checkbox.Group defaultValue={value} onChange={this.onChange}> |
| | | {options.map(option => <Checkbox key={option.value} title={option.label} disabled={option.disabled} value={option.value}>{option.label}</Checkbox>)} |
| | | </Checkbox.Group> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default MKCheckbox |
| | |
| | | const { config } = this.props |
| | | const { value } = this.state |
| | | |
| | | return <Input ref={this.inputRef} placeholder={config.placeholder || ''} value={value} autoComplete="off" onChange={this.handleChange} onPressEnter={this.props.onSubmit} /> |
| | | return <Input ref={this.inputRef} readOnly={config.readOnly} placeholder={config.placeholder || ''} value={value} autoComplete="off" onChange={this.handleChange} onPressEnter={this.props.onSubmit} /> |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return ( |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} value={value} onChange={this.onChange}> |
| | | {options.map(option => <Radio key={option.value} value={option.value}>{option.label}</Radio>)} |
| | | {options.map(option => <Radio key={option.value} disabled={option.disabled} value={option.value}>{option.label}</Radio>)} |
| | | </Radio.Group> |
| | | ) |
| | | } |
| | |
| | | onChange={(val) => val === undefined && this.selectChange('')} |
| | | > |
| | | {options.map(option => |
| | | <Select.Option key={option.value || option.field} value={option.value || option.field}>{option.label || option.text}</Select.Option> |
| | | <Select.Option key={option.value || option.field} disabled={option.disabled} value={option.value || option.field}>{option.label || option.text}</Select.Option> |
| | | )} |
| | | </Select> |
| | | ) |
| | |
| | | onChange={this.mutilselectChange} |
| | | > |
| | | {options.map(option => |
| | | <Select.Option key={option.value} value={option.value}>{option.label || option.text}</Select.Option> |
| | | <Select.Option key={option.value} disabled={option.disabled} value={option.value}>{option.label || option.text}</Select.Option> |
| | | )} |
| | | </Select>) |
| | | } |
| | |
| | | options: [ |
| | | {value: '', label: '不可选'}, |
| | | {value: 'radio', label: '单选'}, |
| | | {value: 'checkbox', label: '多选', forbid: subtype === 'propcard'}, |
| | | {value: 'checkbox', label: '多选', disabled: subtype === 'propcard'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'checkAll', values: ['checkbox']}, |
| | |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载', forbid: subtype === 'propcard'}, |
| | | {value: 'always', label: '数据加载', disabled: subtype === 'propcard'}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | ] |
| | | |
| | | return cardWrapForm.map(item => { |
| | | if (['pagestyle', 'cardType', 'selected'].includes(item.field)) { |
| | | if (['pagestyle'].includes(item.field)) { |
| | | item.options = item.options.filter(option => !option.forbid) |
| | | } |
| | | |
| | |
| | | const cardWrapForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'title', |
| | | label: '标题', |
| | | initval: wrap.title || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initval: wrap.name || '', |
| | |
| | | ] |
| | | |
| | | if (isApp) { |
| | | pageTemps = [ |
| | | // { value: 'page', text: '菜单' }, |
| | | { value: 'linkpage', text: '关联菜单' }, |
| | | { value: 'billprint', text: '单据打印' }, |
| | | { value: 'pay', text: Formdict['model.pay'] }, |
| | | { value: 'custom', text: '链接' } |
| | | ] |
| | | funTypes = [ |
| | | { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, |
| | | ] |
| | | appMenus = sessionStorage.getItem('appMenus') |
| | | if (appMenus) { |
| | | try { |
| | |
| | | funTypes = [ |
| | | { value: 'mkBinding', text: '开通扫码登录' }, |
| | | { value: 'mkUnBinding', text: '用户解绑' }, |
| | | // { value: 'scan', text: '扫一扫' }, |
| | | { value: 'reAuth', text: '重新授权' }, |
| | | ] |
| | | pageTemps = [ |
| | | { value: 'linkpage', text: '关联菜单' }, |
| | | // { value: 'pay', text: Formdict['model.pay'] }, |
| | | { value: 'custom', text: '链接' } |
| | | ] |
| | | } else { |
| | | pageTemps = [ |
| | | { value: 'linkpage', text: '关联菜单' }, |
| | | { value: 'billprint', text: '单据打印' }, |
| | | { value: 'pay', text: Formdict['model.pay'] }, |
| | | { value: 'custom', text: '链接' } |
| | | ] |
| | | funTypes = [ |
| | | { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, |
| | | ] |
| | | opentypes = opentypes.filter(item => item.value !== 'tab') |
| | | } |
| | | } |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import getWrapForm from './options' |
| | | import './index.scss' |
| | | |
| | | const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const MenuComponent = asyncIconComponent(() => import('./menusetting')) |
| | | const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | const { wrap } = this.state.card |
| | | |
| | | return getWrapForm(wrap) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <MenuComponent config={card} updateConfig={this.updateComponent} /> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | | <NormalForm title="菜单栏设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null} |
New file |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap) { |
| | | const wrapForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'name', |
| | | label: '导航栏名称', |
| | | initval: wrap.name || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'MenuNo', |
| | | label: '菜单参数', |
| | | initval: wrap.MenuNo || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'datatype', |
| | | label: '数据来源', |
| | | initval: wrap.datatype || 'static', |
| | | tooltip: '选择静态值,无需配置数据源。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'dynamic', label: '动态'}, |
| | | {value: 'static', label: '静态'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'height', |
| | | label: '高度', |
| | | initval: wrap.height || 50, |
| | | min: 30, |
| | | max: 200, |
| | | precision: 0, |
| | | required: true |
| | | } |
| | | ] |
| | | |
| | | return wrapForm |
| | | } |
| | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import getWrapForm from './options' |
| | | import './index.scss' |
| | | |
| | | const LoginForm = asyncComponent(() => import('./loginform')) |
| | | const WrapComponent = asyncIconComponent(() => import('../wrapsetting')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | |
| | | class PropCardEditComponent extends Component { |
| | | static propTpyes = { |
| | |
| | | } |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | const { wrap } = this.state.card |
| | | |
| | | return getWrapForm(wrap) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | } |
| | | |
| | | render() { |
| | | const { card, dict } = this.state |
| | | let style = resetStyle(card.style) |
| | |
| | | <div className="login-edit-box" style={style} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | | <NormalForm title="登录设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | </div> |
New file |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let menulist = sessionStorage.getItem('appMenus') |
| | | if (menulist) { |
| | | try { |
| | | menulist = JSON.parse(menulist) |
| | | } catch (e) { |
| | | menulist = [] |
| | | } |
| | | } else { |
| | | menulist = [] |
| | | } |
| | | |
| | | let msgTemps = sessionStorage.getItem('msgTemplate') |
| | | |
| | | if (msgTemps) { |
| | | try { |
| | | msgTemps = JSON.parse(msgTemps) |
| | | msgTemps = msgTemps.map(item => { |
| | | item.value = item.ID |
| | | item.label = item.SignName + ' - ' + item.TemplateCode |
| | | return item |
| | | }) |
| | | } catch (e) { |
| | | msgTemps = [] |
| | | } |
| | | } else { |
| | | msgTemps = [] |
| | | } |
| | | |
| | | const wrapForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initval: wrap.name || '', |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'checkbox', |
| | | field: 'loginWays', |
| | | label: '登录方式', |
| | | initval: wrap.loginWays || [], |
| | | required: true, |
| | | options: [ |
| | | { label: '账号', value: 'uname_pwd' }, |
| | | { label: '短信', value: 'sms_vcode' }, |
| | | { label: '扫码', value: 'app_scan', disabled: appType === 'mob' }, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'tempId', values: ['sms_vcode']} |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initval: wrap.width || 24, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'maxWidth', |
| | | label: '最大宽度', |
| | | initval: wrap.maxWidth || '', |
| | | tooltip: '登录框的最大宽度值。', |
| | | min: 100, |
| | | max: 2000, |
| | | precision: 0, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'styleInput', |
| | | field: 'height', |
| | | label: '高度', |
| | | initval: wrap.height || '', |
| | | tooltip: '组件占用的最小高度,用于页面布局。', |
| | | required: false, |
| | | options: ['px', 'vh', 'vw', '%'] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'link', |
| | | label: '链接', |
| | | initval: wrap.link || 'menu', |
| | | required: false, |
| | | options: [ |
| | | {value: 'menu', label: '菜单'}, |
| | | {value: 'linkmenu', label: '关联菜单'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'linkmenu', values: ['linkmenu']} |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'linkmenu', |
| | | label: '关联菜单', |
| | | initval: wrap.linkmenu || '', |
| | | required: true, |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'select', // $验证码$ $mob$ $send_type$ |
| | | field: 'tempId', |
| | | label: '短信模板', |
| | | initval: wrap.tempId || '', |
| | | tooltip: '短信模板可在管理系统 HS-奇云短信模板 处添加。', |
| | | required: true, |
| | | options: msgTemps |
| | | } |
| | | ] |
| | | |
| | | return wrapForm |
| | | } |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import getWrapForm from './options' |
| | | import './index.scss' |
| | | |
| | | const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const MenuComponent = asyncIconComponent(() => import('./menusetting')) |
| | | const LinkComponent = asyncIconComponent(() => import('./linksetting')) |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | const { wrap } = this.state.card |
| | | |
| | | return getWrapForm(wrap) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | |
| | |
| | | <div className="mk-popover-control"> |
| | | <MenuComponent config={card} updateConfig={this.updateComponent} /> |
| | | <LinkComponent config={card} updateConfig={this.updateComponent} /> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | | <NormalForm title="导航栏设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | </div> |
New file |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap) { |
| | | let menulist = sessionStorage.getItem('appMenus') |
| | | if (menulist) { |
| | | try { |
| | | menulist = JSON.parse(menulist) |
| | | } catch (e) { |
| | | menulist = [] |
| | | } |
| | | } else { |
| | | menulist = [] |
| | | } |
| | | |
| | | const wrapForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'name', |
| | | label: '导航栏名称', |
| | | initval: wrap.name || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'MenuNo', |
| | | label: '菜单参数', |
| | | initval: wrap.MenuNo || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initval: wrap.width || 1200, |
| | | tooltip: '导航栏主体内容宽度(包括logo、菜单、链接等)。', |
| | | min: 400, |
| | | max: 3000, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'height', |
| | | label: '高度', |
| | | initval: wrap.height || 50, |
| | | min: 50, |
| | | max: 200, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'source', |
| | | field: 'logo', |
| | | label: 'logo', |
| | | initval: wrap.logo || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'property', |
| | | label: 'logo属性', |
| | | initval: wrap.property || '', |
| | | required: false, |
| | | options: [ |
| | | {value: '', label: '空'}, |
| | | {value: 'linkmenu', label: '关联菜单'}, |
| | | {value: 'link', label: '链接'} |
| | | ], |
| | | controlFields: [ |
| | | {field: 'linkmenu', values: ['linkmenu']}, |
| | | {field: 'link', values: ['link']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'linkmenu', |
| | | label: '关联菜单', |
| | | initval: wrap.linkmenu || '', |
| | | required: true, |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | field: 'link', |
| | | label: '链接', |
| | | initval: wrap.link || '', |
| | | required: true, |
| | | span: 24 |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'user', |
| | | label: '用户信息', |
| | | initval: wrap.user || 'hidden', |
| | | tooltip: '存在登录且取到登录信息时,显示用户头像、用户名及退出。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'hidden', label: '隐藏'}, |
| | | {value: 'show', label: '显示'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'hover', |
| | | label: '悬浮显示', |
| | | initval: wrap.hover || 'false', |
| | | tooltip: '默认隐藏菜单栏,鼠标在靠近顶部时显示。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '不启用'}, |
| | | {value: 'true', label: '启用'}, |
| | | ] |
| | | } |
| | | ] |
| | | |
| | | return wrapForm |
| | | } |
| | |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | z-index: 2; |
| | | opacity: 0; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | z-index: 2; |
| | | opacity: 0; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | |
| | | |
| | | if (item.type === 'link') { |
| | | arrfield.push(item.linkField) |
| | | } else if ((item.type === 'select' || item.type === 'radio') && item.linkSubField && item.linkSubField.length > 0) { |
| | | arrfield.push(...item.linkSubField) |
| | | } else if (item.type === 'checkcard') { |
| | | arrfield = item.fields.map(f => f.field) |
| | | arrfield.push(item.cardValField) |
| | |
| | | arrfield.push(item.urlField) |
| | | } |
| | | } |
| | | if (['select', 'radio', 'link', 'checkcard'].includes(item.type) && item.linkSubField && item.linkSubField.length > 0) { |
| | | arrfield.push(...item.linkSubField) |
| | | } |
| | | if (item.disableField) { |
| | | arrfield.push(item.disableField) |
| | | } |
| | |
| | | border-radius: 0!important; |
| | | } |
| | | } |
| | | body { |
| | | overflow-y: hidden; |
| | | } |
| | |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | | |
| | | body { |
| | | overflow-y: hidden; |
| | | } |
| | |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | | |
| | | body { |
| | | overflow-y: hidden; |
| | | } |