src/menu/components/card/cardcellcomponent/index.jsx
@@ -11,6 +11,7 @@ import { getActionForm } from '@/menu/components/share/actioncomponent/formconfig' import MKEmitter from '@/utils/events.js' import MenuUtils from '@/menu/utils/menuUtils.js' import ElementForm from './elementform' import DragElement from './dragaction' import './index.scss' @@ -276,64 +277,13 @@ menulist = [] } let modules = this.getModules(menu.components, cards.uuid) let modules = MenuUtils.getSubModules(menu.components, cards.uuid) this.setState({ actvisible: true, card: card, formlist: getActionForm(card, functip, cards.setting, usefulFields, 'card', menulist, modules) }) } getModules = (components, selfId) => { let modules = components.map(item => { if (item.uuid === selfId) { return { children: null } } else if (item.format) { return { value: item.uuid, label: item.name } } else if (item.type === 'tabs') { let _item = { value: item.uuid, label: item.name, children: item.subtabs.map(f_tab => { let subItem = { value: f_tab.uuid, label: f_tab.label, children: this.getModules(f_tab.components, selfId) } if (!subItem.children || subItem.children.length === 0) { return {children: null} } return subItem }) } _item.children = _item.children.filter(t => t.children !== null) if (_item.children.length === 0) { return {children: null} } return _item } else { return { children: null } } }) modules = modules.filter(mod => mod.children !== null) if (modules.length === 0) { return null } return modules } /** src/menu/components/group/normal-group/index.jsx
@@ -123,7 +123,7 @@ this.props.updateConfig(component) } insert = (item, cell) => { insert = (item) => { let group = fromJS(this.state.group).toJS() group.components.push(item) src/menu/components/share/actioncomponent/index.jsx
@@ -9,18 +9,20 @@ import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' import { getActionForm } from './formconfig' import asyncSpinComponent from '@/utils/asyncSpinComponent' import MKEmitter from '@/utils/events.js' import ActionForm from './actionform' import VerifyCard from '@/templates/zshare/verifycard' import MenuUtils from '@/menu/utils/menuUtils.js' import CreateFunc from '@/templates/zshare/createfunc' import VerifyPrint from '@/templates/sharecomponent/actioncomponent/verifyprint' import VerifyExcelIn from '@/templates/sharecomponent/actioncomponent/verifyexcelin' import VerifyExcelOut from '@/templates/sharecomponent/actioncomponent/verifyexcelout' import DragElement from './dragaction' import './index.scss' const { confirm } = Modal const VerifyCard = asyncSpinComponent(() => import('@/templates/zshare/verifycard')) const VerifyPrint = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyprint')) const VerifyExcelIn = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelin')) const VerifyExcelOut = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelout')) class ActionComponent extends Component { static propTpyes = { @@ -137,57 +139,6 @@ } } getModules = (components, selfId) => { let modules = components.map(item => { if (item.uuid === selfId) { return { children: null } } else if (item.format) { return { value: item.uuid, label: item.name } } else if (item.type === 'tabs') { let _item = { value: item.uuid, label: item.name, children: item.subtabs.map(f_tab => { let subItem = { value: f_tab.uuid, label: f_tab.label, children: this.getModules(f_tab.components, selfId) } if (!subItem.children || subItem.children.length === 0) { return {children: null} } return subItem }) } _item.children = _item.children.filter(t => t.children !== null) if (_item.children.length === 0) { return {children: null} } return _item } else { return { children: null } } }) modules = modules.filter(mod => mod.children !== null) if (modules.length === 0) { return null } return modules } /** * @description 按钮编辑,获取按钮表单信息 */ @@ -222,7 +173,7 @@ menulist = [] } let modules = this.getModules(menu.components, config.uuid) let modules = MenuUtils.getSubModules(menu.components, config.uuid) this.setState({ visible: true, src/menu/components/share/actioncomponent/index.scss
@@ -39,6 +39,7 @@ padding-bottom: 5px; .ant-modal-body { max-height: calc(100vh - 190px); min-height: calc(100vh - 300px); overflow-y: auto; .ant-empty { margin: 15vh 8px; src/menu/components/tabs/tabcomponents/card.jsx
@@ -12,6 +12,7 @@ const PropCard = asyncComponent(() => import('@/menu/components/card/prop-card')) const TableCard = asyncComponent(() => import('@/menu/components/card/table-card')) const NormalTable = asyncComponent(() => import('@/menu/components/table/normal-table')) const NormalGroup = asyncComponent(() => import('@/menu/components/group/normal-group')) const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => { const originalIndex = findCard(id).index @@ -63,6 +64,8 @@ return (<TableCard card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'table' && card.subtype === 'normaltable') { return (<NormalTable card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'group' && card.subtype === 'normalgroup') { return (<NormalGroup group={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } } src/menu/components/tabs/tabcomponents/index.jsx
@@ -6,6 +6,7 @@ import Utils from '@/utils/utils.js' import MKEmitter from '@/utils/events.js' import MenuUtils from '@/menu/utils/menuUtils.js' import Card from './card' import './index.scss' @@ -47,55 +48,7 @@ }) } let uuids = [] const getUuids = (item) => { if (item.type === 'tabs') { item.subtabs.forEach(tab => { tab.components.forEach(c => { getUuids(c) }) }) } else { if (item.action && item.action.length) { item.action.forEach(act => { if (!act.origin) { uuids.push(act.uuid) } }) } if (item.type === 'card') { item.subcards.forEach(_card => { _card.elements && _card.elements.forEach(cell => { if (cell.eleType === 'button') { uuids.push(cell.uuid) } }) _card.backElements && _card.backElements.forEach(cell => { if (cell.eleType === 'button') { uuids.push(cell.uuid) } }) }) } else if (item.type === 'table' && item.subtype === 'tablecard') { item.subcards.forEach(_card => { _card.elements && _card.elements.forEach(cell => { if (cell.eleType === 'button') { uuids.push(cell.uuid) } }) }) } else if (item.type === 'table' && item.subtype === 'normaltable') { item.cols && item.cols.forEach(col => { if (col.type !== 'action') return col.elements && col.elements.forEach(cell => { uuids.push(cell.uuid) }) }) } } } getUuids(card) let uuids = MenuUtils.getDelButtonIds(card) confirm({ title: `确定删除《${card.name}》吗?`, src/menu/datasource/verifycard/index.jsx
@@ -157,13 +157,25 @@ let getcomponentmarks = (box, conf) => { if (!conf.parentId && box.Template === 'CustomPage') { box.components.forEach(item => { if (item.uuid !== conf.uuid && item.setting && item.setting.varMark) { if (item.type === 'group') { item.components.forEach(cell => { if (cell.uuid !== conf.uuid && cell.setting && cell.setting.varMark) { Marks.push(cell.setting.varMark.toLowerCase()) } }) } else if (item.uuid !== conf.uuid && item.setting && item.setting.varMark) { Marks.push(item.setting.varMark.toLowerCase()) } }) } else if (conf.parentId === box.parentId && conf.tabId === box.uuid) { box.components.forEach(item => { if (item.uuid !== conf.uuid && item.setting && item.setting.varMark) { if (item.type === 'group') { item.components.forEach(cell => { if (cell.uuid !== conf.uuid && cell.setting && cell.setting.varMark) { Marks.push(cell.setting.varMark.toLowerCase()) } }) } else if (item.uuid !== conf.uuid && item.setting && item.setting.varMark) { Marks.push(item.setting.varMark.toLowerCase()) } }) src/menu/datasource/verifycard/settingform/index.jsx
@@ -4,6 +4,7 @@ import { formRule } from '@/utils/option.js' import Utils from '@/utils/utils.js' import MenuUtils from '@/menu/utils/menuUtils.js' import CodeMirror from '@/templates/zshare/codemirror' import './index.scss' @@ -30,7 +31,7 @@ UNSAFE_componentWillMount () { const { menu, config } = this.props let modules = this.getModules(menu.components, config.uuid) let modules = MenuUtils.getSupModules(menu.components, config.uuid) if (!modules) { modules = [] } @@ -52,85 +53,6 @@ } this.setState({modules, usefulFields}) } getModules = (components, selfId) => { let modules = components.map(item => { if (item.uuid === selfId) { return { children: null } } else if (item.switchable) { return { value: item.uuid, label: item.name } } else if (item.type === 'tabs') { let _item = { value: item.uuid, label: item.name, children: item.subtabs.map(f_tab => { let subItem = { value: f_tab.uuid, label: f_tab.label, children: this.getModules(f_tab.components, selfId) } if (!subItem.children || subItem.children.length === 0) { return {children: null} } return subItem }) } _item.children = _item.children.filter(t => t.children !== null) if (_item.children.length === 0) { return {children: null} } return _item } else if (item.type === 'group') { let _item = { value: item.uuid, label: item.name, children: item.components.map(f_tab => { if (f_tab.uuid === selfId) { return { children: null } } else if (f_tab.switchable) { return { value: f_tab.uuid, label: f_tab.name } } return { children: null } }) } _item.children = _item.children.filter(t => t.children !== null) if (_item.children.length === 0) { return {children: null} } return _item } else { return { children: null } } }) modules = modules.filter(mod => mod.children !== null) if (modules.length === 0) { return null } return modules } handleConfirm = () => { src/menu/menushell/index.jsx
@@ -6,6 +6,7 @@ import Utils from '@/utils/utils.js' import MKEmitter from '@/utils/events.js' import MenuUtils from '@/menu/utils/menuUtils.js' import Card from './card' import './index.scss' @@ -47,55 +48,7 @@ }) } let uuids = [] const getUuids = (item) => { if (item.type === 'tabs') { item.subtabs.forEach(tab => { tab.components.forEach(c => { getUuids(c) }) }) } else { if (item.action && item.action.length) { item.action.forEach(act => { if (!act.origin) { uuids.push(act.uuid) } }) } if (item.type === 'card') { item.subcards.forEach(_card => { _card.elements && _card.elements.forEach(cell => { if (cell.eleType === 'button') { uuids.push(cell.uuid) } }) _card.backElements && _card.backElements.forEach(cell => { if (cell.eleType === 'button') { uuids.push(cell.uuid) } }) }) } else if (item.type === 'table' && item.subtype === 'tablecard') { item.subcards.forEach(_card => { _card.elements && _card.elements.forEach(cell => { if (cell.eleType === 'button') { uuids.push(cell.uuid) } }) }) } else if (item.type === 'table' && item.subtype === 'normaltable') { item.cols && item.cols.forEach(col => { if (col.type !== 'action') return col.elements && col.elements.forEach(cell => { uuids.push(cell.uuid) }) }) } } } getUuids(card) let uuids = MenuUtils.getDelButtonIds(card) confirm({ title: `确定删除《${card.name}》吗?`, src/menu/popview/index.jsx
@@ -175,6 +175,8 @@ item.subtabs.forEach(tab => { traversal(tab.components) }) } else if (item.type === 'group') { traversal(item.components) } else if (item.type === 'card' || (item.type === 'table' && item.subtype === 'tablecard')) { item.action && item.action.forEach(btn => { buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`) @@ -227,6 +229,8 @@ item.subtabs.forEach(tab => { tab.components = this.filterConfig(tab.components) }) } else if (item.type === 'group') { item.components = this.filterConfig(item.components) } else if (item.type === 'table' && item.subtype === 'normaltable') { item.search = item.search.filter(a => !a.origin) item.action = item.action.filter(a => !a.origin) src/menu/utils/menuUtils.js
New file @@ -0,0 +1,229 @@ export default class MenuUtils { /** * @description 获取下级模块 * @return {String} selfId 当前组件id */ static getSubModules (components, selfId) { let modules = components.map(item => { if (item.uuid === selfId) { return { children: null } } else if (item.format) { // 数据格式,存在数据源 return { value: item.uuid, label: item.name } } else if (item.type === 'tabs') { let _item = { value: item.uuid, label: item.name, children: item.subtabs.map(f_tab => { let subItem = { value: f_tab.uuid, label: f_tab.label, children: this.getSubModules(f_tab.components, selfId) } if (!subItem.children || subItem.children.length === 0) { return {children: null} } return subItem }) } _item.children = _item.children.filter(t => t.children !== null) if (_item.children.length === 0) { return {children: null} } return _item } else if (item.type === 'group') { let _item = { value: item.uuid, label: item.name, children: item.components.map(f_tab => { if (f_tab.uuid === selfId) { return { children: null } } else if (f_tab.format) { return { value: f_tab.uuid, label: f_tab.name } } return { children: null } }) } _item.children = _item.children.filter(t => t.children !== null) if (_item.children.length === 0) { return {children: null} } return _item } else { return { children: null } } }) modules = modules.filter(mod => mod.children !== null) if (modules.length === 0) { return null } return modules } /** * @description 获取上级模块 * @return {String} selfId 当前组件id */ static getSupModules (components, selfId) { let modules = components.map(item => { if (item.uuid === selfId) { return { children: null } } else if (item.switchable) { // 数据可切换 return { value: item.uuid, label: item.name } } else if (item.type === 'tabs') { let _item = { value: item.uuid, label: item.name, children: item.subtabs.map(f_tab => { let subItem = { value: f_tab.uuid, label: f_tab.label, children: this.getSupModules(f_tab.components, selfId) } if (!subItem.children || subItem.children.length === 0) { return {children: null} } return subItem }) } _item.children = _item.children.filter(t => t.children !== null) if (_item.children.length === 0) { return {children: null} } return _item } else if (item.type === 'group') { let _item = { value: item.uuid, label: item.name, children: item.components.map(f_tab => { if (f_tab.uuid === selfId) { return { children: null } } else if (f_tab.switchable) { return { value: f_tab.uuid, label: f_tab.name } } return { children: null } }) } _item.children = _item.children.filter(t => t.children !== null) if (_item.children.length === 0) { return {children: null} } return _item } else { return { children: null } } }) modules = modules.filter(mod => mod.children !== null) if (modules.length === 0) { return null } return modules } /** * @description 获取删除按钮Id * @return {String} name */ static getDelButtonIds (card) { let uuids = [] const getUuids = (item) => { if (item.type === 'tabs') { item.subtabs.forEach(tab => { tab.components.forEach(c => { getUuids(c) }) }) } else if (item.type === 'group') { item.components.forEach(c => { getUuids(c) }) } else { if (item.action && item.action.length) { item.action.forEach(act => { if (!act.origin) { uuids.push(act.uuid) } }) } if (item.type === 'card') { item.subcards.forEach(_card => { _card.elements && _card.elements.forEach(cell => { if (cell.eleType === 'button') { uuids.push(cell.uuid) } }) _card.backElements && _card.backElements.forEach(cell => { if (cell.eleType === 'button') { uuids.push(cell.uuid) } }) }) } else if (item.type === 'table' && item.subtype === 'tablecard') { item.subcards.forEach(_card => { _card.elements && _card.elements.forEach(cell => { if (cell.eleType === 'button') { uuids.push(cell.uuid) } }) }) } else if (item.type === 'table' && item.subtype === 'normaltable') { item.cols && item.cols.forEach(col => { if (col.type !== 'action') return col.elements && col.elements.forEach(cell => { uuids.push(cell.uuid) }) }) } } } getUuids(card) return uuids } } src/tabviews/custom/components/group/normal-group/index.jsx
New file @@ -0,0 +1,296 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { is, fromJS } from 'immutable' import { Col, Empty, notification } from 'antd' import moment from 'moment' import md5 from 'md5' import Api from '@/api' import options from '@/store/options.js' import asyncComponent from '@/utils/asyncComponent' import Utils from '@/utils/utils.js' import './index.scss' // 通用组件 const AntvBarAndLine = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-bar-line')) const AntvPie = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-pie')) const DataCard = asyncComponent(() => import('@/tabviews/custom/components/card/data-card')) const TableCard = asyncComponent(() => import('@/tabviews/custom/components/card/table-card')) const PropCard = asyncComponent(() => import('@/tabviews/custom/components/card/prop-card')) class TabTransfer extends Component { static propTpyes = { BID: PropTypes.any, // 父级Id bids: PropTypes.any, // 父级Id集 config: PropTypes.object, // 组件配置信息 mainSearch: PropTypes.any, // 全局搜索条件 menuType: PropTypes.any, // 菜单类型 } state = { mainSearch: [], data: null } UNSAFE_componentWillMount () { const { config, mainSearch } = this.props // 获取主搜索条件 let _mainSearch = mainSearch ? fromJS(mainSearch).toJS() : [] let params = [] config.components.forEach(item => { if (item.type === 'tabs') return if (!item.setting || item.setting.interType !== 'system') return if (!item.format || (item.subtype === 'propcard' && item.wrap.datatype === 'static')) return if (item.dataName && (!item.pageable || (item.pageable && !item.setting.laypage)) && item.setting.onload === 'true' && item.setting.sync === 'true') { let param = this.getDefaultParam(item, _mainSearch) params.push(param) } else { item.setting.sync = 'false' } }) this.setState({mainSearch: _mainSearch}) if (params.length > 0) { this.loadmaindata(params) } } UNSAFE_componentWillReceiveProps(nextProps) { if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { this.setState({mainSearch: fromJS(nextProps.mainSearch).toJS()}) } } /** * @description 获取系统存储过程 sPC_Get_TableData 的参数 */ getDefaultParam = (component, mainSearch) => { const { columns, search, setting, dataName, format } = component let searchlist = [] if (search && search.length > 0) { searchlist = Utils.initMainSearch(search) } if (setting.useMSearch === 'true') { let keys = searchlist.map(item => item.key) mainSearch.forEach(item => { if (!keys.includes(item.key)) { searchlist.push(item) } }) } let arr_field = columns.map(col => col.field) let _dataresource = setting.dataresource let _customScript = setting.customScript if (setting.queryType === 'statistics' || _customScript) { let allSearch = Utils.getAllSearchOptions(searchlist) let regoptions = allSearch.map(item => { return { reg: new RegExp('@' + item.key + '@', 'ig'), value: `'${item.value}'` } }) regoptions.forEach(item => { if (_dataresource && setting.queryType === 'statistics') { _dataresource = _dataresource.replace(item.reg, item.value) } if (_customScript) { _customScript = _customScript.replace(item.reg, item.value) } }) } let _search = '' if (setting.queryType !== 'statistics' && _dataresource) { _search = Utils.joinMainSearchkey(searchlist) _search = _search ? 'where ' + _search : '' } if (setting.order && _dataresource) { _dataresource = `select top 1000 ${arr_field.join(',')} from (select ${arr_field.join(',')} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows ` } else if (_dataresource) { _dataresource = `select top 1000 ${arr_field.join(',')} from ${_dataresource} ${_search} ` } // 测试系统打印查询语句 if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) { _customScript && console.info(`${_dataresource ? '' : '/*不执行默认sql*/\n'}${_customScript}`) _dataresource && console.info(_dataresource) } return { name: dataName, columns: columns, par_tablename: '', type: format === 'array' ? format : '', primaryKey: setting.primaryKey || '', foreign_key: '', sql: _dataresource, script: _customScript } } /** * @description 主表数据加载 */ loadmaindata = (params) => { const { config } = this.props let LText_field = [] let diffUser = false let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } let _LText = params.map((item, index) => { let _script = item.script if (index === 0) { _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}' ${_script} ` } if (!diffUser && (/@userid@/ig.test(item.sql) || /@userid@/ig.test(_script))) { diffUser = true } item.columns.forEach(cell => { LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`) }) return `Select '${item.name}' as tablename,'${window.btoa(window.encodeURIComponent(item.sql))}' as LText,'${window.btoa(window.encodeURIComponent(_script))}' as Lcustomize,'${item.type}' as table_type,'${item.primaryKey}' as primary_key,'${item.par_tablename}' as par_tablename,'${item.foreign_key}' as foreign_key,'${index}' as Sort` }) let param = { func: 'sPC_Get_structured_data', LText: _LText.join(' union all '), LText_field: LText_field.join(' union all ') } let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) param.LText1 = LText1 param.LText = LText param.LText2 = LText2 param.LText_field = Utils.formatOptions(param.LText_field) if (config.cacheUseful === 'true') { param.time_type = config.timeUnit param.time_limit = config.cacheTime if (diffUser) { param.userid = sessionStorage.getItem('UserID') } param.data_md5 = md5(JSON.stringify(param)) } param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt(param.LText, param.timestamp) Api.getLocalConfig(param).then(result => { if (result.status) { delete result.status delete result.message delete result.ErrMesg delete result.ErrCode this.setState({ data: result }) } else { this.setState({ data: '' }) notification.error({ top: 92, message: result.message, duration: 10 }) } }) } getComponents = () => { const { menuType, BID, bids, config } = this.props const { mainSearch, data } = this.state if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />) return config.components.map(item => { let _bid = '' if (bids && item.setting && item.setting.supModule) { _bid = bids[item.setting.supModule] || '' } else if (!bids && BID && (!item.setting || !item.setting.supModule)) { _bid = BID } if (item.type === 'bar' || item.type === 'line') { return ( <Col span={item.width} key={item.uuid}> <AntvBarAndLine data={data} config={item} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> </Col> ) } else if (item.type === 'pie') { return ( <Col span={item.width} key={item.uuid}> <AntvPie data={data} config={item} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> </Col> ) } else if (item.type === 'card' && item.subtype === 'datacard') { return ( <Col span={item.width} key={item.uuid}> <DataCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> </Col> ) } else if (item.type === 'card' && item.subtype === 'propcard') { return ( <Col span={item.width} key={item.uuid}> <PropCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> </Col> ) } else if (item.type === 'table' && item.subtype === 'tablecard') { return ( <Col span={item.width} key={item.uuid}> <TableCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> </Col> ) } else { return null } }) } render() { const { config } = this.props return ( <div className="normal-group-wrap" id={config.uuid}> {this.getComponents()} </div> ) } } const mapStateToProps = (state) => { return { menuType: state.editLevel } } const mapDispatchToProps = () => { return {} } export default connect(mapStateToProps, mapDispatchToProps)(TabTransfer) src/tabviews/custom/components/group/normal-group/index.scss
New file @@ -0,0 +1,5 @@ .normal-group-wrap::after { content: ' '; display: block; clear: both; } src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -20,6 +20,7 @@ const DataCard = asyncComponent(() => import('@/tabviews/custom/components/card/data-card')) const TableCard = asyncComponent(() => import('@/tabviews/custom/components/card/table-card')) const PropCard = asyncComponent(() => import('@/tabviews/custom/components/card/prop-card')) const NormalGroup = asyncComponent(() => import('@/tabviews/custom/components/group/normal-group')) class TabTransfer extends Component { static propTpyes = { @@ -54,7 +55,7 @@ let params = [] config.components.forEach(item => { if (item.type === 'tabs') return if (item.type === 'tabs' || item.type === 'group') return if (!item.setting || item.setting.interType !== 'system') return if (!item.format || (item.subtype === 'propcard' && item.wrap.datatype === 'static')) return @@ -297,6 +298,12 @@ <TableCard config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} /> </Col> ) } else if (item.type === 'group' && item.subtype === 'normalgroup') { return ( <Col span={item.width} key={item.uuid}> <NormalGroup config={item} bids={bids} mainSearch={mainSearch} menuType={menuType} /> </Col> ) } else { return null } src/tabviews/custom/index.jsx
@@ -25,6 +25,7 @@ const TableCard = asyncComponent(() => import('./components/card/table-card')) const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch')) const NormalTable = asyncComponent(() => import('./components/table/normal-table')) const NormalGroup = asyncComponent(() => import('./components/group/normal-group')) class CustomPage extends Component { static propTpyes = { @@ -205,6 +206,15 @@ }) }) item.parentIds = supIds } else if (item.type === 'group') { if ( item.setting.blacklist && item.setting.blacklist.length > 0 && item.setting.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0 ) { return false } item.components = this.filterComponent(item.components, roleId, permAction, permMenus) } else if (item.type === 'pie' || item.type === 'bar' || item.type === 'line') { if ( item.plot.blacklist && item.plot.blacklist.length > 0 && @@ -366,6 +376,11 @@ tab = {...tab, ...inherit} return tab }) return component } else if (component.type === 'group') { component.components = this.formatSetting(component.components, [], [], inherit) component = {...component, ...inherit} return component } if (!component.setting) return component // 不使用系统函数时 @@ -712,6 +727,12 @@ <NormalTable config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> </Col> ) } else if (item.type === 'group' && item.subtype === 'normalgroup') { return ( <Col span={item.width} key={item.uuid}> <NormalGroup config={item} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> </Col> ) } else { return null } src/templates/sharecomponent/actioncomponent/index.jsx
@@ -10,18 +10,19 @@ import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' import { getActionForm } from '@/templates/zshare/formconfig' import asyncSpinComponent from '@/utils/asyncSpinComponent' import ActionForm from './actionform' import VerifyCard from '@/templates/zshare/verifycard' import CreateFunc from '@/templates/zshare/createfunc' import CreateInterface from '@/templates/zshare/createinterface' import VerifyPrint from './verifyprint' import VerifyExcelIn from './verifyexcelin' import VerifyExcelOut from './verifyexcelout' import DragElement from './dragaction' import './index.scss' const { confirm } = Modal const VerifyCard = asyncSpinComponent(() => import('@/templates/zshare/verifycard')) const VerifyPrint = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyprint')) const VerifyExcelIn = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelin')) const VerifyExcelOut = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelout')) class ActionComponent extends Component { static propTpyes = { src/templates/sharecomponent/actioncomponent/index.scss
@@ -40,6 +40,7 @@ padding-bottom: 5px; .ant-modal-body { max-height: calc(100vh - 190px); min-height: calc(100vh - 300px); overflow-y: auto; .ant-empty { margin: 15vh 8px; src/views/menudesign/index.jsx
@@ -250,6 +250,8 @@ item.subtabs.forEach(tab => { traversal(tab.components) }) } else if (item.type === 'group') { traversal(item.components) } else if (item.type === 'card' || (item.type === 'table' && item.subtype === 'tablecard')) { item.action && item.action.forEach(btn => { buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`) @@ -302,6 +304,8 @@ item.subtabs.forEach(tab => { tab.components = this.filterConfig(tab.components) }) } else if (item.type === 'group') { item.components = this.filterConfig(item.components) } else if (item.type === 'table' && item.subtype === 'normaltable') { item.search = item.search.filter(a => !a.origin) item.action = item.action.filter(a => !a.origin)