| | |
| | | |
| | | // 字段透视 |
| | | triggerLink = (e, item, record) => { |
| | | const { tabviews, MenuID, setting } = this.props |
| | | const { tabviews, MenuID } = this.props |
| | | |
| | | e.stopPropagation() |
| | | |
| | | let __param = { |
| | | $searchkey: item.field, |
| | | $searchval: record[item.field] || '', |
| | | $BID: record.$$uuid |
| | | } |
| | | |
| | | if (item.linkfields && item.linkfields.length > 0) { |
| | | item.linkfields.forEach(field => { |
| | | __param[field] = record[field] || '' |
| | | }) |
| | | } |
| | | |
| | | if (item.linkThdMenu) { |
| | | let tabmenu = item.linkThdMenu |
| | | |
| | | tabmenu.param = { |
| | | searchkey: item.field, |
| | | searchval: record[item.field] || '', |
| | | BID: record[setting.primaryKey] |
| | | } |
| | | |
| | | tabmenu.param = __param |
| | | tabmenu.selected = true |
| | | |
| | | let index = 0 |
| | | let isexit = false |
| | | let tabs = tabviews.map((tab, i) => { |
| | | let tabs = tabviews.filter((tab, i) => { |
| | | tab.selected = false |
| | | |
| | | if (tab.MenuID === MenuID) { |
| | | index = i |
| | | } else if (tab.MenuID === tabmenu.MenuID) { |
| | | tab.param = tabmenu.param |
| | | tab.selected = true |
| | | isexit = true |
| | | } |
| | | |
| | | return tab |
| | | return tab.MenuID !== tabmenu.MenuID |
| | | }) |
| | | |
| | | if (!isexit) { |
| | | tabs.splice(index + 1, 0, tabmenu) |
| | | if (tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | | this.props.modifyTabview(tabs) |
| | | } else { |
| | | this.setState({}, () => { |
| | | if (MenuID) { |
| | | tabs.splice(index + 1, 0, tabmenu) |
| | | } else { |
| | | tabs.push(tabmenu) |
| | | } |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | } else if (item.linkurl) { |
| | | let src = item.linkurl |
| | | |
| | | if (item.linkurl.indexOf('paramsmain/') > -1) { |
| | | if (src.indexOf('paramsmain/') > -1) { |
| | | try { |
| | | let _url = item.linkurl.split('paramsmain/')[0] + 'paramsmain/' |
| | | let _param = JSON.parse(window.decodeURIComponent(window.atob(item.linkurl.split('paramsmain/')[1]))) |
| | | let dataparam = { |
| | | searchkey: item.field, |
| | | searchval: record[item.field] || '', |
| | | BID: record[setting.primaryKey] |
| | | } |
| | | _param.UserID = sessionStorage.getItem('UserID') |
| | | _param.LoginUID = sessionStorage.getItem('LoginUID') |
| | | _param.User_Name = sessionStorage.getItem('User_Name') |
| | | _param.param = dataparam |
| | | _param.param = __param |
| | | src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | } catch { |
| | | console.warn('菜单参数解析错误!') |
| | | } |
| | | } else { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(src)) { |
| | | con = '&' |
| | | } |
| | | |
| | | if (item.linkfields && item.linkfields.length > 0) { |
| | | item.linkfields.forEach(field => { |
| | | if (field.toLowerCase() === 'id') return |
| | | con += `${field}=${record[field] || ''}&` |
| | | }) |
| | | } |
| | | |
| | | src = src + `${con}id=${record.$$uuid}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } |
| | | |
| | | window.open(src) |
| | |
| | | setting={this.props.setting} |
| | | /> |
| | | ) |
| | | } else if (btn.OpenType === 'tab' || btn.OpenType === 'blank') { |
| | | } else if (btn.OpenType === 'tab') { |
| | | return ( |
| | | <TabButton |
| | | key={btn.uuid} |
| | |
| | | index = selectedRowKeys.slice(-1)[0] |
| | | } |
| | | |
| | | if (setting.tableType === 'checkbox') { |
| | | if (setting.tableType === 'checkbox' || setting.tableType === 'radio') { |
| | | _activeIndex = index === '' ? null : index |
| | | } |
| | | |
| | |
| | | if (this.props.setting.tableType === 'radio') { |
| | | newkeys = [index] |
| | | this.changedata(index) |
| | | this.setState({ selectedRowKeys: newkeys }) |
| | | this.setState({ selectedRowKeys: newkeys, activeIndex: index }) |
| | | } else { |
| | | let _index = '' |
| | | if (newkeys.includes(index)) { |
| | |
| | | dataSource={_data} |
| | | rowClassName={(record) => { |
| | | let className = '' |
| | | if (setting.tableType === 'checkbox' && record.key === activeIndex) { |
| | | if ((setting.tableType === 'checkbox' || setting.tableType === 'radio') && record.key === activeIndex) { |
| | | className = 'mk-row-active ' |
| | | } |
| | | |