{"remainingRequest":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/views/maintain/user/index.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/views/maintain/user/index.vue","mtime":1701742078554},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\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// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]\n// +----------------------------------------------------------------------\n// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.\n// +----------------------------------------------------------------------\n// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权\n// +----------------------------------------------------------------------\n// | Author: CRMEB Team <admin@crmeb.com>\n// +----------------------------------------------------------------------\n\nimport * as systemAdminApi from '@/api/systemadmin.js';\nimport Cookies from 'js-cookie';\nimport { Debounce } from '@/utils/validate';\nexport default {\n  name: 'index',\n  data() {\n    const validatePass = (rule, value, callback) => {\n      if (value === '') {\n        callback(new Error('请再次输入密码'));\n      } else if (value !== this.pram.pwd) {\n        callback(new Error('两次输入密码不一致!'));\n      } else {\n        callback();\n      }\n    };\n    const JavaMerInfo = JSON.parse(Cookies.get('JavaMerInfo'));\n    return {\n      password: '',\n      JavaMerInfo: JSON.parse(Cookies.get('JavaMerInfo')),\n      pram: {\n        account: JavaMerInfo.account,\n        pwd: null,\n        repwd: null,\n        realName: JavaMerInfo.realName,\n        id: JavaMerInfo.id,\n      },\n      roleList: [],\n      rules: {\n        account: [{ required: true, message: '请填管理员账号', trigger: ['blur', 'change'] }],\n        pwd: [{ required: true, message: '请填管理员密码', trigger: ['blur', 'change'] }],\n        repwd: [{ required: true, message: '确认密码密码', validator: validatePass, trigger: ['blur', 'change'] }],\n        realName: [{ required: true, message: '管理员姓名', trigger: ['blur', 'change'] }],\n      },\n    };\n  },\n  methods: {\n    close(formName) {\n      this.$refs[formName].resetFields();\n    },\n    handlerSubmit: Debounce(function (formName) {\n      this.$refs[formName].validate((valid) => {\n        if (valid) {\n          systemAdminApi.adminAccountUpdate(this.pram).then((data) => {\n            this.$message.success('提交成功');\n            this.$router.go(-1);\n          });\n        } else {\n          return false;\n        }\n      });\n    }),\n    handlerPwdInput(val) {\n      if (!val) {\n        this.rules.pwd = [];\n        this.rules.repwd = [];\n        return;\n      }\n      this.rules.pwd = [\n        { required: true, message: '请填管理员密码', trigger: ['blur', 'change'] },\n        { min: 6, max: 20, message: '长度6-20个字符', trigger: ['blur', 'change'] },\n      ];\n      this.rules.repwd = [\n        {\n          required: true,\n          message: '两次输入密码不一致',\n          validator: (rule, value, callback) => {\n            if (value === '') {\n              callback(new Error('两次输入密码不一致!'));\n            } else if (value !== this.pram.pwd) {\n              callback(new Error('两次输入密码不一致!'));\n            } else {\n              callback();\n            }\n          },\n          trigger: ['blur', 'change'],\n        },\n      ];\n    },\n  },\n};\n",null]}