浏览代码

switch branch

Karsa 7 月之前
父节点
当前提交
22bf6696dd
共有 3 个文件被更改,包括 51 次插入41 次删除
  1. 二进制
      src/assets/imgs/report/icon_info.png
  2. 27 25
      src/views/report/EditReport.vue
  3. 24 16
      src/views/report/components/AddReportBaseInfoV2.vue

二进制
src/assets/imgs/report/icon_info.png


+ 27 - 25
src/views/report/EditReport.vue

@@ -15,6 +15,7 @@ import {usePublicSettingStore} from '@/store/modules/publicSetting'
 import {reportManageBtn,useAuthBtn} from '@/hooks/useAuthBtn'
 import {useReportApprove} from '@/hooks/useReportApprove'
 import {Base64} from 'js-base64'
+import AddReportBaseInfoV2 from './components/AddReportBaseInfoV2.vue'
 
 const cachedViewsStore=useCachedViewsStore()
 const publicSettingStore = usePublicSettingStore()
@@ -82,33 +83,20 @@ async function getReportDetail(){
         reportBaseInfoData.frequency=[res.Data.Frequency]
         reportBaseInfoData.createtime=moment(res.Data.CreateTime).format('YYYY-MM-DD')
         reportBaseInfoData.title=res.Data.Title
-        reportBaseInfoData.abstract=res.Data.Abstract
+        reportBaseInfoData.cooperationType=res.Data.CollaborateType
+        reportBaseInfoData.cooperationUsers=res.Data.GrandAdminList
+            ? res.Data.GrandAdminList.map(_ => ({
+                NodeId: _.AdminId,
+                NodeName: _.AdminName
+            }))
+            : []
+        reportBaseInfoData.reportLayout=res.Data.ReportLayout
+        reportBaseInfoData.isPublcPublish=res.Data.IsPublicPublish
 
         reportContentEditorIns.html.set(res.Data.Content);
         
         const classify = reportBaseInfoData.classifyName.map(i=>i.id)
         checkClassifyNameArr(1,classify)
-        // 查找选中的分类是否有电话会
-        const classifyRes=await apiReport.getClassifyList({
-            CurrentIndex:1,
-            PageSize:1000,
-            KeyWord:'',
-            HideDayWeek:1
-        })
-        if(classifyRes.Ret===200){
-            const arr=classifyRes.Data.List||[]
-            arr.forEach(item=>{
-                if(item.Id==reportBaseInfoData.classifyName[0].id){
-                    reportBaseInfoData.classifyName[0].HasTeleconference=item.HasTeleconference
-                }
-                item.Child&&item.Child.forEach(_item=>{
-                    if(_item.Id==reportBaseInfoData.classifyName[1].id){
-                        reportBaseInfoData.classifyName[1].HasTeleconference=_item.HasTeleconference
-                    }
-                })
-            })
-        }
-        
 
     }
 }
@@ -123,7 +111,11 @@ let reportBaseInfoData={
     frequency: ['日度'],
     createtime:moment().format('YYYY-MM-DD'),
     title:'',
-    abstract:''
+    abstract:'',
+    cooperationType:1,
+    cooperationUsers:[],
+    reportLayout: 1,
+    isPublcPublish: 1
 }
 async function handleReportBaseInfoChange(e){
     reportBaseInfoData=e
@@ -475,13 +467,17 @@ const getSystemInfoFun=()=>{
 
 <template>
     <div class="add-report-page">
-        <van-cell title="基础信息" is-link @click="showReportBaseInfo=true"/>
+        <!-- <van-cell title="基础信息" is-link @click="showReportBaseInfo=true"/> -->
         <div class="main-wrap">
             <div class="editor-box" id="editor"></div>
         </div>
         <!-- 底部操作 -->
         <div class="bot-action-box">
             <div class="left-box">
+                <div class="item" @click="showReportBaseInfo=true">
+                    <img src="@/assets/imgs/report/icon_info.png" alt="">
+                    <span>基础信息</span>
+                </div>
                 <div class="item" @click="handleRefreshAllChart">
                     <img src="@/assets/imgs/report/icon_refresh.png" alt="">
                     <span>刷新</span>
@@ -525,7 +521,13 @@ const getSystemInfoFun=()=>{
         position="bottom"
         :style="{ height: '100%' }"
     >
-        <EditReportBaseInfo v-if="showReportBaseInfo" :defaultData="reportBaseInfoData" @close="showReportBaseInfo=false" @confirm="handleReportBaseInfoChange"/>
+        <!-- <EditReportBaseInfo v-if="showReportBaseInfo" :defaultData="reportBaseInfoData" @close="showReportBaseInfo=false" @confirm="handleReportBaseInfoChange"/> -->
+        <AddReportBaseInfoV2
+            @close="showReportBaseInfo=false"
+            :id="Number(route.query.id)"
+            :defaultData="reportBaseInfoData"
+            @confirm="handleReportBaseInfoChange"
+        />
     </van-popup>
 
     <!-- 报告插入数据模块 -->

+ 24 - 16
src/views/report/components/AddReportBaseInfoV2.vue

@@ -4,49 +4,57 @@ import {ref,reactive, computed} from 'vue'
 import { useRouter } from 'vue-router'
 import apiReport from '@/api/report'
 import { showToast } from 'vant'
+import { useWindowSize } from '@vueuse/core'
 import ListClassify from './ListClassify.vue'
 import CooperUserSelect from './CooperUserSelect.vue'
 
 
 const router=useRouter()
 
+const { width, height } = useWindowSize()
+
 const props = defineProps({
   id: {
     type: Number,
     default: 0,
   },
-  reportInfo: {
-    type: Object
+  defaultData: {
+    type: Object,
+    default: null
   }
 })
-const emit = defineEmits(['close','change'])
+const emit = defineEmits(['close','change','confirm'])
+
+
 
 const relationVarietyLabel = computed(() => {
   if(!reportBaseInfo.relationVariety) return  ''
 
   return reportBaseInfo.relationVariety.map(_ => _.PermissionName).join(',')
 })
-
 const cooperationUsersLabel = computed(() => {
   if(!reportBaseInfo.cooperationUsers) return  ''
 
   return reportBaseInfo.cooperationUsers.map(_ => _.NodeName).join(',')
 })
 
+
+
+console.log(props.defaultData)
 const reportBaseInfo=reactive({
-    type: 1,
+    type: props.defaultData?props.defaultData.addType:1,
     inheritId: 0,//继承report id
-    classifyIds: [],
-    classifyName:'',
+    classifyIds: props.defaultData?props.defaultData.classifyName.map(_=>_.id):[],
+    classifyName:props.defaultData?props.defaultData.classifyName.map(_=>_.text).join('/'):'',
     relationVariety: [],
-    title: "",
-    abstract: "",
-    author: [],
-    time: moment().format("YYYY-MM-DD"),
-    cooperationType: 1,//协作方式
-    cooperationUsers: [],
-    reportLayout: 1,//报告布局
-    isPublcPublish: 1
+    title: props.defaultData?props.defaultData.title:"",
+    abstract: props.defaultData?props.defaultData.abstract:"",
+    author: props.defaultData?props.defaultData.author:[],
+    time: props.defaultData?props.defaultData.createtime:moment().format("YYYY-MM-DD"),
+    cooperationType: props.defaultData?props.defaultData.cooperationType:1,//协作方式
+    cooperationUsers: props.defaultData?props.defaultData.cooperationUsers:[],
+    reportLayout: props.defaultData?props.defaultData.reportLayout:1,//报告布局
+    isPublcPublish: props.defaultData?props.defaultData.isPublcPublish:1
 })
 
 
@@ -264,7 +272,7 @@ async function handleSave() {
             v-model="reportBaseInfo.type" 
             direction="horizontal" 
             @change="handleUpdateBaseInfo"
-            :disabled="id"
+            :disabled="id?true:false"
           >
             <van-radio :name="1">新增</van-radio>
             <van-radio :name="2">继承</van-radio>