wolyshaw před 4 roky
rodič
revize
1ca5afdac1

+ 30 - 10
src/views/photo-detail/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div class="m-container">
-    <h2>
+    <h2 v-if="type === 'DEFAULT'">
       <el-page-header @back="onCancel" :content="detailName"></el-page-header>
     </h2>
     <div class="m-core">
       <div class="buttons">
-        <el-button type="primary" @click="openUpload()">上传照片</el-button>
-        <el-button type="primary" :disabled="list.length == 0" v-if="!editing" @click="changeMode()">编辑照片</el-button>
-        <el-button type="danger" v-if="editing" @click="remove()">删除照片</el-button>
+        <el-button type="primary" @click="openUpload()">{{type === 'DEFAULT' ? '上传照片' : '上传证书'}}</el-button>
+        <el-button type="primary" :disabled="list.length == 0" v-if="!editing" @click="changeMode()">{{type === 'DEFAULT' ? '编辑照片' : '编辑证书'}}</el-button>
+        <el-button type="danger" v-if="editing" @click="remove()">{{type === 'DEFAULT' ? '删除照片' : '删除证书'}}</el-button>
         <el-button type="primary" v-if="editing" @click="confirm()">确定</el-button>
         <el-button type="primary" v-if="editing" @click="cancel()">取消</el-button>
       </div>
@@ -35,7 +35,8 @@
             </div>
             <div v-else class="ctrl-bar-view">
               <el-tooltip effect="dark" content="设为封面" placement="top" :open-delay=".5">
-                <i class="el-icon-picture-outline-round" @click="setCover(item)"></i>
+                <i class="el-icon-picture-outline-round" @click="setCover(item)" v-if="type === 'DEFAULT'"></i>
+                <i v-else></i>
               </el-tooltip>
               <el-tooltip effect="dark" :content="views.includes(item.id) ? '设为不可见' : '设为可见'" placement="top" :open-delay=".5">
                 <i class="el-icon-view" :class="{active: views.includes(item.id)}" @click="setViewItem(item)"></i>
@@ -49,14 +50,14 @@
             <el-tooltip v-if="!editing" class="item" effect="dark" :content="item.name" placement="top" :open-delay=".5">
               <div class="name">{{item.name}}</div>
             </el-tooltip>
-            <el-input class="nameinput" v-else v-model="item.name" size="mini" placeholder="请输入照片名称" clearable/>
+            <el-input class="nameinput" v-else v-model="item.name" size="mini" :placeholder="'请输入' + (type === 'DEFAULT' ? '照片' : '证书') + '名称'" clearable/>
           </div>
         </draggable>
       </el-checkbox-group>
       <empty v-if="list.length == 0"/>
     </div>
     <el-dialog
-      title="上传照片"
+      :title="type === 'DEFAULT' ? '上传照片' : '上传证书'"
       :visible.sync="uploadVisible"
       v-if="uploadVisible"
     >
@@ -73,6 +74,12 @@ import draggable from 'vuedraggable'
 import uploadPopup from '@/views/resetTeaming/components/training-photos/upload'
 import { photoQueryPage, photoDel, photoUpdate, photoAlbumUpdate } from '@/views/resetTeaming/components/training-photos/api'
 export default {
+  props: {
+    type: {
+      type: String,
+      default: ''
+    },
+  },
   components: {
     'upload-popup': uploadPopup,
     draggable,
@@ -80,7 +87,20 @@ export default {
   computed: {
     detailName() {
       return this.$route.query.name || '相册详情'
-    }
+    },
+    queryIdOrType() {
+      const id = this.$route.params.id
+      if (this.type === 'DEFAULT') {
+        return {
+          id,
+          type: this.type,
+        }
+      }
+      return {
+        type: this.type,
+        musicGroupId: this.$route.query.id,
+      }
+    },
   },
   data() {
     return {
@@ -111,7 +131,7 @@ export default {
       try {
         await this.$confirm('是否确认设置为封面?', '提示')
         await photoAlbumUpdate({
-          id: this.$route.params.id,
+          ...this.queryIdOrType,
           coverUrl: item.url
         })
         this.$message.success('设置成功')
@@ -154,7 +174,7 @@ export default {
     },
     async FetchList() {
       try {
-        const res = await photoQueryPage({photoAlbumId: this.$route.params.id})
+        const res = await photoQueryPage({...this.queryIdOrType, photoAlbumId: this.queryIdOrType.id})
         // console.log(res.data.rows)
         this.setInitViwes()
         this.list = res.data.rows

+ 10 - 0
src/views/resetTeaming/components/musicArchices.vue

@@ -50,6 +50,14 @@
         <training-photos/>
       </el-tab-pane>
       <el-tab-pane
+        label="获奖证书"
+        lazy
+        v-if="permission('/teamBaseInfo')"
+        name="9"
+      >
+        <photo-detail type="SHOW"/>
+      </el-tab-pane>
+      <el-tab-pane
         label="乐团资讯"
         lazy
         v-if="permission('/teamBaseInfo')"
@@ -71,6 +79,7 @@
 <script>
 import { permission } from "@/utils/directivePage";
 import trainingPhotos from './training-photos'
+import photoDetail from '@/views/photo-detail'
 import baseInfo from "./archicesComponents/baseInfo";
 import certificate from "./archicesComponents/certificate";
 import studentAndTeacher from "./archicesComponents/studentAndTeacher";
@@ -82,6 +91,7 @@ import workStatus from "./archicesComponents/workStatus";
 export default {
   components: {
     'training-photos': trainingPhotos,
+    'photo-detail': photoDetail,
     baseInfo,
     certificate,
     studentAndTeacher,

+ 4 - 2
src/views/resetTeaming/components/training-photos/index.vue

@@ -23,10 +23,10 @@
           <div class="photoNum">{{item.photoNum}} 张</div>
           <div class="dropdown">
             <el-tooltip effect="dark" content="重命名" placement="top" :open-delay=".5">
-              <i class="el-icon-edit" @click="openForm(item)"></i>
+              <i class="el-icon-edit" @click.stop="openForm(item)"></i>
             </el-tooltip>
             <el-tooltip effect="dark" content="删除" placement="top" :open-delay=".5">
-              <i style="color: #f56c6c" class="el-icon-delete" @click="removeItem(item)"></i>
+              <i style="color: #f56c6c" class="el-icon-delete" @click.stop="removeItem(item)"></i>
             </el-tooltip>
           </div>
           <!-- <el-dropdown class="dropdown" @command="command => handleCommand(command, item)">
@@ -46,6 +46,7 @@
       :title="detail ? '修改相册' : '创建相册'"
       :visible.sync="formVisible"
       v-if="formVisible"
+      width="500px"
     >
       <form-popup
         :detail="detail"
@@ -57,6 +58,7 @@
       title="上传照片"
       :visible.sync="uploadVisible"
       v-if="uploadVisible"
+      width="800px"
     >
       <upload-popup
         @close="uploadVisible = false"