讲师管理bug

This commit is contained in:
zhangsir
2024-12-13 18:08:51 +08:00
parent 6ded08e300
commit f1ad9b18da
9 changed files with 128 additions and 57 deletions

View File

@@ -73,7 +73,7 @@
@click="cancelTeacherDialog"
/>
</div>
<a-form style="padding-left:12px;padding-right: 46px;" :model="formParam" :rules="rules" layout="vertical" ref="formRef" >
<a-form style="padding-left:12px;padding-right: 46px;" :model="formParam" layout="vertical" ref="formRef" >
<!-- 基本信息 -->
<a-row>
<a-col :span="24">
@@ -106,7 +106,15 @@
<!-- 讲师名称 ,手机号码-->
<a-row :gutter="16">
<a-col :span="24">
<a-form-item label="讲师姓名" name="name">
<a-form-item name="name">
<template v-slot:label>
<img
style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png"
alt=""
/>
讲师姓名
</template>
<a-input v-model:value="formParam.name" class="draitem" :maxlength="20" showCount
@blur="sendName"
placeholder="请输入讲师姓名" allowClear showSearch>
@@ -114,7 +122,15 @@
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="供应商" name="supplier">
<a-form-item name="supplier">
<template v-slot:label>
<img
style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png"
alt=""
/>
供应商
</template>
<a-input v-model:value="formParam.supplier" class="draitem" :maxlength="30" showCount
placeholder="请输入供应商" allowClear showSearch>
</a-input>
@@ -542,8 +558,9 @@ export default {
state.formParam.supplier = state.formParam?.supplier?.trim()
const formItemNames = Object.keys(rules);
for(let i=0;i<formItemNames.length;i++){
const result = await validateField(formItemNames[i]);
if (result) {
// const result = await validateField(formItemNames[i]);
const result = state.formParam[formItemNames[i]]
if (!result) {
return message.error(rules[formItemNames[i]][0].log)
}
}
@@ -708,7 +725,7 @@ export default {
console.log("外部讲师详情", res.data);
state.formParam = res.data.data
state.formParam.description = state.formParam.description == null ? '<p><br></p>' : state.formParam.description
// state.formParam.photo = state.formParam.photo === null ? userInfo.value?.avatar : state.formParam.photo
state.formParam.photo = state.formParam.photo == null ? null : state.formParam.photo.includes('upload') ? res.data.data.photo : '/upload'+res.data.data.photo
})
.catch((err) => {
message.destroy()