jwyu 1 年之前
父節點
當前提交
cfb12b1019

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 # 接口地址http://8.136.199.33:8610/v1   https://rddptest.hzinsights.com/adminapi
-VITE_APP_API_URL="http://8.136.199.33:8610/v1"
+VITE_APP_API_URL="https://rddptest.hzinsights.com/adminapi"
 # 路由根地址
 VITE_APP_BASE_URL="/"
 # 打包输入文件名

+ 2 - 0
index.html

@@ -5,10 +5,12 @@
     <link rel="icon" type="image/x-icon" href="/fa.ico"/>
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
     <title>移动ETA</title>
+    <link href='/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />
   </head>
   <body>
     <div id="app"></div>
     <script type="module" src="/src/main.js"></script>
     <script src="/jquery-3.6.0.min.js"></script>
+    <script type='text/javascript' src='/froala_editor.pkgd.min.js'></script>
   </body>
 </html>

+ 1 - 0
package.json

@@ -28,6 +28,7 @@
     "pptxgenjs": "^3.12.0",
     "v3-color-picker-teleport": "^1.0.9",
     "vant": "^4.1.2",
+    "vconsole": "^3.15.0",
     "vue": "^3.2.47",
     "vue-router": "^4.1.6"
   },

File diff suppressed because it is too large
+ 6 - 0
public/froala_editor.pkgd.min.css


File diff suppressed because it is too large
+ 6 - 0
public/froala_editor.pkgd.min.js


+ 6 - 0
src/api/report.js

@@ -22,6 +22,7 @@ export default {
      * @param CurrentIndex
      * @param PageSize
      * @param KeyWord
+     * @param HideDayWeek 1不显示晨报/周报
      */
     getClassifyList:params=>{
         return get('/classify/list',params)
@@ -115,5 +116,10 @@ export default {
      */
     publishDayOrWeekReport:params=>{
         return post('/report/publishDayWeekReport',params)
+    },
+
+    // 获取研报作者列表
+    reportAuthorList:params=>{
+        return get('/report/author',params)
     }
 }

二進制
src/assets/imgs/report/icon_preview.png


二進制
src/assets/imgs/report/icon_publish3.png


二進制
src/assets/imgs/report/icon_refresh.png


二進制
src/assets/imgs/report/icon_save2.png


+ 7 - 7
src/assets/styles/common.scss

@@ -51,12 +51,6 @@ img {
     border-radius: 5PX;
 }
 
-// vant搜索框样式
-.van-search__content{
-    border: 1px solid $border-color;
-    background: #ffff !important;
-}
-
 // 列表无数据占位图
 .list-empty-img{
     width: 400px;
@@ -115,4 +109,10 @@ img {
             font-size: 18px;
         }
     }
-}
+}
+
+// froala样式
+.fr-second-toolbar {
+    display: none !important;
+}
+a[href="https://froala.com/wysiwyg-editor"], a[href="https://www.froala.com/wysiwyg-editor?k=u"]{ border:1px solid #eaeaea; background:#fff !important; color:#ccc !important; }

+ 40 - 0
src/assets/styles/vant.scss

@@ -0,0 +1,40 @@
+// vant搜索框样式
+.van-search__content{
+    border: 1px solid $border-color;
+    background: #ffff !important;
+}
+
+.van-action-sheet__content {
+    .van-action-sheet__item{
+        border-bottom: 1px solid $border-color;
+        &:last-child{
+            border: none;
+        }
+    }
+}
+
+.van-button--default{
+    border-color: $theme-color;
+    color: $theme-color;
+}
+
+.van-cell__title{
+    font-size: 32px;
+}
+.van-cell__value{
+    font-size: 32px;
+}
+.van-cell__label{
+    font-size: 30px !important;
+}
+@media screen and (min-width:650px){
+    .van-cell__title{
+        font-size: 16px;
+    }
+    .van-cell__value{
+        font-size: 16px;
+    }
+    .van-cell__label{
+        font-size: 15px ;
+    }
+}

+ 2 - 1
src/assets/styles/var.scss

@@ -7,4 +7,5 @@ $border-color:#DCDFE6;
 $theme-red:#C54322;
 $theme-warning:#E37318;
 $media-width:650px;
-$page-padding:34px;//页面边距
+$page-padding:34px;//页面边距
+$page-bg-grey:#F6F6F6;//灰色背景

+ 2 - 0
src/directives/Index.js

@@ -1,6 +1,8 @@
 // 注册自定义指令
 import ScreenshotDirective from './Screenshot'
+import LongPress from './LongPress';
 
 export function RegisterDirective(app){
     app.directive('screenshot', ScreenshotDirective);
+    app.directive('longpress', LongPress);
 }

+ 49 - 0
src/directives/LongPress.js

@@ -0,0 +1,49 @@
+// 长按指令
+//eg: v-longpress="{ handler: onLongPressItem, args: item, duration: 1000 }"
+
+const LongPressDirective = {
+  beforeMount(el, binding) {
+    let pressTimer = null;
+
+    // 长按开始
+    const start = (event) => {
+      if (event.type === 'click' && event.button !== 0) {
+        return;
+      }
+
+      if (pressTimer === null) {
+        pressTimer = setTimeout(() => {
+          binding.value.handler(binding.value.args);
+        }, binding.value.duration || 500); // 默认长按时间为500毫秒,可通过value.duration修改
+      }
+    };
+
+    // 长按结束
+    const cancel = () => {
+      if (pressTimer !== null) {
+        clearTimeout(pressTimer);
+        pressTimer = null;
+      }
+    };
+
+    el.addEventListener('mousedown', start);
+    el.addEventListener('touchstart', start);
+
+    el.addEventListener('click', cancel);
+    el.addEventListener('mouseout', cancel);
+    el.addEventListener('touchend', cancel);
+    el.addEventListener('touchcancel', cancel);
+  },
+
+  beforeUnmount(el) {
+    el.removeEventListener('mousedown', start);
+    el.removeEventListener('touchstart', start);
+
+    el.removeEventListener('click', cancel);
+    el.removeEventListener('mouseout', cancel);
+    el.removeEventListener('touchend', cancel);
+    el.removeEventListener('touchcancel', cancel);
+  }
+};
+
+export default LongPressDirective

+ 71 - 0
src/hooks/useFroalaEditor.js

@@ -0,0 +1,71 @@
+import { ref } from "vue";
+
+const options = {
+	toolbarButtons: [
+		"insertImage",
+		"insertVideo",
+		"embedly",
+		"insertFile",
+		"textColor",
+		"bold",
+		"italic",
+		"underline",
+		"strikeThrough",
+		"fontFamily",
+		"fontSize",
+		"color",
+		"lineHeight",
+		"align",
+		"formatOL",
+		"formatUL",
+		"outdent",
+		"indent",
+		"quote",
+		"insertTable",
+		"insertHR",
+		"undo",
+		"redo",
+	],
+	height: 400,
+	fontSize: ["12", "14", "16", "18", "20", "24", "28", "32", "36", "40"],
+	
+	fontSizeDefaultSelection: "16",
+	theme: "dark", //主题
+	placeholderText: "请输入内容",
+	language: "zh_cn", //国际化
+	imageUploadURL: import.meta.env.VITE_APP_API_URL + '/report/uploadImg', //上传url
+	videoUploadURL: import.meta.env.VITE_APP_API_URL + '/report/uploadImg', //上传url
+	fileUploadURL: import.meta.env.VITE_APP_API_URL + '/report/uploadImg', //上传url 更多上传介绍 请访问https://www.froala.com/wysiwyg-editor/docs/options
+	imageDefaultWidth: false,
+	quickInsertButtons: ['image', 'ul', 'ol'], //快速插入项
+	toolbarVisibleWithoutSelection: true, //是否开启 不选中模式
+	toolbarSticky: false, //操作栏是否自动吸顶
+	saveInterval: 0,
+	charCounterCount: false,
+	reportloadding: false,
+	lastsavetime: '',
+	isAddEnter: false, //是否已经添加过
+	timer: null,
+	ischange: false,
+	isPublishloading: false,
+	events:{
+
+	}
+};
+
+export function useInitFroalaEditor() {
+	let FroalaEditorIns = ref(null);
+
+	const initFroalaEditor = (el,opts) => {
+		console.log(opts);
+		options.height=opts?.height??500
+		console.log(options);
+		FroalaEditorIns.value = new FroalaEditor(el, options);
+	};
+
+	return {
+		FroalaEditorIns,
+
+		initFroalaEditor,
+	}
+}

+ 7 - 0
src/main.js

@@ -4,10 +4,17 @@ import router from "./router";
 import {registerVant} from './plugin/vant'
 import 'normalize.css'
 import './assets/styles/common.scss'
+import './assets/styles/vant.scss'
 import reportErr from '@/utils/reportErr'
 import '@vant/touch-emulator';
 import {RegisterDirective} from '@/directives/Index.js'
 import {setupStore} from '@/store'
+import VConsole from 'vconsole';
+
+
+if(import.meta.env.MODE==='test'){
+    const vConsole = new VConsole();
+}
 
 
 const app= createApp(App)

+ 9 - 1
src/router/report.js

@@ -1,5 +1,13 @@
 // 中文研报路由模块
- export const reportRoutes=[
+export const reportRoutes=[
+    {
+        path:"/report/add",
+        name:"ReportAdd",
+        component: () => import("@/views/report/AddReport.vue"),
+        meta: { 
+            title: "添加研报",
+        },
+    },
     {
         path:"/report/list",
         name:"ReportList",

+ 136 - 0
src/views/report/AddReport.vue

@@ -0,0 +1,136 @@
+<script setup name="ReportAdd">
+import {ref,onMounted, nextTick, watch} from 'vue'
+import {useInitFroalaEditor} from '@/hooks/useFroalaEditor'
+import EditReportBaseInfo from './components/EditReportBaseInfo.vue'
+import {useEidtReportBaseInfo} from './hooks/useEidtReportBaseInfo'
+
+
+const {FroalaEditorIns,initFroalaEditor}=useInitFroalaEditor()
+onMounted(() => {
+    const el=document.getElementById('editor')
+    initFroalaEditor('#editor',{height:el.offsetHeight-150})
+})
+
+
+
+
+// 报告基本内容
+const showReportBaseInfo=ref(false)
+const {getReportBaseInfo} =useEidtReportBaseInfo()
+
+
+
+function handlePublish(){
+    console.log(FroalaEditorIns.value.html.insert('foo bar', true));
+}
+
+</script>
+
+<template>
+    <div class="add-report-page">
+        <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">
+                    <img src="@/assets/imgs/report/icon_refresh.png" alt="">
+                    <span>刷新</span>
+                </div>
+                <div class="item">
+                    <img src="@/assets/imgs/report/icon_preview.png" alt="">
+                    <span>预览</span>
+                </div>
+                <div class="item">
+                    <img src="@/assets/imgs/report/icon_save2.png" alt="">
+                    <span>保存</span>
+                </div>
+                <div class="item" @click="handlePublish">
+                    <img src="@/assets/imgs/report/icon_publish3.png" alt="">
+                    <span>发布</span>
+                </div>
+            </div>
+            <div class="right-btn">
+                <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
+                    <path d="M12.0499 15.9499V27.5H15.9499V15.9499H27.5V12.0499H15.9499V0.5H12.0499V12.0499H0.5V15.9499H12.0499Z" fill="white"/>
+                </svg>
+            </div>
+        </div>
+    </div>
+
+    <!-- 报告基础信息 -->
+    <van-popup
+        v-model:show="showReportBaseInfo"
+        position="bottom"
+        :style="{ height: '100%' }"
+    >
+        <EditReportBaseInfo @close="showReportBaseInfo=false"/>
+    </van-popup>
+</template>
+<style lang="scss" scoped>
+.add-report-page{
+    height: 100vh;
+    display: flex;
+    flex-direction: column;
+    overflow: hidden;
+}
+.van-cell{
+    flex-shrink: 0;
+}
+.main-wrap{
+    flex: 1;
+    width: calc(100% - 32PX);
+    margin: 0 auto;
+    margin-top: 30px;
+    .editor-box{
+        width: 100%;
+        height: 100%;
+    }
+}
+.bot-action-box{
+    padding: 20px 16PX;
+    display: flex;
+    align-items: center;
+    .left-box{
+        flex: 1;
+        background: #FFFFFF;
+        box-shadow: 0px 12px 60px 10px rgba(0, 0, 0, 0.05), 0px 32px 48px 4px rgba(0, 0, 0, 0.04), 0px 16px 20px -10px rgba(0, 0, 0, 0.08);
+        border-radius: 100px;
+        height: 112px;
+        display: flex;
+        align-items: center;
+        margin-right: 20px;
+        padding: 0 20px;
+        .item{
+            flex: 1;
+            text-align: center;
+            font-size: 20px;
+            img{
+                width: 40px;
+                height: 40px;
+                display: block;
+                margin: 5px auto;
+            }
+        }
+    }
+    .right-btn{
+        flex-shrink: 0;
+        position: relative;
+        width: 96px;
+        height: 96px;
+        background-color: $theme-color;
+        border-radius: 50%;
+        box-shadow: 0px 6px 28px 4px rgba(0, 0, 0, 0.05), 0px 16px 20px 2px rgba(0, 0, 0, 0.06), 0px 10px 10px -6px rgba(0, 0, 0, 0.1);
+        svg{
+            width: 27px;
+            height: 27px;
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%,-50%);
+        }
+    }
+}
+</style>

+ 32 - 10
src/views/report/List.vue

@@ -6,7 +6,6 @@ import ListClassify from './components/ListClassify.vue'
 import ReportPublishPop from './components/ReportPublishPop.vue'
 import { showToast,showDialog,Dialog } from 'vant';
 import { useRouter } from 'vue-router';
-import { OnLongPress  } from '@vueuse/components'
 import { useWindowSize } from '@vueuse/core'
 import {useCachedViewsStore} from '@/store/modules/cachedViews'
 const cachedViewsStore=useCachedViewsStore()
@@ -152,8 +151,8 @@ function handleCalendarChange(e){
 
 // 分类筛选
 function handleConfirmClassify({firstClassify,secondClassify}){
-    listState.ClassifyNameFirst=firstClassify
-    listState.ClassifyNameSecond=secondClassify
+    listState.ClassifyNameFirst=firstClassify.text
+    listState.ClassifyNameSecond=secondClassify.text
     refreshList()
     showClassify.value=false
 }
@@ -263,6 +262,15 @@ async function goSearch(){
     router.push('/report/search')
 }
 
+const showAddReportPop=ref(false)
+function handleSelectAddReportType(e){
+    if(e.name==='研报'){
+        router.push('/report/add')
+    }else{
+
+    }
+}
+
 </script>
 
 <template>
@@ -348,14 +356,12 @@ async function goSearch(){
         >   
             <img v-if="listState.list.length==0&&listState.finished" class="list-empty-img" src="https://hzstatic.hzinsights.com/static/ETA_mobile/empty_img.png" alt="">
             <ul class="list-wrap">
-                <OnLongPress
+                <li
                     v-for="item in listState.list" 
                     :key="item.Id"
-                    @trigger="onLongPressItem(item)"
-                >
-                <li 
-                    class="item" 
+                    class="item"
                     @click="goDetail(item)"
+                    v-longpress="{ handler: onLongPressItem, args: item, duration: 1000 }"
                 >
                     <h2 class="van-ellipsis title">
                         <span :class="['tag',item.ChapterType]">{{['周报','晨报'].includes(item.ClassifyNameFirst)?item.ClassifyNameFirst:'研报'}}</span>
@@ -373,18 +379,34 @@ async function goSearch(){
                         </div>
                     </div>
                 </li>
-                </OnLongPress>
             </ul>
         </van-list>
     </div>
 
     <!-- 添加报告按钮 -->
-    <div class="add-report-btn">
+    <div class="add-report-btn" @click="showAddReportPop=true">
         <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
             <path d="M12.0499 15.9499V27.5H15.9499V15.9499H27.5V12.0499H15.9499V0.5H12.0499V12.0499H0.5V15.9499H12.0499Z" fill="white"/>
         </svg>
     </div>
 
+    <!-- 新增报告弹窗 -->
+    <van-action-sheet 
+        v-model:show="showAddReportPop"
+        cancel-text="取消"
+        close-on-click-action
+        :actions="[
+            {
+                name:'研报'
+            },
+            {
+                name:'晨报/周报'
+            }
+        ]"
+        @select="handleSelectAddReportType"
+    >
+    </van-action-sheet>
+
     <!-- 报告item操作 -->
     <van-action-sheet 
         v-model:show="showReportItemOpt"

+ 297 - 0
src/views/report/components/EditReportBaseInfo.vue

@@ -0,0 +1,297 @@
+<script setup>
+import moment from "moment"
+import { computed, reactive,ref } from "vue"
+import ListClassify from './ListClassify.vue'
+import apiReport from '@/api/report'
+import {reportFrequencyOpts} from '../utils/config'
+import { showToast } from "vant"
+import {useEidtReportBaseInfo} from '../hooks/useEidtReportBaseInfo'
+
+
+const emits=defineEmits(['close'])
+
+// 基本数据
+const {reportBaseInfo} =useEidtReportBaseInfo()
+
+// 报告新增类型
+const showAddTypePop=ref(false)
+const addTypeOpts=[
+    {
+        value:1,
+        name:'新增报告'
+    },
+    {
+        value:2,
+        name:'继承报告'
+    }
+]
+function getAddTypeName(value){
+    return addTypeOpts.filter(item=>item.value===value)[0].name
+}
+function selectAddType(e){
+    reportBaseInfo.addType=e.value
+}
+
+// 报告所属分类
+const showClassifyPop=ref(false)
+const setClassifyVal=computed(()=>{
+    if(reportBaseInfo.classifyName.length===2){
+        return `${reportBaseInfo.classifyName[0].text}/${reportBaseInfo.classifyName[1].text}`
+    }
+    return '请选择分类'
+})
+function handleConfirmClassify({firstClassify,secondClassify}){
+    if(!firstClassify.id||!secondClassify.id){
+        showToast('请选择分类')
+        return
+    }
+    reportBaseInfo.classifyName=[firstClassify,secondClassify]
+    showClassifyPop.value=false
+}
+
+// 研报作者
+const showAuthorPop=ref(false)
+const authorOpts=ref([])
+const temAuthorVal=ref([])
+function handleShowSelectAuthor(){
+    temAuthorVal.value=reportBaseInfo.author
+    showAuthorPop.value=true
+}
+function handleConfirmAuthor(){
+    reportBaseInfo.author=temAuthorVal.value
+    showAuthorPop.value=false
+}
+function getAuthorOpts(){
+    apiReport.reportAuthorList({}).then(res=>{
+        if(res.Ret===200){
+            authorOpts.value=res.Data?.List??[]
+        }
+    })
+}
+getAuthorOpts()
+
+// 报告频度
+const showFrequencyPop=ref(false)
+const temFrequencyVal=ref(['日度'])
+function handleConfirmFrequency(){
+    reportBaseInfo.frequency=temFrequencyVal.value
+    showFrequencyPop.value=false
+}
+
+// 创建日期
+const showCreateTimePop=ref(false)
+function handleConfirmCreatime(e){
+    reportBaseInfo.createtime=moment(e).format('YYYY-MM-DD')
+    showCreateTimePop.value=false
+}
+
+// 报告标题
+const showReportTitlePop=ref(false)
+const temReportTitleVal=ref('')
+function handleShowReportTitle(){
+    temReportTitleVal.value=reportBaseInfo.title
+    showReportTitlePop.value=true
+}
+function handleConfirmReportTitle(){
+    reportBaseInfo.title=temReportTitleVal.value
+    showReportTitlePop.value=false
+}
+
+// 摘要
+const showReportAbsPop=ref(false)
+const temReportAbsVal=ref('')
+function handleShowReportAbs(){
+    temReportAbsVal.value=reportBaseInfo.abstract
+    showReportAbsPop.value=true
+}
+function handleConfirmReportAbs(){
+    reportBaseInfo.abstract=temReportAbsVal.value
+    showReportAbsPop.value=false
+}
+
+
+
+function close(){
+    emits('close')
+}
+</script>
+
+<template>
+    <div class="report-baseinfo-wrap">
+        <van-cell-group>
+            <van-cell value-class="cell-con" required title="新增方式" :value="getAddTypeName(reportBaseInfo.addType)" is-link @click="showAddTypePop=true"/>
+            <van-cell value-class="cell-con" required title="分类" :value="setClassifyVal" is-link @click="showClassifyPop=true"/>
+            <van-cell value-class="cell-con" title="作者" :value="reportBaseInfo.author.join(',')" is-link @click="handleShowSelectAuthor"/>
+            <van-cell value-class="cell-con" title="频度" :value="reportBaseInfo.frequency.join('')" is-link @click="showFrequencyPop=true"/>
+            <van-cell value-class="cell-con" title="创建时间" :value="reportBaseInfo.createtime" is-link @click="showCreateTimePop=true"/>
+        </van-cell-group>
+
+        <van-cell-group style="margin:10px 0">
+            <van-cell  required title="标题" :label="reportBaseInfo.title" is-link @click="handleShowReportTitle"/>
+        </van-cell-group>
+
+        <van-cell-group>
+            <van-cell title="摘要" :label="reportBaseInfo.abstract" is-link @click="handleShowReportAbs"/>
+        </van-cell-group>
+
+        <div class="bot-btns">
+            <van-button class="bot-btn" type="default" @click="close">取消</van-button>
+            <van-button class="bot-btn" type="primary">保存</van-button>
+        </div>
+        
+    </div>
+
+    <!-- 新增方式 -->
+    <van-action-sheet 
+        v-model:show="showAddTypePop"
+        cancel-text="取消"
+        close-on-click-action
+        :actions="addTypeOpts" 
+        @select="selectAddType" 
+    />
+
+    <!-- 分类 -->
+    <van-popup
+        v-model:show="showClassifyPop"
+        position="bottom"
+        round
+    >
+        <ListClassify 
+            :hideDayWeek="1" 
+            :firstClassifyDisabled="true" 
+            @close="showClassifyPop=false" 
+            @confirm="handleConfirmClassify"
+        />
+    </van-popup>
+
+    <!-- 作者 -->
+    <van-popup
+        v-model:show="showAuthorPop"
+        position="bottom"
+        :style="{ height: '100%' }"
+    >
+        <div class="select-author-pop">
+            <van-checkbox-group v-model="temAuthorVal">
+                <van-checkbox
+                    v-for="item in authorOpts"
+                    :key="item.Id"
+                    :name="item.ReportAuthor"
+                >{{item.ReportAuthor}}</van-checkbox>
+            </van-checkbox-group>
+            <div class="bot-btns">
+                <van-button class="bot-btn" type="default" @click="showAuthorPop=false">取消</van-button>
+                <van-button class="bot-btn" type="primary" @click="handleConfirmAuthor">确定</van-button>
+            </div>
+        </div>
+    </van-popup>
+
+    <!-- 报告频度 -->
+    <van-popup
+        v-model:show="showFrequencyPop"
+        position="bottom"
+        round
+    >
+        <van-picker 
+            v-model="temFrequencyVal" 
+            title="选择频度" 
+            :columns="reportFrequencyOpts"
+            @confirm="handleConfirmFrequency"
+            @cancel="showFrequencyPop=false"
+        />
+    </van-popup>
+
+    <!-- 创建日期 -->
+    <van-calendar 
+        v-model:show="showCreateTimePop"
+        title="选择创建日期"
+        @confirm="handleConfirmCreatime" 
+    />
+
+    <!-- 标题 -->
+    <van-popup
+        v-model:show="showReportTitlePop"
+        position="bottom"
+        :style="{ height: '100%' }"
+    >
+        <div class="input-report-title-pop">
+             <van-field v-model="temReportTitleVal" placeholder="请输入报告标题" />
+            <div class="bot-btns">
+                <van-button class="bot-btn" type="default" @click="showReportTitlePop=false">取消</van-button>
+                <van-button class="bot-btn" type="primary" :disabled="!temReportTitleVal" @click="handleConfirmReportTitle">确定</van-button>
+            </div>
+        </div>
+    </van-popup>
+
+    <!-- 摘要 -->
+    <van-popup
+        v-model:show="showReportAbsPop"
+        position="bottom"
+        :style="{ height: '100%' }"
+    >
+        <div class="input-report-title-pop">
+             <van-field type="textarea" autosize v-model="temReportAbsVal" placeholder="请输入报告摘要" />
+            <div class="bot-btns">
+                <van-button class="bot-btn" type="default" @click="showReportAbsPop=false">取消</van-button>
+                <van-button class="bot-btn" type="primary" :disabled="!temReportAbsVal" @click="handleConfirmReportAbs">确定</van-button>
+            </div>
+        </div>
+    </van-popup>
+</template>
+
+<style lang="scss" scoped>
+.report-baseinfo-wrap{
+    height: 100%;
+    position: relative;
+    background: #EDEDED;
+    :deep(.cell-con){
+        flex: 2;
+    }
+    .bot-btns{
+        position: absolute;
+        bottom: 48px;
+        left: 0;
+        width: 100%;
+        text-align: center;
+    }
+}
+.bot-btn{
+    width: 315px;
+    margin: 0 10px;
+}
+
+.select-author-pop{
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    .van-checkbox-group{
+        padding: $page-padding;
+        flex: 1;
+        overflow-y: auto;
+        .van-checkbox{
+            :deep(.van-checkbox__label){
+                padding: 32px 0;
+                flex: 1;
+                border-bottom: 1px solid $border-color;
+            }
+        }
+    }
+    .bot-btns{
+        flex-shrink: 0;
+        padding: 20px 0;
+        text-align: center;
+    }
+}
+.input-report-title-pop{
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    background-color: $page-bg-grey;
+    
+    .bot-btns{
+        flex-shrink: 0;
+        padding: 20px 0;
+        text-align: center;
+    }
+}
+</style>

+ 26 - 5
src/views/report/components/ListClassify.vue

@@ -2,6 +2,11 @@
 import {ref} from 'vue'
 import apiReport from '@/api/report'
 
+const props=defineProps({
+    hideDayWeek:2,
+    firstClassifyDisabled:false,//一级分类是否要判断禁用
+})
+
 const emits=defineEmits(['close','confirm'])
 
 const list=ref([])
@@ -9,7 +14,8 @@ function getClassifyList(){
     apiReport.getClassifyList({
         CurrentIndex:1,
         PageSize:1000,
-        KeyWord:''
+        KeyWord:'',
+        HideDayWeek:props.hideDayWeek
     }).then(res=>{
         if(res.Ret===200){
             const arr=res.Data.List||[]
@@ -17,12 +23,14 @@ function getClassifyList(){
                 const child=item.Child?item.Child.map(e=>{
                     return {
                         text:e.ClassifyName,
-                        id:e.ClassifyName
+                        id:e.Id
                     }
                 }):[]
                 return {
                     text:item.ClassifyName,
-                    children:child
+                    id:item.Id,
+                    children:child,
+                    disabled:props.firstClassifyDisabled&&child.length===0?true:false
                 }
             })
         }
@@ -38,8 +46,20 @@ function handleCancle(){
 }
 
 function handleConfirm(){
-    const firstClassify=list.value[activeIndex.value].text
-    const secondClassify=activeId.value||''
+    const firstClassify={
+        text:list.value[activeIndex.value].text,
+        id:list.value[activeIndex.value].id
+    }
+    let secondClassify={text:'',id:''}
+    if(activeId.value){
+        list.value[activeIndex.value].children.forEach(e => {
+            if(e.id===activeId.value){
+                secondClassify.text=e.text
+                secondClassify.id=e.id
+            }
+        });
+    }
+
     emits('confirm',{firstClassify,secondClassify})
 }
 </script>
@@ -55,6 +75,7 @@ function handleConfirm(){
             v-model:active-id="activeId"
             v-model:main-active-index="activeIndex"
             :items="list"
+            @click-nav="activeId=null"
         />
     </div>
 </template>

+ 27 - 0
src/views/report/hooks/useEidtReportBaseInfo.js

@@ -0,0 +1,27 @@
+// 报告基本信息
+import { reactive } from "vue"
+import moment from "moment"
+
+export function useEidtReportBaseInfo(){
+    // 基本数据
+    const reportBaseInfo=reactive({
+        addType:1,
+        classifyName:[],
+        author:['FICC团队'],
+        frequency: ['日度'],
+        createtime:moment().format('YYYY-MM-DD'),
+        title:'',
+        abstract:''
+    })
+
+    // 获取基本数据
+    const getReportBaseInfo=()=>{
+        return reportBaseInfo
+    }
+
+
+    return {
+        reportBaseInfo,
+        getReportBaseInfo
+    }
+}

+ 35 - 0
src/views/report/utils/config.js

@@ -0,0 +1,35 @@
+// 报告频度配置项
+export const reportFrequencyOpts=[
+    {
+        text:'年度',
+        value:'年度'
+    },
+    {
+        text:'半年度',
+        value:'半年度'
+    },
+    {
+        text:'季度',
+        value:'季度'
+    },
+    {
+        text:'月度',
+        value:'月度'
+    },
+    {
+        text:'双周度',
+        value:'双周度'
+    },
+    {
+        text:'周度',
+        value:'周度'
+    },
+    {
+        text:'日度',
+        value:'日度'
+    },
+    {
+        text:'不定时',
+        value:'不定时'
+    },
+]

+ 2 - 6
src/views/reportEn/List.vue

@@ -5,7 +5,6 @@ import moment from 'moment'
 import ListClassify from './components/ListClassify.vue'
 import { showToast,showDialog,Dialog } from 'vant';
 import { useRouter } from 'vue-router';
-import { OnLongPress  } from '@vueuse/components'
 import { useWindowSize } from '@vueuse/core'
 import {useCachedViewsStore} from '@/store/modules/cachedViews'
 const cachedViewsStore=useCachedViewsStore()
@@ -313,14 +312,12 @@ function goSearch(){
         >   
             <img v-if="listState.list.length==0&&listState.finished" class="list-empty-img" src="https://hzstatic.hzinsights.com/static/ETA_mobile/empty_img.png" alt="">
             <ul class="list-wrap">
-                <OnLongPress
+                <li 
                     v-for="item in listState.list" 
                     :key="item.Id"
-                    @trigger="onLongPressItem(item)"
-                >
-                <li 
                     class="item" 
                     @click="goDetail(item)"
+                    v-longpress="{ handler: onLongPressItem, args: item, duration: 1000 }"
                 >
                     <h2 :class="['van-ellipsis title',item.Title.startsWith('【')?'inline-title':'']">{{item.Title}}</h2>
                     <p class="van-multi-ellipsis--l2 des">{{item.Abstract}}</p>
@@ -335,7 +332,6 @@ function goSearch(){
                         </div>
                     </div>
                 </li>
-                </OnLongPress>
             </ul>
         </van-list>
     </div>

Some files were not shown because too many files changed in this diff