| | |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { ConfigProvider, notification, Modal, Collapse, Card, Switch, Button, Typography, Spin } from 'antd' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, Spin } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import html2canvas from 'html2canvas' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import options from '@/store/options.js' |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import Utils from '@/utils/utils.js' |
| | | import { langs } from '@/store/options' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { getTables } from '@/utils/utils-custom.js' |
| | | import { getTables, getFuncsAndInters, getLangTrans, getAllSqls } from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | |
| | | import '@/assets/css/design.scss' |
| | |
| | | const { Panel } = Collapse |
| | | const { confirm } = Modal |
| | | const { Paragraph } = Typography |
| | | const _locale = antdZhCN |
| | | |
| | | const MenuForm = asyncComponent(() => import('./menuform')) |
| | | const HomeForm = asyncComponent(() => import('./homeform')) |
| | |
| | | const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) |
| | | const StyleController = asyncComponent(() => import('@/menu/stylecontroller')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const Debug = asyncComponent(() => import('@/menu/debug')) |
| | | const NormalCss = asyncComponent(() => import('@/menu/normalCss')) |
| | | const Versions = asyncComponent(() => import('@/menu/versions')) |
| | | const TableNodes = asyncComponent(() => import('@/menu/tablenodes')) |
| | |
| | | menuloading: false, |
| | | oriConfig: null, |
| | | config: null, |
| | | customComponents: [], |
| | | comloading: false, |
| | | settingshow: sessionStorage.getItem('settingshow') !== 'false', |
| | | eyeopen: false, |
| | | view: '', |
| | | popConfig: null, |
| | | langName: '', |
| | | needUpdate: false |
| | | } |
| | | |
| | |
| | | try { |
| | | let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param))) |
| | | |
| | | sessionStorage.setItem('MenuType', param.MenuType || 'custom') |
| | | |
| | | if (param.lang) { |
| | | sessionStorage.setItem('lang', param.lang) |
| | | } |
| | | |
| | | this.setState({ |
| | | MenuType: param.MenuType, |
| | | MenuId: param.MenuId || param.MenuID, |
| | | ParentId: param.ParentId || '', |
| | | MenuName: param.MenuName || '', |
| | | MenuNo: param.MenuNo || '', |
| | | langName: sessionStorage.getItem('lang') !== 'zh-CN' && langs[sessionStorage.getItem('lang')] ? `(${langs[sessionStorage.getItem('lang')]})` : '' |
| | | }, () => { |
| | | this.getMenuParam() |
| | | }) |
| | |
| | | |
| | | MKEmitter.addListener('changePopview', this.initPopview) |
| | | MKEmitter.addListener('triggerMenuSave', this.triggerMenuSave) |
| | | MKEmitter.addListener('updateCustomComponent', this.updateCustomComponent) |
| | | MKEmitter.addListener('changeEditMenu', this.changeEditMenu) |
| | | setTimeout(() => { |
| | | if (sessionStorage.getItem('app_custom_components')) { |
| | | let list = sessionStorage.getItem('app_custom_components') |
| | | list = JSON.parse(list) |
| | | |
| | | this.setCustomComponent(list) |
| | | } else { |
| | | this.updateCustomComponent() |
| | | } |
| | | this.getAppPictures() |
| | | this.getPrintTemp() |
| | | this.getRoleFields() |
| | | setGLOBFuncs() |
| | | // setGLOBFuncs() |
| | | }, 1000) |
| | | |
| | | document.onkeydown = (event) => { |
| | |
| | | } |
| | | MKEmitter.removeListener('changePopview', this.initPopview) |
| | | MKEmitter.removeListener('triggerMenuSave', this.triggerMenuSave) |
| | | MKEmitter.removeListener('updateCustomComponent', this.updateCustomComponent) |
| | | MKEmitter.removeListener('changeEditMenu', this.changeEditMenu) |
| | | } |
| | | |
| | | changeEditMenu = (menu) => { |
| | | if (menu.MenuID && menu.MenuID.length === 3 && menu.MenuNo && !this.menuLoading) { |
| | | this.menuLoading = true |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: menu.MenuID[2] |
| | | } |
| | | |
| | | Api.getCloudConfig(param).then(result => { |
| | | this.menuLoading = false |
| | | if (result.status) { |
| | | let config = null |
| | | |
| | | try { |
| | | config = result.LongParam ? JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) : null |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = null |
| | | } |
| | | |
| | | if (config) { |
| | | let _param = { |
| | | MenuId: menu.MenuID[2], |
| | | MenuID: menu.MenuID[2], |
| | | ParentId: menu.MenuID[1], |
| | | MenuName: menu.MenuName, |
| | | MenuNo: menu.MenuNo |
| | | } |
| | | if (config.Template === 'BaseTable') { |
| | | _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | window.open(`#/tabledesign/${_param}`) |
| | | } else if (config.Template === 'CustomPage') { |
| | | _param.MenuType = 'custom' |
| | | _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | window.open(`#/menudesign/${_param}`) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | triggerMenuSave = () => { |
| | |
| | | window.GLOB.customMenu = config |
| | | |
| | | this.setState({view: '', popConfig: null}) |
| | | } |
| | | |
| | | getPrintTemp = () => { |
| | | if (!sessionStorage.getItem('printTemps')) { |
| | | let _sql = `select ID,Images,PrintTempNO+PrintTempName as PN from sPrintTemplate |
| | | where appkey= @appkey@ and Deleted=0 and typechartwo='web_print' |
| | | union select ID,Images,a.PrintTempNO+PrintTempName as PN |
| | | from (select * from sPrintTemplate where appkey= '' and Deleted=0 and typechartwo='web_print') a |
| | | left join (select PrintTempNO from sPrintTemplate where appkey= @appkey@ and Deleted=0 ) b |
| | | on a.PrintTempNO=b.PrintTempNO |
| | | left join (select Srcid from sPrintTemplate_Log where appkey='' and apicode= @appkey@ and Deleted=0 ) c |
| | | on a.ID=c.Srcid where b.PrintTempNO is null and c.Srcid is null` |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_SelectedList', |
| | | LText: Utils.formatOptions(_sql), |
| | | obj_name: 'data', |
| | | arr_field: 'PN,ID,Images' |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证 |
| | | |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | let temps = res.data.map(temp => { |
| | | return { |
| | | value: temp.ID, |
| | | text: temp.PN |
| | | } |
| | | }) |
| | | |
| | | sessionStorage.setItem('printTemps', JSON.stringify(temps)) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | getAppPictures = () => { |
| | | if (sessionStorage.getItem('app_pictures')) return |
| | | |
| | | let deffers = [] |
| | | let param = { |
| | | func: 's_url_db_adduptdel', |
| | | PageIndex: 0, // 0 代表全部 |
| | | PageSize: 0, // 0 代表全部 |
| | | type: 'search' |
| | | } |
| | | deffers = [new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getCloudConfig({...param, typecharone: 'image'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 500) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getCloudConfig({...param, typecharone: 'video'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1000) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getCloudConfig({...param, typecharone: 'color'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1500) |
| | | })] |
| | | |
| | | Promise.all(deffers).then(response => { |
| | | sessionStorage.setItem('app_pictures', JSON.stringify(response[0] || [])) |
| | | sessionStorage.setItem('app_videos', JSON.stringify(response[1] || [])) |
| | | sessionStorage.setItem('app_colors', JSON.stringify(response[2] || [])) |
| | | }) |
| | | } |
| | | |
| | | updateCustomComponent = () => { |
| | | Api.getCloudConfig({ |
| | | func: 's_get_custom_components', |
| | | typename: '', |
| | | typecharone: '' |
| | | }).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } else if (res.cus_list) { |
| | | sessionStorage.setItem('app_custom_components', JSON.stringify(res.cus_list)) |
| | | this.setCustomComponent(res.cus_list) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | setCustomComponent = (cus_list) => { |
| | | let coms = [] |
| | | |
| | | cus_list.forEach(item => { |
| | | let config = '' |
| | | |
| | | try { |
| | | config = JSON.parse(window.decodeURIComponent(window.atob(item.long_param))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = '' |
| | | } |
| | | |
| | | if (!config || !item.c_name) return |
| | | |
| | | window.GLOB.UserComponentMap.set(item.c_id, item.c_name) |
| | | coms.push({ |
| | | uuid: item.c_id, |
| | | type: 'menu', |
| | | title: item.c_name, |
| | | url: item.images, |
| | | component: config.type, |
| | | subtype: config.subtype, |
| | | config |
| | | }) |
| | | }) |
| | | this.setState({customComponents: coms}) |
| | | } |
| | | |
| | | initPopview = (card, btn) => { |
| | |
| | | |
| | | if (item.action && item.action.length > 0) { |
| | | item.action.forEach(btn => { |
| | | if (btn.hidden === 'true') return |
| | | if (btn.hidden === 'true' || btn.permission === 'false') return |
| | | buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`) |
| | | _sort++ |
| | | }) |
| | |
| | | item.subcards.forEach(card => { |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.hidden === 'true') return |
| | | if (cell.hidden === 'true' || cell.permission === 'false') return |
| | | buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`) |
| | | _sort++ |
| | | }) |
| | | card.backElements && card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.hidden === 'true') return |
| | | if (cell.hidden === 'true' || cell.permission === 'false') return |
| | | buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`) |
| | | _sort++ |
| | | }) |
| | |
| | | } else if (item.type === 'balcony') { |
| | | item.elements && item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.hidden === 'true') return |
| | | if (cell.hidden === 'true' || cell.permission === 'false') return |
| | | buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`) |
| | | _sort++ |
| | | }) |
| | |
| | | loopCol(col.subcols) |
| | | } else if (col.type === 'custom') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true') return |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return |
| | | buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`) |
| | | _sort++ |
| | | }) |
| | |
| | | checkBase = () => { |
| | | const { MenuType, config } = this.state |
| | | |
| | | if (MenuType === 'billPrint' && config.printPage === 'page' && !config.everyPCount) { |
| | | if (MenuType === 'billPrint' && ((config.printPage === 'page' && !config.everyPCount) || (config.callback === 'true' && !config.callNo))) { |
| | | return false |
| | | } else if (MenuType === 'home' && (config.cacheUseful === 'true' && !config.cacheTime)) { |
| | | return false |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (this.checklog()) { |
| | | if (sessionStorage.getItem('langList') && !config.trans) { |
| | | |
| | | } else if (window.backend && config.enabled && !config.allSqls) { |
| | | |
| | | } else { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '当前配置未修改,无需保存。', |
| | | duration: 5 |
| | | }) |
| | | MKEmitter.emit('completeSave') |
| | | return |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | delete config.force |
| | | } |
| | | |
| | | let long_data = '' |
| | | delete config.allSqls |
| | | if (window.backend && config.enabled) { |
| | | let sqls = getAllSqls(config) |
| | | let _t = moment().format('YYYYMMDDHHmmss') |
| | | let getguid = () => { |
| | | let uuid = '' |
| | | for (let i = 0; i < 18; i++) { |
| | | uuid += String.fromCharCode(Math.floor(Math.random() * 26) + 65) |
| | | } |
| | | return uuid |
| | | } |
| | | |
| | | long_data = [] |
| | | |
| | | config.allSqls = sqls.map(item => { |
| | | let v_id = _t + getguid() |
| | | long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))}`) |
| | | |
| | | return { |
| | | uuid: item.uuid, |
| | | v_id: v_id, |
| | | type: item.type, |
| | | reps: item.reps, |
| | | sql: item.LText |
| | | } |
| | | }) |
| | | |
| | | long_data = long_data.join(';') |
| | | } |
| | | |
| | | if (config.cacheUseful !== 'true') { |
| | | config.components = this.resetSyncQuery(config.components) |
| | | } |
| | | |
| | | if (config.MenuID === 'home_page_id') { |
| | | config.permission = 'false' |
| | | } |
| | | |
| | | let tbs = [] |
| | | let btns = this.getMenuMessage(config, tbs) |
| | | |
| | | if (config.permission === 'false') { |
| | | btns = [] |
| | | } |
| | | |
| | | let arr = [] |
| | | tbs = tbs.filter(tb => { |
| | | let _tb = tb.toLowerCase() |
| | |
| | | } else { |
| | | let urlparam = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param))) |
| | | urlparam.type = 'admin' |
| | | urlparam.lang = sessionStorage.getItem('lang') |
| | | |
| | | url = window.btoa(window.encodeURIComponent(JSON.stringify(urlparam))) |
| | | config.tbkey = key |
| | | } |
| | | |
| | | let interfaces = getFuncsAndInters(config) |
| | | let urlFields = config.urlFields ? config.urlFields.join(',') : '' |
| | | let langSql = getLangTrans(config) |
| | | |
| | | let param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | |
| | | 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', menuColor: config.menuColor || '', interfaces, urlFields}), |
| | | open_edition: config.open_edition, |
| | | LText: '', |
| | | LTexttb: '', |
| | | long_data: long_data, |
| | | debug_md5: key, |
| | | debug_url: url, |
| | | debug_list: window.btoa(tbs), |
| | | LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(config))) |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | if (langSql) { |
| | | param.lang_translation = window.btoa(window.encodeURIComponent(langSql)) |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | let btnParam = { // 添加菜单按钮 |
| | | func: 'sPC_Button_AddUpt', |
| | |
| | | ParentID: config.uuid, |
| | | MenuNo: config.MenuNo, |
| | | Template: 'CustomPage', |
| | | button_proc_edition: 'Y' |
| | | button_proc_edition: 'Y', |
| | | exec_type: 'x' |
| | | } |
| | | |
| | | btnParam.LText = btns.join(' union all ') |
| | | |
| | | btnParam.LText = Utils.formatOptions(btnParam.LText) |
| | | btnParam.LText = Utils.formatOptions(btnParam.LText, 'x') |
| | | btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp) |
| | | btnParam.secretkey = Utils.encrypt('', btnParam.timestamp) |
| | | |
| | | new Promise(resolve => { |
| | | if (MenuType === 'billPrint') { // 打印生成页面效果图 |
| | |
| | | Base64Img: canvas.toDataURL('image/png') // 获取生成的图片 |
| | | } |
| | | |
| | | if (options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | if (window.GLOB.cloudServiceApi) { |
| | | param.rduri = window.GLOB.cloudServiceApi |
| | | param.userid = sessionStorage.getItem('CloudUserID') || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | } |
| | | |
| | | Api.fileuploadbase64(param).then(result => { |
| | | if (result.status) { |
| | | let url = result.Images |
| | | let baseurl = '' |
| | | |
| | | if (window.GLOB.cloudServiceApi) { |
| | | baseurl = window.GLOB.cloudServiceApi.replace(/webapi(.*)$/, '') |
| | | } else { |
| | | baseurl = window.GLOB.baseurl |
| | | } |
| | | |
| | | url = url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url |
| | | |
| | | Api.getCloudConfig({ |
| | | func: 's_PrintTemplateMSub', |
| | | ID: config.uuid, |
| | | Images: Utils.getcloudurl(result.Images), |
| | | Images: url, |
| | | Remark: '', |
| | | temp_type: 'billprint', |
| | | }).then(response => { |
| | |
| | | message: '保存成功', |
| | | duration: 2 |
| | | }) |
| | | MKEmitter.emit('completeSave') |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | Modal.warning({ |
| | | width: 400, |
| | | title: res.message, |
| | | okText: '知道了' |
| | | }) |
| | | } |
| | | MKEmitter.emit('completeSave') |
| | | }, this.netError) |
| | | }, 300 + (+sessionStorage.getItem('mkDelay'))) |
| | | } |
| | |
| | | duration: 5 |
| | | }) |
| | | } |
| | | MKEmitter.emit('completeSave') |
| | | } |
| | | |
| | | getRoleFields = () => { |
| | |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | | changeSetting = () => { |
| | |
| | | }, 400) |
| | | } |
| | | |
| | | checklog = () => { |
| | | const { oriConfig, config } = this.state |
| | | |
| | | return is(fromJS(oriConfig), fromJS(config)) |
| | | } |
| | | |
| | | updateLogConfig = (config) => { |
| | | config.fstMenuId = this.state.config.fstMenuId || config.fstMenuId || '' |
| | | config.parentId = this.state.config.parentId || config.parentId || '' |
| | | config.open_edition = this.state.config.open_edition || '' |
| | | |
| | | this.setState({ |
| | | config: null |
| | | }, () => { |
| | | this.setState({ |
| | | config: config |
| | | }) |
| | | }) |
| | | |
| | | window.GLOB.customMenu = config |
| | | } |
| | | |
| | | render () { |
| | | const { view, comloading, MenuType, MenuId, config, settingshow, ParentId, menuloading, customComponents, eyeopen, needUpdate } = this.state |
| | | const { view, comloading, MenuType, MenuId, config, settingshow, ParentId, menuloading, eyeopen, needUpdate, langName } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={_locale}> |
| | | <Header /> |
| | | <> |
| | | <Header menuName={config ? config.MenuName + langName : ''}/> |
| | | <DndProvider backend={HTML5Backend}> |
| | | {view !== 'popview' ? <div className={'pc-menu-view ' + (MenuType || '')}> |
| | | <div className="menu-body"> |
| | |
| | | <Collapse accordion defaultActiveKey="basedata" bordered={false}> |
| | | {/* 基本信息 */} |
| | | <Panel header="基本信息" key="basedata"> |
| | | {/* 菜单信息 */} |
| | | {config && MenuType === 'custom' ? <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | parentId={ParentId} |
| | | MenuName={config.MenuName} |
| | | MenuNo={config.MenuNo} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config && MenuType === 'home' ? <HomeForm |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config && MenuType === 'billPrint' ? <PrintMenuForm |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config ? <UrlFieldComponent |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {/* 表名添加 */} |
| | | {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null} |
| | | {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null} |
| | | {config ? <NormalCss config={config} updateConfig={this.updateConfig}/> : null} |
| | | {config ? <> |
| | | {MenuType === 'custom' ? <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | parentId={ParentId} |
| | | MenuName={config.MenuName} |
| | | MenuNo={config.MenuNo} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {MenuType === 'home' ? <HomeForm |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {MenuType === 'billPrint' ? <PrintMenuForm |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | <UrlFieldComponent |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header="组件" key="component"> |
| | |
| | | <Panel header="元素" key="element"> |
| | | <Modulecell /> |
| | | </Panel> |
| | | {customComponents && customComponents.length ? <Panel header="自定义组件" key="cuscomponent"> |
| | | <SourceWrap components={customComponents} MenuType={MenuType} /> |
| | | </Panel> : null} |
| | | <Panel header="页面样式" key="background"> |
| | | {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} |
| | | </Panel> |
| | | </Collapse> |
| | | </div> |
| | | <div className={'menu-view' + (menuloading ? ' saving' : '') + (eyeopen ? ' eye-open' : '')}> |
| | | <Card title={config ? config.MenuName : ''} bordered={false} extra={ |
| | | <Card bordered={false} extra={ |
| | | <div className="mk-opeartion-list"> |
| | | {config ? <Debug config={config}/> : null} |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <Versions MenuId={MenuId} open_edition={config ? config.open_edition : ''}/> |
| | | {config ? <Versions MenuId={MenuId} Template="CustomPage" checklog={this.checklog} updateConfig={this.updateLogConfig}/> : null} |
| | | <TableNodes config={config} /> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | |
| | | <PasteController insert={this.insert} /> |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <Button type="primary" id="save-config" className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | <Button type="default" disabled={menuloading} onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | {config && !comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : <Spin className="loading-config" size="large" />} |
| | |
| | | <ModalController /> |
| | | <StyleController /> |
| | | <StyleCombController /> |
| | | </ConfigProvider> |
| | | </> |
| | | ) |
| | | } |
| | | } |