Browse Source

rename & fixed components-props bug

hare8999@163.com 2 years ago
parent
commit
09a8795a3b

+ 19 - 5
src/components/UploadDialog/index.vue

@@ -3,7 +3,7 @@
     <el-dialog
       :title="title"
       class="upload-upload"
-      :visible.sync="dialogVisible"
+      :visible.sync="topVisible"
       :before-close="handleClose"
       :width="selectType ? '50%' : '30%'">
       <template v-if="selectType">
@@ -57,13 +57,13 @@
         </div>
       </template>
 
-      <div v-else class="text-center" style="    margin: 20px 0 50px 0;">
+      <div v-else class="text-center" style="margin: 20px 0 50px 0;">
         <el-button v-if="pageName" :type="type==1?'primary':''" @click="type=1">{{ pageName }}</el-button>
         <el-button v-if="isZdy" :type="type==2?'primary':''" @click="type=2,visible=true" style="margin-left:20px">自定义
         </el-button>
       </div>
       <div class="text-center">
-        <el-button type="primary" style="margin-top: 20px;" round @click="handleSave">确定上传</el-button>
+        <el-button type="primary" style="margin-top: 20px;" round @click="handleSave">确定{{ scene }}</el-button>
       </div>
     </el-dialog>
 
@@ -74,7 +74,8 @@
         </el-form-item>
       </el-form>
       <div class="text-center">
-        <el-button type="primary" round @click="save" style=" margin-top: 30px;margin-bottom: 30px;">确定上传</el-button>
+        <el-button type="primary" round @click="save" style=" margin-top: 30px;margin-bottom: 30px;">确定{{ scene }}
+        </el-button>
       </div>
     </el-dialog>
 
@@ -108,11 +109,14 @@ export default {
     selectType: {
       type: String,
       default: ''
+    },
+    scene: {
+      type: String,
+      default: '上传'
     }
   },
   data() {
     return {
-      // dialogVisible:true,
       form: {
         name: ''
       },
@@ -141,6 +145,16 @@ export default {
       remark: ''
     }
   },
+  computed: {
+    topVisible: {
+      get: function() {
+        return this.dialogVisible
+      },
+      set: function(val) {
+        this.$emit('update:dialogVisible', val)
+      }
+    }
+  },
   watch: {
     'gradeId': function(value) {
       this.checkList = []

+ 1 - 0
src/views/accurateTeaching/custom/custom.vue

@@ -98,6 +98,7 @@
       :title="title"
       :pageName="pageName"
       :dialogVisible="dialogVisible"
+      scene="下载"
       @handleClose="handleClose"
       @dialogVisibleClose="dialogVisibleClose"
     ></upload-dialog>

+ 2 - 1
src/views/cloudTank/index.vue

@@ -80,7 +80,8 @@
       v-if="dialogVisible"
       :title="title"
       :page-name="queryParams.category"
-      :dialogVisible="dialogVisible"
+      :dialogVisible.sync="dialogVisible"
+      scene="下载"
       @handleClose="handleClose"
       @dialogVisibleClose="dialogVisibleClose"
     ></upload-dialog>