1) 修复立减金复制不能编辑 2)修复列表状态操作

This commit is contained in:
zhangds 2022-08-15 11:28:08 +08:00
parent 305d9263be
commit 42a8e419a8
4 changed files with 1015 additions and 1064 deletions

View File

@ -510,6 +510,7 @@ export default class add extends React.Component {
this.onStyleChange(e); this.onStyleChange(e);
}} }}
keyStyle={this.state.keyStyle} keyStyle={this.state.keyStyle}
isCopy={true}
isload={this.state.isload} isload={this.state.isload}
direct_reseller_id={this.state.direct_reseller_id} direct_reseller_id={this.state.direct_reseller_id}
name={index} name={index}

File diff suppressed because it is too large Load Diff

View File

@ -489,7 +489,7 @@ const UseKeyList = (props, ref) => {
}; };
const menuItemClick = (e, key, rowData) => { const menuItemClick = (e, key, rowData) => {
if (key == 1) { if (key == 1 || key == 2) {
let formdata = { let formdata = {
key: rowData.key, key: rowData.key,
}; };
@ -503,29 +503,13 @@ const UseKeyList = (props, ref) => {
}; };
dispatch({ type: "setPages", payload: data }); dispatch({ type: "setPages", payload: data });
getTable(); getTable();
Notify.success("标记为使用成功"); if (key == 1) {
}, Notify.success("标记为使用成功");
(err) => { return;
Notify.error(err); } else {
} Notify.success("作废成功");
); return;
}); }
}
if (key == 2) {
let formdata = {
key: rowData.key,
};
keyCancel(formdata).then((res) => {
handelResponse(
res,
(req, msg) => {
let data = {
page: 1,
limit: 10,
};
dispatch({ type: "setPages", payload: data });
getTable();
Notify.success("作废成功");
}, },
(err) => { (err) => {
Notify.error(err); Notify.error(err);
@ -562,10 +546,12 @@ const UseKeyList = (props, ref) => {
const bachOnClose = () => { const bachOnClose = () => {
setBachUploadPop({ ...bachUploadPop, bachVisible: false }); setBachUploadPop({ ...bachUploadPop, bachVisible: false });
}; };
const bachImportBtn = (data) => { const bachImportBtn = (data) => {
if (bachUploadPop.bachApiType === 1) { if (bachUploadPop.bachApiType === 1) {
dispatch({ type: "setPages", payload: { page: 1 } });
dispatch({ type: "setHash", payload: data }); dispatch({ type: "setHash", payload: data });
getTable({ hash: data }); getTable({ hash: data, page: 1 });
return; return;
} }
if (bachUploadPop.bachApiType === 2) { if (bachUploadPop.bachApiType === 2) {
@ -706,69 +692,53 @@ const UseKeyList = (props, ref) => {
); );
} }
if (com == "opearo") { if (com == "opearo") {
let str = null; <span>
if (rowData.status == 1) { <Dropdown position={DropdownPosition.RightTop}>
str = ( <DropdownContent>
<span> <Menu
<a onClick={(e, key) => menuItemClick(e, key, rowData)}
className="grid-link"
style={{ paddingLeft: "2px", color: "#d8dbdd" }}
> >
详情 <MenuItem key="1" disabled>
</a> 标记成已使用
<Dropdown position={DropdownPosition.RightTop}> </MenuItem>
<DropdownClickTrigger> <MenuItem key="2" disabled={rowData.status != 2}>
<div className="linkmore" onClick={(e) => {}}> 作废
{" "} </MenuItem>
更多 <Icon type={"down"} />{" "} </Menu>
</div> </DropdownContent>
</DropdownClickTrigger> </Dropdown>
<DropdownContent> </span>;
<Menu
onClick={(e, key) => menuItemClick(e, key, rowData)} return (
> <span>
<MenuItem key="1">标记成已使用</MenuItem> <a
<MenuItem key="2">作废</MenuItem> className="grid-link"
<MenuItem key="3">日志</MenuItem> style={{ paddingLeft: "2px", color: "#d8dbdd" }}
</Menu> >
</DropdownContent> 详情
</Dropdown> </a>
</span> <Dropdown position={DropdownPosition.RightTop}>
); <DropdownClickTrigger>
} else { <div className="linkmore">
str = ( 更多 <Icon type={"down"} />
<span> </div>
<a </DropdownClickTrigger>
className="grid-link" <DropdownContent>
style={{ paddingLeft: "2px", color: "#d8dbdd" }} <Menu
> onClick={(e, key) => menuItemClick(e, key, rowData)}
详情 >
</a> <MenuItem key="1" disabled={rowData.status != 1}>
<Dropdown position={DropdownPosition.RightTop}> 标记成已使用
<DropdownClickTrigger> </MenuItem>
<div className="linkmore" onClick={(e) => {}}> <MenuItem key="2" disabled={rowData.status != 2}>
{" "} 作废
更多 <Icon type={"down"} />{" "} </MenuItem>
</div> <MenuItem key="3">日志</MenuItem>
</DropdownClickTrigger> </Menu>
<DropdownContent> </DropdownContent>
<Menu </Dropdown>
onClick={(e, key) => menuItemClick(e, key, rowData)} </span>
> );
<MenuItem key="1" disabled>
标记成已使用
</MenuItem>
<MenuItem key="2" disabled={rowData.status != 2}>
作废
</MenuItem>
<MenuItem key="3">日志</MenuItem>
</Menu>
</DropdownContent>
</Dropdown>
</span>
);
}
return str;
} }
}} }}
/> />

View File

@ -550,7 +550,6 @@ export default class acclist extends React.Component {
} }
// 一键复制 // 一键复制
onCopy(e, row) { onCopy(e, row) {
console.log("row =>", row);
sessionStorage.setItem("showflag", true); sessionStorage.setItem("showflag", true);
let editarr = [ let editarr = [
{ {
@ -908,91 +907,39 @@ export default class acclist extends React.Component {
); );
} }
if (com == "opearo") { if (com == "opearo") {
let str = ( return (
<span> <span>
<a {rowData.status == 6 ? (
className="grid-link" <a className="grid-link" style={{ color: "#d8dbdd" }}>
onClick={(e) => { 编辑
this.onEdit(e, rowData); </a>
}} ) : (
> <a
编辑
</a>
<span
className="grid-link"
style={{
color: rowData.status === 0 ? "#ccc" : "#2B66F2",
}}
onClick={(e) => {
this.onCopy(e, rowData);
}}
>
复制
</span>
<span className="grid-link">
{this.currPreview(rowData)}
</span>
<Dropdown position={DropdownPosition.RightTop}>
<DropdownClickTrigger>
<div className="linkmore" onClick={(e) => {}}>
{" "}
更多 <Icon type={"down"} />{" "}
</div>
</DropdownClickTrigger>
<DropdownContent>
<Menu
onClick={(e, key) =>
this.menuItemClick(e, key, rowData)
}
>
<MenuItem key="1">发送密码及压缩包</MenuItem>
<MenuItem key="2" disabled>
日志
</MenuItem>
<MenuItem key="3" disabled={this.state.isCancel}>
作废
</MenuItem>
</Menu>
</DropdownContent>
</Dropdown>
</span>
);
// if(rowData.status ==6 ||rowData.status == 0 )
// {
// str = <span>
// <a className="grid-link" onClick={(e)=>{this.onEdit(e,rowData)} } >编辑</a>
// <Dropdown position={DropdownPosition.RightTop }>
// <DropdownClickTrigger>
// <div className="linkmore" onClick={(e)=>{
// Notify.clear();
// Notify.error("该状态下的数据不允许编辑")
// return
// }}> 更多 <Icon type={"down"} /> </div>
// </DropdownClickTrigger>
// <DropdownContent>
// </DropdownContent>
// </Dropdown>
// </span>
// }
if (rowData.status == 0) {
str = (
<div>
{" "}
<span
className="grid-link" className="grid-link"
onClick={(e) => { onClick={(e) => {
this.onEdit(e, rowData); this.onEdit(e, rowData);
}} }}
> >
编辑 编辑
</span> </a>
)}
{rowData.status == 0 ||
rowData.status == 2 ||
rowData.status == 7 ? (
<span <span
className="grid-link" className="grid-link"
style={{ style={{
color: rowData.status === 0 ? "#ccc" : "#2B66F2", color: "#d8dbdd",
}}
>
复制
</span>
) : (
<span
className="grid-link"
style={{
color: "#2B66F2",
}} }}
onClick={(e) => { onClick={(e) => {
this.onCopy(e, rowData); this.onCopy(e, rowData);
@ -1000,20 +947,25 @@ export default class acclist extends React.Component {
> >
复制 复制
</span> </span>
<span className="grid-link"> )}
{this.currPreview(rowData)}
</span> {/* 预览 */}
<Dropdown position={DropdownPosition.RightTop}> <span className="grid-link">
<DropdownClickTrigger> {this.currPreview(rowData)}
<div </span>
className="linkmore"
style={{ paddingLeft: "2px" }} <Dropdown position={DropdownPosition.RightTop}>
onClick={(e) => {}} <DropdownClickTrigger>
> <div className="linkmore">
{" "} 更多 <Icon type={"down"} />
更多 <Icon type={"down"} />{" "} </div>
</div> </DropdownClickTrigger>
</DropdownClickTrigger>
{rowData.status == 6 ? (
<DropdownContent></DropdownContent>
) : null}
{rowData.status == 0 ? (
<DropdownContent> <DropdownContent>
<Menu <Menu
onClick={(e, key) => onClick={(e, key) =>
@ -1023,48 +975,28 @@ export default class acclist extends React.Component {
<MenuItem key="4">删除</MenuItem> <MenuItem key="4">删除</MenuItem>
</Menu> </Menu>
</DropdownContent> </DropdownContent>
</Dropdown> ) : null}
</div>
); {rowData.status != 0 || rowData.status != 6 ? (
} <DropdownContent>
if (rowData.status == 6) { <Menu
str = ( onClick={(e, key) =>
<div> this.menuItemClick(e, key, rowData)
{" "} }
<a className="grid-link" style={{ color: "#d8dbdd" }}>
编辑
</a>
<span
className="grid-link"
style={{
color: rowData.status === 0 ? "#ccc" : "#2B66F2",
}}
onClick={(e) => {
this.onCopy(e, rowData);
}}
>
复制
</span>
<span className="grid-link">
{this.currPreview(rowData)}
</span>
<Dropdown position={DropdownPosition.RightTop}>
<DropdownClickTrigger>
<div
className="linkmore"
style={{ paddingLeft: "2px", color: "#d8dbdd" }}
onClick={(e) => {}}
> >
{" "} <MenuItem key="1">发送密码及压缩包</MenuItem>
更多 <Icon type={"down"} />{" "} <MenuItem key="2" disabled>
</div> 日志
</DropdownClickTrigger> </MenuItem>
<DropdownContent></DropdownContent> <MenuItem key="3" disabled={this.state.isCancel}>
</Dropdown> 作废
</div> </MenuItem>
); </Menu>
} </DropdownContent>
return str; ) : null}
</Dropdown>
</span>
);
} }
}} }}
/> />