| | |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | position: unset!important; |
| | | vertical-align: top; |
| | | } |
| | | .sort-wrap { |
| | | position: relative; |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'sum', |
| | | label: '显示合计', |
| | | initVal: card.sum || 'false', |
| | | tooltip: '合计信息只在使用系统数据源时有效。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | }], |
| | | forbid: card.isSub || card.sum !== 'true' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'decimal', |
| | | min: 0, |
| | |
| | | } else { |
| | | cell.type = 'number' |
| | | cell.format = 'none' |
| | | cell.sum = 'false' |
| | | cell.decimal = item.decimal || 0 |
| | | cell.Width = 80 |
| | | } |
| | |
| | | |
| | | component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript) |
| | | |
| | | if (!component.setting.execute || component.setting.custompage) { |
| | | component.forbidLine = true |
| | | } |
| | | |
| | | component.setting.delay = delay |
| | | delay += 20 |
| | | |
| | |
| | | async loadLinedata (id) { |
| | | const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state |
| | | |
| | | if (config.forbidLine) { |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (config.setting.useMSearch) { // 主表搜索条件 |
| | | let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || [] |
| | |
| | | async loadLinedata (id) { |
| | | const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state |
| | | |
| | | if (config.forbidLine) { |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (config.setting.useMSearch) { // 主表搜索条件 |
| | | let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || [] |
| | |
| | | async loadmainLinedata (id) { |
| | | const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state |
| | | |
| | | if (config.forbidLine) { |
| | | this.reloadtable() |
| | | return |
| | | } |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (config.setting.useMSearch) { // 主表搜索条件 |
| | | let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || [] |
| | |
| | | async loadmainLinedata (id) { |
| | | const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state |
| | | |
| | | if (config.forbidLine) { |
| | | this.reloadtable() |
| | | return |
| | | } |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (config.setting.useMSearch) { // 主表搜索条件 |
| | | let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || [] |
| | |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadmaindata(true, 'true', '', 'timer') |
| | | this.getStatFieldsValue() |
| | | }) |
| | | }) |
| | | } |
| | |
| | | if (config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadmaindata(false, 'true', '', 'init') |
| | | this.getStatFieldsValue() |
| | | }, config.setting.delay || 0) |
| | | } |
| | | } |
| | | } else if (config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }, config.setting.delay || 0) |
| | | } |
| | | } |
| | |
| | | async loadmainLinedata (id) { |
| | | const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state |
| | | |
| | | if (config.forbidLine) { |
| | | this.reloadtable() |
| | | return |
| | | } |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (config.setting.useMSearch) { // 主表搜索条件 |
| | | let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || [] |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 获取合计字段值 |
| | | */ |
| | | getStatFieldsValue = () => { |
| | | const { setting, config, search, BID, orderBy } = this.state |
| | | |
| | | if (setting.supModule && !BID && setting.supKey !== 'false') { // BID 不存在时,不做查询 |
| | | this.setState({ |
| | | statFValue: [] |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (config.statFields.length === 0 || setting.interType !== 'system' || !setting.dataresource) return |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (config.setting.useMSearch) { // 主表搜索条件 |
| | | let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || [] |
| | | let keys = config.$s_keys || [] |
| | | mainSearch.forEach(item => { |
| | | if (keys.includes(item.key.toLowerCase())) return |
| | | |
| | | searches.push(item) |
| | | }) |
| | | } |
| | | |
| | | if (config.$s_req && searches.filter(item => item.required && item.value === '').length > 0) { |
| | | return |
| | | } |
| | | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getStatQueryDataParams(setting, config.statFields, searches, _orderBy, BID) |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | let _data = res.data[0] |
| | | let values = [] |
| | | |
| | | if (_data) { |
| | | config.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 搜索条件改变时,重置表格数据 |
| | | * 含有初始不加载的页面,修改设置 |
| | | */ |
| | |
| | | search: searches |
| | | }, () => { |
| | | this.loadmaindata(true, 'true') |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } |
| | | |
| | |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadmaindata(true, 'true', id) |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } else { |
| | | this.loadmaindata(true, 'false', id) |
| | | this.getStatFieldsValue() |
| | | } |
| | | } |
| | | |
| | |
| | | BData: data |
| | | }, () => { |
| | | this.loadmaindata(true, 'true') |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | if (item.type === 'table') { |
| | | let statFields = [] |
| | | let getCols = (cols) => { |
| | | return cols.filter(col => { |
| | | if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | |
| | | } |
| | | |
| | | if (col.type === 'number') { |
| | | if (col.sum === 'true' && !statFields.includes(col.field)) { |
| | | statFields.push(col) |
| | | } |
| | | if (typeof(col.decimal) === 'number') { |
| | | col.round = Math.pow(10, col.decimal) |
| | | if (col.format === 'percent') { |
| | |
| | | } |
| | | |
| | | item.cols = getCols(item.cols) |
| | | item.statFields = statFields |
| | | |
| | | if (item.subtype === 'editable') { |
| | | item.submit.logLabel = item.$menuname + '-提交' |
| | |
| | | |
| | | resetElement = (cell) => { |
| | | cell.style = cell.style || {} |
| | | |
| | | if (cell.style.display === 'inline-block') { |
| | | cell.style.verticalAlign = 'top' |
| | | } |
| | | |
| | | if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | if (!cell.height) { |
| | | cell.innerHeight = 'auto' |
| | |
| | | |
| | | component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript) |
| | | |
| | | if (!component.setting.execute || component.setting.custompage) { |
| | | component.forbidLine = true |
| | | } |
| | | |
| | | if (component.setting.sync === 'true') { |
| | | // pageable 是否分页,组件属性,不分页的组件才可以统一查询 |
| | | if ((!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true') { |
| | |
| | | } |
| | | |
| | | if (item.type === 'table') { |
| | | let statFields = [] |
| | | let getCols = (cols) => { |
| | | return cols.filter(col => { |
| | | if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | |
| | | } |
| | | |
| | | if (col.type === 'number') { |
| | | if (col.sum === 'true' && !statFields.includes(col.field)) { |
| | | statFields.push(col) |
| | | } |
| | | if (typeof(col.decimal) === 'number') { |
| | | col.round = Math.pow(10, col.decimal) |
| | | if (col.format === 'percent') { |
| | |
| | | } |
| | | |
| | | item.cols = getCols(item.cols) |
| | | item.statFields = statFields |
| | | |
| | | if (item.subtype === 'editable') { |
| | | item.submit.logLabel = item.$menuname + '-提交' |
| | |
| | | |
| | | resetElement = (cell) => { |
| | | cell.style = cell.style || {} |
| | | |
| | | if (cell.style.display === 'inline-block') { |
| | | cell.style.verticalAlign = 'top' |
| | | } |
| | | |
| | | if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | if (!cell.height) { |
| | | cell.innerHeight = 'auto' |
| | |
| | | |
| | | component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript) |
| | | |
| | | if (!component.setting.execute || component.setting.custompage) { |
| | | component.forbidLine = true |
| | | } |
| | | |
| | | if (component.setting.sync === 'true') { |
| | | // pageable 是否分页,组件属性,不分页的组件才可以统一查询 |
| | | if ((!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true') { |
| | |
| | | |
| | | resetElement = (cell) => { |
| | | cell.style = cell.style || {} |
| | | |
| | | if (cell.style.display === 'inline-block') { |
| | | cell.style.verticalAlign = 'top' |
| | | } |
| | | |
| | | if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | cell.innerHeight = cell.innerHeight || 'auto' |
| | | cell.alignItems = cell.height > 1 ? cell.alignItems : '' |