in src/routes/System/AppAuth/index.js [323:450]
initPluginColumns() {
this.setState({
columns: [
{
align: "center",
title: "AppKey",
dataIndex: "appKey",
key: "appKey",
ellipsis:true,
width: 320,
},
{
align: "center",
title: getIntlContent("SHENYU.AUTH.ENCRYPTKEY"),
dataIndex: "appSecret",
key: "appSecret",
ellipsis:true,
width: 320,
},
{
align: "center",
title: `${getIntlContent("SHENYU.SYSTEM.USER")}Id`,
dataIndex: "userId",
key: "userId",
ellipsis:true,
width: 80,
},
{
align: "center",
title: getIntlContent("SHENYU.AUTH.TEL"),
dataIndex: "phone",
key: "phone",
ellipsis:true,
width: 120,
},
{
align: "center",
title: getIntlContent("SHENYU.AUTH.OPENPATH"),
dataIndex: "open",
key: "open",
ellipsis:true,
width: 80,
render: text => {
if (text) {
return <div className="open">{getIntlContent("SHENYU.COMMON.OPEN")}</div>;
} else {
return <div className="close">{getIntlContent("SHENYU.COMMON.CLOSE")}</div>;
}
}
},
{
align: "center",
title: getIntlContent("SHENYU.SYSTEM.STATUS"),
dataIndex: "enabled",
key: "enabled",
ellipsis:true,
width: 80,
render: text => {
if (text) {
return <div className="open">{getIntlContent("SHENYU.COMMON.OPEN")}</div>;
} else {
return <div className="close">{getIntlContent("SHENYU.COMMON.CLOSE")}</div>;
}
}
},
{
align: "center",
title: getIntlContent("SHENYU.SYSTEM.UPDATETIME"),
dataIndex: "dateUpdated",
render: dateUpdated => dayjs(dateUpdated).format('YYYY-MM-DD HH:mm:ss' ),
key: "dateUpdated",
ellipsis:true,
sorter: (a,b) => a.dateUpdated > b.dateUpdated ? 1 : -1,
},
{
align: "center",
title: getIntlContent("SHENYU.COMMON.OPERAT"),
dataIndex: "operate",
key: "operate",
ellipsis:true,
width: 80,
fixed: "right",
render: (text, record) => {
return (
<AuthButton perms="system:authen:edit">
<div
className="edit"
onClick={() => {
this.editClick(record);
}}
>
{getIntlContent("SHENYU.SYSTEM.EDITOR")}
</div>
</AuthButton>
);
}
},
{
align: "center",
title: getIntlContent("SHENYU.AUTH.OPERATPATH"),
dataIndex: "operates",
key: "operates",
ellipsis:true,
width: 140,
fixed: "right",
render: (text, record) => {
if(record.open){
return (
// 弹窗中的编辑事件
<AuthButton perms="system:authen:editResourceDetails">
<div
className="edit"
onClick={() => {
this.editClickMeta(record);
}}
>
{getIntlContent("SHENYU.AUTH.EDITOR.RESOURCE")}
</div>
</AuthButton>
);
} else {
return null;
}
}
}
]
})
}