1 |
- {"remainingRequest":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/src/views/system/user/compontens/addUserDialog.vue?vue&type=style&index=0&id=0dc6da47&lang=scss&scoped=true","dependencies":[{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/src/views/system/user/compontens/addUserDialog.vue","mtime":1708395041892},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/css-loader/dist/cjs.js","mtime":1708395146948},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/vue-loader/lib/loaders/stylePostLoader.js","mtime":1708395147772},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/postcss-loader/src/index.js","mtime":1708395147225},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/sass-loader/dist/cjs.js","mtime":1708395146389},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/cache-loader/dist/cjs.js","mtime":1708395146433},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/vue-loader/lib/index.js","mtime":1708395147382}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgouZGlhbG9nLWZvb3RlciB7CiAgICBkaXYgewogICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jazsKICAgICAgICB3aWR0aDogODBweDsKICAgICAgICBoZWlnaHQ6IDQwcHg7CiAgICAgICAgYm9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3,"sources":["addUserDialog.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA","file":"addUserDialog.vue","sourceRoot":"src/views/system/user/compontens","sourcesContent":["<template>\n <div class=\"addUserDialog\">\n <el-dialog width=\"636px\" center @close=\"cancel()\" title=\"新增用户\" v-if=\"addUserData.dialogVisible\"\n :visible.sync=\"addUserData.dialogVisible\">\n <el-form label-width=\"80px\" ref=\"ruleForm\" :rules=\"rules\" :model=\"addUserForm\">\n <el-form-item label=\"账号名称\" prop=\"userName\">\n <el-input placeholder=\"请输入账号名称\" v-model=\"addUserForm.userName\"></el-input>\n </el-form-item>\n <el-form-item label=\"真实姓名\" prop=\"nickName\">\n <el-input placeholder=\"请输入真实姓名\" v-model=\"addUserForm.nickName\"></el-input>\n </el-form-item>\n <el-form-item label=\"性别\">\n <el-radio v-model=\"addUserForm.sex\" label=\"1\">男</el-radio>\n <el-radio v-model=\"addUserForm.sex\" label=\"2\">女</el-radio>\n </el-form-item>\n <el-form-item label=\"所属部门\" prop=\"deptName\">\n <el-select style=\"width: 365px;\" clearable v-model=\"addUserForm.deptName\" placeholder=\"部门名称\"\n ref=\"selectTree\">\n <el-option :key=\"addUserForm.deptId\" :value=\"treeData.id\" :label=\"treeData.label\" hidden />\n <el-tree :data=\"treeData\" :props=\"defaultProps\" :node-key=\"treeData.id\" accordion highlight-current\n @node-click=\"handleNodeClick\" />\n </el-select>\n </el-form-item>\n <el-form-item label=\"所属角色\" prop=\"roleIds\">\n <!-- <el-input v-model=\"addUserForm.roleIds\"></el-input> -->\n <el-select style=\"width: 365px;\" v-model=\"addUserForm.roleIds\" multiple placeholder=\"请选择\">\n <el-option v-for=\"item in roleOptions\" :key=\"item.value\" :label=\"item.label\" :value=\"item.value\">\n </el-option>\n </el-select>\n </el-form-item>\n <el-form-item label=\"联系电话\" prop=\"phoneNum\">\n <el-input placeholder=\"请输入联系电话\" :maxLength=\"11\" v-model=\"addUserForm.phoneNum\"></el-input>\n </el-form-item>\n <el-form-item label=\"联系邮箱\" prop=\"email\">\n <el-input placeholder=\"请输入联系邮箱\" v-model=\"addUserForm.email\"></el-input>\n </el-form-item>\n <el-form-item label=\"状态\">\n <!-- <el-switch v-model=\"addUserForm.status\" style=\"display: block;margin-top: 8px;\" active-color=\"#00974B\"\n inactive-color=\"#ff4949\" active-text=\"启用\" inactive-text=\"停用\">\n </el-switch> -->\n <el-switch class=\"switchStyle\" v-model=\"addUserForm.status\" active-text=\"启用\" inactive-text=\"停用\"\n active-color=\"#13ce66\" inactive-color=\"#ff4949\">\n </el-switch>\n </el-form-item>\n </el-form>\n <span slot=\"footer\" class=\"dialog-footer\">\n <div class=\"search\" @click=\"addUser()\">保 存</div>\n <div class=\"reset\" @click=\"cancel()\">取 消</div>\n </span>\n </el-dialog>\n </div>\n</template>\n\n<script>\nimport { getDeptTree, roleList ,getAvailableRoleList} from '@/api/sysManage'\nexport default {\n name: 'addUserDialog',\n props: {\n addUserData: {\n type: Object,\n default: {}\n }\n },\n created() {\n this.getDeptTree()\n this.getRoleList()\n },\n data() {\n let checkPhone = (rule, value, callback) => {\n if (value) {\n let isPhone = /^((0\\d{2,3})-)(\\d{7,8})(-(\\d{3,}))?$/;\n let reg = /^(?:(?:\\+|00)86)?1[3-9]\\d{9}$/;\n // if () {\n // cbfn(\"\");\n // }\n if (!reg.test(value) && !isPhone.test(value) && value) {\n callback(new Error(\"请输入正确的手机号\"));\n } else {\n callback();\n }\n } else {\n callback();\n }\n };\n // 邮箱校验规则\n const checkEmail = (rule, value, callback) => {\n let emailReg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$/;\n if (emailReg.test(value) || value == '') {\n return callback();\n } else {\n callback(new Error(\"邮箱格式错误\"));\n }\n };\n return {\n addUserForm: {\n userName: '',\n // password:'',\n nickName: '',\n sex: '1',\n deptId: '',\n roleIds: '',\n phoneNum: '',\n email: '',\n status: true,\n deptName: ''\n },\n treeData: [],\n roleOptions: [],\n rules: {\n userName: [{ required: true, message: '请输入账号名称', trigger: 'blur' },],\n password: [{ required: true, message: '请输入密码', trigger: 'blur' }],\n nickName: [{ required: true, message: '请输入真实姓名', trigger: 'blur' },],\n deptName: [{ required: true, message: '请选择所属部门', trigger: 'blur' },],\n roleIds: [{ required: true, message: '请选择所属角色', trigger: 'blur' },],\n phoneNum: [{ validator: checkPhone, },],\n email: [{required:false, validator: checkEmail, trigger:'blur'},]\n }\n }\n },\n methods: {\n getDeptTree() {\n getDeptTree().then(res => {\n this.treeData = res.data\n })\n },\n handleNodeClick(v) {\n this.addUserForm.deptId = v.id\n this.addUserForm.deptName = v.label\n },\n getRoleList() {\n // roleList({\n // pageNum: 1,\n // pageSize: 100000,\n // roleName: '',\n // status: '',\n // roleKey: ''\n // }).then(res => {\n // this.roleOptions = []\n // if (res.code == 200) {\n // res.data.records.forEach(item => {\n // this.roleOptions.push({\n // label: item.roleName,\n // value: item.roleId\n // })\n // })\n // }\n // }).catch(err => {\n // })\n let params = {}\n getAvailableRoleList(params).then(res => { \n this.roleOptions = []\n if (res.code == 200) { \n res.data.forEach(item => {\n this.roleOptions.push({\n label: item.roleName,\n value: item.roleId\n })\n })\n }\n })\n },\n cancel() {\n this.addUserData.dialogVisible = false\n },\n addUser() {\n this.$refs.ruleForm.validate(valid => {\n if (valid) {\n this.addUserForm.sex = parseInt(this.addUserForm.sex)\n this.$emit('addUser', this.addUserForm)\n }\n })\n }\n }\n}\n</script>\n<style lang=\"scss\" scoped>\n.dialog-footer {\n div {\n display: inline-block;\n width: 80px;\n height: 40px;\n border-radius: 2px;\n font-size: 14px;\n line-height: 40px;\n text-align: center;\n }\n\n div:hover {\n cursor: pointer;\n }\n\n .search {\n margin: 0 12px;\n background-color: #2766DD;\n color: #fff;\n }\n\n .search:hover {\n background-color: #4D85F4;\n }\n\n .reset {\n color: #333334;\n border: 1px solid #D7D7D7;\n }\n\n .reset:hover {\n color: #1F9FFF;\n border: 1px solid #1F9FFF;\n }\n}\n\n::v-deep .el-dialog__body {\n padding: 20px 95px !important;\n}\n\n// 选中后radio文本的颜色\n::v-deep .el-radio__input.is-checked+.el-radio__label {\n color: #2766DD\n}\n\n/* radio选中后小圆点的颜色 */\n::v-deep .el-radio__input.is-checked .el-radio__inner {\n background: #2766DD !important;\n border-color: #2766DD !important;\n}\n</style>"]}]}
|