Merge branch 'master' into positec
| | |
| | | |
| | | class Api { |
| | | constructor() { |
| | | if (process.env.NODE_ENV === 'production') { |
| | | axios.defaults.baseURL = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | axios.defaults.baseURL = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | axios.defaults.baseURL = window.GLOB.baseurl |
| | | } |
| | | |
| | | /** |
| | |
| | | * @description 微信业务请求 |
| | | */ |
| | | wxAccessToken () { |
| | | let _url = document.location.origin + '/' + window.GLOB.service + 'wxpay/getaccesstoken' |
| | | let _url = window.GLOB.baseurl + 'wxpay/getaccesstoken' |
| | | if (process.env.NODE_ENV !== 'production') { |
| | | _url = document.location.origin + '/wxpay/getaccesstoken' |
| | | } |
| | |
| | | * @description 获取微信支付二维码 |
| | | */ |
| | | getWxNativePay (param) { |
| | | let _url = document.location.origin + '/' + window.GLOB.service + 'wxpay/wxNativePay' |
| | | let _url = window.GLOB.baseurl + 'wxpay/wxNativePay' |
| | | if (process.env.NODE_ENV !== 'production') { |
| | | _url = document.location.origin + '/wxpay/wxNativePay' |
| | | } |
| | |
| | | const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) |
| | | const FormTab = asyncComponent(() => import('@/tabviews/formtab')) |
| | | |
| | | let service = '' |
| | | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | service = document.location.origin + '/' + window.GLOB.service + 'zh-CN/' |
| | | } else { |
| | | service = window.GLOB.location + '/' + window.GLOB.service + 'zh-CN/' |
| | | } |
| | | |
| | | class BreadView extends Component { |
| | | state = { |
| | | tabview: null, // 标签 |
| | |
| | | } 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 === 'iframe') { |
| | | return (<Iframe key={view.MenuID} MenuID={view.MenuID} MenuNo={view.MenuNo} title={view.MenuName} MenuName={view.MenuName} url={service + view.LinkUrl}/>) |
| | | 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 { |
| | | return (<NotFount key={view.MenuID} />) |
| | | } |
| | |
| | | |
| | | BraftEditor.use(Table()) |
| | | |
| | | let service = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | service = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | service = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | |
| | | class NormalEditor extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, |
| | |
| | | form.append('file', _param.binary) |
| | | form.append('fileMd5', params.file.fileMd5) |
| | | form.append('shardingMd5', _param.chunkMd5) |
| | | form.append('baseDomain', service) |
| | | form.append('baseDomain', window.GLOB.baseurl) |
| | | form.append('rootPath', 'Content/images/upload/') |
| | | form.append('fileName', params.file.fileName) |
| | | form.append('fileExt', params.file.fileType) |
| | |
| | | const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) |
| | | const FormTab = asyncComponent(() => import('@/tabviews/formtab')) |
| | | |
| | | let service = '' |
| | | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | service = document.location.origin + '/' + window.GLOB.service + 'zh-CN/' |
| | | } else { |
| | | service = window.GLOB.location + '/' + window.GLOB.service + 'zh-CN/' |
| | | } |
| | | |
| | | class TabViews extends Component { |
| | | static propTpyes = { |
| | | collapse: PropTypes.bool |
| | |
| | | } 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 === 'iframe') { |
| | | return (<Iframe key={view.MenuID} MenuID={view.MenuID} MenuNo={view.MenuNo} title={view.MenuName} MenuName={view.MenuName} url={service + view.LinkUrl}/>) |
| | | 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 { |
| | | return (<NotFount key={view.MenuID} />) |
| | | } |
| | |
| | | } |
| | | GLOB.service = _service ? _service + '/' : '' |
| | | GLOB.host = window.location.host + (_service ? '_' + _service : '') |
| | | GLOB.baseurl = document.location.origin + '/' + GLOB.service |
| | | } else { |
| | | GLOB.linkurl = '' |
| | | GLOB.location = config.host |
| | | GLOB.service = config.service |
| | | GLOB.host = config.host.replace(/http(s)?:\/\//ig, '') + (config.service ? '_' + config.service.replace(/\//ig, '') : '') |
| | | GLOB.baseurl = GLOB.location + '/' + GLOB.service |
| | | } |
| | | |
| | | let mark = sessionStorage.getItem('system_mark') |
| | |
| | | newcard.height = 1 |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [card.uuid, card.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', card.uuid, newcard) |
| | | } |
| | | |
| | | addButton = () => { |
| | |
| | | newcard.focus = true |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [card.uuid, card.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', card.uuid, newcard) |
| | | } |
| | | |
| | | pasteComponent = (res, resolve) => { |
| | |
| | | res.focus = true |
| | | |
| | | if (type === 'customCardElement') { |
| | | MKEmitter.emit('cardAddElement', [card.uuid, card.uuid], res) |
| | | MKEmitter.emit('cardAddElement', card.uuid, res) |
| | | } else { |
| | | res.eleType = 'button' |
| | | MKEmitter.emit('cardAddElement', [card.uuid, card.uuid], res) |
| | | MKEmitter.emit('cardAddElement', card.uuid, res) |
| | | } |
| | | resolve({status: true}) |
| | | } |
| | |
| | | const [, drop] = useDrop({ |
| | | accept: 'action', |
| | | canDrop: () => true, |
| | | drop({ id: draggedId }) { |
| | | drop(item) { |
| | | const { id: draggedId } = item |
| | | |
| | | if (item.$init) { |
| | | item.overIndex = id |
| | | } |
| | | |
| | | if (!draggedId || draggedId === id) return |
| | | |
| | | const { index: originIndex } = findCard(draggedId) |
| | |
| | | const [, drop] = useDrop({ |
| | | accept: 'action', |
| | | canDrop: () => true, |
| | | drop({ id: draggedId }) { |
| | | drop(item) { |
| | | const { id: draggedId } = item |
| | | |
| | | if (item.$init) { |
| | | item.overIndex = id |
| | | } |
| | | |
| | | if (!draggedId || draggedId === id) return |
| | | |
| | | const { index: originIndex } = findCard(draggedId) |
| | |
| | | const getContent = () => { |
| | | if (card.eleType === 'sequence') { |
| | | return ( |
| | | <div className={'ant-mk-text'}>1</div> |
| | | <div style={{height: card.innerHeight || 'auto'}} className="ant-mk-text">1</div> |
| | | ) |
| | | } else if (card.eleType === 'text' || card.eleType === 'number') { |
| | | let val = `${card.prefix || ''}${card.datatype === 'static' ? (card.value || '') : (card.field || '')}${card.postfix || ''}` |
| | |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | ) |
| | | } else if (card.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (card.style.fontSize) { |
| | | fontSize = parseInt(card.style.fontSize) |
| | | } |
| | | if (card.style.lineHeight) { |
| | | lineHeight = parseFloat(card.style.lineHeight) |
| | | } |
| | | |
| | | let innerHeight = fontSize * lineHeight |
| | | return (<MkIcon style={{height: innerHeight}} className="ant-mk-icon" type={card.icon}/>) |
| | | return (<MkIcon style={{height: card.innerHeight || 'auto'}} className="ant-mk-icon" type={card.icon}/>) |
| | | } else if (card.eleType === 'slider') { |
| | | let val = card.value ? (card.value / card.maxValue) * 100 : 30 |
| | | return <MkProgress value={val} config={card}/> |
| | |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{moment().format(card.dateFormat)}<span style={_s}>{card.postfix || ''}</span></> |
| | | } |
| | | return ( |
| | | <div className="ant-mk-date"> |
| | | <div className="ant-mk-text line1" style={{height: card.innerHeight || 'auto'}}> |
| | | {val} |
| | | </div> |
| | | ) |
| | |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{card.formula}<span style={_s}>{card.postfix || ''}</span></> |
| | | } |
| | | return ( |
| | | <div className="ant-mk-date"> |
| | | <div className="ant-mk-text" style={{height: card.innerHeight || 'auto'}}> |
| | | {val} |
| | | </div> |
| | | ) |
| | |
| | | } |
| | | |
| | | let able = true |
| | | if ((appType === 'mob' || appType === 'pc') && parent && (parent.setting.click === 'menu' || parent.setting.click === 'menus')) { |
| | | // if ((appType === 'mob' || appType === 'pc') && parent && parent.setting.click === 'menu') { |
| | | if ((appType === 'mob' || appType === 'pc') && (parent.setting.click === 'menu' || parent.setting.click === 'menus')) { |
| | | able = false |
| | | } |
| | | |
| | |
| | | const [, drop] = useDrop({ |
| | | accept: 'action', |
| | | drop(item) { |
| | | if (item.$init) { // 拖拽添加 |
| | | let newcard = {} |
| | | newcard.uuid = Utils.getuuid() |
| | | newcard.focus = true |
| | | |
| | | // 显示列过滤 |
| | | if (parent.type === 'custom' && item.class !== 'element') { |
| | | delete item.overIndex |
| | | return |
| | | } else if (parent.type === 'action' && item.class === 'element') { |
| | | delete item.overIndex |
| | | return |
| | | } |
| | | |
| | | if (item.class === 'element') { |
| | | newcard.eleType = item.value |
| | | newcard.datatype = 'dynamic' |
| | | newcard.height = 1 |
| | | } else { |
| | | newcard.eleType = 'button' |
| | | newcard.label = 'button' |
| | | newcard.verify = null |
| | | newcard.show = 'link' |
| | | newcard.Ot = 'requiredSgl' |
| | | newcard.OpenType = item.value |
| | | newcard.class = 'primary' |
| | | |
| | | if (newcard.OpenType === 'excelIn') { |
| | | newcard.label = item.text |
| | | newcard.class = 'dgreen' |
| | | newcard.Ot = 'notRequired' |
| | | } else if (item.subType === 'excelOut') { |
| | | newcard.label = item.text |
| | | newcard.execSuccess = 'never' |
| | | newcard.class = 'dgreen' |
| | | } |
| | | } |
| | | |
| | | if (item.overIndex) { |
| | | const { index } = findCard(item.overIndex) |
| | | const _cards = update(cards, { $splice: [[index + 1, 0, newcard]] }) |
| | | handleList(_cards) |
| | | } else { |
| | | handleList([...cards, newcard]) |
| | | } |
| | | |
| | | handleMenu(newcard) |
| | | |
| | | delete item.overIndex |
| | | return |
| | | } |
| | | |
| | | const { index } = findCard(item.id) |
| | | if (index > -1) return |
| | | dropButton(item.id) |
| | |
| | | id={card.uuid} |
| | | key={card.uuid} |
| | | card={card} |
| | | parent={parent} |
| | | copyCard={copyCard} |
| | | moveCard={moveCard} |
| | | editCard={editCard} |
| | |
| | | border-left: 0; |
| | | border-right: 0; |
| | | } |
| | | .ant-mk-date { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | word-break: break-word; |
| | | text-overflow: ellipsis; |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | } |
| | | .ant-mk-check { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | |
| | | |
| | | if (type === 'table' || (type === 'card' && subtype === 'datacard')) { |
| | | _options.push({value: 'sequence', text: '序号'}) |
| | | } else if (card.eleType === 'sequence') { // 拖拽添加类型转换 |
| | | card.eleType = 'text' |
| | | } |
| | | |
| | | let appMenus = [] |
| | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('submitModal', this.handleSave) |
| | | MKEmitter.addListener('cardAddElement', this.cardAddElement) |
| | | MKEmitter.addListener('cardDelElement', this.cardDelElement) |
| | | MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props.cards), fromJS(nextProps.cards)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(this.props.cards), fromJS(nextProps.cards)) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (this.props.side !== nextProps.side) { |
| | | this.setState({ |
| | | elements: fromJS(nextProps.elements).toJS() |
| | | }) |
| | | } else if (!is(fromJS(this.props.elements), fromJS(nextProps.elements)) && nextProps.elements.length !== this.state.elements.length) { |
| | | this.setState({ |
| | | elements: fromJS(nextProps.elements).toJS() |
| | | }) |
| | |
| | | } |
| | | MKEmitter.removeListener('submitModal', this.handleSave) |
| | | MKEmitter.removeListener('cardAddElement', this.cardAddElement) |
| | | MKEmitter.removeListener('cardDelElement', this.cardDelElement) |
| | | MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle) |
| | | } |
| | | |
| | | updateComponentStyle = (parentId, keys, style) => { |
| | | const { cardCell } = this.props |
| | | |
| | | if (!cardCell || cardCell.uuid !== parentId) return |
| | | if (cardCell.uuid !== parentId) return |
| | | |
| | | const { elements } = this.state |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | cardAddElement = (ids, element) => { |
| | | const { cards, cardCell } = this.props |
| | | cardDelElement = (id, eleId) => { |
| | | const { cardCell } = this.props |
| | | |
| | | if (!ids || ids.length !== 2 || ids[0] !== cards.uuid || ids[1] !== cardCell.uuid) return |
| | | if (id !== cardCell.uuid) return |
| | | |
| | | this.setState({elements: this.state.elements.filter(item => item.uuid !== eleId)}) |
| | | } |
| | | |
| | | cardAddElement = (id, element) => { |
| | | const { cardCell } = this.props |
| | | |
| | | if (id !== cardCell.uuid) return |
| | | if (window.GLOB.$lock) return |
| | | |
| | | window.GLOB.$lock = true |
| | |
| | | |
| | | resetCardStyle = (card, style) => { |
| | | let _card = fromJS(card).toJS() |
| | | |
| | | if (['text', 'number', 'formula'].includes(_card.eleType)) { |
| | | _card.style = style |
| | | |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | if (['text', 'number', 'formula', 'currentDate', 'sequence', 'icon'].includes(_card.eleType)) { |
| | | _card.style = style |
| | | let line = _card.height || null |
| | | |
| | | if (_card.style.fontSize) { |
| | | fontSize = parseInt(_card.style.fontSize) |
| | | } |
| | | if (_card.style.lineHeight) { |
| | | lineHeight = parseFloat(_card.style.lineHeight) |
| | | if (['currentDate', 'sequence', 'icon'].includes(_card.eleType)) { |
| | | line = 1 |
| | | } |
| | | |
| | | if (line) { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (_card.style.fontSize) { |
| | | fontSize = parseInt(_card.style.fontSize) |
| | | } |
| | | if (_card.style.lineHeight) { |
| | | lineHeight = parseFloat(_card.style.lineHeight) |
| | | } |
| | | |
| | | _card.innerHeight = fontSize * lineHeight * line |
| | | } else { |
| | | _card.innerHeight = 'auto' |
| | | } |
| | | } else if (_card.eleType === 'sequence') { |
| | | _card.style = style |
| | | |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (_card.style.fontSize) { |
| | | fontSize = parseInt(_card.style.fontSize) |
| | | } |
| | | |
| | | _card.innerHeight = fontSize * lineHeight |
| | | } else if (_card.eleType === 'barcode') { |
| | | _card.style = style |
| | | |
| | |
| | | this.setState({ |
| | | actvisible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, cards, usefulFields, 'card', menulist, modules, anchors) |
| | | formlist: getActionForm(card, functip, cards, usefulFields, menulist, modules, anchors) |
| | | }) |
| | | } |
| | | |
| | |
| | | let _elements = elements.map(cell => { |
| | | if (cell.uuid === res.uuid) { |
| | | res.style = cell.style || {} |
| | | if (res.eleType === 'splitline' && cell.eleType !== 'splitline') { |
| | | if (res.eleType === 'splitline' && (cell.eleType !== 'splitline' || cell.focus)) { |
| | | res.style.paddingTop = '5px' |
| | | res.style.paddingBottom = '5px' |
| | | } else if (['text', 'number', 'formula'].includes(res.eleType)) { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | } else if (['text', 'number', 'formula', 'currentDate', 'sequence', 'icon'].includes(res.eleType)) { |
| | | let line = res.height || null |
| | | |
| | | if (res.style && res.style.fontSize) { |
| | | fontSize = parseInt(res.style.fontSize) |
| | | } |
| | | if (res.style && res.style.lineHeight) { |
| | | lineHeight = parseFloat(res.style.lineHeight) |
| | | |
| | | if (['currentDate', 'sequence', 'icon'].includes(res.eleType)) { |
| | | line = 1 |
| | | } |
| | | |
| | | if (line) { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (res.style && res.style.fontSize) { |
| | | fontSize = parseInt(res.style.fontSize) |
| | | } |
| | | if (res.style && res.style.lineHeight) { |
| | | lineHeight = parseFloat(res.style.lineHeight) |
| | | } |
| | | |
| | | res.innerHeight = fontSize * lineHeight * line |
| | | } else { |
| | | res.innerHeight = 'auto' |
| | | } |
| | | |
| | | if (res.eleType === 'text' && res.link && !res.style.color) { |
| | |
| | | } |
| | | |
| | | dropButton = (id) => { |
| | | const { cards } = this.props |
| | | const { cards, cardCell } = this.props |
| | | |
| | | if (!cards.action) return |
| | | if (cardCell.type === 'custom') return |
| | | |
| | | let index = cards.action.findIndex(item => item.uuid === id) |
| | | |
| | |
| | | <div className="model-menu-card-cell-list"> |
| | | <DragElement |
| | | list={elements} |
| | | parent={{...cardCell, components: elements}} |
| | | parent={cardCell} |
| | | fields={cards.columns} |
| | | updateMarks={this.updateMarks} |
| | | handleList={this.handleList} |
| | |
| | | } |
| | | |
| | | addElement = () => { |
| | | const { cards } = this.props |
| | | const { card } = this.state |
| | | |
| | | let newcard = {} |
| | |
| | | newcard.height = 1 |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [cards.uuid, card.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', card.uuid, newcard) |
| | | } |
| | | |
| | | addButton = () => { |
| | | const { cards } = this.props |
| | | const { card } = this.state |
| | | |
| | | let newcard = {eleType: 'button', label: 'button', verify: null, show: 'link', sqlType: '', Ot: 'requiredSgl', OpenType: 'prompt', icon: '', class: 'primary', intertype: 'system', execSuccess: 'grid', execError: 'never', popClose: 'never'} |
| | |
| | | newcard.focus = true |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [cards.uuid, card.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', card.uuid, newcard) |
| | | } |
| | | |
| | | changeStyle = () => { |
| | |
| | | } |
| | | |
| | | paste = (element, resolve) => { |
| | | const { cards } = this.props |
| | | const { card } = this.state |
| | | |
| | | let _uuid = Utils.getuuid() |
| | |
| | | resolve({status: true}) |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [cards.uuid, card.uuid], element) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if ((sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'propcard') && this.props.cards.subtype === 'propcard') { |
| | | e.stopPropagation() |
| | | MKEmitter.emit('clickComponent', this.state.card, this.props.cards, 'propcard') |
| | | } |
| | | MKEmitter.emit('cardAddElement', card.uuid, element) |
| | | } |
| | | |
| | | doubleClickCard = () => { |
| | |
| | | |
| | | return ( |
| | | <Col span={card.setting.width || 6}> |
| | | <div className={'card-item ' + (card.setting.btnControl || '')} style={_style} onClick={this.clickComponent} onDoubleClick={(e) => {e.stopPropagation(); this.doubleClickCard()}} id={card.uuid}> |
| | | <div className={'card-item ' + (card.setting.btnControl || '')} style={_style} onDoubleClick={(e) => {e.stopPropagation(); this.doubleClickCard()}} id={card.uuid}> |
| | | <CardCellComponent cards={cards} cardCell={card} side={side} elements={elements} updateElement={this.updateCard}/> |
| | | <div className="card-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | |
| | | } |
| | | |
| | | addElement = () => { |
| | | const { cards } = this.props |
| | | const { card } = this.state |
| | | |
| | | let newcard = {} |
| | |
| | | window.GLOB.$lock = false |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [cards.uuid, card.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', card.uuid, newcard) |
| | | } |
| | | |
| | | addButton = () => { |
| | | const { cards } = this.props |
| | | const { card } = this.state |
| | | |
| | | let newcard = {eleType: 'button', label: 'button', verify: null, show: 'link', sqlType: '', Ot: 'requiredSgl', OpenType: 'prompt', icon: '', class: 'primary', intertype: 'system', execSuccess: 'grid', execError: 'never', popClose: 'never'} |
| | |
| | | |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [cards.uuid, card.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', card.uuid, newcard) |
| | | } |
| | | |
| | | changeStyle = () => { |
| | |
| | | } trigger="hover"> |
| | | <ToolOutlined /> |
| | | </Popover> |
| | | <ActionComponent config={card} type="datacard" setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | <div className={'float-' + (card.wrap.cardFloat || 'left') + ' select-' + card.wrap.selStyle}> |
| | | {card.subcards.map((subcard, index) => (<CardComponent key={subcard.uuid} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} |
| | | </div> |
| | |
| | | } trigger="hover"> |
| | | <ToolOutlined /> |
| | | </Popover> |
| | | <ActionComponent config={card} type="datacard" setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | <div style={{minHeight: 'calc(100% - 90px)'}}> |
| | | {card.subcards.map(subcard => (<CardSimpleComponent key={subcard.uuid} cards={card} card={subcard} updateElement={this.updateCard} move={this.move} deleteElement={this.deleteCard}/>))} |
| | | </div> |
| | |
| | | <NormalHeader config={card} updateComponent={this.updateComponent}/> |
| | | <div className="canvas" id={card.uuid + 'canvas'} ref={ref => this.wrap = ref}></div> |
| | | {appType !== 'mob' ? <ActionComponent |
| | | type="chart" |
| | | config={card} |
| | | updateaction={this.updateComponent} |
| | | /> : null} |
| | |
| | | </Popover> |
| | | <NormalHeader config={card} updateComponent={this.updateComponent}/> |
| | | <div className="canvas" id={card.uuid + 'canvas'} ref={ref => this.wrap = ref}></div> |
| | | {appType !== 'mob' ? <ActionComponent type="chart" config={card} updateaction={this.updateComponent}/> : null} |
| | | {appType !== 'mob' ? <ActionComponent config={card} updateaction={this.updateComponent}/> : null} |
| | | <div className="component-name"> |
| | | <div className="center"> |
| | | <div className="title">{card.name}</div> |
| | |
| | | const [, drop] = useDrop({ |
| | | accept: 'search', |
| | | canDrop: () => true, |
| | | drop: ({ id: draggedId }) => { |
| | | if (!draggedId || draggedId === id) return |
| | | const { index: originIndex } = findCard(draggedId) |
| | | if (originIndex === -1) return |
| | | drop: (item) => { |
| | | const { id: draggedId, originalIndex } = item |
| | | |
| | | if (originalIndex === undefined) { |
| | | item.dropTargetId = id |
| | | } else { |
| | | if (!draggedId || draggedId === id) return |
| | | const { index: originIndex } = findCard(draggedId) |
| | | if (originIndex === -1) return |
| | | |
| | | const { index: overIndex } = findCard(id) |
| | | moveCard(draggedId, overIndex) |
| | | const { index: overIndex } = findCard(id) |
| | | moveCard(draggedId, overIndex) |
| | | } |
| | | }, |
| | | }) |
| | | const opacity = isDragging ? 0.5 : 1 |
| | |
| | | |
| | | const [, drop] = useDrop({ |
| | | accept: 'search', |
| | | drop() {} |
| | | drop(item) { |
| | | if (item.hasOwnProperty('originalIndex')) { |
| | | return |
| | | } |
| | | |
| | | let newcard = {} |
| | | newcard.uuid = Utils.getuuid() |
| | | newcard.focus = true |
| | | |
| | | newcard.label = 'label' |
| | | newcard.initval = '' |
| | | newcard.type = item.subType |
| | | newcard.resourceType = '0' |
| | | newcard.options = [] |
| | | newcard.orderType = 'asc' |
| | | |
| | | let _match = 'like' |
| | | if (item.subType === 'select' || item.subType === 'link' || item.subType === 'checkcard') { |
| | | _match = '=' |
| | | } else if (item.subType === 'date' || item.subType === 'datemonth') { |
| | | _match = '>=' |
| | | } else if (item.subType === 'dateweek' || item.subType === 'daterange') { |
| | | _match = 'between' |
| | | } else if (item.subType === 'group') { |
| | | _match = 'between' |
| | | newcard.items = ['day', 'week', 'month', 'quarter', 'year', 'customized'] |
| | | } |
| | | |
| | | newcard.match = _match |
| | | |
| | | let targetId = '' |
| | | |
| | | if (item.dropTargetId) { |
| | | targetId = item.dropTargetId |
| | | delete item.dropTargetId |
| | | } else if (cards.length > 0) { |
| | | targetId = cards[cards.length - 1].uuid |
| | | } |
| | | |
| | | const { index: overIndex, card } = findCard(`${targetId}`) |
| | | |
| | | if (card) { |
| | | newcard.ratio = card.ratio || 6 |
| | | newcard.labelwidth = card.labelwidth || 33.3 |
| | | } |
| | | |
| | | const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] }) |
| | | |
| | | handleList(_cards, newcard) |
| | | } |
| | | }) |
| | | |
| | | let labelwidth = setting.searchLwidth !== undefined ? setting.searchLwidth : 33.3 |
| | |
| | | let linkableFields = [] |
| | | |
| | | card.search.forEach(item => { |
| | | if (item.uuid === card.uuid) return |
| | | if (item.uuid === cell.uuid) return |
| | | if (!['select', 'link', 'checkcard'].includes(item.type)) return |
| | | if (item.type === 'checkcard' && item.multiple === 'true') return |
| | | |
| | |
| | | const [, drop] = useDrop({ |
| | | accept: 'action', |
| | | drop(item) { |
| | | if (item.$init) { // 拖拽添加 |
| | | let newcard = {} |
| | | newcard.uuid = Utils.getuuid() |
| | | newcard.focus = true |
| | | |
| | | if (item.class === 'element') { |
| | | delete item.overIndex |
| | | return |
| | | } else { |
| | | newcard.label = 'button' |
| | | newcard.verify = null |
| | | newcard.show = 'link' |
| | | newcard.Ot = 'requiredSgl' |
| | | newcard.OpenType = item.value |
| | | newcard.class = 'primary' |
| | | |
| | | if (newcard.OpenType === 'excelIn') { |
| | | newcard.label = item.text |
| | | newcard.class = 'dgreen' |
| | | newcard.Ot = 'notRequired' |
| | | } else if (item.subType === 'excelOut') { |
| | | newcard.label = item.text |
| | | newcard.execSuccess = 'never' |
| | | newcard.class = 'dgreen' |
| | | } |
| | | } |
| | | |
| | | if (item.overIndex) { |
| | | const { index } = findCard(item.overIndex) |
| | | const _cards = update(cards, { $splice: [[index + 1, 0, newcard]] }) |
| | | handleList(_cards, newcard) |
| | | } else { |
| | | handleList([...cards, newcard], newcard) |
| | | } |
| | | |
| | | delete item.overIndex |
| | | return |
| | | } |
| | | |
| | | const { index } = findCard(item.id) |
| | | if (index > -1) return |
| | | dropButton(item.id) |
| | |
| | | * @param {*} usefulFields 存储过程可用的开始字段 |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = [], anchors = []) { |
| | | export function getActionForm (card, functip, config, usefulFields, menulist = [], modules = [], anchors = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let printTemps = sessionStorage.getItem('printTemps') |
| | |
| | | let setting = config.setting || {} |
| | | let columns = config.columns || [] |
| | | let appMenus = [] |
| | | let type = '' |
| | | |
| | | if (card.eleType === 'button') { |
| | | type = 'card' |
| | | } else if (config.subtype === 'datacard' || config.subtype === 'tablecard') { |
| | | type = 'datacard' |
| | | } else if (config.type === 'line' || config.type === 'bar' || config.type === 'scatter') { |
| | | type = 'chart' |
| | | } |
| | | |
| | | let opentypes = [ |
| | | { |
| | | value: 'pop', |
| | | text: Formdict['model.form.popform'] |
| | | text: '弹窗(表单)' |
| | | }, { |
| | | value: 'prompt', |
| | | text: Formdict['model.form.prompt'] |
| | | text: '提示框' |
| | | }, { |
| | | value: 'exec', |
| | | text: Formdict['model.form.exec'] |
| | | text: '直接执行' |
| | | }, { |
| | | value: 'excelIn', |
| | | text: Formdict['model.form.excelIn'] |
| | | text: '导入Excel' |
| | | }, { |
| | | value: 'excelOut', |
| | | text: Formdict['model.form.excelOut'] |
| | | text: '导出Excel' |
| | | }, { |
| | | value: 'popview', |
| | | text: Formdict['model.form.popview'] |
| | | text: '弹窗(标签)' |
| | | }, { |
| | | value: 'tab', |
| | | text: Formdict['model.form.tab'] |
| | | text: '标签页' |
| | | }, { |
| | | value: 'innerpage', |
| | | text: Formdict['model.form.newpage'] |
| | | text: '新页面' |
| | | }, { |
| | | value: 'funcbutton', |
| | | text: Formdict['model.form.funcbutton'] |
| | | text: '功能按钮' |
| | | } |
| | | ] |
| | | |
| | |
| | | return _list |
| | | } |
| | | |
| | | // if (type === 'editable') { |
| | | // opentypes = [ |
| | | // { |
| | | // value: 'excelIn', |
| | | // text: Formdict['model.form.excelIn'] |
| | | // }, { |
| | | // value: 'excelOut', |
| | | // text: Formdict['model.form.excelOut'] |
| | | // } |
| | | // ] |
| | | // } |
| | | let tabs = getTabs(JSON.parse(JSON.stringify(window.GLOB.customMenu.components))) |
| | | |
| | | let pageTemps = [ |
| | |
| | | |
| | | if (type === 'chart' && appType !== 'mob') { |
| | | opentypes = opentypes.filter(item => item.value === 'excelIn' || item.value === 'excelOut') |
| | | |
| | | if (card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut') { // 拖拽添加类型转换 |
| | | card.OpenType = 'excelOut' |
| | | } |
| | | } |
| | | |
| | | let refresh = [] |
| | |
| | | value: 'form', |
| | | text: '表单(开关或勾选框)' |
| | | }) |
| | | } else if (card.OpenType === 'form') { // 拖拽添加类型转换 |
| | | card.OpenType = 'pop' |
| | | } |
| | | |
| | | if (!card.control && card.controlField) { |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'sql', |
| | | label: Formdict['model.form.tablename'], |
| | | label: '表名', |
| | | initVal: card.sql || setting.tableName || '', |
| | | required: true |
| | | }, |
| | |
| | | |
| | | class ActionComponent extends Component { |
| | | static propTpyes = { |
| | | type: PropTypes.string, // 菜单类型,主表或子表 |
| | | config: PropTypes.object, // 菜单配置信息 |
| | | setSubConfig: PropTypes.func, // 设置子配置信息 |
| | | updateaction: PropTypes.func // 菜单配置更新 |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, config, usefulFields, this.props.type, menulist, modules, anchors) |
| | | formlist: getActionForm(card, functip, config, usefulFields, menulist, modules, anchors) |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | if (item.uuid === btn.uuid) { |
| | | btn.style = item.style || {} |
| | | |
| | | if (btn.class !== item.class || btn.show !== item.show || !btn.style.color) { |
| | | if (btn.show === 'link' || btn.show === 'icon') { |
| | | if (btn.class !== item.class || btn.show !== item.show || !btn.style.color || item.focus) { |
| | | if (btn.show === 'icon') { |
| | | btn.style.color = color[btn.class] |
| | | btn.style.backgroundColor = 'transparent' |
| | | } else { |
| | |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | let btn = null |
| | | if (config.subtype === 'normaltable') { |
| | | let _col = null |
| | | if (config.subtype === 'normaltable' || config.subtype === 'editable') { |
| | | config.cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | |
| | | col.elements = col.elements.filter(item => { |
| | | if (item.uuid === id) { |
| | | btn = item |
| | | _col = col |
| | | } |
| | | return item.uuid !== id |
| | | }) |
| | |
| | | |
| | | if (!btn) return |
| | | |
| | | btn.Ot = 'requiredSgl' |
| | | config.action.push(btn) |
| | | |
| | | MKEmitter.emit('cardDelElement', _col.uuid, btn.uuid) |
| | | |
| | | this.setState({ |
| | | actionlist: config.action |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, type } = this.props |
| | | const { config } = this.props |
| | | const { actionlist, visible, appType, card, dict, profVisible, record } = this.state |
| | | |
| | | return ( |
| | | <div className={'model-menu-action-list length' + actionlist.length}> |
| | | <DragElement |
| | | list={actionlist} |
| | | type={appType === 'mob' ? (type || '') : ''} |
| | | type={appType === 'mob' ? config.subtype : ''} |
| | | handleList={this.handleList} |
| | | dropButton={this.dropButton} |
| | | handleMenu={this.handleAction} |
| | |
| | | const [, drop] = useDrop({ |
| | | accept: 'search', |
| | | canDrop: () => true, |
| | | drop: ({ id: draggedId }) => { |
| | | if (!draggedId || draggedId === id) return |
| | | |
| | | const { index: originIndex } = findCard(draggedId) |
| | | if (originIndex === -1) return |
| | | |
| | | const { index: overIndex } = findCard(id) |
| | | moveCard(draggedId, overIndex) |
| | | drop: (item) => { |
| | | const { id: draggedId, originalIndex } = item |
| | | |
| | | if (originalIndex === undefined) { |
| | | item.dropTargetId = id |
| | | } else { |
| | | if (!draggedId || draggedId === id) return |
| | | |
| | | const { index: originIndex } = findCard(draggedId) |
| | | if (originIndex === -1) return |
| | | |
| | | const { index: overIndex } = findCard(id) |
| | | moveCard(draggedId, overIndex) |
| | | } |
| | | } |
| | | }) |
| | | const opacity = isDragging ? 0.5 : 1 |
| | |
| | | |
| | | const [, drop] = useDrop({ |
| | | accept: 'search', |
| | | drop() {} |
| | | drop(item) { |
| | | if (item.hasOwnProperty('originalIndex')) { |
| | | return |
| | | } |
| | | |
| | | let newcard = {} |
| | | newcard.uuid = Utils.getuuid() |
| | | newcard.focus = true |
| | | |
| | | newcard.label = 'label' |
| | | newcard.initval = '' |
| | | newcard.type = item.subType |
| | | newcard.resourceType = '0' |
| | | newcard.options = [] |
| | | newcard.orderType = 'asc' |
| | | |
| | | let _match = 'like' |
| | | if (item.subType === 'select' || item.subType === 'link' || item.subType === 'checkcard') { |
| | | _match = '=' |
| | | } else if (item.subType === 'date' || item.subType === 'datemonth') { |
| | | _match = '>=' |
| | | } else if (item.subType === 'dateweek' || item.subType === 'daterange') { |
| | | _match = 'between' |
| | | } else if (item.subType === 'group') { |
| | | _match = 'between' |
| | | newcard.items = ['day', 'week', 'month', 'quarter', 'year', 'customized'] |
| | | } |
| | | |
| | | newcard.match = _match |
| | | |
| | | let targetId = '' |
| | | |
| | | if (item.dropTargetId) { |
| | | targetId = item.dropTargetId |
| | | delete item.dropTargetId |
| | | } else if (cards.length > 0) { |
| | | targetId = cards[cards.length - 1].uuid |
| | | } |
| | | |
| | | const { index: overIndex, card } = findCard(`${targetId}`) |
| | | |
| | | if (card) { |
| | | newcard.ratio = card.ratio || 6 |
| | | newcard.labelwidth = card.labelwidth || 33.3 |
| | | } |
| | | |
| | | const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] }) |
| | | |
| | | handleList(_cards, newcard) |
| | | } |
| | | }) |
| | | |
| | | return ( |
| | |
| | | cell.uuid = Utils.getuuid() |
| | | cell.focus = true |
| | | |
| | | MKEmitter.emit('cardAddElement', [this.props.config.uuid, col.uuid], cell) |
| | | MKEmitter.emit('cardAddElement', col.uuid, cell) |
| | | } |
| | | |
| | | addElement = (col) => { |
| | | const { config } = this.props |
| | | let column = fromJS(col).toJS() |
| | | |
| | | if (column.type === 'colspan') { |
| | |
| | | let newcard = {uuid: Utils.getuuid(), focus: true, width: 24, eleType: 'text', datatype: 'dynamic', style: {paddingLeft: '4px'}} |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [config.uuid, column.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', column.uuid, newcard) |
| | | } else if (column.type === 'action') { |
| | | let newcard = { |
| | | uuid: Utils.getuuid(), |
| | |
| | | } |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [config.uuid, column.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', column.uuid, newcard) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | let options = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | text: '文本' |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'custom', |
| | | text: '自定义列' |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { connectDragSource, connectDropTarget, moveCol, addElement, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | const { connectDragSource, connectDropTarget, moveCol, dropCol, addElement, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | |
| | | if (!column) return ( |
| | | <th {...restProps} index={index}> |
| | |
| | | |
| | | const ColTarget = { |
| | | drop(props, monitor) { |
| | | const dragIndex = monitor.getItem().index |
| | | const item = monitor.getItem() |
| | | const dragIndex = item.index |
| | | const hoverIndex = props.index |
| | | |
| | | if (dragIndex === undefined || hoverIndex === undefined || dragIndex === hoverIndex) { |
| | | if (item.$init) { |
| | | props.dropCol(item, hoverIndex) |
| | | return |
| | | } else if (dragIndex === undefined || hoverIndex === undefined || dragIndex === hoverIndex) { |
| | | return |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | dropCol = (item, hoverIndex) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | let type = item.subType |
| | | |
| | | if (item.subType === 'link' || item.subType === 'colspan' || item.subType === 'picture') { |
| | | type = 'text' |
| | | } |
| | | |
| | | let col = { focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: type, elements: [] } |
| | | |
| | | _columns.splice(hoverIndex, 0, col) |
| | | |
| | | this.setState({ |
| | | columns: _columns |
| | | }, () => { |
| | | this.editColumn(col) |
| | | }) |
| | | } |
| | | |
| | | updateCol = (col, btn) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | _columns = _columns.map(column => { |
| | |
| | | cell.uuid = Utils.getuuid() |
| | | cell.focus = true |
| | | |
| | | MKEmitter.emit('cardAddElement', [this.props.config.uuid, col.uuid], cell) |
| | | MKEmitter.emit('cardAddElement', col.uuid, cell) |
| | | } |
| | | |
| | | addElement = (col) => { |
| | | const { config } = this.props |
| | | let column = fromJS(col).toJS() |
| | | |
| | | if (column.type === 'custom') { |
| | | let newcard = {uuid: Utils.getuuid(), focus: true, width: 24, eleType: 'text', datatype: 'dynamic', style: {paddingLeft: '4px'}} |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [config.uuid, column.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', column.uuid, newcard) |
| | | } else if (column.type === 'action') { |
| | | let newcard = { |
| | | uuid: Utils.getuuid(), |
| | |
| | | } |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [config.uuid, column.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', column.uuid, newcard) |
| | | } |
| | | } |
| | | |
| | |
| | | fields: fields, |
| | | align: col.Align, |
| | | moveCol: this.moveCol, |
| | | dropCol: this.dropCol, |
| | | updateCol: this.updateCol, |
| | | addElement: this.addElement, |
| | | editColumn: this.editColumn, |
| | |
| | | } |
| | | } |
| | | |
| | | .model-menu-card-cell-list { |
| | | .card-detail-row { |
| | | min-height: 21px; |
| | | } |
| | | } |
| | | |
| | | .ant-table-thead { |
| | | th { |
| | | position: relative; |
| | |
| | | <ToolOutlined /> |
| | | </Popover> |
| | | <SearchComponent config={card} updatesearch={this.updateComponent}/> |
| | | <ActionComponent type="editable" config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | <ColumnComponent config={card} updatecolumn={this.updateComponent}/> |
| | | <div className="component-name"> |
| | | <div className="center"> |
| | |
| | | bottom: 0; |
| | | } |
| | | >.ant-row { |
| | | display: none; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | min-height: 10px; |
| | | .common-drawarea-placeholder { |
| | | display: none; |
| | | } |
| | | } |
| | | >.ant-switch { |
| | | display: none; |
| | |
| | | |
| | | let options = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | text: '文本' |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'picture', |
| | | text: Formdict['model.form.picture'] |
| | | text: '图片' |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.href'] |
| | | text: '链接' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'custom', |
| | | text: '自定义列' |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { connectDragSource, connectDropTarget, moveCol, addElement, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | const { connectDragSource, connectDropTarget, moveCol, dropCol, addElement, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | |
| | | if (index !== undefined) { |
| | | return connectDragSource( |
| | |
| | | |
| | | const ColTarget = { |
| | | drop(props, monitor) { |
| | | const dragIndex = monitor.getItem().index |
| | | const item = monitor.getItem() |
| | | const dragIndex = item.index |
| | | const hoverIndex = props.index |
| | | |
| | | if (dragIndex === undefined || hoverIndex === undefined || dragIndex === hoverIndex) { |
| | | if (item.$init) { |
| | | props.dropCol(item, hoverIndex) |
| | | return |
| | | } else if (dragIndex === undefined || hoverIndex === undefined || dragIndex === hoverIndex) { |
| | | return |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | dropCol = (item, hoverIndex) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | |
| | | let col = { focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: item.subType, elements: [] } |
| | | |
| | | _columns.splice(hoverIndex, 0, col) |
| | | |
| | | this.setState({ |
| | | columns: _columns |
| | | }, () => { |
| | | this.editColumn(col) |
| | | }) |
| | | } |
| | | |
| | | loopCol = (columns, col) => { |
| | | return columns.map(column => { |
| | | if (column.type === 'colspan') { |
| | |
| | | cell.uuid = Utils.getuuid() |
| | | cell.focus = true |
| | | |
| | | MKEmitter.emit('cardAddElement', [this.props.config.uuid, col.uuid], cell) |
| | | MKEmitter.emit('cardAddElement', col.uuid, cell) |
| | | } |
| | | |
| | | addElement = (col) => { |
| | | const { config } = this.props |
| | | let column = fromJS(col).toJS() |
| | | |
| | | if (column.type === 'colspan') { |
| | |
| | | let newcard = {uuid: Utils.getuuid(), focus: true, width: 24, eleType: 'text', datatype: 'dynamic', style: {paddingLeft: '4px'}} |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [config.uuid, column.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', column.uuid, newcard) |
| | | } else if (column.type === 'action') { |
| | | let newcard = { |
| | | uuid: Utils.getuuid(), |
| | |
| | | } |
| | | |
| | | // 注册事件-添加元素 |
| | | MKEmitter.emit('cardAddElement', [config.uuid, column.uuid], newcard) |
| | | MKEmitter.emit('cardAddElement', column.uuid, newcard) |
| | | } |
| | | } |
| | | |
| | |
| | | fields: fields, |
| | | align: col.Align, |
| | | moveCol: this.moveCol, |
| | | dropCol: this.dropCol, |
| | | updateCol: this.updateCol, |
| | | addElement: this.addElement, |
| | | editColumn: this.editColumn, |
| | |
| | | background: #ffffff!important; |
| | | } |
| | | } |
| | | .model-menu-card-cell-list { |
| | | .card-detail-row { |
| | | min-height: 21px; |
| | | } |
| | | } |
| | | |
| | | .ant-table-thead { |
| | | th { |
| | |
| | | bottom: 0; |
| | | } |
| | | >.ant-row { |
| | | display: none; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | min-height: 10px; |
| | | .common-drawarea-placeholder { |
| | | display: none; |
| | | } |
| | | } |
| | | >.ant-switch { |
| | | display: none; |
New file |
| | |
| | | import React from 'react' |
| | | import { useDrag } from 'react-dnd' |
| | | // import './index.scss' |
| | | |
| | | const SourceCell = ({item}) => { |
| | | const [, drag] = useDrag({ item }) |
| | | |
| | | return ( |
| | | <div className="element-source-item"> |
| | | <div ref={drag} className="property"><span>{item.text}</span></div> |
| | | </div> |
| | | ) |
| | | } |
| | | export default SourceCell |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import { is, fromJS } from 'immutable' |
| | | |
| | | import SourceWrap from './dragsource' |
| | | import './index.scss' |
| | | |
| | | class ElementSource extends Component { |
| | | state = { |
| | | options: [ |
| | | { |
| | | title: '卡片元素', |
| | | span: 8, |
| | | children: [ |
| | | { value: 'text', text: '文本', type: 'action', class: 'element', $init: true}, |
| | | { value: 'number', text: '数值', type: 'action', class: 'element', $init: true}, |
| | | { value: 'picture', text: '图片', type: 'action', class: 'element', $init: true}, |
| | | { value: 'video', text: '视频', type: 'action', class: 'element', $init: true}, |
| | | { value: 'icon', text: '图标', type: 'action', class: 'element', $init: true}, |
| | | { value: 'slider', text: '进度条', type: 'action', class: 'element', $init: true}, |
| | | { value: 'splitline', text: '分割线', type: 'action', class: 'element', $init: true}, |
| | | { value: 'barcode', text: '条形码', type: 'action', class: 'element', $init: true}, |
| | | { value: 'qrcode', text: '二维码', type: 'action', class: 'element', $init: true}, |
| | | { value: 'currentDate', text: '当前时间', type: 'action', class: 'element', $init: true}, |
| | | { value: 'formula', text: '公式', type: 'action', class: 'element', $init: true}, |
| | | { value: 'sequence', text: '序号', type: 'action', class: 'element', $init: true } |
| | | ] |
| | | }, |
| | | { |
| | | title: '按钮元素', |
| | | span: 12, |
| | | children: [ |
| | | { value: 'pop', text: '弹窗(表单)', type: 'action', class: 'button', $init: true }, |
| | | { value: 'prompt', text: '提示框', type: 'action', class: 'button', $init: true }, |
| | | { value: 'exec', text: '直接执行', type: 'action', class: 'button', $init: true }, |
| | | { value: 'excelIn', text: '导入Excel', type: 'action', class: 'button', $init: true }, |
| | | { value: 'excelOut', text: '导出Excel', type: 'action', class: 'button', $init: true }, |
| | | { value: 'popview', text: '弹窗(标签)', type: 'action', class: 'button', $init: true }, |
| | | { value: 'tab', text: '标签页', type: 'action', class: 'button', $init: true }, |
| | | { value: 'innerpage', text: '新页面', type: 'action', class: 'button', $init: true }, |
| | | { value: 'funcbutton', text: '功能按钮', type: 'action', class: 'button', $init: true }, |
| | | { value: 'form', text: '表单(开关)', type: 'action', class: 'button', $init: true } |
| | | ] |
| | | }, |
| | | { |
| | | title: '表单元素', |
| | | span: 12, |
| | | children: [ |
| | | { subType: 'text', text: '文本', type: 'form' }, |
| | | { subType: 'number', text: '数字', type: 'form' }, |
| | | { subType: 'select', text: '下拉选择', type: 'form' }, |
| | | { subType: 'textarea', text: '多行文本', type: 'form' }, |
| | | { subType: 'multiselect', text: '下拉多选', type: 'form' }, |
| | | { subType: 'link', text: '联动菜单', type: 'form' }, |
| | | { subType: 'switch', text: '开关', type: 'form' }, |
| | | { subType: 'checkbox', text: '多选框', type: 'form' }, |
| | | { subType: 'radio', text: '单选框', type: 'form' }, |
| | | { subType: 'checkcard', text: '选项卡', type: 'form' }, |
| | | { subType: 'fileupload', text: '文件上传', type: 'form' }, |
| | | { subType: 'date', text: '日期(天)', type: 'form' }, |
| | | { subType: 'datemonth', text: '日期(月)', type: 'form' }, |
| | | { subType: 'cascader', text: '级联菜单', type: 'form' }, |
| | | { subType: 'rate', text: '评分', type: 'form' }, |
| | | { subType: 'color', text: '颜色', type: 'form' }, |
| | | { subType: 'brafteditor', text: '富文本', type: 'form' }, |
| | | { subType: 'funcvar', text: '函数变量', type: 'form' }, |
| | | { subType: 'hint', text: '提示', type: 'form' }, |
| | | { subType: 'split', text: '分隔线', type: 'form' }, |
| | | { subType: 'linkMain', text: '关联主表', type: 'form' }, |
| | | { subType: 'formula', text: '公式', type: 'form' } |
| | | ] |
| | | }, |
| | | { |
| | | title: '搜索元素', |
| | | span: 12, |
| | | children: [ |
| | | { subType: 'text', text: '文本', type: 'search' }, |
| | | { subType: 'select', text: '下拉选择', type: 'search' }, |
| | | { subType: 'multiselect', text: '下拉多选', type: 'search' }, |
| | | { subType: 'link', text: '联动菜单', type: 'search' }, |
| | | { subType: 'checkcard', text: '选项卡', type: 'search' }, |
| | | { subType: 'date', text: '日期(天)', type: 'search' }, |
| | | { subType: 'dateweek', text: '日期(周)', type: 'search' }, |
| | | { subType: 'datemonth', text: '日期(月)', type: 'search' }, |
| | | { subType: 'daterange', text: '日期(区间)', type: 'search' }, |
| | | { subType: 'group', text: '日期(组合)', type: 'search' } |
| | | ] |
| | | }, |
| | | { |
| | | title: '显示列元素', |
| | | span: 12, |
| | | children: [ |
| | | { subType: 'text', text: '文本', type: 'col', $init: true }, |
| | | { subType: 'number', text: '数字', type: 'col', $init: true }, |
| | | { subType: 'picture', text: '图片', type: 'col', $init: true }, |
| | | { subType: 'link', text: '链接', type: 'col', $init: true }, |
| | | { subType: 'textarea', text: '多行文本', type: 'col', $init: true }, |
| | | { subType: 'custom', text: '自定义列', type: 'col', $init: true }, |
| | | { subType: 'colspan', text: '合并列', type: 'col', $init: true }, |
| | | { subType: 'formula', text: '公式', type: 'col', $init: true }, |
| | | { subType: 'index', text: '序号', type: 'col', $init: true }, |
| | | { subType: 'action', text: '操作', type: 'col', $init: true } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let options = fromJS(this.state.options).toJS() |
| | | |
| | | if (appType === 'mob') { |
| | | options[1].children = options[1].children.filter(item => ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'].includes(item.value)) |
| | | options[2].children = options[2].children.filter(item => { |
| | | if (item.subType === 'select') { |
| | | item.text = '选择器' |
| | | } |
| | | |
| | | return item.subType !== 'brafteditor' && item.subType !== 'multiselect' |
| | | }) |
| | | options = options.filter(option => option.title !== '搜索元素') |
| | | } else if (appType === 'pc') { |
| | | options[1].children = options[1].children.filter(item => item.value !== 'tab') |
| | | } |
| | | |
| | | if (viewType === 'popview') { // 弹窗标签 |
| | | options[1].children = options[1].children.filter(item => item.value !== 'popview' && item.value !== 'funcbutton') |
| | | } |
| | | |
| | | this.setState({options}) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | render() { |
| | | const { options } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-source-box"> |
| | | <div className="tip">注:当拖动类型不受支持时会被重置。</div> |
| | | {options.map((item, index) => (<div className="mk-class" span={item.span} key={index}> |
| | | <div className="title">{item.title}</div> |
| | | {item.children.map(cell => <SourceWrap key={cell.value || cell.subType} item={cell}/>)} |
| | | </div>))} |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default ElementSource |
New file |
| | |
| | | .mk-source-box { |
| | | .tip { |
| | | height: 10px; |
| | | font-size: 12px; |
| | | color: rgba(0, 0, 0, 0.45); |
| | | } |
| | | .mk-class { |
| | | margin-left: -5px; |
| | | margin-right: -5px; |
| | | padding-top: 10px; |
| | | .title { |
| | | color: #1890ff; |
| | | font-size: 15px; |
| | | padding: 5px 0px; |
| | | border-bottom: 1px solid #e9e9e9; |
| | | margin-bottom: 10px; |
| | | } |
| | | .element-source-item { |
| | | display: inline-block; |
| | | |
| | | .property { |
| | | padding: 3px; |
| | | margin: 5px; |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 5px; |
| | | text-align: center; |
| | | cursor: move; |
| | | white-space: nowrap; |
| | | } |
| | | } |
| | | } |
| | | .mk-class[span="8"] { |
| | | .element-source-item { |
| | | width: 33.33%; |
| | | } |
| | | } |
| | | .mk-class[span="12"] { |
| | | .element-source-item { |
| | | width: 50%; |
| | | } |
| | | } |
| | | } |
| | |
| | | if (!parent) { |
| | | let _parent = null |
| | | |
| | | if (_type === 'propcard') { |
| | | _parent = _p |
| | | MKEmitter.emit('changeCombineStyle', ['margin', 'padding', 'border', 'background', 'shadow']) |
| | | } else if (_type === 'cardcell') { |
| | | if (_type === 'cardcell') { |
| | | _parent = _p |
| | | MKEmitter.emit('changeCombineStyle', ['margin', 'padding', 'border', 'background', 'font']) |
| | | } else { |
| | |
| | | if (components.findIndex(cell => cell.uuid === card.uuid) > -1) { |
| | | components = components.filter(cell => cell.uuid !== card.uuid) |
| | | document.getElementById(card.uuid).classList.remove('selected-control-element') |
| | | } else if (type !== 'propcard' && parent.components.findIndex(cell => cell.uuid === card.uuid) > -1) { |
| | | components.push(card) |
| | | document.getElementById(card.uuid).classList.add('selected-control-element') |
| | | } else if (type === 'propcard' && parent.subcards.findIndex(cell => cell.uuid === card.uuid) > -1) { |
| | | } else if (type === 'cardcell' && parent.elements.findIndex(cell => cell.uuid === card.uuid) > -1) { |
| | | components.push(card) |
| | | document.getElementById(card.uuid).classList.add('selected-control-element') |
| | | } |
| | |
| | | * @description 修改背景位置 |
| | | */ |
| | | changeBackgroundPositon= (val) => { |
| | | this.updateStyle({backgroundPositon: val}) |
| | | this.updateStyle({backgroundPosition: val}) |
| | | } |
| | | |
| | | /** |
| | |
| | | label="位置" |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Select defaultValue={card.backgroundPositon || 'center'} onChange={this.changeBackgroundPositon}> |
| | | <Select defaultValue={card.backgroundPosition || 'center'} onChange={this.changeBackgroundPositon}> |
| | | <Option value="center">center</Option> |
| | | <Option value="top">top</Option> |
| | | <Option value="bottom">bottom</Option> |
| | |
| | | newcard.options = [] |
| | | newcard.readonly = 'false' |
| | | newcard.required = 'true' |
| | | newcard.span = 24 |
| | | newcard.focus = true |
| | | |
| | | let targetId = '' |
| | |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | <div className="ant-mk-text"><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> |
| | | <div className="ant-mk-text line1" style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | ) |
| | | } else if (card.eleType === 'icon') { |
| | | let val = '' |
| | | let height = card.innerHeight |
| | | |
| | | if (!height) { // 兼容 |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (card.style.fontSize) { |
| | | fontSize = parseInt(card.style.fontSize) |
| | | } |
| | | if (card.style.lineHeight) { |
| | | lineHeight = parseFloat(card.style.lineHeight) |
| | | } |
| | | |
| | | height = fontSize * lineHeight |
| | | } |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.tooltip |
| | |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | {val ? <Tooltip title={val}> |
| | | <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/> |
| | | </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/>} |
| | | <MkIcon className="ant-mk-icon" style={{height: height}} type={card.icon}/> |
| | | </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: height}} type={card.icon}/>} |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div className="ant-mk-date" style={card.style}> |
| | | {val} |
| | | <div style={card.style}> |
| | | <div className="ant-mk-text line1" style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | text-decoration: inherit; |
| | | .sequence-wrap { |
| | | display: inline-block; |
| | | width: 22px; |
| | | height: 22px; |
| | | line-height: 22px; |
| | | width: 21px; |
| | | height: 21px; |
| | | line-height: 21px; |
| | | white-space: nowrap; |
| | | border-radius: 50%; |
| | | overflow: visible; |
| | | text-align: center; |
| | | } |
| | | span { |
| | | text-indent: 0px; |
| | |
| | | border-bottom: 0; |
| | | border-left: 0; |
| | | border-right: 0; |
| | | } |
| | | .ant-mk-date { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | word-break: break-word; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .ant-mk-check { |
| | | white-space: nowrap; |
| | |
| | | let shortcuts = [] |
| | | |
| | | try { // 配置信息解析 |
| | | config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) |
| | | config = window.decodeURIComponent(window.atob(result.LongParam)) |
| | | config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | config = JSON.parse(config) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = '' |
| | |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (cell.style.fontSize) { |
| | | fontSize = parseInt(cell.style.fontSize) |
| | | } |
| | | if (cell.style.lineHeight) { |
| | | lineHeight = parseFloat(cell.style.lineHeight) |
| | | } |
| | | |
| | | cell.innerHeight = fontSize * lineHeight |
| | | } |
| | | return cell |
| | | }) |
| | |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (cell.style.fontSize) { |
| | | fontSize = parseInt(cell.style.fontSize) |
| | | } |
| | | if (cell.style.lineHeight) { |
| | | lineHeight = parseFloat(cell.style.lineHeight) |
| | | } |
| | | |
| | | cell.innerHeight = fontSize * lineHeight |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (cell.style.fontSize) { |
| | | fontSize = parseInt(cell.style.fontSize) |
| | | } |
| | | if (cell.style.lineHeight) { |
| | | lineHeight = parseFloat(cell.style.lineHeight) |
| | | } |
| | | |
| | | cell.innerHeight = fontSize * lineHeight |
| | | } |
| | | |
| | | |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | }) |
| | |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (cell.style.fontSize) { |
| | | fontSize = parseInt(cell.style.fontSize) |
| | | } |
| | | if (cell.style.lineHeight) { |
| | | lineHeight = parseFloat(cell.style.lineHeight) |
| | | } |
| | | |
| | | cell.innerHeight = fontSize * lineHeight |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (cell.style.fontSize) { |
| | | fontSize = parseInt(cell.style.fontSize) |
| | | } |
| | | if (cell.style.lineHeight) { |
| | | lineHeight = parseFloat(cell.style.lineHeight) |
| | | } |
| | | |
| | | cell.innerHeight = fontSize * lineHeight |
| | | } |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | | let service = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | service = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | service = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | |
| | | class FileUpload extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, // 表单信息 |
| | |
| | | form.append('file', param.binary) |
| | | form.append('fileMd5', params.file.fileMd5) |
| | | form.append('shardingMd5', param.chunkMd5) |
| | | form.append('baseDomain', service) |
| | | form.append('baseDomain', window.GLOB.baseurl) |
| | | form.append('rootPath', 'Content/images/upload/') |
| | | form.append('fileName', params.file.fileName) |
| | | form.append('fileExt', params.file.fileType) |
| | |
| | | |
| | | Api.fileuploadbase64(param).then(result => { |
| | | if (result.status && result.Images) { |
| | | let url = service + result.Images |
| | | let url = window.GLOB.baseurl + result.Images |
| | | |
| | | if (rduri) { |
| | | url = rduri.replace(/webapi(.*)$/, '') + result.Images |
| | |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | | let service = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | service = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | service = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | |
| | | class FileUpload extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, // 表单信息 |
| | |
| | | form.append('file', param.binary) |
| | | form.append('fileMd5', param.fileMd5) |
| | | form.append('shardingMd5', param.fileMd5) |
| | | form.append('baseDomain', service) |
| | | form.append('baseDomain', window.GLOB.baseurl) |
| | | form.append('rootPath', 'Content/images/upload/') |
| | | form.append('fileName', param.fileName) |
| | | form.append('fileExt', param.fileType) |
| | |
| | | |
| | | Api.fileuploadbase64(param).then(result => { |
| | | if (result.status && result.Images) { |
| | | let url = service + result.Images |
| | | let url = window.GLOB.baseurl + result.Images |
| | | |
| | | if (rduri) { |
| | | url = rduri.replace(/webapi(.*)$/, '') + result.Images |
| | |
| | | targetId = cards[cards.length - 1].uuid |
| | | } |
| | | |
| | | const { index: overIndex } = findCard(`${targetId}`) // cards为空时 overIndex 为 -1 |
| | | const { index: overIndex, card } = findCard(`${targetId}`) // cards为空时 overIndex 为 -1 |
| | | |
| | | if (card) { |
| | | newcard.span = card.span || 12 |
| | | newcard.labelwidth = card.labelwidth || 33.3 |
| | | } |
| | | |
| | | const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] }) |
| | | |
| | | setCards(_cards) |
| | |
| | | targetId = cards[cards.length - 1].uuid |
| | | } |
| | | |
| | | const { index: overIndex } = findCard(`${targetId}`) |
| | | const { index: overIndex, card } = findCard(`${targetId}`) |
| | | |
| | | if (card) { |
| | | newcard.ratio = card.ratio || 6 |
| | | newcard.labelwidth = card.labelwidth || 33.3 |
| | | } |
| | | |
| | | const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] }) |
| | | |
| | | handleList(_cards, newcard) |
| | |
| | | } else { |
| | | typeOptions = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | text: '文本' |
| | | }, { |
| | | value: 'select', |
| | | text: Formdict['model.form.select'] |
| | | text: '下拉选择' |
| | | }, { |
| | | value: 'multiselect', |
| | | text: Formdict['model.form.multiselect'] |
| | | text: '下拉多选' |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.link'] |
| | | text: '联动菜单' |
| | | }, { |
| | | value: 'checkcard', |
| | | text: '选项卡' |
| | |
| | | text: '日期(周)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | text: '日期(月)' |
| | | }, { |
| | | value: 'daterange', |
| | | text: Formdict['model.form.daterange'] |
| | | text: '日期(区间)' |
| | | }, { |
| | | value: 'group', |
| | | text: Formdict['model.form.dategroup'] |
| | | text: '日期(组合)' |
| | | }] |
| | | } |
| | | |
| | |
| | | |
| | | let _openType = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | text: '文本' |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'select', |
| | | text: Formdict['model.form.select'] |
| | | text: '下拉选择' |
| | | }, { |
| | | value: 'textarea', |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'multiselect', |
| | | text: Formdict['model.form.multiselect'] |
| | | text: '下拉多选' |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.link'] |
| | | text: '联动菜单' |
| | | }, { |
| | | value: 'switch', |
| | | text: '开关' |
| | |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | text: '日期(月)' |
| | | // }, { |
| | | // value: 'datetime', |
| | | // text: '日期(分/秒)' |
| | |
| | | text: '评分' |
| | | }, { |
| | | value: 'color', |
| | | text: Formdict['model.form.color'] |
| | | text: '颜色' |
| | | }, { |
| | | value: 'brafteditor', |
| | | text: '富文本' |
| | | }, { |
| | | value: 'funcvar', |
| | | text: Formdict['header.form.funcvar'] |
| | | text: '函数变量' |
| | | }, { |
| | | value: 'hint', |
| | | text: '提示' |
| | |
| | | if (appType === 'mob') { |
| | | _openType = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | text: '文本' |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'select', |
| | | text: '选择器' |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.link'] |
| | | text: '联动菜单' |
| | | }, { |
| | | value: 'textarea', |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'switch', |
| | | text: '开关' |
| | |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | // }, { |
| | | // value: 'datetime', |
| | | // text: '日期(分/秒)' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | text: '日期(月)' |
| | | }, { |
| | | value: 'cascader', |
| | | text: '级联菜单' |
| | |
| | | text: '评分' |
| | | }, { |
| | | value: 'funcvar', |
| | | text: Formdict['header.form.funcvar'] |
| | | text: '函数变量' |
| | | }, { |
| | | value: 'hint', |
| | | text: '提示' |
| | |
| | | */ |
| | | export function resetStyle (style) { |
| | | if (!style) return {} |
| | | if (sessionStorage.getItem('appType') === 'mob') { |
| | | let _style = JSON.stringify(style) |
| | | |
| | | let _style = JSON.stringify(style) |
| | | _style = _style.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | |
| | | if (sessionStorage.getItem('appType') === 'mob') { |
| | | // scaleview |
| | | _style = _style.replace(/\d+vw/ig, (word) => { |
| | | return parseFloat(word) * (window.GLOB.winWidth || 420) / 100 + 'px' |
| | |
| | | return parseFloat(word) * (window.GLOB.winHeight || 738) / 100 + 'px' |
| | | // return parseFloat(word) * 615 / 100 + 'px' |
| | | }) |
| | | |
| | | return JSON.parse(_style) |
| | | } |
| | | return JSON.parse(JSON.stringify(style)) |
| | | |
| | | return JSON.parse(_style) |
| | | } |
| | |
| | | static getrealurl (url) { |
| | | if (!url) return '' |
| | | |
| | | let baseurl = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | baseurl = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | baseurl = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | |
| | | let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url |
| | | let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : window.GLOB.baseurl + url |
| | | return realurl |
| | | } |
| | | |
| | |
| | | if (options.cloudServiceApi) { |
| | | baseurl = options.cloudServiceApi.replace(/webapi(.*)$/, '') |
| | | } else { |
| | | baseurl = document.location.origin + '/' + window.GLOB.service |
| | | baseurl = window.GLOB.baseurl |
| | | } |
| | | |
| | | return url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url |
| | |
| | | const _locale = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | const Header = asyncComponent(() => import('./header')) |
| | | |
| | | let base_url = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | base_url = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | base_url = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | |
| | | const skinStyle = { |
| | | bg_black_style_blue: {name: '蓝色', color: '#1890ff'}, |
| | | bg_black_style_red: {name: '红色', color: '#f5222d'}, |
| | |
| | | </Col> |
| | | </Row> |
| | | <div className="action"> |
| | | <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${base_url}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}` }}></Paragraph> |
| | | <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}` }}></Paragraph> |
| | | </div> |
| | | </div> |
| | | ) |
| | |
| | | const ScriptForm = asyncComponent(() => import('./scriptform')) |
| | | const SubMutilForm = asyncComponent(() => import('./submutilform')) |
| | | |
| | | let base_url = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | base_url = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | base_url = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | const skinStyle = { |
| | |
| | | <Button type="link" onClick={() => this.setState({ selectSubApp: item, subVisible: 'edit' })} style={{color: '#8E44AD'}}>修改</Button> |
| | | <Button type="link" onClick={() => this.deleteSubApp(item)} style={{color: '#ff4d4f'}}>删除</Button> |
| | | <Button type="link" onClick={() => this.jumpApp(item)}>编辑应用</Button> |
| | | <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${base_url}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}` }}></Paragraph> |
| | | <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}` }}></Paragraph> |
| | | </div> |
| | | </div> |
| | | ) |
| | |
| | | let config = '' |
| | | |
| | | try { |
| | | config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) |
| | | config = window.decodeURIComponent(window.atob(result.LongParam)) |
| | | config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | config = JSON.parse(config) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = '' |
| | |
| | | } |
| | | |
| | | uselogon = () => { |
| | | let baseurl = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | baseurl = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | baseurl = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | let m = { |
| | | active: 'raw', |
| | | createDate: '', |
| | | formData: [], |
| | | headers: [], |
| | | interface: baseurl + 'webapi/logon', |
| | | interface: window.GLOB.baseurl + 'webapi/logon', |
| | | method: 'POST', |
| | | params: [], |
| | | raw: "{\n \"UserName\":\"******\",\n \"Password\":\"******\",\n \"systemType\":\"local\",\n \"Type\":\"公钥\",\n \"privatekey\":\"私钥\",\n \"timestamp\":\"" + moment().format('YYYY-MM-DD HH:mm:ss') + "\",\n \"appkey\":\"" + window.GLOB.appkey + "\"\n}", |
| | |
| | | } |
| | | |
| | | usedostars = () => { |
| | | let baseurl = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | baseurl = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | baseurl = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | let m = { |
| | | active: 'raw', |
| | | createDate: '', |
| | | formData: [], |
| | | headers: [], |
| | | interface: baseurl + 'webapi/dostars', |
| | | interface: window.GLOB.baseurl + 'webapi/dostars', |
| | | method: 'POST', |
| | | params: [], |
| | | raw: "{\n \"func\":\"******\",\n \"LoginUID\":\"******\",\n \"UserID\":\"******\",\n \"nonc\":\"" + Utils.getguid() + "\",\n \"t\":" + parseInt(new Date().getTime() / 1000) + "\n}", |
| | |
| | | const MenuShell = asyncComponent(() => import('@/menu/menushell')) |
| | | const PrintMenuForm = asyncComponent(() => import('./printmenuform')) |
| | | const SourceWrap = asyncComponent(() => import('@/menu/modulesource')) |
| | | const Modulecell = asyncComponent(() => import('@/menu/modulecell')) |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | | const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) |
| | | const StyleController = asyncComponent(() => import('@/menu/stylecontroller')) |
| | |
| | | <Panel header="组件" key="component"> |
| | | <SourceWrap MenuType={MenuType} /> |
| | | </Panel> |
| | | <Panel header="元素" key="element"> |
| | | <Modulecell /> |
| | | </Panel> |
| | | {customComponents && customComponents.length ? <Panel header="自定义组件" key="cuscomponent"> |
| | | <SourceWrap components={customComponents} MenuType={MenuType} /> |
| | | </Panel> : null} |
| | |
| | | const Versions = asyncComponent(() => import('@/menu/versions')) |
| | | const ViewNodes = asyncComponent(() => import('@/menu/viewnodes')) |
| | | 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 SysInterface = asyncComponent(() => import('@/menu/sysinterface')) |
| | |
| | | <Panel header={dict['mob.component']} className="component" key="component"> |
| | | <SourceWrap /> |
| | | </Panel> |
| | | <Panel header="元素" key="element"> |
| | | <Modulecell /> |
| | | </Panel> |
| | | {customComponents && customComponents.length ? <Panel header="自定义组件" className="cuscomponent" key="cuscomponent"> |
| | | <SourceWrap components={customComponents} /> |
| | | </Panel> : null} |
| | |
| | | const MenuShell = asyncComponent(() => import('@/pc/menushell')) |
| | | const ViewNodes = asyncComponent(() => import('@/menu/viewnodes')) |
| | | const SourceWrap = asyncComponent(() => import('@/pc/modulesource')) |
| | | const Modulecell = asyncComponent(() => import('@/menu/modulecell')) |
| | | const CreateView = asyncComponent(() => import('@/pc/createview')) |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | | const Quotecomponent = asyncComponent(() => import('@/pc/quotecomponent')) |
| | |
| | | <Panel header={dict['mob.component']} key="component"> |
| | | <SourceWrap /> |
| | | </Panel> |
| | | <Panel header="元素" key="element"> |
| | | <Modulecell /> |
| | | </Panel> |
| | | {customComponents && customComponents.length ? <Panel header="自定义组件" key="cuscomponent"> |
| | | <SourceWrap components={customComponents} /> |
| | | </Panel> : null} |
| | |
| | | const Versions = asyncComponent(() => import('@/menu/versions')) |
| | | const Header = asyncComponent(() => import('@/menu/header')) |
| | | const SourceWrap = asyncComponent(() => import('@/menu/modulesource')) |
| | | const Modulecell = asyncComponent(() => import('@/menu/modulecell')) |
| | | const MenuShell = asyncComponent(() => import('@/menu/menushell')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | |
| | | <Panel header="组件" key="component"> |
| | | <SourceWrap MenuType="" /> |
| | | </Panel> |
| | | <Panel header="元素" key="element"> |
| | | <Modulecell /> |
| | | </Panel> |
| | | {customComponents && customComponents.length ? <Panel header="自定义组件" key="cuscomponent"> |
| | | <SourceWrap components={customComponents} MenuType="" /> |
| | | </Panel> : null} |