src/menu/components/card/cardcellcomponent/dragaction/card.jsx
@@ -76,7 +76,7 @@ _imagestyle = {backgroundImage: `url('${card.url}')`} } else { let index = card.uuid.match(/\d{1}/g) index = index[index.length - 1] % 5 index = index.slice(-1)[0] % 5 let demos = [demo1, demo2, demo3, demo4, demo5] _imagestyle = {backgroundImage: `url('${demos[index]}')`} src/menu/components/card/prop-card/index.jsx
@@ -202,7 +202,7 @@ } if (card.subcards.length > 0) { newcard = fromJS(card.subcards[card.subcards.length - 1]).toJS() newcard = fromJS(card.subcards.slice(-1)[0]).toJS() newcard.uuid = Utils.getuuid() newcard.elements = newcard.elements.map(elem => { elem.uuid = Utils.getuuid() src/menu/components/card/table-card/index.jsx
@@ -207,7 +207,7 @@ } if (card.subcards.length > 0) { newcard = fromJS(card.subcards[card.subcards.length - 1]).toJS() newcard = fromJS(card.subcards.slice(-1)[0]).toJS() newcard.uuid = Utils.getuuid() newcard.elements = newcard.elements.map(elem => { elem.uuid = Utils.getuuid() src/menu/components/table/normal-table/columns/index.jsx
@@ -182,8 +182,10 @@ if (!is(fromJS(this.state.columns), fromJS(nextProps.config.cols))) { let _columns = fromJS(nextProps.config.cols).toJS() this.setState({columns: _columns}) if (_columns[_columns.length - 1] && _columns[_columns.length - 1].focus) { this.editColumn(_columns[_columns.length - 1]) let lastcol = _columns.slice(-1)[0] if (lastcol && lastcol.focus) { this.editColumn(lastcol) } } else if (!is(fromJS(this.state.fields), fromJS(nextProps.config.columns))) { this.setState({fields: fromJS(nextProps.config.columns).toJS()}) @@ -395,7 +397,7 @@ <DndProvider> <Table rowKey="uuid" bordered={config.wrap.border !== 'false'} bordered={config.wrap.bordered !== 'false'} components={components} dataSource={this.state.data} rowSelection={config.wrap.tableType ? { type: 'radio' } : null} src/menu/components/table/normal-table/index.jsx
@@ -63,7 +63,7 @@ name: card.name, subtype: card.subtype, setting: { interType: 'system' }, wrap: { name: card.name, width: 24, border: 'true', tableType: 'checkbox' }, wrap: { name: card.name, width: 24, bordered: 'true', tableType: 'checkbox' }, style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, columns: [], cols: [ src/menu/components/table/normal-table/wrapsetting/settingform/index.jsx
@@ -124,8 +124,8 @@ </Col> <Col span={12}> <Form.Item label="边框"> {getFieldDecorator('border', { initialValue: wrap.border || 'true' {getFieldDecorator('bordered', { initialValue: wrap.bordered || 'true' })( <Radio.Group style={{whiteSpace: 'nowrap'}}> <Radio key="true" value={'true'}> 有 </Radio> src/menu/components/tabs/tabcomponents/index.jsx
@@ -130,7 +130,7 @@ targetId = item.dropTargetId delete item.dropTargetId } else if (cards.length > 0) { targetId = cards[cards.length - 1].uuid targetId = cards.slice(-1)[0].uuid } const { index: overIndex } = findCard(`${targetId}`) src/menu/menushell/index.jsx
@@ -120,7 +120,7 @@ targetId = item.dropTargetId delete item.dropTargetId } else if (cards.length > 0) { targetId = cards[cards.length - 1].uuid targetId = cards.slice(-1)[0].uuid } const { index: overIndex } = findCard(`${targetId}`) src/menu/modalconfig/index.jsx
@@ -510,7 +510,7 @@ required: 'true' } }) _config.groups[_config.groups.length - 1].sublist = [..._config.groups[_config.groups.length - 1].sublist, ..._additems] _config.groups[_config.groups.length - 1].sublist = [..._config.groups.slice(-1)[0].sublist, ..._additems] } else { let items = [] src/mob/mobshell/index.jsx
@@ -56,7 +56,7 @@ targetId = item.dropTargetId delete item.dropTargetId } else if (cards.length > 0) { targetId = cards[cards.length - 1].uuid targetId = cards.slice(-1)[0].uuid } const { index: overIndex } = findCard(`${targetId}`) // cards为空时 overIndex 为 -1 src/tabviews/commontable/index.jsx
@@ -319,7 +319,7 @@ if (_hideCol.includes(col.uuid)) return if (col.linkmenu && col.linkmenu.length > 0) { let menu_id = col.linkmenu[col.linkmenu.length - 1] let menu_id = col.linkmenu.slice(-1)[0] col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || '' } else { col.linkThdMenu = '' @@ -329,13 +329,13 @@ if (col.type === 'colspan' && col.sublist) { let _col = fromJS(col).toJS() let subColumn = [] let subcols = [] _col.sublist.forEach(sub => { if (colMap.has(sub)) { subColumn.push(colMap.get(sub)) subcols.push(colMap.get(sub)) } }) _col.subColumn = subColumn _col.subcols = subcols _columns.push(_col) } else { _columns.push(col) @@ -465,13 +465,10 @@ _ActiveTabId = _tab.uuid }) this.setState({ tabActive: {...this.state.tabActive, [_groupId]: _ActiveTabId} }, () => { if (_ActiveTabId && this.state.tabActive[_groupId] === _ActiveTabId) { MKEmitter.emit('triggerBtnId', triggerId) }) return true return true } } return false }) @@ -1056,7 +1053,7 @@ </Row> : null } {setting && setting.onload !== 'false' && config.tabgroups.map(group => ( <Tabs activeKey={tabActive[group.uuid]} key={group.uuid} onChange={(key) => this.setState({tabActive: {...tabActive, [group.uuid]: key}})}> <Tabs key={group.uuid} onChange={(key) => this.setState({tabActive: {...tabActive, [group.uuid]: key}})}> {group.sublist.map(_tab => { return ( <TabPane tab={ src/tabviews/commontable/secretKeyTable/index.jsx
@@ -94,13 +94,13 @@ if (col.type === 'colspan' && col.sublist) { let _col = JSON.parse(JSON.stringify(col)) let subColumn = [] let subcols = [] _col.sublist.forEach(sub => { if (colMap.has(sub)) { subColumn.push(colMap.get(sub)) subcols.push(colMap.get(sub)) } }) _col.subColumn = subColumn _col.subcols = subcols _columns.push(_col) } else { _columns.push(col) src/tabviews/custom/components/card/data-card/index.jsx
@@ -174,7 +174,7 @@ if (type === 'refresh' && position === 'grid') { this.loadData() if (btn && btn.syncComponent && btn.syncComponent[0]) { let syncId = btn.syncComponent[btn.syncComponent.length - 1] let syncId = btn.syncComponent.slice(-1)[0] if (config.uuid !== syncId) { MKEmitter.emit('syncRefreshComponentId', syncId) } src/tabviews/custom/components/card/prop-card/index.jsx
@@ -189,7 +189,7 @@ if (type === 'refresh' && position === 'grid') { this.loadData() if (btn && btn.syncComponent && btn.syncComponent[0]) { let syncId = btn.syncComponent[btn.syncComponent.length - 1] let syncId = btn.syncComponent.slice(-1)[0] if (config.uuid !== syncId) { MKEmitter.emit('syncRefreshComponentId', syncId) } src/tabviews/custom/components/card/table-card/index.jsx
@@ -33,6 +33,10 @@ showHeader: false // 存在标题、搜索 } /** * @description 初始化处理 * 1、 initdata 为打印时使用的数据集 */ UNSAFE_componentWillMount () { const { data, initdata } = this.props let _config = fromJS(this.props.config).toJS() @@ -188,7 +192,7 @@ if (type === 'refresh' && position === 'grid') { this.loadData() if (btn && btn.syncComponent && btn.syncComponent[0]) { let syncId = btn.syncComponent[btn.syncComponent.length - 1] let syncId = btn.syncComponent.slice(-1)[0] if (config.uuid !== syncId) { MKEmitter.emit('syncRefreshComponentId', syncId) } src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -1160,7 +1160,7 @@ } if (plot.linkmenu && plot.linkmenu.length > 0) { let menu_id = plot.linkmenu[plot.linkmenu.length - 1] let menu_id = plot.linkmenu.slice(-1)[0] let menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' chart.on('element:dblclick', (ev) => { src/tabviews/custom/components/chart/antv-pie/index.jsx
@@ -25,6 +25,7 @@ } state = { BID: '', // 上级ID config: null, // 图表配置信息 empty: true, // 图表数据为空 loading: false, // 数据加载状态 @@ -38,7 +39,7 @@ } UNSAFE_componentWillMount () { const { config, data, initdata } = this.props const { config, data, initdata, BID } = this.props let _config = fromJS(config).toJS() let _data = null @@ -66,9 +67,16 @@ _config.style = {minHeight: (config.plot.height || 400)} } let _BID = BID || '' if (config.setting.supModule && config.setting.supModule[0] !== 'empty') { _BID = '' } sessionStorage.setItem(config.uuid, 'bid') this.setState({ config: _config, data: _data, BID: _BID, arr_field: _config.columns.map(col => col.field).join(','), plot: _config.plot, sync: _sync, @@ -85,10 +93,11 @@ } /** * @description 校验图表的按钮组,如果为统计图表,计算图表字段 * @description 组件销毁 */ componentDidMount () { componentWillUnmount () { const { config } = this.state sessionStorage.removeItem(config.uuid) } /** @@ -128,8 +137,8 @@ } async loadData () { const { mainSearch, BID, menuType, dataManager } = this.props const { config, arr_field, search } = this.state const { mainSearch, menuType, dataManager } = this.props const { config, arr_field, search, BID } = this.state let searches = fromJS(search).toJS() if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 @@ -476,7 +485,7 @@ } if (plot.linkmenu && plot.linkmenu.length > 0) { let menu_id = plot.linkmenu[plot.linkmenu.length - 1] let menu_id = plot.linkmenu.slice(-1)[0] let menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' chart.on('element:dblclick', (ev) => { src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -271,7 +271,7 @@ } else if (item.type === 'search') { return ( <Col span={item.width} key={item.uuid}> <MainSearch config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} refreshdata={this.resetSearch} /> <MainSearch config={item} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} refreshdata={this.resetSearch} /> </Col> ) } else if (item.type === 'tabs') { src/tabviews/custom/components/table/normal-table/index.jsx
New file @@ -0,0 +1,535 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { notification, Switch } from 'antd' import Api from '@/api' import Utils from '@/utils/utils.js' import zhCN from '@/locales/zh-CN/main.js' import enUS from '@/locales/en-US/main.js' import UtilsDM from '@/utils/utils-datamanage.js' import asyncSpinComponent from '@/utils/asyncSpinComponent' import MKEmitter from '@/utils/events.js' import MainSearch from '@/tabviews/zshare/topSearch' import './index.scss' // 通用组件 const MainAction = asyncSpinComponent(() => import('@/tabviews/zshare/actionList')) const MainTable = asyncSpinComponent(() => import('@/tabviews/zshare/normalTable')) class NormalTable extends Component { static propTpyes = { param: PropTypes.any, // 其他页面传递的搜索条件等参数 MenuID: PropTypes.string, // 菜单Id MenuNo: PropTypes.string, // 菜单参数 MenuName: PropTypes.string // 菜单名称 } state = { dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, BID: null, // 页面跳转时携带ID config: {}, // 页面配置信息,包括按钮、搜索、显示列、标签等 searchlist: null, // 搜索条件 actions: null, // 按钮集 columns: null, // 显示列 logcolumns: null, // 日志中显示的列信息 (增加至全部列,除去合并列) arr_field: '', // 使用 sPC_Get_TableData 时的查询字段集 setting: null, // 页面全局设置:数据源、按钮及显示列固定、主键等 data: null, // 列表数据集 selectedData: [], // 已选表格数据 total: 0, // 总数 loading: false, // 列表数据加载中 pageIndex: 1, // 页码 pageSize: 10, // 每页数据条数 orderBy: '', // 排序 search: '', // 搜索条件数组,使用时需分场景处理 BIDs: {}, // 上级表id pickup: false, // 主表数据隐藏显示切换 statFields: [], // 合计字段 statFValue: [] // 合计值 } /** * @description 初始化处理 * 1、 initdata 为打印时使用的数据集 */ UNSAFE_componentWillMount () { const { data, initdata } = this.props let _config = fromJS(this.props.config).toJS() let _cols = new Map() let _data = null let _sync = _config.setting.sync === 'true' if (_config.setting.sync === 'true' && data) { _data = data[_config.dataName] || [] _sync = false } else if (_config.setting.sync === 'true' && initdata) { _data = initdata || [] _sync = false } _config.columns.forEach(item => { _cols.set(item.field, item) }) _config.cols.forEach(column => { if (column.type === 'custom') { column.elements = column.elements.map(item => { if (item.field && _cols.has(item.field)) { item.col = _cols.get(item.field) } return item }) } else if (column.type === 'colspan') { column.unfold = 'true' } else if (column.type === 'action') { column.operations = column.elements } }) this.setState({ title: _config.wrap.title, sync: _sync, data: _data, config: _config, setting: {..._config.setting, ..._config.wrap}, searchlist: _config.search, actions: _config.action, columns: _config.cols, arr_field: _config.columns.map(col => col.field).join(','), search: Utils.initMainSearch(_config.search) // 搜索条件初始化(含有时间格式,需要转化) }, () => { if (_config.setting.sync !== 'true' && _config.setting.onload === 'true') { this.loadmaindata() this.getStatFieldsValue() } }) } /** * @description 主表数据加载 */ async loadmaindata () { const { setting, arr_field, BIDs, search, orderBy, BID, pageIndex, pageSize } = this.state let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0)) this.setState({ selectedData: [], BIDs: { ...BIDs, mainTable: '', mainTabledata: '' } }) if (requireFields.length > 0) { let labels = requireFields.map(item => item.label) labels = Array.from(new Set(labels)) notification.warning({ top: 92, message: this.state.dict['form.required.input'] + labels.join('、') + ' !', duration: 3 }) return } this.setState({ loading: true }) let _orderBy = orderBy || setting.order let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, this.props.dataManager) if (param.func === 'sPC_Get_TableData') { param.menuname = this.props.MenuName || '' } let result = await Api.genericInterface(param) if (result.status) { this.setState({ data: result.data.map((item, index) => { item.key = index return item }), total: result.total, loading: false, pickup: false }) } else { this.setState({ loading: false }) notification.error({ top: 92, message: result.message, duration: 10 }) } } /** * @description 获取单行数据 */ async loadmainLinedata (id) { const { setting, arr_field, search, orderBy, BID, pageIndex, pageSize } = this.state this.setState({ loading: true }) let _orderBy = orderBy || setting.order let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, this.props.dataManager, id) if (param.func === 'sPC_Get_TableData') { param.menuname = this.props.MenuName || '' } let result = await Api.genericInterface(param) if (result.status) { let data = fromJS(this.state.data).toJS() if (result.data && result.data[0]) { let _data = result.data[0] try { data = data.map(item => { if (item[setting.primaryKey] === _data[setting.primaryKey]) { _data.key = item.key return _data } else { return item } }) } catch { console.warn('数据查询错误') } } this.setState({ data: data, loading: false }) } else { this.setState({ loading: false }) notification.error({ top: 92, message: result.message, duration: 10 }) } } /** * @description 获取合计字段值 */ getStatFieldsValue = () => { const { setting, search, BID, orderBy, statFields } = this.state if (statFields.length === 0 || setting.interType !== 'system' || !setting.dataresource) return let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0)) if (requireFields.length > 0) { return } let _orderBy = orderBy || setting.order let param = UtilsDM.getStatQueryDataParams(setting, statFields, search, _orderBy, BID, this.props.menuType, this.props.dataManager) if (param.func === 'sPC_Get_TableData') { param.menuname = this.props.MenuName || '' } Api.genericInterface(param).then(res => { if (res.status) { let _data = res.data[0] let values = [] if (_data) { statFields.forEach(item => { if (_data[item.field] || _data[item.field] === 0) { let val = +_data[item.field] if (isNaN(val)) { val = 0 } val = val.toFixed(item.decimal) values.push({label: item.label, value: val}) } }) } this.setState({ statFValue: values }) } else { this.setState({ statFValue: [] }) notification.error({ top: 92, message: res.message, duration: 10 }) } }) } /** * @description 搜索条件改变时,重置表格数据 * 含有初始不加载的页面,修改设置 */ refreshbysearch = (searches) => { const { setting } = this.state if (setting.onload === 'false') { this.setState({ pageIndex: 1, search: searches, setting: {...setting, onload: 'true'} }, () => { this.loadmaindata() this.getStatFieldsValue() }) } else { MKEmitter.emit('resetTable', this.props.MenuID + 'mainTable') // 列表重置 this.setState({ pageIndex: 1, search: searches }, () => { this.loadmaindata() this.getStatFieldsValue() }) } } /** * @description 表格条件改变时重置数据(分页或排序) */ refreshbytable = (pagination, filters, sorter) => { if (sorter.order) { let _chg = { ascend: 'asc', descend: 'desc' } sorter.order = _chg[sorter.order] } this.setState({ pageIndex: pagination.current, pageSize: pagination.pageSize, orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : '' }, () => { this.loadmaindata() }) } /** * @description 表格刷新 */ reloadtable = (btn) => { if (!btn || btn.resetPageIndex !== 'false') { MKEmitter.emit('resetTable', this.props.MenuID + 'mainTable') // 列表重置 this.setState({ pageIndex: 1 }, () => { this.loadmaindata() this.getStatFieldsValue() }) } else { MKEmitter.emit('resetTable', this.props.MenuID + 'mainTable', 'false') // 列表重置 this.loadmaindata() this.getStatFieldsValue() } } /** * @description 按钮操作完成后(成功或失败),页面刷新,重置页码及选择项 */ refreshbyaction = (position, btn) => { if (position === 'grid' || position === 'view') { this.reloadtable(btn) } } /** * @description 导出Excel时,获取页面搜索排序等参数 */ getexceloutparam = () => { const { MenuName } = this.props const { arr_field, orderBy, search, setting} = this.state return { arr_field: arr_field, orderBy: orderBy || setting.order, search: search, menuName: MenuName } } /** * @description 表格选择项切换 */ changeSelectedData = (selectedData) => { this.setState({selectedData}) } /** * @description 表格Id变化 */ handleTableId = (type, id, data) => { const { BIDs } = this.state this.setState({ BIDs: { ...BIDs, [type]: id, [type + 'data']: data } }) } /** * @description 数据展开合并切换 */ pickupChange = () => { const { pickup } = this.state this.setState({ pickup: !pickup }) } reloadData = (menuId, id, btn) => { const { MenuID } = this.props if (MenuID !== menuId) return if (id === 'empty') return if (id === 'formtab') { // 表单标签页刷新 this.reloadtable(btn) return } if (!id) { this.reloadtable() } else { this.loadmainLinedata(id) } } UNSAFE_componentWillReceiveProps(nextProps) { const { sync, config } = this.state if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { let _data = [] if (nextProps.data && nextProps.data[config.dataName]) { _data = nextProps.data[config.dataName] || [] } this.setState({sync: false, data: _data}) } else if (!is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { if (config.setting.syncRefresh === 'true') { this.setState({}, () => { this.reloadtable() }) } } } shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) } componentDidMount () { MKEmitter.addListener('reloadData', this.reloadData) } /** * @description 组件销毁,清除state更新,清除快捷键设置 */ componentWillUnmount () { this.setState = () => { return } MKEmitter.removeListener('reloadData', this.reloadData) } render() { const { MenuName } = this.props const { BID, setting, searchlist, pageSize, actions, columns, pickup, config, selectedData } = this.state return ( <div className="commontable"> {searchlist && searchlist.length > 0 ? <MainSearch BID={BID} dict={this.state.dict} searchlist={searchlist} menuType={this.props.menuType} dataManager={this.props.dataManager} refreshdata={this.refreshbysearch} /> : null } <div className="commontable-main-action"> <MainAction BID={BID} setting={setting} actions={actions} MenuName={MenuName} dict={this.state.dict} MenuID={this.props.MenuID} selectedData={selectedData} logcolumns={this.state.logcolumns} refreshdata={this.refreshbyaction} getexceloutparam={this.getexceloutparam} /> </div> <div className="main-table-box"> {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && this.state.data && this.state.data.length > 0 ? <Switch title="收起" className="main-pickup" checkedChildren="开" unCheckedChildren="关" defaultChecked={pickup} onChange={this.pickupChange} /> : null } <MainTable tableId="mainTable" BID={BID} pickup={pickup} config={config} setting={setting} columns={columns} MenuName={MenuName} pageSize={pageSize} dict={this.state.dict} data={this.state.data} total={this.state.total} MenuID={this.props.MenuID} loading={this.state.loading} refreshdata={this.refreshbytable} logcolumns={this.state.logcolumns} statFValue={this.state.statFValue} handleTableId={this.handleTableId} refreshbyaction={this.refreshbyaction} chgSelectData={this.changeSelectedData} /> </div> </div> ) } } const mapStateToProps = (state) => { return { menuType: state.editLevel, tabviews: state.tabviews, permAction: state.permAction, permMenus: state.permMenus, permRoles: state.permRoles, dataManager: state.dataManager } } const mapDispatchToProps = () => { return {} } export default connect(mapStateToProps, mapDispatchToProps)(NormalTable) src/tabviews/custom/components/table/normal-table/index.scss
New file @@ -0,0 +1,237 @@ .commontable { position: relative; min-height: calc(100vh - 94px); padding-top: 16px; padding-bottom: 80px; .box404 { padding-top: 30px; } .commontable-main-action { min-height: 25px; .button-list { padding-right: 110px; } } .ant-modal-mask { position: absolute; } .ant-modal-wrap { position: absolute; } .action-modal .ant-modal { top: 40px; max-width: 95%; .ant-modal-body { max-height: calc(100vh - 265px); } } > .ant-spin { position: absolute; z-index: 10; left: calc(50% - 22px); top: calc(50vh - 70px); } > .ant-card { margin: 0 20px 20px; > .ant-card-head { border: 0; padding: 0; min-height: 30px; .ant-card-head-title { padding: 10px 0 0; span { color: #1890ff; display: inline-block; padding: 0 10px; font-size: 15px; border-bottom: 1px solid #1890ff; i { margin-right: 10px; } } } } > .ant-card-body { padding: 0; } } .main-table-box { position: relative; .main-pickup { position: absolute; right: 35px; top: -22px; z-index: 1; } .custom-control { position: absolute; z-index: 1; right: 0px; top: -23px; font-size: 18px; padding: 3px; cursor: pointer; } >.async-spin { line-height: 150px!important; } } > .ant-tabs { width: 100%; padding: 0px 20px; margin-bottom: 20px; .ant-tabs-tab:not(.ant-tabs-tab-active) { cursor: pointer; } .ant-tabs-tab.ant-tabs-tab-active { cursor: default; } } .common-table-copy { position: fixed; z-index: 2; bottom: 65px; right: 30px; width: 40px; height: 40px; } .ant-table-fixed-left, .ant-table-fixed-right { z-index: 1; } > .chart-view { position: relative; padding: 0 20px; >.ant-tabs { .ant-tabs-bar { position: relative; z-index: 1; margin: 0; border: 0; .ant-tabs-nav-scroll { text-align: right; padding-right: 20px; .ant-tabs-ink-bar { display: none!important; } .ant-tabs-tab { padding: 6px 5px; margin-right: 5px; } } } } >.ant-col { min-height: 100px; } >.card-view.ant-col-24 { padding: 0!important; .card-row-box { padding: 0; } } .chart-title { position: relative; color: rgba(0, 0, 0, 0.65); font-weight: 400; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; margin: 0px; padding: 5px 10px; float: left; max-width: 50%; } .chart-table.chart-title { position: absolute; top: 0px; } .canvas { clear: both; } } } .menu-tree-modal { .ant-modal-body { min-height: 300px; .menu-header { text-align: center; span { font-weight: 600; margin-right: 20px; } .ant-typography { font-weight: 600; display: inline-block; } } .ant-tree li .ant-tree-node-content-wrapper { cursor: default; } } } .commontable.bg-gray { background: #f0f2f5; >.top-search { background: #ffffff; padding: 10px 10px; margin: 0 20px; } .chart-view { margin-bottom: 20px; .ant-col:last-child { .line-chart-plot-box { margin-bottom: 0px; } .card-row-box { margin-bottom: 0px; } .normal-data-table { margin-bottom: 0px; } } >.ant-col { min-height: 50px; } } .line-chart-plot-box { background: #ffffff; padding: 10px; margin-bottom: 20px; } .card-row-box { min-height: 130px; background: #ffffff; padding-bottom: 10px; margin-bottom: 20px; } .commontable-main-action { padding: 0 10px; background: #ffffff; } .normal-data-table { padding: 0 10px 10px; margin-bottom: 20px; background: #ffffff; } .main-pickup { right: 45px; } .custom-control { right: 10px; } > .ant-tabs { margin: 0px 20px 20px; padding: 0px; width: calc(100% - 40px); background: #ffffff; .top-search { padding: 0 10px 10px; } .button-list.toolbar-button { padding: 15px 10px 5px; } } } src/tabviews/custom/components/tabs/antv-tabs/index.jsx
@@ -20,13 +20,15 @@ } state = { tabs: null tabs: null, parentIds: [] } UNSAFE_componentWillMount () { const { config } = this.props this.setState({ tabs: config tabs: config, parentIds: config.parentIds || [] }) } src/tabviews/custom/index.jsx
@@ -24,6 +24,7 @@ const PropCard = asyncComponent(() => import('./components/card/prop-card')) const TableCard = asyncComponent(() => import('./components/card/table-card')) const MainSearch = asyncComponent(() => import('./components/search/main-search')) const NormalTable = asyncComponent(() => import('./components/table/normal-table')) class CustomPage extends Component { static propTpyes = { @@ -203,6 +204,18 @@ tab.components = this.filterComponent(tab.components) return tab }) let supIds = [] item.subtabs.forEach(tab => { tab.components.forEach(comp => { if (comp.type === 'tabs' && comp.parentIds) { supIds.push(...comp.parentIds) } else if (comp.setting.supModule && comp.setting.supModule[0] !== 'empty') { supIds.push(...comp.setting.supModule.slice(-1)) } }) }) item.parentIds = supIds } else if (item.type === 'pie' || item.type === 'bar' || item.type === 'line') { if (item.plot.blacklist && item.plot.blacklist.length > 0) { let _black = item.plot.blacklist.filter(v => { @@ -542,7 +555,7 @@ } else if (item.type === 'tabs') { return ( <Col span={item.width} key={item.uuid}> <AntvTabs config={item} BID={BID} mainSearch={mainSearch} /> <AntvTabs config={item} mainSearch={mainSearch} /> </Col> ) } else if (item.type === 'card' && item.subtype === 'datacard') { @@ -563,6 +576,12 @@ <TableCard config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> </Col> ) } else if (item.type === 'table' && item.subtype === 'normaltable') { return ( <Col span={item.width} key={item.uuid}> <NormalTable config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> </Col> ) } else { return null } src/tabviews/scriptmanage/index.jsx
@@ -81,13 +81,13 @@ if (col.type === 'colspan' && col.sublist) { let _col = JSON.parse(JSON.stringify(col)) let subColumn = [] let subcols = [] _col.sublist.forEach(sub => { if (colMap.has(sub)) { subColumn.push(colMap.get(sub)) subcols.push(colMap.get(sub)) } }) _col.subColumn = subColumn _col.subcols = subcols _columns.push(_col) } else { _columns.push(col) src/tabviews/subtable/index.jsx
@@ -246,7 +246,7 @@ if (_hideCol.includes(col.uuid)) return if (col.linkmenu && col.linkmenu.length > 0) { let menu_id = col.linkmenu[col.linkmenu.length - 1] let menu_id = col.linkmenu.slice(-1)[0] col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || '' } else { col.linkThdMenu = '' @@ -256,13 +256,13 @@ if (col.type === 'colspan' && col.sublist) { let _col = JSON.parse(JSON.stringify(col)) let subColumn = [] let subcols = [] _col.sublist.forEach(sub => { if (colMap.has(sub)) { subColumn.push(colMap.get(sub)) subcols.push(colMap.get(sub)) } }) _col.subColumn = subColumn _col.subcols = subcols _columns.push(_col) } else { _columns.push(col) src/tabviews/subtabtable/index.jsx
@@ -227,13 +227,13 @@ if (col.type === 'colspan' && col.sublist) { let _col = JSON.parse(JSON.stringify(col)) let subColumn = [] let subcols = [] _col.sublist.forEach(sub => { if (colMap.has(sub)) { subColumn.push(colMap.get(sub)) subcols.push(colMap.get(sub)) } }) _col.subColumn = subColumn _col.subcols = subcols _columns.push(_col) } else { _columns.push(col) src/tabviews/verupmanage/index.jsx
@@ -86,13 +86,13 @@ if (col.type === 'colspan' && col.sublist) { let _col = JSON.parse(JSON.stringify(col)) let subColumn = [] let subcols = [] _col.sublist.forEach(sub => { if (colMap.has(sub)) { subColumn.push(colMap.get(sub)) subcols.push(colMap.get(sub)) } }) _col.subColumn = subColumn _col.subcols = subcols _columns.push(_col) } else { _columns.push(col) src/tabviews/verupmanage/subtabtable/index.jsx
@@ -109,13 +109,13 @@ if (col.type === 'colspan' && col.sublist) { let _col = JSON.parse(JSON.stringify(col)) let subColumn = [] let subcols = [] _col.sublist.forEach(sub => { if (colMap.has(sub)) { subColumn.push(colMap.get(sub)) subcols.push(colMap.get(sub)) } }) _col.subColumn = subColumn _col.subcols = subcols _columns.push(_col) } else { _columns.push(col) src/tabviews/zshare/actionList/tabbutton/index.jsx
@@ -100,7 +100,7 @@ let menu = null if (btn.linkmenu && btn.linkmenu.length > 0) { let menu_id = btn.linkmenu[btn.linkmenu.length - 1] let menu_id = btn.linkmenu.slice(-1)[0] menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' } src/tabviews/zshare/calendar/index.jsx
@@ -194,7 +194,7 @@ } } let re = 7 - _weeklist[_weeklist.length - 1].sublist.length let re = 7 - _weeklist.slice(-1)[0].sublist.length for (let i = 0; i < re; i++) { _weeklist[_weeklist.length - 1].sublist.push(null) } src/tabviews/zshare/normalTable/index.jsx
@@ -110,7 +110,7 @@ if (item.type === 'colspan' && item.unfold === 'true') { cell = {title: item.label, children: []} item.subColumn.forEach(col => { item.subcols.forEach(col => { if (col.rowspan === 'true') { rowspan = col @@ -617,12 +617,12 @@ </div> ) } else if (item.type === 'colspan') { if (item.subColumn.length === 0) return '' if (item.subcols.length === 0) return '' let ordertype = item.order let contents = [] let images = [] item.subColumn.forEach(col => { item.subcols.forEach(col => { if (!col.field || !record.hasOwnProperty(col.field)) return if (col.type === 'number') { @@ -885,7 +885,7 @@ let index = '' let _activeIndex = null if (selectedRowKeys.length > 0) { index = selectedRowKeys[selectedRowKeys.length - 1] index = selectedRowKeys.slice(-1)[0] } if (setting.tableType === 'checkbox') { @@ -918,7 +918,7 @@ if (newkeys.includes(index)) { newkeys = newkeys.filter(item => item !== index) if (newkeys.length > 0) { _index = newkeys[newkeys.length - 1] _index = newkeys.slice(-1)[0] } this.changedata(_index) } else { src/tabviews/zshare/verifycard/index.jsx
@@ -183,13 +183,13 @@ if (col.type === 'colspan' && col.sublist) { let _col = JSON.parse(JSON.stringify(col)) let subColumn = [] let subcols = [] _col.sublist.forEach(sub => { if (colMap.has(sub)) { subColumn.push(colMap.get(sub)) subcols.push(colMap.get(sub)) } }) _col.subColumn = subColumn _col.subcols = subcols _columns.push(_col) } else { _columns.push(col) src/templates/formtabconfig/dragelement/index.jsx
@@ -141,7 +141,7 @@ targetId = item.dropTargetId delete item.dropTargetId } else if (cards.length > 0) { targetId = cards[cards.length - 1].uuid targetId = cards.slice(-1)[0].uuid } const { index: overIndex } = findCard(`${targetId}`) src/templates/modalconfig/groupform/index.jsx
@@ -24,7 +24,7 @@ const { config, group } = this.props let _source = null let _default = config.groups[config.groups.length - 1] let _default = config.groups.slice(-1)[0] let _selectds = [] if (!_default) { src/templates/modalconfig/index.jsx
@@ -793,7 +793,7 @@ required: 'true' } }) _config.groups[_config.groups.length - 1].sublist = [..._config.groups[_config.groups.length - 1].sublist, ..._additems] _config.groups[_config.groups.length - 1].sublist = [..._config.groups.slice(-1)[0].sublist, ..._additems] } else { let items = [] src/templates/sharecomponent/actioncomponent/dragaction/index.jsx
@@ -134,7 +134,7 @@ targetId = item.dropTargetId delete item.dropTargetId } else if (cards.length > 0) { targetId = cards[cards.length - 1].uuid targetId = cards.slice(-1)[0].uuid } const { index: overIndex } = findCard(`${targetId}`) src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
@@ -412,7 +412,12 @@ </Form.Item> </Col> : null} {type === 'main' ? <Col span={12}> <Form.Item label="表头固定"> <Form.Item label={ <Tooltip placement="topLeft" title={'含有合并列或表格出现横向滚动时会显示异常,请慎用!'}> <Icon type="question-circle" /> 表头固定 </Tooltip> }> {getFieldDecorator('columnfixed', { initialValue: setting.columnfixed === 'true' || setting.columnfixed === true ? 'true' : 'false' })( src/templates/zshare/modalform/modaleditable/index.jsx
@@ -339,7 +339,7 @@ let fields = [] if ((type === 'select' || type === 'radio') && linkSubFields.length > this.state.linkSubFields) { let addcol = linkSubFields[linkSubFields.length - 1] let addcol = linkSubFields.slice(-1)[0] dataSource = dataSource.map(data => { data[addcol.field] = data.Text return data