Commit 89b90f8756f1aa2371da13802e3752c7088b4ea6

Authored by Min
1 parent 53e5d26a

1.在线用户增加清空功能

src/components/Common/CommonTable/index.js
@@ -2951,6 +2951,7 @@ class CommonTableRc extends React.Component { @@ -2951,6 +2951,7 @@ class CommonTableRc extends React.Component {
2951 const bShowTreeDel = props.tableProps.bShowTreeDel && this.findIsExistByControlName(props, 'BtnDel'); /* 添加树节点 */ 2951 const bShowTreeDel = props.tableProps.bShowTreeDel && this.findIsExistByControlName(props, 'BtnDel'); /* 添加树节点 */
2952 const bShowTreeCopyAll = props.tableProps.bShowTreeCopyAll && this.findIsExistByControlName(props, 'BtnCopyAll'); /* 添加树节点 */ 2952 const bShowTreeCopyAll = props.tableProps.bShowTreeCopyAll && this.findIsExistByControlName(props, 'BtnCopyAll'); /* 添加树节点 */
2953 const exitIcon = props.tableProps.setExit; /* 退出操作 */ 2953 const exitIcon = props.tableProps.setExit; /* 退出操作 */
  2954 + const clearIcon = props.tableProps.setClear; /* 清空操作 */
2954 let bShowProductProcess = false;/* 选择成品工序 */ 2955 let bShowProductProcess = false;/* 选择成品工序 */
2955 if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.tableProps) && props.tableProps.bShowProductProcess !== undefined) { 2956 if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.tableProps) && props.tableProps.bShowProductProcess !== undefined) {
2956 bShowProductProcess = props.tableProps.bShowProductProcess;/* 选择成品工序 */ 2957 bShowProductProcess = props.tableProps.bShowProductProcess;/* 选择成品工序 */
@@ -3037,6 +3038,9 @@ class CommonTableRc extends React.Component { @@ -3037,6 +3038,9 @@ class CommonTableRc extends React.Component {
3037 if (exitIcon) { 3038 if (exitIcon) {
3038 operateWidth += 60; 3039 operateWidth += 60;
3039 } 3040 }
  3041 + if (clearIcon) {
  3042 + operateWidth += 60;
  3043 + }
3040 if (headPopup) { 3044 if (headPopup) {
3041 operateWidth += 20; 3045 operateWidth += 20;
3042 } 3046 }
@@ -3092,6 +3096,7 @@ class CommonTableRc extends React.Component { @@ -3092,6 +3096,7 @@ class CommonTableRc extends React.Component {
3092 let operateTreeCopyAll = null; 3096 let operateTreeCopyAll = null;
3093 let operateTreeAddChild = null; 3097 let operateTreeAddChild = null;
3094 let operateExit = null; 3098 let operateExit = null;
  3099 + let operateClear = null;
3095 let operatesAlumitePopup = null; 3100 let operatesAlumitePopup = null;
3096 const setAdd = commonFunc.showMessage(props.app.commonConst, 'setAdd');/* 新增s */ 3101 const setAdd = commonFunc.showMessage(props.app.commonConst, 'setAdd');/* 新增s */
3097 const setCopy = commonFunc.showMessage(props.app.commonConst, 'setCopy');/* 复制 */ 3102 const setCopy = commonFunc.showMessage(props.app.commonConst, 'setCopy');/* 复制 */
@@ -3257,6 +3262,10 @@ class CommonTableRc extends React.Component { @@ -3257,6 +3262,10 @@ class CommonTableRc extends React.Component {
3257 const setExit = '退出'; 3262 const setExit = '退出';
3258 operateExit = <a title={setExit} onClick={this.exitTbRow.bind(this, index, record)}>{<ExportOutlined style={{ color: '#8e1f13' }} />}</a>; 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 if (sAlumitePopup) { 3269 if (sAlumitePopup) {
3261 const setAlumitePopup = '电化铝'; 3270 const setAlumitePopup = '电化铝';
3262 const enabled = this.getTableBtnState('BtnPopupsAlumiteBomBillNo', record); 3271 const enabled = this.getTableBtnState('BtnPopupsAlumiteBomBillNo', record);
@@ -3269,6 +3278,7 @@ class CommonTableRc extends React.Component { @@ -3269,6 +3278,7 @@ class CommonTableRc extends React.Component {
3269 }} 3278 }}
3270 className="operate-bar" 3279 className="operate-bar"
3271 >{operateTreeAdd}{operateTreeAddChild}{operateTreeCopyAll}{operateTreeDel}{operateAdd}{operatesAlumitePopup}{operatePopupModal}{operateCopy}{operateCopyAll}{operateReplace}{operateCopyMore}{operateMaterial}{operateProductMaterials}{operateMaterailRemark}{operateDel}{operateProcess}{operateParamModal}{operateDownload}{operateProductProcess}{operateExit} 3280 >{operateTreeAdd}{operateTreeAddChild}{operateTreeCopyAll}{operateTreeDel}{operateAdd}{operatesAlumitePopup}{operatePopupModal}{operateCopy}{operateCopyAll}{operateReplace}{operateCopyMore}{operateMaterial}{operateProductMaterials}{operateMaterailRemark}{operateDel}{operateProcess}{operateParamModal}{operateDownload}{operateProductProcess}{operateExit}
  3281 + {operateClear}
3272 </div>); 3282 </div>);
3273 }, 3283 },
3274 title: () => (this.props.setOpterationColumn === 'Y' && this.getTableFilterData() === 0 ? <span 3284 title: () => (this.props.setOpterationColumn === 'Y' && this.getTableFilterData() === 0 ? <span
@@ -3954,6 +3964,9 @@ class CommonTableRc extends React.Component { @@ -3954,6 +3964,9 @@ class CommonTableRc extends React.Component {
3954 exitTbRow = (index, record) => { 3964 exitTbRow = (index, record) => {
3955 this.props.onExitTbRow(index, record); 3965 this.props.onExitTbRow(index, record);
3956 } 3966 }
  3967 + clearTbRow = (index, record) => {
  3968 + this.props.onClearTbRow(index, record);
  3969 + }
3957 handleViewClick = (name, sName, record, index, showConfig, configName) => { 3970 handleViewClick = (name, sName, record, index, showConfig, configName) => {
3958 // console.log('vvvs', showConfig); 3971 // console.log('vvvs', showConfig);
3959 if (commonUtils.isNotEmptyObject(showConfig) && commonUtils.isNotEmptyObject(record)) { 3972 if (commonUtils.isNotEmptyObject(showConfig) && commonUtils.isNotEmptyObject(record)) {
src/components/Common/PersonCenter/PersonCenter.js
@@ -375,6 +375,20 @@ class PersonCenter extends Component { @@ -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 handleCancel = () => { 392 handleCancel = () => {
379 this.setState({ 393 this.setState({
380 userVisible: false, 394 userVisible: false,
@@ -724,6 +738,7 @@ class PersonCenter extends Component { @@ -724,6 +738,7 @@ class PersonCenter extends Component {
724 handleCancel={this.handleCancel} 738 handleCancel={this.handleCancel}
725 onSaveState={this.handleSaveOnlineUserState} 739 onSaveState={this.handleSaveOnlineUserState}
726 onExitTbRow={this.handleExitTbRow} 740 onExitTbRow={this.handleExitTbRow}
  741 + onClearTbRow={this.handleClearTbRow}
727 /> 742 />
728 {state.skinChangeModalVisible && 743 {state.skinChangeModalVisible &&
729 <SkinChangeModal 744 <SkinChangeModal
@@ -983,6 +998,7 @@ const PersonCenterOnlineUser = Form.create({ @@ -983,6 +998,7 @@ const PersonCenterOnlineUser = Form.create({
983 onSaveState, 998 onSaveState,
984 onlineUserState = {}, 999 onlineUserState = {},
985 onExitTbRow, 1000 onExitTbRow,
  1001 + onClearTbRow,
986 app, 1002 app,
987 } = props; 1003 } = props;
988 const { userinfo } = app; 1004 const { userinfo } = app;
@@ -1048,13 +1064,15 @@ const PersonCenterOnlineUser = Form.create({ @@ -1048,13 +1064,15 @@ const PersonCenterOnlineUser = Form.create({
1048 const onlineUserProps = { 1064 const onlineUserProps = {
1049 ...commonBusiness.getTableTypes('onlineUser', props), 1065 ...commonBusiness.getTableTypes('onlineUser', props),
1050 formId: commonUtils.createSid(), 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 config: onlineUserConfig, 1069 config: onlineUserConfig,
1053 headerColumn, 1070 headerColumn,
1054 data: commonUtils.isNotEmptyObject(onlineUserDataNew) ? onlineUserDataNew.data : [], 1071 data: commonUtils.isNotEmptyObject(onlineUserDataNew) ? onlineUserDataNew.data : [],
1055 onSaveState, 1072 onSaveState,
1056 onSelectRowChange: () => { }, 1073 onSelectRowChange: () => { },
1057 onExitTbRow, 1074 onExitTbRow,
  1075 + onClearTbRow,
1058 getDateFormat: () => 'YYYY-MM-DD hh:mm:ss', 1076 getDateFormat: () => 'YYYY-MM-DD hh:mm:ss',
1059 ...onlineUserState 1077 ...onlineUserState
1060 }; 1078 };