| | |
| | | { |
| | | "appId": "201912101635586033882D350DED94BC08AB8", |
| | | "appkey": "2019120316231227060CDBAFCB3BF4582BBF8", |
| | | "appId": "202011020835217933120E25C41C54A8988AA", |
| | | "appkey": "20201102081641237BDDE0D5F2E98420BA7EC", |
| | | "mainSystemApi": "https://cloud.positecgroup.com/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "", |
| | | "externalDatabase": "mkdata_oms_test", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "", |
| | |
| | | "transfer": "false", |
| | | "keepPassword": "true", |
| | | "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], |
| | | "host": "https://css-test.positecgroup.com", |
| | | "service": "" |
| | | "host": "http://oms-test.positecgroup.com", |
| | | "service": "oms_new/" |
| | | } |
| | |
| | | > .card-item-box { |
| | | border-color: $color6!important; |
| | | background-color: $color1!important; |
| | | .ant-mk-text, .ant-mk-date { |
| | | .ant-mk-text:not(.sign-font) { |
| | | color: $color6; |
| | | } |
| | | } |
| | |
| | | .mk-card:hover, .mk-card.active, .mk-card.selected { |
| | | > .card-item-box { |
| | | border-color: $color6!important; |
| | | .ant-mk-text, .ant-mk-date { |
| | | .ant-mk-text:not(.sign-font) { |
| | | color: $color6; |
| | | } |
| | | } |
| | |
| | | } |
| | | .mk-card:hover { |
| | | > .card-item-box { |
| | | .ant-mk-text, .ant-mk-date { |
| | | .ant-mk-text:not(.sign-font) { |
| | | color: $color6; |
| | | } |
| | | } |
| | |
| | | .mk-card.active, .mk-card.selected { |
| | | > .card-item-box { |
| | | border-bottom-color: $color6!important; |
| | | .ant-mk-text, .ant-mk-date { |
| | | .ant-mk-text:not(.sign-font) { |
| | | color: $color6; |
| | | } |
| | | } |
| | |
| | | --mk-sys-font-color: rgba(0, 0, 0, 0.85); |
| | | --mk-sys-light-font-color: rgba(0, 0, 0, 0.65); |
| | | } |
| | | |
| | | body[class*='mk-blue-'] { |
| | | --mk-sys-color: #1890ff; |
| | | --mk-sys-color1: #e6f7ff; |
| | | --mk-sys-color5: #40a9ff; |
| | | @include viewstyle(#e6f7ff, #bae7ff, #91d5ff, #69c0ff, #40a9ff, #1890ff, #096dd9); |
| | | } |
| | | |
| | | body[class*='mk-red-'] { |
| | | --mk-sys-color: #f5222d; |
| | | --mk-sys-color1: #fff1f0; |
| | | --mk-sys-color5: #ff4d4f; |
| | | @include viewstyle(#fff1f0, #ffccc7, #ffa39e, #ff7875, #ff4d4f, #f5222d, #cf1322); |
| | | } |
| | | |
| | | body[class*='mk-orange-red-'] { |
| | | --mk-sys-color: #fa541c; |
| | | --mk-sys-color1: #fff2e8; |
| | | --mk-sys-color5: #ff7a45; |
| | | @include viewstyle(#fff2e8, #ffd8bf, #ffbb96, #ff9c6e, #ff7a45, #fa541c, #d4380d); |
| | | } |
| | | |
| | | body[class*='mk-orange-'] { |
| | | --mk-sys-color: #fa8c16; |
| | | --mk-sys-color1: #fff7e6; |
| | | --mk-sys-color5: #ffa940; |
| | | @include viewstyle(#fff7e6, #ffe7ba, #ffd591, #ffc069, #ffa940, #fa8c16, #d46b08); |
| | | } |
| | | |
| | | body[class*='mk-orange-yellow-'] { |
| | | --mk-sys-color: #faad14; |
| | | --mk-sys-color1: #fffbe6; |
| | | --mk-sys-color5: #ffc53d; |
| | | @include viewstyle(#fffbe6, #fff1b8, #ffe58f, #ffd666, #ffc53d, #faad14, #d48806); |
| | | } |
| | | |
| | | body[class*='mk-yellow-'] { |
| | | --mk-sys-color: #fadb14; |
| | | --mk-sys-color1: #feffe6; |
| | | --mk-sys-color5: #ffec3d; |
| | | @include viewstyle(#feffe6, #ffffb8, #fffb8f, #fff566, #ffec3d, #fadb14, #d4b106); |
| | | } |
| | | |
| | | body[class*='mk-yellow-green-'] { |
| | | --mk-sys-color: #a0d911; |
| | | --mk-sys-color1: #fcffe6; |
| | | --mk-sys-color5: #bae637; |
| | | @include viewstyle(#fcffe6, #f4ffb8, #eaff8f, #d3f261, #bae637, #a0d911, #7cb305); |
| | | } |
| | | |
| | | body[class*='mk-green-'] { |
| | | --mk-sys-color: #52c41a; |
| | | --mk-sys-color1: #f6ffed; |
| | | --mk-sys-color5: #73d13d; |
| | | @include viewstyle(#f6ffed, #d9f7be, #b7eb8f, #95de64, #73d13d, #52c41a, #389e0d); |
| | | } |
| | | |
| | | body[class*='mk-cyan-'] { |
| | | --mk-sys-color: #13c2c2; |
| | | --mk-sys-color1: #e6fffb; |
| | | --mk-sys-color5: #36cfc9; |
| | | @include viewstyle(#e6fffb, #b5f5ec, #87e8de, #5cdbd3, #36cfc9, #13c2c2, #08979c); |
| | | } |
| | | |
| | | body[class*='mk-blue-purple-'] { |
| | | --mk-sys-color: #2f54eb; |
| | | --mk-sys-color1: #f0f5ff; |
| | | --mk-sys-color5: #597ef7; |
| | | @include viewstyle(#f0f5ff, #d6e4ff, #adc6ff, #85a5ff, #597ef7, #2f54eb, #1d39c4); |
| | | } |
| | | |
| | | body[class*='mk-purple-'] { |
| | | --mk-sys-color: #722ed1; |
| | | --mk-sys-color1: #f9f0ff; |
| | | --mk-sys-color5: #9254de; |
| | | @include viewstyle(#f9f0ff, #efdbff, #d3adf7, #b37feb, #9254de, #722ed1, #531dab); |
| | | } |
| | | |
| | | body[class*='mk-magenta-'] { |
| | | --mk-sys-color: #eb2f96; |
| | | --mk-sys-color1: #fff0f6; |
| | | --mk-sys-color5: #f759ab; |
| | | @include viewstyle(#fff0f6, #ffd6e7, #ffadd2, #ff85c0, #f759ab, #eb2f96, #c41d7f); |
| | | } |
| | | |
| | | body[class*='mk-grass-green-'] { |
| | | --mk-sys-color: #aeb303; |
| | | --mk-sys-color1: #f2efda; |
| | | --mk-sys-color5: #bfbf22; |
| | | @include viewstyle(#f2efda, #e6de97, #d9d26c, #ccc845, #bfbf22, #aeb303, #838c00); |
| | | } |
| | | |
| | | body[class*='mk-deep-red-'] { |
| | | --mk-sys-color: #c32539; |
| | | --mk-sys-color1: #fff0f0; |
| | | --mk-sys-color5: #cf4856; |
| | | @include viewstyle(#fff0f0, #f5cbcb, #e89b9e, #db7077, #cf4856, #c32539, #9c162c); |
| | | } |
| | | |
| | | body[class*='mk-deep-blue-'] { |
| | | --mk-sys-color: #1d3661; |
| | | --mk-sys-color1: #eff1f4; |
| | | --mk-sys-color5: #394c6f; |
| | | @include viewstyle(#eff1f4, #e0e3e9, #dbdfe6, #c6cede, #394c6f, #1d3661, #1d3661); |
| | | } |
| | |
| | | |
| | | if (level === 'letter_num' && value && /^[0-9a-zA-Z!@#$%^&*()_]*$/.test(value) && /^([^0-9]*|[^a-zA-Z]*)$/.test(value)) { |
| | | callback('密码中必须含有数字和字母。') |
| | | } else if ((level === 'char_num' || level === 'char_num_90') && value && /^[0-9a-zA-Z!@#$%^&*()_]*$/.test(value) && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(value)) { |
| | | } else if ((level === 'char_num' || level === 'char_num_90' || level === 'char_num_90_sms') && value && /^[0-9a-zA-Z!@#$%^&*()_]*$/.test(value) && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(value)) { |
| | | callback('密码中必须含有数字、字母和特殊字符。') |
| | | } else { |
| | | callback() |
| | |
| | | url: '', |
| | | key: '', |
| | | visible: false, |
| | | apptoken: '', |
| | | setting: null |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | } |
| | | this.setState({key: key, setting: _setting}) |
| | | this.setState({key: key, apptoken: values.apptoken, setting: _setting}) |
| | | return |
| | | } |
| | | |
| | |
| | | |
| | | this.props.onChange(content) |
| | | |
| | | this.setState({setting: message, url: values.interface, visible: false}) |
| | | this.setState({setting: message, url: values.interface, apptoken: '', visible: false}) |
| | | |
| | | if (this.props.type !== 'develop') { |
| | | this.setState({key: ''}) |
| | |
| | | if (type === 'develop') { |
| | | this.setState({setting: null, url: ''}) |
| | | } else { |
| | | this.setState({key: '', setting: null, url: ''}) |
| | | this.setState({key: '', apptoken: '', setting: null, url: ''}) |
| | | } |
| | | |
| | | this.props.onChange('') |
| | |
| | | const { type } = this.props |
| | | |
| | | if (type !== 'develop') { |
| | | this.setState({key: ''}) |
| | | this.setState({key: '', apptoken: ''}) |
| | | } |
| | | this.setState({visible: false}) |
| | | } |
| | | |
| | | render() { |
| | | const { type } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { url, visible, setting, key } = this.state |
| | | const { url, visible, setting, key, apptoken } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-key-wrap"> |
| | |
| | | > |
| | | {key && setting ? |
| | | <Form> |
| | | {apptoken && type !== 'develop' ? <Form.Item style={{color: 'red'}} label="正式系统appkey"> |
| | | {apptoken} |
| | | </Form.Item> : null} |
| | | <Form.Item label="接口地址"> |
| | | {getFieldDecorator('interface', { |
| | | initialValue: setting.interface || 'http://******/webapi/dostars', |
| | |
| | | ] |
| | | })(<TextArea placeholder="http://sso.mk9h.cn/cloud/webapi/dostars" rows={2}/>)} |
| | | </Form.Item> |
| | | <Form.Item label="appkey"> |
| | | <Form.Item label="目标系统appkey"> |
| | | {getFieldDecorator('appkey', { |
| | | initialValue: setting.appkey || '', |
| | | rules: [ |
| | |
| | | </Form.Item> |
| | | </Form> : null} |
| | | {!key ? <Form style={{marginTop: '20px', marginBottom: '50px'}}> |
| | | <Form.Item label="appkey"> |
| | | <Form.Item label="正式系统appkey"> |
| | | {getFieldDecorator('apptoken', { |
| | | initialValue: '', |
| | | rules: [ |
| | |
| | | .ant-form-item { |
| | | display: flex; |
| | | .ant-form-item-label { |
| | | width: 20%; |
| | | width: 22%; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | width: 70%; |
| | |
| | | MkIcons[type](resProps) |
| | | ) |
| | | } else { |
| | | return <span className={'anticon anticon-mk ' + (resProps.className || '')} style={resProps.style || null} dangerouslySetInnerHTML={{ __html: type }}></span> |
| | | let svg = type |
| | | |
| | | if (!/<svg/.test(svg)) { |
| | | try { |
| | | svg = window.decodeURIComponent(window.atob(svg)) |
| | | if (!/<svg/.test(svg)) { |
| | | svg = '' |
| | | } |
| | | } catch (e) { |
| | | svg = '' |
| | | } |
| | | } |
| | | |
| | | return <span className={'anticon anticon-mk ' + (resProps.className || '')} style={resProps.style || null} dangerouslySetInnerHTML={{ __html: svg }}></span> |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | let supItem = fieldMap.get(key) |
| | | let fields = [] |
| | | |
| | | controlFields[key].forEach(item => { |
| | | if (!fieldMap.has(item.field)) return |
| | | |
| | |
| | | const { value, options, unit } = this.state |
| | | |
| | | return ( |
| | | <div className="style-input-wrap"> |
| | | <div className="mk-style-input-wrap"> |
| | | <Input value={value} addonAfter={ |
| | | options.length > 1 ? |
| | | <Select value={unit} onChange={this.changeUnit}> |
| | |
| | | .style-input-wrap { |
| | | .mk-style-input-wrap { |
| | | line-height: 32px; |
| | | .ant-select { |
| | | width: 60px!important; |
| | |
| | | .single-unit { |
| | | width: 38px; |
| | | text-align: left; |
| | | color: rgba(255, 255, 255, 0.65); |
| | | } |
| | | div[title="vh"], div[title="vw"] { |
| | | color: #1890ff; |
| | |
| | | const Iframe = asyncComponent(() => import('@/tabviews/iframe')) |
| | | const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) |
| | | const FormTab = asyncComponent(() => import('@/tabviews/formtab')) |
| | | const TabManage = asyncComponent(() => import('@/tabviews/tabmanage')) |
| | | |
| | | class TabViews extends Component { |
| | | static propTpyes = { |
| | |
| | | return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'FormTab') { |
| | | return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | } else if (view.type === 'TabManage') { |
| | | return (<TabManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | } else if (view.type === 'iframe') { |
| | | return (<Iframe key={view.MenuID} MenuID={view.MenuID} MenuNo={view.MenuNo} title={view.MenuName} MenuName={view.MenuName} url={window.GLOB.baseurl + 'zh-CN/' + view.LinkUrl}/>) |
| | | } else { |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | _style_ = {clear: 'left'} |
| | | } |
| | | |
| | | let className = card.width || '' |
| | | if (card.hidden === 'true') { |
| | | className += ' mk-hidden' |
| | | } |
| | | if (card.checkType) { |
| | | className += ' ' + card.checkType |
| | | } |
| | | |
| | | return ( |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | |
| | | {hasProfile ? <ProfileOutlined className="profile" title="setting" onClick={() => profileCard(id)} /> : null} |
| | | </div> |
| | | } trigger="hover"> |
| | | <div ref={node => drag(drop(node))} style={_style_} className={'ant-col card-button-cell ant-col-' + card.width + (card.hidden === 'true' ? ' mk-hidden' : '')} onDoubleClick={(e) => {e.stopPropagation(); doubleClickCard(id)}}> |
| | | <div ref={node => drag(drop(node))} style={_style_} className={'ant-col card-button-cell ant-col-' + className} onDoubleClick={(e) => {e.stopPropagation(); doubleClickCard(id)}}> |
| | | <div style={{opacity: isDragging ? 0.3 : 1, ...card.wrapStyle}}> |
| | | {btnElement} |
| | | </div> |
| | |
| | | } |
| | | } |
| | | .ant-checkbox .ant-checkbox-inner { |
| | | border-color: #b8b8b8; |
| | | } |
| | | } |
| | | .card-button-cell:not(.square) { |
| | | .ant-checkbox .ant-checkbox-inner { |
| | | border-radius: 15px; |
| | | } |
| | | .ant-checkbox-checked::after { |
| | | border-radius: 15px; |
| | | } |
| | | } |
| | |
| | | <div className="mk-popover-control"> |
| | | <PlusOutlined className="plus" title="添加元素" onClick={this.addElement} /> |
| | | <PlusSquareOutlined className="plus" title="添加按钮" onClick={this.addButton} /> |
| | | <NormalForm title="卡片设置" width={950} update={this.updateSetting} getForms={this.getSettingForms}> |
| | | <NormalForm title={cards.subtype === 'datacard' && card.$cardType !== 'extendCard' ? '循环卡片设置' : '属性卡片设置'} width={950} update={this.updateSetting} getForms={this.getSettingForms}> |
| | | <EditOutlined className="edit" title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="cardcell" card={card}/> |
| | |
| | | {card.setting.type === 'multi' ? <Switch size="small" onClick={this.changeSide} defaultChecked /> : null} |
| | | </div> |
| | | } trigger="hover"> |
| | | <ToolOutlined /> |
| | | <ToolOutlined style={cards.subtype === 'datacard' && card.$cardType === 'extendCard' ? {color: '#26C281'} : null}/> |
| | | </Popover> |
| | | </div> |
| | | </div> |
| | |
| | | forbid: subtype !== 'propcard' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'bgField', |
| | | label: '背景图', |
| | | initval: setting.bgField || '', |
| | | tooltip: '动态背景,背景图片由字段值控制。请注意调整背景样式。', |
| | | required: false, |
| | | options: columns |
| | | }, |
| | | { |
| | | type: ops.length === 0 ? 'radio' : 'select', |
| | | field: 'click', |
| | | label: '点击事件', |
| | |
| | | marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' |
| | | }, |
| | | backStyle: {}, |
| | | elements: [], |
| | | elements: [{ |
| | | uuid: Utils.getuuid(), |
| | | eleType: 'text', |
| | | datatype: 'static', |
| | | value: '循环区域' |
| | | }], |
| | | backElements: [], |
| | | menus: [] |
| | | }] |
| | |
| | | options: [ |
| | | {value: 'page', label: '页码'}, |
| | | {value: 'switch', label: '左右切换', forbid: appType === 'mob' || subtype === 'tablecard'}, |
| | | {value: 'slide', label: '滑动加载', forbid: appType !== 'mob'}, |
| | | {value: 'slide', label: '滑动加载', forbid: appType !== 'mob' || sessionStorage.getItem('editMenuType') === 'popview'}, |
| | | {value: 'more', label: '查看更多'}, |
| | | ], |
| | | controlFields: [ |
| | |
| | | forbid: subtype !== 'propcard' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'selected', |
| | | label: '数据选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行(当按钮执行完成并返回主键值时,默认选中主键值对应行)。选中标记:返回数据中存在 selected 字段,且值为 true 的数据被选中。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | {value: 'sign', label: '选中标记'} |
| | | ], |
| | | forbid: subtype !== 'datacard' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'selected', |
| | | label: '首行选中', |
| | | label: '数据选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '当按钮执行完成并返回主键值时,默认选中主键值对应行。', |
| | | tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | ], |
| | | forbid: subtype === 'tablecard' |
| | | forbid: subtype !== 'propcard' |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | label: '节点颜色', |
| | | initval: card.nodeColor || '#1890ff', |
| | | tooltip: '右侧节点的标记颜色。', |
| | | isHex: true, |
| | | colorType: 'hex', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | label: '左节点颜色', |
| | | initval: card.leftColor || '#26C281', |
| | | tooltip: '左侧节点的标记颜色。', |
| | | isHex: true, |
| | | colorType: 'hex', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | purple: '#722ed1', |
| | | magenta: '#eb2f96', |
| | | grass_green: '#aeb303', |
| | | deep_red: '#c32539' |
| | | deep_red: '#c32539', |
| | | deep_blue: '#1d3661' |
| | | } |
| | | |
| | | let systemColor = '#1890ff' |
| | |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | import { Table } from 'antd' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import '@/assets/css/table.scss' |
| | | import './index.scss' |
| | | |
| | | class BodyRow extends React.Component { |
| | |
| | | { |
| | | type: 'radio', |
| | | field: 'drawerPlacement', |
| | | label: '抽屉方向', |
| | | label: '弹出方向', |
| | | initval: wrap.drawerPlacement || 'right', |
| | | required: false, |
| | | options: [ |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'hidden'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'width', 'hidden'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'hidden'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'maskStyle', 'closeButton', 'hidden'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], |
| | |
| | | if (this.record.formType === 'switch') { |
| | | shows.push('field', 'size', 'openVal', 'closeVal', 'openText', 'closeText') |
| | | } else if (this.record.formType === 'radio') { |
| | | shows.push('field', 'openVal', 'closeVal') |
| | | shows.push('field', 'checkType', 'openVal', 'closeVal') |
| | | } else { |
| | | shows.push('field') |
| | | } |
| | |
| | | } else if (openType === 'popview') { |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | |
| | | if (this.record.display === 'drawer') { |
| | | if (appType === 'mob') { |
| | | shows.push('placement') |
| | | } else if (this.record.display === 'drawer') { |
| | | shows.push('placement') |
| | | } |
| | | if (this.record.popClose === 'grid') { |
| | |
| | | } |
| | | } |
| | | if (appType === 'mob') { |
| | | opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'excelOut', 'innerpage', 'funcbutton'].includes(item.value)) |
| | | opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'excelOut', 'popview', 'innerpage', 'funcbutton'].includes(item.value)) |
| | | funTypes = [ |
| | | { value: 'print', text: '标签打印' }, |
| | | { value: 'scan', text: '扫码' }, |
| | |
| | | }, { |
| | | value: 'drawer', |
| | | text: '抽屉' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'ratio', |
| | | min: 1, |
| | | max: 3000, |
| | | precision: 0, |
| | | label: '比例', |
| | | initVal: card.ratio || 85, |
| | | tooltip: '模态框或抽屉的宽度,小于100为窗口宽度(或高度)百分比,大于100为像素值。', |
| | | required: true |
| | | }], |
| | | forbid: appType === 'mob', |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'placement', |
| | | label: '抽屉方向', |
| | | label: '弹出方向', |
| | | initVal: card.placement || 'right', |
| | | required: false, |
| | | options: [{ |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'ratio', |
| | | min: 1, |
| | | max: 3000, |
| | | precision: 0, |
| | | label: '比例', |
| | | initVal: card.ratio || 85, |
| | | tooltip: '模态框或抽屉的宽度,小于100为窗口宽度(或高度)百分比,大于100为像素值。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'clickouter', |
| | | label: '点击蒙层', |
| | |
| | | value: 'close', |
| | | text: '关闭' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'maskStyle', |
| | | label: '蒙层样式', |
| | | initVal: card.maskStyle || 'default', |
| | | required: false, |
| | | options: [{ |
| | | value: 'default', |
| | | text: '默认' |
| | | }, { |
| | | value: 'transparent', |
| | | text: '透明' |
| | | }], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'closeButton', |
| | | label: '关闭按钮', |
| | | initVal: card.closeButton || 'false', |
| | | required: false, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '隐藏' |
| | | }, { |
| | | value: 'true', |
| | | text: '显示' |
| | | }], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | }, { |
| | | value: 'small', |
| | | text: '小' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'checkType', |
| | | label: '选框样式', |
| | | initVal: card.checkType || 'circle', |
| | | options: [{ |
| | | value: 'circle', |
| | | text: '圆角' |
| | | }, { |
| | | value: 'square', |
| | | text: '方角' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'placement', |
| | | label: '抽屉方向', |
| | | label: '弹出方向', |
| | | initVal: card.placement || 'right', |
| | | required: false, |
| | | options: [{ |
| | |
| | | import MarkForm from './markform' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import { minkeIconSystem } from '@/utils/option.js' |
| | | import '@/assets/css/table.scss' |
| | | import './index.scss' |
| | | |
| | | const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | type: 'select', |
| | | field: 'selected', |
| | | label: '首行选中', |
| | | label: '数据选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '当按钮执行完成并返回主键值时,默认选中主键值对应行。', |
| | | tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行(当按钮执行完成并返回主键值时,默认选中主键值对应行)。选中标记:返回数据中存在 selected 字段,且值为 true 的数据被选中。注:启用无人值守时无效。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | ] |
| | | {value: 'sign', label: '选中标记'} |
| | | ], |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // field: 'selected', |
| | | // label: '首行选中', |
| | | // initval: wrap.selected || 'false', |
| | | // tooltip: '当按钮执行完成并返回主键值时,默认选中主键值对应行。', |
| | | // required: false, |
| | | // options: [ |
| | | // {value: 'false', label: '无'}, |
| | | // {value: 'init', label: '初始化'}, |
| | | // {value: 'always', label: '数据加载'}, |
| | | // ] |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | field: 'tableMode', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | type: 'select', |
| | | field: 'selected', |
| | | label: '首行选中', |
| | | label: '数据选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '当按钮执行完成并返回主键值时,默认选中主键值对应行。', |
| | | tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行(当按钮执行完成并返回主键值时,默认选中主键值对应行)。选中标记:返回数据中存在 selected 字段,且值为 true 的数据被选中。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | ] |
| | | {value: 'sign', label: '选中标记'} |
| | | ], |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // field: 'selected', |
| | | // label: '首行选中', |
| | | // initval: wrap.selected || 'false', |
| | | // tooltip: '当按钮执行完成并返回主键值时,默认选中主键值对应行。', |
| | | // required: false, |
| | | // options: [ |
| | | // {value: 'false', label: '无'}, |
| | | // {value: 'init', label: '初始化'}, |
| | | // {value: 'always', label: '数据加载'}, |
| | | // ] |
| | | // }, |
| | | // { |
| | | // type: 'radio', |
| | | // field: 'show', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | if (_loading) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | message: '存在未保存脚本!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | |
| | | let _search = defSearch |
| | | |
| | | if (setting.queryType === 'statistics' && _dataresource) { |
| | | if (_dataresource) { |
| | | _regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, '0') |
| | | }) |
| | |
| | | let options = ['tabs', 'timeline', 'datacard', 'propcard', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter', 'iframe', 'sandbox'] |
| | | |
| | | if (appType === 'mob') { |
| | | options.push('menubar', 'topbar') |
| | | if (sessionStorage.getItem('editMenuType') !== 'popview') { |
| | | options.push('menubar', 'topbar') |
| | | } else { |
| | | options.push('menubar') |
| | | } |
| | | } else { |
| | | options.push('editable', 'antvG6') |
| | | } |
| | |
| | | |
| | | const presetColors = [ |
| | | '#1890ff', '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#2f54eb', '#722ed1', |
| | | '#eb2f96', '#aeb303', '#c32539', '#ffbb96', '#ffd591', '#ffe58f', '#fffb8f', '#eaff8f', '#b7eb8f', '#87e8de', '#91d5ff', |
| | | '#eb2f96', '#aeb303', '#c32539', '#1d3661', '#ffd591', '#ffe58f', '#fffb8f', '#eaff8f', '#b7eb8f', '#87e8de', '#91d5ff', |
| | | '#adc6ff', '#d3adf7', '#EBE9E9', '#d9d9d9', '#434343', '#000000', '#ffffff', 'transparent' |
| | | ] |
| | | |
| | |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ] |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | ] |
| | | |
| | |
| | | _style.height = card.wrap.height |
| | | |
| | | return ( |
| | | <div className="normal-navbar-edit-box" style={_style} id={card.uuid}> |
| | | <div className={'normal-navbar-edit-box ' + (card.wrap.menuStyle || '')} style={_style} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <PlusOutlined className="plus" title="添加菜单" onClick={() => MKEmitter.emit('addmobmenu')}/> |
| | |
| | | margin-bottom: 0; |
| | | } |
| | | } |
| | | .am-tab-bar-tab.tab-zoomIn { |
| | | .am-tab-bar-tab-icon { |
| | | padding: 10px; |
| | | display: inline-block; |
| | | background: #1890ff; |
| | | color: #ffffff; |
| | | border-radius: 40px; |
| | | width: 42px; |
| | | height: 42px; |
| | | font-size: 15px; |
| | | transform: translate(0px, -25px); |
| | | } |
| | | .am-tab-bar-tab-title { |
| | | font-size: 1.2em; |
| | | color: #1890ff; |
| | | transform: translate(0px, -22px); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | .anticon-tool { |
| | |
| | | background: rgba(255, 255, 255, 0.55); |
| | | } |
| | | } |
| | | |
| | | .normal-navbar-edit-box:not(.class1) { |
| | | .menu .am-tab-bar-tab.tab-zoomIn { |
| | | .am-tab-bar-tab-icon { |
| | | padding: 10px; |
| | | display: inline-block; |
| | | background: #1890ff; |
| | | color: #ffffff; |
| | | border-radius: 40px; |
| | | width: 42px; |
| | | height: 42px; |
| | | font-size: 15px; |
| | | transform: translate(0px, -25px); |
| | | } |
| | | .am-tab-bar-tab-title { |
| | | font-size: 1.2em; |
| | | color: #1890ff; |
| | | transform: translate(0px, -22px); |
| | | } |
| | | } |
| | | } |
| | | .normal-navbar-edit-box.class1 { |
| | | background-color: #1890ff!important; |
| | | border-top-left-radius: 40px; |
| | | border-top-right-radius: 40px; |
| | | .am-tab-bar-tab-icon { |
| | | color: #ffffff; |
| | | position: relative; |
| | | top: 5px; |
| | | } |
| | | .menu .am-tab-bar-tab .anticon { |
| | | font-size: 20px; |
| | | } |
| | | .am-tab-bar-tab-title { |
| | | display: none; |
| | | } |
| | | } |
| | | .normal-navbar-edit-box::after { |
| | | display: block; |
| | | content: ' '; |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | type: 'styleInput', |
| | | field: 'height', |
| | | label: '高度', |
| | | initval: wrap.height || 50, |
| | | min: 30, |
| | | max: 200, |
| | | precision: 0, |
| | | required: true |
| | | required: true, |
| | | options: ['px'] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'switch', |
| | | label: '切换方式', |
| | | initval: wrap.switch || 'default', |
| | | tooltip: '默认时在H5中会切换页面,APP中会切换标签页,使用标签页时会强制使用标签切换。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'default', label: '默认'}, |
| | | {value: 'tab', label: '标签页'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'position', values: ['tab']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'position', |
| | | label: '菜单位置', |
| | | initval: wrap.position || 'bottom', |
| | | required: false, |
| | | options: [ |
| | | {value: 'bottom', label: '底部'}, |
| | | {value: 'left', label: '左侧'}, |
| | | {value: 'right', label: '右侧'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'marginTop', values: ['left', 'right']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'menuStyle', |
| | | label: '菜单样式', |
| | | initval: wrap.menuStyle || 'default', |
| | | tooltip: '使用APP中原生菜单栏时无效。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'default', label: '默认'}, |
| | | {value: 'class1', label: '样式二'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'styleInput', |
| | | field: 'marginTop', |
| | | label: '顶部缩进', |
| | | initval: wrap.marginTop || '', |
| | | required: false, |
| | | options: ['px', 'vh'] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | field: 'color', |
| | | label: '颜色', |
| | | initval: wrap.color || '#000000', |
| | | isHex: true, |
| | | colorType: 'hex', |
| | | required: true |
| | | }, |
| | | ] |
| | |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ] |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | ] |
| | | |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { components } = this.props |
| | | const { components, viewType } = this.props |
| | | let options = [] |
| | | |
| | | if (components) { |
| | |
| | | } |
| | | } |
| | | |
| | | if (viewType === 'popview') { |
| | | options = options.filter(item => !['topbar', 'navbar', 'login', 'officialAccount'].includes(item.component)) |
| | | } |
| | | |
| | | this.setState({ |
| | | menuOptions: options |
| | | }) |
| | |
| | | // margin-top: 45px; |
| | | .login-form-button { |
| | | width: 100%; |
| | | height: 40px; |
| | | height: 42px; |
| | | line-height: 1; |
| | | font-size: 18px; |
| | | margin-bottom: 15px; |
| | |
| | | } |
| | | .sign-form-button { |
| | | width: 100%; |
| | | height: 40px; |
| | | height: 42px; |
| | | line-height: 1; |
| | | font-size: 18px; |
| | | margin-bottom: 15px; |
| | |
| | | <Form.Item> |
| | | <Input |
| | | prefix={<UserOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} |
| | | placeholder="用户名" |
| | | placeholder="用户名/手机号/邮箱" |
| | | autoComplete="off" |
| | | /> |
| | | </Form.Item> |
| | |
| | | { |
| | | type: 'styleInput', |
| | | field: 'height', |
| | | label: '高度', |
| | | label: '最小高度', |
| | | initval: wrap.height || '', |
| | | tooltip: '组件占用的最小高度,用于页面布局。', |
| | | required: false, |
| | | options: ['px', 'vh', 'vw', '%'] |
| | | }, |
| | | // { |
| | | // type: 'styleInput', |
| | | // field: 'maxWidth', |
| | | // label: '最大宽度', |
| | | // initval: wrap.maxWidth || '', |
| | | // tooltip: '组件占用的最大宽度,用于页面布局。', |
| | | // required: false, |
| | | // options: ['px', 'vh', 'vw', '%'] |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | field: 'topTip', |
| | |
| | | bg_white_style_grass_green: 'mk-grass-green-white', |
| | | bg_black_style_deep_red: 'mk-deep-red-black', |
| | | bg_white_style_deep_red: 'mk-deep-red-white', |
| | | bg_black_style_deep_blue: 'mk-deep-blue-black', |
| | | bg_white_style_deep_blue: 'mk-deep-blue-white', |
| | | } |
| | |
| | | |
| | | render() { |
| | | const { card, data, cards } = this.props |
| | | let style = {...card.style} |
| | | |
| | | if (card.setting.bgField) { |
| | | style.backgroundImage = `url('${data[card.setting.bgField] || ''}')` |
| | | } |
| | | |
| | | return ( |
| | | <div className={'card-item-box ' + (card.setting.btnControl || '')} style={card.style} onClick={this.openView} onDoubleClick={this.doubleClick}> |
| | | <div className={'card-item-box ' + (card.setting.btnControl || '')} style={style} onClick={this.openView} onDoubleClick={this.doubleClick}> |
| | | <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.elements}/> |
| | | {card.setting.type === 'multi' ? <div className={'back-side ' + card.setting.transform} style={card.backStyle}> |
| | | <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.backElements}/> |
| | |
| | | |
| | | if (card.eleType === 'sequence') { |
| | | let _style = {} |
| | | let className = '' |
| | | if (card.marks) { |
| | | _style.width = card.innerHeight |
| | | _style.height = card.innerHeight |
| | |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | | _style = mark.style |
| | | className = mark.signType |
| | | } |
| | | contents.push( |
| | | <Col key={card.uuid} style={_style_} span={card.width}> |
| | | <div style={card.style}> |
| | | <div className="ant-mk-text line1" style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> |
| | | <div className={'ant-mk-text line1' + className} style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | } |
| | | } |
| | | |
| | | let className = '' |
| | | if (card.marks) { |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | className = mark.signType |
| | | } |
| | | |
| | | if (card.link || (card.anchors && card.anchors.length > 0)) { |
| | |
| | | contents.push( |
| | | <Col key={card.uuid} style={_style_} span={card.width}> |
| | | <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | } |
| | | } |
| | | |
| | | let className = '' |
| | | if (card.marks) { |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | className = mark.signType |
| | | } |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} style={_style_} span={card.width}> |
| | | <div style={_style}> |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | } |
| | | } |
| | | |
| | | let className = '' |
| | | if (card.marks) { |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | className = mark.signType |
| | | } |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} style={_style_} span={card.width}> |
| | | <div style={_style}> |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | padding: 0; |
| | | overflow: hidden; |
| | | } |
| | | .ant-checkbox-inner, .ant-checkbox-checked::after { |
| | | border-radius: 15px; |
| | | .ant-checkbox-wrapper:not(.square) { |
| | | .ant-checkbox-inner, .ant-checkbox-checked::after { |
| | | border-radius: 15px; |
| | | } |
| | | } |
| | | .ant-checkbox-inner { |
| | | border-color: #b8b8b8; |
| | | } |
| | | } |
| | | .ant-mk-slider { |
| | |
| | | } |
| | | |
| | | let selected = 'false' |
| | | if (_config.wrap.selected === 'always' || _config.wrap.selected === 'init') { |
| | | if (_config.wrap.selected === 'always' || _config.wrap.selected === 'init' || _config.wrap.selected === 'sign') { |
| | | selected = _config.wrap.selected |
| | | } else { |
| | | _config.wrap.selected = 'false' |
| | |
| | | } |
| | | |
| | | checkTopLine = (id) => { |
| | | const { config, data } = this.state |
| | | const { config, data, selected } = this.state |
| | | |
| | | if (!data || data.length === 0) { |
| | | this.setState({ |
| | | activeKey: '', |
| | | selectKeys: [], |
| | | selectedData: [] |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | if (config.setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [], false) |
| | | } |
| | | return |
| | | } |
| | | |
| | | if (selected === 'sign') { |
| | | let index = '' |
| | | let keys = [] |
| | | let items = [] |
| | | let last = '' |
| | | data.forEach((item, i) => { |
| | | if (!item.$disabled && item.selected === 'true') { |
| | | items.push(item) |
| | | keys.push(i) |
| | | index = i |
| | | last = item |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | activeKey: index, |
| | | selectKeys: keys, |
| | | selectedData: items |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, last ? last.$$uuid : '', last) |
| | | if (config.setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, items, data.length === keys.length) |
| | | } |
| | | return |
| | | } |
| | | |
| | | let index = 0 |
| | | if (id && data) { |
| | | if (id) { |
| | | index = data.findIndex(item => item.$$uuid === id) |
| | | if (index === -1) { |
| | | index = 0 |
| | | } |
| | | } |
| | | |
| | | if (!data || data.length === 0 || data[index].$disabled) { |
| | | if (data[index].$disabled) { |
| | | this.setState({ |
| | | activeKey: '', |
| | | selectKeys: [], |
| | |
| | | >.card-item-box { |
| | | cursor: not-allowed; |
| | | color: #bcbcbc; |
| | | .ant-mk-text, .ant-mk-date, .anticon { |
| | | .ant-mk-text, .anticon { |
| | | color: #bcbcbc!important; |
| | | span { |
| | | color: #bcbcbc!important; |
| | |
| | | purple: '#722ed1', |
| | | magenta: '#eb2f96', |
| | | grass_green: '#aeb303', |
| | | deep_red: '#c32539' |
| | | deep_red: '#c32539', |
| | | deep_blue: '#1d3661' |
| | | } |
| | | |
| | | let systemColor = '#1890ff' |
| | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import '@/assets/css/table.scss' |
| | | import './index.scss' |
| | | |
| | | class BodyRow extends React.Component { |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | data: [], |
| | | edData: [], |
| | | edColumns: [], |
| | |
| | | if (res && res.ErrCode === 'S') { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.ErrMesg || this.state.dict['main.action.confirm.success'], |
| | | message: res.ErrMesg || '执行成功', |
| | | duration: submit.stime ? submit.stime : 2 |
| | | }) |
| | | } else if (res && res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.ErrMesg || this.state.dict['main.action.confirm.success'] |
| | | title: res.ErrMesg || '执行成功' |
| | | }) |
| | | } else if (res && res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | disableAdd: false, |
| | | disableSave: false, |
| | | typeOptions: [], |
| | | charType: '', |
| | | charInt: '', |
| | | vouDate: null, |
| | | book: null |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | |
| | | let typeOptions = res.char || [] |
| | | |
| | | this.setState({ |
| | | typeOptions: typeOptions, |
| | | charType: typeOptions[0] ? typeOptions[0].voucher_class : '', |
| | | charInt: typeOptions[0] ? typeOptions[0].voucher_char_int : '', |
| | | }) |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | changeVoucherDate = () => { |
| | | |
| | | } |
| | | |
| | | render() { |
| | | const { config, disableSave, disableAdd, typeOptions, data } = this.state |
| | | const { config, disableSave, disableAdd, typeOptions, charType, charInt, data } = this.state |
| | | |
| | | return ( |
| | | <div className="menu-voucher-wrap" style={config.style}> |
| | |
| | | {config.wrap.type === 'edit' ? <div className="voucher-body"> |
| | | <div className="pre-wrap"> |
| | | <div className="voucher-code"> |
| | | <Select dropdownClassName="mk-vcode-dropdown"> |
| | | <Select value={charType} dropdownClassName="mk-vcode-dropdown" onChange={(val, option) => this.setState({charType: val, charInt: option.props.charInt})}> |
| | | {typeOptions.map(option => |
| | | <Select.Option value={option.value}>{option.label}</Select.Option> |
| | | <Select.Option value={option.voucher_class} charInt={option.voucher_char_int}>{option.voucher_char}</Select.Option> |
| | | )} |
| | | </Select> |
| | | <Input autoComplete="off" /> 号 |
| | | <Input value={charInt} autoComplete="off" onChange={(e) => this.setState({charInt: e.target.value})}/> 号 |
| | | </div> |
| | | <div className="voucher-date"> |
| | | 日期:<DatePicker onChange={this.onChange}/> |
| | | 日期:<DatePicker onChange={this.changeVoucherDate}/> |
| | | </div> |
| | | <div className="voucher-affix"> |
| | | 附单据 <Input autoComplete="off" /> 张 |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import '@/assets/css/table.scss' |
| | | import './index.scss' |
| | | |
| | | class BodyRow extends React.Component { |
| | |
| | | import { getMark } from '@/utils/utils.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import Encrypts from '@/components/encrypts' |
| | | import '@/assets/css/table.scss' |
| | | import './index.scss' |
| | | |
| | | const { Paragraph } = Typography |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | tableId: '', // 表格ID |
| | | selectedRowKeys: [], // 表格中选中行 |
| | | pageIndex: 1, // 初始页面索引 |
| | |
| | | this.props.refreshdata({pageIndex}) |
| | | } |
| | | |
| | | mkCheckTopLine = (menuId, id) => { |
| | | mkCheckTopLine = (menuId, id, type) => { |
| | | const { MenuID, data, setting } = this.props |
| | | |
| | | if (MenuID !== menuId || !data || data.length === 0) return |
| | | |
| | | if (type === 'sign') { |
| | | let index = '' |
| | | let keys = [] |
| | | let items = [] |
| | | data.forEach((item, i) => { |
| | | if (!item.$disabled && item.selected === 'true') { |
| | | items.push(item) |
| | | keys.push(i) |
| | | index = i |
| | | } |
| | | }) |
| | | |
| | | this.changedata(index) |
| | | this.setState({ selectedRowKeys: keys, activeIndex: index }) |
| | | this.props.chgSelectData(items) |
| | | |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', MenuID, items, data.length === keys.length) |
| | | } |
| | | return |
| | | } |
| | | |
| | | let index = 0 |
| | | if (id) { |
| | |
| | | /** |
| | | * |
| | | */ |
| | | onSelectChange = selectedRowKeys => { |
| | | onSelectChange = (selectedRowKeys, e) => { |
| | | const { setting, MenuID, data } = this.props |
| | | |
| | | let index = '' |
| | |
| | | pageSizeOptions: pageOptions, |
| | | showSizeChanger: true, |
| | | total: this.props.total || 0, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} ${this.state.dict['main.pagination.of']} ${total} ${this.state.dict['main.pagination.items']}` |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条` |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let height = setting.height || false |
| | | let loading = this.props.loading |
| | | if (setting.mask === 'hidden') { |
| | | loading = false |
| | | } |
| | | |
| | | return ( |
| | | <div className={`normal-custom-table ${setting.tableHeader || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''}`} id={tableId}> |
| | |
| | | rowSelection={rowSelection} |
| | | columns={this.state.columns} |
| | | dataSource={_data} |
| | | loading={this.props.loading} |
| | | loading={loading} |
| | | scroll={{ x: '100%', y: height }} |
| | | onRow={(record, index) => { |
| | | return { |
| | |
| | | table tbody tr { |
| | | color: var(--mk-table-color); |
| | | } |
| | | // table tbody { |
| | | // tr:nth-child(even) { |
| | | // background: #f5f5f5; |
| | | // } |
| | | // } |
| | | } |
| | | .normal-custom-table:not(.fixed-height) { |
| | | .ant-table-body::-webkit-scrollbar { |
| | |
| | | |
| | | let setting = {..._config.setting, ..._config.wrap} |
| | | |
| | | if (setting.selected !== 'always' && setting.selected !== 'init') { |
| | | if (setting.selected !== 'always' && setting.selected !== 'init' && setting.selected !== 'sign') { |
| | | setting.selected = 'false' |
| | | } else { |
| | | setting.orisel = true |
| | |
| | | if (result.status) { |
| | | if ((setting.selected !== 'false' || (setting.orisel && id)) && result.data && result.data.length > 0) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkCheckTopLine', config.uuid, id) |
| | | MKEmitter.emit('mkCheckTopLine', config.uuid, id, setting.selected) |
| | | }, 200) |
| | | if (setting.selected === 'init') { |
| | | this.setState({setting: {...setting, selected: 'false'}}) |
| | |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import CusSwitch from './cusSwitch' |
| | | import Encrypts from '@/components/encrypts' |
| | | import '@/assets/css/table.scss' |
| | | import './index.scss' |
| | | |
| | | const { Paragraph } = Typography |
| | |
| | | |
| | | let setting = {..._config.setting, ..._config.wrap} |
| | | |
| | | if (setting.selected !== 'always' && setting.selected !== 'init') { |
| | | if (setting.selected !== 'always' && setting.selected !== 'init' && setting.selected !== 'sign') { |
| | | setting.selected = 'false' |
| | | } else { |
| | | setting.orisel = true |
| | |
| | | |
| | | if (setting.selected !== 'false' && _data && _data.length > 0) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkCheckTopLine', _config.uuid) |
| | | MKEmitter.emit('mkCheckTopLine', _config.uuid, '', setting.selected) |
| | | }, 200) |
| | | if (setting.selected === 'init') { |
| | | setting.selected = 'false' |
| | |
| | | if (result.status) { |
| | | if ((setting.selected !== 'false' || (setting.orisel && id)) && result.data && result.data.length > 0) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkCheckTopLine', config.uuid, id) |
| | | MKEmitter.emit('mkCheckTopLine', config.uuid, id, setting.selected) |
| | | }, 200) |
| | | if (setting.selected === 'init') { |
| | | this.setState({setting: {...setting, selected: 'false'}}) |
| | |
| | | |
| | | if (setting.selected !== 'false' && _data && _data.length > 0) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkCheckTopLine', config.uuid) |
| | | MKEmitter.emit('mkCheckTopLine', config.uuid, '', setting.selected) |
| | | }, 200) |
| | | if (setting.selected === 'init') { |
| | | this.setState({setting: {...setting, selected: 'false'}}) |
| | |
| | | <div className="button-list toolbar-button" id={fixed ? MenuID + 'mainaction' : ''}> |
| | | {this.getButtonList(actions)} |
| | | {mores ? <Dropdown overlay={<div className="mk-button-dropdown-wrap">{this.getButtonList(mores)}</div>} trigger={['hover']}> |
| | | <div className="mk-more">更多<DownOutlined/></div> |
| | | <div className="mk-button-more">更多<DownOutlined/></div> |
| | | </Dropdown> : null} |
| | | </div> |
| | | </Affix> |
| | |
| | | <div className="button-list toolbar-button" id={fixed ? MenuID + 'mainaction' : ''}> |
| | | {this.getButtonList(actions)} |
| | | {mores ? <Dropdown overlay={<div className="mk-button-dropdown-wrap">{this.getButtonList(mores)}</div>} trigger={['hover']}> |
| | | <div className="mk-more">更多<DownOutlined/></div> |
| | | <div className="mk-button-more">更多<DownOutlined/></div> |
| | | </Dropdown> : null} |
| | | </div> |
| | | ) |
| | |
| | | display: none; |
| | | } |
| | | } |
| | | .mk-more { |
| | | .mk-button-more { |
| | | display: inline-block; |
| | | height: 28px; |
| | | border: 1px solid #d8d8d8; |
| | |
| | | } |
| | | |
| | | // 添加数据中字段,表单值优先(按钮不选行或多行拼接时跳过) |
| | | if (data && btn.Ot !== 'notRequired' && btn.Ot !== 'requiredOnce' && columns && columns.length > 0) { |
| | | if (data && btn.Ot !== 'notRequired' && columns && columns.length > 0) { |
| | | datavars = {...data, ...datavars} |
| | | |
| | | const setField = (col) => { |
| | |
| | | if (btn.formType === 'switch') { |
| | | return <Switch loading={loading} checked={check} disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} onChange={(val,e) => {e.stopPropagation();this.actionTrigger()}} style={btn.style} className={btn.size === 'large' ? 'ant-switch-large' : ''} size={btn.size} checkedChildren={btn.openText || ''} unCheckedChildren={btn.closeText || ''}/> |
| | | } else if (btn.formType === 'radio') { |
| | | return <Checkbox disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} checked={check} onChange={(e) => {e.stopPropagation();this.actionTrigger()}} style={btn.style}></Checkbox> |
| | | return <Checkbox className={btn.checkType || ''} disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} checked={check} onChange={(e) => {e.stopPropagation();this.actionTrigger()}} style={btn.style}></Checkbox> |
| | | } else { |
| | | return <Button type="link" icon="scan" disabled={true} style={btn.style} onClick={(e) => {e.stopPropagation()}}></Button> |
| | | } |
| | |
| | | handleChange = (color) => { |
| | | let _color = `rgba(${ color.rgb.r }, ${ color.rgb.g }, ${ color.rgb.b }, ${ color.rgb.a })` |
| | | |
| | | if (!this.props.config.isHex) { |
| | | if (this.props.config.colorType !== 'hex') { |
| | | this.setState({ color: _color }, () => { |
| | | this.props.onChange(_color) |
| | | }) |
| | |
| | | display: block; |
| | | } |
| | | } |
| | | // table tbody { |
| | | // tr:nth-child(even) { |
| | | // background: #f9f9f9; |
| | | // } |
| | | // } |
| | | } |
| | | .image-scale-modal { |
| | | width: 70vw; |
| | |
| | | import { Form, Row, Col, Button, notification, Modal, Drawer } from 'antd' |
| | | import { CloseOutlined, DownOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import options from '@/store/options.js' |
| | |
| | | } |
| | | |
| | | record = {} |
| | | sign = '' |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, searchlist, setting } = this.props |
| | |
| | | } |
| | | } |
| | | |
| | | let sign = md5(JSON.stringify(searches)) |
| | | |
| | | if (sign === this.sign) return |
| | | |
| | | this.sign = sign |
| | | setTimeout(() => { |
| | | this.sign = '' |
| | | }, 2000) |
| | | |
| | | this.props.refreshdata(searches) |
| | | }) |
| | | }) |
| | |
| | | width: 89.5%; |
| | | } |
| | | } |
| | | .ant-form-item label > .anticon { |
| | | vertical-align: middle; |
| | | } |
| | | } |
| | | .modal-fields-row.up_down { |
| | | .ant-form-item { |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {display === 'drawer' ? <Col span={12}> |
| | | <Form.Item label="抽屉方向"> |
| | | <Form.Item label="弹出方向"> |
| | | {getFieldDecorator('placement', { |
| | | initialValue: placement |
| | | })( |
| | |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | message: '存在未保存脚本!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({loading: true}) |
| | |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | message: '存在未保存脚本!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({loading: true}) |
| | |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="抽屉展开的方向。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 抽屉方向 |
| | | 弹出方向 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('drawerPlacement', { |
| | |
| | | if (_loading) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | message: '存在未保存脚本!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({loading: true}) |
| | |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | message: '存在未保存的脚本!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (activeKey === 'setting') { |
| | |
| | | if (_loading) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | message: '存在未保存脚本!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | this.setState({loading: true}) |
| | | this.sqlverify(() => { // 验证成功 |
| | |
| | | } else if (_actionType === 'LogicDelete') { // 逻辑删除 |
| | | _sql += ` |
| | | /* 默认sql */ |
| | | update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifyuserid=@userid@ where ${primaryKey}=@${primaryKey}@;` |
| | | update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifystaff=@fullname,modifyuserid=@userid@ where ${primaryKey}=@${primaryKey}@;` |
| | | |
| | | } else if (_actionType === 'delete') { // 物理删除 |
| | | let _msg = '' |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'placement', |
| | | label: '抽屉方向', |
| | | label: '弹出方向', |
| | | initVal: card.placement || 'right', |
| | | required: false, |
| | | options: [{ |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'colorType', |
| | | label: '颜色类型', |
| | | initVal: card.colorType || 'hex', |
| | | options: [{ |
| | | value: 'hex', |
| | | text: '16进制' |
| | | }, { |
| | | value: 'rgba', |
| | | text: 'RGBA' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'allowHalf', |
| | | label: '半选', |
| | | initVal: card.allowHalf || 'false', |
| | |
| | | key: 'regularExtra', |
| | | label: '正则扩展符', |
| | | initVal: card.regularExtra || '', |
| | | tooltip: '正则验证时的自定义字符,包括~!@#$%^&*()_+:;{}<>,.-', |
| | | tooltip: '正则验证时允许添加的自定义字符,包括~!@#$%^&*()_+:;{}<>,.-', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | |
| | | 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'], |
| | | cascader: ['readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'separator'], |
| | | color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'], |
| | | color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'colorType', 'extra', 'marginTop', 'marginBottom'], |
| | | rate: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'splitline', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'allowHalf', 'color', 'rateCount', 'character', 'place'], |
| | | hint: ['label', 'field', 'type', 'blacklist', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | split: ['label', 'type', 'marginTop', 'marginBottom', 'splitline'], |
| | |
| | | if (_verify.voucher && _verify.voucher.enabled) { |
| | | _voucher = ',BVoucher=@BVoucher,FIBVoucherDate=@FIBVoucherDate,FiYear=@FiYear' |
| | | } |
| | | _defaultsql = `update ${card.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifyuserid=@userid@${_voucher} where ${_primaryKey}${card.Ot !== 'requiredOnce' ? '=@ID@' : ' in (select ID from dbo.SplitComma(@ID@))'};` |
| | | _defaultsql = `update ${card.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifystaff=@fullname,modifyuserid=@userid@${_voucher} where ${_primaryKey}${card.Ot !== 'requiredOnce' ? '=@ID@' : ' in (select ID from dbo.SplitComma(@ID@))'};` |
| | | } else if (card.sqlType === 'delete') { |
| | | let _msg = '' |
| | | if (columns && columns.length > 0 && card.Ot !== 'notRequired' && card.Ot !== 'requiredOnce') { |
| | | if (columns && columns.length > 0 && card.Ot !== 'notRequired') { |
| | | let _index = 0 |
| | | columns.forEach(col => { |
| | | if (!col.field || col.Hide === 'true' || _index >= 4) return |
| | |
| | | } |
| | | |
| | | // 添加数据中字段,表单值优先(按钮不选行或多行拼接时跳过) |
| | | if (data && btn.Ot !== 'notRequired' && btn.Ot !== 'requiredOnce' && columns && columns.length > 0) { |
| | | if (data && btn.Ot !== 'notRequired' && columns && columns.length > 0) { |
| | | datavars = {...data, ...datavars} |
| | | |
| | | const setField = (col) => { |
| | |
| | | |
| | | _sql += ` |
| | | /* 默认sql */ |
| | | update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifyuserid=@userid@ where ${primaryKey}${_ID};` |
| | | update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifystaff=@fullname,modifyuserid=@userid@ where ${primaryKey}${_ID};` |
| | | |
| | | } else if (_actionType === 'delete') { // 物理删除 |
| | | let _msg = '' |
| | | if (data && columns && columns.length > 0) { |
| | | if (data && columns && columns.length > 0 && btn.Ot !== 'notRequired') { |
| | | let _index = 0 |
| | | columns.forEach(col => { |
| | | if (col.Hide !== 'true' && col.type !== 'colspan' && col.type !== 'old_colspan' && _index < 4) { |
| | | _msg += col.label + '=' + data[col.field] + ',' |
| | | _index++ |
| | | } |
| | | if (!col.field || col.Hide === 'true' || _index >= 4) return |
| | | _msg += col.label + '=' + data[col.field] + ',' |
| | | _index++ |
| | | }) |
| | | } |
| | | |
| | |
| | | let icon = null |
| | | let innerStyle = null |
| | | let position = null |
| | | let signType = '' |
| | | style = JSON.parse(JSON.stringify(style)) |
| | | |
| | | marks.some(mark => { |
| | |
| | | if (type === 'font') { |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color} |
| | | signType = ' sign-font' |
| | | } else if (type === 'background') { |
| | | style.backgroundColor = mark.color |
| | | if (mark.fontColor) { |
| | |
| | | style, |
| | | icon, |
| | | innerStyle, |
| | | position |
| | | position, |
| | | signType |
| | | } |
| | | } |
| | | |
| | |
| | | bg_black_style_purple: {name: '紫色', color: '#722ed1'}, |
| | | bg_black_style_magenta: {name: '洋红色', color: '#eb2f96'}, |
| | | bg_black_style_grass_green: {name: '草绿色', color: '#aeb303'}, |
| | | bg_black_style_deep_red: {name: '深红色', color: '#c32539'} |
| | | bg_black_style_deep_red: {name: '深红色', color: '#c32539'}, |
| | | bg_black_style_deep_blue: {name: '深红色', color: '#1d3661'} |
| | | } |
| | | |
| | | class AppCheck extends Component { |
| | |
| | | bg_black_style_purple: {name: '紫色', color: '#722ed1'}, |
| | | bg_black_style_magenta: {name: '洋红色', color: '#eb2f96'}, |
| | | bg_black_style_grass_green: {name: '草绿色', color: '#aeb303'}, |
| | | bg_black_style_deep_red: {name: '深红色', color: '#c32539'} |
| | | bg_black_style_deep_red: {name: '深红色', color: '#c32539'}, |
| | | bg_black_style_deep_blue: {name: '深红色', color: '#1d3661'} |
| | | } |
| | | |
| | | class AppManage extends Component { |
| | |
| | | <Select.Option value="bg_black_style_magenta"><span className="color-block" style={{background: '#eb2f96'}}></span>洋红色(#eb2f96)</Select.Option> |
| | | <Select.Option value="bg_black_style_grass_green"><span className="color-block" style={{background: '#aeb303'}}></span>草绿色(#aeb303)</Select.Option> |
| | | <Select.Option value="bg_black_style_deep_red"><span className="color-block" style={{background: '#c32539'}}></span>深红色(#c32539)</Select.Option> |
| | | <Select.Option value="bg_black_style_deep_blue"><span className="color-block" style={{background: '#1d3661'}}></span>深蓝色(#1d3661)</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | |
| | | |
| | | let level = localStorage.getItem(_href + 'pwdlevel') |
| | | |
| | | if (level) { |
| | | if (level && process.env.NODE_ENV === 'production') { |
| | | let visible = false |
| | | let tip = '密码强度不够,请修改密码!' |
| | | if (param.password.length < 8) { |
| | | visible = true |
| | | } else if (level === 'letter_num' && /^([^0-9]*|[^a-zA-Z]*)$/.test(param.password)) { |
| | | visible = true |
| | | } else if ((level === 'char_num' || level === 'char_num_90') && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(param.password)) { |
| | | } else if ((level === 'char_num' || level === 'char_num_90' || level === 'char_num_90_sms') && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(param.password)) { |
| | | visible = true |
| | | } else if (level === 'char_num_90' && res.modifydate) { |
| | | } else if ((level === 'char_num_90' || level === 'char_num_90_sms') && res.modifydate) { |
| | | let s = (new Date().getTime() - new Date(res.modifydate).getTime()) / (1000 * 24 * 60 * 60) |
| | | if (!isNaN(s) && s > 90) { |
| | | visible = true |
| | |
| | | |
| | | let level = res.pwd_level || '' |
| | | |
| | | if (level && !['letter_num', 'char_num', 'char_num_90'].includes(level)) { |
| | | if (level && !['letter_num', 'char_num', 'char_num_90', 'char_num_90_sms'].includes(level)) { |
| | | level = '' |
| | | } |
| | | |
| | |
| | | this.props.updateConfig({...config, cacheUseful: value}) |
| | | } else if (key === 'timeUnit') { |
| | | this.props.updateConfig({...config, timeUnit: value}) |
| | | } else if (key === 'cacheLocal') { |
| | | this.props.updateConfig({...config, cacheLocal: value}) |
| | | } |
| | | } |
| | | |
| | |
| | | <Row> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="数据会缓存到用户本地,方便页面快速呈现。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 本地缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheLocal', { |
| | | initialValue: config.cacheLocal || 'false' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('cacheLocal', e.target.value)}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="对于不经常性变动的信息,缓存数据有助于提高查询效率。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 缓存数据 |
| | | 后端缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheUseful', { |
| | |
| | | this.props.updateConfig({...config, hidden: value}) |
| | | } else if (key === 'permission') { |
| | | this.props.updateConfig({...config, permission: value}) |
| | | } else if (key === 'cacheLocal') { |
| | | this.props.updateConfig({...config, cacheLocal: value}) |
| | | } |
| | | } |
| | | |
| | |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="数据会缓存到用户本地,方便页面快速呈现。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 本地缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheLocal', { |
| | | initialValue: config.cacheLocal || 'false' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('cacheLocal', e.target.value)}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="对于不经常性变动的信息,缓存数据有助于提高查询效率。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 缓存数据 |
| | | 后端缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheUseful', { |
| | |
| | | this.props.updateConfig({...config, cacheUseful: value}) |
| | | } else if (key === 'timeUnit') { |
| | | this.props.updateConfig({...config, timeUnit: value}) |
| | | } else if (key === 'cacheLocal') { |
| | | this.props.updateConfig({...config, cacheLocal: value}) |
| | | } |
| | | } |
| | | |
| | |
| | | <Row> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="数据会缓存到用户本地,方便页面快速呈现。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 本地缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheLocal', { |
| | | initialValue: config.cacheLocal || 'false' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('cacheLocal', e.target.value)}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="对于不经常性变动的信息,缓存数据有助于提高查询效率。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 缓存数据 |
| | | 后端缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheUseful', { |
| | |
| | | const StyleCombController = asyncComponent(() => import('@/menu/stylecombcontroller')) |
| | | const StyleCombControlButton = asyncComponent(() => import('@/menu/stylecombcontrolbutton')) |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | | const PopView = asyncComponent(() => import('./popview')) |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | sessionStorage.setItem('editMenuType', 'menu') // 编辑菜单类型 |
| | |
| | | comloading: false, |
| | | adapters: [], |
| | | viewType: 'menu', |
| | | view: '', |
| | | eyeopen: false, |
| | | needUpdate: false |
| | | } |
| | |
| | | document.getElementById('mk-mob-design-view').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh; height: 100vh; background: #fff;">本应用没有PC端页面的编辑权限,请联系管理员!</div>' |
| | | return |
| | | } |
| | | MKEmitter.addListener('changePopview', this.initPopview) |
| | | MKEmitter.addListener('triggerMenuSave', this.submitConfig) |
| | | MKEmitter.addListener('changeEditMenu', this.changeEditMenu) |
| | | setTimeout(() => { |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('changePopview', this.initPopview) |
| | | MKEmitter.removeListener('triggerMenuSave', this.submitConfig) |
| | | MKEmitter.removeListener('changeEditMenu', this.changeEditMenu) |
| | | } |
| | | |
| | | initPopview = (card, btn) => { |
| | | const { config } = this.state |
| | | |
| | | if (!this.checkBase()) { |
| | | return |
| | | } |
| | | |
| | | let _btn = fromJS(btn).toJS() |
| | | |
| | | if (_btn.config) { |
| | | _btn.config.uuid = _btn.uuid |
| | | _btn.config.MenuID = _btn.uuid |
| | | _btn.config.ParentId = card.uuid |
| | | _btn.config.MenuName = _btn.label |
| | | } else { |
| | | _btn.config = { |
| | | uuid: _btn.uuid, |
| | | MenuID: _btn.uuid, |
| | | ParentId: card.uuid, |
| | | enabled: false, |
| | | MenuName: _btn.label, |
| | | tables: config.tables || [], |
| | | Template: 'CustomPage', |
| | | components: [], |
| | | viewType: 'popview', |
| | | style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } |
| | | } |
| | | } |
| | | |
| | | this.setState({view: 'popview', popConfig: _btn}) |
| | | } |
| | | |
| | | closePop = () => { |
| | | const {config} = this.state |
| | | |
| | | sessionStorage.setItem('editMenuType', 'menu') |
| | | |
| | | window.GLOB.urlFields = config.urlFields || [] |
| | | window.GLOB.customMenu = config |
| | | |
| | | this.setState({view: '', popConfig: null}) |
| | | } |
| | | |
| | | submitPopConfig = (btnconfig) => { |
| | | let parents = {[btnconfig.ParentId]: true} |
| | | let popbtns = {[btnconfig.uuid]: fromJS(btnconfig).toJS()} |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | config.components = this.setPopView(config.components, parents, popbtns) |
| | | |
| | | this.setState({ config }, () => { |
| | | this.submitConfig() |
| | | }) |
| | | } |
| | | |
| | | setPopView = (components, parents, popbtns) => { |
| | | return components.map(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | tab.components = this.setPopView(tab.components, parents, popbtns) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | item.components = this.setPopView(item.components, parents, popbtns) |
| | | } else if (parents[item.uuid]) { |
| | | this.setpopConfig(item, popbtns) |
| | | } |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | setpopConfig = (config, popbtns) => { |
| | | config.subcards && config.subcards.forEach(item => { |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.OpenType === 'popview' && popbtns[cell.uuid]) { |
| | | cell.config = popbtns[cell.uuid] |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | config.cols && config.cols.forEach(col => { |
| | | if (col.type === 'action') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.OpenType === 'popview' && popbtns[cell.uuid]) { |
| | | cell.config = popbtns[cell.uuid] |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | config.elements && config.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.OpenType === 'popview' && popbtns[cell.uuid]) { |
| | | cell.config = popbtns[cell.uuid] |
| | | } |
| | | }) |
| | | |
| | | config.action && config.action.forEach(cell => { |
| | | if (cell.OpenType === 'popview' && popbtns[cell.uuid]) { |
| | | cell.config = popbtns[cell.uuid] |
| | | } |
| | | }) |
| | | |
| | | config.$tables = getTables(config) |
| | | } |
| | | |
| | | checkBase = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.MenuName || !config.MenuNo) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请完善菜单基本信息!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | |
| | | getSmStemp = () => { |
| | |
| | | |
| | | |
| | | render () { |
| | | const { viewType, comloading, loading, settingshow, controlshow, activeKey, MenuId, config, menuloading, adapters, eyeopen, needUpdate } = this.state |
| | | const { view, viewType, comloading, loading, settingshow, controlshow, activeKey, MenuId, config, menuloading, adapters, eyeopen, needUpdate } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={antdZhCN}> |
| | |
| | | <Header/> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | <DndProvider backend={HTML5Backend}> |
| | | <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}> |
| | | {view !== 'popview' ? <><div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | | {settingshow ? <DoubleLeftOutlined onClick={() => {this.setState({settingshow: false})}} /> : null} |
| | | {!settingshow ? <DoubleRightOutlined onClick={() => {this.setState({settingshow: true})}} /> : null} |
| | |
| | | {config && !comloading ? <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |
| | | <MobShell menu={config} handleList={this.updateConfig} /> |
| | | </div> : null} |
| | | </div> |
| | | </div></> : <PopView btn={this.state.popConfig} save={this.submitPopConfig} cancel={this.closePop}/>} |
| | | </DndProvider> |
| | | <StyleController /> |
| | | <StyleCombController /> |
| | |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | .card-button-cell { |
| | | .ant-checkbox-inner { |
| | | width: 20px; |
| | | height: 20px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .mk-mob-view.userbind { |
| | |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="数据会缓存到用户本地,方便页面快速呈现。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 本地缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheLocal', { |
| | | initialValue: config.cacheLocal || 'false' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('cacheLocal', e.target.value)}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="对于不经常性变动的信息,缓存数据有助于提高查询效率。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 缓存数据 |
| | | 后端缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheUseful', { |
New file |
| | |
| | | import React, { Component } from 'react' |
| | | import { is, fromJS } from 'immutable' |
| | | import PropTypes from 'prop-types' |
| | | import { notification, Modal, Collapse, Switch, Button } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | |
| | | import './index.scss' |
| | | |
| | | const { Panel } = Collapse |
| | | const { confirm } = Modal |
| | | |
| | | const MenuForm = asyncComponent(() => import('./menuform')) |
| | | const MobShell = asyncComponent(() => import('@/mob/mobshell')) |
| | | const SourceWrap = asyncComponent(() => import('@/mob/modulesource')) |
| | | const Modulecell = asyncComponent(() => import('@/menu/modulecell')) |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) |
| | | const StyleCombControlButton = asyncComponent(() => import('@/menu/stylecombcontrolbutton')) |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | | |
| | | class PopViewDesign extends Component { |
| | | static propTpyes = { |
| | | btn: PropTypes.object, |
| | | save: PropTypes.func, |
| | | cancel: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | menuloading: false, |
| | | oriConfig: null, |
| | | config: null, |
| | | comloading: false, |
| | | settingshow: true, |
| | | controlshow: true, |
| | | eyeopen: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { btn } = this.props |
| | | sessionStorage.setItem('editMenuType', 'popview') |
| | | |
| | | let config = fromJS(btn.config).toJS() |
| | | |
| | | window.GLOB.urlFields = [] // url变量 |
| | | window.GLOB.customMenu = config // 保存菜单信息 |
| | | |
| | | this.setState({config: config, oriConfig: fromJS(config).toJS()}) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('completeSave', this.completeSave) |
| | | MKEmitter.addListener('triggerMenuSave', this.submitConfig) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('completeSave', this.completeSave) |
| | | MKEmitter.removeListener('triggerMenuSave', this.submitConfig) |
| | | } |
| | | |
| | | closeView = () => { |
| | | const { oriConfig, config } = this.state |
| | | |
| | | if (!is(fromJS(oriConfig), fromJS(config))) { |
| | | const _this = this |
| | | |
| | | confirm({ |
| | | title: '配置已修改,放弃保存吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.props.cancel() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | this.props.cancel() |
| | | } |
| | | } |
| | | |
| | | getMenuMessage = (config) => { |
| | | let tbs = [] |
| | | |
| | | let traversal = (components) => { |
| | | components.forEach(item => { |
| | | if (item.$tables) { |
| | | tbs.push(...item.$tables) |
| | | } |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | traversal(tab.components) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | traversal(item.components) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | traversal(config.components) |
| | | |
| | | config.$tables = Array.from(new Set(tbs)) |
| | | } |
| | | |
| | | completeSave = () => { |
| | | this.setState({ |
| | | oriConfig: fromJS(this.state.config).toJS(), |
| | | menuloading: false |
| | | }) |
| | | } |
| | | |
| | | submitConfig = () => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | if (config.cacheUseful === 'true' && !config.cacheTime) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请完善缓存设置!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (config.enabled && this.verifyConfig()) { |
| | | config.enabled = false |
| | | } |
| | | |
| | | this.getMenuMessage(config) |
| | | |
| | | this.setState({ |
| | | config: config, |
| | | menuloading: true |
| | | }) |
| | | |
| | | window.GLOB.customMenu = config |
| | | |
| | | this.props.save(fromJS(config).toJS()) |
| | | } |
| | | |
| | | onEnabledChange = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.enabled && this.verifyConfig(true)) { |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | config: {...config, enabled: !config.enabled} |
| | | }) |
| | | } |
| | | |
| | | verifyConfig = (show) => { |
| | | const { config } = this.state |
| | | let error = '' |
| | | |
| | | 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 |
| | | } else if (!item.errors || item.errors.length === 0) { |
| | | return |
| | | } |
| | | |
| | | item.errors.forEach(err => { |
| | | if (err.level !== 0 || error) return |
| | | error = `组件《${item.name}》${err.detail}` |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | check(config.components) |
| | | |
| | | if (show && error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: error, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | return error |
| | | } |
| | | |
| | | // 更新配置信息 |
| | | updateConfig = (config) => { |
| | | this.setState({ |
| | | config: config |
| | | }) |
| | | |
| | | window.GLOB.customMenu = config |
| | | } |
| | | |
| | | resetConfig = (config) => { |
| | | this.setState({ |
| | | config, |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ |
| | | comloading: false |
| | | }) |
| | | }) |
| | | |
| | | window.GLOB.customMenu = config |
| | | } |
| | | |
| | | /** |
| | | * @description 更新常用表信息,快捷添加后更新配置信息 |
| | | */ |
| | | updatetable = (config) => { |
| | | this.setState({ config }) |
| | | |
| | | window.GLOB.customMenu = config |
| | | } |
| | | |
| | | insert = (item) => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | config.components.push(item) |
| | | |
| | | this.setState({config}) |
| | | |
| | | window.GLOB.customMenu = config |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { settingshow, controlshow, comloading, config, menuloading, eyeopen } = this.state |
| | | |
| | | return ( |
| | | <div className="mob-poper-view"> |
| | | <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | | {settingshow ? <DoubleLeftOutlined onClick={() => {this.setState({settingshow: false})}} /> : null} |
| | | {!settingshow ? <DoubleRightOutlined onClick={() => {this.setState({settingshow: true})}} /> : null} |
| | | </div> |
| | | <div className="pc-setting-tools"> |
| | | <Collapse accordion defaultActiveKey="component" bordered={false}> |
| | | {/* 基本信息 */} |
| | | <Panel header="基本信息" forceRender className="basedata" key="basedata"> |
| | | {/* 菜单信息 */} |
| | | <MenuForm config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header="组件" className="component" key="component"> |
| | | <SourceWrap viewType="popview"/> |
| | | </Panel> |
| | | <Panel header="元素" key="element"> |
| | | <Modulecell /> |
| | | </Panel> |
| | | <Panel header={'页面样式'} key="background"> |
| | | <BgController config={config} updateConfig={this.updateConfig} /> |
| | | </Panel> |
| | | </Collapse> |
| | | </div> |
| | | </div> |
| | | <div className={'menu-control' + (!controlshow ? ' hidden' : '')}> |
| | | <div className="draw"> |
| | | {controlshow ? <DoubleRightOutlined onClick={() => {this.setState({controlshow: false})}}/> : null} |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>保存</Button> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config && config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <PasteController insert={this.insert} /> |
| | | <StyleCombControlButton menu={config} /> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <Button type="default" onClick={this.closeView}>返回</Button> |
| | | </div> |
| | | </div> |
| | | <div className={'menu-body menu-view' + (menuloading ? ' saving' : '') + (eyeopen ? ' eye-open' : '')}> |
| | | {config && !comloading ? <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |
| | | <MobShell menu={config} handleList={this.updateConfig} /> |
| | | </div> : null} |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default PopViewDesign |
New file |
| | |
| | | .mob-poper-view { |
| | | background: #000; |
| | | min-height: 100vh; |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Radio, Tooltip, InputNumber } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | // import './index.scss' |
| | | |
| | | class CustomMenuForm extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | | changeCacheDay = (val) => { |
| | | if (typeof(val) !== 'number') { |
| | | val = '' |
| | | } |
| | | this.props.updateConfig({...this.props.config, cacheTime: val}) |
| | | } |
| | | |
| | | selectChange = (key, value) => { |
| | | const { config } = this.props |
| | | |
| | | if (key === 'cacheUseful') { |
| | | this.props.updateConfig({...config, cacheUseful: value}) |
| | | } else if (key === 'timeUnit') { |
| | | this.props.updateConfig({...config, timeUnit: value}) |
| | | } else if (key === 'cacheLocal') { |
| | | this.props.updateConfig({...config, cacheLocal: value}) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout}> |
| | | <Row> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="数据会缓存到用户本地,方便页面快速呈现。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 本地缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheLocal', { |
| | | initialValue: config.cacheLocal || 'false' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('cacheLocal', e.target.value)}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="对于不经常性变动的信息,缓存数据有助于提高查询效率。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 后端缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheUseful', { |
| | | initialValue: config.cacheUseful || 'false' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('cacheUseful', e.target.value)}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {config.cacheUseful === 'true' ? <Col span={24}> |
| | | <Form.Item label="单位"> |
| | | {getFieldDecorator('timeUnit', { |
| | | initialValue: config.timeUnit || 'day' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('timeUnit', e.target.value)}}> |
| | | <Radio value="day">天</Radio> |
| | | <Radio value="hour">小时</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {config.cacheUseful === 'true' ? <Col span={24}> |
| | | <Form.Item label="时长"> |
| | | {getFieldDecorator('cacheTime', { |
| | | initialValue: config.cacheTime, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入时长!' |
| | | } |
| | | ] |
| | | })( |
| | | <InputNumber min={1} max={config.timeUnit !== 'hour' ? 7 : 23} precision={0} onChange={this.changeCacheDay}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(CustomMenuForm) |
| | |
| | | return ( |
| | | <ConfigProvider locale={antdZhCN}> |
| | | <DndProvider backend={HTML5Backend}> |
| | | {view !== 'popview' ?<div className={'mk-pc-view '} id="mk-pc-design-view"> |
| | | {view !== 'popview' ? <div className={'mk-pc-view '} id="mk-pc-design-view"> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | |
| | | this.props.updateConfig({...config, timeUnit: value}) |
| | | } else if (key === 'mask') { |
| | | this.props.updateConfig({...config, mask: value}) |
| | | } else if (key === 'cacheLocal') { |
| | | this.props.updateConfig({...config, cacheLocal: value}) |
| | | // } else if (key === 'permission') { |
| | | // this.props.updateConfig({...config, permission: value}) |
| | | } |
| | |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="数据会缓存到用户本地,方便页面快速呈现。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 本地缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheLocal', { |
| | | initialValue: config.cacheLocal || 'false' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('cacheLocal', e.target.value)}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="对于不经常性变动的信息,缓存数据有助于提高查询效率。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 缓存数据 |
| | | 后端缓存 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('cacheUseful', { |
| | |
| | | |
| | | let level = res.pwd_level || '' |
| | | |
| | | if (level && !['letter_num', 'char_num', 'char_num_90'].includes(level)) { |
| | | if (level && !['letter_num', 'char_num', 'char_num_90', 'char_num_90_sms'].includes(level)) { |
| | | level = '' |
| | | } |
| | | |
| | |
| | | MenuID: '1583979633842550imkchl4qt4qppsiv', |
| | | MenuNo: 'sVersionMUpgrade', |
| | | MenuName: '版本升级', |
| | | }, { |
| | | src: '', |
| | | PageParam: {OpenType: 'newtab', Template: 'TabManage'}, |
| | | type: 'TabManage', |
| | | MenuID: 'TabManageView', |
| | | MenuNo: 'TabManage', |
| | | MenuName: '标签页管理', |
| | | // }, { |
| | | // src: '', |
| | | // PageParam: {OpenType: 'newtab', Template: 'TabManage'}, |
| | | // type: 'TabManage', |
| | | // MenuID: 'TabManageView', |
| | | // MenuNo: 'TabManage', |
| | | // MenuName: '标签页管理', |
| | | }, { |
| | | src: '', |
| | | PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, |