Просмотр исходного кода

Merge branch 'testToMerge' into allTestUrgent

# Conflicts:
#	src/components/dialogTemplate/index3.vue
qymljy 1 месяц назад
Родитель
Сommit
8f44e41c1c
2 измененных файлов с 55 добавлено и 12 удалено
  1. 10 12
      src/components/dialogTemplate/index3.vue
  2. 45 0
      src/components/dialogTemplate/index4.vue

+ 10 - 12
src/components/dialogTemplate/index3.vue

@@ -1,12 +1,10 @@
 <template>
   <div>
-    <el-button :type="disabled?'':btnType" size="mini" :disabled="disabled"  @click="dialogShow">{{$t(btnTitle)}}</el-button>
-    <el-dialog :title="logTitle?$t(logTitle):$t(`提示`)" :visible.sync="dialogTableVisible" append-to-body
-               :show-close="showClose" :width="logWidth?logWidth:'600px'">
-      <div style="margin-bottom: 20px"><i class="el-icon-warning" v-if="iconShow" style="color: #eda51c;margin-right: 10px"></i>{{$t(content) + '?'}}</div>
+    <el-dialog :title="dialogTitle?$t(dialogTitle):$t(`提示`)" :visible.sync="dialogTableVisible" append-to-body :show-close="false" width="600px">
       <slot name="formRule"></slot>
-      <div slot="footer" class="dialog-footer" style="margin-top: 0 !important;">
-        <slot name="footerBtn"></slot>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="onCancel" size="small">{{$t(`取 消`)}}</el-button>
+        <el-button :disabled="type == '必填' && content.length == 0" :type="btnType?btnType:'primary'" @click="onSubmit" size="small">{{$t(`确 定`)}}</el-button>
       </div>
     </el-dialog>
   </div>
@@ -14,8 +12,8 @@
 
 <script>
 export default {
-  name: "index1",
-  props:["btnTitle","disabled","btnType","content","logTitle","iconShow","showClose","logWidth"],
+  name: "index3",
+  props:["btnTitle","disabled","btnType","content",'dialogTitle','type'],
   data(){
     return {
       dialogTableVisible:false,
@@ -24,7 +22,7 @@ export default {
   methods:{
     dialogShow(){
       this.dialogTableVisible = true
-      this.$emit('showDialog')
+      this.$emit('dialogShow')
     },
     onCancel(){
       this.dialogTableVisible = false
@@ -39,7 +37,7 @@ export default {
 </script>
 
 <style scoped>
-  /deep/ .el-dialog__body {
-    padding: 0 20px 20px 20px !important;
-  }
+/deep/ .el-dialog__body {
+  padding: 0 20px 20px 20px !important;
+}
 </style>

+ 45 - 0
src/components/dialogTemplate/index4.vue

@@ -0,0 +1,45 @@
+<template>
+  <div>
+    <el-button :type="disabled?'':btnType" size="mini" :disabled="disabled"  @click="dialogShow">{{$t(btnTitle)}}</el-button>
+    <el-dialog :title="logTitle?$t(logTitle):$t(`提示`)" :visible.sync="dialogTableVisible" append-to-body
+               :show-close="showClose" :width="logWidth?logWidth:'600px'">
+      <div style="margin-bottom: 20px"><i class="el-icon-warning" v-if="iconShow" style="color: #eda51c;margin-right: 10px"></i>{{$t(content) + '?'}}</div>
+      <slot name="formRule"></slot>
+      <div slot="footer" class="dialog-footer" style="margin-top: 0 !important;">
+        <slot name="footerBtn"></slot>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "index4",
+  props:["btnTitle","disabled","btnType","content","logTitle","iconShow","showClose","logWidth"],
+  data(){
+    return {
+      dialogTableVisible:false,
+    }
+  },
+  methods:{
+    dialogShow(){
+      this.dialogTableVisible = true
+      this.$emit('showDialog')
+    },
+    onCancel(){
+      this.dialogTableVisible = false
+      this.$emit('onCancel')
+    },
+    onSubmit(){
+      this.$emit('onSubmit')
+    }
+  }
+
+}
+</script>
+
+<style scoped>
+/deep/ .el-dialog__body {
+  padding: 0 20px 20px 20px !important;
+}
+</style>