Forráskód Böngészése

重置输入框信息

FinalYu 2 éve
szülő
commit
4f7b5bfaed

+ 8 - 3
chuanyi_client2/src/components/LeftMenu/index.vue

@@ -125,13 +125,13 @@
             >{{dict.key}}</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label='帐号:' prop="ipUserName" v-show="connForm.isAnonymous != 1">
+        <el-form-item label='帐号:' prop="ipUserName" v-if="connForm.isAnonymous != 1">
           <el-input v-model='connForm.ipUserName'
                     type="text"
                     auto-complete="off"
                     placeholder="请输入帐号"></el-input>
         </el-form-item>
-        <el-form-item label='密码:' prop="ipPassword" key="ipPassword" v-show="connForm.isAnonymous != 1">
+        <el-form-item label='密码:' prop="ipPassword" key="ipPassword" v-if="connForm.isAnonymous != 1">
           <el-input v-model='connForm.ipPassword'
                     type="password"
                     auto-complete="new-password"
@@ -510,7 +510,11 @@ export default {
       if (!this.checkDataSourceParam(type, true)) {
         return
       }
-      this.handleWithConnect(type)
+      this.$refs['connForm'].validate(valid => {
+        if (valid) {
+          this.handleWithConnect(type)
+        }
+      })
     },
     /** 处理连接 */
     handleWithConnect(type) {
@@ -656,6 +660,7 @@ export default {
     handleCancel(type) {
       switch (type) {
         case 'conn':
+          this.initConfigForm()
           this.$refs['connForm'].resetFields()
           this.driverList = []
           this.connDialogVisible = false

+ 1 - 0
chuanyi_client2/src/views/data_model/index.vue

@@ -350,6 +350,7 @@ export default {
     dialogClose(done) {
       this.getAllDataModel()
       if (typeof(done) === 'function') {
+        this.$refs['dataModelForm'].resetFields()
         done()
       } else {
         this.dialogDataModelVisible = false