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

云资源管理列表优化

parent 0251e56c
......@@ -541,6 +541,11 @@ width: 620px!important;
background-color: #e1e4fb;
border-color: #e1e4fb;
}
.apass_button .el-button--danger {
color: #fff;
background-color: #e15260;
border-color: #e15260;
}
.apass_button .el-button.is-disabled,
.apass_button .el-button.is-disabled:focus,
.apass_button .el-button.is-disabled:hover {
......
......@@ -24,14 +24,15 @@
</div>
<div slot="footer" class="dialog_action apass_button" v-else>
<el-button
type="defalut"
v-if="!cancelHide"
:type="cancelType"
size="mini"
v-text="cancelText || '取消'"
@click="hide"
@click="dialogCancel"
>
</el-button>
<el-button
type="primary"
:type="sunbmitType"
size="mini"
v-text="sunbmitText || '确定'"
:disabled="submitDisable"
......@@ -63,16 +64,32 @@ export default {
type: String,
default: () => "",
},
cancelType: {
type: String,
default: () => "defalut",
},
cancelHide: {
type: Boolean,
default: () => false,
},
cancel: {
type: Function,
default: () => null,
},
sunbmitText: {
type: String,
default: () => "",
},
sunbmitType: {
type: String,
default: () => "primary",
},
submitDisable: {
type: Boolean,
default: () => false,
},
submit: {
type: [Function,String],
type: Function,
default: () => null,
},
},
......@@ -86,12 +103,18 @@ export default {
hide() {
this.showDialog = false;
},
dialogCancel() {
if (typeof this.cancel === "function") {
this.cancel();
}
this.$emit("cancel");
this.hide();
},
dialogSubmit() {
if (typeof this.submit === "function") {
this.submit();
} else {
this.$emit("submit");
}
this.$emit("submit");
this.hide();
},
},
......
......@@ -24,8 +24,11 @@
<apass-dialog
ref="dialog"
:title="dialogInfo.title"
:msg="dialogInfo.msg"
:cancel-text="dialogInfo.cancelText"
:cancel-type="dialogInfo.cancelType"
:cancel="dialogInfo.cancel"
:sunbmit-text="dialogInfo.sunbmitText"
:submit="dialogInfo.submit"
></apass-dialog>
</div>
......@@ -49,8 +52,11 @@ export default {
listData: [],
listTotal: 0,
dialogInfo: {
title: "",
msg: "",
cancelText: "",
cancelType: "",
cancel: null,
sunbmitText: "",
submit: null,
},
}),
......@@ -84,10 +90,28 @@ export default {
console.log("detailAction");
},
approveAction(item) {
console.log("approveAction");
this.dialogInfo.msg = "该工作区域的申请通过还是拒绝?";
this.dialogInfo.cancelText = "拒绝";
this.dialogInfo.cancelType = "danger";
this.dialogInfo.cancel = () => {
console.log("approveAction - false");
};
this.dialogInfo.sunbmitText = "通过";
this.dialogInfo.submit = () => {
console.log("approveAction - true");
};
this.showDialog();
},
deleteAction(item) {
console.log("deleteAction");
this.dialogInfo.msg = "确认要删除这条申请记录吗?";
this.dialogInfo.cancelText = "";
this.dialogInfo.cancelType = "";
this.dialogInfo.cancel = null;
this.dialogInfo.sunbmitText = "";
this.dialogInfo.submit = () => {
console.log("deleteAction");
};
this.showDialog();
},
},
created() {
......
......@@ -53,6 +53,7 @@
ref="dialog"
:title="dialogInfo.title"
:msg="dialogInfo.msg"
:cancel-hide="dialogInfo.cancelHide"
:submit="dialogInfo.submit"
></apass-dialog>
</div>
......@@ -78,8 +79,8 @@ export default {
listTotal: 0,
dashboardList: [],
dialogInfo: {
title: "",
msg: "",
cancelHide: false,
submit: null,
},
}),
......@@ -320,7 +321,30 @@ export default {
console.log("detailAction");
},
stateAction(item) {
console.log("stateAction");
this.dialogInfo.msg = "您确认要禁用该工作区域吗?";
this.dialogInfo.cancelHide = false;
this.dialogInfo.submit = () => {
console.log("deleteAction");
setTimeout(() => {
this.dialogInfo.msg = `该工作区域已被禁用,普通用户与组织管理员依旧能查看该工作区域,但无法做任何操作。`;
this.dialogInfo.cancelHide = true;
this.dialogInfo.submit = null;
this.showDialog();
}, 500);
};
this.showDialog();
},
deleteAction(item) {
this.dialogInfo.msg = `
您确认要移除该工作区域吗?</br>
<span style='color: #e15260;'>移除操作无法撤销</span>,您还要继续吗?
`;
this.dialogInfo.cancelHide = false;
this.dialogInfo.submit = () => {
console.log("deleteAction");
};
this.showDialog();
},
},
created() {
......@@ -403,7 +427,7 @@ export default {
label: "操作",
type: "buttons",
align: "center",
width: 80,
width: 160,
actionList: [
{
getLabel(item) {
......@@ -411,6 +435,11 @@ export default {
},
callback: this.stateAction,
},
{
label: "移除",
class: "warn",
callback: this.deleteAction,
},
],
},
];
......
......@@ -73,7 +73,6 @@
title="下载日志文件"
sunbmitText="保存"
:submitDisable="download_flag"
submit="file"
@submit="save_file"
>
<template slot="content">
......
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