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

View File

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