Pārlūkot izejas kodu

Merge branch 'ch/ht_3.0' of eta_mini/eta_mini_crm_front into master_ht

leichen 3 mēneši atpakaļ
vecāks
revīzija
dc92dfade1

+ 4 - 3
src/views/author/List.vue

@@ -68,6 +68,7 @@ function handleUploadImg(file){
     apiAuthor.uploadAuthorPic(form).then(res=>{
         if(res.Ret!==200) return 
         curAuthorData.value.HeadImgURL = res.Data?.Url||''
+        curAuthorData.value.OriginUrl = res.Data?.OriginUrl||''
     })
 }
 const rules = {
@@ -79,9 +80,9 @@ async function handleSaveAuthor(){
     try{
         await formRef.value?.validate()
     }catch(e){ return }
-    const {Id,HeadImgURL,Introduction,Name,ProfessionalCertificate,Position,InvestmentCertificate} = curAuthorData.value
+    const {Id,HeadImgURL,Introduction,Name,ProfessionalCertificate,Position,InvestmentCertificate,OriginUrl} = curAuthorData.value
     apiAuthor.editAuthor({
-        Id,HeadImgUrl:HeadImgURL,Introduction,Name,ProfessionalCertificate,Position,InvestmentCertificate
+        Id,HeadImgUrl:HeadImgURL,Introduction,Name,ProfessionalCertificate,Position,InvestmentCertificate,HeadOriginImgUrl:OriginUrl||''
     }).then(res=>{
         if(res.Ret!==200) return 
         ElMessage.success('配置成功')
@@ -114,7 +115,7 @@ async function handleSaveAuthor(){
                                 v-if="row[column.key]"
                                 fit="cover"
                                 :src="row[column.key]||''" 
-                                :preview-src-list="[row[column.key]||'']" 
+                                :preview-src-list="[row.HeadOriginImgUrl||'']" 
                                 style="display: inline-block;width:60px;height: 60px;" preview-teleported/>
                             <span v-else style="display: inline-block;width:60px;height: 60px;line-height: 60px;">-</span> 
                         </div>

+ 6 - 3
src/views/media/components/MediaUpload.vue

@@ -42,11 +42,14 @@ const dialogTitle = computed(()=>{
     return {'add':'上传','edit':'编辑',}[props.modifyType]+mediaName.value
 })
 const uploadAccept = computed(()=>{
-    return props.mediaType==='audio'?'.mp3':'.mp4'
+    return props.mediaType==='audio'?'.mp3,.m4a':'.mp4'
 })
 const uploadType = computed(()=>{
     return props.mediaType==='audio'?'audio/mpeg':'video/mp4'
 })
+const uploadAudioType = computed(()=>{
+    return props.mediaType==='audio'?'audio/x-m4a':'video/mp4'
+})
 const mediaData = reactive({
     fileUrl:'',
     mediaName:'',
@@ -107,7 +110,7 @@ function handleUpload(){
 async function handleUploadMedia(file){
     uploadLoading.value = true
     const {type} = file.file
-    if(type!==uploadType.value){
+    if(type!==uploadType.value && type!==uploadAudioType.value){
         ElMessage.warning(`仅支持${uploadAccept.value}格式的文件`)
         uploadLoading.value = false
         return 
@@ -207,7 +210,7 @@ function handleUploadImg(file){
         <div class="content-wrap">
             <el-form label-width="95px" label-position="left" :model="mediaData" :rules="rules" ref="formRef">
                 <el-form-item prop="fileUrl" class="upload-form-item">
-                    <el-input :placeholder="props.mediaType==='audio'?'音频格式限制mp3':'视频格式限制mp4,编码器为H.264'" v-model="mediaData.fileUrl" disabled>
+                    <el-input :placeholder="props.mediaType==='audio'?'音频格式限制mp3、m4a':'视频格式限制mp4,编码器为H.264'" v-model="mediaData.fileUrl" disabled>
                         <template #append>
                             <el-button 
                                 :loading="uploadLoading"