最终版

This commit is contained in:
zrh050423 2024-12-24 12:24:33 +08:00
parent b92f635cac
commit d560f26ea1
1 changed files with 0 additions and 54 deletions

View File

@ -39,21 +39,6 @@
<p><strong>性别</strong>{{ userInfo.gender }}</p> <p><strong>性别</strong>{{ userInfo.gender }}</p>
<p><strong>权限</strong>{{ userInfo.permission }}</p> <p><strong>权限</strong>{{ userInfo.permission }}</p>
</div> </div>
<button type="button" class="el-button el-button--primary" @click="doctorFormVisible = true" v-if="userInfo.permission === '医生管理员'">新增医生用户</button>
<el-dialog title="新增医生用户" v-model="doctorFormVisible" @close="resetDoctorForm">
<el-form ref="doctorForm" :model="doctorForm" :rules="doctorRules" label-width="80px" @submit.native.prevent="submitDoctorForm">
<el-form-item label="用户名" prop="username">
<el-input v-model="doctorForm.username"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input type="password" v-model="doctorForm.pwd"></el-input>
</el-form-item>
<!-- 可以根据需要添加其他字段 -->
<el-form-item>
<el-button type="primary" @click="submitDoctorForm">提交</el-button>
</el-form-item>
</el-form>
</el-dialog>
</el-dialog> </el-dialog>
<router-view /> <router-view />
</template> </template>
@ -68,45 +53,6 @@ const doctorFormVisible = ref(false);
const showUserInfoDialog = () => { const showUserInfoDialog = () => {
userInfoDialogVisible.value = true; userInfoDialogVisible.value = true;
}; };
const resetDoctorForm = () => {
doctorForm.value = {
username: '',
password: '' //
//
};
};
const doctorRules = {
username: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
pwd: [
{ required: true, message: '请输入密码', trigger: 'blur' },
{ min: 6, message: '密码长度不能少于6位', trigger: 'blur' }
]
//
};
const doctorForm = ref({
username: '',
pwd: ''
//
});
const submitDoctorForm = () => {
// API
axiosInstance.post('/user/register', doctorForm.value)
.then(response => {
//
console.log('医生用户注册成功', response);
//
doctorFormVisible.value = false; //
resetDoctorForm(); //
})
.catch(error => {
//
console.error('医生用户注册失败', error);
});
};
const roleDisplay = computed(() => { const roleDisplay = computed(() => {
switch (sessionStorage.getItem('permission')) { switch (sessionStorage.getItem('permission')) {
case '0': case '0':