| | |
| | | refreshtabs: null, // 需要刷新的标签集 |
| | | triggerBtn: null, // 点击表格中或快捷键触发的按钮 |
| | | tabActive: null, // 标签页展开控制 |
| | | chartId: '' // 展开图表ID |
| | | chartId: '', // 展开图表ID |
| | | statFields: [], // 合计字段 |
| | | statFValue: [] // 合计值 |
| | | } |
| | | |
| | | /** |
| | |
| | | config.setting.execute = config.setting.default !== 'false' // 默认sql是否执行,转为boolean 统一格式 |
| | | config.setting.customScript = '' // 自定义脚本 |
| | | |
| | | if (config.setting.interType === 'system') { |
| | | if (config.setting.scripts && config.setting.scripts.length > 0) { |
| | | let _customScript = '' |
| | | config.setting.scripts.forEach(item => { |
| | |
| | | } else { |
| | | config.setting.dataresource = config.setting.dataresource.replace(/@\$|\$@/ig, '') |
| | | config.setting.customScript = config.setting.customScript.replace(/@\$|\$@/ig, '') |
| | | } |
| | | } |
| | | |
| | | if (_curUserConfig) { |
| | |
| | | let _logcolumns = [] // 日志显示列 |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() // 用于字段过滤 |
| | | let statFields = [] // 合计字段信息 |
| | | |
| | | let _actions = [] // 工具栏按钮 |
| | | let _operations = [] // 操作列按钮(存在时) |
| | |
| | | _logcolumns.push(col) |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { |
| | | statFields.push(col) |
| | | } |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | |
| | | loadingview: false, |
| | | chartId: chartId, |
| | | config: config, |
| | | statFields: statFields, |
| | | tabActive: _tabActive, |
| | | userConfig: userConfig, |
| | | setting: config.setting, |
| | |
| | | }, () => { |
| | | if (config.setting.onload !== 'false' && valid) { // 初始化可加载 |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | } |
| | | this.setShortcut() |
| | | }) |
| | |
| | | } |
| | | |
| | | /** |
| | | * @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) |
| | | |
| | | 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) { |
| | | values.push({label: item.label, value: _data[item.field]}) |
| | | } |
| | | }) |
| | | } |
| | | this.setState({ |
| | | statFValue: values |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | statFValue: [] |
| | | }) |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 搜索条件改变时,重置表格数据 |
| | | * 含有初始不加载的页面,修改设置 |
| | | */ |
| | |
| | | setting: {...setting, onload: 'true'} |
| | | }, () => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | search: searches |
| | | }, () => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } |
| | | } |
| | |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } |
| | | |
| | |
| | | total={this.state.total} |
| | | MenuID={this.props.MenuID} |
| | | loading={this.state.loading} |
| | | statFValue={this.state.statFValue} |
| | | refreshdata={this.refreshbytable} |
| | | buttonTrigger={this.buttonTrigger} |
| | | handleTableId={this.handleTableId} |
| | |
| | | search: [], // 搜索条件数组,使用时需分场景处理 |
| | | pickup: false, // 子表数据隐藏显示切换 |
| | | triggerBtn: null, // 按钮触发 |
| | | chartId: '' // 展开图表ID |
| | | chartId: '', // 展开图表ID |
| | | statFields: [], // 合计字段 |
| | | statFValue: [] // 合计值 |
| | | } |
| | | |
| | | /** |
| | |
| | | }, () => { |
| | | if (this.state.setting) { |
| | | this.loadmaindata(nextProps.BID, 'refresh') |
| | | this.getStatFieldsValue(nextProps.BID, 'refresh') |
| | | } |
| | | }) |
| | | } else if (this.state.config && nextProps.refreshtabs && nextProps.refreshtabs.includes(this.props.Tab.uuid)) { |
| | |
| | | if (this.state.setting) { |
| | | this.setState({}, () => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } |
| | | } |
| | |
| | | let _logcolumns = [] // 日志显示列 |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() |
| | | let statFields = [] // 合计字段信息 |
| | | |
| | | // 版本兼容 |
| | | config = UtilsUpdate.updateSubTable(config) |
| | |
| | | _logcolumns.push(col) |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { |
| | | statFields.push(col) |
| | | } |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | |
| | | config.setting.execute = config.setting.default !== 'false' // 默认sql是否执行,转为boolean 统一格式 |
| | | config.setting.customScript = '' // 自定义脚本 |
| | | |
| | | if (config.setting.interType === 'system') { |
| | | if (config.setting.scripts && config.setting.scripts.length > 0) { |
| | | let _customScript = '' |
| | | config.setting.scripts.forEach(item => { |
| | |
| | | config.setting.dataresource = config.setting.dataresource.replace(/@\$|\$@/ig, '') |
| | | config.setting.customScript = config.setting.customScript.replace(/@\$|\$@/ig, '') |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | loadingview: false, |
| | | chartId: chartId, |
| | | config: config, |
| | | statFields: statFields, |
| | | setting: config.setting, |
| | | searchlist: config.search, |
| | | actions: _actions, |
| | |
| | | }, () => { |
| | | if (config.setting.onload !== 'false' && (!Tab.supMenu || BID || Tab.isTreeNode) && valid) { // 初始化可加载 |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 获取合计字段值 |
| | | */ |
| | | getStatFieldsValue = (bid, type) => { |
| | | const { mainSearch } = this.props |
| | | const { setting, search, orderBy, statFields } = this.state |
| | | |
| | | let _BID = this.props.BID |
| | | let searches = fromJS(search).toJS() |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | searches = [...mainSearch, ...searches] |
| | | } |
| | | |
| | | 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 |
| | | } |
| | | |
| | | if (type === 'refresh') { |
| | | if (!bid) { // 主表ID不存在时,不查询子表合计值 |
| | | this.setState({ |
| | | statFValue: [] |
| | | }) |
| | | return |
| | | } else { |
| | | _BID = bid |
| | | } |
| | | } |
| | | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getStatQueryDataParams(setting, statFields, searches, _orderBy, _BID, this.props.menuType, this.props.dataManager) |
| | | |
| | | 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) { |
| | | values.push({label: item.label, value: _data[item.field]}) |
| | | } |
| | | }) |
| | | } |
| | | this.setState({ |
| | | statFValue: values |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | statFValue: [] |
| | | }) |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 搜索条件改变时,重置表格数据 |
| | | * 含有初始不加载的页面,修改设置 |
| | | */ |
| | |
| | | selectedData: [], |
| | | }, () => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } |
| | | |
| | |
| | | resetTable: !this.state.resetTable |
| | | }, () => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } |
| | | |
| | |
| | | total={this.state.total} |
| | | MenuID={this.props.MenuID} |
| | | loading={this.state.loading} |
| | | statFValue={this.state.statFValue} |
| | | refreshdata={this.refreshbytable} |
| | | buttonTrigger={this.buttonTrigger} |
| | | handleTableId={this.handleTableId} |
| | |
| | | orderBy: '', // 排序 |
| | | search: '', // 搜索条件数组,使用时需分场景处理 |
| | | triggerBtn: null, // 按钮触发 |
| | | chartId: '' // 展开图表ID |
| | | chartId: '', // 展开图表ID |
| | | statFields: [], // 合计字段 |
| | | statFValue: [] // 合计值 |
| | | } |
| | | |
| | | /** |
| | |
| | | let _logcolumns = [] // 日志显示列 |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() |
| | | let statFields = [] // 合计字段信息 |
| | | |
| | | // 版本兼容 |
| | | config = UtilsUpdate.updateSubTable(config) |
| | |
| | | _logcolumns.push(col) |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { |
| | | statFields.push(col) |
| | | } |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | |
| | | config.setting.execute = config.setting.default !== 'false' // 默认sql是否执行,转为boolean 统一格式 |
| | | config.setting.customScript = '' // 自定义脚本 |
| | | |
| | | if (config.setting.interType === 'system') { |
| | | if (config.setting.scripts && config.setting.scripts.length > 0) { |
| | | let _customScript = '' |
| | | config.setting.scripts.forEach(item => { |
| | |
| | | config.setting.dataresource = config.setting.dataresource.replace(/@\$|\$@/ig, '') |
| | | config.setting.customScript = config.setting.customScript.replace(/@\$|\$@/ig, '') |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | loadingview: false, |
| | | chartId: chartId, |
| | | config: config, |
| | | statFields: statFields, |
| | | setting: config.setting, |
| | | searchlist: config.search, |
| | | actions: _actions, |
| | |
| | | }, () => { |
| | | if (config.setting.onload !== 'false' && valid) { // 初始化可加载 |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 获取合计字段值 |
| | | */ |
| | | getStatFieldsValue = () => { |
| | | const { mainSearch, BID } = this.props |
| | | const { setting, search, orderBy, statFields } = this.state |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | searches = [...mainSearch, ...searches] |
| | | } |
| | | |
| | | 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, searches, _orderBy, BID, this.props.menuType, this.props.dataManager) |
| | | |
| | | 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) { |
| | | values.push({label: item.label, value: _data[item.field]}) |
| | | } |
| | | }) |
| | | } |
| | | this.setState({ |
| | | statFValue: values |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | statFValue: [] |
| | | }) |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 搜索条件改变时,重置表格数据 |
| | | * 含有初始不加载的页面,修改设置 |
| | | */ |
| | |
| | | resetTable: !this.state.resetTable |
| | | }, () => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } |
| | | |
| | |
| | | resetTable: !this.state.resetTable |
| | | }, () => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } |
| | | |
| | |
| | | total={this.state.total} |
| | | MenuID={this.props.MenuID} |
| | | loading={this.state.loading} |
| | | statFValue={this.state.statFValue} |
| | | refreshdata={this.refreshbytable} |
| | | buttonTrigger={this.buttonTrigger} |
| | | resetTable={this.state.resetTable} |
| | |
| | | import {connect} from 'react-redux' |
| | | import { Table, message, Affix, Button, Typography, Modal, Icon } from 'antd' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import { modifyTabview } from '@/store/action' |
| | | import '@/assets/css/table.scss' |
| | | import './index.scss' |
| | |
| | | static propTpyes = { |
| | | tableId: PropTypes.string, // 列表Id |
| | | resetTable: PropTypes.bool, // 表格重置 |
| | | statFValue: PropTypes.any, // 合计字段数据 |
| | | pageSize: PropTypes.any, // 每页数据 |
| | | dict: PropTypes.object, // 字典项 |
| | | config: PropTypes.object, // 页面配置 |
| | |
| | | imgSrc: '', // 图片路径 |
| | | lineMarks: null, // 行标记 |
| | | colMap: null, // 列信息(全部) |
| | | activeIndex: null // 标记当前选中行 |
| | | activeIndex: null, // 标记当前选中行 |
| | | rowspan: null // 行合并字段信息 |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | let colMap = new Map() // 用于获取字段信息 |
| | | let radio = 5 // 虚化比例 |
| | | let _format = false // 是否虚化处理 |
| | | let rowspan = null |
| | | |
| | | if (window.GLOB.dataFormat && menuType !== 'HS' && memberLevel) { |
| | | _format = true |
| | |
| | | } |
| | | } |
| | | |
| | | let cell = { |
| | | let cell = null |
| | | |
| | | if (item.type === 'colspan' && item.unfold === 'true') { |
| | | cell = {title: item.label, children: []} |
| | | |
| | | item.subColumn.forEach(col => { |
| | | |
| | | if (col.rowspan === 'true') { |
| | | rowspan = col |
| | | } |
| | | |
| | | cell.children.push({ |
| | | align: col.Align, |
| | | title: col.label, |
| | | dataIndex: col.field || col.uuid, |
| | | key: col.uuid, |
| | | width: col.Width || 120, |
| | | render: (text, record) => { |
| | | return this.getContent(col, record) |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | if (item.rowspan === 'true') { |
| | | rowspan = item |
| | | } |
| | | |
| | | cell = { |
| | | align: item.Align, |
| | | dataIndex: item.field || item.uuid, |
| | | title: item.label, |
| | |
| | | width: item.Width || 120, |
| | | render: (text, record) => { |
| | | return this.getContent(item, record) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | columns: _columns, |
| | | pageSize: pageSize ? pageSize : 10, |
| | | lineMarks: lineMarks, |
| | | colMap: colMap |
| | | colMap: colMap, |
| | | rowspan: rowspan |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (item.linkThdMenu) { |
| | | if (item.rowspan === 'true') { |
| | | return { |
| | | children: ( |
| | | <div className={className}> |
| | | <div className="baseboard link-menu" onDoubleClick={() => this.triggerLink(item, record)}></div> |
| | | <div className="content link-menu" style={{ minWidth: (item.Width || 120) + 'px' }} onDoubleClick={() => this.triggerLink(item, record)}> |
| | | {content} |
| | | </div> |
| | | </div> |
| | | ), |
| | | props: { |
| | | rowSpan: record.$$rowspan, |
| | | } |
| | | } |
| | | } |
| | | return ( |
| | | <div className={className}> |
| | | <div className="baseboard link-menu" onDoubleClick={() => this.triggerLink(item, record)}></div> |
| | |
| | | </div> |
| | | ) |
| | | } else { |
| | | if (item.rowspan === 'true') { |
| | | return { |
| | | children: ( |
| | | <div className={className}> |
| | | <div className="baseboard"></div> |
| | | <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}> |
| | | {content} |
| | | </div> |
| | | </div> |
| | | ), |
| | | props: { |
| | | rowSpan: record.$$rowspan, |
| | | } |
| | | } |
| | | } |
| | | return ( |
| | | <div className={className}> |
| | | <div className="baseboard"></div> |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { setting, pickup } = this.props |
| | | const { selectedRowKeys, lineMarks, colMap, activeIndex } = this.state |
| | | const { setting, pickup, statFValue } = this.props |
| | | const { selectedRowKeys, lineMarks, colMap, activeIndex, rowspan } = this.state |
| | | |
| | | // 设置表格选择属性:单选、多选、不可选 |
| | | let rowSelection = null |
| | |
| | | _data = _data.filter((item, index) => selectedRowKeys.includes(index)) |
| | | } |
| | | |
| | | if (rowspan) { |
| | | let marks = {} |
| | | let premark = {val: '', mark: ''} |
| | | _data = _data.map(item => { |
| | | if (item[rowspan.field]) { |
| | | if (item[rowspan.field] !== premark.val) { |
| | | premark = {val: item[rowspan.field], mark: Utils.getuuid()} |
| | | |
| | | marks[premark.mark] = 1 |
| | | item.$$mark = premark.mark |
| | | } else { |
| | | marks[premark.mark]++ |
| | | item.$$mark = premark.mark |
| | | } |
| | | } else { |
| | | item.$$rowspan = 1 |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | _data = _data.map(item => { |
| | | if (item.$$mark) { |
| | | item.$$rowspan = marks[item.$$mark] |
| | | marks[item.$$mark] = 0 |
| | | } |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | let _pagination = false |
| | | if (setting.laypage !== 'false') { |
| | | _pagination = { |
| | |
| | | total: this.props.total, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} ${this.props.dict['main.pagination.of']} ${total} ${this.props.dict['main.pagination.items']}` |
| | | } |
| | | } |
| | | |
| | | let _footer = '' |
| | | |
| | | if (statFValue && statFValue.length > 0) { |
| | | _footer = statFValue.map(f => `${f.label}(合计):${f.value}`).join(';') |
| | | } |
| | | |
| | | return ( |
| | |
| | | onChange={this.changeTable} |
| | | pagination={_pagination} |
| | | /> |
| | | {_footer ? <div className={'normal-table-footer ' + (_pagination ? 'pagination' : '')}>{_footer}</div> : null} |
| | | <Modal |
| | | className="image-scale-modal" |
| | | visible={this.state.imgShow} |
| | |
| | | .normal-data-table { |
| | | position: relative; |
| | | padding: 0 0px 30px; |
| | | |
| | | .normal-table-footer { |
| | | padding: 10px 0px; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | } |
| | | .normal-table-footer.pagination { |
| | | position: absolute; |
| | | bottom: 40px; |
| | | } |
| | | >.ant-table-wrapper { |
| | | position: relative; |
| | | z-index: 1; |
| | | } |
| | | |
| | | table { |
| | | max-width: 100%; |
| | | width: 100%; |
| | |
| | | .ant-table-body { |
| | | overflow-x: auto!important; |
| | | min-height: 90px; |
| | | border: 1px solid #e8e8e8; |
| | | border-radius: 4px; |
| | | border-top: none; |
| | | border-bottom: none; |
| | | table { |
| | | border-left: 0; |
| | | .ant-table-thead > tr > th:last-child { |
| | | border-right: 0; |
| | | } |
| | | .ant-table-tbody > tr > td:last-child { |
| | | border-right: 0; |
| | | } |
| | | .ant-table-tbody > tr > td { |
| | | vertical-align: top; |
| | | .content { |
| | |
| | | if (type === 'copy') { |
| | | card.originUuid = card.uuid |
| | | card.uuid = Utils.getuuid() |
| | | card.label = card.label + '(copy)' |
| | | card.field = card.field + '(copy)' |
| | | card.focus = true |
| | | |
| | | // 复制到剪切板 |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, InputNumber, Select, Radio } from 'antd' |
| | | import { Form, Row, Col, Input, InputNumber, Select, Radio, Tooltip, Icon } from 'antd' |
| | | import { formRule } from '@/utils/option.js' |
| | | import TransferForm from '@/templates/zshare/transferform' |
| | | import './index.scss' |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['model.name']}> |
| | | {getFieldDecorator('label', { |
| | | initialValue: this.props.card.label, |
| | | initialValue: card.label, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['model.form.align']}> |
| | | {getFieldDecorator('Align', { |
| | | initialValue: this.props.card.Align, |
| | | initialValue: card.Align, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['model.form.columnWidth']}> |
| | | {getFieldDecorator('Width', { |
| | | initialValue: this.props.card.Width, |
| | | initialValue: card.Width, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="选择显示分组,表格会展开添加分组的子列,此时排列方式会失效。"> |
| | | <Icon type="question-circle" /> |
| | | 显示分组 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('unfold', { |
| | | initialValue: card.unfold || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">{this.props.dict['model.true']}</Radio> |
| | | <Radio value="false">{this.props.dict['model.false']}</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['model.hidden']}> |
| | | {getFieldDecorator('Hide', { |
| | | initialValue: this.props.card.Hide || 'false', |
| | | initialValue: card.Hide || 'false', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['header.form.order']}> |
| | | {getFieldDecorator('order', { |
| | | initialValue: this.props.card.order, |
| | | initialValue: card.order, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <TransferForm columns={this.props.columns} ref="column-transfer" selected={this.props.card.sublist}/> |
| | | <TransferForm columns={this.props.columns} ref="column-transfer" selected={card.sublist}/> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | |
| | | width: 100%; |
| | | } |
| | | } |
| | | .anticon-question-circle { |
| | | color: #c49f47; |
| | | position: relative; |
| | | left: -3px; |
| | | } |
| | | } |
| | |
| | | import './index.scss' |
| | | |
| | | const columnTypeOptions = { |
| | | text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'fieldlength', 'blacklist', 'linkmenu'], |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'linkmenu'], |
| | | text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'fieldlength', 'blacklist', 'linkmenu', 'rowspan'], |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'linkmenu', 'sum'], |
| | | link: ['label', 'field', 'type', 'nameField', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'fieldlength', 'blacklist'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale', 'maxHeight'] |
| | |
| | | } else if (item.type === 'radio') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | |
| | | this.columnFormRef.handleConfirm().then(res => { |
| | | let fieldrepet = false // 字段重复 |
| | | let labelrepet = false // 提示文字重复 |
| | | let rowspanLabel = '' // 已存在的行合并字段 |
| | | |
| | | _columnlist = _columnlist.filter(item => !item.origin || item.uuid === res.uuid) // 去除初始列 |
| | | |
| | |
| | | fieldrepet = true |
| | | } else if (item.label === res.label) { |
| | | labelrepet = true |
| | | } else if (res.rowspan === 'true' && item.rowspan === 'true') { |
| | | rowspanLabel = item.label |
| | | } |
| | | } |
| | | |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (rowspanLabel) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: `已存在行合并字段《${rowspanLabel}》!`, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (!card.focus && (card.type !== res.type || (res.field && card.field !== res.field))) { |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'rowspan', |
| | | label: '行合并', |
| | | initVal: card.rowspan || 'false', |
| | | tooltip: '相邻行信息相同时,单元格合并。注:为防止表格信息错乱,行合并只能添加一个字段。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'sum', |
| | | label: '显示合计', |
| | | initVal: card.sum || 'false', |
| | | tooltip: '合计信息只在使用系统数据源,且当前列未隐藏时有效。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'decimal', |
| | | min: 0, |
| | |
| | | |
| | | return param |
| | | } |
| | | |
| | | /** |
| | | * @description 获取系统存储过程 sPC_Get_TableData 合计值的参数 |
| | | */ |
| | | static getStatQueryDataParams (setting, statFields, search, orderBy, pageIndex, pageSize, menuType, dataManager) { |
| | | let param = { |
| | | func: 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | | arr_field: statFields.map(col => col.field).join(','), |
| | | default_sql: setting.execute ? 'true' : 'false' |
| | | } |
| | | |
| | | let _dataresource = setting.dataresource |
| | | let _customScript = '' |
| | | |
| | | if (setting.customScript) { |
| | | _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) select @ErrorCode='',@retmsg ='' |
| | | ${setting.customScript} |
| | | ` |
| | | } |
| | | |
| | | let regoptions = null |
| | | if (setting.queryType === 'statistics' || _customScript) { |
| | | let allSearch = Utils.getAllSearchOptions(search) |
| | | |
| | | regoptions = allSearch.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${item.value}'` |
| | | } |
| | | }) |
| | | regoptions.push({ |
| | | reg: new RegExp('@orderBy@', 'ig'), |
| | | value: orderBy |
| | | }, { |
| | | reg: new RegExp('@pageSize@', 'ig'), |
| | | value: 999999 |
| | | }, { |
| | | reg: new RegExp('@pageIndex@', 'ig'), |
| | | value: 1 |
| | | }) |
| | | } |
| | | |
| | | let _search = Utils.joinMainSearchkey(search) |
| | | if (_search) { |
| | | _search = 'where ' + _search |
| | | } |
| | | |
| | | if (setting.queryType === 'statistics') { // 统计数据源,内容替换 |
| | | regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | }) |
| | | } |
| | | |
| | | if (_customScript) { |
| | | regoptions.forEach(item => { |
| | | _customScript = _customScript.replace(item.reg, item.value) |
| | | }) |
| | | } |
| | | |
| | | let LText = ` select ${statFields.map(col => `sum(${col.field}) as ${col.field}`).join(',')} from ${_dataresource} ${_search} ` |
| | | |
| | | if (_customScript) { |
| | | LText = `${LText} |
| | | aaa: |
| | | if @ErrorCode!='' |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ |
| | | ` |
| | | } |
| | | |
| | | // 测试系统打印查询语句 |
| | | if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) { |
| | | _customScript && console.log(`${LText ? '' : '/*不执行默认sql*/\n'}${_customScript}`) |
| | | LText && console.log(LText) |
| | | } |
| | | |
| | | param.custom_script = Utils.formatOptions(_customScript) |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.DateCount = '' |
| | | |
| | | if (menuType === 'HS') { // 云端数据验证 |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | } |
| | | |
| | | // 数据管理权限 |
| | | if (dataManager) { |
| | | param.dataM = 'Y' |
| | | } |
| | | |
| | | return param |
| | | } |
| | | } |