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();
if (key == 1) {
Notify.success("标记为使用成功"); Notify.success("标记为使用成功");
}, return;
(err) => { } else {
Notify.error(err);
}
);
});
}
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("作废成功"); Notify.success("作废成功");
return;
}
}, },
(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,51 +692,8 @@ const UseKeyList = (props, ref) => {
); );
} }
if (com == "opearo") { if (com == "opearo") {
let str = null;
if (rowData.status == 1) {
str = (
<span> <span>
<a
className="grid-link"
style={{ paddingLeft: "2px", color: "#d8dbdd" }}
>
详情
</a>
<Dropdown position={DropdownPosition.RightTop}> <Dropdown position={DropdownPosition.RightTop}>
<DropdownClickTrigger>
<div className="linkmore" onClick={(e) => {}}>
{" "}
更多 <Icon type={"down"} />{" "}
</div>
</DropdownClickTrigger>
<DropdownContent>
<Menu
onClick={(e, key) => menuItemClick(e, key, rowData)}
>
<MenuItem key="1">标记成已使用</MenuItem>
<MenuItem key="2">作废</MenuItem>
<MenuItem key="3">日志</MenuItem>
</Menu>
</DropdownContent>
</Dropdown>
</span>
);
} else {
str = (
<span>
<a
className="grid-link"
style={{ paddingLeft: "2px", color: "#d8dbdd" }}
>
详情
</a>
<Dropdown position={DropdownPosition.RightTop}>
<DropdownClickTrigger>
<div className="linkmore" onClick={(e) => {}}>
{" "}
更多 <Icon type={"down"} />{" "}
</div>
</DropdownClickTrigger>
<DropdownContent> <DropdownContent>
<Menu <Menu
onClick={(e, key) => menuItemClick(e, key, rowData)} onClick={(e, key) => menuItemClick(e, key, rowData)}
@ -761,6 +704,35 @@ const UseKeyList = (props, ref) => {
<MenuItem key="2" disabled={rowData.status != 2}> <MenuItem key="2" disabled={rowData.status != 2}>
作废 作废
</MenuItem> </MenuItem>
</Menu>
</DropdownContent>
</Dropdown>
</span>;
return (
<span>
<a
className="grid-link"
style={{ paddingLeft: "2px", color: "#d8dbdd" }}
>
详情
</a>
<Dropdown position={DropdownPosition.RightTop}>
<DropdownClickTrigger>
<div className="linkmore">
更多 <Icon type={"down"} />
</div>
</DropdownClickTrigger>
<DropdownContent>
<Menu
onClick={(e, key) => menuItemClick(e, key, rowData)}
>
<MenuItem key="1" disabled={rowData.status != 1}>
标记成已使用
</MenuItem>
<MenuItem key="2" disabled={rowData.status != 2}>
作废
</MenuItem>
<MenuItem key="3">日志</MenuItem> <MenuItem key="3">日志</MenuItem>
</Menu> </Menu>
</DropdownContent> </DropdownContent>
@ -768,8 +740,6 @@ const UseKeyList = (props, ref) => {
</span> </span>
); );
} }
return str;
}
}} }}
/> />
</div> </div>

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,8 +907,13 @@ export default class acclist extends React.Component {
); );
} }
if (com == "opearo") { if (com == "opearo") {
let str = ( return (
<span> <span>
{rowData.status == 6 ? (
<a className="grid-link" style={{ color: "#d8dbdd" }}>
编辑
</a>
) : (
<a <a
className="grid-link" className="grid-link"
onClick={(e) => { onClick={(e) => {
@ -918,10 +922,24 @@ export default class acclist extends React.Component {
> >
编辑 编辑
</a> </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);
@ -929,16 +947,37 @@ export default class acclist extends React.Component {
> >
复制 复制
</span> </span>
)}
{/* 预览 */}
<span className="grid-link"> <span className="grid-link">
{this.currPreview(rowData)} {this.currPreview(rowData)}
</span> </span>
<Dropdown position={DropdownPosition.RightTop}> <Dropdown position={DropdownPosition.RightTop}>
<DropdownClickTrigger> <DropdownClickTrigger>
<div className="linkmore" onClick={(e) => {}}> <div className="linkmore">
{" "} 更多 <Icon type={"down"} />
更多 <Icon type={"down"} />{" "}
</div> </div>
</DropdownClickTrigger> </DropdownClickTrigger>
{rowData.status == 6 ? (
<DropdownContent></DropdownContent>
) : null}
{rowData.status == 0 ? (
<DropdownContent>
<Menu
onClick={(e, key) =>
this.menuItemClick(e, key, rowData)
}
>
<MenuItem key="4">删除</MenuItem>
</Menu>
</DropdownContent>
) : null}
{rowData.status != 0 || rowData.status != 6 ? (
<DropdownContent> <DropdownContent>
<Menu <Menu
onClick={(e, key) => onClick={(e, key) =>
@ -954,117 +993,10 @@ export default class acclist extends React.Component {
</MenuItem> </MenuItem>
</Menu> </Menu>
</DropdownContent> </DropdownContent>
) : null}
</Dropdown> </Dropdown>
</span> </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"
onClick={(e) => {
this.onEdit(e, rowData);
}}
>
编辑
</span>
<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" }}
onClick={(e) => {}}
>
{" "}
更多 <Icon type={"down"} />{" "}
</div>
</DropdownClickTrigger>
<DropdownContent>
<Menu
onClick={(e, key) =>
this.menuItemClick(e, key, rowData)
}
>
<MenuItem key="4">删除</MenuItem>
</Menu>
</DropdownContent>
</Dropdown>
</div>
);
}
if (rowData.status == 6) {
str = (
<div>
{" "}
<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) => {}}
>
{" "}
更多 <Icon type={"down"} />{" "}
</div>
</DropdownClickTrigger>
<DropdownContent></DropdownContent>
</Dropdown>
</div>
);
}
return str;
} }
}} }}
/> />