Procházet zdrojové kódy

admin报告权限同创建人

shanbinzhang před 1 měsícem
rodič
revize
40cccab5d6

+ 6 - 11
src/views/report/chapter/List.vue

@@ -10,7 +10,6 @@ import { showToast,showDialog } from 'vant';
 import { useWindowSize } from '@vueuse/core'
 import {useCachedViewsStore} from '@/store/modules/cachedViews'
 import {usePublicSettingStore} from '@/store/modules/publicSetting'
-import EditBaseInfo from './components/EidtBaseInfo.vue'
 import ReportPublishTimeSet from '../components/ReportPublishTimeSet.vue'
 import html2canvas from "html2canvas";
 import {transfImgTobase64,isWeiXin} from '@/hooks/common'
@@ -68,7 +67,7 @@ async function handleReportBaseInfoChange(e){
 const isCreator = computed(() => {
 
     let userInfo = JSON.parse(Base64.decode(localStorage.getItem('userInfo')))
-    return userInfo.AdminId === reportInfo.value.AdminId;
+    return userInfo.AdminId===reportInfo.value.AdminId || userInfo.RoleTypeCode==='admin';
 })
 
 // 获取报告详情
@@ -541,13 +540,13 @@ async function handleConfirmSetLayout() {
                             
                         </div>
                         
-                        <img src="@/assets/imgs/report/icon_drag.png" alt="" class="move-icon">
+                        <img src="@/assets/imgs/report/icon_drag.png" alt="" class="move-icon" v-if="isCreator">
                     </li>
                 </template>
             </draggable>
 
             <van-button
-                v-if="checkAuthBtn(reportManageBtn.reportMange_chapter_add)"
+                v-if="checkAuthBtn(reportManageBtn.reportMange_chapter_add)&&isCreator"
                 type="primary" 
                 :size="chapterList.length?'normal':'large'" 
                 @click="handleChapterInfo(null)"
@@ -594,12 +593,7 @@ async function handleConfirmSetLayout() {
         position="bottom"
         :style="{height:'100%'}"
     >
-        <!-- <EditBaseInfo 
-            v-if="showBaseInfoPop" 
-            :defaultData="reportInfo"
-            @close="showBaseInfoPop=false"
-            @confirm="handleUpdateBaseInfo"
-        /> -->
+
         <AddReportBaseInfoV2
             @close="showBaseInfoPop=false"
             :id="Number(route.query.id)"
@@ -644,6 +638,7 @@ async function handleConfirmSetLayout() {
             :defaultData="activeItem"
             :userOpts="userOpts"
             :varietyOpts="reportVarietyOpts"
+            :isCreator="isCreator"
             @close="showChapterBaseInfo=false"
             @confirm="handleChapterBaseInfoSave"
         />
@@ -686,7 +681,7 @@ async function handleConfirmSetLayout() {
         <div class="report-item-action-box" v-if="activeItem">
             <div class="title">{{activeItem.Title}}</div>
 
-            <div class="item" @click="handleChapterInfo(activeItem)" v-if="isCreator">基础信息</div>
+            <div class="item" @click="handleChapterInfo(activeItem)" v-if="activeItem.IsAuth">基础信息</div>
             <div class="item" @click="handleDelChapter(activeItem)" v-if="isCreator">删除</div>
             <div class="item" @click="handleShowTrendTag(activeItem)" v-permission="reportManageBtn.reportMange_chapter_editTag">添加标签</div>
             <div class="item" @click="handleShowUploadAudio()">上传录音</div>

+ 4 - 3
src/views/report/chapter/components/EditChapterBaseInfo.vue

@@ -13,7 +13,8 @@ const { width, height } = useWindowSize()
 const props=defineProps({
     defaultData:null,
     userOpts: [],
-    varietyOpts:[]
+    varietyOpts:[],
+    isCreator:false
 })
 const emits=defineEmits(['close','confirm'])
 
@@ -108,7 +109,7 @@ async function handleSave(){
                 required
             />
         </van-cell-group>
-        <van-cell-group>
+        <van-cell-group v-if="isCreator">
             <van-cell 
                 value-class="cell-con"
                 title="关联品种" 
@@ -117,7 +118,7 @@ async function handleSave(){
                 @click="handleShowReportVariety"
             />
         </van-cell-group>
-        <van-cell-group>
+        <van-cell-group v-if="isCreator">
             <van-cell 
                 value-class="cell-con" 
                 title="编辑人"