Commit 89b90f8756f1aa2371da13802e3752c7088b4ea6
1 parent
53e5d26a
1.在线用户增加清空功能
Showing
2 changed files
with
32 additions
and
1 deletions
src/components/Common/CommonTable/index.js
| ... | ... | @@ -2951,6 +2951,7 @@ class CommonTableRc extends React.Component { |
| 2951 | 2951 | const bShowTreeDel = props.tableProps.bShowTreeDel && this.findIsExistByControlName(props, 'BtnDel'); /* 添加树节点 */ |
| 2952 | 2952 | const bShowTreeCopyAll = props.tableProps.bShowTreeCopyAll && this.findIsExistByControlName(props, 'BtnCopyAll'); /* 添加树节点 */ |
| 2953 | 2953 | const exitIcon = props.tableProps.setExit; /* 退出操作 */ |
| 2954 | + const clearIcon = props.tableProps.setClear; /* 清空操作 */ | |
| 2954 | 2955 | let bShowProductProcess = false;/* 选择成品工序 */ |
| 2955 | 2956 | if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.tableProps) && props.tableProps.bShowProductProcess !== undefined) { |
| 2956 | 2957 | bShowProductProcess = props.tableProps.bShowProductProcess;/* 选择成品工序 */ |
| ... | ... | @@ -3037,6 +3038,9 @@ class CommonTableRc extends React.Component { |
| 3037 | 3038 | if (exitIcon) { |
| 3038 | 3039 | operateWidth += 60; |
| 3039 | 3040 | } |
| 3041 | + if (clearIcon) { | |
| 3042 | + operateWidth += 60; | |
| 3043 | + } | |
| 3040 | 3044 | if (headPopup) { |
| 3041 | 3045 | operateWidth += 20; |
| 3042 | 3046 | } |
| ... | ... | @@ -3092,6 +3096,7 @@ class CommonTableRc extends React.Component { |
| 3092 | 3096 | let operateTreeCopyAll = null; |
| 3093 | 3097 | let operateTreeAddChild = null; |
| 3094 | 3098 | let operateExit = null; |
| 3099 | + let operateClear = null; | |
| 3095 | 3100 | let operatesAlumitePopup = null; |
| 3096 | 3101 | const setAdd = commonFunc.showMessage(props.app.commonConst, 'setAdd');/* 新增s */ |
| 3097 | 3102 | const setCopy = commonFunc.showMessage(props.app.commonConst, 'setCopy');/* 复制 */ |
| ... | ... | @@ -3257,6 +3262,10 @@ class CommonTableRc extends React.Component { |
| 3257 | 3262 | const setExit = '退出'; |
| 3258 | 3263 | operateExit = <a title={setExit} onClick={this.exitTbRow.bind(this, index, record)}>{<ExportOutlined style={{ color: '#8e1f13' }} />}</a>; |
| 3259 | 3264 | } |
| 3265 | + if (clearIcon) { | |
| 3266 | + const setExit = '清空'; | |
| 3267 | + operateClear = <a title={setExit} onClick={this.clearTbRow.bind(this, index, record)}>{<ClearOutlined style={{ fontSize:'14px', color: '#8e1f13' }} />}</a>; | |
| 3268 | + } | |
| 3260 | 3269 | if (sAlumitePopup) { |
| 3261 | 3270 | const setAlumitePopup = '电化铝'; |
| 3262 | 3271 | const enabled = this.getTableBtnState('BtnPopupsAlumiteBomBillNo', record); |
| ... | ... | @@ -3269,6 +3278,7 @@ class CommonTableRc extends React.Component { |
| 3269 | 3278 | }} |
| 3270 | 3279 | className="operate-bar" |
| 3271 | 3280 | >{operateTreeAdd}{operateTreeAddChild}{operateTreeCopyAll}{operateTreeDel}{operateAdd}{operatesAlumitePopup}{operatePopupModal}{operateCopy}{operateCopyAll}{operateReplace}{operateCopyMore}{operateMaterial}{operateProductMaterials}{operateMaterailRemark}{operateDel}{operateProcess}{operateParamModal}{operateDownload}{operateProductProcess}{operateExit} |
| 3281 | + {operateClear} | |
| 3272 | 3282 | </div>); |
| 3273 | 3283 | }, |
| 3274 | 3284 | title: () => (this.props.setOpterationColumn === 'Y' && this.getTableFilterData() === 0 ? <span |
| ... | ... | @@ -3954,6 +3964,9 @@ class CommonTableRc extends React.Component { |
| 3954 | 3964 | exitTbRow = (index, record) => { |
| 3955 | 3965 | this.props.onExitTbRow(index, record); |
| 3956 | 3966 | } |
| 3967 | + clearTbRow = (index, record) => { | |
| 3968 | + this.props.onClearTbRow(index, record); | |
| 3969 | + } | |
| 3957 | 3970 | handleViewClick = (name, sName, record, index, showConfig, configName) => { |
| 3958 | 3971 | // console.log('vvvs', showConfig); |
| 3959 | 3972 | if (commonUtils.isNotEmptyObject(showConfig) && commonUtils.isNotEmptyObject(record)) { | ... | ... |
src/components/Common/PersonCenter/PersonCenter.js
| ... | ... | @@ -375,6 +375,20 @@ class PersonCenter extends Component { |
| 375 | 375 | }); |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | + // 情空用户 | |
| 379 | + handleClearTbRow = async (index, record) => { | |
| 380 | + const { app } = this.props; | |
| 381 | + const { userinfo, token } = app; | |
| 382 | + const { sUserId, sUserLoginType } = record; | |
| 383 | + const configUrl = `${config.server_host}license/doClean/${sUserId}`; | |
| 384 | + const configReturn = (await commonServices.getService(token, configUrl)).data; | |
| 385 | + if (configReturn.code === 1) { | |
| 386 | + message.success(`用户【${record.sUserName}】已清空`); | |
| 387 | + } else { | |
| 388 | + message.error(`用户【${record.sUserName}】强制清空失败`); | |
| 389 | + } | |
| 390 | + } | |
| 391 | + | |
| 378 | 392 | handleCancel = () => { |
| 379 | 393 | this.setState({ |
| 380 | 394 | userVisible: false, |
| ... | ... | @@ -724,6 +738,7 @@ class PersonCenter extends Component { |
| 724 | 738 | handleCancel={this.handleCancel} |
| 725 | 739 | onSaveState={this.handleSaveOnlineUserState} |
| 726 | 740 | onExitTbRow={this.handleExitTbRow} |
| 741 | + onClearTbRow={this.handleClearTbRow} | |
| 727 | 742 | /> |
| 728 | 743 | {state.skinChangeModalVisible && |
| 729 | 744 | <SkinChangeModal |
| ... | ... | @@ -983,6 +998,7 @@ const PersonCenterOnlineUser = Form.create({ |
| 983 | 998 | onSaveState, |
| 984 | 999 | onlineUserState = {}, |
| 985 | 1000 | onExitTbRow, |
| 1001 | + onClearTbRow, | |
| 986 | 1002 | app, |
| 987 | 1003 | } = props; |
| 988 | 1004 | const { userinfo } = app; |
| ... | ... | @@ -1048,13 +1064,15 @@ const PersonCenterOnlineUser = Form.create({ |
| 1048 | 1064 | const onlineUserProps = { |
| 1049 | 1065 | ...commonBusiness.getTableTypes('onlineUser', props), |
| 1050 | 1066 | formId: commonUtils.createSid(), |
| 1051 | - tableProps: { AutoTableHeight: '100%', setNoCommonOperate: true, setExit: ['sysadmin'].includes(sType), }, | |
| 1067 | + tableProps: { AutoTableHeight: '100%', setNoCommonOperate: true, setExit: ['sysadmin'].includes(sType), | |
| 1068 | + setClear: ['sysadmin'].includes(sType),}, | |
| 1052 | 1069 | config: onlineUserConfig, |
| 1053 | 1070 | headerColumn, |
| 1054 | 1071 | data: commonUtils.isNotEmptyObject(onlineUserDataNew) ? onlineUserDataNew.data : [], |
| 1055 | 1072 | onSaveState, |
| 1056 | 1073 | onSelectRowChange: () => { }, |
| 1057 | 1074 | onExitTbRow, |
| 1075 | + onClearTbRow, | |
| 1058 | 1076 | getDateFormat: () => 'YYYY-MM-DD hh:mm:ss', |
| 1059 | 1077 | ...onlineUserState |
| 1060 | 1078 | }; | ... | ... |