| | |
| | | sessionStorage.setItem('CloudUserName', res.UserName) |
| | | sessionStorage.setItem('CloudFullName', res.FullName) |
| | | sessionStorage.setItem('CloudAvatar', res.icon) |
| | | |
| | | sessionStorage.setItem('cloudDataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('localDataM', sessionStorage.setItem('dataM') || '') |
| | | |
| | | sessionStorage.setItem('cloudRole_id', res.role_id || '') |
| | | sessionStorage.setItem('localRole_id', sessionStorage.getItem('role_id') || '') |
| | | |
| | | sessionStorage.setItem('role_id', res.role_id || '') |
| | | sessionStorage.setItem('dataM', res.dataM ? 'true' : '') |
| | |
| | | _param.Full_Name && sessionStorage.setItem('Full_Name', _param.Full_Name) |
| | | _param.debug && sessionStorage.setItem('debug', _param.debug) |
| | | _param.dataM && sessionStorage.setItem('dataM', _param.dataM) |
| | | _param.dataM && sessionStorage.setItem('localDataM', _param.dataM) |
| | | _param.avatar && sessionStorage.setItem('avatar', _param.avatar) |
| | | _param.role_id && sessionStorage.setItem('role_id', _param.role_id) |
| | | _param.dataM && sessionStorage.setItem('localRole_id', _param.dataM) |
| | | _param.Member_Level && sessionStorage.setItem('Member_Level', _param.Member_Level) |
| | | |
| | | if (_param.mainlogo) { |
| | |
| | | searchlist: null, // 搜索条件 |
| | | actions: null, // 按钮集 |
| | | columns: null, // 显示列 |
| | | logcolumns: null, // 日志中显示的列信息 (增加至全部列,除去合并列) |
| | | arr_field: '', // 使用 sPC_Get_TableData 时的查询字段集 |
| | | setting: null, // 页面全局设置:数据源、按钮及显示列固定、主键等 |
| | | data: null, // 列表数据集 |
| | |
| | | |
| | | let _arrField = [] // 字段集 |
| | | let _columns = [] // 显示列 |
| | | let _logcolumns = [] // 日志显示列 |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() // 用于字段过滤 |
| | | let statFields = [] // 合计字段信息 |
| | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | _logcolumns.push(col) |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { |
| | |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | | } else if (col.Hide === 'true') { |
| | | _hideCol.push(col.uuid) |
| | | } |
| | | colMap.set(col.uuid, col) |
| | | }) |
| | |
| | | |
| | | col.sort = index |
| | | |
| | | if (col.type === 'colspan' && col.sublist) { |
| | | if (col.type === 'colspan') { |
| | | if (col.unfold !== 'true') { // 不展开为旧版合并列 |
| | | col.type = 'old_colspan' |
| | | } |
| | | |
| | | let _col = fromJS(col).toJS() |
| | | let subcols = [] |
| | | _col.sublist.forEach(sub => { |
| | | _col.sublist && _col.sublist.forEach(sub => { |
| | | if (colMap.has(sub)) { |
| | | subcols.push(colMap.get(sub)) |
| | | } |
| | |
| | | searchlist: config.search, |
| | | actions: _actions, |
| | | columns: _columns, |
| | | logcolumns: _logcolumns, |
| | | arr_field: _arrField.join(','), |
| | | search: Utils.initMainSearch(initSearch) // 搜索条件初始化(含有时间格式,需要转化) |
| | | }, () => { |
| | |
| | | BID={BID} |
| | | setting={setting} |
| | | actions={actions} |
| | | columns={columns} |
| | | MenuName={MenuName} |
| | | dict={this.state.dict} |
| | | MenuID={this.props.MenuID} |
| | | selectedData={selectedData} |
| | | logcolumns={this.state.logcolumns} |
| | | ContainerId={this.state.ContainerId} |
| | | refreshdata={this.refreshbyaction} |
| | | getexceloutparam={this.getexceloutparam} |
| | |
| | | tableId="mainTable" |
| | | BID={BID} |
| | | pickup={pickup} |
| | | config={config} |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuName={MenuName} |
| | |
| | | MenuID={this.props.MenuID} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | logcolumns={this.state.logcolumns} |
| | | statFValue={this.state.statFValue} |
| | | handleTableId={this.handleTableId} |
| | | ContainerId={this.state.ContainerId} |
| | |
| | | BID={BID} |
| | | plot={item} |
| | | config={config} |
| | | columns={columns} |
| | | MenuName={MenuName} |
| | | tableId="mainTable" |
| | | data={this.state.data} |
| | | MenuID={this.props.MenuID} |
| | | loading={this.state.loading} |
| | | logcolumns={this.state.logcolumns} |
| | | ContainerId={this.state.ContainerId} |
| | | refreshdata={this.refreshbyaction} |
| | | getexceloutparam={this.getexceloutparam} |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .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; |
| | | } |
| | | } |
| | | } |
| | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | | } else if (col.Hide === 'true') { |
| | | _hideCol.push(col.uuid) |
| | | } |
| | | colMap.set(col.uuid, col) |
| | | }) |
| | |
| | | config.columns.forEach(col => { |
| | | if (_hideCol.includes(col.uuid)) return |
| | | |
| | | if (col.type === 'colspan' && col.sublist) { |
| | | let _col = JSON.parse(JSON.stringify(col)) |
| | | if (col.type === 'colspan') { |
| | | if (col.unfold !== 'true') { // 不展开为旧版合并列 |
| | | col.type = 'old_colspan' |
| | | } |
| | | |
| | | let _col = fromJS(col).toJS() |
| | | let subcols = [] |
| | | _col.sublist.forEach(sub => { |
| | | _col.sublist && _col.sublist.forEach(sub => { |
| | | if (colMap.has(sub)) { |
| | | subcols.push(colMap.get(sub)) |
| | | } |
| | |
| | | <SubTable |
| | | tableId={this.props.Tab.uuid} |
| | | pickup={pickup} |
| | | config={config} |
| | | setting={setting} |
| | | columns={columns} |
| | | dict={this.state.dict} |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="ant-advanced-search-form top-search" id={this.state.formId} onSubmit={this.handleSearch}> |
| | | <Form {...formItemLayout} className="header-top-search" id={this.state.formId} onSubmit={this.handleSearch}> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |
| | |
| | | .ant-advanced-search-form.top-search { |
| | | .header-top-search { |
| | | padding: 0px 24px 10px; |
| | | border-bottom: 1px solid #efefef; |
| | | .ant-form-item { |
| | |
| | | .ant-advanced-search-form.top-search { |
| | | padding: 0px 24px 10px; |
| | | border-bottom: 1px solid #efefef; |
| | | .ant-form-item { |
| | | display: flex; |
| | | margin-bottom: 0px; |
| | | min-height: 60px; |
| | | .ant-form-explain { |
| | | white-space: nowrap; |
| | | } |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | flex: 1; |
| | | width: calc(100% - 100px); |
| | | } |
| | | .ant-form-item-label { |
| | | // width: 100px; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .daterange .ant-calendar-picker-input { |
| | | padding: 4px 20px 4px 5px; |
| | | font-size: 13px; |
| | | } |
| | | .ant-select-dropdown { |
| | | z-index: 10 !important; |
| | | } |
| | | .ant-calendar-picker-container { |
| | | z-index: 10 !important; |
| | | } |
| | | .group-required { |
| | | label::before { |
| | | display: inline-block; |
| | | margin-right: 4px; |
| | | color: #f5222d; |
| | | font-size: 14px; |
| | | font-family: SimSun, sans-serif; |
| | | line-height: 1; |
| | | content: '*'; |
| | | } |
| | | } |
| | | } |
| | |
| | | searchlist: null, // 搜索条件 |
| | | actions: null, // 按钮集 |
| | | columns: null, // 显示列 |
| | | logcolumns: null, // 日志中显示的列信息 (增加至全部列,除去合并列) |
| | | arr_field: '', // 使用 sPC_Get_TableData 时的查询字段集 |
| | | setting: null, // 页面全局设置:数据源、按钮及显示列固定、主键等 |
| | | data: null, // 列表数据集 |
| | |
| | | } |
| | | return item |
| | | }) |
| | | } else if (column.type === 'colspan') { |
| | | column.unfold = 'true' |
| | | } else if (column.type === 'action') { |
| | | column.operations = column.elements |
| | | } |
| | |
| | | |
| | | render() { |
| | | const { MenuName } = this.props |
| | | const { BID, setting, searchlist, pageSize, actions, columns, pickup, config, selectedData } = this.state |
| | | const { BID, setting, searchlist, pageSize, actions, config, columns, pickup, selectedData } = this.state |
| | | |
| | | return ( |
| | | <div className="commontable"> |
| | | <div className="custom-normal-table"> |
| | | {searchlist && searchlist.length > 0 ? |
| | | <MainSearch |
| | | BID={BID} |
| | |
| | | BID={BID} |
| | | setting={setting} |
| | | actions={actions} |
| | | columns={config.columns} |
| | | MenuName={MenuName} |
| | | dict={this.state.dict} |
| | | MenuID={this.props.MenuID} |
| | | selectedData={selectedData} |
| | | logcolumns={this.state.logcolumns} |
| | | refreshdata={this.refreshbyaction} |
| | | getexceloutparam={this.getexceloutparam} |
| | | /> |
| | |
| | | tableId="mainTable" |
| | | BID={BID} |
| | | pickup={pickup} |
| | | config={config} |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuName={MenuName} |
| | | pageSize={pageSize} |
| | | dict={this.state.dict} |
| | | data={this.state.data} |
| | | fields={config.columns} |
| | | 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} |
| | |
| | | .commontable { |
| | | .custom-normal-table { |
| | | position: relative; |
| | | min-height: calc(100vh - 94px); |
| | | padding-top: 16px; |
| | | padding-bottom: 80px; |
| | | .box404 { |
| | | padding-top: 30px; |
| | | |
| | | .top-search { |
| | | padding: 0; |
| | | } |
| | | .commontable-main-action { |
| | | min-height: 25px; |
| | |
| | | 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; |
| | | right: 5px; |
| | | top: -22px; |
| | | z-index: 1; |
| | | } |
| | |
| | | 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; |
| | | } |
| | | padding: 0; |
| | | } |
| | | } |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction, param } = this.props |
| | | const { permAction, permMenus, param } = this.props |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | |
| | | // 权限过滤 |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | if (this.props.menuType !== 'HS') { |
| | | config.components = this.filterComponent(config.components, roleId) |
| | | } |
| | | config.components = this.filterComponent(config.components, roleId, permAction, permMenus) |
| | | |
| | | // 获取主搜索条件 |
| | | let mainSearch = [] |
| | |
| | | inherit.cacheTime = config.cacheTime |
| | | } |
| | | |
| | | config.components = this.formatSetting(config.components, params, mainSearch, permAction, inherit) |
| | | config.components = this.formatSetting(config.components, params, mainSearch, inherit) |
| | | |
| | | this.setState({ |
| | | BID: BID, |
| | |
| | | } |
| | | } |
| | | |
| | | filterComponent = (components, roleId) => { |
| | | filterComponent = (components, roleId, permAction, permMenus) => { |
| | | return components.filter(item => { |
| | | if (item.type === 'tabs') { |
| | | if ( |
| | |
| | | } |
| | | |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.components = this.filterComponent(tab.components, roleId) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | return false |
| | | } |
| | | } |
| | | // 搜索黑名单过滤 |
| | | if (item.search && item.search.length > 0) { |
| | | item.search = item.search.map(cell => { |
| | | cell.oriInitval = cell.initval |
| | |
| | | return item |
| | | }) |
| | | } |
| | | if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | item.cols = item.cols.map(col => { |
| | | if (!col.blacklist || col.blacklist.length === 0) return col |
| | | if (col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | | col.Hide = 'true' |
| | | } |
| | | |
| | | if (col.Hide !== 'true' && col.linkmenu && col.linkmenu.length > 0) { |
| | | let menu_id = col.linkmenu.slice(-1)[0] |
| | | col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | } else { |
| | | col.linkThdMenu = '' |
| | | } |
| | | |
| | | return col |
| | | }) |
| | | } |
| | | // 权限过滤 |
| | | if (this.props.menuType !== 'HS') { |
| | | if (item.action && item.action.length > 0) { |
| | | item.action = item.action.filter(cell => permAction[cell.uuid]) |
| | | } |
| | | if (item.type === 'card') { |
| | | item.subcards.forEach(card => { |
| | | card.elements = card.elements.filter(cell => cell.eleType !== 'button' || permAction[cell.uuid]) |
| | | card.backElements = card.backElements.filter(cell => cell.eleType !== 'button' || permAction[cell.uuid]) |
| | | }) |
| | | } else if (item.type === 'table' && item.subtype === 'tablecard') { |
| | | item.subcards.forEach(card => { |
| | | card.elements = card.elements.filter(cell => cell.eleType !== 'button' || permAction[cell.uuid]) |
| | | }) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | item.cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | col.elements = col.elements.filter(cell => permAction[cell.uuid]) |
| | | }) |
| | | } |
| | | } |
| | | return true |
| | | }) |
| | | } |
| | | |
| | | // 格式化默认设置 |
| | | formatSetting = (components, params, mainSearch, permAction, inherit) => { |
| | | formatSetting = (components, params, mainSearch, inherit) => { |
| | | return components.map(component => { |
| | | if (component.type === 'tabs') { |
| | | component.subtabs = component.subtabs.map(tab => { |
| | | tab.components = this.formatSetting(tab.components, [], [], permAction, inherit) |
| | | tab.components = this.formatSetting(tab.components, [], [], inherit) |
| | | tab = {...tab, ...inherit} |
| | | return tab |
| | | }) |
| | | } |
| | | |
| | | // 权限过滤 |
| | | if (this.props.menuType !== 'HS') { |
| | | if (component.action) { |
| | | component.action = component.action.filter(item => permAction[item.uuid]) |
| | | } |
| | | } |
| | | |
| | | if (!component.setting) return component // 不使用系统函数时 |
| | |
| | | return { |
| | | menuType: state.editLevel, |
| | | refreshTab: state.refreshTab, |
| | | permAction: state.permAction |
| | | permAction: state.permAction, |
| | | permMenus: state.permMenus |
| | | } |
| | | } |
| | | |
| | |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | primaryId: PropTypes.string, // 主键 |
| | | actions: PropTypes.array, // 按钮组 |
| | | logcolumns: PropTypes.array, // 显示列 |
| | | dict: PropTypes.object, // 字典项 |
| | | data: PropTypes.any, // 数据 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | |
| | | * @description 按钮提交执行 |
| | | */ |
| | | execSubmit = (btn, data, _resolve, formdata) => { |
| | | const { setting, logcolumns, primaryId } = this.props |
| | | const { setting, primaryId } = this.props |
| | | |
| | | let _primaryId = primaryId |
| | | |
| | |
| | | |
| | | if (btn.sql && btn.sqlType === 'insert') { // 系统函数添加时,生成uuid |
| | | param.ID = Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns) // 数据源 |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | |
| | | _primaryId = param.ID |
| | | } else if (btn.sql && btn.sqlType === 'insertOrUpdate') { // 系统函数添加或修改时 |
| | | param.ID = primaryId || Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns) // 数据源 |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | |
| | | _primaryId = param.ID |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns) // 数据源 |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | |
| | | {hasform ? |
| | | <FormAction |
| | | menuType={this.props.menuType} |
| | | logcolumns={[]} |
| | | setting={setting} |
| | | actions={actions} |
| | | dict={this.state.dict} |
| | |
| | | Tab: PropTypes.any, // 如果当前元素为标签时,tab为标签信息 |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | actions: PropTypes.array, // 按钮组 |
| | | logcolumns: PropTypes.array, // 显示列 |
| | | dict: PropTypes.object, // 字典项 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | |
| | | actions: [], // 按钮集 |
| | | columns: [], // 显示列 |
| | | arr_field: '', // 使用 sPC_Get_TableData 时的查询字段集 |
| | | logcolumns: null, // 日志中显示的列信息 (增加至全部列,除去合并列) |
| | | setting: {}, // 页面全局设置:数据源、按钮及显示列固定、主键等 |
| | | data: [], // 列表数据集 |
| | | selectedData: [], // 已选表格数据 |
| | |
| | | |
| | | let _arrField = [] // 字段集 |
| | | let _columns = [] // 显示列 |
| | | let _logcolumns = [] // 日志显示列 |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() // 用于字段过滤 |
| | | |
| | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | |
| | | _logcolumns.push(col) |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | | } else if (col.Hide === 'true') { |
| | | _hideCol.push(col.uuid) |
| | | } |
| | | colMap.set(col.uuid, col) |
| | | }) |
| | |
| | | config.columns.forEach(col => { |
| | | if (_hideCol.includes(col.uuid)) return |
| | | |
| | | if (col.type === 'colspan' && col.sublist) { |
| | | let _col = JSON.parse(JSON.stringify(col)) |
| | | if (col.type === 'colspan') { |
| | | if (col.unfold !== 'true') { // 不展开为旧版合并列 |
| | | col.type = 'old_colspan' |
| | | } |
| | | |
| | | let _col = fromJS(col).toJS() |
| | | let subcols = [] |
| | | _col.sublist.forEach(sub => { |
| | | _col.sublist && _col.sublist.forEach(sub => { |
| | | if (colMap.has(sub)) { |
| | | subcols.push(colMap.get(sub)) |
| | | } |
| | |
| | | return item |
| | | }), |
| | | columns: _columns, |
| | | logcolumns: _logcolumns, |
| | | arr_field: _arrField.join(','), |
| | | search: Utils.initMainSearch(config.search) |
| | | }, () => { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { dict, searchlist, config, setting, actions, columns, pickup, selectedData } = this.state |
| | | const { dict, searchlist, setting, actions, columns, pickup, selectedData } = this.state |
| | | |
| | | return ( |
| | | <div className="script-manage-table" id={this.state.ContainerId}> |
| | |
| | | dict={this.state.dict} |
| | | MenuID={this.props.MenuID} |
| | | selectedData={selectedData} |
| | | logcolumns={this.state.logcolumns} |
| | | ContainerId={this.state.ContainerId} |
| | | refreshdata={this.refreshbyaction} |
| | | /> |
| | |
| | | <MainTable |
| | | tableId="mainTable" |
| | | pickup={pickup} |
| | | config={config} |
| | | setting={setting} |
| | | columns={columns} |
| | | dict={this.state.dict} |
| | |
| | | searchlist: null, // 搜索条件 |
| | | actions: null, // 按钮集 |
| | | columns: null, // 显示列 |
| | | logcolumns: null, // 日志中显示的列信息 (增加至全部列,除去合并列) |
| | | arr_field: '', // 使用 sPC_Get_TableData 时的查询字段集 |
| | | setting: null, // 页面全局设置:数据源、按钮及显示列固定、主键等 |
| | | data: null, // 列表数据集 |
| | |
| | | |
| | | let _arrField = [] // 字段集 |
| | | let _columns = [] // 显示列 |
| | | let _logcolumns = [] // 日志显示列 |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() |
| | | let statFields = [] // 合计字段信息 |
| | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | _logcolumns.push(col) |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { |
| | |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | | } else if (col.Hide === 'true') { |
| | | _hideCol.push(col.uuid) |
| | | } |
| | | colMap.set(col.uuid, col) |
| | | }) |
| | |
| | | |
| | | col.sort = index |
| | | |
| | | if (col.type === 'colspan' && col.sublist) { |
| | | let _col = JSON.parse(JSON.stringify(col)) |
| | | if (col.type === 'colspan') { |
| | | if (col.unfold !== 'true') { // 不展开为旧版合并列 |
| | | col.type = 'old_colspan' |
| | | } |
| | | |
| | | let _col = fromJS(col).toJS() |
| | | let subcols = [] |
| | | _col.sublist.forEach(sub => { |
| | | _col.sublist && _col.sublist.forEach(sub => { |
| | | if (colMap.has(sub)) { |
| | | subcols.push(colMap.get(sub)) |
| | | } |
| | |
| | | searchlist: config.search, |
| | | actions: _actions, |
| | | columns: _columns, |
| | | logcolumns: _logcolumns, |
| | | arr_field: _arrField.join(','), |
| | | search: Utils.initMainSearch(config.search) // 搜索条件初始化(含有时间格式,需要转化) |
| | | }, () => { |
| | |
| | | <SubAction |
| | | setting={setting} |
| | | actions={actions} |
| | | columns={columns} |
| | | Tab={this.props.Tab} |
| | | BID={this.props.BID} |
| | | BData={this.props.BData} |
| | | MenuID={this.props.MenuID} |
| | | selectedData={selectedData} |
| | | MenuName={this.props.Tab.label} |
| | | logcolumns={this.state.logcolumns} |
| | | refreshdata={this.refreshbyaction} |
| | | ContainerId={this.props.ContainerId} |
| | | getexceloutparam={this.getexceloutparam} |
| | |
| | | <SubTable |
| | | tableId={this.props.Tab.uuid} |
| | | pickup={pickup} |
| | | config={config} |
| | | setting={setting} |
| | | columns={columns} |
| | | pageSize={pageSize} |
| | |
| | | loading={this.state.loading} |
| | | MenuName={this.props.Tab.label} |
| | | refreshdata={this.refreshbytable} |
| | | logcolumns={this.state.logcolumns} |
| | | statFValue={this.state.statFValue} |
| | | handleTableId={this.handleTableId} |
| | | ContainerId={this.props.ContainerId} |
| | |
| | | <CardComponent |
| | | plot={item} |
| | | config={config} |
| | | columns={columns} |
| | | Tab={this.props.Tab} |
| | | BID={this.props.BID} |
| | | BData={this.props.BData} |
| | |
| | | loading={this.state.loading} |
| | | tableId={this.props.Tab.uuid} |
| | | MenuName={this.props.Tab.label} |
| | | logcolumns={this.state.logcolumns} |
| | | refreshdata={this.refreshbyaction} |
| | | handleTableId={this.handleTableId} |
| | | getexceloutparam={this.getexceloutparam} |
| | |
| | | searchlist: null, // 搜索条件 |
| | | actions: null, // 按钮集 |
| | | columns: null, // 显示列 |
| | | logcolumns: null, // 日志中显示的列信息 (增加至全部列,除去合并列) |
| | | arr_field: '', // 使用 sPC_Get_TableData 时的查询字段集 |
| | | setting: null, // 页面全局设置:数据源、按钮及显示列固定、主键等 |
| | | data: null, // 列表数据集 |
| | |
| | | |
| | | let _arrField = [] // 字段集 |
| | | let _columns = [] // 显示列 |
| | | let _logcolumns = [] // 日志显示列 |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() |
| | | let statFields = [] // 合计字段信息 |
| | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | _logcolumns.push(col) |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { |
| | |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | | } else if (col.Hide === 'true') { |
| | | _hideCol.push(col.uuid) |
| | | } |
| | | colMap.set(col.uuid, col) |
| | | }) |
| | |
| | | |
| | | col.linkThdMenu = '' // 弹窗中不可使用字段透视 |
| | | |
| | | if (col.type === 'colspan' && col.sublist) { |
| | | let _col = JSON.parse(JSON.stringify(col)) |
| | | if (col.type === 'colspan') { |
| | | if (col.unfold !== 'true') { // 不展开为旧版合并列 |
| | | col.type = 'old_colspan' |
| | | } |
| | | |
| | | let _col = fromJS(col).toJS() |
| | | let subcols = [] |
| | | _col.sublist.forEach(sub => { |
| | | _col.sublist && _col.sublist.forEach(sub => { |
| | | if (colMap.has(sub)) { |
| | | subcols.push(colMap.get(sub)) |
| | | } |
| | |
| | | searchlist: config.search, |
| | | actions: _actions, |
| | | columns: _columns, |
| | | logcolumns: _logcolumns, |
| | | arr_field: _arrField.join(','), |
| | | search: Utils.initMainSearch(config.search) // 搜索条件初始化(含有时间格式,需要转化) |
| | | }, () => { |
| | |
| | | <SubAction |
| | | setting={setting} |
| | | actions={actions} |
| | | columns={columns} |
| | | BID={this.props.BID} |
| | | dict={this.state.dict} |
| | | BData={this.props.BData} |
| | | selectedData={selectedData} |
| | | MenuID={this.props.SupMenuID} |
| | | MenuName={this.props.Tab.label} |
| | | logcolumns={this.state.logcolumns} |
| | | refreshdata={this.refreshbyaction} |
| | | getexceloutparam={this.getexceloutparam} |
| | | /> |
| | | </div> |
| | | <SubTable |
| | | tableId={this.props.Tab.uuid} |
| | | config={config} |
| | | setting={setting} |
| | | columns={columns} |
| | | pageSize={pageSize} |
| | |
| | | loading={this.state.loading} |
| | | MenuName={this.props.Tab.label} |
| | | refreshdata={this.refreshbytable} |
| | | logcolumns={this.state.logcolumns} |
| | | statFValue={this.state.statFValue} |
| | | refreshbyaction={this.refreshbyaction} |
| | | chgSelectData={this.changeSelectedData} |
| | |
| | | tableId="" |
| | | plot={item} |
| | | config={config} |
| | | columns={columns} |
| | | BID={this.props.BID} |
| | | data={this.state.data} |
| | | BData={this.props.BData} |
| | | loading={this.state.loading} |
| | | MenuName={this.props.Tab.label} |
| | | logcolumns={this.state.logcolumns} |
| | | refreshdata={this.refreshbyaction} |
| | | handleTableId={() => {}} |
| | | /> |
| | |
| | | type: PropTypes.string, // 判断当前为主表(main)、子表(sub)、子表标签(subtab) |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | actions: PropTypes.array, // 按钮组 |
| | | logcolumns: PropTypes.array, // 显示列 |
| | | columns: PropTypes.array, // 显示列 |
| | | dict: PropTypes.object, // 字典项 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | |
| | | * @description 按钮提交执行 |
| | | */ |
| | | execSubmit = (btn, data, _resolve, formdata) => { |
| | | const { setting, logcolumns } = this.props |
| | | const { setting, columns } = this.props |
| | | |
| | | if (btn.intertype === 'inner') { |
| | | // 执行方式为多行拼接,且打开方式为表单时,会转为循环发送请求 |
| | |
| | | } |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, '', param, data[0], logcolumns) // 数据源 |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, '', param, data[0], columns) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | |
| | | } |
| | | } |
| | | param.ID = primaryId || Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], logcolumns) // 数据源 |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], columns) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], logcolumns) // 数据源 |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], columns) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | |
| | | } |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, '', param, cell, logcolumns) // 数据源 |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, '', param, cell, columns) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | |
| | | } |
| | | } else if (btn.sql && btn.sqlType === 'insert') { // 系统函数添加时,生成uuid |
| | | param.ID = _formPrimaryId || Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, cell, logcolumns) // 数据源 |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, cell, columns) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | |
| | | } |
| | | |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, cell, logcolumns) // 数据源 |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, cell, columns) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | |
| | | actions: [], // 按钮集 |
| | | columns: [], // 显示列 |
| | | arr_field: '', // 使用 sPC_Get_TableData 时的查询字段集 |
| | | logcolumns: null, // 日志中显示的列信息 (增加至全部列,除去合并列) |
| | | setting: {}, // 页面全局设置:数据源、按钮及显示列固定、主键等 |
| | | data: [], // 列表数据集 |
| | | selectedData: [], // 已选表格数据 |
| | |
| | | |
| | | let _arrField = [] // 字段集 |
| | | let _columns = [] // 显示列 |
| | | let _logcolumns = [] // 日志显示列 |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() // 用于字段过滤 |
| | | |
| | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | |
| | | _logcolumns.push(col) |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | | } else if (col.Hide === 'true') { |
| | | _hideCol.push(col.uuid) |
| | | } |
| | | colMap.set(col.uuid, col) |
| | | }) |
| | |
| | | config.columns.forEach(col => { |
| | | if (_hideCol.includes(col.uuid)) return |
| | | |
| | | if (col.type === 'colspan' && col.sublist) { |
| | | let _col = JSON.parse(JSON.stringify(col)) |
| | | if (col.type === 'colspan') { |
| | | if (col.unfold !== 'true') { // 不展开为旧版合并列 |
| | | col.type = 'old_colspan' |
| | | } |
| | | |
| | | let _col = fromJS(col).toJS() |
| | | let subcols = [] |
| | | _col.sublist.forEach(sub => { |
| | | _col.sublist && _col.sublist.forEach(sub => { |
| | | if (colMap.has(sub)) { |
| | | subcols.push(colMap.get(sub)) |
| | | } |
| | |
| | | return item |
| | | }), |
| | | columns: _columns, |
| | | logcolumns: _logcolumns, |
| | | arr_field: _arrField.join(','), |
| | | search: Utils.initMainSearch(config.search) |
| | | }, () => { |
| | |
| | | type="main" |
| | | setting={setting} |
| | | actions={actions} |
| | | columns={columns} |
| | | dict={this.state.dict} |
| | | MenuID={this.props.MenuID} |
| | | selectedData={selectedData} |
| | | logcolumns={this.state.logcolumns} |
| | | ContainerId={this.state.ContainerId} |
| | | refreshdata={this.refreshbyaction} |
| | | /> |
| | |
| | | <MainTable |
| | | tableId="mainTable" |
| | | pickup={pickup} |
| | | config={config} |
| | | setting={setting} |
| | | columns={columns} |
| | | dict={this.state.dict} |
| | |
| | | searchlist: null, // 搜索条件 |
| | | actions: null, // 按钮集 |
| | | columns: null, // 显示列 |
| | | logcolumns: null, // 日志中显示的列信息 (增加至全部列,除去合并列) |
| | | arr_field: '', // 使用 sPC_Get_TableData 时的查询字段集 |
| | | setting: null, // 页面全局设置:数据源、按钮及显示列固定、主键等 |
| | | data: null, // 列表数据集 |
| | |
| | | |
| | | let _arrField = [] // 字段集 |
| | | let _columns = [] // 显示列 |
| | | let _logcolumns = [] // 日志显示列 |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() |
| | | |
| | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | |
| | | _logcolumns.push(col) |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | | } else if (col.Hide === 'true') { |
| | | _hideCol.push(col.uuid) |
| | | } |
| | | colMap.set(col.uuid, col) |
| | | }) |
| | |
| | | config.columns.forEach(col => { |
| | | if (_hideCol.includes(col.uuid)) return |
| | | |
| | | if (col.type === 'colspan' && col.sublist) { |
| | | let _col = JSON.parse(JSON.stringify(col)) |
| | | if (col.type === 'colspan') { |
| | | if (col.unfold !== 'true') { // 不展开为旧版合并列 |
| | | col.type = 'old_colspan' |
| | | } |
| | | let _col = fromJS(col).toJS() |
| | | let subcols = [] |
| | | _col.sublist.forEach(sub => { |
| | | _col.sublist && _col.sublist.forEach(sub => { |
| | | if (colMap.has(sub)) { |
| | | subcols.push(colMap.get(sub)) |
| | | } |
| | |
| | | return item |
| | | }), |
| | | columns: _columns, |
| | | logcolumns: _logcolumns, |
| | | arr_field: _arrField.join(','), |
| | | search: Utils.initMainSearch(config.search) // 搜索条件初始化(含有时间格式,需要转化) |
| | | }, () => { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, setting, searchlist, actions, columns, pickup, selectedData } = this.state |
| | | const { setting, searchlist, actions, columns, pickup, selectedData } = this.state |
| | | |
| | | return ( |
| | | <div className="verup-subtable" id={'subtable' + this.props.MenuID}> |
| | |
| | | type="sub" |
| | | setting={setting} |
| | | actions={actions} |
| | | columns={columns} |
| | | Tab={this.props.Tab} |
| | | BID={this.props.BID} |
| | | BData={this.props.BData} |
| | | dict={this.state.dict} |
| | | selectedData={selectedData} |
| | | MenuID={this.props.SupMenuID} |
| | | logcolumns={this.state.logcolumns} |
| | | refreshdata={this.refreshbyaction} |
| | | ContainerId={this.props.ContainerId} |
| | | getexceloutparam={this.getexceloutparam} |
| | |
| | | <SubTable |
| | | tableId={this.props.Tab.uuid} |
| | | pickup={pickup} |
| | | config={config} |
| | | setting={setting} |
| | | columns={columns} |
| | | dict={this.state.dict} |
| | |
| | | sessionStorage.setItem('Full_Name', res.FullName) |
| | | sessionStorage.setItem('avatar', res.icon || '') |
| | | sessionStorage.setItem('dataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('localDataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('debug', res.debug || '') |
| | | sessionStorage.setItem('role_id', res.role_id || '') |
| | | sessionStorage.setItem('localRole_id', res.role_id || '') |
| | | |
| | | sessionStorage.removeItem('CloudAvatar') |
| | | sessionStorage.removeItem('cloudDataM') |
| | |
| | | Tab: PropTypes.any, // 如果当前元素为标签时,tab为标签信息 |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | actions: PropTypes.array, // 按钮组 |
| | | logcolumns: PropTypes.array, // 显示列 |
| | | columns: PropTypes.array, // 显示列 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | | refreshdata: PropTypes.func, // 执行完成后数据刷新 |
| | |
| | | } |
| | | |
| | | getButtonList = (actions) => { |
| | | const { BID, BData, MenuID, Tab, logcolumns, setting, ContainerId, selectedData, getexceloutparam, MenuName } = this.props |
| | | const { BID, BData, MenuID, Tab, columns, setting, ContainerId, selectedData, getexceloutparam, MenuName } = this.props |
| | | |
| | | return actions.map(item => { |
| | | if (['exec', 'prompt', 'pop'].includes(item.OpenType)) { |
| | |
| | | btn={item} |
| | | BData={BData} |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuName={MenuName} |
| | | columns={logcolumns} |
| | | ContainerId={ContainerId} |
| | | selectedData={selectedData} |
| | | updateStatus={this.updateStatus} |
| | |
| | | Tab: PropTypes.any, // 如果当前元素为标签时,tab为标签信息 |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | setting: PropTypes.object, // 页面设定 |
| | | logcolumns: PropTypes.array, // 字段列 |
| | | columns: PropTypes.array, // 显示列 |
| | | card: PropTypes.object, // 卡片设置信息 |
| | | data: PropTypes.object, // 卡片数据 |
| | | selectKey: PropTypes.string, // 选择卡片的序号 |
| | |
| | | * @description 获取按钮元素 |
| | | */ |
| | | getActionList = (actions, show) => { |
| | | const { BID, BData, Tab, setting, logcolumns, ContainerId, data, MenuID, MenuName } = this.props |
| | | const { BID, BData, Tab, setting, columns, ContainerId, data, MenuID, MenuName } = this.props |
| | | |
| | | return actions.map(item => { |
| | | if (['exec', 'prompt', 'pop'].includes(item.OpenType)) { |
| | |
| | | show={show} |
| | | BData={BData} |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuName={MenuName} |
| | | columns={logcolumns} |
| | | selectedData={[data]} |
| | | ContainerId={ContainerId} |
| | | updateStatus={this.props.refreshdata} |
| | |
| | | BData={this.props.BData} |
| | | setting={this.props.setting} |
| | | MenuName={this.props.MenuName} |
| | | columns={this.props.logcolumns} |
| | | columns={this.props.columns} |
| | | selectedData={[]} |
| | | ContainerId={this.props.ContainerId} |
| | | updateStatus={this.props.refreshdata} |
| | |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | MenuName: PropTypes.any, // 菜单名称 |
| | | config: PropTypes.object, // 页面配置信息 |
| | | logcolumns: PropTypes.array, // 显示列 |
| | | columns: PropTypes.array, // 显示列 |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | | plot: PropTypes.object, |
| | | tableId: PropTypes.string, |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { plot, data, loading, BID, BData, Tab, MenuID, config, logcolumns, ContainerId, MenuName } = this.props |
| | | const { plot, data, loading, BID, BData, Tab, MenuID, config, columns, ContainerId, MenuName } = this.props |
| | | const { card, colMap, selectKey, actionList } = this.state |
| | | |
| | | return ( |
| | |
| | | BData={BData} |
| | | MenuID={MenuID} |
| | | colMap={colMap} |
| | | columns={columns} |
| | | MenuName={MenuName} |
| | | selectKey={selectKey} |
| | | logcolumns={logcolumns} |
| | | setting={config.setting} |
| | | ContainerId={ContainerId} |
| | | switchCard={this.switchCard} |
| | |
| | | pageSize: PropTypes.any, // 每页数据 |
| | | MenuName: PropTypes.any, // 菜单名称 |
| | | dict: PropTypes.object, // 字典项 |
| | | config: PropTypes.object, // 页面配置 |
| | | MenuID: PropTypes.string, // 菜单Id |
| | | setting: PropTypes.object, // 表格全局设置:tableType(表格是否可选、单选、多选)、columnfixed(列固定)、actionfixed(按钮固定) |
| | | pickup: PropTypes.any, // 数据收起 |
| | | columns: PropTypes.array, // 表格列 |
| | | logcolumns: PropTypes.array, // 字段列 |
| | | fields: PropTypes.array, // 组件字段集 |
| | | BID: PropTypes.any, // 主表Id |
| | | ContainerId: PropTypes.any, // 标签页外层Id |
| | | BData: PropTypes.any, // 主表数据 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { menuType, config, memberLevel, pageSize } = this.props |
| | | let columns = JSON.parse(JSON.stringify(this.props.columns)) |
| | | const { menuType, memberLevel, pageSize } = this.props |
| | | let columns = fromJS(this.props.columns).toJS() |
| | | let lineMarks = [] |
| | | let _columns = [] |
| | | let radio = 5 // 虚化比例 |
| | |
| | | } |
| | | } |
| | | |
| | | // 获取行标记 |
| | | config.columns.forEach(col => { |
| | | if (!col.field) return |
| | | |
| | | col.marks && col.marks.forEach(mark => { |
| | | if (mark.signType === 'line') { |
| | | lineMarks.push(mark) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | columns.forEach((item, index) => { |
| | | if (item.hidden === true || item.Hide === 'true') return |
| | | |
| | | if (_format && !Math.floor(Math.random() * radio)) { |
| | | item.blur = true |
| | | } |
| | | |
| | | if (item.marks) { // 过滤行和卡片标记 |
| | | item.marks = item.marks.filter(mark => mark.signType !== 'line' && mark.signType !== 'card') |
| | | |
| | | if (item.marks.length === 0) { |
| | | item.marks = '' |
| | | } |
| | | } |
| | | |
| | | let cell = null |
| | | |
| | | if (item.type === 'colspan' && item.unfold === 'true') { |
| | | if (item.type === 'colspan') { |
| | | cell = {title: item.label, children: []} |
| | | |
| | | item.subcols.forEach(col => { |
| | | |
| | | if (col.rowspan === 'true') { |
| | | rowspan = col |
| | | } |
| | | if (_format && !Math.floor(Math.random() * radio)) { |
| | | col.blur = true |
| | | } |
| | | |
| | | if (col.marks) { // 过滤行和卡片标记 |
| | | col.marks = col.marks.filter(mark => mark.signType !== 'line' && mark.signType !== 'card') |
| | | col.marks = col.marks.filter(mark => { |
| | | if (mark.signType === 'line') { |
| | | lineMarks.push(mark) |
| | | } |
| | | return mark.signType !== 'line' && mark.signType !== 'card' |
| | | }) |
| | | |
| | | if (col.marks.length === 0) { |
| | | col.marks = '' |
| | |
| | | } |
| | | }) |
| | | }) |
| | | } else if (item.type === 'old_colspan') { |
| | | item.subcols.forEach(col => { |
| | | if (col.marks) { // 过滤行和卡片标记 |
| | | col.marks = col.marks.filter(mark => { |
| | | if (mark.signType === 'line') { |
| | | lineMarks.push(mark) |
| | | } |
| | | return mark.signType !== 'line' && mark.signType !== 'card' |
| | | }) |
| | | |
| | | if (col.marks.length === 0) { |
| | | col.marks = '' |
| | | } |
| | | } |
| | | }) |
| | | |
| | | cell = { |
| | | align: item.Align, |
| | | dataIndex: item.field || item.uuid, |
| | | title: item.label, |
| | | sorter: item.field && item.IsSort === 'true', |
| | | width: item.Width || 120, |
| | | render: (text, record) => { |
| | | return this.getContent(item, record) |
| | | } |
| | | } |
| | | } else { |
| | | if (item.rowspan === 'true') { |
| | | rowspan = item |
| | | } |
| | | if (_format && !Math.floor(Math.random() * radio)) { |
| | | item.blur = true |
| | | } |
| | | |
| | | if (item.marks) { // 过滤行和卡片标记 |
| | | item.marks = item.marks.filter(mark => { |
| | | if (mark.signType === 'line') { |
| | | lineMarks.push(mark) |
| | | } |
| | | return mark.signType !== 'line' && mark.signType !== 'card' |
| | | }) |
| | | |
| | | if (item.marks.length === 0) { |
| | | item.marks = '' |
| | | } |
| | | } |
| | | |
| | | cell = { |
| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | let decimal = item.decimal || 0 |
| | | if (item.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } |
| | | |
| | | content = content.toFixed(item.decimal || 0) |
| | | content = content.toFixed(decimal) |
| | | |
| | | if (item.format === 'thdSeparator') { |
| | | content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | |
| | | BData={this.props.BData} |
| | | setting={this.props.setting} |
| | | MenuName={this.props.MenuName} |
| | | columns={this.props.logcolumns} |
| | | columns={this.props.fields || this.props.columns} |
| | | ContainerId={this.props.ContainerId} |
| | | updateStatus={this.updateStatus} |
| | | /> |
| | |
| | | })} |
| | | </div> |
| | | ) |
| | | } else if (item.type === 'colspan') { |
| | | } else if (item.type === 'old_colspan') { |
| | | if (item.subcols.length === 0) return '' |
| | | let ordertype = item.order |
| | | let contents = [] |
| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | let decimal = col.decimal || 0 |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } |
| | | |
| | | content = content.toFixed(col.decimal || 0) |
| | | |
| | | content = content.toFixed(decimal) |
| | | |
| | | if (col.format === 'thdSeparator') { |
| | | content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | |
| | | content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}` |
| | | } |
| | | |
| | | content = (col.prefix || '') + record[col.field] + (col.postfix || '') |
| | | content = (col.prefix || '') + content + (col.postfix || '') |
| | | } |
| | | |
| | | if (col.marks) { |
| | |
| | | changeRow = (record, index) => { |
| | | if (!this.props.setting.tableType || this.props.pickup) return |
| | | |
| | | let newkeys = JSON.parse(JSON.stringify(this.state.selectedRowKeys)) |
| | | let newkeys = fromJS(this.state.selectedRowKeys).toJS() |
| | | |
| | | if (this.props.setting.tableType === 'radio') { |
| | | newkeys = [index] |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="ant-advanced-search-form top-search" id={this.state.formId} onSubmit={this.handleSearch}> |
| | | <Form {...formItemLayout} className="top-search" id={this.state.formId} onSubmit={this.handleSearch}> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |
| | |
| | | .ant-advanced-search-form.top-search { |
| | | .top-search { |
| | | padding: 0px 24px 10px; |
| | | border-bottom: 1px solid #efefef; |
| | | .ant-form-item { |
| | |
| | | * @return {String} type 执行类型 |
| | | * @return {String} table 表名 |
| | | */ |
| | | static getSysDefaultSql (btn, setting, formdata, param, data, logcolumns, tab) { |
| | | static getSysDefaultSql (btn, setting, formdata, param, data, columns, tab) { |
| | | let primaryId = param.ID |
| | | let BID = param.BID |
| | | let verify = btn.verify || {} |
| | |
| | | // 添加数据中字段,表单值优先(按钮不选行或多行拼接时跳过) |
| | | if (data && btn.Ot !== 'notRequired' && btn.Ot !== 'requiredOnce') { |
| | | _formFieldValue = {...data, ..._formFieldValue} |
| | | const setField = (col) => { |
| | | if (!col.field) return |
| | | let _key = col.field.toLowerCase() |
| | | |
| | | if (logcolumns && logcolumns.length > 0) { |
| | | logcolumns.forEach(col => { |
| | | let _key = col.field.toLowerCase() |
| | | if (!_initvars.includes(_key)) { |
| | | let _val = data.hasOwnProperty(col.field) ? data[col.field] : '' |
| | | |
| | | if (!_initvars.includes(_key)) { |
| | | _initvars.push(_key) |
| | | _initvars.push(_key) |
| | | _initColfields.push(`@${_key}='${_val}'`) |
| | | } |
| | | |
| | | if (!_vars.includes(_key)) { |
| | | _vars.push(_key) |
| | | |
| | | let _val = data.hasOwnProperty(col.field) ? data[col.field] : '' |
| | | |
| | | if (col.type === 'number') { |
| | | if (typeof(_val) !== 'number') { |
| | | _val = parseFloat(_val) |
| | | if (isNaN(_val)) { |
| | | _val = 0 |
| | | } |
| | | } |
| | | _initColfields.push(`@${_key}=${_val}`) |
| | | } else { |
| | | _initColfields.push(`@${_key}='${_val}'`) |
| | | } |
| | | } |
| | | |
| | | if (!_vars.includes(_key)) { |
| | | _vars.push(_key) |
| | | |
| | | if (col.datatype) { |
| | | _declarefields.push(`@${_key} ${col.datatype}`) |
| | | } else { |
| | | if (col.fieldlength && col.fieldlength > 2048) { |
| | | col.fieldlength = 'max' |
| | | } |
| | | |
| | | let _type = `nvarchar(${col.fieldlength || 50})` |
| | | |
| | | |
| | | if (col.type === 'number') { |
| | | let _length = col.decimal ? col.decimal : 0 |
| | | _type = `decimal(18,${_length})` |
| | |
| | | } |
| | | |
| | | _declarefields.push(`@${_key} ${_type}`) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (columns && columns.length > 0) { |
| | | columns.forEach(col => { |
| | | if (col.type === 'colspan' || col.type === 'old_colspan') { |
| | | col.subcols.forEach(cell => { |
| | | setField(cell) |
| | | }) |
| | | } else { |
| | | setField(col) |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | } else if (_actionType === 'delete') { // 物理删除 |
| | | let _msg = '' |
| | | if (data && logcolumns && logcolumns.length > 0) { |
| | | if (data && columns && columns.length > 0) { |
| | | let _index = 0 |
| | | logcolumns.forEach(col => { |
| | | if (col.Hide !== 'true' && _index < 4) { |
| | | columns.forEach(col => { |
| | | if (col.Hide !== 'true' && col.type !== 'colspan' && col.type !== 'old_colspan' && _index < 4) { |
| | | _msg += col.label + '=' + data[col.field] + ',' |
| | | _index++ |
| | | } |
| | |
| | | let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param))) |
| | | |
| | | sessionStorage.setItem('dataM', param.dataM || '') |
| | | sessionStorage.setItem('localDataM', param.dataM || '') |
| | | this.setState({ |
| | | BID: param.id || '', |
| | | tempId: param.tempId |
| | |
| | | sessionStorage.setItem('Full_Name', res.FullName) |
| | | sessionStorage.setItem('avatar', res.icon || '') |
| | | sessionStorage.setItem('dataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('localDataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('debug', res.debug || '') |
| | | sessionStorage.setItem('role_id', res.role_id || '') |
| | | sessionStorage.setItem('localRole_id', res.role_id || '') |
| | | |
| | | localStorage.setItem('lang', param.lang || 'zh-CN') |
| | | |
| | |
| | | sessionStorage.setItem('Full_Name', res.FullName) |
| | | sessionStorage.setItem('avatar', res.icon || '') |
| | | sessionStorage.setItem('dataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('localDataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('debug', res.debug || '') |
| | | sessionStorage.setItem('role_id', res.role_id || '') |
| | | sessionStorage.setItem('localRole_id', res.role_id || '') |
| | | |
| | | localStorage.setItem('lang', param.lang || 'zh-CN') |
| | | |
| | |
| | | _param.Full_Name && sessionStorage.setItem('Full_Name', _param.Full_Name) |
| | | _param.debug && sessionStorage.setItem('debug', _param.debug) |
| | | _param.dataM && sessionStorage.setItem('dataM', _param.dataM) |
| | | _param.dataM && sessionStorage.setItem('localDataM', _param.dataM) |
| | | _param.avatar && sessionStorage.setItem('avatar', _param.avatar) |
| | | _param.role_id && sessionStorage.setItem('role_id', _param.role_id) |
| | | _param.role_id && sessionStorage.setItem('localRole_id', _param.role_id) |
| | | } else { |
| | | this.props.history.replace('/login') |
| | | } |