From 9cacf4bf8339ebdfbf2fec7604b501a8dc32f9a4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 18 一月 2023 23:06:42 +0800 Subject: [PATCH] 2023-01-18 --- src/menu/components/card/balcony/index.jsx | 14 ++++ src/menu/tablenodes/index.jsx | 25 ++++++++ src/tabviews/zshare/tablenodes/index.jsx | 44 ++++++++++++++ src/tabviews/custom/components/card/balcony/index.jsx | 14 +++- src/views/appmanage/index.jsx | 7 +- src/views/appmanage/submutilform/index.jsx | 12 ++++ src/views/systemfunc/sidemenu/config.jsx | 4 src/views/design/sidemenu/thdmenuplus/index.jsx | 1 src/menu/components/card/balcony/options.jsx | 10 +++ src/views/systemfunc/sidemenu/index.jsx | 10 +++ 10 files changed, 127 insertions(+), 14 deletions(-) diff --git a/src/menu/components/card/balcony/index.jsx b/src/menu/components/card/balcony/index.jsx index 4c89067..d8dca20 100644 --- a/src/menu/components/card/balcony/index.jsx +++ b/src/menu/components/card/balcony/index.jsx @@ -245,9 +245,19 @@ } getWrapForms = () => { - const { wrap } = this.state.card + const { card } = this.state - return getWrapForm(wrap) + let buttons = [] + card.elements && card.elements.forEach(item => { + if (item.eleType === 'button') { + buttons.push({ + value: item.uuid, + label: item.label + }) + } + }) + + return getWrapForm(card.wrap, buttons) } updateWrap = (res) => { diff --git a/src/menu/components/card/balcony/options.jsx b/src/menu/components/card/balcony/options.jsx index 86b84f5..da00fcc 100644 --- a/src/menu/components/card/balcony/options.jsx +++ b/src/menu/components/card/balcony/options.jsx @@ -4,7 +4,7 @@ /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (wrap) { +export default function (wrap, buttons) { let menu = window.GLOB.customMenu let modules = MenuUtils.getLinkModules(menu.components) || [] @@ -260,6 +260,14 @@ forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' }, { + type: 'select', + field: 'linkbtn', + label: '鍏宠仈鎸夐挳', + initval: wrap.linkbtn || '', + required: false, + options: buttons + }, + { type: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', diff --git a/src/menu/tablenodes/index.jsx b/src/menu/tablenodes/index.jsx index 36281b2..e903da7 100644 --- a/src/menu/tablenodes/index.jsx +++ b/src/menu/tablenodes/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Modal, Button, notification, Spin, Input } from 'antd' +import { Modal, Button, notification, Spin, Input, message } from 'antd' import { ForkOutlined } from '@ant-design/icons' import Api from '@/api' @@ -158,6 +158,7 @@ id: 'par' + i, direction: 'left', color: '#5AD8A6', + node: 'table', children: [] } @@ -232,7 +233,12 @@ if (menu.direction !== 'right') return if (menu.depth === 1) { + sessionStorage.setItem('mk-table-node', menu.label) window.open('#/hs') + + setTimeout(() => { + sessionStorage.removeItem('mk-table-node') + }, 50) } else if (menu.param) { if (menu.param.type === 'admin') { if (menu.param.MenuType === 'custom') { @@ -354,6 +360,23 @@ } }) + if (model.direction === 'left') { + if (model.node === 'table') { + model.fontcolor = '#1890ff' + this.graph.updateItem(item, model, false) + + let oInput = document.createElement('input') + oInput.value = model.label + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + + message.success('琛ㄥ悕澶嶅埗鎴愬姛銆�') + } + return + } + model.fontcolor = '#1890ff' this.graph.updateItem(item, model, false) diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx index bf037dd..5336d0f 100644 --- a/src/tabviews/custom/components/card/balcony/index.jsx +++ b/src/tabviews/custom/components/card/balcony/index.jsx @@ -395,20 +395,28 @@ MKEmitter.emit('mkCheckAll', syncConfig.uuid, e.target.checked) } + triggerButton = () => { + const { config, data } = this.state + + if (config.wrap.linkbtn) { + MKEmitter.emit('triggerBtnId', config.wrap.linkbtn, data.$$empty ? [] : [data]) + } + } + render() { const { config, loading, data, show, syncConfig, syncData, checked } = this.state if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null return ( - <div className={'custom-balcony-box' + (!show ? ' hidden' : '')} style={config.style}> + <div className={'custom-balcony-box' + (!show ? ' hidden' : '')} style={config.style} onClick={this.triggerButton}> {loading ? - <div className="loading-mask"> + <div className="loading-mask" onClick={(e) => e.stopPropagation()}> <div className="ant-spin-blur"></div> <Spin /> </div> : null } - {config.wrap.checkAll === 'show' ? <div className="check-all"><Checkbox checked={checked} onChange={this.checkAll}>鍏ㄩ��</Checkbox></div> : null} + {config.wrap.checkAll === 'show' ? <div className="check-all" onClick={(e) => e.stopPropagation()}><Checkbox checked={checked} onChange={this.checkAll}>鍏ㄩ��</Checkbox></div> : null} <CardCellComponent data={data} syncData={syncData || []} cards={syncConfig || config} cardCell={config} elements={config.elements}/> </div> ) diff --git a/src/tabviews/zshare/tablenodes/index.jsx b/src/tabviews/zshare/tablenodes/index.jsx index df97bc4..f46b98d 100644 --- a/src/tabviews/zshare/tablenodes/index.jsx +++ b/src/tabviews/zshare/tablenodes/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Modal, Button, notification, Spin, Input, Typography } from 'antd' +import { Modal, Button, notification, Spin, Input, Typography, message } from 'antd' import Api from '@/api' import G6 from "@antv/g6" @@ -166,6 +166,7 @@ id: 'par' + i, direction: 'left', color: '#5AD8A6', + node: 'table', children: [] } @@ -345,6 +346,44 @@ ev.preventDefault(); }, }); + + G6.registerBehavior('dice-mindmap', { + getEvents() { + return { + 'node:dblclick': 'editNode', + }; + }, + editNode(evt) { + const item = evt.item; + const model = item.get('model'); + + // 閫変腑鑺傜偣 + this.graph.getNodes().forEach(node => { + let _model = node.get('model') + if (_model.fontcolor === '#1890ff') { + _model.fontcolor = '' + this.graph.updateItem(node, _model, false) + } + }) + + if (model.direction === 'left') { + if (model.node === 'table') { + model.fontcolor = '#1890ff' + this.graph.updateItem(item, model, false) + + let oInput = document.createElement('input') + oInput.value = model.label + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + + message.success('琛ㄥ悕澶嶅埗鎴愬姛銆�') + } + return + } + } + }); const dataTransform = (data) => { const changeData = (d, level = 0, color) => { @@ -420,7 +459,8 @@ }, }, 'drag-canvas', - 'zoom-canvas' + 'zoom-canvas', + 'dice-mindmap' ], }, }); diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index 3b7bf87..a54a3b7 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -469,6 +469,7 @@ cell.sysBgColor = _param.sysBgColor || '#ffffff' cell.direction = _param.direction || 'vertical' cell.adapter = _param.adapter || '' + cell.topHeight = _param.topHeight || '' cell.share = _param.share || 'false' // 鍒嗕韩 cell.share_des = _param.share_des || '' // 鍒嗕韩鎻忚堪 cell.share_url = _param.share_url || '' // 鍒嗕韩鍥剧墖 @@ -652,7 +653,7 @@ }) // 瀛愬簲鐢↖D銆乼ypename銆佸簲鐢↖D銆丆loudUserID銆乤ppkey銆乴ogin_types(鏄惁闇�瑕佺櫥褰曪紝宸插純鐢�)銆乴ink_type(鏄惁浣跨敤鐭繛鎺ワ紝宸插純鐢�)銆乺ole_type(鏄惁浣跨敤瑙掕壊绠$悊)銆乴ang銆乧ss(鐨偆)銆乼itle(鏍囬)銆乫avicon(鍥炬爣)銆乽ser_binding(鐢ㄦ埛缁戝畾)銆乻ms_id(鐭俊妯℃澘ID)銆佽嚜瀹氫箟 - param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) + param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', topHeight: item.topHeight || '', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) @@ -898,7 +899,7 @@ return item }) - param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) + param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', topHeight: item.topHeight || '', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) } @@ -991,7 +992,7 @@ return item }) - param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) + param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', topHeight: item.topHeight || '', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) diff --git a/src/views/appmanage/submutilform/index.jsx b/src/views/appmanage/submutilform/index.jsx index c9b5b5b..20d6daf 100644 --- a/src/views/appmanage/submutilform/index.jsx +++ b/src/views/appmanage/submutilform/index.jsx @@ -309,6 +309,18 @@ )} </Form.Item> </Col> : null} + {typename === 'pad' && adapters.includes('app') ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鍦ㄦ槑绉戜簯APP涓紝鐘舵�佹爮鐨勬渶澶ч珮搴︼紝绌哄�兼椂浣跨敤APP鑾峰彇鍒扮殑鐘舵�佹爮楂樺害銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鐘舵�佹爮楂樺害 + </Tooltip> + }> + {getFieldDecorator('topHeight', { + initialValue: card ? card.topHeight || '' : '' + })(<InputNumber min={0} max={5000} precision={0} onPressEnter={this.handleSubmit}/>)} + </Form.Item> + </Col> : null} <Col span={12}> <Form.Item className="sys-bgcolor" label={ <Tooltip placement="topLeft" title="瀛愬簲鐢ㄩ�氱敤鐨勮儗鏅壊锛屽瓙搴旂敤椤甸潰鍒涘缓鏃朵細榛樿娣诲姞姝よ儗鏅壊銆�"> diff --git a/src/views/design/sidemenu/thdmenuplus/index.jsx b/src/views/design/sidemenu/thdmenuplus/index.jsx index cbacb44..c10da0d 100644 --- a/src/views/design/sidemenu/thdmenuplus/index.jsx +++ b/src/views/design/sidemenu/thdmenuplus/index.jsx @@ -123,6 +123,7 @@ let sysMenu = { MenuID: Utils.getuuid(), MenuName: template.title, + MenuNo: template.MenuNo ? template.MenuNo + '_01' : '', Template: template.type, fstMenuId: mainMenu.MenuID, ParentId: supMenu.MenuID, diff --git a/src/views/systemfunc/sidemenu/config.jsx b/src/views/systemfunc/sidemenu/config.jsx index c49b74a..8dbb1f7 100644 --- a/src/views/systemfunc/sidemenu/config.jsx +++ b/src/views/systemfunc/sidemenu/config.jsx @@ -5,8 +5,8 @@ PageParam: {Icon: 'folder'}, children: [{ src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'CustomPage'}, + type: 'CustomPage', MenuID: '1581067625930haged11ieaivpavv77k', MenuNo: 'sDatasM', MenuName: '鏁版嵁瀛楀吀', diff --git a/src/views/systemfunc/sidemenu/index.jsx b/src/views/systemfunc/sidemenu/index.jsx index b1ea702..21bd103 100644 --- a/src/views/systemfunc/sidemenu/index.jsx +++ b/src/views/systemfunc/sidemenu/index.jsx @@ -1,5 +1,6 @@ import React, {Component} from 'react' import { Menu } from 'antd' +import { fromJS } from 'immutable' import { FolderOutlined } from '@ant-design/icons' import { SySMenuList } from './config' @@ -39,10 +40,19 @@ menulist = menulist.filter(menu => menu.children.length > 0) } + let tb = sessionStorage.getItem('mk-table-node') + this.setState({ subMenulist: menulist, rootSubmenuKeys: menulist.map(item => item.MenuID), openKeys: [menulist[0].MenuID] + }, () => { + if (tb && menulist[0] && menulist[0].children[0] && menulist[0].children[0].MenuNo === 'sDatasM') { + setTimeout(() => { + MKEmitter.emit('modifyTabs', fromJS(menulist[0].children[0]).toJS()) + }, 500) + } + sessionStorage.removeItem('mk-table-node') }) } -- Gitblit v1.8.0