mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-24 13:04:57 +08:00
parent
6a5cada416
commit
54054c4bcc
|
@ -88,10 +88,10 @@ const validatePassword = (rule: any, value: any, callback: any) => {
|
||||||
|
|
||||||
//自定义校验规则函数
|
//自定义校验规则函数
|
||||||
const validatorPassword = (rule: any, value: any, callback: any) => {
|
const validatorPassword = (rule: any, value: any, callback: any) => {
|
||||||
if (value.length >= 6) {
|
if (!(new RegExp(REGEXP.PASSWORD).test(value))) {
|
||||||
callback();
|
callback("8~16位字母或数字(区分大小写)");
|
||||||
} else {
|
} else {
|
||||||
callback(new Error('密码长度至少6位'));
|
callback()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
<div class="login-page">
|
<div class="login-page">
|
||||||
<div class="left-content move_4"></div>
|
<div class="left-content move_4"></div>
|
||||||
<div class="right-content">
|
<div class="right-content">
|
||||||
<!-- <div class="select-hospital-box">
|
<!-- <div class="select-hospital-box">
|
||||||
<el-select class="select-hospital" v-model="currentHospital" size="small" @change="selectHospital">
|
<el-select class="select-hospital" v-model="currentHospital" size="small">
|
||||||
<el-option v-for="item in hospitals" :key="item.id" :label="item.name" :value="item.id"/>
|
<el-option v-for="item in hospitals" :key="item.id" :label="item.name" :value="item.id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>-->
|
</div>-->
|
||||||
|
@ -26,7 +26,8 @@
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-input v-model="loginParams.password" type="password" show-password placeholder="请输入密码">
|
<el-input v-model="loginParams.password" type="password" show-password
|
||||||
|
placeholder="请输入密码">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<Lock/>
|
<Lock/>
|
||||||
|
@ -34,7 +35,8 @@
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-button :loading="loading" class="login-btn" type="primary" @click="login('password')">登录</el-button>
|
<el-button :loading="loading" class="login-btn" type="primary" @click="login('password')">登录
|
||||||
|
</el-button>
|
||||||
<span class="register-btn" @click="getCaptchaCode()">注册账号</span>
|
<span class="register-btn" @click="getCaptchaCode()">注册账号</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="login-form code-login" v-else>
|
<div class="login-form code-login" v-else>
|
||||||
|
@ -86,6 +88,10 @@
|
||||||
<el-input v-model="registerParams.password" type="password" show-password
|
<el-input v-model="registerParams.password" type="password" show-password
|
||||||
placeholder="请输入密码"></el-input>
|
placeholder="请输入密码"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="确认密码" prop="confirmPassword">
|
||||||
|
<el-input v-model="registerParams.confirmPassword" type="password" show-password
|
||||||
|
placeholder="请输入密码8~16位字母或数字(区分大小写)"></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="姓名" prop="name">
|
<el-form-item label="姓名" prop="name">
|
||||||
<el-input v-model="registerParams.name" placeholder="请输入姓名"></el-input>
|
<el-input v-model="registerParams.name" placeholder="请输入姓名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -137,6 +143,7 @@ import SliderVerify from "@/components/SliderVerify/index.vue";
|
||||||
import * as loginApi from "@/api/login";
|
import * as loginApi from "@/api/login";
|
||||||
import {Session} from "@/utils/storage";
|
import {Session} from "@/utils/storage";
|
||||||
import * as hospitalApi from "@/api/hospital";
|
import * as hospitalApi from "@/api/hospital";
|
||||||
|
import {REGEXP} from "@/enum/global-enum";
|
||||||
|
|
||||||
|
|
||||||
//引入用户相关的小仓库
|
//引入用户相关的小仓库
|
||||||
|
@ -150,11 +157,10 @@ const phoneAreas: any = getPhoneAreasData()
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
//自定义校验规则函数
|
//自定义校验规则函数
|
||||||
const validatorPhone = (rule: any, value: any, callback: any) => {
|
const validatorPhone = (rule: any, value: any, callback: any) => {
|
||||||
var isPhone = /^1[34578]\d{9}$/;
|
|
||||||
if (value.indexOf('****') >= 0) {
|
if (value.indexOf('****') >= 0) {
|
||||||
return callback().trim();
|
return callback().trim();
|
||||||
}
|
}
|
||||||
if (!isPhone.test(value)) {
|
if (!new RegExp(REGEXP.MOBILE).test(value)) {
|
||||||
callback(new Error('请输入合法手机号'));
|
callback(new Error('请输入合法手机号'));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
|
@ -163,14 +169,10 @@ const validatorPhone = (rule: any, value: any, callback: any) => {
|
||||||
|
|
||||||
const loginRules = reactive({
|
const loginRules = reactive({
|
||||||
account: [
|
account: [
|
||||||
{required: true, message: '请输入用户名', trigger: 'change'},
|
{required: true, message: '请输入用户名', trigger: 'change'}
|
||||||
{min: 2, max: 18, message: "长度在 6 到 18个字符"},
|
|
||||||
//{pattern:/^(?![^A-Za-z]+$)(?![^0-9]+$)[0-9A-Za-z_]{4,15}$/, message: '长度在4-15位,数字、字母、下划线的组合,其中数字和字母必须同时存在'}
|
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{required: true, message: '请输入密码', trigger: 'blur'},
|
{required: true, message: '请输入密码', trigger: 'blur'}
|
||||||
{min: 5, max: 25, message: '长度在 5 到 25个字符'},
|
|
||||||
{pattern: /^(\w){5,25}$/, message: '长度在5-25之间,以字母、数字、下划线'}
|
|
||||||
],
|
],
|
||||||
phone: [
|
phone: [
|
||||||
{required: true, validator: validatorPhone, trigger: 'blur'},
|
{required: true, validator: validatorPhone, trigger: 'blur'},
|
||||||
|
@ -182,13 +184,15 @@ const loginRules = reactive({
|
||||||
const registerRules = reactive({
|
const registerRules = reactive({
|
||||||
username: [
|
username: [
|
||||||
{required: true, message: '请输入用户名', trigger: 'change'},
|
{required: true, message: '请输入用户名', trigger: 'change'},
|
||||||
{min: 2, max: 18, message: "长度在 6 到 18个字符"},
|
{validator: validateAccount, trigger: ['blur', 'change']}
|
||||||
//{pattern:/^(?![^A-Za-z]+$)(?![^0-9]+$)[0-9A-Za-z_]{4,15}$/, message: '长度在4-15位,数字、字母、下划线的组合,其中数字和字母必须同时存在'}
|
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{required: true, message: '请输入密码', trigger: 'blur'},
|
{required: true, message: '请输入密码', trigger: 'blur'},
|
||||||
{min: 5, max: 25, message: '长度在 5 到 25个字符'},
|
{validator: validatePassword, trigger: ['blur', 'change']}
|
||||||
{pattern: /^(\w){5,25}$/, message: '长度在5-25之间,以字母、数字、下划线'}
|
],
|
||||||
|
confirmPassword: [
|
||||||
|
{required: true, message: '请输入密码', trigger: ['blur', 'change']},
|
||||||
|
{validator: validatePassword, trigger: ['blur', 'change']}
|
||||||
],
|
],
|
||||||
name: [
|
name: [
|
||||||
{required: true, message: '请输入真实姓名', trigger: 'blur'},
|
{required: true, message: '请输入真实姓名', trigger: 'blur'},
|
||||||
|
@ -224,6 +228,7 @@ const loginParams = ref({
|
||||||
const registerParams = ref({
|
const registerParams = ref({
|
||||||
username: '',
|
username: '',
|
||||||
password: '',
|
password: '',
|
||||||
|
confirmPassword: '',
|
||||||
name: '',
|
name: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
hospital: '',
|
hospital: '',
|
||||||
|
@ -250,7 +255,22 @@ onMounted(() => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
const selectHospital = (e: string) => {
|
function validatePassword(rule: any, value: any, callback: any) {
|
||||||
|
if (!(new RegExp(REGEXP.PASSWORD).test(value))) {
|
||||||
|
callback("8~16位字母或数字(区分大小写)");
|
||||||
|
} else if (value != registerParams.value.password) {
|
||||||
|
callback(new Error('两次密码不一致'));
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateAccount(rule: any, value: any, callback: any) {
|
||||||
|
if (!(new RegExp(REGEXP.ACCOUNT).test(value))) {
|
||||||
|
callback("2~16位字母或数字(区分大小写)");
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const register = async () => {
|
const register = async () => {
|
||||||
|
|
|
@ -6,25 +6,24 @@
|
||||||
<el-form-item label="标题" prop="title">
|
<el-form-item label="标题" prop="title">
|
||||||
<el-input :model-value="formData.title"></el-input>
|
<el-input :model-value="formData.title"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="IP地址" prop="ip">
|
<el-form-item label="IP地址" prop="remoteAddr">
|
||||||
<el-input :model-value="formData.ip"></el-input>
|
<el-input :model-value="formData.remoteAddr"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="请求方式" prop="requestMethod">
|
<el-form-item label="请求方式" prop="method">
|
||||||
<el-input :model-value="formData.requestMethod"></el-input>
|
<el-input :model-value="formData.method"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="请求时间" prop="requestTime">
|
<el-form-item label="请求时间" prop="createTime">
|
||||||
<el-input :model-value="dateFormater('yyyy-MM-dd HH:mm:ss', formData.requestTime)"></el-input>
|
<el-input :model-value="dateFormater('yyyy-MM-dd HH:mm:ss', formData.createTime)"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="操作人" prop="operator">
|
<el-form-item label="操作人" prop="createBy">
|
||||||
<el-input :model-value="formData.operator"></el-input>
|
<el-input :model-value="formData.createBy"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang='ts' setup>
|
<script lang='ts' setup>
|
||||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
import {onMounted, reactive, ref} from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import {dateFormater} from '@/utils/date-util'
|
||||||
import { dateFormater } from '@/utils/date-util'
|
|
||||||
|
|
||||||
const emit = defineEmits(['close'])
|
const emit = defineEmits(['close'])
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<div class="button-part" style="justify-content: space-between;">
|
<div class="button-part" style="justify-content: space-between;">
|
||||||
<el-button icon="Delete" @click="removeData()">删除</el-button>
|
<el-button icon="Delete" @click="removeData()">删除</el-button>
|
||||||
<TableAbility @searchBtn="isSearch = !isSearch" @refreshBtn="init"
|
<TableAbility @searchBtn="isSearch = !isSearch" @refreshBtn="init"
|
||||||
@downloadBtn="exportData('日志数据', tableData)"></TableAbility>
|
@downloadBtn="exportMultiData('日志数据', tableData)"></TableAbility>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-part">
|
<div class="table-part">
|
||||||
<el-table ref="tableRef" v-loading="loading" :data="tableData" height="100%" border show-overflow-tooltip
|
<el-table ref="tableRef" v-loading="loading" :data="tableData" height="100%" border show-overflow-tooltip
|
||||||
|
@ -63,7 +63,7 @@ import {onMounted, ref} from 'vue'
|
||||||
import LoginChart from './chart/login-chart.vue'
|
import LoginChart from './chart/login-chart.vue'
|
||||||
import CommonPagination from '@/components/common-pagination.vue'
|
import CommonPagination from '@/components/common-pagination.vue'
|
||||||
import LogForm from './form/log-form.vue'
|
import LogForm from './form/log-form.vue'
|
||||||
import {exportData, tableRemoveRow} from '@/utils/table-util'
|
import {exportMultiData, tableRemoveRow} from '@/utils/table-util'
|
||||||
import {dateFormater} from '@/utils/date-util'
|
import {dateFormater} from '@/utils/date-util'
|
||||||
import * as logManageApi from '@/api/log-manage'
|
import * as logManageApi from '@/api/log-manage'
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="用户名" prop="username">
|
<el-form-item label="用户名" prop="username">
|
||||||
<el-input v-model="formData.username" placeholder="请输入用户名"
|
<el-input v-model="formData.username" placeholder="请输入用户名2~16位字母或数字(区分大小写)"
|
||||||
:disabled="type === 'edit'"></el-input>
|
:disabled="type === 'edit'"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -46,8 +46,14 @@
|
||||||
<el-row v-if="type != 'edit'">
|
<el-row v-if="type != 'edit'">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="密码" prop="password">
|
<el-form-item label="密码" prop="password">
|
||||||
<el-input v-model="formData.password" placeholder="请输入密码"
|
<el-input v-model="formData.password" placeholder="请输入密码8~16位字母或数字(区分大小写)"
|
||||||
:disabled="type === 'edit'"></el-input>
|
:disabled="type === 'edit'" type="password" show-password></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="确认密码" prop="confirmPassword">
|
||||||
|
<el-input v-model="formData.confirmPassword" placeholder="请输入密码8~16位字母或数字(区分大小写)"
|
||||||
|
:disabled="type === 'edit'" type="password" show-password></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -60,10 +66,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang='ts' setup>
|
<script lang='ts' setup>
|
||||||
import {onMounted, reactive, ref, toRefs, watch} from 'vue'
|
import {onMounted, reactive, ref} from 'vue'
|
||||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import {getRoleList} from "@/api/role";
|
import {getRoleList} from "@/api/role";
|
||||||
import {addUser, updateUI} from "@/api/user";
|
import {addUser, updateUI} from "@/api/user";
|
||||||
|
import {REGEXP} from "@/enum/global-enum";
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'save'])
|
const emit = defineEmits(['close', 'save'])
|
||||||
|
|
||||||
|
@ -74,13 +81,10 @@ const props = defineProps({
|
||||||
const roleOption = ref<any>([])
|
const roleOption = ref<any>([])
|
||||||
|
|
||||||
const validatorPhone = (rule: any, value: any, callback: any) => {
|
const validatorPhone = (rule: any, value: any, callback: any) => {
|
||||||
var isPhone = /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
|
|
||||||
|
|
||||||
|
|
||||||
if (value.indexOf('****') >= 0) {
|
if (value.indexOf('****') >= 0) {
|
||||||
return callback().trim();
|
return callback().trim();
|
||||||
}
|
}
|
||||||
if (!isPhone.test(value)) {
|
if (!new RegExp(REGEXP.MOBILE).test(value)) {
|
||||||
callback(new Error('请输入合法手机号'));
|
callback(new Error('请输入合法手机号'));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
|
@ -91,6 +95,7 @@ const validatorPhone = (rule: any, value: any, callback: any) => {
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
username: [
|
username: [
|
||||||
{required: true, message: '请输入用户名', trigger: ['blur', 'change']},
|
{required: true, message: '请输入用户名', trigger: ['blur', 'change']},
|
||||||
|
{validator: validateAccount, trigger: ['blur', 'change']}
|
||||||
],
|
],
|
||||||
name: [
|
name: [
|
||||||
{required: true, message: '请输入姓名', trigger: ['blur', 'change']},
|
{required: true, message: '请输入姓名', trigger: ['blur', 'change']},
|
||||||
|
@ -103,6 +108,11 @@ const rules = reactive({
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{required: true, message: '请输入密码', trigger: ['blur', 'change']},
|
{required: true, message: '请输入密码', trigger: ['blur', 'change']},
|
||||||
|
{validator: validatePassword, trigger: ['blur', 'change']}
|
||||||
|
],
|
||||||
|
confirmPassword: [
|
||||||
|
{required: true, message: '请输入密码', trigger: ['blur', 'change']},
|
||||||
|
{validator: validatePassword, trigger: ['blur', 'change']}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -115,6 +125,7 @@ const formData = ref({
|
||||||
email: '',
|
email: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
password: '',
|
password: '',
|
||||||
|
confirmPassword: '',
|
||||||
lockFlag: '0',
|
lockFlag: '0',
|
||||||
} as any)
|
} as any)
|
||||||
|
|
||||||
|
@ -122,6 +133,24 @@ onMounted(() => {
|
||||||
resetData()
|
resetData()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function validatePassword(rule: any, value: any, callback: any) {
|
||||||
|
if (!(new RegExp(REGEXP.PASSWORD).test(value))) {
|
||||||
|
callback("8~16位字母或数字(区分大小写)");
|
||||||
|
} else if (value !== formData.value.password) {
|
||||||
|
callback(new Error('两次密码不一致'));
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateAccount(rule: any, value: any, callback: any) {
|
||||||
|
if (!(new RegExp(REGEXP.ACCOUNT).test(value))) {
|
||||||
|
callback("2~16位字母或数字(区分大小写)");
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getRoleList().then((res: any) => {
|
getRoleList().then((res: any) => {
|
||||||
if (res && res.code == 0) {
|
if (res && res.code == 0) {
|
||||||
roleOption.value = res.data
|
roleOption.value = res.data
|
||||||
|
@ -150,6 +179,7 @@ function resetData() {
|
||||||
email: '',
|
email: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
password: '',
|
password: '',
|
||||||
|
confirmPassword: '',
|
||||||
lockFlag: '0',
|
lockFlag: '0',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user