瀏覽代碼

Merge branch 'master' of https://git.agilestar.cn/spfm-group/spfm-market-front

daiqisheng 3 年之前
父節點
當前提交
3cc308952a
共有 1 個文件被更改,包括 43 次插入51 次删除
  1. 43 51
      src/pages/main/performance/components/dialog.vue

+ 43 - 51
src/pages/main/performance/components/dialog.vue

@@ -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>