This commit is contained in:
六如
2024-10-10 21:52:37 +08:00
parent e23911b075
commit dd11ab46be
23 changed files with 883 additions and 53 deletions

View File

@@ -7,7 +7,8 @@ const apiUrl: any = createUrl({
add: "/isv/add",
update: "/isv/update",
del: "/isv/delete",
getKeys: "/isv/getKeys"
getKeys: "/isv/getKeys",
updateStatus: "/isv/updateStatus"
});
/**
@@ -48,5 +49,12 @@ export const api: any = {
*/
viewKeys(params: object) {
return http.get<Result, any>(apiUrl.getKeys, { params });
},
/**
* 修改状态
* @param data 表单内容
*/
updateStatus(data: object) {
return http.post<Result, any>(apiUrl.updateStatus, { data });
}
};

View File

@@ -127,19 +127,27 @@ actionButtons.value = [
}
},
{
// 删除
text: "删除",
// 启用/禁用
text: row => (row.status === StatusEnum.ENABLE ? "禁用" : "启用"),
code: "delete",
props: {
type: "danger"
},
confirm: {
message: data => {
const opt = data.row.status === StatusEnum.ENABLE ? "禁用" : "启用";
return `确定${opt}吗?`;
},
options: { draggable: false }
},
onConfirm(params: ButtonsCallBackParams) {
api.del(params).then(() => {
const data = {
id: params.row.id,
status:
params.row.status === StatusEnum.ENABLE
? StatusEnum.DISABLE
: StatusEnum.ENABLE
};
api.updateStatus(data).then(() => {
ElMessage({
message: "删除成功",
message: "修改成功",
type: "success"
});
dlgShow.value = false;

View File

@@ -77,7 +77,7 @@ export const showKeysFormColumns: PlusFormGroupRow[] = [
export const viewKeys = (row: any) => {
const params = {
appId: row.appId
isvInfoId: row.id
};
api.viewKeys(params).then(resp => {
showKeysFormData.value = resp.data;

View File

@@ -156,7 +156,7 @@ actionButtons.value = [
}
},
{
// 删除
// 启用/禁用
text: row => (row.status === StatusEnum.ENABLE ? "禁用" : "启用"),
code: "delete",
confirm: {