Selaa lähdekoodia

Merge branch 'feature-2025-1-10-pad' into online

TIANYONG 6 kuukautta sitten
vanhempi
commit
5d374568d9

BIN
public/shareImg/statistics-school.png


+ 5 - 0
src/components/m-full-refresh/index.tsx

@@ -13,6 +13,10 @@ export default defineComponent({
     modelValue: {
       type: Boolean,
       default: false
+    },
+    freshDisabled: { // 是否禁用下拉刷新
+      type: Boolean,
+      default: false
     }
   },
   emits: ['refresh', 'update:modelValue'],
@@ -37,6 +41,7 @@ export default defineComponent({
         v-model:modelValue={state.fullState}
         onRefresh={() => emit('refresh')}
         loadingText=" "
+        disabled={props.freshDisabled}
         class={styles.pullRefresh}>
         {{
           // loading: () => (

+ 68 - 56
src/views/questionnaire-statistics-new/detail.tsx

@@ -24,13 +24,6 @@ export default defineComponent({
   setup() {
     const route = useRoute();
     const router = useRouter();
-    const areaTenantName = sessionStorage.getItem('areaTenantName') || ''
-    const shareTitle = areaTenantName + '音乐(器乐)数字化转型问卷统计';
-    const weChatShare = useWeChatShare(
-      shareTitle,
-      '科技赋能音乐(器乐)学习,在每一个孩子心中奏响美妙的乐章。',
-      window.location.origin + '/classroom-app/shareImg/questionnaire-statistics-new.png'
-    );
 
     const tabName = ref('all');
     const forms = reactive({
@@ -70,6 +63,7 @@ export default defineComponent({
         const res = await request.post(
           '/edu-app/open/meetingQuestionSetting/schoolStat',
           {
+            hideLoading: false,
             data: {
               schoolAreaId: forms.id
             }
@@ -151,9 +145,8 @@ export default defineComponent({
     }
 
     const onRefresh = async () => {
-      console.log('刷新111')
-      state.intervalOne = null;
-      clearInterval(state.intervalOne); // 停止定时器
+      // console.log('刷新111')
+      clearDataAnimation();
       finished.value = false;
       // 重新加载数据
       // 将 loading 设置为 true,表示处于加载状态
@@ -162,6 +155,10 @@ export default defineComponent({
       refreshing.value = false
     };
 
+    const clearDataAnimation = () => {
+      clearInterval(state.intervalOne); // 停止定时器
+      state.intervalOne = null;
+    }
 
     const initData = async () => {
       await queryInfo()
@@ -183,25 +180,37 @@ export default defineComponent({
           }
           percentage += 1; // 每次增加1%
           if (percentage > Math.max(state.schoolInfo.supportStudentRate, state.schoolInfo.participationStudentRate)) {
-            clearInterval(state.intervalOne); // 停止定时器
-            state.intervalOne = null;
+            clearDataAnimation();
             // percentage = 0;
           }
         }, 25); // 每25ms更新一次
       });
     }
-    onMounted(async () => {
+
+    const initWxShare = () => {
+      const shareTitle = (state.schoolInfo.schoolName||'') + '音乐(器乐)数字化转型调查统计';
+      const weChatShare = useWeChatShare(
+        shareTitle,
+        '科技赋能音乐(器乐)学习,在每一个孩子心中奏响美妙的乐章。',
+        window.location.origin + '/classroom-app/shareImg/statistics-school.png'
+      );
       if (browser().weixin) {
         weChatShare.getAppSignature()
       }
-      initData()
+    }
+
+    onMounted(async () => {
+      await initData()
+      nextTick(() => {
+        initWxShare()
+      });
     });
     onUnmounted(() => {
-        clearInterval(state.intervalOne); // 停止定时器
-        state.intervalOne = null;
+      clearDataAnimation();
     });
     return () => (
       <OFullRefresh
+      freshDisabled={state.gradeStatus}
       v-model:modelValue={refreshing.value}
       onRefresh={onRefresh}
       class={styles.refreshC}>
@@ -281,48 +290,51 @@ export default defineComponent({
             </li>                                             
         </ul>
         {/** 班级列表 */}
-        <div class={styles.scList}>
-          {
-            state.classList.map((item: any) => (
-              <div class={styles.sItem}>
-              <div class={[styles.itemTile, styles.itemTileDetail]}>
-                <img src={gradeIcon} />
-                <p>{item.currentGrade||''}{item.currentClass || ''}</p>
-                <div class={styles.itRight}><span class={styles.sRed}>{formatNumberWithComma(item.studentNum || 0)}</span> 人参与调查</div>
-              </div>
-              <ul class={styles.itemContent}>
-                <li>
-                  <div class={styles.icTop}>
-                    <span class={styles.sBlue}>{formatNumberWithComma(item.supportStudentNum || 0)}</span><i>人</i>
-                  </div>
-                 <p>支持开展</p>
-                </li>      
-                <li>
-                  <div class={styles.icTop}>
-                    <span class={styles.sBlue}>{Number(item.supportStudentRate || 0).toFixed(2)}%</span>
-                  </div>
-                 <p>支持率</p>
-                </li>  
+        {
+          state.classList.length ?
+          <div class={styles.scList}>
+            {
+              state.classList.map((item: any) => (
+                <div class={styles.sItem}>
+                <div class={[styles.itemTile, styles.itemTileDetail]}>
+                  <img src={gradeIcon} />
+                  <p>{item.currentGrade||''}{item.currentClass || ''}</p>
+                  <div class={styles.itRight}><span class={styles.sRed}>{formatNumberWithComma(item.studentNum || 0)}</span> 人参与调查</div>
+                </div>
+                <ul class={styles.itemContent}>
+                  <li>
+                    <div class={styles.icTop}>
+                      <span class={styles.sBlue}>{formatNumberWithComma(item.supportStudentNum || 0)}</span><i>人</i>
+                    </div>
+                  <p>支持开展</p>
+                  </li>      
+                  <li>
+                    <div class={styles.icTop}>
+                      <span class={styles.sBlue}>{Number(item.supportStudentRate || 0).toFixed(2)}%</span>
+                    </div>
+                  <p>支持率</p>
+                  </li>  
 
-                <li>
-                  <div class={styles.icTop}>
-                    <span class={styles.sGreen}>{formatNumberWithComma(item.participationStudentNum || 0)}</span><i>人</i>
-                  </div>
-                 <p>报名参加</p>
-                </li>
-
-                <li>
-                  <div class={styles.icTop}>
-                    <span class={styles.sGreen}>{Number(item.participationStudentRate || 0).toFixed(2)}%</span>
-                  </div>
-                 <p>参加率</p>
-                </li>                                
-              </ul>
-            </div>
-            ))
-          }
-        </div>
+                  <li>
+                    <div class={styles.icTop}>
+                      <span class={styles.sGreen}>{formatNumberWithComma(item.participationStudentNum || 0)}</span><i>人</i>
+                    </div>
+                  <p>报名参加</p>
+                  </li>
 
+                  <li>
+                    <div class={styles.icTop}>
+                      <span class={styles.sGreen}>{Number(item.participationStudentRate || 0).toFixed(2)}%</span>
+                    </div>
+                  <p>参加率</p>
+                  </li>                                
+                </ul>
+              </div>
+              ))
+            }
+          </div> : 
+          <OEmpty description="暂无内容" class={styles.emptyC} />
+        }
         {/* 班级 */}
         <Popup
           v-model:show={state.gradeStatus}

+ 4 - 2
src/views/questionnaire-statistics-new/index.module.less

@@ -185,6 +185,7 @@
   flex-wrap: nowrap;
   overflow-x: scroll;
   margin-top: 12px;
+  padding-bottom: 1px;
   &::-webkit-scrollbar {
     display: none;
   }
@@ -201,7 +202,8 @@
     font-size: 12px;
     color: #333333;
     padding: 0 8px;
-    margin-right: 10px;
+    margin-right: 6px;
+    box-sizing: content-box;
     >span {
       word-break: keep-all;
     }
@@ -554,7 +556,7 @@
       >p {
         position: absolute;
         left: 50%;
-        bottom: 26px;
+        bottom: 24px;
         transform: translateX(-58%) scale(0.85);
         text-align: center;
         font-size: 12px;

+ 15 - 11
src/views/questionnaire-statistics-new/index.tsx

@@ -118,8 +118,7 @@ export default defineComponent({
             }
             percentage += 1; // 每次增加1%
             if (percentage > Math.max(forms.totalInfo.supportRate, forms.totalInfo.participationRate)) {
-              clearInterval(state.intervalOne); // 停止定时器
-              state.intervalOne = null;
+              clearDataAnimation();
             }
           }, 25); // 每25ms更新一次
         });
@@ -164,7 +163,7 @@ export default defineComponent({
 
     const skipDetail = (id: any) => {
       // sessionStorage.setItem('areaIdx', forms.areaIdx)
-      sessionStorage.setItem('areaTenantName', forms.totalInfo.tenantName || '')
+      // sessionStorage.setItem('areaTenantName', forms.totalInfo.tenantName || '')
       sessionStorage.setItem('qsFilterParams', JSON.stringify({
         schoolName: forms.schoolName,
         sortType: forms.sortType,
@@ -212,18 +211,22 @@ export default defineComponent({
     }
 
     const onRefresh = async () => {
-      console.log('刷新111')
-      clearInterval(state.intervalOne); // 停止定时器
-      state.intervalOne = null;
+      // console.log('刷新111')
+      clearDataAnimation();
       forms.areaColumns = []
       finished.value = false;
       // 重新加载数据
       // 将 loading 设置为 true,表示处于加载状态
       loading.value = true;
-       await queryArea();
-       refreshing.value = false
+      await queryArea();
+      refreshing.value = false
     };
 
+    const clearDataAnimation = () => {
+      clearInterval(state.intervalOne); // 停止定时器
+      state.intervalOne = null;
+    }
+
     onMounted(async () => {
       console.log('刷新页面')
       forms.areaIdx = sessionStorage.getItem('areaIdx') || 0;
@@ -239,13 +242,13 @@ export default defineComponent({
     });
 
     onUnmounted(() => {
-      clearInterval(state.intervalOne); // 停止定时器
-      state.intervalOne = null;
+      clearDataAnimation();
     });
 
     return () => (
       <OFullRefresh
       v-model:modelValue={refreshing.value}
+      freshDisabled={forms.areaStatus}
       onRefresh={onRefresh}
       class={styles.refreshC}>
       <div class={[styles.statisBody]}>
@@ -422,9 +425,10 @@ export default defineComponent({
                 forms.schoolName = '';
                 forms.currentAreaInfo = forms.areaList[val.selectedOptions[0].value]
                 sessionStorage.setItem('areaIdx', forms.areaIdx)
+                clearDataAnimation()
                 queryInfo()
                 getList()
-                console.log('选择1111',val,forms.areaOptionIndex)
+                // console.log('选择1111',val,forms.areaOptionIndex)
               }}
             />
           )}

+ 51 - 41
src/views/questionnaire-statistics/detail.tsx

@@ -1,4 +1,4 @@
-import { defineComponent, onMounted, reactive, ref } from 'vue';
+import { defineComponent, onMounted, reactive, ref, nextTick } from 'vue';
 import styles from './index.module.less';
 import { List, Popup, DatePicker, Popover, Picker } from 'vant';
 import request from '@/helpers/request';
@@ -23,13 +23,6 @@ export default defineComponent({
   setup() {
     const route = useRoute();
     const router = useRouter();
-    const areaTenantName = sessionStorage.getItem('areaTenantName') || ''
-    const shareTitle = areaTenantName + '音乐(器乐)数字化转型问卷统计';
-    const weChatShare = useWeChatShare(
-      shareTitle,
-      '科技赋能音乐(器乐)学习,在每一个孩子心中奏响美妙的乐章。',
-      window.location.origin + '/classroom-app/shareImg/questionnaire-statistics.png'
-    );
 
     const tabName = ref('all');
     const forms = reactive({
@@ -67,6 +60,7 @@ export default defineComponent({
         const res = await request.post(
           '/edu-app/open/meetingQuestionSetting/schoolStat',
           {
+            hideLoading: false,
             data: {
               schoolAreaId: forms.id
             }
@@ -158,16 +152,29 @@ export default defineComponent({
       refreshing.value = false
     };
 
-    onMounted(async () => {
+    const initWxShare = () => {
+      const shareTitle = (state.schoolInfo.schoolName||'') + '音乐(器乐)数字化转型调查统计';
+      const weChatShare = useWeChatShare(
+        shareTitle,
+        '科技赋能音乐(器乐)学习,在每一个孩子心中奏响美妙的乐章。',
+        window.location.origin + '/classroom-app/shareImg/statistics-school.png'
+      );
       if (browser().weixin) {
         weChatShare.getAppSignature()
       }
+    }
+
+    onMounted(async () => {
       await queryInfo()
       queryList()
+      nextTick(() => {
+        initWxShare()
+      });
     });
 
     return () => (
       <OFullRefresh
+      freshDisabled={state.gradeStatus}
       v-model:modelValue={refreshing.value}
       onRefresh={onRefresh}
       class={styles.refreshC}>
@@ -215,39 +222,42 @@ export default defineComponent({
             </li>                        
         </ul>
         {/** 班级列表 */}
-        <div class={styles.scList}>
-          {
-            state.classList.map((item: any) => (
-              <div class={styles.sItem}>
-              <div class={styles.itemTile}>
-                <img src={gradeIcon} />
-                <p>{item.currentGrade||''}{item.currentClass || ''}</p>
+        {
+          state.classList.length ? 
+          <div class={styles.scList}>
+            {
+              state.classList.map((item: any) => (
+                <div class={styles.sItem}>
+                <div class={styles.itemTile}>
+                  <img src={gradeIcon} />
+                  <p>{item.currentGrade||''}{item.currentClass || ''}</p>
+                </div>
+                <ul class={styles.itemContent}>
+                  <li>
+                    <div class={styles.icTop}>
+                      <span class={styles.sRed}>{formatNumberWithComma(item.studentNum || 0)}</span><i>人</i>
+                    </div>
+                  <p>参与调查</p>
+                  </li>
+                  <li>
+                    <div class={styles.icTop}>
+                      <span class={styles.sBlue}>{formatNumberWithComma(item.supportStudentNum || 0)}</span><i>人</i>
+                    </div>
+                  <p>支持学校开展</p>
+                  </li>
+                  <li>
+                    <div class={styles.icTop}>
+                      <span class={styles.sBlue}>{Number(item.supportStudentRate).toFixed(2)}%</span>
+                    </div>
+                  <p>支持率</p>
+                  </li>                                
+                </ul>
               </div>
-              <ul class={styles.itemContent}>
-                <li>
-                  <div class={styles.icTop}>
-                    <span class={styles.sRed}>{formatNumberWithComma(item.studentNum || 0)}</span><i>人</i>
-                  </div>
-                 <p>参与调查</p>
-                </li>
-                <li>
-                  <div class={styles.icTop}>
-                    <span class={styles.sBlue}>{formatNumberWithComma(item.supportStudentNum || 0)}</span><i>人</i>
-                  </div>
-                 <p>支持学校开展</p>
-                </li>
-                <li>
-                  <div class={styles.icTop}>
-                    <span class={styles.sBlue}>{Number(item.supportStudentRate).toFixed(2)}%</span>
-                  </div>
-                 <p>支持率</p>
-                </li>                                
-              </ul>
-            </div>
-            ))
-          }
-        </div>
-
+              ))
+            }
+          </div> : 
+          <OEmpty description="暂无内容" class={styles.emptyC} />
+        }
         {/* 班级 */}
         <Popup
           v-model:show={state.gradeStatus}

BIN
src/views/questionnaire-statistics/images/tbg_icon1.png


BIN
src/views/questionnaire-statistics/images/tbg_icon2.png


BIN
src/views/questionnaire-statistics/images/tbg_icon3.png


+ 28 - 5
src/views/questionnaire-statistics/index.module.less

@@ -49,15 +49,36 @@
 }
 
 .scContent {
-  background: url('./images/total_box_icon.png') no-repeat center;
+  // background: url('./images/total_box_icon.png') no-repeat center;
   background-size: contain;
   width: 100%;
   height: 145px;
   margin: 8px 0 12px;
-  max-width: 400px;
+  // max-width: 400px;
   position: relative;
   left: 50%;
   transform: translateX(-50%);
+  .scBgBox {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    .scBg1 {
+      height: 145px;
+      object-fit: contain;
+    }
+    .scBg2 {
+      height: 145px;
+      flex: 1;
+    }
+    .scBg3 {
+      height: 145px;
+      object-fit: contain;
+    }    
+  }
   .scTop {
     margin: 19px 0 0 24px;
     display: inline-block;
@@ -142,11 +163,13 @@
         background-size: contain;
       }    
       &:nth-child(1)::before {
-        right: 4px;
+        //right: 4px;
+        transform: translateX(-4px);
       }
       &:nth-child(2)::before {
-        right: -8px;
-        z-index: 99;
+        //right: -8px;
+        //z-index: 99;
+        transform: translateX(8px);
       }
     }    
   }

+ 11 - 2
src/views/questionnaire-statistics/index.tsx

@@ -17,6 +17,9 @@ import totalBoxBg from './images/total_box_icon.png';
 import useWeChatShare from '@/hooks/useWeChatShare';
 import { browser } from '@/helpers/utils';
 import OFullRefresh from '@/components/m-full-refresh';
+import tbgIcon1 from './images/tbg_icon1.png';
+import tbgIcon2 from './images/tbg_icon2.png';
+import tbgIcon3 from './images/tbg_icon3.png';
 
 export default defineComponent({
   name: 'questionnaire-statistics',
@@ -106,7 +109,6 @@ export default defineComponent({
 
     const getList = async () => {
       try {
-        console.log(11111)
         const { provinceCode='',cityCode='',regionCode='' } = forms.currentAreaInfo
         const res = await request.post(
           '/edu-app/open/schoolMeetingQuestion/areaSummary',
@@ -140,7 +142,7 @@ export default defineComponent({
 
     const skipDetail = (id: any) => {
       // sessionStorage.setItem('areaIdx', forms.areaIdx)
-      sessionStorage.setItem('areaTenantName', forms.totalInfo.tenantName || '')
+      // sessionStorage.setItem('areaTenantName', forms.totalInfo.tenantName || '')
       sessionStorage.setItem('yqsFilterParams', JSON.stringify({
         schoolName: forms.schoolName,
         sortType: forms.sortType,
@@ -213,6 +215,7 @@ export default defineComponent({
     return () => (
       <OFullRefresh
       v-model:modelValue={refreshing.value}
+      freshDisabled={forms.areaStatus}
       onRefresh={onRefresh}
       class={styles.refreshC}>
       <div class={[styles.statisBody, forms.areaColumns.length == 1 ? styles.statisBody2 : styles.statisBody1]}>
@@ -228,6 +231,12 @@ export default defineComponent({
         </div>
         }
         <div class={styles.scContent}>
+          <div class={styles.scBgBox}>
+            <img class={styles.scBg1} src={tbgIcon1} />
+            <img class={styles.scBg2} src={tbgIcon2} />
+            <img class={styles.scBg3} src={tbgIcon3} />
+          </div>
+
           <div class={styles.scTop}>
             <div>参与学校</div><span>{formatNumberWithComma(forms.totalInfo.schoolNum || 0)}</span><i>所</i>
           </div>

+ 1 - 1
vite.config.ts

@@ -14,7 +14,7 @@ function resolve(dir: string) {
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
 // const proxyUrl = 'https://test.lexiaoya.cn/';
-const proxyUrl = 'https://dev.kt.colexiu.com/';
+const proxyUrl = 'https://test.kt.colexiu.com/';
 // const proxyUrl = 'http://192.168.3.143:7093/';
 // const proxyUrl = 'https://dev.kt.colexiu.com/';
 export default defineConfig({