Sfoglia il codice sorgente

对应 tnb 项目图片稿件的更改

reghao 1 anno fa
parent
commit
91a75e543b

+ 5 - 5
src/api/image.js

@@ -13,6 +13,11 @@ const imageApi = {
   postAlbumApi: '/api/content/album'
 }
 
+// 创建相册
+export function createAlbum(jsonData) {
+  return post(imageApi.imageAlbumApi + '/create', jsonData)
+}
+
 export function submitAlbum(jsonData) {
   return post(imageApi.imageAlbumApi, jsonData)
 }
@@ -56,11 +61,6 @@ export function getImages(page) {
   return get(imageApi.imageApi + '?page=' + page)
 }
 
-// 创建稿件合集
-export function createAlbum(jsonData) {
-  return post(imageApi.postAlbumApi + '/create', jsonData)
-}
-
 // 获取用户合集
 export function getUserAlbums(page) {
   return get(imageApi.postAlbumApi + '/user?pn=' + page)

+ 27 - 34
src/components/upload/EditImage.vue

@@ -1,41 +1,34 @@
 <template>
   <el-row class="movie-list">
     <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
-      <el-col :md="24" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
-        <el-card class="box-card">
-          <div class="text item">
-            <el-button style="float: left; padding: 3px 0" type="text" @click="onReturnAlbum">返回相册稿件列表</el-button>
-          </div>
-        </el-card>
-      </el-col>
+      <el-card class="box-card" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+        <div slot="header" class="clearfix">
+          <span>添加图片</span>
+          <el-button style="float: right; padding: 10px" type="text" @click="onReturnAlbum">返回相册稿件列表</el-button>
+        </div>
+        <div class="text item">
+          <el-upload
+            :action="actionUrl"
+            :headers="imgHeaders"
+            :data="imgData"
+            :file-list="uploadImages"
+            :multiple="true"
+            :limit="limit"
+            :with-credentials="true"
+            list-type="picture-card"
+            :before-upload="handleBeforeUpload"
+            :on-success="handleOnSuccess"
+            :on-error="handleOnError"
+            :on-remove="handleOnRemove"
+            :on-preview="handleOnPreview"
+          >
+            <i class="el-icon-plus" />
+          </el-upload>
+        </div>
+      </el-card>
     </el-row>
-    <el-row>
-      <el-col :md="8">
-        <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
-          <el-card class="box-card">
-            <div class="text item">
-              <el-upload
-                :action="actionUrl"
-                :headers="imgHeaders"
-                :data="imgData"
-                :file-list="uploadImages"
-                :multiple="true"
-                :limit="limit"
-                :with-credentials="true"
-                list-type="picture-card"
-                :before-upload="handleBeforeUpload"
-                :on-success="handleOnSuccess"
-                :on-error="handleOnError"
-                :on-remove="handleOnRemove"
-                :on-preview="handleOnPreview"
-              >
-                <i class="el-icon-plus" />
-              </el-upload>
-            </div>
-          </el-card>
-        </el-row>
-      </el-col>
-      <el-col :md="16">
+    <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+      <el-col :md="24">
         <div v-if="data !== null">
           <el-col
             v-for="(image, index) in data.images"

+ 6 - 6
src/components/upload/PublishVideo.vue

@@ -135,7 +135,7 @@ export default {
         Authorization: ''
       },
       imgData: {
-        channelId: null
+        channelCode: null
       },
       coverUrl: null,
       // ****************************************************************************************************************
@@ -152,7 +152,7 @@ export default {
       ],
       form: {
         videoFileId: null,
-        channelId: 0,
+        channelCode: 0,
         coverFileId: null,
         coverChannelId: 0,
         title: null,
@@ -169,7 +169,7 @@ export default {
     getVideoChannelInfo().then(res => {
       if (res.code === 0) {
         const resData = res.data
-        this.form.channelId = resData.channelId
+        this.form.channelCode = resData.channelCode
         this.options = {
           target: resData.ossUrl,
           // 分块大小 10MB
@@ -218,8 +218,8 @@ export default {
     getVideoCoverChannelInfo().then(res => {
       if (res.code === 0) {
         const resData = res.data
-        this.form.coverChannelId = resData.channelId
-        this.imgData.channelId = resData.channelId
+        this.form.coverChannelId = resData.channelCode
+        this.imgData.channelCode = resData.channelCode
         this.imgOssUrl = resData.ossUrl
         this.imgHeaders.Authorization = 'Bearer ' + resData.token
       } else {
@@ -365,7 +365,7 @@ export default {
 
           const formData = new FormData()
           formData.append('file', coverFile)
-          formData.append('channelId', this.imgData.channelId)
+          formData.append('channelCode', this.imgData.channelCode)
           fetch(this.imgOssUrl, {
             headers: this.imgHeaders,
             method: 'POST',

+ 1 - 8
src/views/post/ImagePost.vue

@@ -127,12 +127,6 @@
             <el-form-item label="相册名">
               <el-input v-model="form.albumName" style="width: 70%; padding-right: 2px" placeholder="相册名不能超过 50 个字符" />
             </el-form-item>
-            <el-form-item label="稿件类型">
-              <el-select v-model="form.postType" placeholder="选择稿件类型">
-                <el-option label="图片" value="1" />
-                <el-option label="视频" value="2" />
-              </el-select>
-            </el-form-item>
             <el-form-item label="可见范围">
               <el-select v-model="form.scope" placeholder="选择可见范围">
                 <el-option label="本人可见" value="1" />
@@ -192,8 +186,7 @@ export default {
       // **********************************************************************
       showEditScopeDialog: false,
       form: {
-        albumId: null,
-        postType: '1',
+        albumName: null,
         scope: '1'
       },
       createAlbumDiaglog: false