|
@@ -1,65 +1,57 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
<el-dialog
|
|
|
- :title="title"
|
|
|
- :visible.sync="visible"
|
|
|
- :key="reload"
|
|
|
- :before-close="handleCancel"
|
|
|
- width="700px"
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="visible"
|
|
|
+ :key="reload"
|
|
|
+ :before-close="handleCancel"
|
|
|
+ :width="width"
|
|
|
>
|
|
|
- <!-- 表格主体部分 -->
|
|
|
- <slot></slot>
|
|
|
- <!-- 表格底部 -->
|
|
|
- <div slot="footer">
|
|
|
- <el-button @click="handleCancel" size="small">取消</el-button>
|
|
|
- <el-button @click="handleConfirm" type="primary" size="small"
|
|
|
- >确定</el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
+ <!-- 表格主体部分 -->
|
|
|
+ <slot></slot>
|
|
|
+ <!-- 表格底部 -->
|
|
|
+ <div slot="footer">
|
|
|
+ <el-button @click="handleCancel" size="small">取消</el-button>
|
|
|
+ <el-button @click="handleConfirm" type="primary" size="small"
|
|
|
+ >确定</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
- </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- props: {
|
|
|
- visible: {
|
|
|
- type: Boolean,
|
|
|
- default: false,
|
|
|
+ props: {
|
|
|
+ visible: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ title: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
+ reload: {
|
|
|
+ type: Number,
|
|
|
+ default: 0,
|
|
|
+ },
|
|
|
+ width: {
|
|
|
+ type: String,
|
|
|
+ default: "500px",
|
|
|
+ },
|
|
|
},
|
|
|
- title: {
|
|
|
- type: String,
|
|
|
- default: "",
|
|
|
+ mounted() {
|
|
|
+ console.log("我被初始化了");
|
|
|
},
|
|
|
- reload: {
|
|
|
- type: Number,
|
|
|
- default: 0,
|
|
|
+ methods: {
|
|
|
+ // 确定的回调
|
|
|
+ handleConfirm() {
|
|
|
+ this.$emit("confirm", false);
|
|
|
+ },
|
|
|
+ // 取消的回调
|
|
|
+ handleCancel() {
|
|
|
+ this.$emit("cancel", false);
|
|
|
+ },
|
|
|
},
|
|
|
- reload: {
|
|
|
- type: Number,
|
|
|
- default: 0,
|
|
|
- },
|
|
|
- },
|
|
|
- data: () => ({
|
|
|
- object: {},
|
|
|
- }),
|
|
|
- mounted() {
|
|
|
- console.log("我被初始化了");
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 确定的回调
|
|
|
- handleConfirm() {
|
|
|
- this.object = {};
|
|
|
- this.$emit("confirm", { params: this.object, visible: false });
|
|
|
- },
|
|
|
- // 取消的回调
|
|
|
- handleCancel() {
|
|
|
- this.object = {};
|
|
|
- this.$emit("cancel", false);
|
|
|
- },
|
|
|
- },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
-</style>
|
|
|
+<style></style>
|