Browse Source

推广素材,素材发布调整

qymljy 2 năm trước cách đây
mục cha
commit
b1ba5fec5b

+ 8 - 8
src/SManagement/archives_ad/components/list.vue

@@ -20,7 +20,7 @@
             <span>{{item.newcount}}</span>
           </div>
         </div>
-        <div class="handle">
+        <div class="handle" v-if="type == 1">
           <slot name="edit" :data="item"></slot>
           <slot name="delete" :data="item"></slot>
         </div>
@@ -39,12 +39,12 @@ export default {
       currentItem:[]
     };
   },
-  props: ['fileData'],
+  props: ['fileData','type'],
   computed: {
-    
+
   },
   components: {
-    
+
   },
   watch: {
   },
@@ -55,18 +55,18 @@ export default {
     getCover(item) {
       let result = item.attinfos.find(item1 => item1.fileType == 'image')
       if(result) {
-        return item.attinfos.find(item => item == result).cover        
+        return item.attinfos.find(item => item == result).cover
       } else if(item.attinfos[0] && item.attinfos[0].subfiles[0]) {
         return item.attinfos[0].subfiles[0].url
       }else {
         return require('@/assets/video.png')
       }
-      
+
     },
     itemClick (data) {
       this.$emit('listItemClick', data)
     },
-    
+
   },
 };
 </script>
@@ -122,7 +122,7 @@ export default {
   justify-content: space-between;
 }
 .list-box .list .bottom .icon-box .item {
-  
+
 }
 .list-box .list .bottom .icon-box .item span {
   font-size: 10px;

+ 9 - 11
src/SManagement/archives_admag/index.vue

@@ -10,7 +10,7 @@
           <div style="display:flex;align-items:center">
             <div style="display:flex;align-items:center;padding-bottom:15px">
               <p style="font-size:14px;margin-right:10px;width:50px">范围:</p>
-              <el-select v-model="params.content.where.type" placeholder="请选择素材范围" size="small" @change="getFileList">
+              <el-select v-model="params.content.where.type" placeholder="请选择素材范围" size="small" @change="getFileList(true)">
                 <el-option
                   label="总部"
                   :value="0">
@@ -30,13 +30,13 @@
           </div>
 
           <!--素材列表-->
-          <list :fileData="fileData" @listItemClick="listItemClick"
+          <list :fileData="fileData" @listItemClick="listItemClick" :type="params.content.where.type"
             v-if="tool.checkAuth($route.name, 'read')">
             <template v-slot:edit="scope">
-              <Edit :fileData="scope.data" :disabled="tool.checkAuth($route.name, 'update') && scope.data.isAuth"></Edit>
+              <Edit :fileData="scope.data" :disabled="tool.checkAuth($route.name, 'update') && scope.data.isAuth" ></Edit>
             </template>
             <template v-slot:delete="scope">
-              <Delete :data="scope.data" @removeSuccess="getFileList"  :disabled="tool.checkAuth($route.name, 'delete') && scope.data.isAuth"></Delete>
+              <Delete :data="scope.data" @removeSuccess="getFileList(true)"  :disabled="tool.checkAuth($route.name, 'delete') && scope.data.isAuth" ></Delete>
             </template>
           </list>
           <pagination :total="total" :pageSize="params.content.pageSize" :currentPage="params.content.pageNumber"
@@ -132,7 +132,7 @@ export default {
   watch: {
     $route (val) {
       if (val.path == '/archives_admag') {
-        this.getFileList()
+        this.getFileList(true)
         this.$refs.add.dialogVisible = false
       }
     },
@@ -141,7 +141,7 @@ export default {
     }
   },
   created() {
-    this.getFileList()
+    this.getFileList(true)
   },
   methods: {
     inputChange () {
@@ -172,8 +172,6 @@ export default {
       if (deleteList.length != 0) return this.handleDelete(deleteList);
       this.total = res.total
       this.fileData = res.data
-      console.log(this.fileData);
-
       this.fileData.forEach((item) => {
         item.attinfos = matchingFileType.fileList(item.attinfos)
       })
@@ -188,14 +186,14 @@ export default {
         }
       }).then(res => {
         console.log("处理删除", res);
-        if (res.msg == '成功') this.getFileList()
+        if (res.msg == '成功') this.getFileList(true)
       })
     },
     sortTypeChange(name) {
       for (let i = 0; i < this.params.content.sort.length; i++) {
         this.params.content.sort[i].sorted = this.params.content.sort[i].sortname == name ? 1 : 0
       }
-      this.getFileList()
+      this.getFileList(true)
     },
     //列表单击事件
     async listItemClick(data) {
@@ -221,7 +219,7 @@ export default {
     },
     clearData() {
       this.params.content.where.condition = ''
-      this.getFileList()
+      this.getFileList(true)
     },
     pageChange(n) {
       this.params.content.pageNumber = n

+ 30 - 4
src/SManagement/archives_upload/index.vue

@@ -5,7 +5,7 @@
       <save type="save" @click.native="save()"></save>
     </Header>-->
     <el-row>
-      <el-col :span="24">
+      <el-col :span="14" v-if="$route.path === '/upload_archives'">
         <!--标题 分类-->
         <Set ref="set" @setSelectChange="selectChange" @setTitleChange="titleChange" />
         <!--文件列表-->
@@ -28,8 +28,31 @@
           ></Editor>
         </file-text>
       </el-col>
+      <el-col :span="24" v-else>
+        <!--标题 分类-->
+        <Set ref="set" @setSelectChange="selectChange" @setTitleChange="titleChange" />
+        <!--文件列表-->
+        <file-list ref="attFileList" v-if="uploadType == '1' || uploadType == '2'">
+          <upload slot="upload" @onSuccess="onSuccess" target="archives" :classType="uploadType"></upload>
+          <template v-slot:delete="scope">
+            <delete1 @deleteFile="deleteFile" :obj="scope.data"></delete1>
+          </template>
+          <template v-slot:download="scope">
+            <download :data="scope.data"></download>
+          </template>
+        </file-list>
+        <!--富文本-->
+        <file-text ref="text" v-if="uploadType == '3'">
+          <Editor
+              ref="editor"
+              slot="editor"
+              :content="cacheInfo.content.content"
+              :id="uploadCacheData.sat_sharematerialid"
+          ></Editor>
+        </file-text>
+      </el-col>
       <!-- 授权范围 -->
-<!--      <el-col :span="10">
+      <el-col :span="10" v-if="$route.path === '/upload_archives'">
         <scopeOfauth
           style="margin-left:10px;"
           :defaultData="defaultData"
@@ -38,7 +61,7 @@
           obiectName="sat_sharematerialid"
           @onChecked="onChecked"
         />
-      </el-col>-->
+      </el-col>
     </el-row>
     <div class="fixed__btn__panel">
       <el-button size="small" @click="$store.dispatch('DrawerShowChange',false)" class="normal-btn-width">取 消</el-button>
@@ -173,7 +196,10 @@ export default {
           this.$api.requested(this.cacheInfo).then(res => {
             this.tool.showMessage(res, () => {
               this.uploadCacheData.status = '完成'
-             /* this.insertCoursewareauth()*/
+              if (this.$route.path === '/upload_archives'){
+                this.insertCoursewareauth()
+              }
+
               this.$store.dispatch('DrawerShowChange',false)
               this.$router.back()
               this.$emit('onSuccess')