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

apassDialog弹窗组件优化

parent 04951361
...@@ -9,12 +9,27 @@ ...@@ -9,12 +9,27 @@
<h3 class="dialog_title" slot="title"> <h3 class="dialog_title" slot="title">
<span v-text="title"></span> <span v-text="title"></span>
</h3> </h3>
<div class="dialog_content appas_table">
<div v-if="$slots.content" class="dialog_content appas_table">
<slot name="content"></slot> <slot name="content"></slot>
</div> </div>
<div slot="footer" class="dialog_action apass_button"> <p v-else class="dialog_msg" v-text="msg"></p>
<div
v-if="$slots.action"
slot="footer"
class="dialog_action apass_button"
>
<slot name="action"></slot> <slot name="action"></slot>
</div> </div>
<div v-else slot="footer" class="dialog_action apass_button">
<el-button type="defalut" size="mini" @click="hide">
取消
</el-button>
<el-button type="primary" size="mini" @click="dialogSubmit">
确定
</el-button>
</div>
</el-dialog> </el-dialog>
</transition> </transition>
</template> </template>
...@@ -31,6 +46,10 @@ export default { ...@@ -31,6 +46,10 @@ export default {
type: String, type: String,
default: () => "", default: () => "",
}, },
msg: {
type: String,
default: () => "",
},
}, },
data: () => ({ data: () => ({
showDialog: false, showDialog: false,
...@@ -42,6 +61,10 @@ export default { ...@@ -42,6 +61,10 @@ export default {
hide() { hide() {
this.showDialog = false; this.showDialog = false;
}, },
dialogSubmit() {
this.$emit("submit");
this.hide();
},
}, },
}; };
</script> </script>
...@@ -64,6 +87,12 @@ export default { ...@@ -64,6 +87,12 @@ export default {
font-weight: bold; font-weight: bold;
color: #1d1e20; color: #1d1e20;
} }
.dialog_msg {
font-size: 18px;
line-height: 34px;
color: #58617a;
margin: 30px 0 10px;
}
</style> </style>
<style> <style>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
:visible.sync="show" :visible.sync="show"
width="400px" width="400px"
top="25vh" top="25vh"
class="dialog_action"
:class="{'user-dialog':true,'out':confirmOptions.position}" :class="{'user-dialog':true,'out':confirmOptions.position}"
> >
<span slot="title"> <span slot="title">
...@@ -62,7 +63,7 @@ export default { ...@@ -62,7 +63,7 @@ export default {
}; };
</script> </script>
<style> <style>
.el-dialog__header { .dialog_action .el-dialog__header {
border-bottom: 1px solid #edf0ff; border-bottom: 1px solid #edf0ff;
padding: 20px 20px 16px !important; padding: 20px 20px 16px !important;
font-family: "MicrosoftYaHei"; font-family: "MicrosoftYaHei";
...@@ -70,7 +71,7 @@ export default { ...@@ -70,7 +71,7 @@ export default {
color: #1d1e20; color: #1d1e20;
font-weight: 800; font-weight: 800;
} }
.el-dialog__header .iconLeft { .dialog_action .el-dialog__header .iconLeft {
width: 4px; width: 4px;
height: 16px; height: 16px;
background-color: #0367f6; background-color: #0367f6;
...@@ -79,23 +80,23 @@ export default { ...@@ -79,23 +80,23 @@ export default {
vertical-align: middle; vertical-align: middle;
margin-right: 3px; margin-right: 3px;
} }
.el-icon-close:before { .dialog_action .el-icon-close:before {
font-weight: 800 !important; font-weight: 800 !important;
} }
.el-dialog__body { .dialog_action .el-dialog__body {
padding: 49px 20px !important; padding: 49px 20px !important;
} }
.out .el-dialog__body{ .dialog_action .out .el-dialog__body{
text-align: left; text-align: left;
} }
</style> </style>
<style scoped> <style scoped>
.group-dialog.el-dialog__wrapper { .dialog_action .group-dialog.el-dialog__wrapper {
width: 100% !important; width: 100% !important;
left: 0 !important; left: 0 !important;
overflow: hidden; overflow: hidden;
} }
.user-dialog { .dialog_action .user-dialog {
overflow: hidden; overflow: hidden;
} }
</style> </style>
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
:visible.sync="show" :visible.sync="show"
width="400px" width="400px"
top="25vh" top="25vh"
class="dialog_action"
:class="this.confirmModalOptions.className ? this.confirmModalOptions.className : 'user-dialog'" :class="this.confirmModalOptions.className ? this.confirmModalOptions.className : 'user-dialog'"
> >
<span slot="title"> <span slot="title">
...@@ -109,7 +110,7 @@ export default { ...@@ -109,7 +110,7 @@ export default {
}; };
</script> </script>
<style> <style>
.el-dialog__header { .dialog_action .el-dialog__header {
border-bottom: 1px solid #edf0ff; border-bottom: 1px solid #edf0ff;
padding: 20px 20px 16px !important; padding: 20px 20px 16px !important;
font-family: "MicrosoftYaHei"; font-family: "MicrosoftYaHei";
...@@ -117,7 +118,7 @@ export default { ...@@ -117,7 +118,7 @@ export default {
color: #1d1e20; color: #1d1e20;
font-weight: 800; font-weight: 800;
} }
.el-dialog__header .iconLeft { .dialog_action .el-dialog__header .iconLeft {
width: 4px; width: 4px;
height: 16px; height: 16px;
background-color: #0367f6; background-color: #0367f6;
...@@ -126,20 +127,20 @@ export default { ...@@ -126,20 +127,20 @@ export default {
vertical-align: middle; vertical-align: middle;
margin-right: 3px; margin-right: 3px;
} }
.el-icon-close:before { .dialog_action .el-icon-close:before {
font-weight: 800 !important; font-weight: 800 !important;
} }
.el-dialog__body { .dialog_action .el-dialog__body {
padding: 49px 20px !important; padding: 49px 20px !important;
} }
</style> </style>
<style scoped> <style scoped>
.group-dialog.el-dialog__wrapper { .dialog_action .group-dialog.el-dialog__wrapper {
width: 100% !important; width: 100% !important;
left: 0 !important; left: 0 !important;
overflow: hidden; overflow: hidden;
} }
.user-dialog { .dialog_action .user-dialog {
overflow: hidden; overflow: hidden;
} }
</style> </style>
\ No newline at end of file
...@@ -30,16 +30,12 @@ ...@@ -30,16 +30,12 @@
></organization-list> ></organization-list>
</apass-list> </apass-list>
<apass-dialog ref="dialog" title="提示"> <apass-dialog
<p slot="content" style="text-align: left;">确认删除该组织吗?</p> ref="dialog"
<template slot="action"> title="提示"
<el-button type="defalut" size="mini" @click="dialogHide"> msg="确认删除该组织吗?"
取消 @submit="dialogSubmit"
</el-button> >
<el-button type="primary" size="mini" @click="dialogSubmit">
确定
</el-button>
</template>
</apass-dialog> </apass-dialog>
</div> </div>
</template> </template>
...@@ -170,17 +166,10 @@ export default { ...@@ -170,17 +166,10 @@ export default {
console.log(value); console.log(value);
}, },
deleteAction(item) { deleteAction(item) {
this.dialogShow();
},
dialogShow() {
this.$refs.dialog.show(); this.$refs.dialog.show();
}, },
dialogHide() {
this.$refs.dialog.hide();
},
dialogSubmit() { dialogSubmit() {
console.log("dialog submit"); console.log("dialog submit");
this.dialogHide();
}, },
}, },
}; };
......
...@@ -76,7 +76,12 @@ ...@@ -76,7 +76,12 @@
</el-table> </el-table>
</apass-list> </apass-list>
<apass-dialog ref="dialog" width="590px" title="分配角色"> <apass-dialog
ref="dialog"
width="590px"
title="分配角色"
@submit="dialogSubmit"
>
<el-table <el-table
slot="content" slot="content"
:border="false" :border="false"
...@@ -96,14 +101,6 @@ ...@@ -96,14 +101,6 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<template slot="action">
<el-button type="defalut" size="mini" @click="dialogHide">
取消
</el-button>
<el-button type="primary" size="mini" @click="dialogSubmit">
确定
</el-button>
</template>
</apass-dialog> </apass-dialog>
</div> </div>
</template> </template>
...@@ -189,7 +186,7 @@ export default { ...@@ -189,7 +186,7 @@ export default {
}, },
setRole(item) { setRole(item) {
console.log("setRole " + item.name); console.log("setRole " + item.name);
this.dialogShow(); this.$refs.dialog.show();
}, },
setState(item) { setState(item) {
console.log("setState " + item.name); console.log("setState " + item.name);
...@@ -197,15 +194,8 @@ export default { ...@@ -197,15 +194,8 @@ export default {
dialogSelectionChange(values) { dialogSelectionChange(values) {
console.log(values); console.log(values);
}, },
dialogShow() {
this.$refs.dialog.show();
},
dialogHide() {
this.$refs.dialog.hide();
},
dialogSubmit() { dialogSubmit() {
console.log("dialog submit"); console.log("dialog submit");
this.dialogHide();
}, },
}, },
}; };
......
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