Jelajahi Sumber

视频管理 客户反馈ok

cxmo 7 bulan lalu
induk
melakukan
a88e3dc105

+ 10 - 0
src/api/customer/modules/user.js

@@ -14,4 +14,14 @@ export default {
     getTempCustomList:params=>{
         return get('/user/temporary/list',params)
     },
+    /**
+     * 
+     * @param {Object} params
+     * @param {Number} params.PageSize
+     * @param {Number} params.CurrentIndex
+     * @returns 
+     */
+    getFeedbackList:params=>{
+        return get('/feedBack/feedBackList',params)
+    }
 };

+ 1 - 0
src/api/media/video.js

@@ -36,6 +36,7 @@ export default{
      * @param {Object} params.AnalystId 
      * @param {Object} params.AnalystName
      * @param {Object} params.SrcUrl
+     * @param {Object} params.CoverSrc
      * @param {Object} params.PermissionIds 所属二级品种,用,隔开
      * @param {Object} params.DurationMillisecond 视频长度 单位毫秒
      * @returns 

+ 17 - 32
src/views/customer/FeedbackList.vue

@@ -1,18 +1,19 @@
 <script setup>
 import { ref, reactive } from 'vue'
+import {apiCustomerUser} from '@/api/customer'
 
 const tableColumns = [
     {
         label:'手机号',
-        key:'mobile',
+        key:'Mobile',
         sortable:false
     },{
         label:'反馈内容',
-        key:'feedbackContent',
+        key:'Message',
         sortable:false
     },{
         label:'反馈时间',
-        key:'feedbackTime',
+        key:'CreatedTime',
         sortable:true
     }
 ]
@@ -25,36 +26,20 @@ const tableQuery = reactive({
 })
 const tableData = ref([])
 function getTableData(){
-    tableData.value = [{
-            mobile:'123456'
-        },
-        {
-            mobile:'123456'
-        },
-        {
-            mobile:'123456'
-        },
-        {
-            mobile:'123456'
-        },
-        {
-            mobile:'123456'
-        },
-        {
-            mobile:'123456'
-        },
-        {
-            mobile:'123456'
-        },
-        {
-            mobile:'123456'
-        },
-        {
-            mobile:'123456'
-        },]
+    apiCustomerUser.getFeedbackList({
+        PageSize:tableQuery.pageSize,
+        CurrentIndex:tableQuery.currentPage,
+    }).then(res=>{
+        if(res.Ret!==200) return 
+        tableData.value = res.Data.List||[]
+        tableQuery.totals = res.Data.Paging.Totals||0
+    })
 }
 getTableData()
-function handlePageChange(){}
+function handlePageChange(page){
+    tableQuery.currentPage = page
+    getTableData()
+}
 </script>
 
 <template>
@@ -69,7 +54,7 @@ function handlePageChange(){}
             <el-pagination
                 background
                 layout="total,prev,pager,next,jumper"
-                :current-page="tableQuery.page"
+                :current-page="tableQuery.currentPage"
                 :page-size="tableQuery.pageSize"
                 :total="tableQuery.totals"
                 @current-change="handlePageChange"

+ 1 - 1
src/views/media/AudioList.vue

@@ -129,7 +129,7 @@ function handleSortChange({order,prop}){
         v-model:show="mediaUploadShow"
         mediaType="audio"
         modifyType="add"
-        :modifyata="curData"
+        :modifydata="curData"
     ></MediaUpload>
     <MediaPlayer 
         v-model:show="mediaPlayerShow"

+ 23 - 11
src/views/media/VideoList.vue

@@ -51,15 +51,17 @@ function handlePreviewVideo(data={}){
 let curData = ref({})
 function setCurData(data={}){
     curData.value = {
-        fileUrl:data.url||'',
-        mediaName:data.name||'',
-        author:data.author||'',
-        labels:data.labels||'',
-        mediaCover:data.pic||'',
+        fileUrl:data.src||'',
+        mediaName:data.mediaName||'',
+        author:data.authorId||'',
+        labels:data.permissionIds||'',
+        mediaCover:data.coverSrc||'',
     }
 }
+let modifyType = ref('add')
 function handleEdit(data={}){
     setCurData(data)
+    modifyType.value = data.mediaId?'edit':'add'
     mediaUploadShow.value = true
 }
 function handleDelete(data){
@@ -101,10 +103,19 @@ function handleSortChange({order,prop}){
                     v-for="column in tableColumns" :key="column.key"
                     :prop="column.key" :label="column.label" :sortable="column.sortable" :width="column.width">
                     <template #default="{row}">
-                        <span v-if="column.key==='name'" @click="handlePreviewVideo(row)" style="color:#086CE0;cursor: pointer;">
-                            {{ row.name }}
+                        <span v-if="column.key==='mediaName'" @click="handlePreviewVideo(row)" style="color:#086CE0;cursor: pointer;">
+                            {{ row.mediaName }}
                         </span>
-                        <span v-else>{{ row[column.key] }}</span>
+                        <div v-else-if="column.key==='coverSrc'" style="color:#086CE0;cursor: pointer;">
+                            <el-image 
+                                v-if="row[column.key]"
+                                fit="cover"
+                                :src="row[column.key]||''" 
+                                :preview-src-list="[row[column.key]||'']" 
+                                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>
+                        <span v-else>{{ row[column.key]||'-' }}</span>
                     </template>
                 </el-table-column>
                 <el-table-column label="操作">
@@ -127,15 +138,16 @@ function handleSortChange({order,prop}){
     </div>
     <MediaUpload
         v-model:show="mediaUploadShow"
-        :modifyata="curData"
+        :modifydata="curData"
         mediaType="video"
-        modifyType="add"
+        :modifyType="modifyType"
         ImageUploadWidth="192px"
         ImageUploadHeight="108px"
     ></MediaUpload>
     <MediaPlayer 
         v-model:show="mediaPlayerShow"
-        title="123456"
+        :title="curData.mediaName"
+        :src="curData.fileUrl"
         mediaType="video"
     >
     </MediaPlayer>

+ 17 - 12
src/views/media/components/MediaUpload.vue

@@ -11,7 +11,7 @@ const props = defineProps({
         type:String,
         default:'audio',//audio or video
     },
-    modifyata:{
+    modifydata:{
         type:Object,
         default:{
             fileUrl:'',
@@ -57,7 +57,8 @@ const mediaData = reactive({
 })
 watch(show,(newval)=>{
     if(newval){
-        Object.assign(mediaData,props.modifyata)
+        Object.assign(mediaData,props.modifydata)
+        mediaData.labels = mediaData.labels.split(',').map(i=>Number(i))
     }else{
         Object.assign(mediaData,{
             fileUrl:'',
@@ -92,6 +93,7 @@ function getLableList(){
 }
 getLableList()
 //点击上传按钮
+const uploadLoading = ref(false)
 const uploadRef = ref(null)
 function handleUpload(){
     uploadRef.value?.$el.getElementsByTagName('input')[0].click()
@@ -107,11 +109,13 @@ async function handleUploadMedia(file){
         return 
     }
 
+    uploadLoading.value = true
     let form = new FormData();
     form.append('File',file.file);
     const res = props.mediaType==='audio'
         ?await apiAudio.uploadAudioFile(form)
         :await apiVideo.uploadVideoFile(form)
+    uploadLoading.value = false
     if(res.Ret!==200) return 
     mediaData.fileUrl = res.Data.Url||""
     //视频取上传文件返回的duration
@@ -152,25 +156,25 @@ async function handleSave(){
     const params = {
         AnalystId:mediaData.author.Id,
         AnalystName:mediaData.author.Name,
-        AudioName:mediaData.mediaName,
         SrcUrl:mediaData.fileUrl,
         PermissionIds:Array.isArray(mediaData.labels)?mediaData.labels.join(','):'',
-        DurationMillisecond:parseInt(mediaData.duration*1000)
     }
     const otherParams = props.mediaType==='audio'?{
-        AudioId:mediaData.mediaId
+        AudioName:mediaData.mediaName,
+        DurationMillisecond:parseInt(mediaData.duration*1000)
     }:{
-        VideoId:mediaData.mediaId,
-        CoverSrc:mediaData.mediaCover
+        VideoName:mediaData.mediaName,
+        CoverSrc:mediaData.mediaCover,
+        DurationMillisecond:mediaData.duration
     }
     if(props.modifyType==='add'){
         res = props.mediaType==='audio'
-        ? await apiAudio.addAudio(params)
-        : await apiVideo.addVideo({...params,CoverSrc:mediaData.mediaCover})
+        ? await apiAudio.addAudio({...params,...otherParams})
+        : await apiVideo.addVideo({...params,...otherParams})
     }else{
         res = props.mediaType==='audio'
-        ? await apiAudio.editAudio({...params,...otherParams})
-        : await apiVideo.editVideo({...params,...otherParams})
+        ? await apiAudio.editAudio({...params,...otherParams,AudioId:mediaData.mediaId||0})
+        : await apiVideo.editVideo({...params,...otherParams,VideoId:mediaData.mediaId||0})
     }
     if(res.Ret!==200) return 
     ElMessage.success(`${props.modifyType==='add'?'添加':'编辑'}成功`)
@@ -206,9 +210,10 @@ function handleUploadImg(file){
                     <el-input placeholder="请上传文件" v-model="mediaData.fileUrl" disabled>
                         <template #append>
                             <el-button 
+                                :loading="uploadLoading"
                                 @click="handleUpload" 
                                 style="background-color: #086CE0;color:#fff;border-top-left-radius:0;border-bottom-left-radius:0;">
-                                上传{{mediaName}}
+                                {{uploadLoading?`上传中...`:`上传${mediaName}`}}
                             </el-button>
                             <el-upload
                                 ref="uploadRef"