| | |
| | | appId -- 云端生成的应用ID |
| | | appkey -- 云端生成的应用密钥 |
| | | mainSystemApi -- sso系统的接口路径,注:业务系统需要填写,且值为通用接口的完整路径 |
| | | systemType -- 判断业务系统为测试(空)或正式( official ),正式系统开发权限只含有系统升级等限定功能 |
| | | systemType -- 判断业务系统为测试 (空) 或正式 (production) ,正式系统开发权限只含有系统升级等限定功能 |
| | | lineColor -- 分割线颜色 |
| | | filter -- 页面滤镜,值为'true'时,页面显示为黑白色 |
| | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { // 编辑状态时,获取一级菜单,增加参数debug |
| | | _param.debug = 'Y' |
| | | } |
| | | if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'official') { |
| | | if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') { |
| | | _param.linkurl = window.GLOB.linkurl |
| | | } |
| | | |
| | |
| | | // 获取主菜单参数 |
| | | let promiseMenu = new Promise(resolve => { |
| | | let _param = {func: 'sPC_Get_MainMenu', systemType: options.sysType} |
| | | if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'official') { |
| | | if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') { |
| | | _param.linkurl = window.GLOB.linkurl |
| | | } |
| | | |
| | |
| | | _userName = sessionStorage.getItem('CloudUserName') |
| | | } |
| | | |
| | | if (window.GLOB.systemType === 'official' && state) { |
| | | if (window.GLOB.systemType === 'production' && state) { |
| | | this.props.resetEditLevel('HS') |
| | | this.props.modifyMainMenu({ |
| | | MenuID: 'systemManageView' |
| | |
| | | this.props.resetEditState(state) |
| | | |
| | | return |
| | | } else if (window.GLOB.systemType === 'official' && !state) { |
| | | } else if (window.GLOB.systemType === 'production' && !state) { |
| | | this.props.resetEditLevel(false) |
| | | this.props.modifyMainMenu(menulist[0] || '') |
| | | |
| | |
| | | this.props.resetEditState(state) |
| | | } |
| | | |
| | | if (state && this.props.sysRoles.length === 0 && this.props.permFuncField.length === 0 && window.GLOB.systemType !== 'official') { |
| | | if (state && this.props.sysRoles.length === 0 && this.props.permFuncField.length === 0 && window.GLOB.systemType !== 'production') { |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | |
| | | _avatar = Utils.getrealurl(res.icon) // 头像 |
| | | } |
| | | |
| | | if (window.GLOB.systemType === 'official') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | this.props.resetEditLevel('HS') |
| | | this.props.modifyMainMenu({ |
| | | MenuID: 'systemManageView' |
| | |
| | | * @description 退出管理界面菜单 |
| | | */ |
| | | exitManage = () => { |
| | | if (window.GLOB.systemType === 'official') { // 正式系统版本升级后,页面刷新 |
| | | if (window.GLOB.systemType === 'production') { // 正式系统版本升级后,页面刷新 |
| | | window.location.reload() |
| | | return |
| | | } |
| | |
| | | {this.props.editLevel === 'HS' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>退出</Button> : null} |
| | | {/* 进入编辑按钮 */} |
| | | {this.props.editState && !this.props.editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} |
| | | {/* {this.props.editState && !this.props.editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'official' ? |
| | | {/* {this.props.editState && !this.props.editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' ? |
| | | <a href="#/mobmanage" target="_blank" className="mobile" type="edit"> 应用管理 <Icon type="arrow-right" /></a> : null |
| | | } */} |
| | | {/* 编辑菜单 */} |
| | |
| | | text: '传输号查询' |
| | | }, { |
| | | src: '', |
| | | systems: ['official', 'local', 'SSO', 'cloud'], |
| | | systems: ['production', 'local', 'SSO', 'cloud'], |
| | | PageParam: {OpenType: 'newtab', Template: 'VerupTable'}, |
| | | type: 'VerupTable', |
| | | MenuID: '1583979633842550imkchl4qt4qppsiv', |
| | |
| | | text: '语言包' |
| | | }, { |
| | | src: '', |
| | | systems: ['official', 'local', 'SSO', 'cloud'], |
| | | systems: ['production', 'local', 'SSO', 'cloud'], |
| | | PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, |
| | | type: 'ManageTable', |
| | | MenuID: '1577971621421tg4v0i1ur8873k7e0ob', |
| | |
| | | text: '接口地址' |
| | | }, { |
| | | src: '', |
| | | systems: ['official', 'local', 'SSO', 'cloud'], |
| | | systems: ['production', 'local', 'SSO', 'cloud'], |
| | | PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, |
| | | type: 'ManageTable', |
| | | MenuID: '1577929944419lgc5h3hepum765e2k7u', |
| | |
| | | enterManageView = (type) => { |
| | | let menulist = SySMenuList[type] |
| | | |
| | | if (window.GLOB.systemType === 'official') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | menulist.forEach(menu => { |
| | | menu.children = menu.children.filter(item => item.systems && item.systems.includes(window.GLOB.systemType)) |
| | | }) |
| | |
| | | |
| | | window.GLOB = window.GLOB || {} |
| | | |
| | | if (!(options.sysType === 'local' && window.GLOB.systemType === 'official')) { // 只有业务系统才可以设置为正式系统 |
| | | // 只有业务系统才可以设置为正式系统 |
| | | if (options.sysType === 'local' && (window.GLOB.systemType === 'official' || window.GLOB.systemType === 'production')) { |
| | | window.GLOB.systemType = 'production' |
| | | } else { |
| | | window.GLOB.systemType = '' |
| | | } |
| | | |
| | |
| | | if (process.env.NODE_ENV === 'production') { // 用于校验是否存在开发权限 |
| | | let _service = window.location.href.replace(/\/index.html(.*)|\/#(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '') |
| | | window.GLOB.linkurl = window.location.href.split('#')[0] |
| | | if (!/index.html/ig.test(window.GLOB.linkurl)) { |
| | | window.GLOB.linkurl = window.GLOB.linkurl + 'index.html' |
| | | } |
| | | window.GLOB.service = _service ? _service + '/' : '' |
| | | } else { |
| | | window.GLOB.linkurl = '' |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | // import { is, fromJS } from 'immutable' |
| | | import { SketchPicker } from 'react-color' |
| | | import {Popover } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | | class ColorSketch extends Component { |
| | | static propTpyes = { |
| | | card: PropTypes.object, |
| | | onDoubleClick: PropTypes.func |
| | | } |
| | | state = { |
| | | visible: false, |
| | | color: '#f8e71c', |
| | | }; |
| | | |
| | | handleClick = () => { |
| | | this.setState({ visible: !this.state.visible }) |
| | | }; |
| | | |
| | | handleClose = () => { |
| | | this.setState({ visible: false }) |
| | | }; |
| | | |
| | | handleChange = (color) => { |
| | | this.setState({ color: color.rgb }) |
| | | }; |
| | | |
| | | render() { |
| | | const { color } = this.state |
| | | return ( |
| | | <Popover content={ |
| | | <SketchPicker color={ this.state.color } onChange={ this.handleChange } /> |
| | | } overlayClassName="color-sketch-popover" placement="bottomRight" title="" trigger="click"> |
| | | <div className="color-sketch-block" onClick={ this.handleClick }> |
| | | <div className="color-sketch-block-inner" style={ {background: `rgba(${ color.r }, ${ color.g }, ${ color.b }, ${ color.a })`} }></div> |
| | | </div> |
| | | </Popover> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default ColorSketch |
New file |
| | |
| | | .color-sketch-block { |
| | | padding: 5px; |
| | | background: #fff; |
| | | border-radius: 2px; |
| | | box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); |
| | | display: inline-block; |
| | | cursor: pointer; |
| | | |
| | | .color-sketch-block-inner { |
| | | width: 50px; |
| | | height: 14px; |
| | | border-radius: 2px; |
| | | } |
| | | } |
| | | |
| | | .color-sketch-popover { |
| | | .ant-popover-inner-content { |
| | | padding: 0; |
| | | .sketch-picker { |
| | | width: 210px!important; |
| | | } |
| | | } |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | // import PropTypes from 'prop-types' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Collapse } from 'antd' |
| | | import { Collapse, Form, Input, Col, Icon, InputNumber, Select } from 'antd' |
| | | |
| | | import zhCN from '@/locales/zh-CN/mob.js' |
| | | import enUS from '@/locales/en-US/mob.js' |
| | | import ColorSketch from '@/mob/colorsketch' |
| | | import './index.scss' |
| | | |
| | | const { Panel } = Collapse |
| | | const { Option } = Select |
| | | |
| | | class MobController extends Component { |
| | | // static propTpyes = { |
| | | // collapse: PropTypes.bool, |
| | | // } |
| | | static propTpyes = { |
| | | editElem: PropTypes.any, |
| | | } |
| | | |
| | | state = { |
| | | dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | } |
| | |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | render () { |
| | | boldChange = (val) => { |
| | | console.log(val) |
| | | } |
| | | |
| | | render () { |
| | | const { editElem } = this.props |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | return ( |
| | | <div className="mob-controller"> |
| | | <Collapse expandIconPosition="right"> |
| | | <Panel header="字体" key="0"> |
| | | 字体修改 |
| | | </Panel> |
| | | <Form {...formItemLayout}> |
| | | {editElem ? <Collapse expandIconPosition="right" accordion={true}> |
| | | {editElem.items.includes('font') ? <Panel header="字体" key="0"> |
| | | <Col span={12}> |
| | | <Form.Item colon={false} label={<Icon title="字体大小" type="font-size" />}> |
| | | <InputNumber min={12} max={100} precision={0} /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item colon={false} label={<Icon title="字体粗细" type="bold" />}> |
| | | <Select defaultValue="normal" onChange={this.boldChange}> |
| | | <Option value="normal">normal</Option> |
| | | <Option value="bold">bold</Option> |
| | | <Option value="bolder">bolder</Option> |
| | | <Option value="lighter">lighter</Option> |
| | | <Option value="100">100</Option> |
| | | <Option value="200">200</Option> |
| | | <Option value="300">300</Option> |
| | | <Option value="400">400</Option> |
| | | <Option value="500">500</Option> |
| | | <Option value="600">600</Option> |
| | | <Option value="700">700</Option> |
| | | <Option value="800">800</Option> |
| | | <Option value="900">900</Option> |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item colon={false} label={<Icon title="行间距" type="line-height" />}> |
| | | <InputNumber min={1} max={10} precision={1} /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item colon={false} label={<Icon title="字间距" type="column-width" />}> |
| | | <InputNumber min={0} max={100} precision={0} /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<Icon title="字体颜色" type="font-colors" />} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <ColorSketch /> |
| | | <Input /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item colon={false} label={<Icon title="字体粗细" type="bold" />}> |
| | | <Input /> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | <Panel header="背景" key="1"> |
| | | 背景 |
| | | </Panel> |
| | |
| | | <Panel header="其他" key="3"> |
| | | 其他 |
| | | </Panel> |
| | | </Collapse> |
| | | </Collapse> : null} |
| | | </Form> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow: hidden; |
| | | >.ant-collapse { |
| | | >.ant-form >.ant-collapse { |
| | | border: 0; |
| | | background: #262E3F; |
| | | |
| | |
| | | color: rgba(255, 255, 255, 0.85); |
| | | background-color: #202735; |
| | | border-top: 1px solid #202735; |
| | | |
| | | .ant-form-item { |
| | | margin-bottom: 5px; |
| | | |
| | | .ant-form-item-label > label { |
| | | color: rgba(255, 255, 255, 0.85); |
| | | .anticon { |
| | | vertical-align: middle; |
| | | font-size: 18px; |
| | | } |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | .ant-form-item-control { |
| | | input { |
| | | background: transparent; |
| | | color: rgba(255, 255, 255, 0.65); |
| | | } |
| | | .ant-input { |
| | | height: 28px; |
| | | } |
| | | .ant-input-number { |
| | | height: 28px; |
| | | background: transparent; |
| | | .ant-input-number-input { |
| | | height: 28px; |
| | | } |
| | | } |
| | | .ant-select-selection { |
| | | background: transparent; |
| | | color: rgba(255, 255, 255, 0.65); |
| | | } |
| | | .color-sketch-block { |
| | | position: relative; |
| | | top: 10px; |
| | | } |
| | | .color-sketch-block + .ant-input { |
| | | float: right; |
| | | width: 60%; |
| | | margin-top: 9px; |
| | | } |
| | | .ant-select-arrow { |
| | | color: inherit; |
| | | } |
| | | .ant-input-number-handler-wrap { |
| | | background: transparent; |
| | | .ant-input-number-handler { |
| | | color: rgba(255, 255, 255, 0.65); |
| | | .ant-input-number-handler-up-inner, .ant-input-number-handler-down-inner { |
| | | color: rgba(255, 255, 255, 0.65); |
| | | } |
| | | } |
| | | .ant-input-number-handler:active { |
| | | background: transparent; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | // import { is, fromJS } from 'immutable' |
| | | import { Form, Icon, Popover, Input } from 'antd' |
| | | import { Form, Icon, Popover, Input, Modal } from 'antd' |
| | | |
| | | import zhCN from '@/locales/zh-CN/mob.js' |
| | | import enUS from '@/locales/en-US/mob.js' |
| | | import FileUpload from '@/tabviews/zshare/fileupload' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | const { confirm } = Modal |
| | | |
| | | class ContentUpdate extends Component { |
| | | static propTpyes = { |
| | |
| | | |
| | | state = { |
| | | dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | images: [], |
| | | visible: false |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | deleteElement = () => { |
| | | const _this = this |
| | | |
| | | confirm({ |
| | | title: '确定删除元素吗?', |
| | | onOk() { |
| | | _this.props.updateContent(null) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | imgChange = (list) => { |
| | | const { element } = this.props |
| | | |
| | | this.setState({images: list}) |
| | | if (list && list.length && list[0].response) { |
| | | this.setState({ |
| | | visible: false, |
| | | images: [] |
| | | }) |
| | | let val = list[0].response |
| | | if (val && element.content !== val) { |
| | | this.props.updateContent({...element, content: val}) |
| | | } |
| | | this.props.form.setFieldsValue({content: val}) |
| | | } |
| | | } |
| | | |
| | | render () { |
| | | const { element } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { visible } = this.state |
| | | const { visible, images } = this.state |
| | | |
| | | return ( |
| | | <div className="mob-content-update"> |
| | | <Icon type="delete" onClick={this.deleteElement} /> |
| | | <Popover content={ |
| | | <div> |
| | | {element.eleType === 'img' ? <FileUpload value={images} maxFile={1} fileType="text" onChange={this.imgChange}/> : null} |
| | | {getFieldDecorator('content', { |
| | | initialValue: element.content |
| | | })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | })(element.eleType !== 'textarea' ? |
| | | <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} /> : |
| | | <TextArea autosize={{ minRows: 2, maxRows: 3 }} onPressEnter={this.handleSubmit} /> |
| | | )} |
| | | </div> |
| | | } overlayClassName="mob-content-update-popover" placement="bottomRight" title="" visible={visible} trigger="click" onVisibleChange={this.onVisibleChange}> |
| | | <Icon type="edit" /> |
| | |
| | | .mob-content-update { |
| | | position: absolute; |
| | | top: -23px; |
| | | top: -22px; |
| | | right: -1px; |
| | | background: #2f54eb; |
| | | border-radius: 2px; |
| | | color: #ffffff; |
| | | font-size: 14px; |
| | |
| | | i { |
| | | padding: 2px 5px; |
| | | cursor: pointer; |
| | | background: #2f54eb; |
| | | } |
| | | .anticon-delete { |
| | | background: #ff4d4f; |
| | | } |
| | | } |
| | | .editing .mob-content-update { |
| | |
| | | .ant-popover-arrow { |
| | | top: 1px; |
| | | } |
| | | |
| | | .fileupload-form-container { |
| | | display: block; |
| | | margin-bottom: 10px; |
| | | .ant-upload-list { |
| | | width: 250px; |
| | | } |
| | | } |
| | | } |
| | | input { |
| | | width: 200px; |
| | | width: 250px; |
| | | } |
| | | textarea { |
| | | width: 270px; |
| | | } |
| | | } |
| | |
| | | |
| | | return ( |
| | | <div className="mob-login" onClick={this.editBox} style={{paddingTop: `calc(17vh - 10px)`}}> |
| | | <div className={'logo ' + (editId === card.logo.uuid ? 'editing' : '')} onClick={this.editLogo}> |
| | | {card.logo ? <div className={'logo ' + (editId === card.logo.uuid ? 'editing' : '')} onClick={this.editLogo}> |
| | | <ContentUpdate element={card.logo} updateContent={(ele) => this.updateContent({...card, logo: ele})}/> |
| | | <img src={card.logo.content} alt=""/> |
| | | </div> |
| | | <div className={'plat-name ' + (editId === card.title.uuid ? 'editing' : '')} onClick={this.editTitle}> |
| | | </div> : null} |
| | | {card.title ? <div className={'plat-name ' + (editId === card.title.uuid ? 'editing' : '')} onClick={this.editTitle}> |
| | | <ContentUpdate element={card.title} updateContent={(ele) => this.updateContent({...card, title: ele})}/> |
| | | {card.title.content} |
| | | </div> |
| | | </div> : null} |
| | | <InputItem |
| | | placeholder="UserName" |
| | | prefixListCls="mk-login-item am-list" |
| | |
| | | <div className="clear-both"></div> |
| | | </div> |
| | | <Button type="primary" onDoubleClick={() => this.props.doubleClickCard(card.login)}>登录</Button> |
| | | <div className={'company-msg ' + (editId === card.copyright.uuid ? 'editing' : '')} onClick={this.editMsg}> |
| | | {card.copyright ? <div className={'company-msg ' + (editId === card.copyright.uuid ? 'editing' : '')} onClick={this.editMsg}> |
| | | <ContentUpdate element={card.copyright} updateContent={(ele) => this.updateContent({...card, copyright: ele})}/> |
| | | <p>{card.copyright.content}</p> |
| | | </div> |
| | | </div> : null} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | max-width: 280px; |
| | | min-height: 10px; |
| | | margin: 0 auto; |
| | | margin-bottom: 15px; |
| | | text-align: center; |
| | | border: 1px dotted transparent; |
| | | img { |
| | |
| | | .plat-name:not(.editing):hover { |
| | | border-color: #535353; |
| | | } |
| | | |
| | | .plat-name + .mk-login-item.am-list-item, .logo + .mk-login-item.am-list-item { |
| | | margin-top: 30px; |
| | | } |
| | | |
| | | .mk-login-item.am-list-item { |
| | | position: relative; |
| | | z-index: 1; |
| | |
| | | title: _dict['mob.login'], |
| | | sourceType: 'login', |
| | | options: [ |
| | | {sourceType: 'mob-login-1', type: 'mob', url: mobLogin1, style: {}, |
| | | { |
| | | sourceType: 'mob-login-1', type: 'mob', url: mobLogin1, style: {}, |
| | | param: { |
| | | type: 'login', subtype: 'mob-login-1', |
| | | box: { editable: true, paddingTop: '17vh', background: '', color: '#ffffff' }, |
| | | logo: { editable: true, content: mklogo }, |
| | | title: { editable: true, content: '明科商业智能开放平台', fontSize: '20px', fontWeight: 'bold', color: '#ffffff' }, |
| | | login: { editable: true, content: '登录', fontSize: '20px', fontWeight: 'bold', color: '#ffffff' }, |
| | | copyright: { editable: true, content: 'Copyright©2017 所有相关版权归 北京明科普华信息技术有限公司', fontSize: '12px', color: '#ffffff' } |
| | | box: { editable: true, eleType: 'box', paddingTop: '17vh', background: '', color: '#ffffff' }, |
| | | logo: { editable: true, eleType: 'img', content: mklogo }, |
| | | title: { editable: true, eleType: 'text', content: '明科商业智能开放平台', fontSize: '20px', fontWeight: 'bold', color: '#ffffff' }, |
| | | login: { editable: true, eleType: 'button', content: '登录', fontSize: '20px', fontWeight: 'bold', color: '#ffffff' }, |
| | | copyright: { editable: true, eleType: 'textarea', content: 'Copyright©2017 所有相关版权归 北京明科普华信息技术有限公司', fontSize: '12px', color: '#ffffff' } |
| | | } |
| | | }, |
| | | ] |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | let Url = '/Upload' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | Url = document.location.origin + '/' + window.GLOB.service + 'zh-CN/Home/Upload' |
| | | } |
| | | // let Url = '/Upload' |
| | | // if (process.env.NODE_ENV === 'production') { |
| | | // Url = document.location.origin + '/' + window.GLOB.service + 'zh-CN/Home/Upload' |
| | | // } |
| | | |
| | | let service = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | |
| | | } |
| | | |
| | | state = { |
| | | baseUrl: Url, |
| | | percent: 0, |
| | | showprogress: false |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | getExtraData = () => { |
| | | return { |
| | | RootPath: 'Content/images/upload/' |
| | | } |
| | | } |
| | | // getExtraData = () => { |
| | | // return { |
| | | // RootPath: 'Content/images/upload/' |
| | | // } |
| | | // } |
| | | |
| | | shardupload = (params) => { |
| | | let param = params.chunks.shift() |
| | |
| | | |
| | | render() { |
| | | const { value, maxFile, fileType } = this.props |
| | | const { showprogress, percent, baseUrl } = this.state |
| | | const { showprogress, percent } = this.state |
| | | |
| | | let uploadable = '' |
| | | let uploadable = 'fileupload-form-container ' |
| | | |
| | | if (maxFile && maxFile > 0 && value && value.length >= maxFile) { |
| | | uploadable = 'limit-fileupload' |
| | | uploadable += 'limit-fileupload' |
| | | } |
| | | |
| | | const props = { |
| | |
| | | disabled: showprogress, |
| | | listType: fileType, |
| | | fileList: value, |
| | | action: baseUrl, |
| | | action: null, |
| | | method: 'post', |
| | | multiple: false, |
| | | onChange: this.onChange, |
| | | onRemove: this.onRemove, |
| | | data: this.getExtraData, |
| | | // data: this.getExtraData, |
| | | beforeUpload: this.beforeUpload, |
| | | className: uploadable |
| | | } |
| | |
| | | .main-form-field { |
| | | .fileupload-form-container { |
| | | .ant-progress-small.ant-progress-line { |
| | | position: absolute; |
| | | bottom: -20px; |
| | | left: 0px; |
| | | } |
| | | .limit-fileupload { |
| | | > .ant-upload { |
| | | display: none; |
| | | } |
| | | } |
| | | |
| | | .ant-upload-list-picture-card .ant-upload-list-item { |
| | | width: 90px; |
| | | height: 90px; |
| | |
| | | height: 90px; |
| | | } |
| | | } |
| | | .fileupload-form-container.limit-fileupload { |
| | | > .ant-upload { |
| | | display: none; |
| | | } |
| | | } |
| | |
| | | |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | | |
| | | if (window.GLOB.systemType !== 'official' && options.sysType !== 'cloud') { |
| | | if (window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') { |
| | | let fsql = ` |
| | | ${_sql} |
| | | ${_sqlInsert} |
| | |
| | | _sql += ` |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | | |
| | | if (window.GLOB.systemType !== 'official' && options.sysType !== 'cloud') { |
| | | if (window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') { |
| | | _sql = _sql.replace(/\n\s{8}/ig, '\n') |
| | | console.log(_sql) |
| | | } |
| | |
| | | import { DndProvider } from 'react-dnd' |
| | | import { fromJS } from 'immutable' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | // import { SketchPicker } from 'react-color' |
| | | import { Icon, Tabs, notification, Modal } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | |
| | | </div> |
| | | {appType === 'mob' && config ? |
| | | <div className="mob-shell"> |
| | | <MobShell config={config} deleteCard={this.deleteCard} editCard={this.editCard} editId={editElem ? editElem.uuid : ''} handleList={this.updateConfig} /> |
| | | <MobShell |
| | | config={config} |
| | | deleteCard={this.deleteCard} |
| | | editCard={this.editCard} |
| | | editId={editElem ? editElem.uuid : ''} |
| | | handleList={this.updateConfig} |
| | | /> |
| | | </div> : null |
| | | } |
| | | <div className="mob-setting"> |
| | | {config ? <Tabs defaultActiveKey="2" animated={false} size="small"> |
| | | <TabPane tab="配置" key="1"> |
| | | {/* <SketchPicker /> */} |
| | | <Controller /> |
| | | <Controller editElem={editElem} /> |
| | | </TabPane> |
| | | <TabPane tab="数据源" key="2"> |
| | | <DataSource config={config} updateConfig={this.updateConfig} /> |
| | |
| | | _selectItem.left = _left |
| | | _selectItem.top = _top |
| | | |
| | | let result = this.resetItem(_selectItem) |
| | | let result = this.resetItem(fromJS(_selectItem).toJS()) |
| | | |
| | | if (!is(fromJS(result), fromJS(_preItem))) { |
| | | _preItem = JSON.parse(JSON.stringify(result)) |
| | |
| | | |
| | | } |
| | | |
| | | resetItem = (item) => { |
| | | let _item = JSON.parse(JSON.stringify(item)) |
| | | resetItem = (_item) => { |
| | | const { config } = this.state |
| | | let oriItem = fromJS(config.elements.filter(ele => ele.uuid === _item.uuid)[0]).toJS() // 源编辑元素 |
| | | _item.width = +_item.width |
| | | _item.height = +_item.height |
| | | |
| | | let _boxwidth = +config.width |
| | | let _boxheight = +config.height |
| | | let _left = +_item.left |
| | | let _top = +_item.top |
| | | let _width = +_item.width |
| | | let _height = +_item.height |
| | | let _width = _item.width |
| | | let _height = _item.height |
| | | |
| | | if (_left < 0) { |
| | | _item.left = 0 |
| | |
| | | } |
| | | |
| | | if (_item.type === 'barcode') { |
| | | if (+_item.barcodeWidth > +_item.width) { |
| | | _item.barcodeWidth = +_item.width |
| | | _item.barcodeWidth = +_item.barcodeWidth |
| | | _item.barcodeHeight = +_item.barcodeHeight |
| | | |
| | | if (oriItem.width !== _item.width || oriItem.height !== _item.height) { |
| | | _item.barcodeWidth = _item.width * 0.8 |
| | | _item.barcodeHeight = _item.height * 0.6 |
| | | } else if (_item.barcodeLabel === 'true') { |
| | | if (_item.barcodeWidth > _item.width) { |
| | | _item.barcodeWidth = _item.width |
| | | } |
| | | if (+_item.barcodeHeight > +_item.height) { |
| | | _item.barcodeHeight = +_item.height |
| | | let fsize = Math.floor(_item.fontSize / 2) |
| | | if (_item.barcodeHeight + fsize > _item.height) { |
| | | _item.barcodeHeight = _item.height - fsize |
| | | } |
| | | } else { |
| | | if (_item.barcodeWidth > _item.width) { |
| | | _item.barcodeWidth = _item.width |
| | | } |
| | | if (_item.barcodeHeight > _item.height) { |
| | | _item.barcodeHeight = _item.height |
| | | } |
| | | } |
| | | } else if (_item.type === 'qrcode') { |
| | | if (+_item.qrcodeWidth > +_item.width) { |
| | | _item.qrcodeWidth = +_item.width |
| | | _item.qrcodeWidth = +_item.qrcodeWidth |
| | | |
| | | if (oriItem.width !== _item.width || oriItem.height !== _item.height) { |
| | | if (_item.height > _item.width) { |
| | | _item.qrcodeWidth = _item.width * 0.9 |
| | | } else if (_item.width > _item.height) { |
| | | _item.qrcodeWidth = _item.height * 0.9 |
| | | } |
| | | if (+_item.qrcodeWidth > +_item.height) { |
| | | _item.qrcodeWidth = +_item.height |
| | | } else { |
| | | if (_item.qrcodeWidth > _item.width) { |
| | | _item.qrcodeWidth = _item.width |
| | | } |
| | | if (_item.qrcodeWidth > _item.height) { |
| | | _item.qrcodeWidth = _item.height |
| | | } |
| | | } |
| | | } else if (_item.type === 'image') { |
| | | if (+_item.imgWidth > +_item.width) { |
| | | _item.imgWidth = +_item.width |
| | | _item.imgWidth = +_item.imgWidth |
| | | |
| | | if (oriItem.width !== _item.width || oriItem.height !== _item.height) { |
| | | _item.imgWidth = _item.width * 0.9 |
| | | _item.imgHeight = _item.height * 0.9 |
| | | } else { |
| | | if (_item.imgWidth > _item.width) { |
| | | _item.imgWidth = _item.width |
| | | } |
| | | if (+_item.imgHeight > +_item.height) { |
| | | _item.imgHeight = +_item.height |
| | | if (_item.imgHeight > _item.height) { |
| | | _item.imgHeight = _item.height |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | handleSubmit = () => { |
| | | const { config } = this.state |
| | | |
| | | this.FormRef.handleConfirm().then(res => { |
| | | this.FormRef.handleConfirm().then(response => { |
| | | let res = fromJS(response).toJS() |
| | | if (res.type === 'Template') { |
| | | res.width = parseInt(res.width) |
| | | res.height = parseInt(res.height) |
| | |
| | | } else if (res.type === 'qrcode') { |
| | | res.url = qrurl |
| | | } else if (res.type === 'image') { |
| | | if (res.value && res.value.length > 0) { |
| | | let url = res.value[0].url || res.value[0].response |
| | | res.value = url || '' |
| | | } else { |
| | | res.value = '' |
| | | } |
| | | res.url = imgurl |
| | | } |
| | | |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, InputNumber, Select } from 'antd' |
| | | import { formRule } from '@/utils/option.js' |
| | | import FileUpload from '../fileupload' |
| | | import FileUpload from '@/tabviews/zshare/fileupload' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | |
| | | if (!isCusField) { |
| | | delete fieldsvalue.cusfield |
| | | } |
| | | if (nextProps.editItem.type === 'image' && fieldsvalue.value) { |
| | | fieldsvalue.value = [{ |
| | | uid: '1', |
| | | name: fieldsvalue.value, |
| | | status: 'done', |
| | | url: fieldsvalue.value |
| | | }] |
| | | } else if (nextProps.editItem.type === 'image') { |
| | | fieldsvalue.value = [] |
| | | } |
| | | |
| | | this.props.form.setFieldsValue(fieldsvalue) |
| | | }) |
| | | |
| | |
| | | this.handleSubmit() |
| | | } |
| | | |
| | | updateImg = (list) => { |
| | | if (list && list.length > 0) { |
| | | let url = list[0].url || list[0].response |
| | | if (url) { |
| | | this.props.form.setFieldsValue({ value: list }) |
| | | this.handleSubmit() |
| | | } |
| | | } else { |
| | | this.props.form.setFieldsValue({ value: [] }) |
| | | this.handleSubmit() |
| | | } |
| | | } |
| | | |
| | | resetForm = (param) => { |
| | | let _param = JSON.parse(JSON.stringify(param)) |
| | | delete _param.type |
| | |
| | | |
| | | if (_param.field !== 'other_field') { |
| | | delete _param.cusfield |
| | | } |
| | | if (param.type === 'image' && param.value) { |
| | | _param.value = [{ |
| | | uid: '1', |
| | | name: param.value, |
| | | status: 'done', |
| | | url: param.value |
| | | }] |
| | | } else if (param.type === 'image') { |
| | | _param.value = [] |
| | | } |
| | | |
| | | this.props.form.setFieldsValue(_param) |
| | |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'fileupload') { |
| | | let filelist = this.props.data ? this.props.data[item.field] : item.initval |
| | | if (filelist && this.state.readin[item.field]) { |
| | | try { |
| | | filelist = filelist.split(',').map((url, index) => { |
| | | return { |
| | | uid: `${index}`, |
| | | name: url.slice(url.lastIndexOf('/') + 1), |
| | | let filelist = [] |
| | | if (item.initval) { |
| | | filelist = [{ |
| | | uid: '1', |
| | | name: item.initval, |
| | | status: 'done', |
| | | url: url, |
| | | origin: true |
| | | } |
| | | }) |
| | | } catch { |
| | | filelist = [] |
| | | } |
| | | } else { |
| | | filelist = [] |
| | | url: item.initval |
| | | }] |
| | | } |
| | | |
| | | fields.push( |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <FileUpload /> |
| | | <FileUpload maxFile={1} fileType={'text'} onChange={this.updateImg} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | initval: item.name, |
| | | required: false |
| | | }, |
| | | // { |
| | | // type: 'text', |
| | | // key: 'value', |
| | | // label: '图片地址', |
| | | // initval: item.value, |
| | | // required: false |
| | | // }, |
| | | { |
| | | type: 'fileupload', |
| | | key: 'value', |
| | | label: '图片地址', |
| | | initval: item.value, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'field', |
| | |
| | | } |
| | | |
| | | let image = new Image() |
| | | image.src = element.value || element.url |
| | | image.src = element.url |
| | | if (element.value && element.value.indexOf(window.location.hostname) > -1) { |
| | | image.src = element.value |
| | | } |
| | | |
| | | if (image.complete) { |
| | | context.drawImage(image, _left, _top, element.imgWidth, element.imgHeight) |