10 Commits 0b9d059d5a ... 4798ea765a

Author SHA1 Message Date
  shanbinzhang 4798ea765a Merge branch 'debug' of http://8.136.199.33:3000/eta_front/eta_mobile_front into debug 1 day ago
  shanbinzhang 0bb58f653a Merge branch 'need_pool296' into debug 1 day ago
  shanbinzhang b96e4b3c40 需求:章节提交后不可编辑 1 day ago
  ldong a41d5acc2e Merge branch 'bug5979' 1 week ago
  yujinwen a56024302b Merge branch 'fix_nh_pdf' 1 week ago
  yujinwen 3b97c84dbf 增加国能专属打包 1 week ago
  yujinwen cd8c2ee80d 增加国能专属打包 1 week ago
  yujinwen 4a6f4cdf24 增加国能专属打包 1 week ago
  shanbinzhang a2e669d6a1 Merge branch 'fix_cnpc2.1' 1 week ago
  shanbinzhang 66dbfd8a1c commit 1 week ago

+ 2 - 0
.env.libgn

@@ -0,0 +1,2 @@
+# 这个webcomponent的库用到 eta_report项目的
+VITE_APP_BASEAPIURL="/ybreport/api"

+ 1 - 0
package.json

@@ -8,6 +8,7 @@
     "build": "vite build --mode production",
     "build.test": "vite build --mode test",
     "build.lib": "vite build --mode lib",
+    "build.libgn": "vite build --mode libgn",
     "preview": "vite preview"
   },
   "dependencies": {

+ 9 - 0
src/api/report.js

@@ -374,6 +374,15 @@ export default {
         return post('/report/chapter/title/edit',params)
     },
 
+    /**
+	 * 撤销章节发布
+	 * @param {*} params ReportChapterId
+	 * @returns 
+	 */
+	cancelChapter: params => {
+		return post('/report/chapter/publish/cancel',params)
+	},
+
     /**
      * 获取报告图表刷新状态
      * @param {*} params 

+ 1 - 1
src/views/externalReport/List.vue

@@ -510,7 +510,7 @@ function goDetail(item){
                     <p class="van-multi-ellipsis--l2 des">{{item.Abstract}}</p>
                     <div class="bot-info">
                         <div class="time">
-                            <span style="margin-right:2px">{{moment(item.ReportUpdateTime).format('YYYY-MM-DD')}}</span>
+                            <span style="margin-right:2px">{{moment(item.ModifyTime).format('YYYY-MM-DD')}}</span>
                         </div>
                         <span class="author van-ellipsis">{{item.SysUserName}}</span>
                     </div>

+ 13 - 4
src/views/report/EditReport.vue

@@ -303,10 +303,19 @@ async function autoSaveReportChapter(type="auto"){
 
 /* 提交章节 */
 async function handlePublishChapter() {
-    const saveRes = await autoSaveReportChapter('auto');
-    if(!saveRes) return
-
-    handlePublishChapterApi(reportData.value.ReportChapterId)
+    showDialog({
+        title: '提示',
+        showCancelButton: true,
+        message: '章节提交后不可编辑,是否确认提交?',
+        confirmButtonText: '确认',
+        cancelButtonText: '取消', 
+    }).then( async() => {
+		const saveRes = await autoSaveReportChapter('auto');
+        if(!saveRes) return
+
+        handlePublishChapterApi(reportData.value.ReportChapterId)
+
+    }).catch(() =>{})
 }
 
 </script>

+ 28 - 3
src/views/report/chapter/List.vue

@@ -216,6 +216,30 @@ function handleDelChapter(item) {
 
 }
 
+/* 撤销章节 */
+function handleCancelChapter(item) {
+    showItemOpt.value = false
+    showDialog({
+        title: '提示',
+        showCancelButton: true,
+        message: '是否确认撤销该章节?',
+        confirmButtonText: '确认',
+        cancelButtonText: '取消', 
+    }).then( async() => {
+        const res = await apiReport.cancelChapter({
+            ReportChapterId: item.ReportChapterId
+        })
+
+        if(res.Ret!==200) return
+        showToast('撤销成功')
+        
+        let index = chapterList.value.findIndex(_=>_.ReportChapterId===item.ReportChapterId)
+        chapterList.value[index].PublishState = 1;
+
+    }).catch(() =>{})
+}
+
+
 /* 上传章节音频 */
 // 上传音频
 const showUploadAudio=ref(false)
@@ -358,7 +382,7 @@ function handleConfirmEditTrendTag(){
 // 跳转章节详情
 async function goChapterDetail(item){
 
-    if(item.IsAuth) {
+    if(item.IsAuth && item.PublishState===1) {
         //编辑前标记一下
         const res = await apiReport.reportMark({
             Status: 1,
@@ -512,7 +536,7 @@ async function handleConfirmSetLayout() {
                 <template #item="{element}">
                     <li class="item"  @click="goChapterDetail(element)">
                         <div class="item-top">
-                            <div class="type-name" v-if="element.TypeName">{{element.TypeName}}宏观</div>
+                            <div class="type-name" v-if="element.TypeName">{{element.TypeName}}</div>
                         </div>
 
                         <div class="content">
@@ -541,7 +565,7 @@ 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>
@@ -687,6 +711,7 @@ async function handleConfirmSetLayout() {
             <div class="title">{{activeItem.Title}}</div>
 
             <div class="item" @click="handleChapterInfo(activeItem)" v-if="isCreator">基础信息</div>
+            <div class="item" @click="handleCancelChapter(activeItem)" v-if="activeItem.IsAuth&&activeItem.PublishState===2">撤销</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>

+ 13 - 3
src/views/report/smartReport/EditReport.vue

@@ -806,10 +806,20 @@ async function autoSaveReportChapter(type="auto"){
 
 /* 提交章节 */
 async function handlePublishChapter() {
-    const saveRes = await autoSaveReportChapter('auto');
-    if(!saveRes) return
+		showDialog({
+        title: '提示',
+        showCancelButton: true,
+        message: '章节提交后不可编辑,是否确认提交?',
+        confirmButtonText: '确认',
+        cancelButtonText: '取消', 
+    }).then( async() => {
+        
+			const saveRes = await autoSaveReportChapter('auto');
+			if(!saveRes) return
+
+			handlePublishChapterApi(reportInfo.value.ReportChapterId)
 
-    handlePublishChapterApi(reportInfo.value.ReportChapterId)
+    }).catch(() =>{})
 }
 
 const { 

+ 1 - 1
vite.config.js

@@ -92,7 +92,7 @@ export default ({ mode }) =>{
           ]
         }
       },
-    build: mode=='lib'?etaWebCompBuildConfig:{
+    build: ['lib','libgn'].includes(mode)?etaWebCompBuildConfig:{
       outDir: loadEnv(mode, process.cwd()).VITE_APP_OUTDIR,
       rollupOptions: {
         plugins: [