|
@@ -126,14 +126,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12" v-if="formType === 'create-T' || formType === 'update-T'">
|
|
|
<el-form-item label="用户类型" prop="userType">
|
|
|
- <el-select v-model="formData.userType" placeholder="请选择用户类型">
|
|
|
- <el-option
|
|
|
- v-for="option in userTypes"
|
|
|
- :key="option.value"
|
|
|
- :label="option.label"
|
|
|
- :value="option.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
+ <el-input v-model="userTypeT" value="导师" placeholder="导师" :disabled="true"/>
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="用户类型" prop="userType">
|
|
|
<span style="margin-left: 10px;">导师</span>
|
|
@@ -247,6 +240,7 @@ defineOptions({ name: 'SystemUserForm' })
|
|
|
const { t } = useI18n() // 国际化
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
const userTypeSt = ref('1')
|
|
|
+const userTypeT = ref('3')
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
@@ -278,7 +272,7 @@ const formData = ref({
|
|
|
const formRules = reactive<FormRules>({
|
|
|
username: [{ required: true, message: '账号不能为空', trigger: 'blur' }],
|
|
|
nickname: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
|
|
- // password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }],
|
|
|
+ password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }],
|
|
|
email: [
|
|
|
{ required: true, message: '邮箱不能为空', trigger: 'blur' }, // 确保这是必填
|
|
|
{
|
|
@@ -305,7 +299,7 @@ const formRules = reactive<FormRules>({
|
|
|
],
|
|
|
// supervisor: [{ required: true, message: '导师不能为空', trigger: 'blur' }],
|
|
|
userNumber: [{ required: true, message: '学号不能为空', trigger: 'blur' }],
|
|
|
- userType: [{ required: true, message: '用户类型不能为空', trigger: 'blur' }],
|
|
|
+ // userType: [{ required: true, message: '用户类型不能为空', trigger: 'blur' }],
|
|
|
})
|
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
@@ -414,6 +408,9 @@ const submitForm = async () => {
|
|
|
if(formType.value === 'create-S'){
|
|
|
formData.value.userType = userTypeSt.value
|
|
|
}
|
|
|
+ if(formType.value === 'create-T'){
|
|
|
+ formData.value.userType = userTypeT.value
|
|
|
+ }
|
|
|
console.log(formData.value,'提交的表单');
|
|
|
if (!formRef.value) return
|
|
|
const valid = await formRef.value.validate()
|