{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\mail\\mailSettingEdit.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\mail\\mailSettingEdit.vue","mtime":1667327529622},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\babel.config.js","mtime":1667327525434},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.constructor\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport { mapState, mapActions } from \"vuex\";\nimport { Message } from 'element-ui';\nexport default {\n  props: [\"id\"],\n  name: \"mailSettingEdit\",\n  data: function data() {\n    return {\n      isOriginPwd: false,\n      rules: {\n        nickName: [{\n          required: true,\n          message: '请输入用户名称',\n          trigger: 'blur'\n        }],\n        mailType: [{\n          required: true,\n          message: '请选择邮箱类型',\n          trigger: 'blur'\n        }],\n        mailAddress: [{\n          required: true,\n          message: '请输入邮箱地址',\n          trigger: 'blur'\n        }, {\n          type: 'email',\n          message: '请输入正确的邮箱地址',\n          trigger: 'blur,change'\n        }],\n        password: [{\n          required: true,\n          message: '请输入邮箱授权码',\n          trigger: 'blur'\n        }]\n      }\n    };\n  },\n  computed: mapState({\n    data: function data(state) {\n      return state.mail.mailSettingData;\n    }\n  }),\n  methods: {\n    showInfos: function showInfos() {\n      if (this.data.mailAddress != '') {\n        var address = this.data.mailAddress;\n        var type = this.data.mailType;\n        var s = address.substring(address.indexOf('@') + 1, address.length + 1).trim();\n\n        if (type == 'pop3') {\n          this.data.smtpHost = 'smtp.' + s;\n          this.data.popHost = 'pop.' + s;\n        }\n\n        if (type == 'pop3') {\n          if (s == 'gmail.com' || s == 'msn.com' || s == 'live.cn' || s == 'live.com' || s == 'hotmail.com') {\n            this.data.ssl = 0;\n          } else {\n            this.data.popPort = '110';\n            this.data.smtpPort = '25';\n          }\n        } else if (type == 'imap') {\n          if (s == 'gmail.com' || s == 'msn.com' || s == 'live.cn' || s == 'live.com' || s == 'hotmail.com') {\n            this.data.ssl = 0;\n          } else {\n            this.data.smtpPort = '25';\n            this.data.imapPort = '143';\n          }\n\n          this.data.imapHost = 'imap' + '.' + s;\n        } else {\n          this.data.smtpHost = s;\n          this.data.smtpPort = \"mail.\" + s;\n        }\n      }\n    },\n    mailTypeChange: function mailTypeChange(change) {\n      if (this.data.mailAddress != '') {\n        var address = this.data.mailAddress;\n        var s = address.substring(address.indexOf('@') + 1, address.length + 1).trim();\n\n        if (change == 'pop3') {\n          this.data.smtpHost = 'smtp.' + s;\n          this.data.popHost = 'pop.' + s;\n        }\n\n        if (change == 'pop3') {\n          if (s == 'gmail.com' || s == 'msn.com' || s == 'live.cn' || s == 'live.com' || s == 'hotmail.com') {\n            this.data.ssl = 0;\n          } else {\n            this.data.popPort = '110';\n            this.data.smtpPort = '25';\n          }\n        } else if (change == 'imap') {\n          if (s == 'gmail.com' || s == 'msn.com' || s == 'live.cn' || s == 'live.com' || s == 'hotmail.com') {\n            this.data.ssl = 0;\n          } else {\n            this.data.imapPort = '143';\n            this.data.smtpPort = '25';\n          }\n\n          this.data.imapHost = 'imap' + '.' + s;\n        } else {\n          this.data.smtpHost = s;\n          this.data.smtpPort = \"mail.\" + s;\n        }\n      }\n    },\n    changeSSL: function changeSSL() {\n      if (this.data.ssl == '1' && this.data.mailType != 'exchange') {\n        this.data.imapPort = '993';\n        this.data.smtpPort = '465';\n        this.data.popPort = '995';\n      } else if (this.data.mailType != 'exchange') {\n        this.data.imapPort = '143';\n        this.data.smtpPort = '25';\n        this.data.popPort = '110';\n      }\n    },\n    handleChange: function handleChange() {\n      this.isOriginPwd = true;\n      this.$store.dispatch(\"mail/setIsOriginPwd\", this.isOriginPwd);\n    },\n    back: function back() {\n      this.$router.go(-1); //返回上一层\n    },\n    submitForm: function submitForm(data) {\n      var _this = this;\n\n      //判断是否为空格\n      var regu = \"^[ ]+$\";\n      var re = new RegExp(regu); //用户名称\n\n      if (this.data.nickName && re.test(this.data.nickName)) {\n        this.$message.warning(\"用户名称不能为空!\");\n        return false;\n      } //邮箱账号\n\n\n      if (this.data.mailAddress && re.test(this.data.mailAddress)) {\n        this.$message.warning(\"邮箱地址不能为空!\");\n        return false;\n      } //密码\n\n\n      if (this.data.password && re.test(this.data.password)) {\n        this.$message.warning(\"邮箱密码不能为空!\");\n        return false;\n      }\n\n      this.$refs[data].validate(function (valid) {\n        if (valid) {\n          _this.$store.dispatch(\"mail/saveMailSetting\", _this.data).then(function () {\n            _this.back();\n          });\n        } else {\n          _this.$message.warning(\"您输入表单信息有误，请重新填写!\");\n\n          return false;\n        }\n      });\n    },\n    testConnect: function testConnect() {\n      Message.info(\"测试连接可能需要点时间,请耐心等候下。\");\n      this.$store.dispatch(\"mail/testMailConnect\", this.data);\n    }\n  },\n  created: function created() {\n    this.$store.dispatch(\"mail/getMailSettingById\", this.id);\n  }\n};",null]}