Merge branch 'master' into positec
| | |
| | | GLOB.mainSystemApi = '' |
| | | } |
| | | |
| | | if (/#\/hs$/.test(window.location.href)) { // hs下不打印脚本 |
| | | GLOB.debugger = false |
| | | |
| | | if (GLOB.mainSystemApi) { |
| | | GLOB.localSystemApi = GLOB.mainSystemApi |
| | | GLOB.mainSystemApi = '' |
| | | } |
| | | if (GLOB.cloudServiceApi) { |
| | | GLOB.mainSystemApi = GLOB.cloudServiceApi |
| | | } |
| | | } |
| | | |
| | | if (GLOB.sysType !== 'cloud') { |
| | | if (config.appkey === options.cakey) { |
| | | document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">不可使用云端appkey,请联系管理员!</div>' |
| | |
| | | } |
| | | } |
| | | |
| | | if (/#\/hs$/.test(window.location.href)) { // hs下不打印脚本 |
| | | GLOB.debugger = false |
| | | |
| | | if (GLOB.mainSystemApi) { |
| | | GLOB.localSystemApi = GLOB.mainSystemApi |
| | | GLOB.mainSystemApi = '' |
| | | } |
| | | if (GLOB.cloudServiceApi) { |
| | | GLOB.mainSystemApi = GLOB.cloudServiceApi |
| | | } |
| | | } |
| | | |
| | | let _href = window.location.href.split('#')[0] |
| | | let _systemMsg = localStorage.getItem(_href + 'system') |
| | | let className = 'mk-blue-black' |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cacheSearch', |
| | | label: '搜索缓存', |
| | | initval: wrap.cacheSearch || 'false', |
| | | tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'click', |
| | | label: '点击事件', |
| | | initval: wrap.click || '', |
| | |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cacheSearch', |
| | | label: '搜索缓存', |
| | | initval: wrap.cacheSearch || 'false', |
| | | tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cacheSearch', |
| | | label: '搜索缓存', |
| | | initval: wrap.cacheSearch || 'false', |
| | | tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | <div className={`${card.wrap.layout || 'grid'}-layout float-${card.wrap.cardFloat || 'left'} select-${card.wrap.selStyle || ''}`}> |
| | | {card.subcards.map(subcard => (<CardComponent key={subcard.uuid} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} |
| | | </div> |
| | | {card.wrap.display === 'hidden' ? <HeatMapOutlined className="prop-hidden"/> : null} |
| | | {card.wrap.display === 'hidden' ? <HeatMapOutlined title="组件隐藏" className="prop-hidden"/> : null} |
| | | <div className="component-name"> |
| | | <div className="center"> |
| | | <div className="title" onDoubleClick={() => { |
| | |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cacheSearch', |
| | | label: '搜索缓存', |
| | | initval: wrap.cacheSearch || 'false', |
| | | tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !!appType |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | initval: wrap.controlVal || '', |
| | | tooltip: '当字段值与禁用值相等时,行数据会禁用,多个值用逗号分隔。', |
| | | required: false |
| | | } |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cacheSearch', |
| | | label: '搜索缓存', |
| | | initval: wrap.cacheSearch || 'false', |
| | | tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ] |
| | | }, |
| | | ] |
| | | |
| | | return wrapForm |
| | |
| | | <PlusOutlined className="plus" title="添加列" onClick={this.addColumns}/> |
| | | {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="添加搜索" onClick={this.addSearch}/> : null} |
| | | <PlusSquareOutlined className="plus" title="添加按钮" onClick={this.addButton}/> |
| | | <NormalForm title="表格设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <NormalForm title="表格设置" width={900} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="editable" card={card}/> |
| | |
| | | {value: 'all', label: '全部'}, |
| | | {value: 'change', label: '修改项'}, |
| | | {value: 'simple', label: '单项'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'standard', values: ['change', 'simple']}, |
| | | ] |
| | | }, |
| | | // { |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'standard', |
| | | label: '修改标准', |
| | | initval: wrap.standard || 'init', |
| | | tooltip: '如何判断行信息是否应该提交。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'init', label: '与初始值不同'}, |
| | | {value: 'change', label: '存在编辑痕迹'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cache', |
| | | label: '缓存', |
| | | initval: wrap.cache || 'true', |
| | |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cacheSearch', |
| | | label: '搜索缓存', |
| | | initval: wrap.cacheSearch || 'false', |
| | | tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | return {tbs, ptbs} |
| | | } |
| | | |
| | | getFuncAndInterface = (config) => { |
| | | let ptbs = [] |
| | | |
| | | let filterBtn = (cell, tbs) => { |
| | | if (cell.intertype === 'inner') { |
| | | tbs.push({ |
| | | label: cell.innerFunc + ' (' + cell.label + ')', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } else if (cell.intertype === 'outer' || cell.intertype === 'custom') { |
| | | if (cell.innerFunc) { |
| | | tbs.push({ |
| | | label: cell.innerFunc + ' (' + cell.label + ')', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | if (cell.outerFunc) { |
| | | tbs.push({ |
| | | label: cell.outerFunc + ' (' + cell.label + ')', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | if (cell.interface && cell.sysInterface !== 'true') { |
| | | tbs.push({ |
| | | label: cell.interface + ' (' + cell.label + ')', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | if (cell.proInterface) { |
| | | tbs.push({ |
| | | label: cell.proInterface + ' (' + cell.label + ')', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | if (cell.exInterface) { |
| | | let url = '' |
| | | |
| | | try { |
| | | url = JSON.parse(cell.exInterface).url |
| | | } catch(e) { |
| | | url = '' |
| | | } |
| | | |
| | | if (url) { |
| | | tbs.push({ |
| | | label: url + ' (' + cell.label + ')', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | } |
| | | if (cell.exProInterface) { |
| | | let url = '' |
| | | |
| | | try { |
| | | url = JSON.parse(cell.exProInterface).url |
| | | } catch(e) { |
| | | url = '' |
| | | } |
| | | |
| | | if (url) { |
| | | tbs.push({ |
| | | label: url + ' (' + cell.label + ')', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | } |
| | | if (cell.callbackFunc) { |
| | | tbs.push({ |
| | | label: cell.callbackFunc + ' (' + cell.label + ')', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | let filterSetting = (item, tbs) => { |
| | | if (!item.setting) return |
| | | if (item.setting.interType === 'inner') { |
| | | tbs.push({ |
| | | label: item.setting.innerFunc + ' (数据源)', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } else if (item.setting.interType === 'outer') { |
| | | if (item.setting.outerFunc) { |
| | | tbs.push({ |
| | | label: item.setting.outerFunc + ' (数据源)', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | if (item.setting.interface && item.setting.sysInterface !== 'true') { |
| | | tbs.push({ |
| | | label: item.setting.interface + ' (数据源)', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | if (item.setting.proInterface) { |
| | | tbs.push({ |
| | | label: item.setting.proInterface + ' (数据源)', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | if (item.setting.exInterface) { |
| | | let url = '' |
| | | |
| | | try { |
| | | url = JSON.parse(item.setting.exInterface).url |
| | | } catch(e) { |
| | | url = '' |
| | | } |
| | | |
| | | if (url) { |
| | | tbs.push({ |
| | | label: url + ' (数据源)', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | } |
| | | if (item.setting.exProInterface) { |
| | | let url = '' |
| | | |
| | | try { |
| | | url = JSON.parse(item.setting.exProInterface).url |
| | | } catch(e) { |
| | | url = '' |
| | | } |
| | | |
| | | if (url) { |
| | | tbs.push({ |
| | | label: url + ' (数据源)', |
| | | color: 'orange', |
| | | id: Utils.getuuid(), |
| | | direction: 'left' |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | let traversal = (components, extra) => { |
| | | components.forEach(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | traversal(tab.components, extra) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | traversal(item.components, extra) |
| | | } else { |
| | | let tbs = [] |
| | | |
| | | filterSetting(item, tbs) |
| | | |
| | | if (item.action) { |
| | | item.action.forEach(cell => { |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config.components) { |
| | | traversal(cell.config.components, `-${cell.label}(弹窗)`) |
| | | } |
| | | } else { |
| | | filterBtn(cell, tbs) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { |
| | | item.subcards.forEach(card => { |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config.components) { |
| | | traversal(cell.config.components, `-${cell.label}(弹窗)`) |
| | | } |
| | | } else { |
| | | filterBtn(cell, tbs) |
| | | } |
| | | }) |
| | | card.backElements && card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config.components) { |
| | | traversal(cell.config.components, `-${cell.label}(弹窗)`) |
| | | } |
| | | } else { |
| | | filterBtn(cell, tbs) |
| | | } |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements && item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config.components) { |
| | | traversal(cell.config.components, `-${cell.label}(弹窗)`) |
| | | } |
| | | } else { |
| | | filterBtn(cell, tbs) |
| | | } |
| | | }) |
| | | } else if (item.type === 'table') { |
| | | let loopCol = (cols) => { |
| | | cols.forEach(col => { |
| | | if (col.type === 'colspan') { |
| | | loopCol(col.subcols) |
| | | } else if (col.type === 'custom') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config.components) { |
| | | traversal(cell.config.components, `-${cell.label}(弹窗)`) |
| | | } |
| | | } else { |
| | | filterBtn(cell, tbs) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | loopCol(item.cols) |
| | | } else if (item.type === 'form') { |
| | | item.subcards.forEach(group => { |
| | | filterBtn(group.subButton, tbs) |
| | | }) |
| | | } |
| | | |
| | | if (tbs.length) { |
| | | ptbs.push({ |
| | | label: item.name + extra, |
| | | id: Utils.getuuid(), |
| | | direction: 'left', |
| | | color: 'orange', |
| | | children: tbs |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (config.interfaces) { |
| | | config.interfaces.forEach(item => { |
| | | let tbs = [] |
| | | filterSetting(item, tbs) |
| | | if (tbs.length) { |
| | | ptbs.push({ |
| | | label: item.name, |
| | | id: Utils.getuuid(), |
| | | direction: 'left', |
| | | color: 'orange', |
| | | children: tbs |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | traversal(config.components, '') |
| | | |
| | | return ptbs |
| | | } |
| | | |
| | | trigger = () => { |
| | | const { config } = this.props |
| | | |
| | |
| | | |
| | | data.children.push(cell) |
| | | }) |
| | | } |
| | | |
| | | let funcs = this.getFuncAndInterface(config) |
| | | |
| | | if (funcs.length) { |
| | | data.children.push(...funcs) |
| | | } |
| | | |
| | | if (result.tb_list) { |
| | |
| | | </div> |
| | | <div className="footer"> |
| | | <Button key="cancel" onClick={() => { this.setState({ visible: false })}}>关闭</Button> |
| | | <span className="tip">注:点击表名可展开/收起菜单</span> |
| | | <span className="tip">注:点击表名(右侧)可展开/收起菜单,左侧橙色标注为接口或函数名。</span> |
| | | </div> |
| | | </Modal> |
| | | </div> |
| | |
| | | import { Table, Typography, Modal, Input, InputNumber, Button, notification, message, Select } from 'antd' |
| | | import { EditOutlined, QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | pageSize: 10, // 每页数据条数 |
| | | columns: null, // 显示列 |
| | | forms: [], |
| | | signForms: [], |
| | | orderfields: {}, // 排序id与field转换 |
| | | loading: false, |
| | | pageOptions: [], |
| | |
| | | let deForms = [] |
| | | let _forms = {} |
| | | let hasBid = false |
| | | let signForms = [] |
| | | |
| | | let getColumns = (cols) => { |
| | | return cols.map(item => { |
| | |
| | | } else { |
| | | if (item.editable === 'true') { |
| | | _forms[item.field] = item |
| | | |
| | | signForms.push(item.field) |
| | | |
| | | if (item.ctrlField) { |
| | | item.ctrlValue = item.ctrlValue.split(',') |
| | |
| | | |
| | | this.setState({ |
| | | forms, |
| | | signForms, |
| | | pageSize: setting.pageSize || 10, |
| | | pageOptions, |
| | | columns: _columns, |
| | |
| | | } |
| | | |
| | | transferData = (menuid, data, type) => { |
| | | const { MenuID } = this.props |
| | | const { edData } = this.state |
| | | const { MenuID, setting } = this.props |
| | | const { edData, signForms } = this.state |
| | | |
| | | if (menuid !== MenuID) return |
| | | |
| | | if (setting.commit !== 'all' && setting.standard !== 'change') { |
| | | if (type !== 'line') { |
| | | data.forEach(item => { |
| | | let value = '' |
| | | signForms.forEach(field => { |
| | | value += item[field] |
| | | }) |
| | | item.$sign = md5(value) |
| | | }) |
| | | } else { |
| | | let value = '' |
| | | signForms.forEach(field => { |
| | | value += data[field] |
| | | }) |
| | | data.$sign = md5(value) |
| | | } |
| | | } |
| | | |
| | | if (type !== 'line') { |
| | | let index = edData.findIndex(item => !item.$origin && !item.$forbid) |
| | |
| | | |
| | | changeRecord = (id, record) => { |
| | | const { setting } = this.props |
| | | const { tableId } = this.state |
| | | const { tableId, signForms } = this.state |
| | | |
| | | if (id !== tableId) return |
| | | |
| | | let lock = record.$lock |
| | | if (!record.$sign) { |
| | | record.$origin = false |
| | | record.$lock = true |
| | | delete record.$forbid |
| | | } else { |
| | | let value = '' |
| | | signForms.forEach(field => { |
| | | value += record[field] |
| | | }) |
| | | |
| | | if (record.$sign !== md5(value)) { |
| | | record.$origin = false |
| | | record.$lock = true |
| | | } else { |
| | | record.$origin = true |
| | | record.$lock = false |
| | | } |
| | | } |
| | | |
| | | let _data = this.state.edData.map(item => { |
| | | if (item.$$uuid === record.$$uuid) { |
| | | record.$origin = false |
| | | record.$lock = true |
| | | |
| | | delete record.$forbid |
| | | |
| | | return record |
| | | } else { |
| | | return item |
| | |
| | | }) |
| | | |
| | | this.setState({edData: _data}, () => { |
| | | if (setting.tableType && setting.hasAction && !lock && this.state.selectedRowKeys.includes(record.$$uuid)) { |
| | | if (setting.tableType && setting.hasAction && this.state.selectedRowKeys.includes(record.$$uuid)) { |
| | | this.selectdata(this.state.selectedRowKeys) |
| | | } |
| | | }) |
| | |
| | | border-color: var(--mk-table-border-color)!important; |
| | | } |
| | | table tr { |
| | | th .ant-table-column-title { |
| | | position: unset!important; |
| | | } |
| | | th .ant-table-column-title, th .ant-table-column-title span:not(.anticon) { |
| | | font-size: var(--mk-table-font-size)!important; |
| | | font-weight: var(--mk-table-font-weight)!important; |
| | |
| | | } |
| | | |
| | | handleSubmit = () => { |
| | | const { config } = this.props |
| | | |
| | | this.setState({}, () => { |
| | | this.props.form.validateFields((err, values) => { |
| | | if (err) return |
| | |
| | | this.sign = '' |
| | | }, 2000) |
| | | |
| | | if (config.wrap && config.wrap.cacheSearch === 'true') { |
| | | let _values = {} |
| | | searches.forEach(item => { |
| | | _values[item.key] = item.value |
| | | }) |
| | | |
| | | window.GLOB.SearchBox.set(config.$searchId + 'cache', _values) |
| | | } |
| | | |
| | | if (this.props.refreshdata) { |
| | | this.props.refreshdata(searches) |
| | | } else { |
| | | window.GLOB.SearchBox.set(this.props.config.$searchId, searches) |
| | | MKEmitter.emit('searchRefresh', this.props.config.$searchId) |
| | | window.GLOB.SearchBox.set(config.$searchId, searches) |
| | | MKEmitter.emit('searchRefresh', config.$searchId) |
| | | } |
| | | }) |
| | | }) |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 获取接口及函数 |
| | | */ |
| | | export function getFuncsAndInters (config) { |
| | | let inters = 'false' |
| | | |
| | | let filterBtn = (cell) => { |
| | | if ((cell.intertype === 'outer' && cell.sysInterface !== 'true') || cell.intertype === 'custom') { |
| | | inters = 'true' |
| | | } |
| | | } |
| | | |
| | | let traversal = (components) => { |
| | | if (!components || inters === 'true') return |
| | | |
| | | components.forEach(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | traversal(tab.components) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | traversal(item.components) |
| | | } else { |
| | | if (item.setting && item.setting.interType === 'outer' && item.setting.sysInterface !== 'true') { |
| | | inters = 'true' |
| | | } |
| | | |
| | | if (item.action) { |
| | | item.action.forEach(cell => { |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config) { |
| | | traversal(cell.config.components) |
| | | } |
| | | } else { |
| | | filterBtn(cell) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { |
| | | item.subcards.forEach(card => { |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config) { |
| | | traversal(cell.config.components) |
| | | } |
| | | } else { |
| | | filterBtn(cell) |
| | | } |
| | | }) |
| | | card.backElements && card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config) { |
| | | traversal(cell.config.components) |
| | | } |
| | | } else { |
| | | filterBtn(cell) |
| | | } |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements && item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config) { |
| | | traversal(cell.config.components) |
| | | } |
| | | } else { |
| | | filterBtn(cell) |
| | | } |
| | | }) |
| | | } else if (item.type === 'table') { |
| | | let loopCol = (cols) => { |
| | | cols.forEach(col => { |
| | | if (col.type === 'colspan') { |
| | | loopCol(col.subcols) |
| | | } else if (col.type === 'custom') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config) { |
| | | traversal(cell.config.components) |
| | | } |
| | | } else { |
| | | filterBtn(cell) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | loopCol(item.cols) |
| | | } else if (item.type === 'form') { |
| | | item.subcards.forEach(group => { |
| | | filterBtn(group.subButton) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (config.interfaces) { |
| | | config.interfaces.forEach(item => { |
| | | if (item.setting && item.setting.interType === 'outer' && item.setting.sysInterface !== 'true') { |
| | | inters = 'true' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | traversal(config.components) |
| | | |
| | | return inters |
| | | } |
| | | |
| | | /** |
| | | * @description 检测组件内容 |
| | | */ |
| | | export function checkComponent (card) { |
| | |
| | | let roleId = sessionStorage.getItem('role_id') || '' |
| | | let required = false |
| | | let keys = [] |
| | | let values = null |
| | | if (config.wrap && config.wrap.cacheSearch === 'true') { |
| | | values = window.GLOB.SearchBox.get(config.$searchId + 'cache') |
| | | } |
| | | |
| | | config.search = config.search.map(item => { |
| | | item.hidden = item.Hide === 'true' |
| | |
| | | |
| | | item.oriInitval = item.initval |
| | | |
| | | if (values) { |
| | | item.initval = values[item.field] || '' |
| | | } |
| | | |
| | | if (item.blacklist && item.blacklist.length > 0 && !item.hidden) { |
| | | if (item.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | | item.hidden = true |
| | |
| | | import React, {Component} from 'react' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Menu, Popover, Modal, notification } from 'antd' |
| | | import { EditOutlined, PlusOutlined, SettingOutlined } from '@ant-design/icons' |
| | | import { EditOutlined, PlusOutlined, SettingOutlined, ApiOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | {item.children.map(cell => { |
| | | return ( |
| | | <Menu.Item key={cell.MenuID}> |
| | | <span className="editable-menu-item" onDoubleClick={() => this.editmenu(cell)}>{cell.MenuName}</span> |
| | | <span className="editable-menu-item" onDoubleClick={() => this.editmenu(cell)}>{cell.PageParam && cell.PageParam.interfaces === 'true' ? <ApiOutlined title="菜单中使用了外部接口" /> : null}{cell.MenuName}</span> |
| | | </Menu.Item> |
| | | ) |
| | | })} |
| | |
| | | padding-left: 48px; |
| | | } |
| | | .editable-menu-item { |
| | | position: relative; |
| | | display: block; |
| | | padding-left: 48px; |
| | | cursor: pointer; |
| | | |
| | | .anticon-api { |
| | | position: absolute; |
| | | left: 25px; |
| | | top: 11px; |
| | | color: orange; |
| | | } |
| | | } |
| | | } |
| | | .ant-menu-sub.ant-menu-inline { |
| | |
| | | |
| | | Api.getTouristMsg().then(result => { |
| | | if (result.status) { |
| | | if (result.website && process.env.NODE_ENV === 'production') { |
| | | let website = result.website.replace(/http(s)?:\/\/|\/$/ig, '').toLowerCase() |
| | | let current = window.GLOB.baseurl.replace(/http(s)?:\/\/|\/$/ig, '').toLowerCase() |
| | | // if (result.website && process.env.NODE_ENV === 'production') { |
| | | // let website = result.website.replace(/http(s)?:\/\/|\/$/ig, '').toLowerCase() |
| | | // let current = window.GLOB.baseurl.replace(/http(s)?:\/\/|\/$/ig, '').toLowerCase() |
| | | |
| | | if (website !== current) { |
| | | try { |
| | | window.history.replaceState(null, null, result.website.replace(/\/$/ig, '') + '/admin/index.html#/login') |
| | | window.location.reload() |
| | | } catch(e) { |
| | | window.location.href = result.website.replace(/\/$/ig, '') + '/admin/index.html#/login' |
| | | } |
| | | return |
| | | } |
| | | } |
| | | // if (website !== current) { |
| | | // try { |
| | | // window.history.replaceState(null, null, result.website.replace(/\/$/ig, '') + '/admin/index.html#/login') |
| | | // window.location.reload() |
| | | // } catch(e) { |
| | | // window.location.href = result.website.replace(/\/$/ig, '') + '/admin/index.html#/login' |
| | | // } |
| | | // return |
| | | // } |
| | | // } |
| | | |
| | | sessionStorage.setItem('visitorUserID', result.UserID || '') |
| | | sessionStorage.setItem('visitorLoginUID', result.LoginUID || '') |
| | |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { getTables } from '@/utils/utils-custom.js' |
| | | import { getTables, getFuncsAndInters } from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | |
| | | import '@/assets/css/design.scss' |
| | |
| | | config.tbkey = key |
| | | } |
| | | |
| | | let interfaces = getFuncsAndInters(config) |
| | | |
| | | let param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | | FstID: config.fstMenuId || '', |
| | |
| | | EasyCode: config.easyCode || '', |
| | | Template: 'CustomPage', |
| | | MenuName: config.MenuName || '', |
| | | PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false'}), |
| | | PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', interfaces}), |
| | | open_edition: config.open_edition, |
| | | LText: '', |
| | | LTexttb: '', |
| | |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MenuUtils, { getTables } from '@/utils/utils-custom.js' |
| | | import MenuUtils, { getTables, getFuncsAndInters } from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | |
| | | import '@/assets/css/design.scss' |
| | |
| | | let menus_used_list = subMenus.map(m => `'${config.uuid}','${config.MenuName || ''}','${config.MenuNo || ''}','${m.MenuID}','${m.MenuName}'`).join(';') |
| | | menus_used_list = window.btoa(window.encodeURIComponent(menus_used_list || 'del')) |
| | | |
| | | let interfaces = getFuncsAndInters(config) |
| | | roleParam.interfaces = interfaces |
| | | |
| | | let param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | | FstID: 'mk_app', |
| | |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | Typename: sessionStorage.getItem('typename'), |
| | | MenuName: config.MenuName || '', |
| | | PageParam: JSON.stringify({Template: 'webPage'}), |
| | | PageParam: JSON.stringify({Template: 'webPage', interfaces}), |
| | | open_edition: config.open_edition, |
| | | menus_rolelist: window.btoa(window.encodeURIComponent(JSON.stringify(roleParam))), |
| | | LText: '', |
| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | | import { getTables } from '@/utils/utils-custom.js' |
| | | import { getTables, getFuncsAndInters } from '@/utils/utils-custom.js' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | |
| | | config.tbkey = key |
| | | } |
| | | |
| | | let interfaces = getFuncsAndInters(config) |
| | | roleParam.interfaces = interfaces |
| | | |
| | | let param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | | FstID: 'mk_app', |
| | |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | Typename: 'pc', |
| | | MenuName: config.MenuName || '', |
| | | PageParam: JSON.stringify({Template: 'webPage'}), |
| | | PageParam: JSON.stringify({Template: 'webPage', interfaces}), |
| | | menus_rolelist: window.btoa(window.encodeURIComponent(JSON.stringify(roleParam))), |
| | | open_edition: config.open_edition, |
| | | LText: '', |
| | |
| | | import { Spin, notification, Button, Table, Modal, ConfigProvider, Tree, Input, Empty } from 'antd' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | import enUS from 'antd/es/locale/en_US' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | import { ApiOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | const { TreeNode } = Tree |
| | | const { Search } = Input |
| | | |
| | | const _locale = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | const Header = asyncComponent(() => import('./header')) |
| | | const TransferForm = asyncComponent(() => import('@/templates/zshare/basetransferform')) |
| | | |
| | |
| | | title: '菜单名称', dataIndex: 'MenuName', key: 'MenuName', align: 'center', render: (text, record) => { |
| | | if (record.extra) { |
| | | return <span style={{color: '#1890ff'}}>{text}</span> |
| | | } else if (record.interfaces === 'true') { |
| | | return <span><ApiOutlined style={{color: 'orange', marginRight: '5px'}} title="菜单中使用了外部接口" />{text}</span> |
| | | } |
| | | return text |
| | | } |
| | |
| | | try { |
| | | let pageParam = JSON.parse(window.decodeURIComponent(window.atob(item.menus_rolelist))) |
| | | item.nodes = pageParam |
| | | item.interfaces = pageParam.interfaces || 'false' |
| | | |
| | | if (pageParam.type) { |
| | | item.type = pageParam.type |
| | |
| | | |
| | | return ( |
| | | <div className="mk-role-manage"> |
| | | <ConfigProvider locale={_locale}> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header app={app} /> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | this.props.history.replace('/login') |
| | | } else { |
| | | if (!sessionStorage.getItem('LocalUserID')) { |
| | | sessionStorage.setItem('LocalUserID', sessionStorage.getItem('UserID')) |
| | | sessionStorage.setItem('LocalLoginUID', sessionStorage.getItem('LoginUID')) |
| | | } |
| | | sessionStorage.setItem('role_id', sessionStorage.getItem('cloudRole_id')) |
| | | sessionStorage.setItem('dataM', sessionStorage.getItem('cloudDataM')) |
| | | sessionStorage.setItem('User_Name', sessionStorage.getItem('CloudUserName')) |
| | |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { getTables } from '@/utils/utils-custom.js' |
| | | import { getTables, getFuncsAndInters } from '@/utils/utils-custom.js' |
| | | import SourceElement from '@/templates/zshare/dragsource' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import Source from './source' |
| | |
| | | config.tbkey = key |
| | | } |
| | | |
| | | let interfaces = getFuncsAndInters(config) |
| | | |
| | | let param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | | FstID: config.fstMenuId || '', |
| | |
| | | EasyCode: config.easyCode || '', |
| | | Template: 'BaseTable', |
| | | MenuName: config.MenuName || '', |
| | | PageParam: JSON.stringify({Template: 'BaseTable', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false'}), |
| | | PageParam: JSON.stringify({Template: 'BaseTable', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', interfaces}), |
| | | open_edition: config.open_edition, |
| | | LText: '', |
| | | LTexttb: '', |