jwyu 1 an în urmă
părinte
comite
9d603f62c2

+ 4 - 3
src/directives/LongPress.js

@@ -1,12 +1,12 @@
 // 长按指令
 //eg: v-longpress="{ handler: onLongPressItem, args: item, duration: 1000 }"
-
+let start,cancel;
 const LongPressDirective = {
   beforeMount(el, binding) {
     let pressTimer = null;
 
     // 长按开始
-    const start = (event) => {
+    start = (event) => {
       if (event.type === 'click' && event.button !== 0) {
         return;
       }
@@ -19,7 +19,7 @@ const LongPressDirective = {
     };
 
     // 长按结束
-    const cancel = () => {
+    cancel = () => {
       if (pressTimer !== null) {
         clearTimeout(pressTimer);
         pressTimer = null;
@@ -36,6 +36,7 @@ const LongPressDirective = {
   },
 
   beforeUnmount(el) {
+    if(!start) return
     el.removeEventListener('mousedown', start);
     el.removeEventListener('touchstart', start);
 

+ 1 - 0
src/views/ppt/components/PadPPTIndexWrap.vue

@@ -441,6 +441,7 @@ const showPopover=ref(false)
                 padding: 0 10px;
                 position: sticky;
                 top: 60px;
+                z-index: 99;
             }
             .list-wrap{
                 padding: var(--van-search-padding);

+ 25 - 2
src/views/report/List.vue

@@ -142,12 +142,20 @@ function handleReportPublishCancle(item){
 // 日期筛选
 const calendarMinDate=new Date(2010,0,1)
 const showCalendar=ref(false)
+const calendarIns=ref(null)
 function handleCalendarChange(e){
     listState.StartDate=moment(e[0]).format('YYYY-MM-DD')
     listState.EndDate=moment(e[1]).format('YYYY-MM-DD')
     refreshList()
     showCalendar.value=false
 }
+function handleResetCalendar(){
+    listState.StartDate=''
+    listState.EndDate=''
+    calendarIns.value.reset()
+    refreshList()
+    showCalendar.value=false
+}
 
 // 分类筛选
 function handleConfirmClassify({firstClassify,secondClassify}){
@@ -232,6 +240,13 @@ const reportStatusOpt=[
         value:1
     }
 ]
+function handleSelectReportStatus(item){
+    if(listState.MsgIsSend==item.value){
+        listState.MsgIsSend=''
+    }else{
+        listState.MsgIsSend=item.value
+    }
+}
 function handleSelectFrequency(item){
     if(listState.Frequency==item.value){
         listState.Frequency=''
@@ -326,7 +341,7 @@ async function goSearch(){
                                 :class="['status-item',listState.MsgIsSend===item.value?'active':'']" 
                                 v-for="item in reportStatusOpt" 
                                 :key="item.value"
-                                @click="listState.MsgIsSend=item.value"
+                                @click="handleSelectReportStatus(item)"
                             >{{item.label}}</li>
                         </ul>
                         
@@ -415,13 +430,21 @@ async function goSearch(){
         round
     >
         <van-calendar 
+            ref="calendarIns"
             :poppable="false"
             type="range"
             allow-same-day
             :min-date="calendarMinDate"
             @confirm="handleCalendarChange" 
             :style="{ height: '500px' }"
-        />
+        >
+            <template #title>
+                <div style="position: relative;">
+                    <span style="color:#666;position: absolute;left:16px" @click="handleResetCalendar">重置</span>
+                    <span>日期选择</span>
+                </div>
+            </template>
+        </van-calendar>
     </van-popup>
     
 </template>

+ 7 - 1
src/views/report/components/ListClassify.vue

@@ -37,6 +37,12 @@ function handleCancle(){
     emits('close')
 }
 
+function handleReset(){
+    activeIndex.value=0
+    activeId.value=null
+    emits('confirm',{firstClassify:'',secondClassify:''})
+}
+
 function handleConfirm(){
     const firstClassify=list.value[activeIndex.value].text
     const secondClassify=activeId.value||''
@@ -47,7 +53,7 @@ function handleConfirm(){
 <template>
     <div class="report-list-classify-wrap">
         <div class="top-box">
-            <span style="color:#666666" @click="handleCancle">取消</span>
+            <span style="color:#666666" @click="handleReset">重置</span>
             <span style="font-size:18px;font-weight:bold">选择分类</span>
             <span style="color:#0052D9" @click="handleConfirm">确定</span>
         </div>

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

@@ -117,12 +117,20 @@ function handleReportPublishCancle(item){
 // 日期筛选
 const calendarMinDate=new Date(2010,0,1)
 const showCalendar=ref(false)
+const calendarIns=ref(null)
 function handleCalendarChange(e){
     listState.StartDate=moment(e[0]).format('YYYY-MM-DD')
     listState.EndDate=moment(e[1]).format('YYYY-MM-DD')
     refreshList()
     showCalendar.value=false
 }
+function handleResetCalendar(){
+    listState.StartDate=''
+    listState.EndDate=''
+    calendarIns.value.reset()
+    refreshList()
+    showCalendar.value=false
+}
 
 // 分类筛选
 function handleConfirmClassify({firstClassify,secondClassify}){
@@ -198,6 +206,13 @@ const reportStatusOpt=[
         value:1
     }
 ]
+function handleSelectReportStatus(item){
+    if(listState.MsgIsSend==item.value){
+        listState.MsgIsSend=''
+    }else{
+        listState.MsgIsSend=item.value
+    }
+}
 function handleSelectFrequency(item){
     if(listState.Frequency==item.value){
         listState.Frequency=''
@@ -291,7 +306,7 @@ function goSearch(){
                                 :class="['status-item',listState.MsgIsSend===item.value?'active':'']" 
                                 v-for="item in reportStatusOpt" 
                                 :key="item.value"
-                                @click="listState.MsgIsSend=item.value"
+                                @click="handleSelectReportStatus(item)"
                             >{{item.label}}</li>
                         </ul>
                         
@@ -371,13 +386,21 @@ function goSearch(){
         round
     >
         <van-calendar 
+            ref="calendarIns"
             :poppable="false"
             type="range"
             allow-same-day
             :min-date="calendarMinDate"
             @confirm="handleCalendarChange" 
             :style="{ height: '500px' }"
-        />
+        >
+            <template #title>
+                <div style="position: relative;">
+                    <span style="color:#666;position: absolute;left:16px" @click="handleResetCalendar">重置</span>
+                    <span>日期选择</span>
+                </div>
+            </template>
+        </van-calendar>
     </van-popup>
 </template>
 

+ 7 - 1
src/views/reportEn/components/ListClassify.vue

@@ -37,6 +37,12 @@ function handleCancle(){
     emits('close')
 }
 
+function handleReset(){
+    activeIndex.value=0
+    activeId.value=null
+    emits('confirm',{firstClassify:'',secondClassify:''})
+}
+
 function handleConfirm(){
     const firstClassify=list.value[activeIndex.value].text
     const secondClassify=activeId.value||''
@@ -47,7 +53,7 @@ function handleConfirm(){
 <template>
     <div class="report-list-classify-wrap">
         <div class="top-box">
-            <span style="color:#666666" @click="handleCancle">取消</span>
+            <span style="color:#666666" @click="handleReset">重置</span>
             <span style="font-size:18px;font-weight:bold">选择分类</span>
             <span style="color:#0052D9" @click="handleConfirm">确定</span>
         </div>