Commit a86f0844 authored by 徐一鸣's avatar 徐一鸣

云资源管理接口调试

parent af5a9323
......@@ -94,15 +94,48 @@ export default {
});
},
approveAction(item) {
let action = (type) => {
this.$http
.put("/apaas/service/v3/resource/apply/approve", null, {
params: {
apply_id: item.apply_id,
apply_type: item.apply_type,
cloud_id: item.id,
apply_state: type,
},
})
.then(({ data }) => {
if (data.success == 1) {
this.$message({
message: data.errMsg || `操作成功.`,
type: "success",
});
this.init(this.tempFilter);
} else {
this.$message({
message: data.errMsg || "操作失败",
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
this.$message({
message: "操作失败",
type: "warning",
});
});
};
this.dialogInfo.msg = "该工作区域的申请通过还是拒绝?";
this.dialogInfo.cancelText = "拒绝";
this.dialogInfo.cancelType = "danger";
this.dialogInfo.cancel = () => {
console.log("approveAction - false");
action(-1);
};
this.dialogInfo.sunbmitText = "通过";
this.dialogInfo.submit = () => {
console.log("approveAction - true");
action(1);
};
this.showDialog();
},
......
......@@ -2037,6 +2037,7 @@ export default {
<style scoped>
.service_management_list {
height: 100%;
min-width: 1500px;
}
.cloud_title {
margin-top: 15px;
......
......@@ -83,12 +83,15 @@ export default {
cancelHide: false,
submit: null,
},
tempFilter: null,
}),
computed: {},
methods: {
init(filter) {
// console.log(filter);
this.tempFilter = filter;
this.$http
.get("/apaas/service/v3/resource/user/apply/list", {
params: {
......@@ -323,19 +326,59 @@ export default {
});
},
stateAction(item) {
let action = (type, cb) => {
this.$http
.put("/apaas/service/v3/resource/apply/disable", null, {
params: {
id: item.id,
type,
},
})
.then(({ data }) => {
if (data.success == 1) {
typeof cb == "function" && cb();
this.init(this.tempFilter);
} else {
this.$message({
message: data.errMsg || "操作失败",
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
this.$message({
message: "操作失败",
type: "warning",
});
});
};
if (item.state == 1) {
this.dialogInfo.msg = "您确认要禁用该工作区域吗?";
this.dialogInfo.cancelHide = false;
this.dialogInfo.submit = () => {
console.log("deleteAction");
setTimeout(() => {
action(0, () => {
this.dialogInfo.msg = `该工作区域已被禁用,普通用户与组织管理员依旧能查看该工作区域,但无法做任何操作。`;
this.dialogInfo.cancelHide = true;
this.dialogInfo.submit = null;
this.showDialog();
}, 500);
});
};
this.showDialog();
} else {
this.dialogInfo.msg = "您确认要启用该工作区域吗?";
this.dialogInfo.cancelHide = false;
this.dialogInfo.submit = () => {
action(1, () => {
this.$message({
message: "该工作区域已被启用",
type: "success",
});
});
};
this.showDialog();
}
},
deleteAction(item) {
this.dialogInfo.msg = `
......@@ -344,7 +387,34 @@ export default {
`;
this.dialogInfo.cancelHide = false;
this.dialogInfo.submit = () => {
console.log("deleteAction");
this.$http
.delete("/apaas/service/v3/resource/apply/remove", {
params: {
id: item.id,
name_space: item.name_space,
use_uid: item.use_uid,
},
})
.then(({ data }) => {
if (data.success) {
this.$message({
message: data.errMsg || `删除${item.name_space}成功.`,
type: "success",
});
this.init(this.tempFliter);
} else {
this.$message({
message: data.errMsg,
type: "warning",
});
}
})
.catch((error) => {
this.$message({
message: `删除${item.name}失败.`,
type: "warning",
});
});
};
this.showDialog();
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment