key码列表新增重置功能

This commit is contained in:
xiaogang 2024-08-06 11:02:06 +08:00
parent c851310040
commit 577cb675e2
2 changed files with 41 additions and 1 deletions

View File

@ -738,6 +738,11 @@ export const getkeyDetailList = (id, data) => {
return req("get", baseurl + "/key/" + id, data)
}
// key码重置
export const resetKey = (data) => {
return req("put", baseurl + "/key/reset", data)
}
//提交审核
export const approvals = (id, data) => {
return req("post", baseurl + "/plan/" + id + "/approvals", data)

View File

@ -7,7 +7,8 @@ import {
keyBatchCancel,
keyBatchUsage,
keyCancel,
keyUsage
keyUsage,
resetKey
} from "@/assets/api.js"
import menu from "@/assets/enum.js"
import UseUploadExcel from "@/components/UseUploadExcel"
@ -476,6 +477,35 @@ const UseKeyList = () => {
}
const menuItemClick = (e, key, rowData) => {
//key
if(Number(key) === 5){
Sweetalert.confirm({
type: "warning",
closeBtn: true,
title: "确认操作",
content: <p>确定重置{rowData.title}的key码</p>,
onConfirm() {
let formdata = {
key: rowData.key
}
resetKey(formdata).then((res) => {
handelResponse(
res,
(req, msg) => {
setState({ page: 1, limit: 10, isQuery: !state.isQuery })
Notify.success("重置key码成功")
},
(err) => {
Notify.error(err)
}
)
})
},
onCancel() {},
className: "questModal",
parentComponent: this
})
}
if (Number(key) === 1) {
let formdata = {
key: rowData.key
@ -798,6 +828,11 @@ const UseKeyList = () => {
<MenuItem key="4" disabled={![1, 2].includes(rowData.status)}>
编辑key码有效期
</MenuItem>
<MenuItem
key="5"
>
重置
</MenuItem>
<MenuItem
key="2"
disabled={rowData.status !== 4 && rowData.status !== 3 ? false : true}