| | |
| | | background-color: unset; |
| | | color: unset; |
| | | } |
| | | .side-menu.ant-menu-dark .ant-menu-item.ant-menu-item-selected { |
| | | .mk-side-menu.ant-menu-dark .ant-menu-item.ant-menu-item-selected { |
| | | background-color: unset; |
| | | color: unset; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | #root > .main-view { |
| | | #root > .mk-main-view { |
| | | > .header-container { |
| | | background: $bg1; |
| | | color: $font1; |
| | |
| | | } |
| | | } |
| | | } |
| | | > .side-menu { |
| | | > .mk-side-menu { |
| | | border-right: 1px solid #d9d9d9; |
| | | background: $bg1; |
| | | > .ant-menu { |
| | |
| | | } |
| | | } |
| | | } |
| | | > .side-menu:not(.edit) { |
| | | > .mk-side-menu:not(.edit) { |
| | | > .ant-menu { |
| | | > .ant-menu-submenu { |
| | | > .ant-menu-sub { |
| | |
| | | } |
| | | } |
| | | } |
| | | >.content-box { |
| | | >.mk-tabview-wrap { |
| | | >.content-header { |
| | | >.ant-tabs { |
| | | >.ant-tabs-bar { |
| | |
| | | } |
| | | |
| | | @mixin bgblack() { |
| | | #root > .main-view { |
| | | #root > .mk-main-view { |
| | | > .header-container { |
| | | box-shadow: none; |
| | | > .header-menu { |
| | |
| | | {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 !== 'production' ? |
| | | {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 |
| | | } */} |
| | | } |
| | | {/* window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'home', MenuId: 'home_page_id', MenuName: '首页' }))) */} |
| | | {this.props.editState && !this.props.editLevel && window.GLOB.systemType !== 'production' && this.props.memberLevel >= 20 ? |
| | | <a className="home-edit" href={`#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=`} target="_blank" rel="noopener noreferrer"> |
| | |
| | | const { mainMenu } = this.props |
| | | const editShow = (this.props.editState && !this.props.editLevel) || false |
| | | |
| | | if (mainMenu === '') return (<span className="side-menu-hidden"></span>) |
| | | if (mainMenu === '') return (<span className="mk-side-menu-hidden"></span>) |
| | | |
| | | return ( |
| | | <aside className={"side-menu ant-menu-dark" + (this.props.collapse ? ' side-menu-collapsed' : '') + (this.props.isiframe ? ' iframe' : '') + (this.props.editState ? ' edit' : '')}> |
| | | <aside id="mk-sidemenu-wrap" className={'mk-side-menu ant-menu-dark' + (this.props.collapse ? ' collapsed' : '') + (this.props.isiframe ? ' mk-iframe' : '') + (this.props.editState ? ' mk-edit' : '')}> |
| | | {!(this.props.editLevel === 'level2' || this.props.editLevel === 'level3') && |
| | | <Menu openKeys={this.state.openKeys} onOpenChange={this.onOpenChange} mode="inline" theme="dark" inlineCollapsed={this.props.collapse}> |
| | | {editShow && <li className="sup-menu"><Icon onClick={this.enterSubEdit} className="edit-check" type="edit" /></li>} |
| | |
| | | @import '../../assets/css/iconfont.css'; |
| | | @import '../../assets/css/global.scss'; |
| | | |
| | | .side-menu { |
| | | .mk-side-menu { |
| | | flex: 0 0 235px; |
| | | width: 235px; |
| | | padding: 48px 0 40px; |
| | |
| | | left: 187px; |
| | | } |
| | | } |
| | | .side-menu.edit { // 编辑时控制菜单底色 |
| | | .mk-side-menu.mk-edit { // 编辑时控制菜单底色 |
| | | .ant-menu-sub.ant-menu-inline { |
| | | > .ant-menu-item.ant-menu-item-selected { |
| | | background: unset; |
| | |
| | | } |
| | | } |
| | | } |
| | | .side-menu.iframe { // tab页中为iframe时 |
| | | .mk-side-menu.mk-iframe { // tab页中为iframe时 |
| | | max-height: 100vh; |
| | | overflow-y: scroll; |
| | | &::-webkit-scrollbar { |
| | | display: none; |
| | | } |
| | | } |
| | | .side-menu.side-menu-collapsed { // 左侧菜单合并时 |
| | | .mk-side-menu.collapsed { // 左侧菜单合并时 |
| | | flex: 0 0 80px; |
| | | width: 80px; |
| | | } |
| | |
| | | const { tabviews, activeId } = this.state |
| | | |
| | | return ( |
| | | <section className={'flex-container content-box' + (this.props.collapse ? ' collapsed' : '')}> |
| | | <section id="mk-tabview-wrap" className={'mk-tabview-wrap' + (this.props.collapse ? ' collapsed' : '')}> |
| | | <div className="content-header"> |
| | | {tabviews && tabviews.length > 0 && |
| | | <Tabs activeKey={activeId}> |
| | |
| | | .content-box { |
| | | .mk-tabview-wrap { |
| | | display: flex; |
| | | flex: auto; |
| | | min-height: 100%; |
| | | padding-top: 48px; |
| | | max-width: calc(100% - 235px); |
| | | transition: max-width 0.2s; |
| | |
| | | right: 30px; |
| | | } |
| | | } |
| | | .content-box.collapsed { |
| | | .mk-tabview-wrap.collapsed { |
| | | max-width: calc(100% - 80px); |
| | | } |
| | | .side-menu-hidden + .content-box, .side-menu-hidden + .content-box.collapsed { |
| | | .mk-side-menu-hidden + .mk-tabview-wrap, .mk-side-menu-hidden + .mk-tabview-wrap.collapsed { |
| | | max-width: 100%; |
| | | >.content-header >.ant-tabs >.ant-tabs-bar { |
| | | display: none; |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, Select, Icon, Radio, Tooltip, InputNumber, notification } from 'antd' |
| | | import { Form, Row, Col, Input, Select, Icon, Radio, Tooltip, InputNumber } from 'antd' |
| | | |
| | | import { formRule } from '@/utils/option.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | link: '' |
| | | } |
| | | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card, config } = this.props |
| | | let _options = this.getOptions(card.eleType, card.datatype, card.link) |
| | |
| | | } else if (card.eleType === 'number') { |
| | | item.options = item.oriOptions.filter(op => op.value !== 'YYYY-MM-DD') |
| | | } |
| | | } else if (item.key === 'url') { |
| | | item.required = card.eleType !== 'qrcode' |
| | | } |
| | | if (item.key === 'linkurl') { |
| | | item.type = card.link === 'dynamic' ? 'select' : 'text' |
| | |
| | | } else if (value === 'number') { |
| | | item.options = item.oriOptions.filter(op => op.value !== 'YYYY-MM-DD') |
| | | } |
| | | } else if (item.key === 'url') { |
| | | item.required = value !== 'qrcode' |
| | | } |
| | | |
| | | return item |
| | |
| | | values.uuid = this.props.card.uuid |
| | | values.marks = this.props.card.marks || null |
| | | |
| | | if (values.eleType === 'picture' && values.datatype === 'static' && !values.url) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '尚未添加图片或图片上传失败,请重新添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | // if (values.eleType === 'picture' && values.datatype === 'static' && !values.url) { |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: '尚未添加图片或图片上传失败,请重新添加!', |
| | | // duration: 5 |
| | | // }) |
| | | // return |
| | | // } |
| | | |
| | | resolve(values) |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } |
| | | .ant-form-explain, .ant-form-extra { |
| | | font-size: 13px; |
| | | } |
| | | } |
| | |
| | | label: '图片/文件', |
| | | initVal: card.url || '', |
| | | maxfile: 1, |
| | | required: false |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Popover, Button, Icon } from 'antd' |
| | | import { Radio, Icon, Modal } from 'antd' |
| | | |
| | | import PopSource from './popsource' |
| | | import InputForm from './inputform' |
| | | import './index.scss' |
| | | |
| | | class CopyComponent extends Component { |
| | |
| | | } |
| | | |
| | | state = { |
| | | url: this.props.value |
| | | url: this.props.value, |
| | | visible: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | this.props.onChange('') |
| | | } |
| | | |
| | | changePopover = (visible) => { |
| | | if (!visible && this.SourceWrap.state.url) { |
| | | this.setState({url: this.SourceWrap.state.url}) |
| | | this.props.onChange(this.SourceWrap.state.url) |
| | | } else if (visible && this.SourceWrap) { |
| | | this.SourceWrap.init() |
| | | handleChange = (key) => { |
| | | this.setState({visible: key}) |
| | | } |
| | | |
| | | popSubmit = () => { |
| | | let url = '' |
| | | if (this.inputWrap && this.inputWrap.state.url) { |
| | | url = this.inputWrap.state.url |
| | | } |
| | | |
| | | this.setState({visible: '', url}) |
| | | this.props.onChange(url) |
| | | } |
| | | |
| | | render () { |
| | | const { url } = this.state |
| | | const { type, placement } = this.props |
| | | const { url, visible } = this.state |
| | | const { type } = this.props |
| | | let name = url ? url.slice(url.lastIndexOf('/') + 1) : '' |
| | | |
| | | return ( |
| | | <div className="mk-source-wrap"> |
| | | {!url ? <Popover overlayClassName="mk-source-manage" placement={placement || 'top'} content={<PopSource type={type} ref={dom => { this.SourceWrap = dom }} />} trigger="click" onVisibleChange={this.changePopover}> |
| | | <Button icon="upload">点击添加</Button> |
| | | </Popover> : null} |
| | | {!url ? <Radio.Group> |
| | | <Radio.Button value="input" size="small" onClick={() => this.handleChange('input')}>输入</Radio.Button> |
| | | <Radio.Button value="upload" size="small" onClick={() => this.handleChange('upload')}>上传</Radio.Button> |
| | | <Radio.Button value="system" size="small" onClick={() => this.handleChange('system')}>系统</Radio.Button> |
| | | </Radio.Group> : null} |
| | | {url ? <div className="mk-source-item-info"> |
| | | <Icon type="paper-clip" /> |
| | | <a target="_blank" rel="noopener noreferrer" href={url}>{name}</a> |
| | | <Icon title="删除文件" type="delete" onClick={this.deleteUrl}/> |
| | | </div> : null} |
| | | <Modal |
| | | visible={!!visible} |
| | | width={visible !== 'system' ? 600 : 1000} |
| | | closable={false} |
| | | maskClosable={false} |
| | | onOk={this.popSubmit} |
| | | onCancel={() => {this.setState({visible: ''})}} |
| | | destroyOnClose |
| | | > |
| | | <InputForm type={type === 'picture' ? 'image' : type} keyword={visible} ref={dom => { this.inputWrap = dom }} /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | display: inline-block; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .mk-source-manage { |
| | | z-index: 1170 !important; |
| | | .ant-radio-button-wrapper { |
| | | height: 28px; |
| | | line-height: 26px; |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Input, Form, Row, Col, Pagination, Empty, Button, Modal, notification } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | const { Search } = Input |
| | | const FileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload')) |
| | | const Video = asyncComponent(() => import('@/menu/picturecontroller/video')) |
| | | const Image = asyncComponent(() => import('@/components/Image')) |
| | | const EditForm = asyncComponent(() => import('@/menu/picturecontroller/editform')) |
| | | |
| | | class PopSource extends Component { |
| | | static propTpyes = { |
| | | btnlog: PropTypes.array, |
| | | keyword: PropTypes.string, |
| | | handlelog: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | url: '', |
| | | originlist: [], |
| | | list: [], |
| | | pagelist: [], |
| | | fileList: [], |
| | | searchKey: '', |
| | | pageSize: 12, |
| | | pageIndex: 1, |
| | | selectId: '', |
| | | editvisible: false, |
| | | card: null |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | if (this.props.keyword === 'system') { |
| | | this.init() |
| | | } |
| | | } |
| | | |
| | | componentDidMount() { |
| | | try { |
| | | let _form = document.getElementById('source-input') |
| | | |
| | | if (_form && _form.focus) { |
| | | _form.focus() |
| | | } |
| | | } catch {} |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | init = () => { |
| | | const { type } = this.props |
| | | |
| | | let originlist = [] |
| | | if (type === 'video') { |
| | | let videos = sessionStorage.getItem('app_videos') |
| | | try { |
| | | originlist = JSON.parse(videos) |
| | | } catch { |
| | | originlist = [] |
| | | } |
| | | } else { |
| | | let pictures = sessionStorage.getItem('app_pictures') |
| | | try { |
| | | originlist = JSON.parse(pictures) |
| | | } catch { |
| | | originlist = [] |
| | | } |
| | | } |
| | | |
| | | let list = originlist |
| | | let pagelist = list.filter((item, index) => index < this.state.pageSize) |
| | | |
| | | this.setState({originlist, list, url: '', searchKey: '', pageIndex: 1, fileList: [], pagelist}) |
| | | } |
| | | |
| | | changeSearch = () => { |
| | | const { originlist, pageSize, searchKey } = this.state |
| | | let list = originlist.filter(item => item.remark.indexOf(searchKey) > -1) |
| | | let pagelist = list.filter((item, index) => index < pageSize) |
| | | |
| | | this.setState({list, pagelist, pageIndex: 1}) |
| | | } |
| | | |
| | | changeValue = (e) => { |
| | | this.setState({url: e.target.value}) |
| | | } |
| | | |
| | | changeSize = (page) => { |
| | | const { list, pageSize } = this.state |
| | | let pagelist = list.filter((item, index) => index < pageSize * page && index >= pageSize * (page - 1)) |
| | | this.setState({pageIndex: page, pagelist}) |
| | | } |
| | | |
| | | changeFile = (vals) => { |
| | | this.setState({fileList: vals}) |
| | | |
| | | if (vals && vals[0] && vals[0].status === 'done' && vals[0].response) { |
| | | this.setState({url: vals[0].response}) |
| | | } |
| | | } |
| | | |
| | | selectItem = (item) => { |
| | | if (item.linkurl) { |
| | | this.setState({url: item.linkurl, selectId: item.id}) |
| | | } |
| | | } |
| | | |
| | | handleSource = (item) => { |
| | | this.setState({ |
| | | editvisible: true, |
| | | card: item |
| | | }) |
| | | } |
| | | |
| | | save = () => { |
| | | const { card } = this.state |
| | | this.editFormRef.handleConfirm().then(res => { |
| | | res = {...card, ...res} |
| | | |
| | | if (!res.id) { |
| | | res.id = Utils.getuuid() |
| | | } |
| | | |
| | | Api.getSystemConfig({ |
| | | func: 's_url_db_adduptdel', |
| | | id: res.id, |
| | | PageIndex: 0, // 0 代表全部 |
| | | PageSize: 0, // 0 代表全部 |
| | | remark: res.remark || '', |
| | | linkurl: res.linkurl, |
| | | typecharone: card.typecharone, |
| | | type: 'add' |
| | | }).then(result => { |
| | | if (result.status) { |
| | | if (card.typecharone === 'image') { |
| | | sessionStorage.setItem('app_pictures', JSON.stringify(result.data || [])) |
| | | this.init() |
| | | } else { |
| | | sessionStorage.setItem('app_videos', JSON.stringify(result.data || [])) |
| | | this.init() |
| | | } |
| | | this.setState({editvisible: false}) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { type, keyword } = this.props |
| | | const { list, url, pagelist, fileList, searchKey, pageIndex, pageSize, selectId, editvisible, card } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-source-pop-wrap"> |
| | | {keyword === 'input' ? <Form.Item label="地址" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | | <TextArea id="source-input" value={url} rows={4} onChange={this.changeValue}/> |
| | | </Form.Item> : null} |
| | | {keyword === 'upload' ? <Form.Item label="上传" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | | <FileUpload value={fileList} onChange={this.changeFile} accept={type === 'video' ? '.mp4,.webm,.ogg' : '.jpg,.png,.gif,.pjp,.pjpeg,.jpeg,.jfif,.webp'} maxFile={1} fileType={type === 'video' ? 'text' : 'picture'} /> |
| | | </Form.Item> : null} |
| | | {keyword === 'system' ? |
| | | <Search value={searchKey} placeholder="" onChange={(e) => this.setState({searchKey: e.target.value})} onSearch={this.changeSearch} enterButton/> : null} |
| | | {keyword === 'system' ? <Button className="picture-plus mk-green" icon="plus" onClick={() => this.handleSource({typecharone: type})}> |
| | | 添加 |
| | | </Button> : null} |
| | | {keyword === 'system' && list.length ? |
| | | <Row gutter={16} style={{minHeight: '250px'}}> |
| | | {pagelist.map(item => ( |
| | | <Col span={4} key={item.id}> |
| | | <div className={'image-video-box' + (selectId === item.id ? ' active' : '')} onClick={() => this.selectItem(item)}> |
| | | <div className="image-video-box-body"> |
| | | {type !== 'video' ? <Image url={item.linkurl} /> : null} |
| | | {type === 'video' ? <Video value={item.linkurl} /> : null} |
| | | </div> |
| | | </div> |
| | | </Col> |
| | | ))} |
| | | </Row> : null} |
| | | {keyword === 'system' && list.length === 0 ? <Empty description={null}/> : null} |
| | | {keyword === 'system' && list.length > pageSize ? <Pagination size="small" current={pageIndex} pageSize={pageSize} onChange={this.changeSize} total={list.length} /> : null} |
| | | <Modal |
| | | title={'新建'} |
| | | wrapClassName="picture-edit-model" |
| | | visible={editvisible} |
| | | width={600} |
| | | maskClosable={false} |
| | | onOk={this.save} |
| | | onCancel={() => {this.setState({editvisible: false})}} |
| | | destroyOnClose |
| | | > |
| | | <EditForm card={card} wrappedComponentRef={(inst) => this.editFormRef = inst} inputSubmit={this.save}/> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default PopSource |
New file |
| | |
| | | .mk-source-pop-wrap { |
| | | padding: 20px 10px 15px; |
| | | min-height: 150px; |
| | | |
| | | .image-video-box { |
| | | position: relative; |
| | | padding-top: 75%; |
| | | cursor: pointer; |
| | | margin-bottom: 16px; |
| | | transition: all 0.3s; |
| | | .image-video-box-body { |
| | | position: absolute; |
| | | top: 0px; |
| | | left: 0px; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | .video-react-big-play-button { |
| | | display: none; |
| | | } |
| | | .video-react-control-bar { |
| | | display: none; |
| | | } |
| | | } |
| | | .image-video-box-body::after { |
| | | content: ''; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | } |
| | | } |
| | | .image-video-box.active { |
| | | box-shadow: 0px 0px 8px #1890ff; |
| | | } |
| | | .ant-input-search { |
| | | width: 300px; |
| | | position: relative; |
| | | top: -15px; |
| | | } |
| | | .ant-empty { |
| | | height: 250px; |
| | | padding-top: 50px; |
| | | } |
| | | .ant-pagination { |
| | | text-align: right; |
| | | } |
| | | .picture-plus { |
| | | float: right; |
| | | position: relative; |
| | | top: -15px; |
| | | } |
| | | } |
| | | .picture-edit-model { |
| | | .ant-modal { |
| | | .ant-modal-body { |
| | | min-height: 200px; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <FileUpload accept=".jpg,.png,.gif,.pjp,.pjpeg,.jpeg,.jfif,.webp" maxFile={1} fileType={'text'} /> |
| | | <FileUpload accept=".jpg,.png,.gif,.pjp,.pjpeg,.jpeg,.jfif,.webp" maxFile={1} fileType={'picture'} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | |
| | | .picture-edit-model-form { |
| | | min-height: 150px; |
| | | .ant-input:read-only { |
| | | background: #fafafa; |
| | | resize: none; |
| | | } |
| | | .ant-input:read-only:hover, .ant-input:read-only:focus { |
| | | border-color: #d9d9d9; |
| | | box-shadow: none; |
| | | } |
| | | .ant-form-explain, .ant-form-extra { |
| | | font-size: 13px; |
| | | } |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import { Modal, Button, Row, Col, Input, Icon, message, Tabs, Empty, Pagination } from 'antd' |
| | | import { Modal, Button, Row, Col, Input, Icon, message, Tabs, Empty, Pagination, notification } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | this.resetVideo(result.data || []) |
| | | } |
| | | this.setState({editvisible: false}) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | |
| | | sessionStorage.setItem('app_videos', JSON.stringify(res.data || [])) |
| | | _this.resetVideo(res.data || []) |
| | | } |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | resolve() |
| | | }) |
| | |
| | | <Search placeholder="" value={imageKey} onChange={(e) => this.setState({imageKey: e.target.value})} onSearch={this.filterPicture} enterButton /> |
| | | </Col> |
| | | <Col span={16}> |
| | | <Button className="picture-plus" type="link" icon="plus" onClick={() => this.handleSource({typecharone: 'image'})}> |
| | | <Button className="picture-plus mk-green" icon="plus" onClick={() => this.handleSource({typecharone: 'image'})}> |
| | | 添加 |
| | | </Button> |
| | | </Col> |
| | |
| | | <Search placeholder="" value={videoKey} onChange={e => this.setState({videoKey: e.target.value})} onSearch={this.filterVideo} enterButton /> |
| | | </Col> |
| | | <Col span={16}> |
| | | <Button className="picture-plus" type="link" icon="plus" onClick={() => this.handleSource({typecharone: 'video'})}> |
| | | <Button className="picture-plus mk-green" icon="plus" onClick={() => this.handleSource({typecharone: 'video'})}> |
| | | 添加 |
| | | </Button> |
| | | </Col> |
| | |
| | | .picture-plus { |
| | | float: right; |
| | | font-size: 16px; |
| | | color: rgb(38, 194, 129); |
| | | } |
| | | .image-video-box { |
| | | position: relative; |
| | |
| | | text-align: right; |
| | | } |
| | | } |
| | | .picture-edit-model { |
| | | .ant-modal { |
| | | .ant-modal-body { |
| | | min-height: 200px; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | loadOutResource = (params) => { |
| | | let setting = params.shift() |
| | | loadOutResource = (inters) => { |
| | | let setting = inters.shift() |
| | | let param = UtilsDM.getPrevQueryParams(setting, [], this.state.BID, this.props.menuType) |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | if (res.mk_ex_invoke === 'false') { |
| | | if (params.length > 0) { |
| | | this.loadOutResource(params) |
| | | if (inters.length > 0) { |
| | | this.loadOutResource(inters) |
| | | } |
| | | } else { |
| | | this.customOuterRequest(res, setting, params) |
| | | this.customOuterRequest(res, setting, inters) |
| | | } |
| | | } else { |
| | | notification.error({ |
| | |
| | | }) |
| | | } |
| | | |
| | | customOuterRequest = (result, setting, params) => { |
| | | customOuterRequest = (result, setting, inters) => { |
| | | let url = '' |
| | | |
| | | if (window.GLOB.systemType === 'production') { |
| | |
| | | $ErrMesg: error |
| | | } |
| | | |
| | | this.customCallbackRequest(_result, setting, params) |
| | | this.customCallbackRequest(_result, setting, inters) |
| | | } else { |
| | | res.mk_api_key = mkey |
| | | this.customCallbackRequest(res, setting, params) |
| | | this.customCallbackRequest(res, setting, inters) |
| | | } |
| | | }, (e) => { |
| | | let _result = { |
| | |
| | | $ErrMesg: e && e.statusText ? e.statusText : '' |
| | | } |
| | | |
| | | this.customCallbackRequest(_result, setting, params) |
| | | this.customCallbackRequest(_result, setting, inters) |
| | | }) |
| | | } |
| | | |
| | | customCallbackRequest = (result, setting, params) => { |
| | | customCallbackRequest = (result, setting, inters) => { |
| | | let errSql = '' |
| | | if (result.$ErrCode === 'E') { |
| | | errSql = ` |
| | |
| | | } else { |
| | | param.func = 's_ex_result_back' |
| | | param.s_ex_result = lines.map((item, index) => ({ |
| | | MenuID: this.props.MenuID, |
| | | MenuName: this.props.MenuName, |
| | | MenuID: this.props.MenuID || '', |
| | | MenuName: this.props.MenuName || '', |
| | | TableName: item.table, |
| | | LongText: window.btoa(window.encodeURIComponent(`${item.insert} ${item.selects.join(` union all `)}`)), |
| | | Sort: index + 1 |
| | |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | if (params.length > 0) { |
| | | this.loadOutResource(params) |
| | | if (inters.length > 0) { |
| | | this.loadOutResource(inters) |
| | | } |
| | | } else { |
| | | notification.error({ |
| | |
| | | |
| | | state = { |
| | | percent: 0, |
| | | showprogress: false |
| | | showprogress: false, |
| | | filelist: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { value } = this.props |
| | | if (!value) return |
| | | |
| | | this.setState({filelist: fromJS(value).toJS()}) |
| | | } |
| | | |
| | | onChange = ({ fileList }) => { |
| | | const { onChange } = this.props |
| | | |
| | | fileList = fileList.map(item => { |
| | | if (item.status === 'error' && /^<!DOCTYPE html>/.test(item.response)) { |
| | | item.response = '' |
| | |
| | | return item |
| | | }) |
| | | |
| | | if (onChange) { |
| | | onChange([...fileList]) |
| | | } |
| | | this.setState({filelist: fileList}) |
| | | this.props.onChange(fileList) |
| | | } |
| | | |
| | | onRemove = file => { |
| | | const { value, onChange } = this.props |
| | | const files = this.state.filelist.filter(v => v.uid !== file.uid) |
| | | |
| | | const files = value.filter(v => v.url !== file.url) |
| | | |
| | | if (onChange) { |
| | | onChange(files) |
| | | } |
| | | this.setState({filelist: files}) |
| | | this.props.onChange(files) |
| | | } |
| | | |
| | | onUpdate = (url) => { |
| | | const { value, onChange } = this.props |
| | | let filelist = fromJS(this.state.filelist).toJS() |
| | | |
| | | let filelist = fromJS(value).toJS() |
| | | if (filelist[filelist.length -1]) { |
| | | filelist[filelist.length -1].status = 'done' |
| | | filelist[filelist.length -1].response = url |
| | | filelist[filelist.length -1].origin = false |
| | | |
| | | if (onChange) { |
| | | onChange([...filelist]) |
| | | } |
| | | |
| | | this.setState({filelist}) |
| | | this.props.onChange(filelist) |
| | | } |
| | | |
| | | onDelete = (msg) => { |
| | | const { value, onChange } = this.props |
| | | let filelist = value.filter(v => !v.url && !v.response) |
| | | let filelist = this.state.filelist.filter(v => !v.url && !v.response) |
| | | |
| | | if (onChange) { |
| | | onChange([...filelist]) |
| | | } |
| | | |
| | | this.setState({ |
| | | showprogress: false |
| | | }) |
| | | this.setState({filelist, showprogress: false}) |
| | | this.props.onChange(filelist) |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { value, maxFile, fileType, accept } = this.props |
| | | const { showprogress, percent } = this.state |
| | | const { maxFile, fileType, accept } = this.props |
| | | const { showprogress, percent, filelist } = this.state |
| | | |
| | | let uploadable = 'fileupload-form-container ' |
| | | |
| | | if (maxFile && maxFile > 0 && value && value.length >= maxFile) { |
| | | if (maxFile && maxFile > 0 && filelist.length >= maxFile) { |
| | | uploadable += 'limit-fileupload' |
| | | } |
| | | |
| | |
| | | name: 'file', |
| | | disabled: showprogress, |
| | | listType: fileType, |
| | | fileList: value, |
| | | fileList: filelist, |
| | | action: null, |
| | | accept: accept || '', |
| | | method: 'post', |
| | |
| | | class Main extends Component { |
| | | render () { |
| | | return ( |
| | | <div className="flex-container main-view"> |
| | | <div className="mk-main-view"> |
| | | <ConfigProvider locale={_locale}> |
| | | <Header key="header"/> |
| | | <Sidemenu key="sidemenu"/> |
| | |
| | | .flex-container { |
| | | .mk-main-view { |
| | | display: flex; |
| | | flex: auto; |
| | | min-height: 100%; |